UNPKG

@mediapipe/tasks-vision

Version:

MediaPipe Vision Tasks

1 lines 138 kB
"use strict";function t(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}Object.defineProperty(exports,"__esModule",{value:!0});var e="undefined"!=typeof self?self:{};function n(t,n){t:{for(var r=["CLOSURE_FLAGS"],i=e,s=0;s<r.length;s++)if(null==(i=i[r[s]])){r=null;break t}r=i}return null!=(t=r&&r[t])?t:n}function r(){throw Error("Invalid UTF8")}function i(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}let s,o;const a="undefined"!=typeof TextDecoder;let c;const h="undefined"!=typeof TextEncoder;function u(t){if(h)t=(c||=new TextEncoder).encode(t);else{let n=0;const r=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(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){const 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}function l(t){e.setTimeout((()=>{throw t}),0)}var f,d=n(610401301,!1),p=n(748402147,!0);function g(){var t=e.navigator;return t&&(t=t.userAgent)?t:""}const m=e.navigator;function y(t){return y[" "](t),t}f=m&&m.userAgentData||null,y[" "]=function(){};const _={};let v=null;function E(t){const e=t.length;let n=3*e/4;n%3?n=Math.floor(n):-1!="=.".indexOf(t[e-1])&&(n=-1!="=.".indexOf(t[e-2])?n-2:n-1);const r=new Uint8Array(n);let i=0;return function(t,e){function n(e){for(;r<t.length;){const e=t.charAt(r++),n=v[e];if(null!=n)return n;if(!/^[\s\xa0]*$/.test(e))throw Error("Unknown base64 encoding at char: "+e)}return e}w();let r=0;for(;;){const t=n(-1),r=n(0),i=n(64),s=n(64);if(64===s&&-1===t)break;e(t<<2|r>>4),64!=i&&(e(r<<4&240|i>>2),64!=s&&e(i<<6&192|s))}}(t,(function(t){r[i++]=t})),i!==n?r.subarray(0,i):r}function w(){if(!v){v={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let n=0;n<5;n++){const r=t.concat(e[n].split(""));_[n]=r;for(let t=0;t<r.length;t++){const e=r[t];void 0===v[e]&&(v[e]=t)}}}}var T="undefined"!=typeof Uint8Array,A=!(!(d&&f&&f.brands.length>0)&&(-1!=g().indexOf("Trident")||-1!=g().indexOf("MSIE")))&&"function"==typeof btoa;const b=/[-_.]/g,k={"-":"+",_:"/",".":"="};function x(t){return k[t]||""}function S(t){if(!A)return E(t);t=b.test(t)?t.replace(b,x):t,t=atob(t);const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function L(t){return T&&null!=t&&t instanceof Uint8Array}var R={};function I(){return M||=new P(null,R)}function F(t){C(R);var e=t.g;return null==(e=null==e||L(e)?e:"string"==typeof e?S(e):null)?e:t.g=e}var P=class{h(){return new Uint8Array(F(this)||0)}constructor(t,e){if(C(e),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};let M,O;function C(t){if(t!==R)throw Error("illegal external caller")}function N(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function U(t){return N(t=Error(t),"warning"),t}function D(t,e){if(null!=t){var n=O??={},r=n[t]||0;r>=e||(n[t]=r+1,N(t=Error(),"incident"),l(t))}}function B(){return"function"==typeof BigInt}var G="function"==typeof Symbol&&"symbol"==typeof Symbol();function j(t,e,n=!1){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?n&&Symbol.for&&t?Symbol.for(t):null!=t?Symbol(t):Symbol():e}var V=j("jas",void 0,!0),X=j(void 0,"0di"),H=j(void 0,"1oa"),W=j(void 0,Symbol()),z=j(void 0,"0ub"),K=j(void 0,"0ubs"),Y=j(void 0,"0ubsb"),q=j(void 0,"0actk"),$=j("m_m","Pa",!0),J=j();const Z={Ga:{value:0,configurable:!0,writable:!0,enumerable:!1}},Q=Object.defineProperties,tt=G?V:"Ga";var et;const nt=[];function rt(t,e){G||tt in t||Q(t,Z),t[tt]|=e}function it(t,e){G||tt in t||Q(t,Z),t[tt]=e}function st(t){return rt(t,34),t}function ot(t){return rt(t,8192),t}it(nt,7),et=Object.freeze(nt);var at={};function ct(t,e){return void 0===e?t.h!==ht&&!!(2&(0|t.v[tt])):!!(2&e)&&t.h!==ht}const ht={};function ut(t,e){if(null!=t)if("string"==typeof t)t=t?new P(t,R):I();else if(t.constructor!==P)if(L(t))t=t.length?new P(new Uint8Array(t),R):I();else{if(!e)throw Error();t=void 0}return t}class lt{constructor(t,e,n){this.g=t,this.h=e,this.l=n}next(){const t=this.g.next();return t.done||(t.value=this.h.call(this.l,t.value)),t}[Symbol.iterator](){return this}}var ft=Object.freeze({});function dt(t,e,n){const r=128&e?0:-1,i=t.length;var s;(s=!!i)&&(s=null!=(s=t[i-1])&&"object"==typeof s&&s.constructor===Object);const o=i+(s?-1:0);for(e=128&e?1:0;e<o;e++)n(e-r,t[e]);if(s){t=t[i-1];for(const e in t)!isNaN(e)&&n(+e,t[e])}}var pt={};function gt(t){return 128&t?pt:void 0}function mt(t){return t.Na=!0,t}var yt=mt((t=>"number"==typeof t)),_t=mt((t=>"string"==typeof t)),vt=mt((t=>"boolean"==typeof t)),Et="function"==typeof e.BigInt&&"bigint"==typeof e.BigInt(0);function wt(t){var e=t;if(_t(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(yt(e)&&!Number.isSafeInteger(e))throw Error(String(e));return Et?BigInt(t):t=vt(t)?t?"1":"0":_t(t)?t.trim()||"0":String(t)}var Tt=mt((t=>Et?t>=bt&&t<=xt:"-"===t[0]?St(t,At):St(t,kt)));const At=Number.MIN_SAFE_INTEGER.toString(),bt=Et?BigInt(Number.MIN_SAFE_INTEGER):void 0,kt=Number.MAX_SAFE_INTEGER.toString(),xt=Et?BigInt(Number.MAX_SAFE_INTEGER):void 0;function St(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++){const r=t[n],i=e[n];if(r>i)return!1;if(r<i)return!0}}const Lt="function"==typeof Uint8Array.prototype.slice;let Rt,It=0,Ft=0;function Pt(t){const e=t>>>0;It=e,Ft=(t-e)/4294967296>>>0}function Mt(t){if(t<0){Pt(-t);const[e,n]=Vt(It,Ft);It=e>>>0,Ft=n>>>0}else Pt(t)}function Ot(t){const e=Rt||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),Ft=0,It=e.getUint32(0,!0)}function Ct(t,e){const n=4294967296*e+(t>>>0);return Number.isSafeInteger(n)?n:Dt(t,e)}function Nt(t,e){return wt(B()?BigInt.asUintN(64,(BigInt(e>>>0)<<BigInt(32))+BigInt(t>>>0)):Dt(t,e))}function Ut(t,e){return B()?wt(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(e))<<BigInt(32))+BigInt.asUintN(32,BigInt(t)))):wt(Gt(t,e))}function Dt(t,e){if(t>>>=0,(e>>>=0)<=2097151)var n=""+(4294967296*e+t);else B()?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+Bt(n)+Bt(t));return n}function Bt(t){return t=String(t),"0000000".slice(t.length)+t}function Gt(t,e){if(2147483648&e)if(B())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,r]=Vt(t,e);t="-"+Dt(n,r)}else t=Dt(t,e);return t}function jt(t){if(t.length<16)Mt(Number(t));else if(B())t=BigInt(t),It=Number(t&BigInt(4294967295))>>>0,Ft=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);Ft=It=0;const n=t.length;for(let r=e,i=(n-e)%6+e;i<=n;r=i,i+=6){const e=Number(t.slice(r,i));Ft*=1e6,It=1e6*It+e,It>=4294967296&&(Ft+=Math.trunc(It/4294967296),Ft>>>=0,It>>>=0)}if(e){const[t,e]=Vt(It,Ft);It=t,Ft=e}}}function Vt(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function Xt(t){return Array.prototype.slice.call(t)}const Ht="function"==typeof BigInt?BigInt.asIntN:void 0,Wt="function"==typeof BigInt?BigInt.asUintN:void 0,zt=Number.isSafeInteger,Kt=Number.isFinite,Yt=Math.trunc,qt=wt(0);function $t(t){if(null!=t&&"number"!=typeof t)throw Error(`Value of float/double field must be a number, found ${typeof t}: ${t}`);return t}function Jt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function Zt(t){if(null!=t&&"boolean"!=typeof t){var e=typeof t;throw Error(`Expected boolean but got ${"object"!=e?e:t?Array.isArray(t)?"array":e:"null"}: ${t}`)}return t}function Qt(t){return null==t||"boolean"==typeof t?t:"number"==typeof t?!!t:void 0}const te=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function ee(t){switch(typeof t){case"bigint":return!0;case"number":return Kt(t);case"string":return te.test(t);default:return!1}}function ne(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Kt(t)?0|t:void 0}function re(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Kt(t)?t>>>0:void 0}function ie(t){const e=t.length;return("-"===t[0]?e<20||20===e&&t<="-9223372036854775808":e<19||19===e&&t<="9223372036854775807")?t:(jt(t),Gt(It,Ft))}function se(t){if(t=Yt(t),!zt(t)){Mt(t);var e=It,n=Ft;(t=2147483648&n)&&(n=~n>>>0,0==(e=1+~e>>>0)&&(n=n+1>>>0)),t="number"==typeof(e=Ct(e,n))?t?-e:e:t?"-"+e:e}return t}function oe(t){var e=Yt(Number(t));return zt(e)?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),ie(t))}function ae(t){var e=Yt(Number(t));return zt(e)?wt(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),B()?wt(Ht(64,BigInt(t))):wt(ie(t)))}function ce(t){return zt(t)?t=wt(se(t)):(t=Yt(t),zt(t)?t=String(t):(Mt(t),t=Gt(It,Ft)),t=wt(t)),t}function he(t){const e=typeof t;return null==t?t:"bigint"===e?wt(Ht(64,t)):ee(t)?"string"===e?ae(t):ce(t):void 0}function ue(t){if("string"!=typeof t)throw Error();return t}function le(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function fe(t){return null==t||"string"==typeof t?t:void 0}function de(t,e,n,r){return null!=t&&t[$]===at?t:Array.isArray(t)?((r=(n=0|t[tt])|32&r|2&r)!==n&&it(t,r),new e(t)):(n?2&r?((t=e[X])||(st((t=new e).v),t=e[X]=t),e=t):e=new e:e=void 0,e)}function pe(t,e,n){if(e)t:{if(!ee(e=t))throw U("int64");switch(typeof e){case"string":e=ae(e);break t;case"bigint":e=wt(Ht(64,e));break t;default:e=ce(e)}}else e=he(t);return null==(t=e)?n?qt:void 0:t}const ge={};let me=function(){try{return y(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class ye{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,e){return this.g.set(t,e),this.size=this.g.size,this}delete(t){return t=this.g.delete(t),this.size=this.g.size,t}clear(){this.g.clear(),this.size=this.g.size}has(t){return this.g.has(t)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(t,e){return this.g.forEach(t,e)}[Symbol.iterator](){return this.entries()}}const _e=me?(Object.setPrototypeOf(ye.prototype,Map.prototype),Object.defineProperties(ye.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),ye):class extends Map{constructor(){super()}};function ve(t){return t}function Ee(t){if(2&t.J)throw Error("Cannot mutate an immutable Map")}var we=class extends _e{constructor(t,e,n=ve,r=ve){super(),this.J=0|t[tt],this.K=e,this.S=n,this.fa=this.K?Te:r;for(let i=0;i<t.length;i++){const s=t[i],o=n(s[0],!1,!0);let a=s[1];e?void 0===a&&(a=null):a=r(s[1],!1,!0,void 0,void 0,this.J),super.set(o,a)}}V(t){return ot(Array.from(super.entries(),t))}clear(){Ee(this),super.clear()}delete(t){return Ee(this),super.delete(this.S(t,!0,!1))}entries(){if(this.K){var t=super.keys();t=new lt(t,Ae,this)}else t=super.entries();return t}values(){if(this.K){var t=super.keys();t=new lt(t,we.prototype.get,this)}else t=super.values();return t}forEach(t,e){this.K?super.forEach(((n,r,i)=>{t.call(e,i.get(r),r,i)})):super.forEach(t,e)}set(t,e){return Ee(this),null==(t=this.S(t,!0,!1))?this:null==e?(super.delete(t),this):super.set(t,this.fa(e,!0,!0,this.K,!1,this.J))}Ma(t){const e=this.S(t[0],!1,!0);t=t[1],t=this.K?void 0===t?null:t:this.fa(t,!1,!0,void 0,!1,this.J),super.set(e,t)}has(t){return super.has(this.S(t,!1,!1))}get(t){t=this.S(t,!1,!1);const e=super.get(t);if(void 0!==e){var n=this.K;return n?((n=this.fa(e,!1,!0,n,this.ra,this.J))!==e&&super.set(t,n),n):e}}[Symbol.iterator](){return this.entries()}};function Te(t,e,n,r,i,s){return t=de(t,r,n,s),i&&(t=He(t)),t}function Ae(t){return[t,this.get(t)]}let be;function ke(){return be||=new we(st([]),void 0,void 0,void 0,ge)}function xe(t){return W?t[W]:void 0}function Se(t,e){for(const n in t)!isNaN(n)&&e(t,+n,t[n])}we.prototype.toJSON=void 0;var Le=class{};const Re={Ka:!0};function Ie(t,e){e<100||D(K,1)}function Fe(t,e,n,r){const i=void 0!==r;r=!!r;var s,o=W;!i&&G&&o&&(s=t[o])&&Se(s,Ie),o=[];var a=t.length;let c;s=4294967295;let h=!1;const u=!!(64&e),l=u?128&e?0:-1:void 0;1&e||(c=a&&t[a-1],null!=c&&"object"==typeof c&&c.constructor===Object?s=--a:c=void 0,!u||128&e||i||(h=!0,s=s-l+l)),e=void 0;for(var f=0;f<a;f++){let i=t[f];if(null!=i&&null!=(i=n(i,r)))if(u&&f>=s){const t=f-l;(e??={})[t]=i}else o[f]=i}if(c)for(let t in c){if(null==(a=c[t])||null==(a=n(a,r)))continue;let i;f=+t,u&&!Number.isNaN(f)&&(i=f+l)<s?o[i]=a:(e??={})[t]=a}return e&&(h?o.push(e):o[s]=e),i&&W&&(t=xe(t))&&t instanceof Le&&(o[W]=function(t){const e=new Le;return Se(t,((t,n,r)=>{e[n]=Xt(r)})),e.da=t.da,e}(t)),o}function Pe(t){return t[0]=Me(t[0]),t[1]=Me(t[1]),t}function Me(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return Tt(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(Array.isArray(t)){var e=0|t[tt];return 0===t.length&&1&e?void 0:Fe(t,e,Me)}if(null!=t&&t[$]===at)return Ne(t);if(t instanceof P){if(null==(e=t.g))t="";else if("string"==typeof e)t=e;else{if(A){for(var n="",r=0,i=e.length-10240;r<i;)n+=String.fromCharCode.apply(null,e.subarray(r,r+=10240));n+=String.fromCharCode.apply(null,r?e.subarray(r):e),e=btoa(n)}else{void 0===n&&(n=0),w(),n=_[n],r=Array(Math.floor(e.length/3)),i=n[64]||"";let t=0,h=0;for(;t<e.length-2;t+=3){var s=e[t],o=e[t+1],a=e[t+2],c=n[s>>2];s=n[(3&s)<<4|o>>4],o=n[(15&o)<<2|a>>6],a=n[63&a],r[h++]=c+s+o+a}switch(c=0,a=i,e.length-t){case 2:a=n[(15&(c=e[t+1]))<<2]||i;case 1:e=e[t],r[h]=n[e>>2]+n[(3&e)<<4|c>>4]+a+i}e=r.join("")}t=t.g=e}return t}return t instanceof we?t=0!==t.size?t.V(Pe):void 0:void 0}return t}let Oe,Ce;function Ne(t){return Fe(t=t.v,0|t[tt],Me)}function Ue(t,e){return De(t,e[0],e[1])}function De(t,e,n,r=0){if(null==t){var i=32;n?(t=[n],i|=128):t=[],e&&(i=-16760833&i|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(i=0|t[tt],p&&1&i)throw Error("rfarr");if(2048&i&&!(2&i)&&function(){if(p)throw Error("carr");D(q,5)}(),256&i)throw Error("farr");if(64&i)return(i|r)!==i&&it(t,i|r),t;if(n&&(i|=128,n!==t[0]))throw Error("mid");t:{i|=64;var s=(n=t).length;if(s){var o=s-1;const t=n[o];if(null!=t&&"object"==typeof t&&t.constructor===Object){if((o-=e=128&i?0:-1)>=1024)throw Error("pvtlmt");for(var a in t)(s=+a)<o&&(n[s+e]=t[a],delete t[a]);i=-16760833&i|(1023&o)<<14;break t}}if(e){if((a=Math.max(e,s-(128&i?0:-1)))>1024)throw Error("spvt");i=-16760833&i|(1023&a)<<14}}}return it(t,64|i|r),t}function Be(t,e){if("object"!=typeof t)return t;if(Array.isArray(t)){var n=0|t[tt];return 0===t.length&&1&n?void 0:Ge(t,n,e)}if(null!=t&&t[$]===at)return Ve(t);if(t instanceof we){if(2&(e=t.J))return t;if(!t.size)return;if(n=st(t.V()),t.K)for(t=0;t<n.length;t++){const r=n[t];let i=r[1];i=null==i||"object"!=typeof i?void 0:null!=i&&i[$]===at?Ve(i):Array.isArray(i)?Ge(i,0|i[tt],!!(32&e)):void 0,r[1]=i}return n}return t instanceof P?t:void 0}function Ge(t,e,n){return 2&e||(!n||4096&e||16&e?t=Xe(t,e,!1,n&&!(16&e)):(rt(t,34),4&e&&Object.freeze(t))),t}function je(t,e,n){return t=new t.constructor(e),n&&(t.h=ht),t.m=ht,t}function Ve(t){const e=t.v,n=0|e[tt];return ct(t,n)?t:Ye(t,e,n)?je(t,e):Xe(e,n)}function Xe(t,e,n,r){return r??=!!(34&e),t=Fe(t,e,Be,r),r=32,n&&(r|=2),it(t,e=16769217&e|r),t}function He(t){const e=t.v,n=0|e[tt];return ct(t,n)?Ye(t,e,n)?je(t,e,!0):new t.constructor(Xe(e,n,!1)):t}function We(t){if(t.h!==ht)return!1;var e=t.v;return rt(e=Xe(e,0|e[tt]),2048),t.v=e,t.h=void 0,t.m=void 0,!0}function ze(t){if(!We(t)&&ct(t,0|t.v[tt]))throw Error()}function Ke(t,e){void 0===e&&(e=0|t[tt]),32&e&&!(4096&e)&&it(t,4096|e)}function Ye(t,e,n){return!!(2&n)||!(!(32&n)||4096&n)&&(it(e,2|n),t.h=ht,!0)}const qe=wt(0),$e={};function Je(t,e,n,r,i){if(null!==(e=Ze(t.v,e,n,i))||r&&t.m!==ht)return e}function Ze(t,e,n,r){if(-1===e)return null;const i=e+(n?0:-1),s=t.length-1;let o,a;if(!(s<1+(n?0:-1))){if(i>=s)if(o=t[s],null!=o&&"object"==typeof o&&o.constructor===Object)n=o[e],a=!0;else{if(i!==s)return;n=o}else n=t[i];if(r&&null!=n){if(null==(r=r(n)))return r;if(!Object.is(r,n))return a?o[e]=r:t[i]=r,r}return n}}function Qe(t,e,n,r){ze(t),tn(t=t.v,0|t[tt],e,n,r)}function tn(t,e,n,r,i){const s=n+(i?0:-1);var o=t.length-1;if(o>=1+(i?0:-1)&&s>=o){const i=t[o];if(null!=i&&"object"==typeof i&&i.constructor===Object)return i[n]=r,e}return s<=o?(t[s]=r,e):(void 0!==r&&(n>=(o=(e??=0|t[tt])>>14&1023||536870912)?null!=r&&(t[o+(i?0:-1)]={[n]:r}):t[s]=r),e)}function en(){return void 0===ft?2:4}function nn(t,e,n,r,i){let s=t.v,o=0|s[tt];r=ct(t,o)?1:r,i=!!i||3===r,2===r&&We(t)&&(s=t.v,o=0|s[tt]);let a=(t=sn(s,e))===et?7:0|t[tt],c=on(a,o);var h=!(4&c);if(h){4&c&&(t=Xt(t),a=0,c=bn(c,o),o=tn(s,o,e,t));let r=0,i=0;for(;r<t.length;r++){const e=n(t[r]);null!=e&&(t[i++]=e)}i<r&&(t.length=i),n=-513&(4|c),c=n&=-1025,c&=-4097}return c!==a&&(it(t,c),2&c&&Object.freeze(t)),rn(t,c,s,o,e,r,h,i)}function rn(t,e,n,r,i,s,o,a){let c=e;return 1===s||4===s&&(2&e||!(16&e)&&32&r)?an(e)||((e|=!t.length||o&&!(4096&e)||32&r&&!(4096&e||16&e)?2:256)!==c&&it(t,e),Object.freeze(t)):(2===s&&an(e)&&(t=Xt(t),c=0,e=bn(e,r),r=tn(n,r,i,t)),an(e)||(a||(e|=16),e!==c&&it(t,e))),2&e||!(4096&e||16&e)||Ke(n,r),t}function sn(t,e,n){return t=Ze(t,e,n),Array.isArray(t)?t:et}function on(t,e){return 2&e&&(t|=2),1|t}function an(t){return!!(2&t)&&!!(4&t)||!!(256&t)}function cn(t){return ut(t,!0)}function hn(t){t=Xt(t);for(let e=0;e<t.length;e++){const n=t[e]=Xt(t[e]);Array.isArray(n[1])&&(n[1]=st(n[1]))}return ot(t)}function un(t,e,n,r){ze(t),tn(t=t.v,0|t[tt],e,("0"===r?0===Number(n):n===r)?void 0:n)}function ln(t,e,n){if(2&e)throw Error();const r=gt(e);let i=sn(t,n,r),s=i===et?7:0|i[tt],o=on(s,e);return(2&o||an(o)||16&o)&&(o===s||an(o)||it(i,o),i=Xt(i),s=0,o=bn(o,e),tn(t,e,n,i,r)),o&=-13,o!==s&&it(i,o),i}function fn(t,e){var n=Cs;return gn(dn(t=t.v),t,void 0,n)===e?e:-1}function dn(t){if(G)return t[H]??(t[H]=new Map);if(H in t)return t[H];const e=new Map;return Object.defineProperty(t,H,{value:e}),e}function pn(t,e,n,r,i){const s=dn(t),o=gn(s,t,e,n,i);return o!==r&&(o&&(e=tn(t,e,o,void 0,i)),s.set(n,r)),e}function gn(t,e,n,r,i){let s=t.get(r);if(null!=s)return s;s=0;for(let t=0;t<r.length;t++){const o=r[t];null!=Ze(e,o,i)&&(0!==s&&(n=tn(e,n,s,void 0,i)),s=o)}return t.set(r,s),s}function mn(t,e,n){let r=0|t[tt];const i=gt(r),s=Ze(t,n,i);let o;if(null!=s&&s[$]===at){if(!ct(s))return We(s),s.v;o=s.v}else Array.isArray(s)&&(o=s);if(o){const t=0|o[tt];2&t&&(o=Xe(o,t))}return o=Ue(o,e),o!==s&&tn(t,r,n,o,i),o}function yn(t,e,n,r,i){let s=!1;if(null!=(r=Ze(t,r,i,(t=>{const r=de(t,n,!1,e);return s=r!==t&&null!=r,r}))))return s&&!ct(r)&&Ke(t,e),r}function _n(t,e,n,r){let i=t.v,s=0|i[tt];if(null==(e=yn(i,s,e,n,r)))return e;if(s=0|i[tt],!ct(t,s)){const o=He(e);o!==e&&(We(t)&&(i=t.v,s=0|i[tt]),s=tn(i,s,n,e=o,r),Ke(i,s))}return e}function vn(t,e,n,r,i,s,o,a){var c=ct(t,n);s=c?1:s,o=!!o||3===s,c=a&&!c,(2===s||c)&&We(t)&&(n=0|(e=t.v)[tt]);var h=(t=sn(e,i))===et?7:0|t[tt],u=on(h,n);if(a=!(4&u)){var l=t,f=n;const e=!!(2&u);e&&(f|=2);let i=!e,s=!0,o=0,a=0;for(;o<l.length;o++){const t=de(l[o],r,!1,f);if(t instanceof r){if(!e){const e=ct(t);i&&=!e,s&&=e}l[a++]=t}}a<o&&(l.length=a),u|=4,u=s?-4097&u:4096|u,u=i?8|u:-9&u}if(u!==h&&(it(t,u),2&u&&Object.freeze(t)),c&&!(8&u||!t.length&&(1===s||4===s&&(2&u||!(16&u)&&32&n)))){for(an(u)&&(t=Xt(t),u=bn(u,n),n=tn(e,n,i,t)),r=t,c=u,h=0;h<r.length;h++)(l=r[h])!==(u=He(l))&&(r[h]=u);c|=8,it(t,u=c=r.length?4096|c:-4097&c)}return rn(t,u,e,n,i,s,a,o)}function En(t,e,n){const r=t.v;return vn(t,r,0|r[tt],e,n,en(),!1,!0)}function wn(t){return null==t&&(t=void 0),t}function Tn(t,e,n,r,i){return Qe(t,n,r=wn(r),i),r&&!ct(r)&&Ke(t.v),t}function An(t,e,n,r){t:{var i=r=wn(r);ze(t);const s=t.v;let o=0|s[tt];if(null==i){const t=dn(s);if(gn(t,s,o,n)!==e)break t;t.set(n,0)}else o=pn(s,o,n,e);tn(s,o,e,i)}r&&!ct(r)&&Ke(t.v)}function bn(t,e){return-273&(2&e?2|t:-3&t)}function kn(t,e,n,r){var i=r;ze(t),t=vn(t,r=t.v,0|r[tt],n,e,2,!0),i=null!=i?i:new n,t.push(i),e=n=t===et?7:0|t[tt],(i=ct(i))?(n&=-9,1===t.length&&(n&=-4097)):n|=4096,n!==e&&it(t,n),i||Ke(r)}function xn(t,e,n){return ne(Je(t,e,void 0,n))}function Sn(t,e){return Je(t,e,void 0,void 0,Jt)??0}function Ln(t,e,n){if(null!=n){if("number"!=typeof n)throw U("int32");if(!Kt(n))throw U("int32");n|=0}Qe(t,e,n)}function Rn(t,e,n){Qe(t,e,$t(n))}function In(t,e,n){un(t,e,le(n),"")}function Fn(t,e,n){{ze(t);const o=t.v;let a=0|o[tt];if(null==n)tn(o,a,e);else{var r=t=n===et?7:0|n[tt],i=an(t),s=i||Object.isFrozen(n);for(i||(t=0),s||(n=Xt(n),r=0,t=bn(t,a),s=!1),t|=5,t|=(4&t?512&t?512:1024&t?1024:0:void 0)??1024,i=0;i<n.length;i++){const e=n[i],o=ue(e);Object.is(e,o)||(s&&(n=Xt(n),r=0,t=bn(t,a),s=!1),n[i]=o)}t!==r&&(s&&(n=Xt(n),t=bn(t,a)),it(n,t)),tn(o,a,e,n)}}}function Pn(t,e,n){ze(t),nn(t,e,fe,2,!0).push(ue(n))}var Mn=class{constructor(t,e,n){if(this.buffer=t,n&&!e)throw Error();this.g=e}};function On(t,e){if("string"==typeof t)return new Mn(S(t),e);if(Array.isArray(t))return new Mn(new Uint8Array(t),e);if(t.constructor===Uint8Array)return new Mn(t,!1);if(t.constructor===ArrayBuffer)return t=new Uint8Array(t),new Mn(t,!1);if(t.constructor===P)return e=F(t)||new Uint8Array(0),new Mn(e,!0,t);if(t instanceof Uint8Array)return t=t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Mn(t,!1);throw Error()}function Cn(t,e){let n,r=0,i=0,s=0;const o=t.h;let a=t.g;do{n=o[a++],r|=(127&n)<<s,s+=7}while(s<32&&128&n);if(s>32)for(i|=(127&n)>>4,s=3;s<32&&128&n;s+=7)n=o[a++],i|=(127&n)<<s;if(jn(t,a),!(128&n))return e(r>>>0,i>>>0);throw Error()}function Nn(t){let e=0,n=t.g;const r=n+10,i=t.h;for(;n<r;){const r=i[n++];if(e|=r,0==(128&r))return jn(t,n),!!(127&e)}throw Error()}function Un(t){const e=t.h;let n=t.g,r=e[n++],i=127&r;if(128&r&&(r=e[n++],i|=(127&r)<<7,128&r&&(r=e[n++],i|=(127&r)<<14,128&r&&(r=e[n++],i|=(127&r)<<21,128&r&&(r=e[n++],i|=r<<28,128&r&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++])))))throw Error();return jn(t,n),i}function Dn(t){return Un(t)>>>0}function Bn(t){var e=t.h;const n=t.g;var r=e[n],i=e[n+1];const s=e[n+2];return e=e[n+3],jn(t,t.g+4),t=2*((i=(r<<0|i<<8|s<<16|e<<24)>>>0)>>31)+1,r=i>>>23&255,i&=8388607,255==r?i?NaN:t*(1/0):0==r?1401298464324817e-60*t*i:t*Math.pow(2,r-150)*(i+8388608)}function Gn(t){return Un(t)}function jn(t,e){if(t.g=e,e>t.l)throw Error()}function Vn(t,e){if(e<0)throw Error();const n=t.g;if((e=n+e)>t.l)throw Error();return t.g=e,n}function Xn(t,e){if(0==e)return I();var n=Vn(t,e);return t.Y&&t.j?n=t.h.subarray(n,n+e):(t=t.h,n=n===(e=n+e)?new Uint8Array(0):Lt?t.slice(n,e):new Uint8Array(t.subarray(n,e))),0==n.length?I():new P(n,R)}var Hn=[];function Wn(t,e,n,r){if(tr.length){const i=tr.pop();return i.o(r),i.g.init(t,e,n,r),i}return new Qn(t,e,n,r)}function zn(t){t.g.clear(),t.l=-1,t.h=-1,tr.length<100&&tr.push(t)}function Kn(t){var e=t.g;if(e.g==e.l)return!1;t.m=t.g.g;var n=Dn(t.g);if(e=n>>>3,!((n&=7)>=0&&n<=5))throw Error();if(e<1)throw Error();return t.l=e,t.h=n,!0}function Yn(t){switch(t.h){case 0:0!=t.h?Yn(t):Nn(t.g);break;case 1:jn(t=t.g,t.g+8);break;case 2:if(2!=t.h)Yn(t);else{var e=Dn(t.g);jn(t=t.g,t.g+e)}break;case 5:jn(t=t.g,t.g+4);break;case 3:for(e=t.l;;){if(!Kn(t))throw Error();if(4==t.h){if(t.l!=e)throw Error();break}Yn(t)}break;default:throw Error()}}function qn(t,e,n){const r=t.g.l;var i=Dn(t.g);let s=(i=t.g.g+i)-r;if(s<=0&&(t.g.l=i,n(e,t,void 0,void 0,void 0),s=i-t.g.g),s)throw Error();return t.g.g=i,t.g.l=r,e}function $n(t){var e=Dn(t.g),n=Vn(t=t.g,e);if(t=t.h,a){var c,h=t;(c=o)||(c=o=new TextDecoder("utf-8",{fatal:!0})),e=n+e,h=0===n&&e===h.length?h:h.subarray(n,e);try{var u=c.decode(h)}catch(t){if(void 0===s){try{c.decode(new Uint8Array([128]))}catch(t){}try{c.decode(new Uint8Array([97])),s=!0}catch(t){s=!1}}throw!s&&(o=void 0),t}}else{e=(u=n)+e,n=[];let s,o=null;for(;u<e;){var l=t[u++];l<128?n.push(l):l<224?u>=e?r():(s=t[u++],l<194||128!=(192&s)?(u--,r()):n.push((31&l)<<6|63&s)):l<240?u>=e-1?r():(s=t[u++],128!=(192&s)||224===l&&s<160||237===l&&s>=160||128!=(192&(c=t[u++]))?(u--,r()):n.push((15&l)<<12|(63&s)<<6|63&c)):l<=244?u>=e-2?r():(s=t[u++],128!=(192&s)||s-144+(l<<28)>>30!=0||128!=(192&(c=t[u++]))||128!=(192&(h=t[u++]))?(u--,r()):(l=(7&l)<<18|(63&s)<<12|(63&c)<<6|63&h,l-=65536,n.push(55296+(l>>10&1023),56320+(1023&l)))):r(),n.length>=8192&&(o=i(o,n),n.length=0)}u=i(o,n)}return u}function Jn(t){const e=Dn(t.g);return Xn(t.g,e)}function Zn(t,e,n){var r=Dn(t.g);for(r=t.g.g+r;t.g.g<r;)n.push(e(t.g))}var Qn=class{constructor(t,e,n,r){if(Hn.length){const i=Hn.pop();i.init(t,e,n,r),t=i}else t=new class{constructor(t,e,n,r){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.init(t,e,n,r)}init(t,e,n,{Y:r=!1,ea:i=!1}={}){this.Y=r,this.ea=i,t&&(t=On(t,this.ea),this.h=t.buffer,this.j=t.g,this.m=e||0,this.l=void 0!==n?this.m+n:this.h.length,this.g=this.m)}clear(){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.Y=!1}}(t,e,n,r);this.g=t,this.m=this.g.g,this.h=this.l=-1,this.o(r)}o({ha:t=!1}={}){this.ha=t}},tr=[];function er(t){return t?/^\d+$/.test(t)?(jt(t),new nr(It,Ft)):null:rr||=new nr(0,0)}var nr=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let rr;function ir(t){return t?/^-?\d+$/.test(t)?(jt(t),new sr(It,Ft)):null:or||=new sr(0,0)}var sr=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let or;function ar(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 cr(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function hr(t,e){if(e>=0)cr(t,e);else{for(let n=0;n<9;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function ur(t){var e=It;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 lr(t,e){0!==e.length&&(t.l.push(e),t.h+=e.length)}function fr(t,e,n){cr(t.g,8*e+n)}function dr(t,e){return fr(t,e,2),e=t.g.end(),lr(t,e),e.push(t.h),e}function pr(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 gr(t,e,n){fr(t,e,2),cr(t.g,n.length),lr(t,t.g.end()),lr(t,n)}function mr(t,e,n,r){null!=n&&(e=dr(t,e),r(n,t),pr(t,e))}function yr(){const t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var _r=yr(),vr=yr(),Er=yr(),wr=yr(),Tr=yr(),Ar=yr(),br=yr(),kr=yr(),xr=yr(),Sr=yr();function Lr(t,e,n){var r=t.v;W&&W in r&&(r=r[W])&&delete r[e.g],e.h?e.j(t,e.h,e.g,n,e.l):e.j(t,e.g,n,e.l)}var Rr=class{constructor(t,e){this.v=De(t,e,void 0,2048)}toJSON(){return Ne(this)}j(){var t=Lo,e=this.v,n=t.g,r=W;if(G&&r&&null!=e[r]?.[n]&&D(z,3),e=t.g,J&&W&&void 0===J&&(r=(n=this.v)[W])&&(r=r.da))try{r(n,e,Re)}catch(t){l(t)}return t.h?t.m(this,t.h,t.g,t.l):t.m(this,t.g,t.defaultValue,t.l)}clone(){const t=this.v,e=0|t[tt];return Ye(this,t,e)?je(this,t,!0):new this.constructor(Xe(t,e,!1))}};Rr.prototype[$]=at,Rr.prototype.toString=function(){return this.v.toString()};var Ir=class{constructor(t,e,n){this.g=t,this.h=e,t=_r,this.l=!!t&&n===t||!1}};function Fr(t,e){return new Ir(t,e,_r)}function Pr(t,e,n,r,i){mr(t,n,Hr(e,r),i)}const Mr=Fr((function(t,e,n,r,i){return 2===t.h&&(qn(t,mn(e,r,n),i),!0)}),Pr),Or=Fr((function(t,e,n,r,i){return 2===t.h&&(qn(t,mn(e,r,n),i),!0)}),Pr);var Cr=Symbol(),Nr=Symbol(),Ur=Symbol(),Dr=Symbol(),Br=Symbol();let Gr,jr;function Vr(t,e,n,r){var i=r[t];if(i)return i;(i={}).qa=r,i.T=function(t){switch(typeof t){case"boolean":return Oe||=[0,void 0,!0];case"number":return t>0?void 0:0===t?Ce||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(r[0]);var s=r[1];let o=1;s&&s.constructor===Object&&(i.ba=s,"function"==typeof(s=r[++o])&&(i.ma=!0,Gr??=s,jr??=r[o+1],s=r[o+=2]));const a={};for(;s&&Array.isArray(s)&&s.length&&"number"==typeof s[0]&&s[0]>0;){for(var c=0;c<s.length;c++)a[s[c]]=s;s=r[++o]}for(c=1;void 0!==s;){let t;"number"==typeof s&&(c+=s,s=r[++o]);var h=void 0;if(s instanceof Ir?t=s:(t=Mr,o--),t?.l){s=r[++o],h=r;var u=o;"function"==typeof s&&(s=s(),h[u]=s),h=s}for(u=c+1,"number"==typeof(s=r[++o])&&s<0&&(u-=s,s=r[++o]);c<u;c++){const r=a[c];h?n(i,c,t,h,r):e(i,c,t,r)}}return r[t]=i}function Xr(t){return Array.isArray(t)?t[0]instanceof Ir?t:[Or,t]:[t,void 0]}function Hr(t,e){return t instanceof Rr?t.v:Array.isArray(t)?Ue(t,e):void 0}function Wr(t,e,n,r){const i=n.g;t[e]=r?(t,e,n)=>i(t,e,n,r):i}function zr(t,e,n,r,i){const s=n.g;let o,a;t[e]=(t,e,n)=>s(t,e,n,a||=Vr(Nr,Wr,zr,r).T,o||=Kr(r),i)}function Kr(t){let e=t[Ur];if(null!=e)return e;const n=Vr(Nr,Wr,zr,t);return e=n.ma?(t,e)=>Gr(t,e,n):(t,e)=>{for(;Kn(e)&&4!=e.h;){var r=e.l,i=n[r];if(null==i){var s=n.ba;s&&(s=s[r])&&(null!=(s=qr(s))&&(i=n[r]=s))}if(null==i||!i(e,t,r)){if(i=(s=e).m,Yn(s),s.ha)var o=void 0;else o=s.g.g-i,s.g.g=i,o=Xn(s.g,o);i=void 0,s=t,o&&((i=s[W]??(s[W]=new Le))[r]??(i[r]=[])).push(o)}}return(t=xe(t))&&(t.da=n.qa[Br]),!0},t[Ur]=e,t[Br]=Yr.bind(t),e}function Yr(t,e,n,r){var i=this[Nr];const s=this[Ur],o=Ue(void 0,i.T),a=xe(t);if(a){var c=!1,h=i.ba;if(h){if(i=(e,n,i)=>{if(0!==i.length)if(h[n])for(const t of i){e=Wn(t);try{c=!0,s(o,e)}finally{zn(e)}}else r?.(t,n,i)},null==e)Se(a,i);else if(null!=a){const t=a[e];t&&i(a,e,t)}if(c){let r=0|t[tt];if(2&r&&2048&r&&!n?.Ka)throw Error();const i=gt(r),s=(e,s)=>{if(null!=Ze(t,e,i)){if(1===n?.Qa)return;throw Error()}null!=s&&(r=tn(t,r,e,s,i)),delete a[e]};null==e?dt(o,0|o[tt],((t,e)=>{s(t,e)})):s(e,Ze(o,e,i))}}}}function qr(t){const e=(t=Xr(t))[0].g;if(t=t[1]){const n=Kr(t),r=Vr(Nr,Wr,zr,t).T;return(t,i,s)=>e(t,i,s,r,n)}return e}function $r(t,e,n){t[e]=n.h}function Jr(t,e,n,r){let i,s;const o=n.h;t[e]=(t,e,n)=>o(t,e,n,s||=Vr(Cr,$r,Jr,r).T,i||=Zr(r))}function Zr(t){let e=t[Dr];if(!e){const n=Vr(Cr,$r,Jr,t);e=(t,e)=>Qr(t,e,n),t[Dr]=e}return e}function Qr(t,e,n){dt(t,0|t[tt],((t,r)=>{if(null!=r){var i=function(t,e){var n=t[e];if(n)return n;if((n=t.ba)&&(n=n[e])){var r=(n=Xr(n))[0].h;if(n=n[1]){const e=Zr(n),i=Vr(Cr,$r,Jr,n).T;n=t.ma?jr(i,e):(t,n,s)=>r(t,n,s,i,e)}else n=r;return t[e]=n}}(n,t);i?i(e,r,t):t<500||D(Y,3)}})),(t=xe(t))&&Se(t,((t,n,r)=>{for(lr(e,e.g.end()),t=0;t<r.length;t++)lr(e,F(r[t])||new Uint8Array(0))}))}const ti=wt(0);function ei(t,e){if(Array.isArray(e)){var n=0|e[tt];if(4&n)return e;for(var r=0,i=0;r<e.length;r++){const n=t(e[r]);null!=n&&(e[i++]=n)}return i<r&&(e.length=i),(t=-1537&(5|n))!==n&&it(e,t),2&t&&Object.freeze(e),e}}function ni(t,e,n){return new Ir(t,e,n)}function ri(t,e,n){return new Ir(t,e,n)}function ii(t,e,n){tn(t,0|t[tt],e,n,gt(0|t[tt]))}var si=Fr((function(t,e,n,r,i){if(2!==t.h)return!1;if(t=Xt(t=qn(t,Ue([void 0,void 0],r),i)),i=gt(r=0|e[tt]),2&r)throw Error();let s=Ze(e,n,i);if(s instanceof we)0!=(2&s.J)?(s=s.V(),s.push(t),tn(e,r,n,s,i)):s.Ma(t);else if(Array.isArray(s)){var o=0|s[tt];8192&o||it(s,o|=8192),2&o&&(s=hn(s),tn(e,r,n,s,i)),s.push(t)}else tn(e,r,n,ot([t]),i);return!0}),(function(t,e,n,r,i){if(e instanceof we)e.forEach(((e,s)=>{mr(t,n,Ue([s,e],r),i)}));else if(Array.isArray(e)){for(let s=0;s<e.length;s++){const o=e[s];Array.isArray(o)&&mr(t,n,Ue(o,r),i)}ot(e)}}));function oi(t,e,n){null!=(e=Jt(e))&&(fr(t,n,5),t=t.g,Ot(e),ur(t))}function ai(t,e,n){if(e=function(t){if(null==t)return t;const e=typeof t;if("bigint"===e)return String(Ht(64,t));if(ee(t)){if("string"===e)return oe(t);if("number"===e)return se(t)}}(e),null!=e){if("string"==typeof e)ir(e);if(null!=e)switch(fr(t,n,0),typeof e){case"number":t=t.g,Mt(e),ar(t,It,Ft);break;case"bigint":n=BigInt.asUintN(64,e),n=new sr(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),ar(t.g,n.h,n.g);break;default:n=ir(e),ar(t.g,n.h,n.g)}}}function ci(t,e,n){null!=(e=ne(e))&&null!=e&&(fr(t,n,0),hr(t.g,e))}function hi(t,e,n){null!=(e=Qt(e))&&(fr(t,n,0),t.g.g.push(e?1:0))}function ui(t,e,n){null!=(e=fe(e))&&gr(t,n,u(e))}function li(t,e,n,r,i){mr(t,n,Hr(e,r),i)}function fi(t,e,n){null!=(e=null==e||"string"==typeof e||e instanceof P?e:void 0)&&gr(t,n,On(e,!0).buffer)}function di(t,e,n){null!=(e=re(e))&&null!=e&&(fr(t,n,0),cr(t.g,e))}function pi(t,e,n){return(5===t.h||2===t.h)&&(e=ln(e,0|e[tt],n),2==t.h?Zn(t,Bn,e):e.push(Bn(t.g)),!0)}var gi=ni((function(t,e,n){return 5===t.h&&(ii(e,n,Bn(t.g)),!0)}),oi,kr),mi=ri(pi,(function(t,e,n){if(null!=(e=ei(Jt,e)))for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];null!=s&&(fr(r,i,5),r=r.g,Ot(s),ur(r))}}),kr),yi=ri(pi,(function(t,e,n){if(null!=(e=ei(Jt,e))&&e.length){fr(t,n,2),cr(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,Ot(e[r]),ur(n)}}),kr),_i=ni((function(t,e,n){return 5===t.h&&(ii(e,n,0===(t=Bn(t.g))?void 0:t),!0)}),oi,kr),vi=ni((function(t,e,n){return 0!==t.h?t=!1:(ii(e,n,Cn(t.g,Ut)),t=!0),t}),ai,Ar),Ei=ni((function(t,e,n){return 0!==t.h?e=!1:(ii(e,n,(t=Cn(t.g,Ut))===ti?void 0:t),e=!0),e}),ai,Ar),wi=ni((function(t,e,n){return 0!==t.h?t=!1:(ii(e,n,Cn(t.g,Nt)),t=!0),t}),(function(t,e,n){if(e=function(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(Wt(64,t));if(ee(t)){if("string"===e)return e=Yt(Number(t)),zt(e)&&e>=0?t=String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),(e="-"!==t[0]&&((e=t.length)<20||20===e&&t<="18446744073709551615"))||(jt(t),t=Dt(It,Ft))),t;if("number"===e)return(t=Yt(t))>=0&&zt(t)||(Mt(t),t=Ct(It,Ft)),t}}(e),null!=e){if("string"==typeof e)er(e);if(null!=e)switch(fr(t,n,0),typeof e){case"number":t=t.g,Mt(e),ar(t,It,Ft);break;case"bigint":n=BigInt.asUintN(64,e),n=new nr(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),ar(t.g,n.h,n.g);break;default:n=er(e),ar(t.g,n.h,n.g)}}}),br),Ti=ni((function(t,e,n){return 0===t.h&&(ii(e,n,Un(t.g)),!0)}),ci,wr),Ai=ri((function(t,e,n){return(0===t.h||2===t.h)&&(e=ln(e,0|e[tt],n),2==t.h?Zn(t,Un,e):e.push(Un(t.g)),!0)}),(function(t,e,n){if(null!=(e=ei(ne,e))&&e.length){n=dr(t,n);for(let n=0;n<e.length;n++)hr(t.g,e[n]);pr(t,n)}}),wr),bi=ni((function(t,e,n){return 0===t.h&&(ii(e,n,0===(t=Un(t.g))?void 0:t),!0)}),ci,wr),ki=ni((function(t,e,n){return 0===t.h&&(ii(e,n,Nn(t.g)),!0)}),hi,vr),xi=ni((function(t,e,n){return 0===t.h&&(ii(e,n,!1===(t=Nn(t.g))?void 0:t),!0)}),hi,vr),Si=ri((function(t,e,n){return 2===t.h&&(t=$n(t),ln(e,0|e[tt],n).push(t),!0)}),(function(t,e,n){if(null!=(e=ei(fe,e)))for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];null!=s&&gr(r,i,u(s))}}),Er),Li=ni((function(t,e,n){return 2===t.h&&(ii(e,n,""===(t=$n(t))?void 0:t),!0)}),ui,Er),Ri=ni((function(t,e,n){return 2===t.h&&(ii(e,n,$n(t)),!0)}),ui,Er),Ii=function(t,e,n=_r){return new Ir(t,e,n)}((function(t,e,n,r,i){return 2===t.h&&(r=Ue(void 0,r),ln(e,0|e[tt],n).push(r),qn(t,r,i),!0)}),(function(t,e,n,r,i){if(Array.isArray(e)){for(let s=0;s<e.length;s++)li(t,e[s],n,r,i);1&(t=0|e[tt])||it(e,1|t)}})),Fi=Fr((function(t,e,n,r,i,s){if(2!==t.h)return!1;let o=0|e[tt];return pn(e,o,s,n,gt(o)),qn(t,e=mn(e,r,n),i),!0}),li),Pi=ni((function(t,e,n){return 2===t.h&&(ii(e,n,Jn(t)),!0)}),fi,xr),Mi=ri((function(t,e,n){return(0===t.h||2===t.h)&&(e=ln(e,0|e[tt],n),2==t.h?Zn(t,Dn,e):e.push(Dn(t.g)),!0)}),(function(t,e,n){if(null!=(e=ei(re,e)))for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];null!=s&&(fr(r,i,0),cr(r.g,s))}}),Tr),Oi=ni((function(t,e,n){return 0===t.h&&(ii(e,n,0===(t=Dn(t.g))?void 0:t),!0)}),di,Tr),Ci=ni((function(t,e,n){return 0===t.h&&(ii(e,n,Un(t.g)),!0)}),(function(t,e,n){null!=(e=ne(e))&&(e=parseInt(e,10),fr(t,n,0),hr(t.g,e))}),Sr);class Ni{constructor(t,e){var n=ts;this.g=t,this.h=e,this.m=_n,this.j=Tn,this.defaultValue=void 0,this.l=null!=n.Oa?pt:void 0}register(){y(this)}}function Ui(t,e){return new Ni(t,e)}function Di(t,e){return(n,r)=>{{const s={ea:!0};r&&Object.assign(s,r),n=Wn(n,void 0,void 0,s);try{const r=new t,s=r.v;Kr(e)(s,n);var i=r}finally{zn(n)}}return i}}function Bi(t){return function(){const e=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const t=this.g;return this.g=[],t}}}};Qr(this.v,e,Vr(Cr,$r,Jr,t)),lr(e,e.g.end());const n=new Uint8Array(e.h),r=e.l,i=r.length;let s=0;for(let t=0;t<i;t++){const e=r[t];n.set(e,s),s+=e.length}return e.l=[n],n}}var Gi=class extends Rr{constructor(t){super(t)}},ji=[0,Li,ni((function(t,e,n){return 2===t.h&&(ii(e,n,(t=Jn(t))===I()?void 0:t),!0)}),(function(t,e,n){if(null!=e){if(e instanceof Rr){const r=e.Ra;return void(r?(e=r(e),null!=e&&gr(t,n,On(e,!0).buffer)):D(Y,3))}if(Array.isArray(e))return void D(Y,3)}fi(t,e,n)}),xr)];let Vi,Xi=globalThis.trustedTypes;function Hi(t){var e;return void 0===Vi&&(Vi=function(){let t=null;if(!Xi)return t;try{const e=t=>t;t=Xi.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(t){}return t}()),t=(e=Vi)?e.createScriptURL(t):t,new class{constructor(t){this.g=t}toString(){return this.g+""}}(t)}function Wi(t,...e){if(0===e.length)return Hi(t[0]);let n=t[0];for(let r=0;r<e.length;r++)n+=encodeURIComponent(e[r])+t[r+1];return Hi(n)}var zi=[0,Ti,Ci,ki,-1,Ai,Ci,-1,ki],Ki=class extends Rr{constructor(t){super(t)}},Yi=[0,ki,Ri,ki,Ci,-1,ri((function(t,e,n){return(0===t.h||2===t.h)&&(e=ln(e,0|e[tt],n),2==t.h?Zn(t,Gn,e):e.push(Un(t.g)),!0)}),(function(t,e,n){if(null!=(e=ei(ne,e))&&e.length){n=dr(t,n);for(let n=0;n<e.length;n++)hr(t.g,e[n]);pr(t,n)}}),Sr),Ri,-1,[0,ki,-1],Ci,ki,-1],qi=[0,3,ki,-1,2,[0,[2],Ti,Fi,[0,ni((function(t,e,n){return 0===t.h&&(ii(e,n,Dn(t.g)),!0)}),di,Tr)]],[0,Ci,ki,Ci,ki,Ci,ki,Ri,-1],[0,[3,4],Ri,-1,Fi,[0,Ti],Fi,[0,Ci]],[0]],$i=[0,Ri,-2],Ji=class extends Rr{constructor(t){super(t)}},Zi=[0],Qi=[0,Ti,ki,1,ki,-4],ts=class extends Rr{constructor(t){super(t,2)}},es={};es[336783863]=[0,Ri,ki,-1,Ti,[0,[1,2,3,4,5,6,7,8,9],Fi,Zi,Fi,Yi,Fi,$i,Fi,Qi,Fi,zi,Fi,[0,Ri,-2],Fi,[0,Ri,Ci],Fi,qi,Fi,[0,Ci,-1,ki]],[0,Ri],ki,[0,[1,3],[2,4],Fi,[0,Ai],-1,Fi,[0,Si],-1,Ii,[0,Ri,-1]],Ri];var ns=[0,Ei,-1,xi,-3,Ei,Ai,Li,bi,Ei,-1,xi,bi,xi,-2,Li];function rs(t,e){Pn(t,3,e)}function is(t,e){Pn(t,4,e)}var ss=class extends Rr{constructor(t){super(t,500)}o(t){return Tn(this,0,7,t)}},os=[-1,{}],as=[0,Ri,1,os],cs=[0,Ri,Si,os];function hs(t,e){kn(t,1,ss,e)}function us(t,e){Pn(t,10,e)}function ls(t,e){Pn(t,15,e)}var fs=class extends Rr{constructor(t){super(t,500)}o(t){return Tn(this,0,1001,t)}},ds=[-500,Ii,[-500,Li,-1,Si,-3,[-2,es,ki],Ii,ji,bi,-1,as,cs,Ii,[0,Li,xi],Li,ns,bi,Si,987,Si],4,Ii,[-500,Ri,-1,[-1,{}],998,Ri],Ii,[-500,Ri,Si,-1,[-2,{},ki],997,Si,-1],bi,Ii,[-500,Ri,Si,os,998,Si],Si,bi,as,cs,Ii,[0,Li,-1,os],Si,-2,ns,Li,-1,xi,[0,xi,Oi],978,os,Ii,ji];fs.prototype.g=Bi(ds);var ps=Di(fs,ds),gs=class extends Rr{constructor(t){super(t)}},ms=class extends Rr{constructor(t){super(t)}g(){return En(this,gs,1)}},ys=[0,Ii,[0,Ti,gi,Ri,-1]],_s=Di(ms,ys),vs=class extends Rr{constructor(t){super(t)}},Es=class extends Rr{constructor(t){super(t)}},ws=class extends Rr{constructor(t){super(t)}l(){return _n(this,vs,2)}g(){return En(this,Es,5)}},Ts=Di(class extends Rr{constructor(t){super(t)}},[0,Si,Ai,yi,[0,Ci,[0,Ti,-3],[0,gi,-3],[0,Ti,-1,[0,Ii,[0,Ti,-2]]],Ii,[0,gi,-1,Ri,gi]],Ri,-1,vi,Ii,[0,Ti,gi],Si,vi]),As=class extends Rr{constructor(t){super(t)}},bs=Di(class extends Rr{constructor(t){super(t)}},[0,Ii,[0,gi,-4]]),ks=class extends Rr{constructor(t){super(t)}},xs=Di(class extends Rr{constructor(t){super(t)}},[0,Ii,[0,gi,-4]]),Ss=class extends Rr{constructor(t){super(t)}},Ls=[0,Ti,-1,yi,Ci],Rs=class extends Rr{constructor(t){super(t)}};Rs.prototype.g=Bi([0,gi,-4,vi]);var Is=class extends Rr{constructor(t){super(t)}},Fs=Di(class extends Rr{constructor(t){super(t)}},[0,Ii,[0,1,Ti,Ri,ys],vi]),Ps=class extends Rr{constructor(t){super(t)}},Ms=class extends Rr{constructor(t){super(t)}na(){const t=Je(this,1,void 0,void 0,cn);return null==t?I():t}},Os=class extends Rr{constructor(t){super(t)}},Cs=[1,2],Ns=Di(class extends Rr{constructor(t){super(t)}},[0,Ii,[0,Cs,Fi,[0,yi],Fi,[0,Pi],Ti,Ri],vi]),Us=class extends Rr{constructor(t){super(t)}},Ds=[0,Ri,Ti,gi,Si,-1],Bs=class extends Rr{constructor(t){super(t)}},Gs=[0,ki,-1],js=class extends Rr{constructor(t){super(t)}},Vs=[1,2,3,4,5,6],Xs=class extends Rr{constructor(t){super(t)}g(){return null!=Je(this,1,void 0,void 0,cn)}l(){return null!=fe(Je(this,2))}},Hs=class extends Rr{constructor(t){super(t)}g(){return Qt(Je(this,2))??!1}},Ws=[0,Pi,Ri,[0,Ti,vi,-1],[0,wi,vi]],zs=[0,Ws,ki,[0,Vs,Fi,Qi,Fi,Yi,Fi,zi,Fi,Zi,Fi,$i,Fi,qi],Ci],Ks=class extends Rr{constructor(t){super(t)}},Ys=[0,zs,gi,-1,Ti],qs=Ui(502141897,Ks);es[502141897]=Ys;var $s=Di(class extends Rr{constructor(t){super(t)}},[0,[0,Ci,-1,mi,Mi],Ls]),Js=class extends Rr{constructor(t){super(t)}},Zs=class extends Rr{constructor(t){super(t)}},Qs=[0,zs,gi,[0,zs],ki],to=Ui(508968150,Zs);es[508968150]=[0,zs,Ys,Qs,gi,[0,[0,Ws]]],es[508968149]=Qs;var eo=class extends Rr{constructor(t){super(t)}l(){return _n(this,Us,2)}g(){Qe(this,2)}},no=[0,zs,Ds];es[478825465]=no;var ro=class extends Rr{constructor(t){super(t)}},io=class extends Rr{constructor(t){super(t)}},so=class extends Rr{constructor(t){super(t)}},oo=class extends Rr{constructor(t){super(t)}},ao=class extends Rr{constructor(t){super(t)}},co=[0,zs,[0,zs],no,-1],ho=[0,zs,gi,Ti],uo=[0,zs,gi],lo=[0,zs,ho,uo,gi],fo=Ui(479097054,ao);es[479097054]=[0,zs,lo,co],es[463370452]=co,es[464864288]=ho;var po=Ui(462713202,oo);es[462713202]=lo,es[474472470]=uo;var go=class extends Rr{constructor(t){super(t)}},mo=class extends Rr{constructor(t){super(t)}},yo=class extends Rr{constructor(t){super(t)}},_o=class extends Rr{constructor(t){super(t)}},vo=[0,zs,gi,-1,Ti],Eo=[0,zs,gi,ki];_o.prototype.g=Bi([0,zs,uo,[0,zs],Ys,Qs,vo,Eo]);var wo=class extends Rr{constructor(t){super(t)}},To=Ui(456383383,wo);es[456383383]=[0,zs,Ds];var Ao=class extends Rr{constructor(t){super(t)}},bo=Ui(476348187,Ao);es[476348187]=[0,zs,Gs];var ko=class extends Rr{constructor(t){super(t)}},xo=class extends Rr{constructor(t){super(t)}},So=[0,Ci,-1],Lo=Ui(458105876,class extends Rr{constructor(t){super(t)}g(){let t;var e=this.v;const n=0|e[tt];return t=ct(this,n),e=function(t,e,n,r){var i=xo;!r&&We(t)&&(n=0|(e=t.v)[tt]);var s=Ze(e,2);if(t=!1,null==s){if(r)return ke();s=[]}else if(s.constructor===we){if(!(2&s.J)||r)return s;s=s.V()}else Array.isArray(s)?t=!!(2&(0|s[tt])):s=[];if(r){if(!s.length)return ke();t||(t=!0,st(s))}else t&&(t=!1,ot(s),s=hn(s));return!t&&32&n&&rt(s,32),n=tn(e,n,2,r=new we(s,i,pe,void 0)),t||Ke(e,n),r}(this,e,n,t),!t&&xo&&(e.ra=!0),e}});es[458105876]=[0,So,si,[!0,vi,[0,Ri,-1,Si]],[0,Ai,ki,Ci]];var Ro=class extends Rr{constructor(t){super(t)}},Io=Ui(458105758,Ro);es[458105758]=[0,zs,Ri,So];var Fo=class extends Rr{constructor(t){super(t)}},Po=[0,_i,-1,xi],Mo=class extends Rr{constructor(t){super(t)}},Oo=class extends Rr{constructor(t){super(t)}},Co=[1,2];Oo.prototype.g=Bi([0,Co,Fi,Po,Fi,[0,Ii,Po]]);var No=class extends Rr{constructor(t){super(t)}},Uo=Ui(443442058,No);es[443442058]=[0,zs,Ri,Ti,gi,Si,-1,ki,gi],es[514774813]=vo;var Do=class extends Rr{constructor(t){super(t)}},Bo=Ui(516587230,Do);function Go(t,e){return e=e?e.clone():new Us,void 0!==t.displayNamesLocale?Qe(e,1,le(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Qe(e,1),void 0!==t.maxResults?Ln(e,2,t.maxResults):"maxResults"in t&&Qe(e,2),void 0!==t.scoreThreshold?Rn(e,3,t.scoreThreshold):"scoreThreshold"in t&&Qe(e,3),void 0!==t.categoryAllowlist?Fn(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&Qe(e,4),void 0!==t.categoryDenylist?Fn(e,5,t.categoryDenylist):"categoryDenylist"in t&&Qe(e,5),e}function jo(t){const e=Number(t);return Number.isSafeInteger(e)?e:String(t)}function Vo(t,e=-1,n=""){return{categories:t.map((t=>({index:xn(t,1)??0??-1,score:Sn(t,2)??0,categoryName:fe(Je(t,3))??""??"",displayName:fe(Je(t,4))??""??""}))),headIndex:e,headName:n}}function Xo(t){const e={classifications:En(t,Is,1).map((t=>Vo(_n(t,ms,4)?.g()??[],xn(t,2)??0,fe(Je(t,3))??"")))};return null!=function(t){return null==t?t:"bigint"==typeof t?(Tt(t)?t=Number(t):(t=Ht(64,t),t=Tt(t)?Number(t):String(t)),t):ee(t)?"number"==typeof t?se(t):oe(t):void 0}(Je(t,2,void 0,void 0,he))&&(e.timestampMs=jo(Je(t,2,void 0,void 0,he)??qe)),e}function Ho(t){var e=nn(t,3,Jt,en()),n=nn(t,2,ne,en()),r=nn(t,1,fe,en()),i=nn(t,9,fe,en());const s={categories:[],keypoints:[]};for(let t=0;t<e.length;t++)s.categories.push({score:e[t],index:n[t]??-1,categoryName:r[t]??"",displayName:i[t]??""});if((e=_n(t,ws,4)?.l())&&(s.boundingBox={originX:xn(e,1,$e)??0,originY:xn(e,2,$e)??0,width:xn(e,3,$e)??0,height:xn(e,4,$e)??0,angle:0}),_n(t,ws,4)?.g().length)for(const e of _n(t,ws,4).g())s.keypoints.push({x:Je(e,1,void 0,$e,Jt)??0,y:Je(e,2,void 0,$e,Jt)??0,score:Je(e,4,void 0,$e,Jt)??0,label:fe(Je(e,3,void 0,$e))??""});return s}function Wo(t){const e=[];for(const n of En(t,ks,1))e.push({x:Sn(n,1)??0,y:Sn(n,2)??0,z:Sn(n,3)??0,visibility:Sn(n,4)??0});return e}function zo(t){const e=[];for(const n of En(t,As,1))e.push({x:Sn(n,1)??0,y:Sn(n,2)??0,z:Sn(n,3)??0,visibility:Sn(n,4)??0});return e}function Ko(t){return Array.from(t,(t=>t>127?t-256:t))}function Yo(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)}let qo;es[516587230]=[0,zs,vo,Eo,gi],es[518928384]=Eo;const $o=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function Jo(t){if(t)return!0;if(void 0===qo)try{await WebAssembly.instantiate($o),qo=!0}catch{qo=!1}return qo}async function Zo(t,e,n){return{wasmLoaderPath:`${e}/${t}_${n=`wasm${n?"_module":""}${await Jo(n)?"":"_nosimd"}_internal`}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var Qo=class{};function ta(){var t=navigator;return"undefined"!=typeof OffscreenCanvas&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(t)||!!((t=t.userAgent.match(/Version\/([\d]+).*Safari/))&&t.length>=1&&Number(t[1])>=17))}async function ea(e){if("function"!=typeof importScripts){const t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise(((e,n)=>{t.addEventListener("load",(()=>{e()}),!1),t.addEventListener("error",(t=>{n(t)}),!1),document.body.appendChild(t)}))}try{importScripts(e.toString())}catch(n){if(!(n instanceof TypeError))throw n;{const n=self.import;n?await n(e.toString()):await function(e){return Promise.resolve().then((function(){return t(require(e))}))}(e.toString())}}}function na(t){return void 0!==t.videoWidth?[t.videoWidth,t.videoHeight]:void 0!==t.naturalWidth?[t.naturalWidth,t.naturalHeight]:void 0!==t.displayWidth?[t.displayWidth,t.displayHeight]:[t.width,t.height]}function ra(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 ia(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);const[r,i]=na(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 sa(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const r=new Uint32Array(e.length);for(let n=0;n<e.length;n++)r[n]=t.i.stringToNewUTF8(e[n]);e=t.i._malloc(4*r.length),t.i.HEAPU32.set(r,e>>2),n(e);for(const e of r)t.i._free(e);t.i._free(e)}function oa(t,e,n){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=n}function aa(t,e,n){let r=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(t,e,i)=>{e?(n(r,i),r=[]):r.push(t)}}Qo.forVisionTasks=function(t,e=!1){return Zo("vision",t??Wi``,e)},Qo.forTextTasks=function(t,e=!1){return Zo("text",t??Wi``,e)},Qo.forGenAiTasks=function(t,e=!1){return Zo("genai",t??Wi``,e)},Qo.forAudioTasks=function(t,e=!1){return Zo("audio",t??Wi``,e)},Qo.isSimdSupported=function(t=!1){return Jo(t)};async function ca(t,e,n,r){return t=await(async(t,e,n,r,i)=>{if(e&&await ea(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(n&&(await ea(n),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&i&&((e=self.Module).locateFile=i.locateFile,i.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=i.mainScriptUrlOrBlob)),i=await self.ModuleFactory(self.Module||i),self.ModuleFactory=self.Module=void 0,new t(i,r)})(t,n.wasmLoaderPath,n.assetLoaderPath,e,{locateFile:t=>t.endsWith(".wasm")?n.wasmBinaryPath.toString():n.assetBinaryPath&&t.endsWith(".data")?n.assetBinaryPath.toString():t}),await t.o(r),t}function ha(t,e){const n=_n(t.baseOptions,Xs,1)||new Xs;"string"==typeof e?(Qe(n,2,le(e)),Qe(n,1)):e instanceof Uint8Array&&(Qe(n,1,ut(e,!1)),Qe(n,2)),Tn(t.baseOptions,0,1,n)}function ua(t){try{const e=t.H.length;if(1===e)throw Error(t.H[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.H.map((t=>t.message)).join(", "))}finally{t.H=[]}}function la(t,e){t.C=Math.max(t.C,e)}function fa(t,e){t.B=new ss,In(t.B,2,"PassThroughCalculator"),rs(t.B,"free_memory"),is(t.B,"free_memory_unused_out"),us(e,"free_memory"),hs(e,t.B)}function da(t,e){rs(t.B,e),is(t.B,e+"_unused_out")}function pa(t){t.g.addBoolToStream(!0,"free_memory",t.C)}var ga=class{constructor(t){this.g=t,this.H=[],this.C=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){if(e){const e=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(_n(this.baseOptions,Xs,1)?.g()||_n(this.baseOptions,Xs,1)?.l()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer