@mediapipe/tasks-audio 1.1.0 → 1.1.1-rc.20261009

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/audio_bundle.mjs CHANGED
@@ -1,2 +1,2 @@
1
- var t="undefined"!=typeof self?self:{};function r(r,e){t:{for(var n=["CLOSURE_FLAGS"],i=t,o=0;o<n.length;o++)if(null==(i=i[n[o]])){n=null;break t}n=i}return null!=(r=n&&n[r])?r:e}function e(){throw Error("Invalid UTF8")}function n(t,r){return r=String.fromCharCode.apply(null,r),null==t?r:t+r}var i,o,a=void 0,s="undefined"!=typeof TextDecoder,u="undefined"!=typeof TextEncoder;function l(t){if(u)t=(o||=new TextEncoder).encode(t);else{let e=0,n=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var r=t.charCodeAt(i);if(r<128)n[e++]=r;else{if(r<2048)n[e++]=r>>6|192;else{if(r>=55296&&r<=57343){if(r<=56319&&i<t.length){let o=t.charCodeAt(++i);if(o>=56320&&o<=57343){r=1024*(r-55296)+o-56320+65536,n[e++]=r>>18|240,n[e++]=r>>12&63|128,n[e++]=r>>6&63|128,n[e++]=63&r|128;continue}i--}r=65533}n[e++]=r>>12|224,n[e++]=r>>6&63|128}n[e++]=63&r|128}}t=e===n.length?n:n.subarray(0,e)}return t}var h=r(610401301,!1),c=r(748402147,!0);function f(){var r=t.navigator;return r&&(r=r.userAgent)?r:""}var d,v=t.navigator;function p(t){return p[" "](t),t}d=v&&v.userAgentData||null,p[" "]=function(){};var g={},m=null;function y(t){var r=t.length,e=3*r/4;e%3?e=Math.floor(e):-1!="=.".indexOf(t[r-1])&&(e=-1!="=.".indexOf(t[r-2])?e-2:e-1);var n=new Uint8Array(e),i=0;return function(t,r){function e(r){for(;n<t.length;){let r=t.charAt(n++),e=m[r];if(null!=e)return e;if(!/^[\s\xa0]*$/.test(r))throw Error("Unknown base64 encoding at char: "+r)}return r}w();for(var n=0;;){let t=e(-1),n=e(0),i=e(64),o=e(64);if(64===o&&-1===t)break;r(t<<2|n>>4),64!=i&&(r(n<<4&240|i>>2),64!=o&&r(i<<6&192|o))}}(t,function(t){n[i++]=t}),i!==e?n.subarray(0,i):n}function w(){if(!m){m={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),r=["+/=","+/","-_=","-_.","-_"];for(let e=0;e<5;e++){let n=t.concat(r[e].split(""));g[e]=n;for(let t=0;t<n.length;t++){let r=n[t];void 0===m[r]&&(m[r]=t)}}}}var b="undefined"!=typeof Uint8Array,_=!(!(!!h&&(!!d&&d.brands.length>0))&&(-1!=f().indexOf("Trident")||-1!=f().indexOf("MSIE")))&&"function"==typeof btoa,S=/[-_.]/g,A={"-":"+",_:"/",".":"="};function I(t){return A[t]||""}function j(t){if(!_)return y(t);t=S.test(t)?t.replace(S,I):t,t=atob(t);var r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}var E={};function T(){return U||=new P(null,E)}function B(t){x(E);var r=t.h;return null==(r=null==r||b&&null!=r&&r instanceof Uint8Array?r:"string"==typeof r?j(r):null)?r:t.h=r}var U,P=class{constructor(t,r){if(x(r),this.h=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};function x(t){if(t!==E)throw Error("illegal external caller")}function L(t,r){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=r}var N=void 0;function O(t){return L(t=Error(t),"warning"),t}function k(r,e){if(null!=r){var n=N??={},i=n[r]||0;i>=e||(n[r]=i+1,L(r=Error(),"incident"),function(r){t.setTimeout(()=>{throw r},0)}(r))}}function V(){return"function"==typeof BigInt}var F="function"==typeof Symbol&&"symbol"==typeof Symbol();function M(t,r,e=!1){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?e&&Symbol.for&&t?Symbol.for(t):null!=t?Symbol(t):Symbol():r}var G,C=M("jas",void 0,!0),D=M(void 0,"1oa"),R=M(void 0,Symbol()),W=M(void 0,"0ubs"),H=M(void 0,"0ubsb"),$=M(void 0,"0actk"),z=M("m_m","ia",!0),K={Y:{value:0,configurable:!0,writable:!0,enumerable:!1}},J=Object.defineProperties,X=F?C:"Y",Y=[];function Z(t,r){F||X in t||J(t,K),t[X]|=r}function q(t,r){F||X in t||J(t,K),t[X]=r}q(Y,7),G=Object.freeze(Y);var Q={};function tt(t,r){return void 0===r?t.h!==rt&&!!(2&t.m[X]):!!(2&r)&&t.h!==rt}var rt={};function et(t,r){if(null!=t)if("string"==typeof t)t=t?new P(t,E):T();else if(t.constructor!==P)if(b&&null!=t&&t instanceof Uint8Array)t=t.length?new P(new Uint8Array(t),E):T();else{if(!r)throw Error();t=void 0}return t}var nt=Object.freeze({});function it(t,r,e){var n,i=128&r?0:-1,o=t.length;(n=!!o)&&(n=null!=(n=t[o-1])&&"object"==typeof n&&n.constructor===Object);var a=o+(n?-1:0);for(r=128&r?1:0;r<a;r++)e(r-i,t[r]);if(n){t=t[o-1];for(let r in t)!isNaN(r)&&e(+r,t[r])}}var ot={};function at(t){return 128&t?ot:void 0}function st(t){return t.ga=!0,t}var ut=st(t=>"number"==typeof t),lt=st(t=>"string"==typeof t),ht=st(t=>"boolean"==typeof t),ct="function"==typeof t.BigInt&&"bigint"==typeof t.BigInt(0);function ft(t){var r=t;if(lt(r)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(r))throw Error(String(r))}else if(ut(r)&&!Number.isSafeInteger(r))throw Error(String(r));return ct?BigInt(t):t=ht(t)?t?"1":"0":lt(t)?t.trim()||"0":String(t)}var dt=st(t=>ct?t>=pt&&t<=mt:"-"===t[0]?yt(t,vt):yt(t,gt)),vt=Number.MIN_SAFE_INTEGER.toString(),pt=ct?BigInt(Number.MIN_SAFE_INTEGER):void 0,gt=Number.MAX_SAFE_INTEGER.toString(),mt=ct?BigInt(Number.MAX_SAFE_INTEGER):void 0;function yt(t,r){if(t.length>r.length)return!1;if(t.length<r.length||t===r)return!0;for(let e=0;e<t.length;e++){let n=t[e],i=r[e];if(n>i)return!1;if(n<i)return!0}}var wt,bt="function"==typeof Uint8Array.prototype.slice,_t=0,St=0;function At(t){var r=t>>>0;_t=r,St=(t-r)/4294967296>>>0}function It(t){if(t<0){At(-t);let[r,e]=Lt(_t,St);_t=r>>>0,St=e>>>0}else At(t)}function jt(t,r){var e=4294967296*r+(t>>>0);return Number.isSafeInteger(e)?e:Bt(t,r)}function Et(t,r){return ft(V()?BigInt.asUintN(64,(BigInt(r>>>0)<<BigInt(32))+BigInt(t>>>0)):Bt(t,r))}function Tt(t,r){return V()?ft(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(r))<<BigInt(32))+BigInt.asUintN(32,BigInt(t)))):ft(Pt(t,r))}function Bt(t,r){if(t>>>=0,(r>>>=0)<=2097151)var e=""+(4294967296*r+t);else V()?e=""+(BigInt(r)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(e=16777215&(t>>>24|r<<8))+6710656*(r=r>>16&65535),e+=8147497*r,r*=2,t>=1e7&&(e+=t/1e7>>>0,t%=1e7),e>=1e7&&(r+=e/1e7>>>0,e%=1e7),e=r+Ut(e)+Ut(t));return e}function Ut(t){return t=String(t),"0000000".slice(t.length)+t}function Pt(t,r){if(2147483648&r)if(V())t=""+(BigInt(0|r)<<BigInt(32)|BigInt(t>>>0));else{let[e,n]=Lt(t,r);t="-"+Bt(e,n)}else t=Bt(t,r);return t}function xt(t){if(t.length<16)It(Number(t));else if(V())t=BigInt(t),_t=Number(t&BigInt(4294967295))>>>0,St=Number(t>>BigInt(32)&BigInt(4294967295));else{let r=+("-"===t[0]);St=_t=0;let e=t.length;for(let n=r,i=(e-r)%6+r;i<=e;n=i,i+=6){let r=Number(t.slice(n,i));St*=1e6,(_t=1e6*_t+r)>=4294967296&&(St+=Math.trunc(_t/4294967296),St>>>=0,_t>>>=0)}if(r){let[t,r]=Lt(_t,St);_t=t,St=r}}}function Lt(t,r){return r=~r,t?t=1+~t:r+=1,[t,r]}function Nt(t){return Array.prototype.slice.call(t)}var Ot="function"==typeof BigInt?BigInt.asIntN:void 0,kt="function"==typeof BigInt?BigInt.asUintN:void 0,Vt=Number.isSafeInteger,Ft=Number.isFinite,Mt=Math.trunc;function Gt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}var Ct=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Dt(t){switch(typeof t){case"bigint":return!0;case"number":return Ft(t);case"string":return Ct.test(t);default:return!1}}function Rt(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Ft(t)?0|t:void 0}function Wt(t){var r=t.length;return("-"===t[0]?r<20||20===r&&t<="-9223372036854775808":r<19||19===r&&t<="9223372036854775807")?t:(xt(t),Pt(_t,St))}function Ht(t){if("-"===t[0])var r=!1;else r=(r=t.length)<20||20===r&&t<="18446744073709551615";return r?t:(xt(t),Bt(_t,St))}function $t(t){if(t=Mt(t),!Vt(t)){It(t);var r=_t,e=St;(t=2147483648&e)&&(e=~e>>>0,0==(r=1+~r>>>0)&&(e=e+1>>>0)),t="number"==typeof(r=jt(r,e))?t?-r:r:t?"-"+r:r}return t}function zt(t){return(t=Mt(t))>=0&&Vt(t)||(It(t),t=jt(_t,St)),t}function Kt(t){var r=Mt(Number(t));return Vt(r)?String(r):(-1!==(r=t.indexOf("."))&&(t=t.substring(0,r)),Wt(t))}function Jt(t){var r=Mt(Number(t));return Vt(r)?ft(r):(-1!==(r=t.indexOf("."))&&(t=t.substring(0,r)),V()?ft(Ot(64,BigInt(t))):ft(Wt(t)))}function Xt(t){return Vt(t)?t=ft($t(t)):(t=Mt(t),Vt(t)?t=String(t):(It(t),t=Pt(_t,St)),t=ft(t)),t}function Yt(t){var r=typeof t;return null==t?t:"bigint"===r?ft(Ot(64,t)):Dt(t)?"string"===r?Jt(t):Xt(t):void 0}function Zt(t){if(null==t)return t;var r=typeof t;if("bigint"===r)return String(Ot(64,t));if(Dt(t)){if("string"===r)return Kt(t);if("number"===r)return $t(t)}}function qt(t){if(null==t||"string"==typeof t||t instanceof P)return t}function Qt(t){if("string"!=typeof t)throw Error();return t}function tr(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function rr(t){return null==t||"string"==typeof t?t:void 0}function er(t,r,e){if(null!=t&&t[z]===Q)return t;if(Array.isArray(t)){var n=0|t[X];return(e=n|32&e|2&e)!==n&&q(t,e),new r(t)}}function nr(t){return t}function ir(t){return R?t[R]:void 0}function or(t,r){for(let e in t)!isNaN(e)&&r(t,+e,t[e])}var ar,sr,ur,lr=class{};function hr(t,r){r<100||k(W,1)}function cr(t,r,e,n){var i=void 0!==n;n=!!n;var o,a=R;!i&&F&&a&&(o=t[a])&&or(o,hr),a=[];var s=t.length;o=4294967295;var u=!1,l=!!(64&r),h=l?128&r?0:-1:void 0;if(!(1&r)){var c=s&&t[s-1];null!=c&&"object"==typeof c&&c.constructor===Object?o=--s:c=void 0,!l||128&r||i||(u=!0,o=(ar??nr)(o-h,h,t,c,void 0)+h)}r=void 0;for(var f=0;f<s;f++){let i=t[f];if(null!=i&&null!=(i=e(i,n)))if(l&&f>=o){let t=f-h;(r??={})[t]=i}else a[f]=i}if(c)for(let t in c){if(null==(s=c[t])||null==(s=e(s,n)))continue;let i;f=+t,l&&!Number.isNaN(f)&&(i=f+h)<o?a[i]=s:(r??={})[t]=s}return r&&(u?a.push(r):a[o]=r),i&&R&&(t=ir(t))&&t instanceof lr&&(a[R]=function(t){var r=new lr;return or(t,(t,e,n)=>{r[e]=Nt(n)}),r.h=t.h,r}(t)),a}function fr(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return dt(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(Array.isArray(t)){var r=0|t[X];return 0===t.length&&1&r?void 0:cr(t,r,fr)}if(null!=t&&t[z]===Q)return dr(t);if(t instanceof P){if(null==(r=t.h))t="";else if("string"==typeof r)t=r;else{if(_){for(var e="",n=0,i=r.length-10240;n<i;)e+=String.fromCharCode.apply(null,r.subarray(n,n+=10240));e+=String.fromCharCode.apply(null,n?r.subarray(n):r),r=btoa(e)}else{void 0===e&&(e=0),w(),e=g[e],n=Array(Math.floor(r.length/3)),i=e[64]||"";let t=0,l=0;for(;t<r.length-2;t+=3){var o=r[t],a=r[t+1],s=r[t+2],u=e[o>>2];o=e[(3&o)<<4|a>>4],a=e[(15&a)<<2|s>>6],s=e[63&s],n[l++]=u+o+a+s}switch(u=0,s=i,r.length-t){case 2:s=e[(15&(u=r[t+1]))<<2]||i;case 1:r=r[t],n[l]=e[r>>2]+e[(3&r)<<4|u>>4]+s+i}r=n.join("")}t=t.h=r}return t}return}return t}function dr(t){return cr(t=t.m,0|t[X],fr)}function vr(t,r){return pr(t,r[0],r[1])}function pr(t,r,e,n=0){if(null==t){var i=32;e?(t=[e],i|=128):t=[],r&&(i=-16760833&i|(1023&r)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(i=0|t[X],c&&1&i)throw Error("rfarr");if(2048&i&&!(2&i)&&function(){if(c)throw Error("carr");k($,5)}(),256&i)throw Error("farr");if(64&i)return(i|n)!==i&&q(t,i|n),t;if(e&&(i|=128,e!==t[0]))throw Error("mid");t:{i|=64;var o=(e=t).length;if(o){var a=o-1;let t=e[a];if(null!=t&&"object"==typeof t&&t.constructor===Object){if((a-=r=128&i?0:-1)>=1024)throw Error("pvtlmt");for(var s in t)(o=+s)<a&&(e[o+r]=t[s],delete t[s]);i=-16760833&i|(1023&a)<<14;break t}}if(r){if((s=Math.max(r,o-(128&i?0:-1)))>1024)throw Error("spvt");i=-16760833&i|(1023&s)<<14}}}return q(t,64|i|n),t}function gr(t,r){if("object"!=typeof t)return t;if(Array.isArray(t)){var e=0|t[X];return 0===t.length&&1&e?t=void 0:2&e||(!r||4096&e||16&e?t=yr(t,e,!1,r&&!(16&e)):(Z(t,34),4&e&&Object.freeze(t))),t}return null!=t&&t[z]===Q?tt(t,e=0|(r=t.m)[X])?t:Ar(t,r,e)?mr(t,r):yr(r,e):t instanceof P?t:void 0}function mr(t,r,e){return t=new t.constructor(r),e&&(t.h=rt),t.o=rt,t}function yr(t,r,e,n){return n??=!!(34&r),t=cr(t,r,gr,n),n=32,e&&(n|=2),q(t,r=16769217&r|n),t}function wr(t){var r=t.m,e=0|r[X];return tt(t,e)?Ar(t,r,e)?mr(t,r,!0):new t.constructor(yr(r,e,!1)):t}function br(t){if(t.h!==rt)return!1;var r=t.m;return Z(r=yr(r,0|r[X]),2048),t.m=r,t.h=void 0,t.o=void 0,!0}function _r(t){if(!br(t)&&tt(t,0|t.m[X]))throw Error()}function Sr(t,r){void 0===r&&(r=0|t[X]),32&r&&!(4096&r)&&q(t,4096|r)}function Ar(t,r,e){return!!(2&e)||!(!(32&e)||4096&e)&&(q(r,2|e),t.h=rt,!0)}var Ir=ft(0);function jr(t,r,e,n){if(null!==(t=Er(t.m,r,e,n)))return t}function Er(t,r,e,n){if(-1===r)return null;var i=r+(e?0:-1),o=t.length-1;if(!(o<1+(e?0:-1))){if(i>=o){var a=t[o];if(null!=a&&"object"==typeof a&&a.constructor===Object){e=a[r];var s=!0}else{if(i!==o)return;e=a}}else e=t[i];if(n&&null!=e){if(null==(n=n(e)))return n;if(!Object.is(n,e))return s?a[r]=n:t[i]=n,n}return e}}function Tr(t,r,e,n){_r(t);var i=t.m;return Br(i,0|i[X],r,e,n),t}function Br(t,r,e,n,i){var o=e+(i?0:-1),a=t.length-1;if(a>=1+(i?0:-1)&&o>=a){let i=t[a];if(null!=i&&"object"==typeof i&&i.constructor===Object)return i[e]=n,r}return o<=a?(t[o]=n,r):(void 0!==n&&(e>=(a=(r??=0|t[X])>>14&1023||536870912)?null!=n&&(t[a+(i?0:-1)]={[e]:n}):t[o]=n),r)}function Ur(t,r,e,n,i,o,a,s){var u=r;return 1===o||4===o&&(2&r||!(16&r)&&32&n)?Lr(r)||((r|=!t.length||a&&!(4096&r)||32&n&&!(4096&r||16&r)?2:256)!==u&&q(t,r),Object.freeze(t)):(2===o&&Lr(r)&&(t=Nt(t),u=0,r=Jr(r,n),n=Br(e,n,i,t)),Lr(r)||(s||(r|=16),r!==u&&q(t,r))),2&r||!(4096&r||16&r)||Sr(e,n),t}function Pr(t,r,e){return t=Er(t,r,e),Array.isArray(t)?t:G}function xr(t,r){return 2&r&&(t|=2),1|t}function Lr(t){return!!(2&t)&&!!(4&t)||!!(256&t)}function Nr(t){return et(t,!0)}function Or(t,r,e){_r(t);var n=0|(t=t.m)[X];if(null==e)Br(t,n,r);else{var i=e===G?7:0|e[X],o=i,a=Lr(i),s=a||Object.isFrozen(e);for(a||(i=0),s||(e=Nt(e),o=0,i=Jr(i,n),s=!1),i|=5,i|=(4&i?512&i?512:1024&i?1024:0:void 0)??1024,a=0;a<e.length;a++){let t=e[a],r=Qt(t);Object.is(t,r)||(s&&(e=Nt(e),o=0,i=Jr(i,n),s=!1),e[a]=r)}i!==o&&(s&&(e=Nt(e),i=Jr(i,n)),q(e,i)),Br(t,n,r,e)}}function kr(t,r,e){if(2&r)throw Error();var n=at(r),i=Pr(t,e,n),o=i===G?7:0|i[X],a=xr(o,r);return(2&a||Lr(a)||16&a)&&(a===o||Lr(a)||q(i,a),i=Nt(i),o=0,a=Jr(a,r),Br(t,r,e,i,n)),(a&=-13)!==o&&q(i,a),i}function Vr(t,r){var e=lo;return Gr(Fr(t=t.m),t,void 0,e)===r?r:-1}function Fr(t){if(F)return t[D]??(t[D]=new Map);if(D in t)return t[D];var r=new Map;return Object.defineProperty(t,D,{value:r}),r}function Mr(t,r,e,n,i){var o=Fr(t),a=Gr(o,t,r,e,i);return a!==n&&(a&&(r=Br(t,r,a,void 0,i)),o.set(e,n)),r}function Gr(t,r,e,n,i){var o=t.get(n);if(null!=o)return o;o=0;for(let t=0;t<n.length;t++){let a=n[t];null!=Er(r,a,i)&&(0!==o&&(e=Br(r,e,o,void 0,i)),o=a)}return t.set(n,o),o}function Cr(t,r,e){var n=0|t[X],i=at(n),o=Er(t,e,i);if(null!=o&&o[z]===Q){if(!tt(o))return br(o),o.m;var a=o.m}else Array.isArray(o)&&(a=o);if(a){let t=0|a[X];2&t&&(a=yr(a,t))}return(a=vr(a,r))!==o&&Br(t,n,e,a,i),a}function Dr(t,r,e,n){var i=!1;if(null!=(n=Er(t,n,void 0,t=>{var n=er(t,e,r);return i=n!==t&&null!=n,n})))return i&&!tt(n)&&Sr(t,r),n}function Rr(t,r,e){var n=t.m,i=0|n[X];if(null==(r=Dr(n,i,r,e)))return r;if(!tt(t,i=0|n[X])){let o=wr(r);o!==r&&(br(t)&&(i=0|(n=t.m)[X]),Sr(n,i=Br(n,i,e,r=o)))}return r}function Wr(t,r,e,n,i,o,a,s){var u=tt(t,e);o=u?1:o,a=!!a||3===o,u=s&&!u,(2===o||u)&&br(t)&&(e=0|(r=t.m)[X]);var l=(t=Pr(r,i))===G?7:0|t[X],h=xr(l,e);if(s=!(4&h)){var c=t,f=e;let r=!!(2&h);r&&(f|=2);let i=!r,o=!0,a=0,s=0;for(;a<c.length;a++){let t=er(c[a],n,f);if(t instanceof n){if(!r){let r=tt(t);i&&=!r,o&&=r}c[s++]=t}}s<a&&(c.length=s),h|=4,h=o?-4097&h:4096|h,h=i?8|h:-9&h}if(h!==l&&(q(t,h),2&h&&Object.freeze(t)),u&&!(8&h||!t.length&&(1===o||4===o&&(2&h||!(16&h)&&32&e)))){for(Lr(h)&&(t=Nt(t),h=Jr(h,e),e=Br(r,e,i,t)),n=t,u=h,l=0;l<n.length;l++)(c=n[l])!==(h=wr(c))&&(n[l]=h);u|=8,q(t,h=u=n.length?4096|u:-4097&u)}return Ur(t,h,r,e,i,o,s,a)}function Hr(t,r){var e=t.m;return Wr(t,e,0|e[X],r,1,void 0===nt?2:4,!1,!0)}function $r(t){return null==t&&(t=void 0),t}function zr(t,r,e,n,i){return Tr(t,e,n=$r(n),i),n&&!tt(n)&&Sr(t.m),t}function Kr(t,r,e,n){t:{var i=n=$r(n);_r(t);let o=t.m,a=0|o[X];if(null==i){let t=Fr(o);if(Gr(t,o,a,e)!==r)break t;t.set(e,0)}else a=Mr(o,a,e,r);Br(o,a,r,i)}return n&&!tt(n)&&Sr(t.m),t}function Jr(t,r){return-273&(t=2&r?2|t:-3&t)}function Xr(t,r,e,n){_r(t);var i=t.m;t=Wr(t,i,0|i[X],e,r,2,!0),n=null!=n?n:new e,t.push(n),r=e=t===G?7:0|t[X],(n=tt(n))?(e&=-9,1===t.length&&(e&=-4097)):e|=4096,e!==r&&q(t,e),n||Sr(i)}function Yr(t,r,e){if(null!=e)t:{if(!Dt(e))throw O("int64");switch(typeof e){case"string":e=Jt(e);break t;case"bigint":e=ft(Ot(64,e));break t;default:e=Xt(e)}}return Tr(t,r,e)}function Zr(t,r,e){return Tr(t,r,null==e?e:function(t){if(!Dt(t))throw O("uint64");switch(typeof t){case"string":var r=Mt(Number(t));return Vt(r)&&r>=0?t=ft(r):(-1!==(r=t.indexOf("."))&&(t=t.substring(0,r)),t=V()?ft(kt(64,BigInt(t))):ft(Ht(t))),t;case"bigint":return ft(kt(64,t));default:return Vt(t)?t=ft(zt(t)):((t=Mt(t))>=0&&Vt(t)?t=String(t):(It(t),t=Bt(_t,St)),t=ft(t)),t}}(e))}function qr(t,r,e){if(null!=e){if(!Ft(e))throw O("enum");e|=0}return Tr(t,r,e)}function Qr(t,r,e){_r(t);var n=t.m,i=0|n[X],o=tt(t,i)?1:2;2===o&&br(t)&&(i=0|(n=t.m)[X]);var a=(t=Pr(n,r))===G?7:0|t[X],s=xr(a,i),u=!(4&s);if(u){4&s&&(t=Nt(t),a=0,s=Jr(s,i),i=Br(n,i,r,t));let e=0,o=0;for(;e<t.length;e++){let r=rr(t[e]);null!=r&&(t[o++]=r)}o<e&&(t.length=o),s=-513&s|4,s&=-1025,s&=-4097}s!==a&&(q(t,s),2&s&&Object.freeze(t)),(t=Ur(t,s,n,i,r,o,u,!0)).push(Qt(e))}var te=class{constructor(t,r,e){if(this.buffer=t,e&&!r)throw Error();this.h=r}};function re(t,r){if("string"==typeof t)return new te(j(t),r);if(Array.isArray(t))return new te(new Uint8Array(t),r);if(t.constructor===Uint8Array)return new te(t,!1);if(t.constructor===ArrayBuffer)return t=new Uint8Array(t),new te(t,!1);if(t.constructor===P)return r=B(t)||new Uint8Array(0),new te(r,!0,t);if(t instanceof Uint8Array)return t=t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new te(t,!1);throw Error()}function ee(t,r){var e=0,n=0,i=0,o=t.j,a=t.h;do{var s=o[a++];e|=(127&s)<<i,i+=7}while(i<32&&128&s);if(i>32)for(n|=(127&s)>>4,i=3;i<32&&128&s;i+=7)n|=(127&(s=o[a++]))<<i;if(ue(t,a),!(128&s))return r(e>>>0,n>>>0);throw Error()}function ne(t){for(var r=0,e=t.h,n=e+10,i=t.j;e<n;){let n=i[e++];if(r|=n,!(128&n))return ue(t,e),!!(127&r)}throw Error()}function ie(t){var r=t.j,e=t.h,n=r[e++],i=127&n;if(128&n&&(i|=(127&(n=r[e++]))<<7,128&n&&(i|=(127&(n=r[e++]))<<14,128&n&&(i|=(127&(n=r[e++]))<<21,128&n&&(i|=(n=r[e++])<<28,128&n&&128&r[e++]&&128&r[e++]&&128&r[e++]&&128&r[e++]&&128&r[e++])))))throw Error();return ue(t,e),i}function oe(t){return ee(t,Tt)}function ae(t){var r=t.j,e=t.h,n=r[e],i=r[e+1],o=r[e+2];return r=r[e+3],ue(t,t.h+4),(n|i<<8|o<<16|r<<24)>>>0}function se(t){return ie(t)}function ue(t,r){if(t.h=r,r>t.l)throw Error()}function le(t,r){if(r<0)throw Error();var e=t.h;if((r=e+r)>t.l)throw Error();return t.h=r,e}function he(t,r){if(0==r)return T();var e=le(t,r);return t.L&&t.u?e=t.j.subarray(e,e+r):(t=t.j,e=e===(r=e+r)?new Uint8Array(0):bt?t.slice(e,r):new Uint8Array(t.subarray(e,r))),0==e.length?T():new P(e,E)}var ce=class{constructor(t,r,e,n){this.j=null,this.u=!1,this.h=this.l=this.o=0,this.init(t,r,e,n)}init(t,r,e,{L:n=!1,O:i=!1}={}){this.L=n,this.O=i,t&&(t=re(t,this.O),this.j=t.buffer,this.u=t.h,this.o=r||0,this.l=void 0!==e?this.o+e:this.j.length,this.h=this.o)}clear(){this.j=null,this.u=!1,this.h=this.l=this.o=0,this.L=!1}},fe=[],de=0;function ve(t,r,e,n){if(Ie.length){let i=Ie.pop();return i.v(n),i.h.init(t,r,e,n),i}return new Ae(t,r,e,n)}function pe(t){t.h.clear(),t.l=-1,t.j=-1,Ie.length<100&&Ie.push(t)}function ge(t){var r=t.h;if(r.h==r.l)return!1;t.o=t.h.h;var e=ie(t.h)>>>0;if(r=e>>>3,!((e&=7)>=0&&e<=5))throw Error();if(r<1)throw Error();return t.l=r,t.j=e,!0}function me(t){try{switch(t.j){case 0:0!=t.j?me(t):ne(t.h);break;case 1:var r=t.h;ue(r,r.h+8);break;case 2:if(2!=t.j)me(t);else{var e=ie(t.h)>>>0,n=t.h;ue(n,n.h+e)}break;case 5:var i=t.h;ue(i,i.h+4);break;case 3:ye();let o=t.l;try{for(;;){if(!ge(t))throw Error();if(4==t.j){if(t.l!=o)throw Error();break}me(t)}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{de>0&&de--}break;default:throw Error()}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}}function ye(){if(de>=100)throw new SyntaxError;de++}function we(t,r,e){var n=t.h.l,i=ie(t.h)>>>0,o=(i=t.h.h+i)-n;if(o<=0&&(t.h.l=i,e(r,t,void 0,void 0,void 0),o=i-t.h.h),o)throw Error();t.h.h=i,t.h.l=n}function be(t){var r=ie(t.h)>>>0,o=le(t=t.h,r);if(t=t.j,s){var u,l=t;(u=i)||(u=i=new TextDecoder("utf-8",{fatal:!0})),r=o+r,l=0===o&&r===l.length?l:l.subarray(o,r);try{var h=u.decode(l)}catch(t){if(void 0===a){try{u.decode(new Uint8Array([128]))}catch(t){}try{u.decode(new Uint8Array([97])),a=!0}catch(t){a=!1}}throw!a&&(i=void 0),t}}else{r=(h=o)+r,o=[];let i,a=null;for(;h<r;){var c=t[h++];c<128?o.push(c):c<224?h>=r?e():(i=t[h++],c<194||128!=(192&i)?(h--,e()):o.push((31&c)<<6|63&i)):c<240?h>=r-1?e():(i=t[h++],128!=(192&i)||224===c&&i<160||237===c&&i>=160||128!=(192&(u=t[h++]))?(h--,e()):o.push((15&c)<<12|(63&i)<<6|63&u)):c<=244?h>=r-2?e():(i=t[h++],128!=(192&i)||i-144+(c<<28)>>30||128!=(192&(u=t[h++]))||128!=(192&(l=t[h++]))?(h--,e()):(c=(7&c)<<18|(63&i)<<12|(63&u)<<6|63&l,c-=65536,o.push(55296+(c>>10&1023),56320+(1023&c)))):e(),o.length>=8192&&(a=n(a,o),o.length=0)}h=n(a,o)}return h}function _e(t){var r=ie(t.h)>>>0;return he(t.h,r)}function Se(t,r,e){var n=ie(t.h)>>>0;for(n=t.h.h+n;t.h.h<n;)e.push(r(t.h))}var Ae=class{constructor(t,r,e,n){if(fe.length){let i=fe.pop();i.init(t,r,e,n),t=i}else t=new ce(t,r,e,n);this.h=t,this.o=this.h.h,this.j=this.l=-1,this.v(n)}v({R:t=!1}={}){this.R=t}},Ie=[];function je(t){return new Be(4294967295&t,Math.floor(t/4294967296))}function Ee(t){return t?/^\d+$/.test(t)?(xt(t),new Be(_t,St)):null:Te||=new Be(0,0)}var Te,Be=class{constructor(t,r){this.j=t>>>0,this.h=r>>>0}};function Ue(t){return new Ge(4294967295&t,Math.floor(t/4294967296))}function Pe(t){return t?/^-?\d+$/.test(t)?(xt(t),new Ge(_t,St)):null:xe||=new Ge(0,0)}var xe,Le,Ne,Oe,ke,Ve,Fe,Me,Ge=class{constructor(t,r){this.j=t>>>0,this.h=r>>>0}};function Ce(t,r,e){return"undefined"!=typeof BigInt64Array?(Fe||(Fe=new BigInt64Array(1),Me=new Uint32Array(Fe.buffer),Fe[0]=BigInt(1),Ve=1===Me[0]),Fe[0]=t,new r(Me[t=Ve?0:1],Me[1-t])):(ke||(Le=BigInt(Number.MIN_SAFE_INTEGER),Ne=BigInt(Number.MAX_SAFE_INTEGER),Oe=BigInt(4294967295),ke=BigInt(32)),t>=Le&&t<=Ne?e(Number(t)):(t=BigInt.asUintN(64,t),new r(Number(t&Oe),Number(t>>ke))))}function De(t,r,e){for(;e>0||r>127;)t.h.push(127&r|128),r=(r>>>7|e<<25)>>>0,e>>>=7;t.h.push(r)}function Re(t,r){for(;r>127;)t.h.push(127&r|128),r>>>=7;t.h.push(r)}function We(t,r){if(r>=0)Re(t,r);else{for(let e=0;e<9;e++)t.h.push(127&r|128),r>>=7;t.h.push(1)}}function He(t,r){xt(r),function(t){var r=St>>31;t(_t<<1^r,(St<<1|_t>>>31)^r)}((r,e)=>{De(t,r>>>0,e>>>0)})}function $e(t,r){t.h.push(r>>>0&255),t.h.push(r>>>8&255),t.h.push(r>>>16&255),t.h.push(r>>>24&255)}var ze=class{constructor(){this.h=[]}length(){return this.h.length}end(){var t=this.h;return this.h=[],t}};function Ke(t,r){0!==r.length&&(t.l.push(r),t.j+=r.length)}function Je(t,r,e){Re(t.h,8*r+e)}function Xe(t,r){return Je(t,r,2),r=t.h.end(),Ke(t,r),r.push(t.j),r}function Ye(t,r){var e=r.pop();for(e=t.j+t.h.length()-e;e>127;)r.push(127&e|128),e>>>=7,t.j++;r.push(e),t.j++}function Ze(t,r,e){if(null!=e)switch(Je(t,r,0),typeof e){case"number":t=t.h,It(e),De(t,_t,St);break;case"bigint":e=Ce(e,Ge,Ue),De(t.h,e.j,e.h);break;default:e=Pe(e),De(t.h,e.j,e.h)}}function qe(t,r,e){Je(t,r,2),Re(t.h,e.length),Ke(t,t.h.end()),Ke(t,e)}var Qe=class{constructor(){this.l=[],this.j=0,this.h=new ze}};function tn(t){if("string"==typeof t)Pe(t)}function rn(){var t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var en=rn(),nn=rn(),on=rn(),an=rn(),sn=rn(),un=rn(),ln=rn(),hn=rn(),cn=rn(),fn=rn(),dn=rn(),vn=rn();var pn=class{constructor(t,r){this.m=pr(t,r,void 0,2048)}toJSON(){return dr(this)}};pn.prototype[z]=Q,pn.prototype.toString=function(){return this.m.toString()};var gn=class{constructor(t,r,e){this.h=t,this.j=r,t=en,this.l=!!t&&e===t||!1}};function mn(t,r){return new gn(t,r,en)}function yn(t,r,e,n,i){null!=(r=Pn(r,n))&&(e=Xe(t,e),i(r,t),Ye(t,e))}var wn,bn,_n=mn(function(t,r,e,n,i){return 2===t.j&&(we(t,Cr(r,n,e),i),!0)},yn),Sn=mn(function(t,r,e,n,i){return 2===t.j&&(we(t,Cr(r,n,e),i),!0)},yn),An=Symbol(),In=Symbol(),jn=Symbol(),En=Symbol(),Tn=Symbol();function Bn(t,r,e,n){var i=n[t];if(i)return i;(i={}).V=n,i.J=function(t){switch(typeof t){case"boolean":return sr||=[0,void 0,!0];case"number":return t>0?void 0:0===t?ur||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(n[0]);var o=n[1],a=1;o&&o.constructor===Object&&(i.M=o,"function"==typeof(o=n[++a])&&(i.S=!0,wn??=o,bn??=n[a+1],o=n[a+=2]));for(var s={};o&&Array.isArray(o)&&o.length&&"number"==typeof o[0]&&o[0]>0;){for(var u=0;u<o.length;u++)s[o[u]]=o;o=n[++a]}for(u=1;void 0!==o;){let t;"number"==typeof o&&(u+=o,o=n[++a]);var l=void 0;if(o instanceof gn?t=o:(t=_n,a--),t?.l){o=n[++a],l=n;var h=a;"function"==typeof o&&(o=o(),l[h]=o),l=o}for(h=u+1,"number"==typeof(o=n[++a])&&o<0&&(h-=o,o=n[++a]);u<h;u++){let n=s[u];l?e(i,u,t,l,n):r(i,u,t,n)}}return n[t]=i}function Un(t){return Array.isArray(t)?t[0]instanceof gn?t:[Sn,t]:[t,void 0]}function Pn(t,r){return t instanceof pn?t.m:Array.isArray(t)?vr(t,r):void 0}function xn(t,r,e,n){var i=e.h;t[r]=n?(t,r,e)=>i(t,r,e,n):i}function Ln(t,r,e,n,i){var o,a,s=e.h;t[r]=(t,r,e)=>s(t,r,e,a||=Bn(In,xn,Ln,n).J,o||=Nn(n),i)}function Nn(t){var r=t[jn];if(null!=r)return r;var e=Bn(In,xn,Ln,t);return r=e.S?(t,r)=>wn(t,r,e):(t,r)=>{t:{ye();try{for(;ge(r)&&4!=r.j;){let u=r.l,l=e[u];if(null==l){let t=e.M;if(t){let r=t[u];if(r){let t=kn(r);null!=t&&(l=e[u]=t)}}}if(null==l||!l(r,t,u)){var n=r;let e=n.o;if(me(n),n.R)var i=void 0;else{let t=n.h.h-e;n.h.h=e,i=he(n.h,t)}n=void 0;var o=t,a=u,s=i;s&&((n=o[R]??(o[R]=new lr))[a]??(n[a]=[])).push(s)}}let l=ir(t);l&&(l.h=e.V[Tn]);var u=!0;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{de>0&&de--}u=void 0}return u},t[jn]=r,t[Tn]=On.bind(t),r}function On(t,r,e,n){var i=this[In],o=this[jn],a=vr(void 0,i.J),s=ir(t);if(s){var u=!1,l=i.M;if(l){if(i=(r,e,i)=>{if(0!==i.length)if(l[e])for(let t of i){r=ve(t);try{u=!0,o(a,r)}finally{pe(r)}}else n?.(t,e,i)},null==r)or(s,i);else if(null!=s){let t=s[r];t&&i(s,r,t)}if(u){let n=0|t[X];if(2&n&&2048&n&&!e?.ka)throw Error();let i=at(n),o=(r,o)=>{if(null!=Er(t,r,i)){if(1===e?.ja)return;throw Error()}null!=o&&(n=Br(t,n,r,o,i)),delete s[r]};null==r?it(a,0|a[X],(t,r)=>{o(t,r)}):o(r,Er(a,r,i))}}}}function kn(t){var r=(t=Un(t))[0].h;if(t=t[1]){let e=Nn(t),n=Bn(In,xn,Ln,t).J;return(t,i,o)=>r(t,i,o,n,e)}return r}function Vn(t,r,e){t[r]=e.j}function Fn(t,r,e,n){var i,o,a=e.j;t[r]=(t,r,e)=>a(t,r,e,o||=Bn(An,Vn,Fn,n).J,i||=Mn(n))}function Mn(t){var r=t[En];if(!r){let e=Bn(An,Vn,Fn,t);r=(t,r)=>Gn(t,r,e),t[En]=r}return r}function Gn(t,r,e){it(t,0|t[X],(t,n)=>{if(null!=n){var i=function(t,r){var e=t[r];if(e)return e;if((e=t.M)&&(e=e[r])){var n=(e=Un(e))[0].j;if(e=e[1]){let r=Mn(e),i=Bn(An,Vn,Fn,e).J;e=t.S?bn(i,r):(t,e,o)=>n(t,e,o,i,r)}else e=n;return t[r]=e}}(e,t);i?i(r,n,t):t<500||k(H,3)}}),(t=ir(t))&&or(t,(t,e,n)=>{for(Ke(r,r.h.end()),t=0;t<n.length;t++)Ke(r,B(n[t])||new Uint8Array(0))})}var Cn=ft(0);function Dn(t,r,e){if(Array.isArray(r)){var n=0|r[X];if(4&n)return r;for(var i=0,o=0;i<r.length;i++){let e=t(r[i]);null!=e&&(r[o++]=e)}return o<i&&(r.length=o),t=1|n,e&&(t=-1537&t|4),t!==n&&q(r,t),e&&2&t&&Object.freeze(r),r}}var Rn=(t,r)=>{var e=new Qe;Gn(t.m,e,Bn(An,Vn,Fn,r)),Ke(e,e.h.end()),t=new Uint8Array(e.j);var n=(r=e.l).length,i=0;for(let e=0;e<n;e++){let n=r[e];t.set(n,i),i+=n.length}return e.l=[t],t};function Wn(t,r,e){return new gn(t,r,e)}function Hn(t,r,e){return new gn(t,r,e)}function $n(t,r,e){Br(t,0|t[X],r,e,at(0|t[X]))}function zn(t,r,e){null!=(r=Zt(r))&&(tn(r),Ze(t,e,r))}function Kn(t,r,e){null!=(r=Rt(r))&&null!=r&&(Je(t,e,0),We(t.h,r))}function Jn(t,r,e){null!=(r=null==r||"boolean"==typeof r?r:"number"==typeof r?!!r:void 0)&&(Je(t,e,0),t.h.h.push(r?1:0))}function Xn(t,r,e){null!=(r=rr(r))&&qe(t,e,l(r))}function Yn(t,r,e,n,i){null!=(r=Pn(r,n))&&(e=Xe(t,e),i(r,t),Ye(t,e))}function Zn(t,r,e){null!=(r=qt(r))&&qe(t,e,re(r,!0).buffer)}function qn(t,r,e){r=function(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Ft(t)?t>>>0:void 0}(r),null!=r&&null!=r&&(Je(t,e,0),Re(t.h,r))}function Qn(t,r,e){null!=(r=Rt(r))&&(r=parseInt(r,10),Je(t,e,0),We(t.h,r))}function ti(t,r,e){return 0===t.j&&($n(r,e,oe(t.h)),!0)}function ri(t,r,e){return(0===t.j||2===t.j)&&(r=kr(r,0|r[X],e),2==t.j?Se(t,ie,r):r.push(ie(t.h)),!0)}function ei(t,r,e){return 2===t.j&&($n(r,e,(t=_e(t))===T()?void 0:t),!0)}var ni=Wn(function(t,r,e){if(1!==t.j)return!1;var n=t.h;t=ae(n);var i=ae(n);n=2*(i>>31)+1;var o=i>>>20&2047;return t=4294967296*(1048575&i)+t,$n(r,e,2047==o?t?NaN:n*(1/0):0==o?5e-324*n*t:n*Math.pow(2,o-1075)*(t+4503599627370496)),!0},function(t,r,e){null!=(r=Gt(r))&&(Je(t,e,1),t=t.h,(e=wt||=new DataView(new ArrayBuffer(8))).setFloat64(0,+r,!0),_t=e.getUint32(0,!0),St=e.getUint32(4,!0),$e(t,_t),$e(t,St))},fn),ii=Wn(function(t,r,e){if(5!==t.j)return!1;var n=ae(t.h);t=2*(n>>31)+1;var i=n>>>23&255;return n&=8388607,$n(r,e,255==i?n?NaN:t*(1/0):0==i?1401298464324817e-60*t*n:t*Math.pow(2,i-150)*(n+8388608)),!0},function(t,r,e){null!=(r=Gt(r))&&(Je(t,e,5),t=t.h,(e=wt||=new DataView(new ArrayBuffer(8))).setFloat32(0,+r,!0),St=0,$e(t,_t=e.getUint32(0,!0)))},cn),oi=Wn(function(t,r,e){return ti(t,r,e)},zn,un),ai=Wn(function(t,r,e){return ti(t,r,e)},zn,un),si=Hn(function(t,r,e){return 0!==t.j&&2!==t.j?t=!1:(r=kr(r,0|r[X],e),2==t.j?Se(t,oe,r):r.push(oe(t.h)),t=!0),t},function(t,r,e){if(null!=(r=Dn(Zt,r,!1)))for(let n=0;n<r.length;n++)Ze(t,e,r[n])},un),ui=Wn(function(t,r,e){return 0!==t.j?r=!1:($n(r,e,(t=oe(t.h))===Cn?void 0:t),r=!0),r},zn,un),li=Wn(function(t,r,e){return 0!==t.j?t=!1:($n(r,e,ee(t.h,Et)),t=!0),t},function(t,r,e){if(r=function(t){if(null==t)return t;var r=typeof t;if("bigint"===r)return String(kt(64,t));if(Dt(t)){if("string"===r)return r=Mt(Number(t)),Vt(r)&&r>=0?t=String(r):(-1!==(r=t.indexOf("."))&&(t=t.substring(0,r)),t=Ht(t)),t;if("number"===r)return zt(t)}}(r),null!=r){if("string"==typeof r)Ee(r);if(null!=r)switch(Je(t,e,0),typeof r){case"number":t=t.h,It(r),De(t,_t,St);break;case"bigint":e=Ce(r,Be,je),De(t.h,e.j,e.h);break;default:e=Ee(r),De(t.h,e.j,e.h)}}},ln),hi=Wn(function(t,r,e){return 0===t.j&&($n(r,e,ie(t.h)),!0)},Kn,an),ci=Hn(ri,function(t,r,e){if(null!=(r=Dn(Rt,r,!0)))for(let a=0;a<r.length;a++){var n=t,i=e,o=r[a];null!=o&&(Je(n,i,0),We(n.h,o))}},an),fi=Hn(ri,function(t,r,e){if(null!=(r=Dn(Rt,r,!0))&&r.length){e=Xe(t,e);for(let e=0;e<r.length;e++)We(t.h,r[e]);Ye(t,e)}},an),di=Wn(function(t,r,e){return 0===t.j&&($n(r,e,0===(t=ie(t.h))?void 0:t),!0)},Kn,an),vi=Wn(function(t,r,e){return 0===t.j&&($n(r,e,ne(t.h)),!0)},Jn,nn),pi=Wn(function(t,r,e){return 0===t.j&&($n(r,e,!1===(t=ne(t.h))?void 0:t),!0)},Jn,nn),gi=Hn(function(t,r,e){return 2===t.j&&(t=be(t),kr(r,0|r[X],e).push(t),!0)},function(t,r,e){if(null!=(r=Dn(rr,r,!0)))for(let a=0;a<r.length;a++){var n=t,i=e,o=r[a];null!=o&&qe(n,i,l(o))}},on),mi=Wn(function(t,r,e){return 2===t.j&&($n(r,e,""===(t=be(t))?void 0:t),!0)},Xn,on),yi=Wn(function(t,r,e){return 2===t.j&&($n(r,e,be(t)),!0)},Xn,on),wi=function(t,r,e=en){return new gn(t,r,e)}(function(t,r,e,n,i){return 2===t.j&&(n=vr(void 0,n),kr(r,0|r[X],e).push(n),we(t,n,i),!0)},function(t,r,e,n,i){if(Array.isArray(r)){for(let o=0;o<r.length;o++)Yn(t,r[o],e,n,i);1&(t=0|r[X])||q(r,1|t)}}),bi=mn(function(t,r,e,n,i,o){if(2!==t.j)return!1;var a=0|r[X];return Mr(r,a,o,e,at(a)),we(t,r=Cr(r,n,e),i),!0},Yn),_i=Wn(function(t,r,e){return 2===t.j&&($n(r,e,_e(t)),!0)},Zn,dn),Si=Hn(function(t,r,e){return 2===t.j&&(t=_e(t),kr(r,0|r[X],e).push(t),!0)},function(t,r,e){if(null!=(r=Dn(qt,r,!1)))for(let a=0;a<r.length;a++){var n=t,i=e,o=r[a];null!=o&&qe(n,i,re(o,!0).buffer)}},dn),Ai=Wn(function(t,r,e){return 0===t.j&&($n(r,e,ie(t.h)>>>0),!0)},qn,sn),Ii=Wn(function(t,r,e){return 0===t.j&&($n(r,e,0===(t=ie(t.h)>>>0)?void 0:t),!0)},qn,sn),ji=Wn(function(t,r,e){return 0===t.j&&($n(r,e,ie(t.h)),!0)},Qn,vn),Ei=Wn(function(t,r,e){return 0===t.j&&($n(r,e,0===(t=ie(t.h))?void 0:t),!0)},Qn,vn),Ti=Wn(function(t,r,e){return 0!==t.j?t=!1:($n(r,e,function(t){return ee(t,(t,r)=>{var e=-(1&t);return Tt(t=(t>>>1|r<<31)^e,r>>>1^e)})}(t.h)),t=!0),t},function(t,r,e){if(null!=(r=Zt(r))&&(tn(r),null!=r))switch(Je(t,e,0),typeof r){case"number":t=t.h,r=(e=r)<0,At(e=2*Math.abs(e)),e=_t;let n=St;r&&(0==e?0==n?n=e=4294967295:(n--,e=4294967295):e--),De(t,_t=e,St=n);break;case"bigint":t=t.h,r=r<<BigInt(1)^r>>BigInt(63),_t=Number(BigInt.asUintN(32,r)),St=Number(BigInt.asUintN(32,r>>BigInt(32))),De(t,_t,St);break;default:He(t.h,r)}},hn);function Bi(t){return function(){return Rn(this,t)}}var Ui,Pi=[0,_i,Si,vi,yi],xi=[0,mi,[0,Ei,[0,ui,di],Ei,-1,[0,ji],Ei,-1],Wn(ei,Zn,dn)],Li=[0,mi,Wn(ei,function(t,r,e){if(null!=r){if(r instanceof pn){let n=r.ma;return void(n?(r=n(r),null!=r&&qe(t,e,re(r,!0).buffer)):k(H,3))}if(Array.isArray(r))return void k(H,3)}Zn(t,r,e)},dn)],Ni=[0,1,[0,12,hi,10,vi],[0,7,[0,hi,-1]]],Oi=globalThis.trustedTypes;var ki=class{constructor(t){this.h=t}toString(){return this.h+""}};function Vi(t){var r;return void 0===Ui&&(Ui=function(){var t=null;if(!Oi)return t;try{let r=t=>t;t=Oi.createPolicy("goog#html",{createHTML:r,createScript:r,createScriptURL:r})}catch(t){}return t}()),t=(r=Ui)?r.createScriptURL(t):t,new ki(t)}function Fi(t,...r){if(0===r.length)return Vi(t[0]);var e=t[0];for(let n=0;n<r.length;n++)e+=encodeURIComponent(r[n])+t[n+1];return Vi(e)}var Mi=[0,hi,ji,vi,-1,fi,ji,-1,vi,-1],Gi=[0,ji,-1,vi],Ci=class extends pn{constructor(t){super(t)}},Di=[0,vi,yi,vi,ji,-1,Hn(function(t,r,e){return(0===t.j||2===t.j)&&(r=kr(r,0|r[X],e),2==t.j?Se(t,se,r):r.push(ie(t.h)),!0)},function(t,r,e){if(null!=(r=Dn(Rt,r,!0))&&r.length){e=Xe(t,e);for(let e=0;e<r.length;e++)We(t.h,r[e]);Ye(t,e)}},vn),yi,-1,[0,vi,-1],ji,vi,-1,Gi],Ri=class extends pn{constructor(t){super(t)}},Wi=class extends pn{constructor(t){super(t)}j(){var t=this.m;return void 0!==Dr(t,0|t[X],Ri,9)}},Hi=[0,3,vi,-1,2,[0,[2],hi,bi,[0,Ai]],[0,ji,vi,ji,vi,ji,4,[0,vi,yi,-1,vi]],[0,[3,4],yi,-1,bi,[0,hi],bi,[0,ji,-1]],[0],yi],$i=[0,yi,-2],zi=class extends pn{constructor(t){super(t)}},Ki=[0],Ji=[0,hi,vi,1,vi,-4],Xi=class extends pn{constructor(t){super(t,2)}},Yi={};Yi[336783863]=[0,yi,vi,-1,hi,[0,[1,2,3,4,5,6,7,8,9],bi,Ki,bi,Di,bi,$i,bi,Ji,bi,Mi,bi,[0,yi,-2],bi,[0,yi,ji],bi,Hi,bi,Gi],[0,yi],vi,[0,[1,3],[2,4],bi,[0,fi],-1,bi,[0,gi],-1,wi,[0,yi,-1]],yi];var Zi=[0,ui,-1,pi,-3,ui,fi,mi,di,ui,-1,pi,di,pi,-2,mi],qi=class extends pn{constructor(t){super(t,500)}v(t){return zr(this,0,7,t)}},Qi=[-1,{}],to=[0,yi,1,Qi],ro=[0,yi,gi,Qi],eo=class extends pn{constructor(t){super(t,500)}v(t){return zr(this,0,1001,t)}};eo.prototype.j=Bi([-500,wi,[-500,mi,-1,gi,-3,[-2,Yi,vi],wi,Li,di,-1,to,ro,wi,[0,mi,pi],mi,Zi,di,gi,987,gi],4,wi,[-500,yi,-1,[-1,{}],998,yi],wi,[-500,yi,gi,-1,[-2,{},vi],997,gi,-1],di,wi,[-500,yi,gi,Qi,998,gi],gi,di,to,ro,wi,[0,mi,-1,Qi],gi,-2,Zi,mi,-1,pi,[0,pi,Ii],978,Qi,wi,Li]);var no,io=class extends pn{constructor(t){super(t)}},oo=class extends pn{constructor(t){super(t)}j(){return Hr(this,io)}},ao=[0,wi,[0,hi,ii,yi,-1]],so=class extends pn{constructor(t){super(t)}},uo=class extends pn{constructor(t){super(t)}j(){var t=this.m;return void 0!==Dr(t,0|t[X],Ci,Vr(this,2))}l(){return Rr(this,Wi,Vr(this,6))}},lo=[1,2,3,4,5,6],ho=class extends pn{constructor(t){super(t)}j(){return null!=jr(this,1,void 0,Nr)}l(){return null!=rr(jr(this,2))}},co=class extends pn{constructor(t){super(t)}},fo=class extends pn{constructor(t){super(t)}};no=new class{constructor(){var t=Xi;this.h=fo,this.l=zr,this.defaultValue=void 0,this.j=null!=t.ha?ot:void 0}register(){p(this)}},Yi[451755788]=[0,[0,[0,_i,yi,[0,hi,ai,-1],[0,li,ai]],vi,[0,lo,bi,Ji,bi,Di,bi,Mi,bi,Ki,bi,$i,bi,Hi],ji],[0,yi,hi,ii,gi,-1],ni];var vo,po,go=class extends pn{constructor(t){super(t)}},mo=(vo=class extends pn{constructor(t){super(t)}},po=[0,wi,[0,1,hi,yi,ao],ai],(t,r)=>{t:{let n={O:!0};r&&Object.assign(n,r),t=ve(t,void 0,void 0,n);try{let r=new vo,n=r.m;Nn(po)(n,t);var e=r;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{pe(t)}e=void 0}return e});function yo(t){return qr(new wo,1,t)}var wo=class extends pn{constructor(t){super(t)}},bo=class extends pn{constructor(t){super(t)}},_o=[0,ji,2,li,-2,ai,wi,[0,ji,ai]],So=class extends pn{constructor(t){super(t)}},Ao=class extends pn{constructor(t){super(t)}};function Io(t){var r=new jo;return r=qr(r,1,4),qr(r,2,t)}var jo=class extends pn{constructor(t){super(t)}},Eo=[3,4,5,6,7],To=class extends pn{constructor(t){super(t)}},Bo=class extends pn{constructor(t){super(t)}};Bo.prototype.j=Bi([0,[0,ji,yi,-3,ji],[0,Eo,ji,-1,bi,[0,ji,yi,li],bi,_o,bi,[0,1,_o],bi,[0,ji],bi,[0,ji,yi,li]]]);var Uo=class{constructor(){this.h="undefined"!=typeof AbortController}async send(t,r,e){var n=this.h?new AbortController:void 0,i=n&&t.N>0?setTimeout(()=>{n.abort()},t.N):void 0;try{let i=await fetch(t.url,{method:t.da,headers:{...t.ca},...t.body&&{body:t.body},...t.withCredentials&&{credentials:"include"},signal:t.N&&n?n.signal:null});200===i.status?r?.(await i.text()):e?.(i.status)}catch(t){if("AbortError"===t?.name)e?.(408);else e?.(400)}finally{clearTimeout(i)}}},Po=class extends pn{constructor(t){super(t,37)}},xo=[-4,{},Ni,ji,xi],Lo=[0,yi,ji,1,yi,-1,ji,1,ji,1,ai],No=[0,ji,yi,-2],Oo=[0,yi,ji],ko=[0,yi,ji],Vo=[0,vi,-3],Fo=[0,ji,yi,-1,ai,hi,-1,yi,-5,wi,[0,yi,-4],-1,vi,[0,vi,-3],ji];var Mo=class extends pn{constructor(t){super(t,19)}},Go=function(t){return r=>Rn(r,t)}([-19,{},[0,ji,1,[0,yi,-6,ai,hi,yi,-1,ai],1,[0,yi,1,yi,-5],yi,-1,[0,ji,yi,-8],[0,yi,-3],[0,yi,ji,yi,-2],[0,yi,-1,ji,yi,-1,ji,yi,-1,[0,wi,[0,yi,-1],vi,yi,-5],[0,ji,vi,hi,-2]],ai,[0,yi,-3,ai,hi,yi,-1],[0,ji,yi,-1],[0,yi,-9],[0,yi,-6,ji,yi,1,yi,vi,ji,-1,vi,yi,-2,ji,yi,ji,yi,hi,-1],1,[0,ji],1,[0,yi,-4],1,Lo,[0,[1,2,3,4,5,6],bi,Lo,bi,Oo,bi,ko,bi,[0,ji],bi,Fo,bi,No],Oo,ko,Fo,[0,[0,ji,yi,-1,ai,hi,-1,yi,-4,wi,[0,yi,-4],-1,1,Vo],[0,ji,yi,-1,ai,hi,-1,yi,-4,Vo]],No,[0,yi,[0,hi,-3,ji],ji,-2,[0,hi,-1],vi],4,[0,yi,ji,yi,-1,ai,ji,yi,-1,ji,hi,-1]],ji,wi,[-37,{},oi,yi,wi,[0,yi,-1],_i,1,_i,[0,gi,-1,ci,si,-1],yi,[0,hi,yi,-1],vi,hi,ai,yi,-1,Ti,Pi,oi,_i,ji,ci,ai,-1,[0,ji,-1],yi,vi,yi,fi,yi,-1,ni,1,ni,xo,vi,[0,ji,[0,ii,hi,-2],[0,ii]],[0,ji,ai]],oi,Si,yi,-1,oi,ji,-1,[0,vi,-1,ji,vi],[0,ai,-1,yi],[0,oi,vi,ai],ai,1,Ai,1,xo]),Co=class{constructor(t){this.j=[],this.o=new Uo,this.l=t??"",this.h=setInterval(()=>{this.flush()},6e4)}close(){void 0!==this.h&&(clearInterval(this.h),this.h=void 0),this.flush()}flush(t,r){if(this.error)r?.("net-send-failed");else if(0===this.j.length)t?.();else{var e=this.j;this.j=[],e=function(t){var r=new Mo;{_r(r=qr(r,2,1786));let l=r.m,h=0|l[X];if(null==t)Br(l,h,3);else{var e=t===G?7:0|t[X],n=e,i=Lr(e),o=i||Object.isFrozen(t),a=!0,s=!0;for(let r=0;r<t.length;r++){var u=t[r];i||(u=tt(u),a&&=!u,s&&=u)}i||(e=a?13:5,e=s?-4097&e:4096|e),o&&e===n||(t=Nt(t),n=0,e=Jr(e,h)),e!==n&&q(t,e),h=Br(l,h,3,t),2&e||!(4096&e||16&e)||Sr(l,h)}}return r}(e),e=Go(e),this.o.send({url:"https://odml.pa.googleapis.com/v1/log",da:"POST",N:1e4,body:e,fa:2,ca:{"Content-Type":"application/x-protobuf","x-goog-api-key":this.l},withCredentials:!1},()=>{t?.()},t=>{this.error=Error(`Logging failed with HTTP error: ${t}`),this.j=[],void 0!==this.h&&(clearInterval(this.h),this.h=void 0),r?.("net-send-failed",t)})}}};class Do{constructor(){this.I=this.B=this.H=this.A=this.D=this.F=this.C=0}}function Ro(t,r){var e=new Bo;e=zr(e,0,1,t.U),e=zr(e,0,2,r),r=Tr(r=new Po,6,et(e=e.j(),!1)),(t=t.G).error||t.j.push(r)}function Wo(t,r){var e={C:r.C-t.l.C,F:r.F-t.l.F,D:r.D-t.l.D,A:r.A-t.l.A,H:r.H-t.l.H,B:r.B,I:r.I},n=Io(1);e=Ho(t,e),Ro(t,n=Kr(n,4,Eo,e)),t.l=r}function Ho(t,r){var e=new bo;return t=Zr(t=Yr(t=qr(e,1,t.K),7,r.A),5,r.B),t=Zr(t,6,r.I),r.D>0&&Zr(t,4,r.H/r.D),0!==r.C&&(e=Yr(e=yo(3),2,r.C),Xr(t,8,wo,e)),0!==r.F&&(r=Yr(e=yo(4),2,r.F),Xr(t,8,wo,r)),t}var $o=class{constructor(t,r){this.T=performance.now(),this.o=performance.now(),this.j=new Map,this.u=0,this.h=new Do,this.l=new Do,this.G=new Co(r),this.K=function(t){switch(t){case"IMAGE":return 11;case"VIDEO":return 12;case"LIVE_STREAM":return 13;case"AUDIO_CLIPS":return 14;case"AUDIO_STREAM":return 15;default:return 10}}(t),t=new To,"undefined"==typeof window?r=0:(r=navigator.userAgent,r=/Android/i.test(r)?1:/iPhone|iPad|iPod/i.test(r)?2:/Windows/i.test(r)?5:/Macintosh/i.test(r)?4:/Linux/i.test(r)?3:0),t=Tr(t=qr(t,1,r),2,tr("")),t=Tr(t,3,tr("")),t=Tr(t,4,tr("1.1.0")),t=Tr(t,5,tr("")),this.U=qr(t,6,4)}aa(){var t=new Ao;t=Zr(t=qr(t,1,this.K),3,performance.now()-this.T),Ro(this,t=Kr(Io(0),3,Eo,t)),this.o=performance.now()}Z(){var t={...this.h,A:this.h.A+this.j.size,B:this.u,I:performance.now()-this.T};Wo(this,t);var r=new So;r=zr(r,0,2,t=Ho(this,t)),Ro(this,r=Kr(t=Io(2),5,Eo,r))}close(){var t=this.G;"function"==typeof t.close?t.close():t.flush()}};function zo(){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 Ko(t){if("function"!=typeof importScripts){let r=document.createElement("script");return r.src=t.toString(),r.crossOrigin="anonymous",new Promise((t,e)=>{r.addEventListener("load",()=>{t()},!1),r.addEventListener("error",t=>{e(t)},!1),document.body.appendChild(r)})}try{importScripts(t.toString())}catch(r){if(!(r instanceof TypeError))throw r;{let r=self.import;r?await r(t.toString()):await import(t.toString())}}}function Jo(t,r,e){t.o||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),e(r=t.i.stringToNewUTF8(r)),t.i._free(r)}function Xo(t,r,e){t.o||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");var n=new Uint32Array(r.length);for(let e=0;e<r.length;e++)n[e]=t.i.stringToNewUTF8(r[e]);r=t.i._malloc(4*n.length),t.i.HEAPU32.set(n,r>>2),e(r);for(let r of n)t.i._free(r);t.i._free(r)}function Yo(t,r,e){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[r]=e}function Zo(t,r,e){var n=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[r]=(t,r,i)=>{r?(e(n,i),n=[]):n.push(t)}}var qo=function(t){return class extends t{get P(){return this.i}X(){if("function"==typeof this.P._mediapipeLoggerGetEncodedApiKey){let t=this.P._mediapipeLoggerGetEncodedApiKey();return this.P._decodeBase64(t)}}}}(function(t){return class extends t{ba(){this.i._registerModelResourcesGraphService()}}}(class{constructor(t,r){this.l=!0,this.i=t,this.h=null,this.j=0,this.o="function"==typeof this.i._addIntToInputStream,void 0!==r?this.i.canvas=r:zo()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}async initializeGraph(t){var r=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(r),t)}setGraphFromString(t){this.setGraph((new TextEncoder).encode(t),!1)}setGraph(t,r){var e=t.length,n=this.i._malloc(e);this.i.HEAPU8.set(t,n),r?this.i._changeBinaryGraph(e,n):this.i._changeTextGraph(e,n),this.i._free(n)}configureAudio(t,r,e,n,i){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),Jo(this,n||"input_audio",n=>{Jo(this,i=i||"audio_header",i=>{this.i._configureAudio(n,i,t,r??0,e)})})}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}attachErrorListener(t){this.i.errorListener=t}attachEmptyPacketListener(t,r){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[t]=r}addAudioToStream(t,r,e){this.addAudioToStreamWithShape(t,0,0,r,e)}addAudioToStreamWithShape(t,r,e,n,i){var o=4*t.length;this.j!==o&&(this.h&&this.i._free(this.h),this.h=this.i._malloc(o),this.j=o),this.i.HEAPF32.set(t,this.h/4),Jo(this,n,t=>{this.i._addAudioToInputStream(this.h,r,e,t,i)})}addGpuBufferToStream(t,r,e){Jo(this,r,r=>{if(!this.i.canvas)throw Error("No OpenGL canvas configured.");r?this.i._bindTextureToStream(r):this.i._bindTextureToCanvas();var n=this.i.canvas.getContext("webgl2")||this.i.canvas.getContext("webgl");if(!n)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");this.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),this.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);var[i,o]=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];!this.l||i===this.i.canvas.width&&o===this.i.canvas.height||(this.i.canvas.width=i,this.i.canvas.height=o);var[a,s]=[i,o];this.i._addBoundTextureToStream(r,a,s,e)})}addBoolToStream(t,r,e){Jo(this,r,r=>{this.i._addBoolToInputStream(t,r,e)})}addDoubleToStream(t,r,e){Jo(this,r,r=>{this.i._addDoubleToInputStream(t,r,e)})}addFloatToStream(t,r,e){Jo(this,r,r=>{this.i._addFloatToInputStream(t,r,e)})}addIntToStream(t,r,e){Jo(this,r,r=>{this.i._addIntToInputStream(t,r,e)})}addUintToStream(t,r,e){Jo(this,r,r=>{this.i._addUintToInputStream(t,r,e)})}addStringToStream(t,r,e){Jo(this,r,r=>{Jo(this,t,t=>{this.i._addStringToInputStream(t,r,e)})})}addStringRecordToStream(t,r,e){Jo(this,r,r=>{Xo(this,Object.keys(t),n=>{Xo(this,Object.values(t),i=>{this.i._addFlatHashMapToInputStream(n,i,Object.keys(t).length,r,e)})})})}addProtoToStream(t,r,e,n){Jo(this,e,e=>{Jo(this,r,r=>{var i=this.i._malloc(t.length);this.i.HEAPU8.set(t,i),this.i._addProtoToInputStream(i,t.length,r,e,n),this.i._free(i)})})}addEmptyPacketToStream(t,r){Jo(this,t,t=>{this.i._addEmptyPacketToInputStream(t,r)})}addBoolVectorToStream(t,r,e){Jo(this,r,r=>{var n=this.i._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(let r of t)this.i._addBoolVectorEntry(n,r);this.i._addBoolVectorToInputStream(n,r,e)})}addDoubleVectorToStream(t,r,e){Jo(this,r,r=>{var n=this.i._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(let r of t)this.i._addDoubleVectorEntry(n,r);this.i._addDoubleVectorToInputStream(n,r,e)})}addFloatVectorToStream(t,r,e){Jo(this,r,r=>{var n=this.i._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(let r of t)this.i._addFloatVectorEntry(n,r);this.i._addFloatVectorToInputStream(n,r,e)})}addIntVectorToStream(t,r,e){Jo(this,r,r=>{var n=this.i._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(let r of t)this.i._addIntVectorEntry(n,r);this.i._addIntVectorToInputStream(n,r,e)})}addUintVectorToStream(t,r,e){Jo(this,r,r=>{var n=this.i._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(let r of t)this.i._addUintVectorEntry(n,r);this.i._addUintVectorToInputStream(n,r,e)})}addStringVectorToStream(t,r,e){Jo(this,r,r=>{var n=this.i._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(let r of t)Jo(this,r,t=>{this.i._addStringVectorEntry(n,t)});this.i._addStringVectorToInputStream(n,r,e)})}addBoolToInputSidePacket(t,r){Jo(this,r,r=>{this.i._addBoolToInputSidePacket(t,r)})}addDoubleToInputSidePacket(t,r){Jo(this,r,r=>{this.i._addDoubleToInputSidePacket(t,r)})}addFloatToInputSidePacket(t,r){Jo(this,r,r=>{this.i._addFloatToInputSidePacket(t,r)})}addIntToInputSidePacket(t,r){Jo(this,r,r=>{this.i._addIntToInputSidePacket(t,r)})}addUintToInputSidePacket(t,r){Jo(this,r,r=>{this.i._addUintToInputSidePacket(t,r)})}addStringToInputSidePacket(t,r){Jo(this,r,r=>{Jo(this,t,t=>{this.i._addStringToInputSidePacket(t,r)})})}addProtoToInputSidePacket(t,r,e){Jo(this,e,e=>{Jo(this,r,r=>{var n=this.i._malloc(t.length);this.i.HEAPU8.set(t,n),this.i._addProtoToInputSidePacket(n,t.length,r,e),this.i._free(n)})})}addBoolVectorToInputSidePacket(t,r){Jo(this,r,r=>{var e=this.i._allocateBoolVector(t.length);if(!e)throw Error("Unable to allocate new bool vector on heap.");for(let r of t)this.i._addBoolVectorEntry(e,r);this.i._addBoolVectorToInputSidePacket(e,r)})}addDoubleVectorToInputSidePacket(t,r){Jo(this,r,r=>{var e=this.i._allocateDoubleVector(t.length);if(!e)throw Error("Unable to allocate new double vector on heap.");for(let r of t)this.i._addDoubleVectorEntry(e,r);this.i._addDoubleVectorToInputSidePacket(e,r)})}addFloatVectorToInputSidePacket(t,r){Jo(this,r,r=>{var e=this.i._allocateFloatVector(t.length);if(!e)throw Error("Unable to allocate new float vector on heap.");for(let r of t)this.i._addFloatVectorEntry(e,r);this.i._addFloatVectorToInputSidePacket(e,r)})}addIntVectorToInputSidePacket(t,r){Jo(this,r,r=>{var e=this.i._allocateIntVector(t.length);if(!e)throw Error("Unable to allocate new int vector on heap.");for(let r of t)this.i._addIntVectorEntry(e,r);this.i._addIntVectorToInputSidePacket(e,r)})}addUintVectorToInputSidePacket(t,r){Jo(this,r,r=>{var e=this.i._allocateUintVector(t.length);if(!e)throw Error("Unable to allocate new unsigned int vector on heap.");for(let r of t)this.i._addUintVectorEntry(e,r);this.i._addUintVectorToInputSidePacket(e,r)})}addStringVectorToInputSidePacket(t,r){Jo(this,r,r=>{var e=this.i._allocateStringVector(t.length);if(!e)throw Error("Unable to allocate new string vector on heap.");for(let r of t)Jo(this,r,t=>{this.i._addStringVectorEntry(e,t)});this.i._addStringVectorToInputSidePacket(e,r)})}attachBoolListener(t,r){Yo(this,t,r),Jo(this,t,t=>{this.i._attachBoolListener(t)})}attachBoolVectorListener(t,r){Zo(this,t,r),Jo(this,t,t=>{this.i._attachBoolVectorListener(t)})}attachIntListener(t,r){Yo(this,t,r),Jo(this,t,t=>{this.i._attachIntListener(t)})}attachIntVectorListener(t,r){Zo(this,t,r),Jo(this,t,t=>{this.i._attachIntVectorListener(t)})}attachUintListener(t,r){Yo(this,t,r),Jo(this,t,t=>{this.i._attachUintListener(t)})}attachUintVectorListener(t,r){Zo(this,t,r),Jo(this,t,t=>{this.i._attachUintVectorListener(t)})}attachDoubleListener(t,r){Yo(this,t,r),Jo(this,t,t=>{this.i._attachDoubleListener(t)})}attachDoubleVectorListener(t,r){Zo(this,t,r),Jo(this,t,t=>{this.i._attachDoubleVectorListener(t)})}attachFloatListener(t,r){Yo(this,t,r),Jo(this,t,t=>{this.i._attachFloatListener(t)})}attachFloatVectorListener(t,r){Zo(this,t,r),Jo(this,t,t=>{this.i._attachFloatVectorListener(t)})}attachStringListener(t,r){Yo(this,t,r),Jo(this,t,t=>{this.i._attachStringListener(t)})}attachStringVectorListener(t,r){Zo(this,t,r),Jo(this,t,t=>{this.i._attachStringVectorListener(t)})}attachProtoListener(t,r,e){Yo(this,t,r),Jo(this,t,t=>{this.i._attachProtoListener(t,e||!1)})}attachProtoVectorListener(t,r,e){Zo(this,t,r),Jo(this,t,t=>{this.i._attachProtoVectorListener(t,e||!1)})}attachAudioListener(t,r,e){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Yo(this,t,(t,e)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),r(t,e)}),Jo(this,t,t=>{this.i._attachAudioListener(t,e||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}})),Qo=class extends qo{};async function ta(t,r){var e=await(async(t,r,e)=>{var n=ha;if(t&&await Ko(t),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(r&&(await Ko(r),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&e&&((t=self.Module).locateFile=e.locateFile,e.mainScriptUrlOrBlob&&(t.mainScriptUrlOrBlob=e.mainScriptUrlOrBlob)),e=await self.ModuleFactory(self.Module||e),self.ModuleFactory=self.Module=void 0,new n(e,null)})(t.wasmLoaderPath,t.assetLoaderPath,{locateFile:r=>r.endsWith(".wasm")?t.wasmBinaryPath.toString():t.assetBinaryPath&&r.endsWith(".data")?t.assetBinaryPath.toString():r});return function(t,r){r=r.la??"";var e=t.h.X();t.j=new $o(r,e)}(e,r),await e.v(r),e}async function ra(t,r){return ta(t,r)}function ea(t,r){var e=Rr(t.baseOptions,ho,1)||new ho;"string"==typeof r?(Tr(e,2,tr(r)),Tr(e,1)):r instanceof Uint8Array&&(Tr(e,1,et(r,!1)),Tr(e,2)),zr(t.baseOptions,0,1,e)}function na(t,r){var e=r.baseOptions||{};if(r.baseOptions?.modelAssetBuffer&&r.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Rr(t.baseOptions,ho,1)?.j()||Rr(t.baseOptions,ho,1)?.l()||r.baseOptions?.modelAssetBuffer||r.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,r){var e=Rr(t.baseOptions,uo,3);if(!e){var n=e=new uo,i=new zi;Kr(n,4,lo,i)}"delegate"in r&&("GPU"===r.delegate?(r=e,n=new Ci,Kr(r,2,lo,n)):(r=e,n=new zi,Kr(r,4,lo,n))),zr(t.baseOptions,0,3,e)}(t,e),e.modelAssetPath)return fetch(e.modelAssetPath.toString()).then(t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${e.modelAssetPath} (${t.status})`)}).then(r=>{r=new Uint8Array(r);try{t.h.i.FS_unlink("/model.dat")}catch{}t.h.i.FS_createDataFile("/","model.dat",r,!0,!1,!1),ea(t,"/model.dat"),la(t)});if(e.modelAssetBuffer instanceof Uint8Array)ea(t,e.modelAssetBuffer);else if(e.modelAssetBuffer)return async function(t){for(var r=[],e=0;;){let{done:n,value:i}=await t.read();if(n)break;r.push(i),e+=i.length}if(0===r.length)return new Uint8Array(0);if(1===r.length)return r[0];t=new Uint8Array(e),e=0;for(let n of r)t.set(n,e),e+=n.length;return t}(e.modelAssetBuffer).then(r=>{ea(t,r),la(t)});return la(t),Promise.resolve()}function ia(t){try{let r=t.u.length;if(1===r)throw Error(t.u[0].message);if(r>1)throw Error("Encountered multiple errors: "+t.u.map(t=>t.message).join(", "))}finally{t.u=[]}}var oa=class{constructor(t){this.h=t,this.u=[],this.o=0,this.h.setAutoRenderToScreen(!1)}setGraph(t,r){this.h.attachErrorListener((t,r)=>{this.u.push(Error(r))}),this.h.ba(),this.h.setGraph(t,r),this.j?.aa(),ia(this)}finishProcessing(t){if(this.h.finishProcessing(),ia(this),this.j&&void 0!==t){var r=this.j,e=r.j.get(t);if(void 0!==e&&(r.j.delete(t),t=performance.now()-e,++r.h.D,r.h.H+=t,r.h.B=Math.max(r.h.B,t),r.u=Math.max(r.u,t),performance.now()>r.o+3e4)){for(let[n,i]of r.j.entries())t=n,i<e&&(r.h.A++,r.j.delete(t));e={...r.h,I:performance.now()-r.o},r.h.B=0,r.o=performance.now(),Wo(r,e)}}}close(){this.j?.Z(),this.j?.close(),this.h.closeGraph()}};async function aa(t,r){return ra(t,r)}oa.prototype.close=oa.prototype.close;var sa=class extends oa{constructor(){super(...arguments),this.K=48e3}ea(t){this.K=t}};function ua(t){var r={classifications:Hr(t,go).map(t=>function(t,r=-1,e=""){return{categories:t.map(t=>({index:Rt(jr(t,1))??0??-1,score:jr(t,2,void 0,Gt)??0??0,categoryName:rr(jr(t,3))??""??"",displayName:rr(jr(t,4))??""??""})),headIndex:r,headName:e}}(Rr(t,oo,4)?.j()??[],Rt(jr(t,2))??0,rr(jr(t,3))??""))};return null!=function(t){return null==t?t:"bigint"==typeof t?(dt(t)?t=Number(t):(t=Ot(64,t),t=dt(t)?Number(t):String(t)),t):Dt(t)?"number"==typeof t?$t(t):Kt(t):void 0}(jr(t,2,void 0,Yt))&&(r.timestampMs=function(t){var r=Number(t);return Number.isSafeInteger(r)?r:String(t)}(jr(t,2,void 0,Yt)??Ir)),r}function la(t){var r=new eo;Qr(r,10,"audio_in"),Qr(r,10,"sample_rate"),Qr(r,15,"timestamped_classifications");var e=new Xi;!function(t,r){var e=no,n=t.m;R&&R in n&&(n=n[R])&&delete n[451755788],e.h?e.l(t,e.h,451755788,r,e.j):e.l(t,451755788,r,e.j)}(e,t.l);var n=new qi;!function(t){var r=tr("mediapipe.tasks.audio.audio_classifier.AudioClassifierGraph");_r(t),Br(t=t.m,0|t[X],2,""===r?void 0:r)}(n),Qr(n,3,"AUDIO:audio_in"),Qr(n,3,"SAMPLE_RATE:sample_rate"),Qr(n,4,"TIMESTAMPED_CLASSIFICATIONS:timestamped_classifications"),n.v(e),Xr(r,1,qi,n),t.h.attachProtoVectorListener("timestamped_classifications",(r,e)=>{!function(t,r){r.forEach(r=>{r=mo(r),t.G.push(ua(r))})}(t,r),t.o=Math.max(t.o,e)}),t.h.attachEmptyPacketListener("timestamped_classifications",r=>{t.o=Math.max(t.o,r)}),r=r.j(),t.setGraph(new Uint8Array(r),!0)}sa.prototype.setDefaultSampleRate=sa.prototype.ea;var ha=class extends sa{constructor(t,r){super(new Qo(t,r)),this.G=[],zr(t=this.l=new fo,0,1,r=new co)}get baseOptions(){return Rr(this.l,co,1)}set baseOptions(t){zr(this.l,0,1,t)}v(t){var r=this.l,e=Rr(this.l,so,2);if(e){var n=e.m;let t=0|n[X];e=Ar(e,n,t)?mr(e,n,!0):new e.constructor(yr(n,t,!1))}else e=new so;if(void 0!==t.displayNamesLocale?Tr(e,1,tr(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Tr(e,1),void 0!==t.maxResults){if(null!=(n=t.maxResults)){if("number"!=typeof n)throw O("int32");if(!Ft(n))throw O("int32");n|=0}Tr(e,2,n)}else"maxResults"in t&&Tr(e,2);if(void 0!==t.scoreThreshold){if(null!=(n=t.scoreThreshold)&&"number"!=typeof n)throw Error(`Value of float/double field must be a number, found ${typeof n}: ${n}`);Tr(e,3,n)}else"scoreThreshold"in t&&Tr(e,3);return void 0!==t.categoryAllowlist?Or(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&Tr(e,4),void 0!==t.categoryDenylist?Or(e,5,t.categoryDenylist):"categoryDenylist"in t&&Tr(e,5),zr(r,0,2,e),na(this,t)}W(t,r){r=r??this.K;var e=this.o+1;if(this.j&&void 0!==e){var n=Rr(this.baseOptions,uo,3);n?.j()||n?.l()?.j()?(++(n=this.j).h.F,n.j.set(e,performance.now())):(++(n=this.j).h.C,n.j.set(e,performance.now()))}return this.h.addDoubleToStream(r,"sample_rate",e),this.h.addAudioToStreamWithShape(t,1,t.length,"audio_in",e),this.G=[],this.finishProcessing(e),[...this.G]}};ha.prototype.classify=ha.prototype.W,ha.prototype.setOptions=ha.prototype.v,ha.createFromModelPath=function(t,r){return ra(t,{baseOptions:{modelAssetPath:r}})},ha.createFromModelBuffer=function(t,r){return aa(t,{baseOptions:{modelAssetBuffer:r}})},ha.createFromOptions=function(t,r){return aa(t,r)};var ca,fa=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 da(t){if(t)return!0;if(void 0===ca)try{await WebAssembly.instantiate(fa),ca=!0}catch{ca=!1}return ca}async function va(t,r,e){return{wasmLoaderPath:`${r}/${t}_${e=`wasm${e?"_module":""}${await da(e)?"":"_nosimd"}_internal`}.js`,wasmBinaryPath:`${r}/${t}_${e}.wasm`}}var pa=class{};pa.forVisionTasks=function(t,r=!1){return va("vision",t??Fi``,r)},pa.forLiteRtLmTextTasks=function(t,r=!1){return va("litertlm_text",t??Fi``,r)},pa.forTextTasks=function(t,r=!1){return va("text",t??Fi``,r)},pa.forRetrievalTasks=function(t,r=!1){return va("retrieval",t??Fi``,r)},pa.forGenAiTasks=function(t,r=!1){return va("genai",t??Fi``,r)},pa.forDecisionTasks=function(t,r=!1){return va("decision",t??Fi``,r)},pa.forAudioTasks=function(t,r=!1){return va("audio",t??Fi``,r)},pa.isSimdSupported=function(t=!1){return da(t)};export{ha as AudioClassifier,sa as AudioTaskRunner,pa as FilesetResolver,oa as TaskRunner};
1
+ var t="undefined"!=typeof self?self:{};function r(r,e){t:{for(var n=["CLOSURE_FLAGS"],i=t,o=0;o<n.length;o++)if(null==(i=i[n[o]])){n=null;break t}n=i}return null!=(r=n&&n[r])?r:e}function e(){throw Error("Invalid UTF8")}function n(t,r){return r=String.fromCharCode.apply(null,r),null==t?r:t+r}var i,o,a=void 0,s="undefined"!=typeof TextDecoder,u="undefined"!=typeof TextEncoder;function l(t){if(u)t=(o||=new TextEncoder).encode(t);else{let e=0,n=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var r=t.charCodeAt(i);if(r<128)n[e++]=r;else{if(r<2048)n[e++]=r>>6|192;else{if(r>=55296&&r<=57343){if(r<=56319&&i<t.length){let o=t.charCodeAt(++i);if(o>=56320&&o<=57343){r=1024*(r-55296)+o-56320+65536,n[e++]=r>>18|240,n[e++]=r>>12&63|128,n[e++]=r>>6&63|128,n[e++]=63&r|128;continue}i--}r=65533}n[e++]=r>>12|224,n[e++]=r>>6&63|128}n[e++]=63&r|128}}t=e===n.length?n:n.subarray(0,e)}return t}var h=r(610401301,!1),c=r(748402147,!0);function f(){var r=t.navigator;return r&&(r=r.userAgent)?r:""}var d,v=t.navigator;function p(t){return p[" "](t),t}d=v&&v.userAgentData||null,p[" "]=function(){};var g={},m=null;function y(t){var r=t.length,e=3*r/4;e%3?e=Math.floor(e):-1!="=.".indexOf(t[r-1])&&(e=-1!="=.".indexOf(t[r-2])?e-2:e-1);var n=new Uint8Array(e),i=0;return function(t,r){function e(r){for(;n<t.length;){let r=t.charAt(n++),e=m[r];if(null!=e)return e;if(!/^[\s\xa0]*$/.test(r))throw Error("Unknown base64 encoding at char: "+r)}return r}w();for(var n=0;;){let t=e(-1),n=e(0),i=e(64),o=e(64);if(64===o&&-1===t)break;r(t<<2|n>>4),64!=i&&(r(n<<4&240|i>>2),64!=o&&r(i<<6&192|o))}}(t,function(t){n[i++]=t}),i!==e?n.subarray(0,i):n}function w(){if(!m){m={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),r=["+/=","+/","-_=","-_.","-_"];for(let e=0;e<5;e++){let n=t.concat(r[e].split(""));g[e]=n;for(let t=0;t<n.length;t++){let r=n[t];void 0===m[r]&&(m[r]=t)}}}}var b="undefined"!=typeof Uint8Array,_=!(!(!!h&&(!!d&&d.brands.length>0))&&(-1!=f().indexOf("Trident")||-1!=f().indexOf("MSIE")))&&"function"==typeof btoa,S=/[-_.]/g,A={"-":"+",_:"/",".":"="};function I(t){return A[t]||""}function j(t){if(!_)return y(t);t=S.test(t)?t.replace(S,I):t,t=atob(t);var r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}var E={};function T(){return U||=new P(null,E)}function B(t){x(E);var r=t.h;return null==(r=null==r||b&&null!=r&&r instanceof Uint8Array?r:"string"==typeof r?j(r):null)?r:t.h=r}var U,P=class{constructor(t,r){if(x(r),this.h=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};function x(t){if(t!==E)throw Error("illegal external caller")}function L(t,r){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=r}var N=void 0;function O(t){return L(t=Error(t),"warning"),t}function k(r,e){if(null!=r){var n=N??={},i=n[r]||0;i>=e||(n[r]=i+1,L(r=Error(),"incident"),function(r){t.setTimeout(()=>{throw r},0)}(r))}}function V(){return"function"==typeof BigInt}var F="function"==typeof Symbol&&"symbol"==typeof Symbol();function M(t,r,e=!1){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?e&&Symbol.for&&t?Symbol.for(t):null!=t?Symbol(t):Symbol():r}var G,C=M("jas",void 0,!0),D=M(void 0,"1oa"),R=M(void 0,Symbol()),W=M(void 0,"0ubs"),H=M(void 0,"0ubsb"),$=M(void 0,"0actk"),z=M("m_m","ia",!0),K={Y:{value:0,configurable:!0,writable:!0,enumerable:!1}},J=Object.defineProperties,X=F?C:"Y",Y=[];function Z(t,r){F||X in t||J(t,K),t[X]|=r}function q(t,r){F||X in t||J(t,K),t[X]=r}q(Y,7),G=Object.freeze(Y);var Q={};function tt(t,r){return void 0===r?t.h!==rt&&!!(2&t.m[X]):!!(2&r)&&t.h!==rt}var rt={};function et(t,r){if(null!=t)if("string"==typeof t)t=t?new P(t,E):T();else if(t.constructor!==P)if(b&&null!=t&&t instanceof Uint8Array)t=t.length?new P(new Uint8Array(t),E):T();else{if(!r)throw Error();t=void 0}return t}function nt(t,r,e){var n,i=128&r?0:-1,o=t.length;(n=!!o)&&(n=null!=(n=t[o-1])&&"object"==typeof n&&n.constructor===Object);var a=o+(n?-1:0);for(r=128&r?1:0;r<a;r++)e(r-i,t[r]);if(n){t=t[o-1];for(let r in t)!isNaN(r)&&e(+r,t[r])}}Object.freeze({});var it={};function ot(t){return 128&t?it:void 0}function at(t){return t.ga=!0,t}var st=at(t=>"number"==typeof t),ut=at(t=>"string"==typeof t),lt=at(t=>"boolean"==typeof t),ht="function"==typeof t.BigInt&&"bigint"==typeof t.BigInt(0);function ct(t){var r=t;if(ut(r)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(r))throw Error(String(r))}else if(st(r)&&!Number.isSafeInteger(r))throw Error(String(r));return ht?BigInt(t):t=lt(t)?t?"1":"0":ut(t)?t.trim()||"0":String(t)}var ft=at(t=>ht?t>=vt&&t<=gt:"-"===t[0]?mt(t,dt):mt(t,pt)),dt=Number.MIN_SAFE_INTEGER.toString(),vt=ht?BigInt(Number.MIN_SAFE_INTEGER):void 0,pt=Number.MAX_SAFE_INTEGER.toString(),gt=ht?BigInt(Number.MAX_SAFE_INTEGER):void 0;function mt(t,r){if(t.length>r.length)return!1;if(t.length<r.length||t===r)return!0;for(let e=0;e<t.length;e++){let n=t[e],i=r[e];if(n>i)return!1;if(n<i)return!0}}var yt,wt="function"==typeof Uint8Array.prototype.slice,bt=0,_t=0;function St(t){var r=t>>>0;bt=r,_t=(t-r)/4294967296>>>0}function At(t){if(t<0){St(-t);let[r,e]=xt(bt,_t);bt=r>>>0,_t=e>>>0}else St(t)}function It(t,r){var e=4294967296*r+(t>>>0);return Number.isSafeInteger(e)?e:Tt(t,r)}function jt(t,r){return ct(V()?BigInt.asUintN(64,(BigInt(r>>>0)<<BigInt(32))+BigInt(t>>>0)):Tt(t,r))}function Et(t,r){return V()?ct(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(r))<<BigInt(32))+BigInt.asUintN(32,BigInt(t)))):ct(Ut(t,r))}function Tt(t,r){if(t>>>=0,(r>>>=0)<=2097151)var e=""+(4294967296*r+t);else V()?e=""+(BigInt(r)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(e=16777215&(t>>>24|r<<8))+6710656*(r=r>>16&65535),e+=8147497*r,r*=2,t>=1e7&&(e+=t/1e7>>>0,t%=1e7),e>=1e7&&(r+=e/1e7>>>0,e%=1e7),e=r+Bt(e)+Bt(t));return e}function Bt(t){return t=String(t),"0000000".slice(t.length)+t}function Ut(t,r){if(2147483648&r)if(V())t=""+(BigInt(0|r)<<BigInt(32)|BigInt(t>>>0));else{let[e,n]=xt(t,r);t="-"+Tt(e,n)}else t=Tt(t,r);return t}function Pt(t){if(t.length<16)At(Number(t));else if(V())t=BigInt(t),bt=Number(t&BigInt(4294967295))>>>0,_t=Number(t>>BigInt(32)&BigInt(4294967295));else{let r=+("-"===t[0]);_t=bt=0;let e=t.length;for(let n=r,i=(e-r)%6+r;i<=e;n=i,i+=6){let r=Number(t.slice(n,i));_t*=1e6,(bt=1e6*bt+r)>=4294967296&&(_t+=Math.trunc(bt/4294967296),_t>>>=0,bt>>>=0)}if(r){let[t,r]=xt(bt,_t);bt=t,_t=r}}}function xt(t,r){return r=~r,t?t=1+~t:r+=1,[t,r]}function Lt(t){return Array.prototype.slice.call(t)}var Nt="function"==typeof BigInt?BigInt.asIntN:void 0,Ot="function"==typeof BigInt?BigInt.asUintN:void 0,kt=Number.isSafeInteger,Vt=Number.isFinite,Ft=Math.trunc;function Mt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}var Gt=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Ct(t){switch(typeof t){case"bigint":return!0;case"number":return Vt(t);case"string":return Gt.test(t);default:return!1}}function Dt(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Vt(t)?0|t:void 0}function Rt(t){var r=t.length;return("-"===t[0]?r<20||20===r&&t<="-9223372036854775808":r<19||19===r&&t<="9223372036854775807")?t:(Pt(t),Ut(bt,_t))}function Wt(t){if("-"===t[0])var r=!1;else r=(r=t.length)<20||20===r&&t<="18446744073709551615";return r?t:(Pt(t),Tt(bt,_t))}function Ht(t){if(t=Ft(t),!kt(t)){At(t);var r=bt,e=_t;(t=2147483648&e)&&(e=~e>>>0,0==(r=1+~r>>>0)&&(e=e+1>>>0)),t="number"==typeof(r=It(r,e))?t?-r:r:t?"-"+r:r}return t}function $t(t){return(t=Ft(t))>=0&&kt(t)||(At(t),t=It(bt,_t)),t}function zt(t){var r=Ft(Number(t));return kt(r)?String(r):(-1!==(r=t.indexOf("."))&&(t=t.substring(0,r)),Rt(t))}function Kt(t){var r=Ft(Number(t));return kt(r)?ct(r):(-1!==(r=t.indexOf("."))&&(t=t.substring(0,r)),V()?ct(Nt(64,BigInt(t))):ct(Rt(t)))}function Jt(t){return kt(t)?t=ct(Ht(t)):(t=Ft(t),kt(t)?t=String(t):(At(t),t=Ut(bt,_t)),t=ct(t)),t}function Xt(t){var r=typeof t;return null==t?t:"bigint"===r?ct(Nt(64,t)):Ct(t)?"string"===r?Kt(t):Jt(t):void 0}function Yt(t){if(null==t)return t;var r=typeof t;if("bigint"===r)return String(Nt(64,t));if(Ct(t)){if("string"===r)return zt(t);if("number"===r)return Ht(t)}}function Zt(t){if(null==t||"string"==typeof t||t instanceof P)return t}function qt(t){if("string"!=typeof t)throw Error();return t}function Qt(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function tr(t){return null==t||"string"==typeof t?t:void 0}function rr(t,r,e){if(null!=t&&t[z]===Q)return t;if(Array.isArray(t)){var n=0|t[X];return(e=n|32&e|2&e)!==n&&q(t,e),new r(t)}}function er(t){return t}function nr(t){return R?t[R]:void 0}function ir(t,r){for(let e in t)!isNaN(e)&&r(t,+e,t[e])}var or,ar,sr,ur=class{};function lr(t,r){r<100||k(W,1)}function hr(t,r,e,n){var i=void 0!==n;n=!!n;var o,a=R;!i&&F&&a&&(o=t[a])&&ir(o,lr),a=[];var s=t.length;o=4294967295;var u=!1,l=!!(64&r),h=l?128&r?0:-1:void 0;if(!(1&r)){var c=s&&t[s-1];null!=c&&"object"==typeof c&&c.constructor===Object?o=--s:c=void 0,!l||128&r||i||(u=!0,o=(or??er)(o-h,h,t,c,void 0)+h)}r=void 0;for(var f=0;f<s;f++){let i=t[f];if(null!=i&&null!=(i=e(i,n)))if(l&&f>=o){let t=f-h;(r??={})[t]=i}else a[f]=i}if(c)for(let t in c){if(null==(s=c[t])||null==(s=e(s,n)))continue;let i;f=+t,l&&!Number.isNaN(f)&&(i=f+h)<o?a[i]=s:(r??={})[t]=s}return r&&(u?a.push(r):a[o]=r),i&&R&&(t=nr(t))&&t instanceof ur&&(a[R]=function(t){var r=new ur;return ir(t,(t,e,n)=>{r[e]=Lt(n)}),r.h=t.h,r}(t)),a}function cr(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return ft(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(Array.isArray(t)){var r=0|t[X];return 0===t.length&&1&r?void 0:hr(t,r,cr)}if(null!=t&&t[z]===Q)return fr(t);if(t instanceof P){if(null==(r=t.h))t="";else if("string"==typeof r)t=r;else{if(_){for(var e="",n=0,i=r.length-10240;n<i;)e+=String.fromCharCode.apply(null,r.subarray(n,n+=10240));e+=String.fromCharCode.apply(null,n?r.subarray(n):r),r=btoa(e)}else{void 0===e&&(e=0),w(),e=g[e],n=Array(Math.floor(r.length/3)),i=e[64]||"";let t=0,l=0;for(;t<r.length-2;t+=3){var o=r[t],a=r[t+1],s=r[t+2],u=e[o>>2];o=e[(3&o)<<4|a>>4],a=e[(15&a)<<2|s>>6],s=e[63&s],n[l++]=u+o+a+s}switch(u=0,s=i,r.length-t){case 2:s=e[(15&(u=r[t+1]))<<2]||i;case 1:r=r[t],n[l]=e[r>>2]+e[(3&r)<<4|u>>4]+s+i}r=n.join("")}t=t.h=r}return t}return}return t}function fr(t){return hr(t=t.m,0|t[X],cr)}function dr(t,r){return vr(t,r[0],r[1])}function vr(t,r,e,n=0){if(null==t){var i=32;e?(t=[e],i|=128):t=[],r&&(i=-16760833&i|(1023&r)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(i=0|t[X],c&&1&i)throw Error("rfarr");if(2048&i&&!(2&i)&&function(){if(c)throw Error("carr");k($,5)}(),256&i)throw Error("farr");if(64&i)return(i|n)!==i&&q(t,i|n),t;if(e&&(i|=128,e!==t[0]))throw Error("mid");t:{i|=64;var o=(e=t).length;if(o){var a=o-1;let t=e[a];if(null!=t&&"object"==typeof t&&t.constructor===Object){if((a-=r=128&i?0:-1)>=1024)throw Error("pvtlmt");for(var s in t)(o=+s)<a&&(e[o+r]=t[s],delete t[s]);i=-16760833&i|(1023&a)<<14;break t}}if(r){if((s=Math.max(r,o-(128&i?0:-1)))>1024)throw Error("spvt");i=-16760833&i|(1023&s)<<14}}}return q(t,64|i|n),t}function pr(t,r){if("object"!=typeof t)return t;if(Array.isArray(t)){var e=0|t[X];return 0===t.length&&1&e?t=void 0:2&e||(!r||4096&e||16&e?t=mr(t,e,!1,r&&!(16&e)):(Z(t,34),4&e&&Object.freeze(t))),t}return null!=t&&t[z]===Q?tt(t,e=0|(r=t.m)[X])?t:Sr(t,r,e)?gr(t,r):mr(r,e):t instanceof P?t:void 0}function gr(t,r,e){return t=new t.constructor(r),e&&(t.h=rt),t.o=rt,t}function mr(t,r,e,n){return n??=!!(34&r),t=hr(t,r,pr,n),n=32,e&&(n|=2),q(t,r=16769217&r|n),t}function yr(t){var r=t.m,e=0|r[X];return tt(t,e)?Sr(t,r,e)?gr(t,r,!0):new t.constructor(mr(r,e,!1)):t}function wr(t){if(t.h!==rt)return!1;var r=t.m;return Z(r=mr(r,0|r[X]),2048),t.m=r,t.h=void 0,t.o=void 0,!0}function br(t){if(!wr(t)&&tt(t,0|t.m[X]))throw Error()}function _r(t,r){void 0===r&&(r=0|t[X]),32&r&&!(4096&r)&&q(t,4096|r)}function Sr(t,r,e){return!!(2&e)||!(!(32&e)||4096&e)&&(q(r,2|e),t.h=rt,!0)}var Ar=ct(0);function Ir(t,r,e,n){if(null!==(t=jr(t.m,r,e,n)))return t}function jr(t,r,e,n){if(-1===r)return null;var i=r+(e?0:-1),o=t.length-1;if(!(o<1+(e?0:-1))){if(i>=o){var a=t[o];if(null!=a&&"object"==typeof a&&a.constructor===Object){e=a[r];var s=!0}else{if(i!==o)return;e=a}}else e=t[i];if(n&&null!=e){if(null==(n=n(e)))return n;if(!Object.is(n,e))return s?a[r]=n:t[i]=n,n}return e}}function Er(t,r,e,n){br(t);var i=t.m;return Tr(i,0|i[X],r,e,n),t}function Tr(t,r,e,n,i){var o=e+(i?0:-1),a=t.length-1;if(a>=1+(i?0:-1)&&o>=a){let i=t[a];if(null!=i&&"object"==typeof i&&i.constructor===Object)return i[e]=n,r}return o<=a?(t[o]=n,r):(void 0!==n&&(e>=(a=(r??=0|t[X])>>14&1023||536870912)?null!=n&&(t[a+(i?0:-1)]={[e]:n}):t[o]=n),r)}function Br(t,r){return null!=(t=jr(t.m,r))&&t[z]===Q||Array.isArray(t)}function Ur(t,r,e,n,i,o,a,s){var u=r;return 1===o||4===o&&(2&r||!(16&r)&&32&n)?Lr(r)||((r|=!t.length||a&&!(4096&r)||32&n&&!(4096&r||16&r)?2:256)!==u&&q(t,r),Object.freeze(t)):(2===o&&Lr(r)&&(t=Lt(t),u=0,r=Kr(r,n),n=Tr(e,n,i,t)),Lr(r)||(s||(r|=16),r!==u&&q(t,r))),2&r||!(4096&r||16&r)||_r(e,n),t}function Pr(t,r,e){return t=jr(t,r,e),Array.isArray(t)?t:G}function xr(t,r){return 2&r&&(t|=2),1|t}function Lr(t){return!!(2&t)&&!!(4&t)||!!(256&t)}function Nr(t){return et(t,!0)}function Or(t,r,e){br(t);var n=0|(t=t.m)[X];if(null==e)Tr(t,n,r);else{var i=e===G?7:0|e[X],o=i,a=Lr(i),s=a||Object.isFrozen(e);for(a||(i=0),s||(e=Lt(e),o=0,i=Kr(i,n),s=!1),i|=5,i|=(4&i?512&i?512:1024&i?1024:0:void 0)??1024,a=0;a<e.length;a++){let t=e[a],r=qt(t);Object.is(t,r)||(s&&(e=Lt(e),o=0,i=Kr(i,n),s=!1),e[a]=r)}i!==o&&(s&&(e=Lt(e),i=Kr(i,n)),q(e,i)),Tr(t,n,r,e)}}function kr(t,r,e){if(2&r)throw Error();var n=ot(r),i=Pr(t,e,n),o=i===G?7:0|i[X],a=xr(o,r);return(2&a||Lr(a)||16&a)&&(a===o||Lr(a)||q(i,a),i=Lt(i),o=0,a=Kr(a,r),Tr(t,r,e,i,n)),(a&=-13)!==o&&q(i,a),i}function Vr(t,r){var e=so;return Gr(Fr(t=t.m),t,void 0,e)===r?r:-1}function Fr(t){if(F)return t[D]??(t[D]=new Map);if(D in t)return t[D];var r=new Map;return Object.defineProperty(t,D,{value:r}),r}function Mr(t,r,e,n,i){var o=Fr(t),a=Gr(o,t,r,e,i);return a!==n&&(a&&(r=Tr(t,r,a,void 0,i)),o.set(e,n)),r}function Gr(t,r,e,n,i){var o=t.get(n);if(null!=o)return o;o=0;for(let t=0;t<n.length;t++){let a=n[t];null!=jr(r,a,i)&&(0!==o&&(e=Tr(r,e,o,void 0,i)),o=a)}return t.set(n,o),o}function Cr(t,r,e){var n=0|t[X],i=ot(n),o=jr(t,e,i);if(null!=o&&o[z]===Q){if(!tt(o))return wr(o),o.m;var a=o.m}else Array.isArray(o)&&(a=o);if(a){let t=0|a[X];2&t&&(a=mr(a,t))}return(a=dr(a,r))!==o&&Tr(t,n,e,a,i),a}function Dr(t,r,e){var n=t.m,i=0|n[X];if(r=function(t,r,e,n){var i=!1;if(null!=(n=jr(t,n,void 0,t=>{var n=rr(t,e,r);return i=n!==t&&null!=n,n})))return i&&!tt(n)&&_r(t,r),n}(n,i,r,e),null==r)return r;if(!tt(t,i=0|n[X])){let o=yr(r);o!==r&&(wr(t)&&(i=0|(n=t.m)[X]),_r(n,i=Tr(n,i,e,r=o)))}return r}function Rr(t,r,e,n,i,o,a,s){var u=tt(t,e);o=u?1:o||4,a=!!a||3===o,u=s&&!u,(2===o||u)&&wr(t)&&(e=0|(r=t.m)[X]);var l=(t=Pr(r,i))===G?7:0|t[X],h=xr(l,e);if(s=!(4&h)){var c=t,f=e;let r=!!(2&h);r&&(f|=2);let i=!r,o=!0,a=0,s=0;for(;a<c.length;a++){let t=rr(c[a],n,f);if(t instanceof n){if(!r){let r=tt(t);i&&=!r,o&&=r}c[s++]=t}}s<a&&(c.length=s),h|=4,h=o?-4097&h:4096|h,h=i?8|h:-9&h}if(h!==l&&(q(t,h),2&h&&Object.freeze(t)),u&&!(8&h||!t.length&&(1===o||4===o&&(2&h||!(16&h)&&32&e)))){for(Lr(h)&&(t=Lt(t),h=Kr(h,e),e=Tr(r,e,i,t)),n=t,u=h,l=0;l<n.length;l++)(c=n[l])!==(h=yr(c))&&(n[l]=h);u|=8,q(t,h=u=n.length?4096|u:-4097&u)}return Ur(t,h,r,e,i,o,s,a)}function Wr(t,r){var e=t.m;return Rr(t,e,0|e[X],r,1,void 0,!1,!0)}function Hr(t){return null==t&&(t=void 0),t}function $r(t,r,e,n,i){return Er(t,e,n=Hr(n),i),n&&!tt(n)&&_r(t.m),t}function zr(t,r,e,n){t:{var i=n=Hr(n);br(t);let o=t.m,a=0|o[X];if(null==i){let t=Fr(o);if(Gr(t,o,a,e)!==r)break t;t.set(e,0)}else a=Mr(o,a,e,r);Tr(o,a,r,i)}return n&&!tt(n)&&_r(t.m),t}function Kr(t,r){return-273&(t=2&r?2|t:-3&t)}function Jr(t,r,e,n){br(t);var i=t.m;t=Rr(t,i,0|i[X],e,r,2,!0),n=null!=n?n:new e,t.push(n),r=e=t===G?7:0|t[X],(n=tt(n))?(e&=-9,1===t.length&&(e&=-4097)):e|=4096,e!==r&&q(t,e),n||_r(i)}function Xr(t,r,e){if(null!=e)t:{if(!Ct(e))throw O("int64");switch(typeof e){case"string":e=Kt(e);break t;case"bigint":e=ct(Nt(64,e));break t;default:e=Jt(e)}}return Er(t,r,e)}function Yr(t,r,e){return Er(t,r,null==e?e:function(t){if(!Ct(t))throw O("uint64");switch(typeof t){case"string":var r=Ft(Number(t));return kt(r)&&r>=0?t=ct(r):(-1!==(r=t.indexOf("."))&&(t=t.substring(0,r)),t=V()?ct(Ot(64,BigInt(t))):ct(Wt(t))),t;case"bigint":return ct(Ot(64,t));default:return kt(t)?t=ct($t(t)):((t=Ft(t))>=0&&kt(t)?t=String(t):(At(t),t=Tt(bt,_t)),t=ct(t)),t}}(e))}function Zr(t,r,e){if(null!=e){if(!Vt(e))throw O("enum");e|=0}return Er(t,r,e)}function qr(t,r,e){br(t);var n=t.m,i=0|n[X],o=tt(t,i)?1:2;2===o&&wr(t)&&(i=0|(n=t.m)[X]);var a=(t=Pr(n,r))===G?7:0|t[X],s=xr(a,i),u=!(4&s);if(u){4&s&&(t=Lt(t),a=0,s=Kr(s,i),i=Tr(n,i,r,t));let e=0,o=0;for(;e<t.length;e++){let r=tr(t[e]);null!=r&&(t[o++]=r)}o<e&&(t.length=o),s=-513&s|4,s&=-1025,s&=-4097}s!==a&&(q(t,s),2&s&&Object.freeze(t)),(t=Ur(t,s,n,i,r,o,u,!0)).push(qt(e))}var Qr=class{constructor(t,r,e){if(this.buffer=t,e&&!r)throw Error();this.h=r}};function te(t,r){if("string"==typeof t)return new Qr(j(t),r);if(Array.isArray(t))return new Qr(new Uint8Array(t),r);if(t.constructor===Uint8Array)return new Qr(t,!1);if(t.constructor===ArrayBuffer)return t=new Uint8Array(t),new Qr(t,!1);if(t.constructor===P)return r=B(t)||new Uint8Array(0),new Qr(r,!0,t);if(t instanceof Uint8Array)return t=t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Qr(t,!1);throw Error()}function re(t,r){var e=0,n=0,i=0,o=t.j,a=t.h;do{var s=o[a++];e|=(127&s)<<i,i+=7}while(i<32&&128&s);if(i>32)for(n|=(127&s)>>4,i=3;i<32&&128&s;i+=7)n|=(127&(s=o[a++]))<<i;if(se(t,a),!(128&s))return r(e>>>0,n>>>0);throw Error()}function ee(t){for(var r=0,e=t.h,n=e+10,i=t.j;e<n;){let n=i[e++];if(r|=n,!(128&n))return se(t,e),!!(127&r)}throw Error()}function ne(t){var r=t.j,e=t.h,n=r[e++],i=127&n;if(128&n&&(i|=(127&(n=r[e++]))<<7,128&n&&(i|=(127&(n=r[e++]))<<14,128&n&&(i|=(127&(n=r[e++]))<<21,128&n&&(i|=(n=r[e++])<<28,128&n&&128&r[e++]&&128&r[e++]&&128&r[e++]&&128&r[e++]&&128&r[e++])))))throw Error();return se(t,e),i}function ie(t){return re(t,Et)}function oe(t){var r=t.j,e=t.h,n=r[e],i=r[e+1],o=r[e+2];return r=r[e+3],se(t,t.h+4),(n|i<<8|o<<16|r<<24)>>>0}function ae(t){return ne(t)}function se(t,r){if(t.h=r,r>t.l)throw Error()}function ue(t,r){if(r<0)throw Error();var e=t.h;if((r=e+r)>t.l)throw Error();return t.h=r,e}function le(t,r){if(0==r)return T();var e=ue(t,r);return t.L&&t.u?e=t.j.subarray(e,e+r):(t=t.j,e=e===(r=e+r)?new Uint8Array(0):wt?t.slice(e,r):new Uint8Array(t.subarray(e,r))),0==e.length?T():new P(e,E)}var he=class{constructor(t,r,e,n){this.j=null,this.u=!1,this.h=this.l=this.o=0,this.init(t,r,e,n)}init(t,r,e,{L:n=!1,O:i=!1}={}){this.L=n,this.O=i,t&&(t=te(t,this.O),this.j=t.buffer,this.u=t.h,this.o=r||0,this.l=void 0!==e?this.o+e:this.j.length,this.h=this.o)}clear(){this.j=null,this.u=!1,this.h=this.l=this.o=0,this.L=!1}},ce=[],fe=0;function de(t,r,e,n){if(Ae.length){let i=Ae.pop();return i.v(n),i.h.init(t,r,e,n),i}return new Se(t,r,e,n)}function ve(t){t.h.clear(),t.l=-1,t.j=-1,Ae.length<100&&Ae.push(t)}function pe(t){var r=t.h;if(r.h==r.l)return!1;t.o=t.h.h;var e=ne(t.h)>>>0;if(r=e>>>3,!((e&=7)>=0&&e<=5))throw Error();if(r<1)throw Error();return t.l=r,t.j=e,!0}function ge(t){try{switch(t.j){case 0:0!=t.j?ge(t):ee(t.h);break;case 1:var r=t.h;se(r,r.h+8);break;case 2:if(2!=t.j)ge(t);else{var e=ne(t.h)>>>0,n=t.h;se(n,n.h+e)}break;case 5:var i=t.h;se(i,i.h+4);break;case 3:me();let o=t.l;try{for(;;){if(!pe(t))throw Error();if(4==t.j){if(t.l!=o)throw Error();break}ge(t)}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{fe>0&&fe--}break;default:throw Error()}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}}function me(){if(fe>=100)throw new SyntaxError;fe++}function ye(t,r,e){var n=t.h.l,i=ne(t.h)>>>0,o=(i=t.h.h+i)-n;if(o<=0&&(t.h.l=i,e(r,t,void 0,void 0,void 0),o=i-t.h.h),o)throw Error();t.h.h=i,t.h.l=n}function we(t){var r=ne(t.h)>>>0,o=ue(t=t.h,r);if(t=t.j,s){var u,l=t;(u=i)||(u=i=new TextDecoder("utf-8",{fatal:!0})),r=o+r,l=0===o&&r===l.length?l:l.subarray(o,r);try{var h=u.decode(l)}catch(t){if(void 0===a){try{u.decode(new Uint8Array([128]))}catch(t){}try{u.decode(new Uint8Array([97])),a=!0}catch(t){a=!1}}throw!a&&(i=void 0),t}}else{r=(h=o)+r,o=[];let i,a=null;for(;h<r;){var c=t[h++];c<128?o.push(c):c<224?h>=r?e():(i=t[h++],c<194||128!=(192&i)?(h--,e()):o.push((31&c)<<6|63&i)):c<240?h>=r-1?e():(i=t[h++],128!=(192&i)||224===c&&i<160||237===c&&i>=160||128!=(192&(u=t[h++]))?(h--,e()):o.push((15&c)<<12|(63&i)<<6|63&u)):c<=244?h>=r-2?e():(i=t[h++],128!=(192&i)||i-144+(c<<28)>>30||128!=(192&(u=t[h++]))||128!=(192&(l=t[h++]))?(h--,e()):(c=(7&c)<<18|(63&i)<<12|(63&u)<<6|63&l,c-=65536,o.push(55296+(c>>10&1023),56320+(1023&c)))):e(),o.length>=8192&&(a=n(a,o),o.length=0)}h=n(a,o)}return h}function be(t){var r=ne(t.h)>>>0;return le(t.h,r)}function _e(t,r,e){var n=ne(t.h)>>>0;for(n=t.h.h+n;t.h.h<n;)e.push(r(t.h))}var Se=class{constructor(t,r,e,n){if(ce.length){let i=ce.pop();i.init(t,r,e,n),t=i}else t=new he(t,r,e,n);this.h=t,this.o=this.h.h,this.j=this.l=-1,this.v(n)}v({R:t=!1}={}){this.R=t}},Ae=[];function Ie(t){return new Te(4294967295&t,Math.floor(t/4294967296))}function je(t){return t?/^\d+$/.test(t)?(Pt(t),new Te(bt,_t)):null:Ee||=new Te(0,0)}var Ee,Te=class{constructor(t,r){this.j=t>>>0,this.h=r>>>0}};function Be(t){return new Me(4294967295&t,Math.floor(t/4294967296))}function Ue(t){return t?/^-?\d+$/.test(t)?(Pt(t),new Me(bt,_t)):null:Pe||=new Me(0,0)}var Pe,xe,Le,Ne,Oe,ke,Ve,Fe,Me=class{constructor(t,r){this.j=t>>>0,this.h=r>>>0}};function Ge(t,r,e){return"undefined"!=typeof BigInt64Array?(Ve||(Ve=new BigInt64Array(1),Fe=new Uint32Array(Ve.buffer),Ve[0]=BigInt(1),ke=1===Fe[0]),Ve[0]=t,new r(Fe[t=ke?0:1],Fe[1-t])):(Oe||(xe=BigInt(Number.MIN_SAFE_INTEGER),Le=BigInt(Number.MAX_SAFE_INTEGER),Ne=BigInt(4294967295),Oe=BigInt(32)),t>=xe&&t<=Le?e(Number(t)):(t=BigInt.asUintN(64,t),new r(Number(t&Ne),Number(t>>Oe))))}function Ce(t,r,e){for(;e>0||r>127;)t.h.push(127&r|128),r=(r>>>7|e<<25)>>>0,e>>>=7;t.h.push(r)}function De(t,r){for(;r>127;)t.h.push(127&r|128),r>>>=7;t.h.push(r)}function Re(t,r){if(r>=0)De(t,r);else{for(let e=0;e<9;e++)t.h.push(127&r|128),r>>=7;t.h.push(1)}}function We(t,r){Pt(r),function(t){var r=_t>>31;t(bt<<1^r,(_t<<1|bt>>>31)^r)}((r,e)=>{Ce(t,r>>>0,e>>>0)})}function He(t,r){t.h.push(r>>>0&255),t.h.push(r>>>8&255),t.h.push(r>>>16&255),t.h.push(r>>>24&255)}var $e=class{constructor(){this.h=[]}length(){return this.h.length}end(){var t=this.h;return this.h=[],t}};function ze(t,r){0!==r.length&&(t.l.push(r),t.j+=r.length)}function Ke(t,r,e){De(t.h,8*r+e)}function Je(t,r){return Ke(t,r,2),r=t.h.end(),ze(t,r),r.push(t.j),r}function Xe(t,r){var e=r.pop();for(e=t.j+t.h.length()-e;e>127;)r.push(127&e|128),e>>>=7,t.j++;r.push(e),t.j++}function Ye(t,r,e){if(null!=e)switch(Ke(t,r,0),typeof e){case"number":t=t.h,At(e),Ce(t,bt,_t);break;case"bigint":e=Ge(e,Me,Be),Ce(t.h,e.j,e.h);break;default:e=Ue(e),Ce(t.h,e.j,e.h)}}function Ze(t,r,e){Ke(t,r,2),De(t.h,e.length),ze(t,t.h.end()),ze(t,e)}var qe=class{constructor(){this.l=[],this.j=0,this.h=new $e}};function Qe(t){if("string"==typeof t)Ue(t)}function tn(){var t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var rn=tn(),en=tn(),nn=tn(),on=tn(),an=tn(),sn=tn(),un=tn(),ln=tn(),hn=tn(),cn=tn(),fn=tn(),dn=tn();var vn=class{constructor(t,r){this.m=vr(t,r,void 0,2048)}toJSON(){return fr(this)}};vn.prototype[z]=Q,vn.prototype.toString=function(){return this.m.toString()};var pn=class{constructor(t,r,e){this.h=t,this.j=r,t=rn,this.l=!!t&&e===t||!1}};function gn(t,r){return new pn(t,r,rn)}function mn(t,r,e,n,i){null!=(r=Un(r,n))&&(e=Je(t,e),i(r,t),Xe(t,e))}var yn,wn,bn=gn(function(t,r,e,n,i){return 2===t.j&&(ye(t,Cr(r,n,e),i),!0)},mn),_n=gn(function(t,r,e,n,i){return 2===t.j&&(ye(t,Cr(r,n,e),i),!0)},mn),Sn=Symbol(),An=Symbol(),In=Symbol(),jn=Symbol(),En=Symbol();function Tn(t,r,e,n){var i=n[t];if(i)return i;(i={}).V=n,i.J=function(t){switch(typeof t){case"boolean":return ar||=[0,void 0,!0];case"number":return t>0?void 0:0===t?sr||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(n[0]);var o=n[1],a=1;o&&o.constructor===Object&&(i.M=o,"function"==typeof(o=n[++a])&&(i.S=!0,yn??=o,wn??=n[a+1],o=n[a+=2]));for(var s={};o&&Array.isArray(o)&&o.length&&"number"==typeof o[0]&&o[0]>0;){for(var u=0;u<o.length;u++)s[o[u]]=o;o=n[++a]}for(u=1;void 0!==o;){let t;"number"==typeof o&&(u+=o,o=n[++a]);var l=void 0;if(o instanceof pn?t=o:(t=bn,a--),t?.l){o=n[++a],l=n;var h=a;"function"==typeof o&&(o=o(),l[h]=o),l=o}for(h=u+1,"number"==typeof(o=n[++a])&&o<0&&(h-=o,o=n[++a]);u<h;u++){let n=s[u];l?e(i,u,t,l,n):r(i,u,t,n)}}return n[t]=i}function Bn(t){return Array.isArray(t)?t[0]instanceof pn?t:[_n,t]:[t,void 0]}function Un(t,r){return t instanceof vn?t.m:Array.isArray(t)?dr(t,r):void 0}function Pn(t,r,e,n){var i=e.h;t[r]=n?(t,r,e)=>i(t,r,e,n):i}function xn(t,r,e,n,i){var o,a,s=e.h;t[r]=(t,r,e)=>s(t,r,e,a||=Tn(An,Pn,xn,n).J,o||=Ln(n),i)}function Ln(t){var r=t[In];if(null!=r)return r;var e=Tn(An,Pn,xn,t);return r=e.S?(t,r)=>yn(t,r,e):(t,r)=>{t:{me();try{for(;pe(r)&&4!=r.j;){let u=r.l,l=e[u];if(null==l){let t=e.M;if(t){let r=t[u];if(r){let t=On(r);null!=t&&(l=e[u]=t)}}}if(null==l||!l(r,t,u)){var n=r;let e=n.o;if(ge(n),n.R)var i=void 0;else{let t=n.h.h-e;n.h.h=e,i=le(n.h,t)}n=void 0;var o=t,a=u,s=i;s&&((n=o[R]??(o[R]=new ur))[a]??(n[a]=[])).push(s)}}let l=nr(t);l&&(l.h=e.V[En]);var u=!0;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{fe>0&&fe--}u=void 0}return u},t[In]=r,t[En]=Nn.bind(t),r}function Nn(t,r,e,n){var i=this[An],o=this[In],a=dr(void 0,i.J),s=nr(t);if(s){var u=!1,l=i.M;if(l){if(i=(r,e,i)=>{if(0!==i.length)if(l[e])for(let t of i){r=de(t);try{u=!0,o(a,r)}finally{ve(r)}}else n?.(t,e,i)},null==r)ir(s,i);else if(null!=s){let t=s[r];t&&i(s,r,t)}if(u){let n=0|t[X];if(2&n&&2048&n&&!e?.ka)throw Error();let i=ot(n),o=(r,o)=>{if(null!=jr(t,r,i)){if(1===e?.ja)return;throw Error()}null!=o&&(n=Tr(t,n,r,o,i)),delete s[r]};null==r?nt(a,0|a[X],(t,r)=>{o(t,r)}):o(r,jr(a,r,i))}}}}function On(t){var r=(t=Bn(t))[0].h;if(t=t[1]){let e=Ln(t),n=Tn(An,Pn,xn,t).J;return(t,i,o)=>r(t,i,o,n,e)}return r}function kn(t,r,e){t[r]=e.j}function Vn(t,r,e,n){var i,o,a=e.j;t[r]=(t,r,e)=>a(t,r,e,o||=Tn(Sn,kn,Vn,n).J,i||=Fn(n))}function Fn(t){var r=t[jn];if(!r){let e=Tn(Sn,kn,Vn,t);r=(t,r)=>Mn(t,r,e),t[jn]=r}return r}function Mn(t,r,e){nt(t,0|t[X],(t,n)=>{if(null!=n){var i=function(t,r){var e=t[r];if(e)return e;if((e=t.M)&&(e=e[r])){var n=(e=Bn(e))[0].j;if(e=e[1]){let r=Fn(e),i=Tn(Sn,kn,Vn,e).J;e=t.S?wn(i,r):(t,e,o)=>n(t,e,o,i,r)}else e=n;return t[r]=e}}(e,t);i?i(r,n,t):t<500||k(H,3)}}),(t=nr(t))&&ir(t,(t,e,n)=>{for(ze(r,r.h.end()),t=0;t<n.length;t++)ze(r,B(n[t])||new Uint8Array(0))})}var Gn=ct(0);function Cn(t,r,e){if(Array.isArray(r)){var n=0|r[X];if(4&n)return r;for(var i=0,o=0;i<r.length;i++){let e=t(r[i]);null!=e&&(r[o++]=e)}return o<i&&(r.length=o),t=1|n,e&&(t=-1537&t|4),t!==n&&q(r,t),e&&2&t&&Object.freeze(r),r}}var Dn=(t,r)=>{var e=new qe;Mn(t.m,e,Tn(Sn,kn,Vn,r)),ze(e,e.h.end()),t=new Uint8Array(e.j);var n=(r=e.l).length,i=0;for(let e=0;e<n;e++){let n=r[e];t.set(n,i),i+=n.length}return e.l=[t],t};function Rn(t,r,e){return new pn(t,r,e)}function Wn(t,r,e){return new pn(t,r,e)}function Hn(t,r,e){Tr(t,0|t[X],r,e,ot(0|t[X]))}function $n(t,r,e){null!=(r=Yt(r))&&(Qe(r),Ye(t,e,r))}function zn(t,r,e){null!=(r=Dt(r))&&null!=r&&(Ke(t,e,0),Re(t.h,r))}function Kn(t,r,e){null!=(r=null==r||"boolean"==typeof r?r:"number"==typeof r?!!r:void 0)&&(Ke(t,e,0),t.h.h.push(r?1:0))}function Jn(t,r,e){null!=(r=tr(r))&&Ze(t,e,l(r))}function Xn(t,r,e,n,i){null!=(r=Un(r,n))&&(e=Je(t,e),i(r,t),Xe(t,e))}function Yn(t,r,e){null!=(r=Zt(r))&&Ze(t,e,te(r,!0).buffer)}function Zn(t,r,e){r=function(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Vt(t)?t>>>0:void 0}(r),null!=r&&null!=r&&(Ke(t,e,0),De(t.h,r))}function qn(t,r,e){null!=(r=Dt(r))&&(r=parseInt(r,10),Ke(t,e,0),Re(t.h,r))}function Qn(t,r,e){return 0===t.j&&(Hn(r,e,ie(t.h)),!0)}function ti(t,r,e){return(0===t.j||2===t.j)&&(r=kr(r,0|r[X],e),2==t.j?_e(t,ne,r):r.push(ne(t.h)),!0)}function ri(t,r,e){return 2===t.j&&(Hn(r,e,(t=be(t))===T()?void 0:t),!0)}var ei=Rn(function(t,r,e){if(1!==t.j)return!1;var n=t.h;t=oe(n);var i=oe(n);n=2*(i>>31)+1;var o=i>>>20&2047;return t=4294967296*(1048575&i)+t,Hn(r,e,2047==o?t?NaN:n*(1/0):0==o?5e-324*n*t:n*Math.pow(2,o-1075)*(t+4503599627370496)),!0},function(t,r,e){null!=(r=Mt(r))&&(Ke(t,e,1),t=t.h,(e=yt||=new DataView(new ArrayBuffer(8))).setFloat64(0,+r,!0),bt=e.getUint32(0,!0),_t=e.getUint32(4,!0),He(t,bt),He(t,_t))},cn),ni=Rn(function(t,r,e){if(5!==t.j)return!1;var n=oe(t.h);t=2*(n>>31)+1;var i=n>>>23&255;return n&=8388607,Hn(r,e,255==i?n?NaN:t*(1/0):0==i?1401298464324817e-60*t*n:t*Math.pow(2,i-150)*(n+8388608)),!0},function(t,r,e){null!=(r=Mt(r))&&(Ke(t,e,5),t=t.h,(e=yt||=new DataView(new ArrayBuffer(8))).setFloat32(0,+r,!0),_t=0,He(t,bt=e.getUint32(0,!0)))},hn),ii=Rn(function(t,r,e){return Qn(t,r,e)},$n,sn),oi=Rn(function(t,r,e){return Qn(t,r,e)},$n,sn),ai=Wn(function(t,r,e){return 0!==t.j&&2!==t.j?t=!1:(r=kr(r,0|r[X],e),2==t.j?_e(t,ie,r):r.push(ie(t.h)),t=!0),t},function(t,r,e){if(null!=(r=Cn(Yt,r,!1)))for(let n=0;n<r.length;n++)Ye(t,e,r[n])},sn),si=Rn(function(t,r,e){return 0!==t.j?r=!1:(Hn(r,e,(t=ie(t.h))===Gn?void 0:t),r=!0),r},$n,sn),ui=Rn(function(t,r,e){return 0!==t.j?t=!1:(Hn(r,e,re(t.h,jt)),t=!0),t},function(t,r,e){if(r=function(t){if(null==t)return t;var r=typeof t;if("bigint"===r)return String(Ot(64,t));if(Ct(t)){if("string"===r)return r=Ft(Number(t)),kt(r)&&r>=0?t=String(r):(-1!==(r=t.indexOf("."))&&(t=t.substring(0,r)),t=Wt(t)),t;if("number"===r)return $t(t)}}(r),null!=r){if("string"==typeof r)je(r);if(null!=r)switch(Ke(t,e,0),typeof r){case"number":t=t.h,At(r),Ce(t,bt,_t);break;case"bigint":e=Ge(r,Te,Ie),Ce(t.h,e.j,e.h);break;default:e=je(r),Ce(t.h,e.j,e.h)}}},un),li=Rn(function(t,r,e){return 0===t.j&&(Hn(r,e,ne(t.h)),!0)},zn,on),hi=Wn(ti,function(t,r,e){if(null!=(r=Cn(Dt,r,!0)))for(let a=0;a<r.length;a++){var n=t,i=e,o=r[a];null!=o&&(Ke(n,i,0),Re(n.h,o))}},on),ci=Wn(ti,function(t,r,e){if(null!=(r=Cn(Dt,r,!0))&&r.length){e=Je(t,e);for(let e=0;e<r.length;e++)Re(t.h,r[e]);Xe(t,e)}},on),fi=Rn(function(t,r,e){return 0===t.j&&(Hn(r,e,0===(t=ne(t.h))?void 0:t),!0)},zn,on),di=Rn(function(t,r,e){return 0===t.j&&(Hn(r,e,ee(t.h)),!0)},Kn,en),vi=Rn(function(t,r,e){return 0===t.j&&(Hn(r,e,!1===(t=ee(t.h))?void 0:t),!0)},Kn,en),pi=Wn(function(t,r,e){return 2===t.j&&(t=we(t),kr(r,0|r[X],e).push(t),!0)},function(t,r,e){if(null!=(r=Cn(tr,r,!0)))for(let a=0;a<r.length;a++){var n=t,i=e,o=r[a];null!=o&&Ze(n,i,l(o))}},nn),gi=Rn(function(t,r,e){return 2===t.j&&(Hn(r,e,""===(t=we(t))?void 0:t),!0)},Jn,nn),mi=Rn(function(t,r,e){return 2===t.j&&(Hn(r,e,we(t)),!0)},Jn,nn),yi=function(t,r,e=rn){return new pn(t,r,e)}(function(t,r,e,n,i){return 2===t.j&&(n=dr(void 0,n),kr(r,0|r[X],e).push(n),ye(t,n,i),!0)},function(t,r,e,n,i){if(Array.isArray(r)){for(let o=0;o<r.length;o++)Xn(t,r[o],e,n,i);1&(t=0|r[X])||q(r,1|t)}}),wi=gn(function(t,r,e,n,i,o){if(2!==t.j)return!1;var a=0|r[X];return Mr(r,a,o,e,ot(a)),ye(t,r=Cr(r,n,e),i),!0},Xn),bi=Rn(function(t,r,e){return 2===t.j&&(Hn(r,e,be(t)),!0)},Yn,fn),_i=Wn(function(t,r,e){return 2===t.j&&(t=be(t),kr(r,0|r[X],e).push(t),!0)},function(t,r,e){if(null!=(r=Cn(Zt,r,!1)))for(let a=0;a<r.length;a++){var n=t,i=e,o=r[a];null!=o&&Ze(n,i,te(o,!0).buffer)}},fn),Si=Rn(function(t,r,e){return 0===t.j&&(Hn(r,e,ne(t.h)>>>0),!0)},Zn,an),Ai=Rn(function(t,r,e){return 0===t.j&&(Hn(r,e,0===(t=ne(t.h)>>>0)?void 0:t),!0)},Zn,an),Ii=Rn(function(t,r,e){return 0===t.j&&(Hn(r,e,ne(t.h)),!0)},qn,dn),ji=Rn(function(t,r,e){return 0===t.j&&(Hn(r,e,0===(t=ne(t.h))?void 0:t),!0)},qn,dn),Ei=Rn(function(t,r,e){return 0!==t.j?t=!1:(Hn(r,e,function(t){return re(t,(t,r)=>{var e=-(1&t);return Et(t=(t>>>1|r<<31)^e,r>>>1^e)})}(t.h)),t=!0),t},function(t,r,e){if(null!=(r=Yt(r))&&(Qe(r),null!=r))switch(Ke(t,e,0),typeof r){case"number":t=t.h,r=(e=r)<0,St(e=2*Math.abs(e)),e=bt;let n=_t;r&&(0==e?0==n?n=e=4294967295:(n--,e=4294967295):e--),Ce(t,bt=e,_t=n);break;case"bigint":t=t.h,r=r<<BigInt(1)^r>>BigInt(63),bt=Number(BigInt.asUintN(32,r)),_t=Number(BigInt.asUintN(32,r>>BigInt(32))),Ce(t,bt,_t);break;default:We(t.h,r)}},ln);function Ti(t){return function(){return Dn(this,t)}}var Bi,Ui=[0,bi,_i,di,mi],Pi=[0,gi,[0,ji,[0,si,fi],ji,-1,[0,Ii],ji,-1],Rn(ri,Yn,fn)],xi=[0,gi,Rn(ri,function(t,r,e){if(null!=r){if(r instanceof vn){let n=r.ma;return void(n?(r=n(r),null!=r&&Ze(t,e,te(r,!0).buffer)):k(H,3))}if(Array.isArray(r))return void k(H,3)}Yn(t,r,e)},fn)],Li=[0,1,[0,12,li,10,di],[0,7,[0,li,-1]]],Ni=globalThis.trustedTypes;var Oi=class{constructor(t){this.h=t}toString(){return this.h+""}};function ki(t){var r;return void 0===Bi&&(Bi=function(){var t=null;if(!Ni)return t;try{let r=t=>t;t=Ni.createPolicy("goog#html",{createHTML:r,createScript:r,createScriptURL:r})}catch(t){}return t}()),t=(r=Bi)?r.createScriptURL(t):t,new Oi(t)}function Vi(t,...r){if(0===r.length)return ki(t[0]);var e=t[0];for(let n=0;n<r.length;n++)e+=encodeURIComponent(r[n])+t[n+1];return ki(e)}var Fi=[0,li,Ii,di,-1,ci,Ii,-1,di,-1],Mi=[0,Ii,-1,di],Gi=class extends vn{constructor(t){super(t)}},Ci=[0,di,mi,di,Ii,-1,Wn(function(t,r,e){return(0===t.j||2===t.j)&&(r=kr(r,0|r[X],e),2==t.j?_e(t,ae,r):r.push(ne(t.h)),!0)},function(t,r,e){if(null!=(r=Cn(Dt,r,!0))&&r.length){e=Je(t,e);for(let e=0;e<r.length;e++)Re(t.h,r[e]);Xe(t,e)}},dn),mi,-1,[0,di,-1],Ii,di,-1,Mi],Di=class extends vn{constructor(t){super(t)}j(){return Br(this,9)}},Ri=[0,3,di,-1,2,[0,[2],li,wi,[0,Si]],[0,Ii,di,Ii,di,Ii,4,[0,di,mi,-1,di]],[0,[3,4],mi,-1,wi,[0,li],wi,[0,Ii,-1]],[0],mi],Wi=[0,mi,-2],Hi=class extends vn{constructor(t){super(t)}},$i=[0],zi=[0,li,di,1,di,-4],Ki=class extends vn{constructor(t){super(t,2)}},Ji={};Ji[336783863]=[0,mi,di,-1,li,[0,[1,2,3,4,5,6,7,8,9],wi,$i,wi,Ci,wi,Wi,wi,zi,wi,Fi,wi,[0,mi,-2],wi,[0,mi,Ii],wi,Ri,wi,Mi],[0,mi],di,[0,[1,3],[2,4],wi,[0,ci],-1,wi,[0,pi],-1,yi,[0,mi,-1]],mi];var Xi=[0,si,-1,vi,-3,si,ci,gi,fi,si,-1,vi,fi,vi,-2,gi],Yi=class extends vn{constructor(t){super(t,500)}v(t){return $r(this,0,7,t)}},Zi=[-1,{}],qi=[0,mi,1,Zi],Qi=[0,mi,pi,Zi],to=class extends vn{constructor(t){super(t,500)}v(t){return $r(this,0,1001,t)}};to.prototype.j=Ti([-500,yi,[-500,gi,-1,pi,-3,[-2,Ji,di],yi,xi,fi,-1,qi,Qi,yi,[0,gi,vi],gi,Xi,fi,pi,987,pi],4,yi,[-500,mi,-1,[-1,{}],998,mi],yi,[-500,mi,pi,-1,[-2,{},di],997,pi,-1],fi,yi,[-500,mi,pi,Zi,998,pi],pi,fi,qi,Qi,yi,[0,gi,-1,Zi],pi,-2,Xi,gi,-1,vi,[0,vi,Ai],978,Zi,yi,xi]);var ro,eo=class extends vn{constructor(t){super(t)}},no=class extends vn{constructor(t){super(t)}j(){return Wr(this,eo)}},io=[0,yi,[0,li,ni,mi,-1]],oo=class extends vn{constructor(t){super(t)}},ao=class extends vn{constructor(t){super(t)}j(){return Br(this,Vr(this,2))}l(){return Dr(this,Di,Vr(this,6))}},so=[1,2,3,4,5,6],uo=class extends vn{constructor(t){super(t)}j(){return null!=Ir(this,1,void 0,Nr)}l(){return null!=tr(Ir(this,2))}},lo=class extends vn{constructor(t){super(t)}},ho=class extends vn{constructor(t){super(t)}};ro=new class{constructor(){var t=Ki;this.h=ho,this.l=$r,this.defaultValue=void 0,this.j=null!=t.ha?it:void 0}register(){p(this)}},Ji[451755788]=[0,[0,[0,bi,mi,[0,li,oi,-1],[0,ui,oi]],di,[0,so,wi,zi,wi,Ci,wi,Fi,wi,$i,wi,Wi,wi,Ri],Ii],[0,mi,li,ni,pi,-1],ei];var co,fo,vo=class extends vn{constructor(t){super(t)}},po=(co=class extends vn{constructor(t){super(t)}},fo=[0,yi,[0,1,li,mi,io],oi],(t,r)=>{t:{let n={O:!0};r&&Object.assign(n,r),t=de(t,void 0,void 0,n);try{let r=new co,n=r.m;Ln(fo)(n,t);var e=r;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{ve(t)}e=void 0}return e});function go(t){return Zr(new mo,1,t)}var mo=class extends vn{constructor(t){super(t)}},yo=class extends vn{constructor(t){super(t)}},wo=[0,Ii,2,ui,-2,oi,yi,[0,Ii,oi]],bo=class extends vn{constructor(t){super(t)}},_o=class extends vn{constructor(t){super(t)}};function So(t){var r=new Ao;return r=Zr(r,1,4),Zr(r,2,t)}var Ao=class extends vn{constructor(t){super(t)}},Io=[3,4,5,6,7],jo=class extends vn{constructor(t){super(t)}},Eo=class extends vn{constructor(t){super(t)}};Eo.prototype.j=Ti([0,[0,Ii,mi,-3,Ii],[0,Io,Ii,-1,wi,[0,Ii,mi,ui],wi,wo,wi,[0,1,wo],wi,[0,Ii],wi,[0,Ii,mi,ui]]]);var To=class{constructor(){this.h="undefined"!=typeof AbortController}async send(t,r,e){var n=this.h?new AbortController:void 0,i=n&&t.N>0?setTimeout(()=>{n.abort()},t.N):void 0;try{let i=await fetch(t.url,{method:t.da,headers:{...t.ca},...t.body&&{body:t.body},...t.withCredentials&&{credentials:"include"},signal:t.N&&n?n.signal:null});200===i.status?r?.(await i.text()):e?.(i.status)}catch(t){if("AbortError"===t?.name)e?.(408);else e?.(400)}finally{clearTimeout(i)}}},Bo=class extends vn{constructor(t){super(t,37)}},Uo=[-4,{},Li,Ii,Pi],Po=[0,mi,Ii],xo=[0,mi,Ii],Lo=[0,Ii,mi,-1,oi,li,-1,mi,-5,yi,[0,mi,-4],-1,di,[0,di,-3],Ii],No=[0,mi,Ii,1,mi,-1,Ii,1,Ii,1,oi],Oo=[0,Ii,mi,-2],ko=[0,di,-3];var Vo=class extends vn{constructor(t){super(t,19)}},Fo=function(t){return r=>Dn(r,t)}([-19,{},[0,Ii,1,[0,mi,-6,oi,li,mi,-1,oi],1,[0,mi,1,mi,-5],mi,-1,[0,Ii,mi,-8],[0,mi,-3],[0,mi,Ii,mi,-2],[0,mi,-1,Ii,mi,-1,Ii,mi,-1,[0,yi,[0,mi,-1],di,mi,-5],[0,Ii,di,li,-2]],oi,[0,mi,-3,oi,li,mi,-1],[0,Ii,mi,-1],[0,mi,-9],[0,mi,-6,Ii,mi,1,mi,di,Ii,-1,di,mi,-2,Ii,mi,Ii,mi,li,-1],1,[0,Ii],1,[0,mi,-4],1,No,[0,[1,2,3,4,5,6],wi,No,wi,Po,wi,xo,wi,[0,Ii],wi,Lo,wi,Oo],Po,xo,Lo,[0,[0,Ii,mi,-1,oi,li,-1,mi,-4,yi,[0,mi,-4],-1,1,ko],[0,Ii,mi,-1,oi,li,-1,mi,-4,ko]],Oo,[0,mi,[0,li,-3,Ii],Ii,-2,[0,li,-1],di],4,[0,mi,Ii,mi,-1,oi,Ii,mi,-1,Ii,li,-1]],Ii,yi,[-37,{},ii,mi,yi,[0,mi,-1],bi,1,bi,[0,pi,-1,hi,ai,-1],mi,[0,li,mi,-1],di,li,oi,mi,-1,Ei,Ui,ii,bi,Ii,hi,oi,-1,[0,Ii,-1],mi,di,mi,ci,mi,-1,ei,1,ei,Uo,di,[0,Ii,[0,ni,li,-2],[0,ni]],[0,Ii,oi]],ii,_i,mi,-1,ii,Ii,-1,[0,di,-1,Ii,di],[0,oi,-1,mi],[0,ii,di,oi],oi,1,Si,1,Uo]),Mo=class{constructor(t){this.j=[],this.o=new To,this.l=t??"",this.h=setInterval(()=>{this.flush()},6e4)}close(){void 0!==this.h&&(clearInterval(this.h),this.h=void 0),this.flush()}flush(t,r){if(this.error)r?.("net-send-failed");else if(0===this.j.length)t?.();else{var e=this.j;this.j=[],e=function(t){var r=new Vo;{br(r=Zr(r,2,1786));let l=r.m,h=0|l[X];if(null==t)Tr(l,h,3);else{var e=t===G?7:0|t[X],n=e,i=Lr(e),o=i||Object.isFrozen(t),a=!0,s=!0;for(let r=0;r<t.length;r++){var u=t[r];i||(u=tt(u),a&&=!u,s&&=u)}i||(e=a?13:5,e=s?-4097&e:4096|e),o&&e===n||(t=Lt(t),n=0,e=Kr(e,h)),e!==n&&q(t,e),h=Tr(l,h,3,t),2&e||!(4096&e||16&e)||_r(l,h)}}return r}(e),e=Fo(e),this.o.send({url:"https://odml.pa.googleapis.com/v1/log",da:"POST",N:1e4,body:e,fa:2,ca:{"Content-Type":"application/x-protobuf","x-goog-api-key":this.l},withCredentials:!1},()=>{t?.()},t=>{this.error=Error(`Logging failed with HTTP error: ${t}`),this.j=[],void 0!==this.h&&(clearInterval(this.h),this.h=void 0),r?.("net-send-failed",t)})}}};class Go{constructor(){this.I=this.B=this.H=this.A=this.D=this.F=this.C=0}}function Co(t,r){var e=new Eo;e=$r(e,0,1,t.U),e=$r(e,0,2,r),r=Er(r=new Bo,6,et(e=e.j(),!1)),(t=t.G).error||t.j.push(r)}function Do(t,r){var e={C:r.C-t.l.C,F:r.F-t.l.F,D:r.D-t.l.D,A:r.A-t.l.A,H:r.H-t.l.H,B:r.B,I:r.I},n=So(1);e=Ro(t,e),Co(t,n=zr(n,4,Io,e)),t.l=r}function Ro(t,r){var e=new yo;return t=Yr(t=Xr(t=Zr(e,1,t.K),7,r.A),5,r.B),t=Yr(t,6,r.I),r.D>0&&Yr(t,4,r.H/r.D),0!==r.C&&(e=Xr(e=go(3),2,r.C),Jr(t,8,mo,e)),0!==r.F&&(r=Xr(e=go(4),2,r.F),Jr(t,8,mo,r)),t}var Wo=class{constructor(t,r){this.T=performance.now(),this.o=performance.now(),this.j=new Map,this.u=0,this.h=new Go,this.l=new Go,this.G=new Mo(r),this.K=function(t){switch(t){case"IMAGE":return 11;case"VIDEO":return 12;case"LIVE_STREAM":return 13;case"AUDIO_CLIPS":return 14;case"AUDIO_STREAM":return 15;default:return 10}}(t),t=new jo,"undefined"==typeof window?r=0:(r=navigator.userAgent,r=/Android/i.test(r)?1:/iPhone|iPad|iPod/i.test(r)?2:/Windows/i.test(r)?5:/Macintosh/i.test(r)?4:/Linux/i.test(r)?3:0),t=Er(t=Zr(t,1,r),2,Qt("")),t=Er(t,3,Qt("")),t=Er(t,4,Qt("1.1.1")),t=Er(t,5,Qt("")),this.U=Zr(t,6,4)}aa(){var t=new _o;t=Yr(t=Zr(t,1,this.K),3,performance.now()-this.T),Co(this,t=zr(So(0),3,Io,t)),this.o=performance.now()}Z(){var t={...this.h,A:this.h.A+this.j.size,B:this.u,I:performance.now()-this.T};Do(this,t);var r=new bo;r=$r(r,0,2,t=Ro(this,t)),Co(this,r=zr(t=So(2),5,Io,r))}close(){var t=this.G;"function"==typeof t.close?t.close():t.flush()}};function Ho(){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 $o(t){if("function"!=typeof importScripts){let r=document.createElement("script");return r.src=t.toString(),r.crossOrigin="anonymous",new Promise((t,e)=>{r.addEventListener("load",()=>{t()},!1),r.addEventListener("error",t=>{e(t)},!1),document.body.appendChild(r)})}try{importScripts(t.toString())}catch(r){if(!(r instanceof TypeError))throw r;{let r=self.import;r?await r(t.toString()):await import(t.toString())}}}function zo(t,r,e){t.o||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),e(r=t.i.stringToNewUTF8(r)),t.i._free(r)}function Ko(t,r,e){t.o||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");var n=new Uint32Array(r.length);for(let e=0;e<r.length;e++)n[e]=t.i.stringToNewUTF8(r[e]);r=t.i._malloc(4*n.length),t.i.HEAPU32.set(n,r>>2),e(r);for(let r of n)t.i._free(r);t.i._free(r)}function Jo(t,r,e){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[r]=e}function Xo(t,r,e){var n=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[r]=(t,r,i)=>{r?(e(n,i),n=[]):n.push(t)}}var Yo=function(t){return class extends t{get P(){return this.i}X(){if("function"==typeof this.P._mediapipeLoggerGetEncodedApiKey){let t=this.P._mediapipeLoggerGetEncodedApiKey();return this.P._decodeBase64(t)}}}}(function(t){return class extends t{ba(){this.i._registerModelResourcesGraphService()}}}(class{constructor(t,r){this.l=!0,this.i=t,this.h=null,this.j=0,this.o="function"==typeof this.i._addIntToInputStream,void 0!==r?this.i.canvas=r:Ho()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}async initializeGraph(t){var r=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(r),t)}setGraphFromString(t){this.setGraph((new TextEncoder).encode(t),!1)}setGraph(t,r){var e=t.length,n=this.i._malloc(e);this.i.HEAPU8.set(t,n),r?this.i._changeBinaryGraph(e,n):this.i._changeTextGraph(e,n),this.i._free(n)}configureAudio(t,r,e,n,i){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),zo(this,n||"input_audio",n=>{zo(this,i=i||"audio_header",i=>{this.i._configureAudio(n,i,t,r??0,e)})})}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}attachErrorListener(t){this.i.errorListener=t}attachEmptyPacketListener(t,r){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[t]=r}addAudioToStream(t,r,e){this.addAudioToStreamWithShape(t,0,0,r,e)}addAudioToStreamWithShape(t,r,e,n,i){var o=4*t.length;this.j!==o&&(this.h&&this.i._free(this.h),this.h=this.i._malloc(o),this.j=o),this.i.HEAPF32.set(t,this.h/4),zo(this,n,t=>{this.i._addAudioToInputStream(this.h,r,e,t,i)})}addGpuBufferToStream(t,r,e){zo(this,r,r=>{if(!this.i.canvas)throw Error("No OpenGL canvas configured.");r?this.i._bindTextureToStream(r):this.i._bindTextureToCanvas();var n=this.i.canvas.getContext("webgl2")||this.i.canvas.getContext("webgl");if(!n)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");this.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),this.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);var[i,o]=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];!this.l||i===this.i.canvas.width&&o===this.i.canvas.height||(this.i.canvas.width=i,this.i.canvas.height=o);var[a,s]=[i,o];this.i._addBoundTextureToStream(r,a,s,e)})}addBoolToStream(t,r,e){zo(this,r,r=>{this.i._addBoolToInputStream(t,r,e)})}addDoubleToStream(t,r,e){zo(this,r,r=>{this.i._addDoubleToInputStream(t,r,e)})}addFloatToStream(t,r,e){zo(this,r,r=>{this.i._addFloatToInputStream(t,r,e)})}addIntToStream(t,r,e){zo(this,r,r=>{this.i._addIntToInputStream(t,r,e)})}addUintToStream(t,r,e){zo(this,r,r=>{this.i._addUintToInputStream(t,r,e)})}addStringToStream(t,r,e){zo(this,r,r=>{zo(this,t,t=>{this.i._addStringToInputStream(t,r,e)})})}addStringRecordToStream(t,r,e){zo(this,r,r=>{Ko(this,Object.keys(t),n=>{Ko(this,Object.values(t),i=>{this.i._addFlatHashMapToInputStream(n,i,Object.keys(t).length,r,e)})})})}addProtoToStream(t,r,e,n){zo(this,e,e=>{zo(this,r,r=>{var i=this.i._malloc(t.length);this.i.HEAPU8.set(t,i),this.i._addProtoToInputStream(i,t.length,r,e,n),this.i._free(i)})})}addEmptyPacketToStream(t,r){zo(this,t,t=>{this.i._addEmptyPacketToInputStream(t,r)})}addBoolVectorToStream(t,r,e){zo(this,r,r=>{var n=this.i._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(let r of t)this.i._addBoolVectorEntry(n,r);this.i._addBoolVectorToInputStream(n,r,e)})}addDoubleVectorToStream(t,r,e){zo(this,r,r=>{var n=this.i._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(let r of t)this.i._addDoubleVectorEntry(n,r);this.i._addDoubleVectorToInputStream(n,r,e)})}addFloatVectorToStream(t,r,e){zo(this,r,r=>{var n=this.i._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(let r of t)this.i._addFloatVectorEntry(n,r);this.i._addFloatVectorToInputStream(n,r,e)})}addIntVectorToStream(t,r,e){zo(this,r,r=>{var n=this.i._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(let r of t)this.i._addIntVectorEntry(n,r);this.i._addIntVectorToInputStream(n,r,e)})}addUintVectorToStream(t,r,e){zo(this,r,r=>{var n=this.i._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(let r of t)this.i._addUintVectorEntry(n,r);this.i._addUintVectorToInputStream(n,r,e)})}addStringVectorToStream(t,r,e){zo(this,r,r=>{var n=this.i._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(let r of t)zo(this,r,t=>{this.i._addStringVectorEntry(n,t)});this.i._addStringVectorToInputStream(n,r,e)})}addBoolToInputSidePacket(t,r){zo(this,r,r=>{this.i._addBoolToInputSidePacket(t,r)})}addDoubleToInputSidePacket(t,r){zo(this,r,r=>{this.i._addDoubleToInputSidePacket(t,r)})}addFloatToInputSidePacket(t,r){zo(this,r,r=>{this.i._addFloatToInputSidePacket(t,r)})}addIntToInputSidePacket(t,r){zo(this,r,r=>{this.i._addIntToInputSidePacket(t,r)})}addUintToInputSidePacket(t,r){zo(this,r,r=>{this.i._addUintToInputSidePacket(t,r)})}addStringToInputSidePacket(t,r){zo(this,r,r=>{zo(this,t,t=>{this.i._addStringToInputSidePacket(t,r)})})}addProtoToInputSidePacket(t,r,e){zo(this,e,e=>{zo(this,r,r=>{var n=this.i._malloc(t.length);this.i.HEAPU8.set(t,n),this.i._addProtoToInputSidePacket(n,t.length,r,e),this.i._free(n)})})}addBoolVectorToInputSidePacket(t,r){zo(this,r,r=>{var e=this.i._allocateBoolVector(t.length);if(!e)throw Error("Unable to allocate new bool vector on heap.");for(let r of t)this.i._addBoolVectorEntry(e,r);this.i._addBoolVectorToInputSidePacket(e,r)})}addDoubleVectorToInputSidePacket(t,r){zo(this,r,r=>{var e=this.i._allocateDoubleVector(t.length);if(!e)throw Error("Unable to allocate new double vector on heap.");for(let r of t)this.i._addDoubleVectorEntry(e,r);this.i._addDoubleVectorToInputSidePacket(e,r)})}addFloatVectorToInputSidePacket(t,r){zo(this,r,r=>{var e=this.i._allocateFloatVector(t.length);if(!e)throw Error("Unable to allocate new float vector on heap.");for(let r of t)this.i._addFloatVectorEntry(e,r);this.i._addFloatVectorToInputSidePacket(e,r)})}addIntVectorToInputSidePacket(t,r){zo(this,r,r=>{var e=this.i._allocateIntVector(t.length);if(!e)throw Error("Unable to allocate new int vector on heap.");for(let r of t)this.i._addIntVectorEntry(e,r);this.i._addIntVectorToInputSidePacket(e,r)})}addUintVectorToInputSidePacket(t,r){zo(this,r,r=>{var e=this.i._allocateUintVector(t.length);if(!e)throw Error("Unable to allocate new unsigned int vector on heap.");for(let r of t)this.i._addUintVectorEntry(e,r);this.i._addUintVectorToInputSidePacket(e,r)})}addStringVectorToInputSidePacket(t,r){zo(this,r,r=>{var e=this.i._allocateStringVector(t.length);if(!e)throw Error("Unable to allocate new string vector on heap.");for(let r of t)zo(this,r,t=>{this.i._addStringVectorEntry(e,t)});this.i._addStringVectorToInputSidePacket(e,r)})}attachBoolListener(t,r){Jo(this,t,r),zo(this,t,t=>{this.i._attachBoolListener(t)})}attachBoolVectorListener(t,r){Xo(this,t,r),zo(this,t,t=>{this.i._attachBoolVectorListener(t)})}attachIntListener(t,r){Jo(this,t,r),zo(this,t,t=>{this.i._attachIntListener(t)})}attachIntVectorListener(t,r){Xo(this,t,r),zo(this,t,t=>{this.i._attachIntVectorListener(t)})}attachUintListener(t,r){Jo(this,t,r),zo(this,t,t=>{this.i._attachUintListener(t)})}attachUintVectorListener(t,r){Xo(this,t,r),zo(this,t,t=>{this.i._attachUintVectorListener(t)})}attachDoubleListener(t,r){Jo(this,t,r),zo(this,t,t=>{this.i._attachDoubleListener(t)})}attachDoubleVectorListener(t,r){Xo(this,t,r),zo(this,t,t=>{this.i._attachDoubleVectorListener(t)})}attachFloatListener(t,r){Jo(this,t,r),zo(this,t,t=>{this.i._attachFloatListener(t)})}attachFloatVectorListener(t,r){Xo(this,t,r),zo(this,t,t=>{this.i._attachFloatVectorListener(t)})}attachStringListener(t,r){Jo(this,t,r),zo(this,t,t=>{this.i._attachStringListener(t)})}attachStringVectorListener(t,r){Xo(this,t,r),zo(this,t,t=>{this.i._attachStringVectorListener(t)})}attachProtoListener(t,r,e){Jo(this,t,r),zo(this,t,t=>{this.i._attachProtoListener(t,e||!1)})}attachProtoVectorListener(t,r,e){Xo(this,t,r),zo(this,t,t=>{this.i._attachProtoVectorListener(t,e||!1)})}attachAudioListener(t,r,e){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Jo(this,t,(t,e)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),r(t,e)}),zo(this,t,t=>{this.i._attachAudioListener(t,e||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}})),Zo=class extends Yo{};async function qo(t,r){var e=await(async(t,r,e)=>{var n=ua;if(t&&await $o(t),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(r&&(await $o(r),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&e&&((t=self.Module).locateFile=e.locateFile,e.mainScriptUrlOrBlob&&(t.mainScriptUrlOrBlob=e.mainScriptUrlOrBlob)),e=await self.ModuleFactory(self.Module||e),self.ModuleFactory=self.Module=void 0,new n(e,null)})(t.wasmLoaderPath,t.assetLoaderPath,{locateFile:r=>r.endsWith(".wasm")?t.wasmBinaryPath.toString():t.assetBinaryPath&&r.endsWith(".data")?t.assetBinaryPath.toString():r});return function(t,r){r=r.la??"";var e=t.h.X();t.j=new Wo(r,e)}(e,r),await e.v(r),e}async function Qo(t,r){return qo(t,r)}function ta(t,r){var e=Dr(t.baseOptions,uo,1)||new uo;"string"==typeof r?(Er(e,2,Qt(r)),Er(e,1)):r instanceof Uint8Array&&(Er(e,1,et(r,!1)),Er(e,2)),$r(t.baseOptions,0,1,e)}function ra(t,r){var e=r.baseOptions||{};if(r.baseOptions?.modelAssetBuffer&&r.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Dr(t.baseOptions,uo,1)?.j()||Dr(t.baseOptions,uo,1)?.l()||r.baseOptions?.modelAssetBuffer||r.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,r){var e=Dr(t.baseOptions,ao,3);if(!e){var n=e=new ao,i=new Hi;zr(n,4,so,i)}"delegate"in r&&("GPU"===r.delegate?(r=e,n=new Gi,zr(r,2,so,n)):(r=e,n=new Hi,zr(r,4,so,n))),$r(t.baseOptions,0,3,e)}(t,e),e.modelAssetPath)return fetch(e.modelAssetPath.toString()).then(t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${e.modelAssetPath} (${t.status})`)}).then(r=>{r=new Uint8Array(r);try{t.h.i.FS_unlink("/model.dat")}catch{}t.h.i.FS_createDataFile("/","model.dat",r,!0,!1,!1),ta(t,"/model.dat"),sa(t)});if(e.modelAssetBuffer instanceof Uint8Array)ta(t,e.modelAssetBuffer);else if(e.modelAssetBuffer)return async function(t){for(var r=[],e=0;;){let{done:n,value:i}=await t.read();if(n)break;r.push(i),e+=i.length}if(0===r.length)return new Uint8Array(0);if(1===r.length)return r[0];t=new Uint8Array(e),e=0;for(let n of r)t.set(n,e),e+=n.length;return t}(e.modelAssetBuffer).then(r=>{ta(t,r),sa(t)});return sa(t),Promise.resolve()}function ea(t){try{let r=t.u.length;if(1===r)throw Error(t.u[0].message);if(r>1)throw Error("Encountered multiple errors: "+t.u.map(t=>t.message).join(", "))}finally{t.u=[]}}var na=class{constructor(t){this.h=t,this.u=[],this.o=0,this.h.setAutoRenderToScreen(!1)}setGraph(t,r){this.h.attachErrorListener((t,r)=>{this.u.push(Error(r))}),this.h.ba(),this.h.setGraph(t,r),this.j?.aa(),ea(this)}finishProcessing(t){if(this.h.finishProcessing(),ea(this),this.j&&void 0!==t){var r=this.j,e=r.j.get(t);if(void 0!==e&&(r.j.delete(t),t=performance.now()-e,++r.h.D,r.h.H+=t,r.h.B=Math.max(r.h.B,t),r.u=Math.max(r.u,t),performance.now()>r.o+3e4)){for(let[n,i]of r.j.entries())t=n,i<e&&(r.h.A++,r.j.delete(t));e={...r.h,I:performance.now()-r.o},r.h.B=0,r.o=performance.now(),Do(r,e)}}}close(){this.j?.Z(),this.j?.close(),this.h.closeGraph()}};async function ia(t,r){return Qo(t,r)}na.prototype.close=na.prototype.close;var oa=class extends na{constructor(){super(...arguments),this.K=48e3}ea(t){this.K=t}};function aa(t){var r={classifications:Wr(t,vo).map(t=>function(t,r=-1,e=""){return{categories:t.map(t=>({index:Dt(Ir(t,1))??0??-1,score:Ir(t,2,void 0,Mt)??0??0,categoryName:tr(Ir(t,3))??""??"",displayName:tr(Ir(t,4))??""??""})),headIndex:r,headName:e}}(Dr(t,no,4)?.j()??[],Dt(Ir(t,2))??0,tr(Ir(t,3))??""))};return null!=function(t){return null==t?t:"bigint"==typeof t?(ft(t)?t=Number(t):(t=Nt(64,t),t=ft(t)?Number(t):String(t)),t):Ct(t)?"number"==typeof t?Ht(t):zt(t):void 0}(Ir(t,2,void 0,Xt))&&(r.timestampMs=function(t){var r=Number(t);return Number.isSafeInteger(r)?r:String(t)}(Ir(t,2,void 0,Xt)??Ar)),r}function sa(t){var r=new to;qr(r,10,"audio_in"),qr(r,10,"sample_rate"),qr(r,15,"timestamped_classifications");var e=new Ki;!function(t,r){var e=ro,n=t.m;R&&R in n&&(n=n[R])&&delete n[451755788],e.h?e.l(t,e.h,451755788,r,e.j):e.l(t,451755788,r,e.j)}(e,t.l);var n=new Yi;!function(t){var r=Qt("mediapipe.tasks.audio.audio_classifier.AudioClassifierGraph");br(t),Tr(t=t.m,0|t[X],2,""===r?void 0:r)}(n),qr(n,3,"AUDIO:audio_in"),qr(n,3,"SAMPLE_RATE:sample_rate"),qr(n,4,"TIMESTAMPED_CLASSIFICATIONS:timestamped_classifications"),n.v(e),Jr(r,1,Yi,n),t.h.attachProtoVectorListener("timestamped_classifications",(r,e)=>{!function(t,r){r.forEach(r=>{r=po(r),t.G.push(aa(r))})}(t,r),t.o=Math.max(t.o,e)}),t.h.attachEmptyPacketListener("timestamped_classifications",r=>{t.o=Math.max(t.o,r)}),r=r.j(),t.setGraph(new Uint8Array(r),!0)}oa.prototype.setDefaultSampleRate=oa.prototype.ea;var ua=class extends oa{constructor(t,r){super(new Zo(t,r)),this.G=[],$r(t=this.l=new ho,0,1,r=new lo)}get baseOptions(){return Dr(this.l,lo,1)}set baseOptions(t){$r(this.l,0,1,t)}v(t){var r=this.l,e=Dr(this.l,oo,2);if(e){var n=e.m;let t=0|n[X];e=Sr(e,n,t)?gr(e,n,!0):new e.constructor(mr(n,t,!1))}else e=new oo;if(void 0!==t.displayNamesLocale?Er(e,1,Qt(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Er(e,1),void 0!==t.maxResults){if(null!=(n=t.maxResults)){if("number"!=typeof n)throw O("int32");if(!Vt(n))throw O("int32");n|=0}Er(e,2,n)}else"maxResults"in t&&Er(e,2);if(void 0!==t.scoreThreshold){if(null!=(n=t.scoreThreshold)&&"number"!=typeof n)throw Error(`Value of float/double field must be a number, found ${typeof n}: ${n}`);Er(e,3,n)}else"scoreThreshold"in t&&Er(e,3);return void 0!==t.categoryAllowlist?Or(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&Er(e,4),void 0!==t.categoryDenylist?Or(e,5,t.categoryDenylist):"categoryDenylist"in t&&Er(e,5),$r(r,0,2,e),ra(this,t)}W(t,r){r=r??this.K;var e=this.o+1;if(this.j&&void 0!==e){var n=Dr(this.baseOptions,ao,3);n?.j()||n?.l()?.j()?(++(n=this.j).h.F,n.j.set(e,performance.now())):(++(n=this.j).h.C,n.j.set(e,performance.now()))}return this.h.addDoubleToStream(r,"sample_rate",e),this.h.addAudioToStreamWithShape(t,1,t.length,"audio_in",e),this.G=[],this.finishProcessing(e),[...this.G]}};ua.prototype.classify=ua.prototype.W,ua.prototype.setOptions=ua.prototype.v,ua.createFromModelPath=function(t,r){return Qo(t,{baseOptions:{modelAssetPath:r}})},ua.createFromModelBuffer=function(t,r){return ia(t,{baseOptions:{modelAssetBuffer:r}})},ua.createFromOptions=function(t,r){return ia(t,r)};var la,ha=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 ca(t){if(t)return!0;if(void 0===la)try{await WebAssembly.instantiate(ha),la=!0}catch{la=!1}return la}async function fa(t,r,e){return{wasmLoaderPath:`${r}/${t}_${e=`wasm${e?"_module":""}${await ca(e)?"":"_nosimd"}_internal`}.js`,wasmBinaryPath:`${r}/${t}_${e}.wasm`}}var da=class{};da.forVisionTasks=function(t,r=!1){return fa("vision",t??Vi``,r)},da.forLiteRtLmTextTasks=function(t,r=!1){return fa("litertlm_text",t??Vi``,r)},da.forTextTasks=function(t,r=!1){return fa("text",t??Vi``,r)},da.forRetrievalTasks=function(t,r=!1){return fa("retrieval",t??Vi``,r)},da.forGenAiTasks=function(t,r=!1){return fa("genai",t??Vi``,r)},da.forDecisionTasks=function(t,r=!1){return fa("decision",t??Vi``,r)},da.forAudioTasks=function(t,r=!1){return fa("audio",t??Vi``,r)},da.isSimdSupported=function(t=!1){return ca(t)};export{ua as AudioClassifier,oa as AudioTaskRunner,da as FilesetResolver,na as TaskRunner};
2
2
  //# sourceMappingURL=audio_bundle_mjs.js.map