@mediapipe/tasks-audio 0.10.13 → 0.10.14-rc.20240508
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/README.md +0 -0
- package/audio.d.ts +9 -7
- package/audio_bundle.cjs +1 -1
- package/audio_bundle.cjs.map +1 -1
- package/audio_bundle.mjs +1 -1
- package/audio_bundle.mjs.map +1 -1
- package/package.json +1 -1
- package/wasm/audio_wasm_internal.js +2 -2
- package/wasm/audio_wasm_internal.wasm +0 -0
- package/wasm/audio_wasm_nosimd_internal.js +2 -2
- package/wasm/audio_wasm_nosimd_internal.wasm +0 -0
package/README.md
CHANGED
|
File without changes
|
package/audio.d.ts
CHANGED
|
@@ -17,9 +17,10 @@ export declare class AudioClassifier extends AudioTaskRunner<AudioClassifierResu
|
|
|
17
17
|
* @export
|
|
18
18
|
* @param wasmFileset A configuration object that provides the location of the
|
|
19
19
|
* Wasm binary and its loader.
|
|
20
|
-
* @param modelAssetBuffer
|
|
20
|
+
* @param modelAssetBuffer An array or a stream containing a binary
|
|
21
|
+
* representation of the model.
|
|
21
22
|
*/
|
|
22
|
-
static createFromModelBuffer(wasmFileset: WasmFileset, modelAssetBuffer: Uint8Array): Promise<AudioClassifier>;
|
|
23
|
+
static createFromModelBuffer(wasmFileset: WasmFileset, modelAssetBuffer: Uint8Array | ReadableStreamDefaultReader): Promise<AudioClassifier>;
|
|
23
24
|
/**
|
|
24
25
|
* Initializes the Wasm runtime and creates a new audio classifier based on
|
|
25
26
|
* the path to the model asset.
|
|
@@ -95,9 +96,10 @@ export declare class AudioEmbedder extends AudioTaskRunner<AudioEmbedderResult[]
|
|
|
95
96
|
* @export
|
|
96
97
|
* @param wasmFileset A configuration object that provides the location of the
|
|
97
98
|
* Wasm binary and its loader.
|
|
98
|
-
* @param modelAssetBuffer
|
|
99
|
+
* @param modelAssetBuffer An array or a stream containing a binary
|
|
100
|
+
* representation of the model.
|
|
99
101
|
*/
|
|
100
|
-
static createFromModelBuffer(wasmFileset: WasmFileset, modelAssetBuffer: Uint8Array): Promise<AudioEmbedder>;
|
|
102
|
+
static createFromModelBuffer(wasmFileset: WasmFileset, modelAssetBuffer: Uint8Array | ReadableStreamDefaultReader): Promise<AudioEmbedder>;
|
|
101
103
|
/**
|
|
102
104
|
* Initializes the Wasm runtime and creates a new audio embedder based on the
|
|
103
105
|
* path to the model asset.
|
|
@@ -191,10 +193,10 @@ declare interface BaseOptions_2 {
|
|
|
191
193
|
*/
|
|
192
194
|
modelAssetPath?: string | undefined;
|
|
193
195
|
/**
|
|
194
|
-
* A buffer containing the model
|
|
195
|
-
* `modelAssetBuffer` can be set.
|
|
196
|
+
* A buffer or stream reader containing the model asset. Only one of
|
|
197
|
+
* `modelAssetPath` or `modelAssetBuffer` can be set.
|
|
196
198
|
*/
|
|
197
|
-
modelAssetBuffer?: Uint8Array | undefined;
|
|
199
|
+
modelAssetBuffer?: Uint8Array | ReadableStreamDefaultReader | undefined;
|
|
198
200
|
/** Overrides the default backend to use for the provided model. */
|
|
199
201
|
delegate?: "CPU" | "GPU" | undefined;
|
|
200
202
|
}
|
package/audio_bundle.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t="undefined"!=typeof self?self:{};function e(e){t:{for(var n=["CLOSURE_FLAGS"],r=t,o=0;o<n.length;o++)if(null==(r=r[n[o]])){n=null;break t}n=r}return null!=(e=n&&n[e])&&e}function n(){throw Error("Invalid UTF8")}function r(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}let o,i;const s="undefined"!=typeof TextDecoder;let a;const u="undefined"!=typeof TextEncoder;function c(t){if(u)t=(a||=new TextEncoder).encode(t);else{let n=0;const r=new Uint8Array(3*t.length);for(let o=0;o<t.length;o++){var e=t.charCodeAt(o);if(128>e)r[n++]=e;else{if(2048>e)r[n++]=e>>6|192;else{if(55296<=e&&57343>=e){if(56319>=e&&o<t.length){const i=t.charCodeAt(++o);if(56320<=i&&57343>=i){e=1024*(e-55296)+i-56320+65536,r[n++]=e>>18|240,r[n++]=e>>12&63|128,r[n++]=e>>6&63|128,r[n++]=63&e|128;continue}o--}e=65533}r[n++]=e>>12|224,r[n++]=e>>6&63|128}r[n++]=63&e|128}}t=n===r.length?r:r.subarray(0,n)}return t}var l,h=e(610401301),f=e(188588736);const d=t.navigator;function g(t){return!!h&&(!!l&&l.brands.some((({brand:e})=>e&&-1!=e.indexOf(t))))}function p(e){var n;return(n=t.navigator)&&(n=n.userAgent)||(n=""),-1!=n.indexOf(e)}function m(){return!!h&&(!!l&&0<l.brands.length)}function y(){return m()?g("Chromium"):(p("Chrome")||p("CriOS"))&&!(!m()&&p("Edge"))||p("Silk")}l=d&&d.userAgentData||null;var v=!m()&&(p("Trident")||p("MSIE"));!p("Android")||y(),y(),p("Safari")&&(y()||!m()&&p("Coast")||!m()&&p("Opera")||!m()&&p("Edge")||(m()?g("Microsoft Edge"):p("Edg/"))||m()&&g("Opera"));var b={},w=null;function _(t){var e=t.length,n=3*e/4;n%3?n=Math.floor(n):-1!="=.".indexOf(t[e-1])&&(n=-1!="=.".indexOf(t[e-2])?n-2:n-1);var r=new Uint8Array(n),o=0;return function(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),o=w[n];if(null!=o)return o;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}A();for(var r=0;;){var o=n(-1),i=n(0),s=n(64),a=n(64);if(64===a&&-1===o)break;e(o<<2|i>>4),64!=s&&(e(i<<4&240|s>>2),64!=a&&e(s<<6&192|a))}}(t,(function(t){r[o++]=t})),o!==n?r.subarray(0,o):r}function A(){if(!w){w={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=t.concat(e[n].split(""));b[n]=r;for(var o=0;o<r.length;o++){var i=r[o];void 0===w[i]&&(w[i]=o)}}}}var S="undefined"!=typeof Uint8Array,E=!v&&"function"==typeof btoa;function T(t){if(!E){var e;void 0===e&&(e=0),A(),e=b[e];var n=Array(Math.floor(t.length/3)),r=e[64]||"";let u=0,c=0;for(;u<t.length-2;u+=3){var o=t[u],i=t[u+1],s=t[u+2],a=e[o>>2];o=e[(3&o)<<4|i>>4],i=e[(15&i)<<2|s>>6],s=e[63&s],n[c++]=a+o+i+s}switch(a=0,s=r,t.length-u){case 2:s=e[(15&(a=t[u+1]))<<2]||r;case 1:t=t[u],n[c]=e[t>>2]+e[(3&t)<<4|a>>4]+s+r}return n.join("")}for(e="",n=0,r=t.length-10240;n<r;)e+=String.fromCharCode.apply(null,t.subarray(n,n+=10240));return e+=String.fromCharCode.apply(null,n?t.subarray(n):t),btoa(e)}const I=/[-_.]/g,P={"-":"+",_:"/",".":"="};function U(t){return P[t]||""}function x(t){if(!E)return _(t);I.test(t)&&(t=t.replace(I,U)),t=atob(t);const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function L(t){return S&&null!=t&&t instanceof Uint8Array}let O;function V(){return O||=new Uint8Array(0)}var B={};let k;function F(t){if(t!==B)throw Error("illegal external caller")}function j(){return k||=new M(null,B)}function N(t){F(B);var e=t.g;return null==(e=null==e||L(e)?e:"string"==typeof e?x(e):null)?e:t.g=e}var M=class{constructor(t,e){if(F(e),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}i(){const t=N(this);return t?new Uint8Array(t):V()}};function D(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function C(){return Error("Failed to read varint, encoding is invalid.")}function G(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function $(t){if("string"==typeof t)return{buffer:x(t),v:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),v:!1};if(t.constructor===Uint8Array)return{buffer:t,v:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),v:!1};if(t.constructor===M)return{buffer:N(t)||V(),v:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),v:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function z(){return"function"==typeof BigInt}const W="function"==typeof Uint8Array.prototype.slice;let R,H=0,q=0;function J(t){const e=0>t;let n=(t=Math.abs(t))>>>0;if(t=Math.floor((t-n)/4294967296),e){const[e,r]=et(n,t);t=r,n=e}H=n>>>0,q=t>>>0}function K(t){const e=R||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),q=0,H=e.getUint32(0,!0)}function Y(t,e){return 4294967296*e+(t>>>0)}function X(t,e){const n=2147483648&e;return n&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),t=Y(t,e),n?-t:t}function Q(t,e){if(t>>>=0,2097151>=(e>>>=0))var n=""+(4294967296*e+t);else z()?n=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(n=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),n+=8147497*e,e*=2,1e7<=t&&(n+=Math.floor(t/1e7),t%=1e7),1e7<=n&&(e+=Math.floor(n/1e7),n%=1e7),n=e+Z(n)+Z(t));return n}function Z(t){return t=String(t),"0000000".slice(t.length)+t}function tt(t){if(16>t.length)J(Number(t));else if(z())t=BigInt(t),H=Number(t&BigInt(4294967295))>>>0,q=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);q=H=0;const n=t.length;for(let r=e,o=(n-e)%6+e;o<=n;r=o,o+=6){const e=Number(t.slice(r,o));q*=1e6,H=1e6*H+e,4294967296<=H&&(q+=Math.trunc(H/4294967296),q>>>=0,H>>>=0)}if(e){const[t,e]=et(H,q);H=t,q=e}}}function et(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function nt(t,e){let n,r=0,o=0,i=0;const s=t.i;let a=t.g;do{n=s[a++],r|=(127&n)<<i,i+=7}while(32>i&&128&n);for(32<i&&(o|=(127&n)>>4),i=3;32>i&&128&n;i+=7)n=s[a++],o|=(127&n)<<i;if(ct(t,a),128>n)return e(r>>>0,o>>>0);throw C()}function rt(t){let e=0,n=t.g;const r=n+10,o=t.i;for(;n<r;){const r=o[n++];if(e|=r,0==(128&r))return ct(t,n),!!(127&e)}throw C()}function ot(t){const e=t.i;let n=t.g,r=e[n++],o=127&r;if(128&r&&(r=e[n++],o|=(127&r)<<7,128&r&&(r=e[n++],o|=(127&r)<<14,128&r&&(r=e[n++],o|=(127&r)<<21,128&r&&(r=e[n++],o|=r<<28,128&r&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++])))))throw C();return ct(t,n),o}function it(t){var e=t.i;const n=t.g,r=e[n],o=e[n+1],i=e[n+2];return e=e[n+3],ct(t,t.g+4),(r<<0|o<<8|i<<16|e<<24)>>>0}function st(t){var e=it(t);t=2*(e>>31)+1;const n=e>>>23&255;return e&=8388607,255==n?e?NaN:1/0*t:0==n?t*Math.pow(2,-149)*e:t*Math.pow(2,n-150)*(e+Math.pow(2,23))}function at(t){return ot(t)}function ut(t,e,{C:n=!1}={}){t.C=n,e&&(e=$(e),t.i=e.buffer,t.m=e.v,t.s=0,t.j=t.i.length,t.g=t.s)}function ct(t,e){if(t.g=e,e>t.j)throw G(t.j,e)}function lt(t,e){if(0>e)throw Error(`Tried to read a negative byte length: ${e}`);const n=t.g,r=n+e;if(r>t.j)throw G(e,t.j-n);return t.g=r,n}function ht(t,e){if(0==e)return j();var n=lt(t,e);return t.C&&t.m?n=t.i.subarray(n,n+e):(t=t.i,n=n===(e=n+e)?V():W?t.slice(n,e):new Uint8Array(t.subarray(n,e))),0==n.length?j():new M(n,B)}var ft=[];function dt(t){var e=t.g;if(e.g==e.j)return!1;t.j=t.g.g;var n=ot(t.g)>>>0;if(e=n>>>3,!(0<=(n&=7)&&5>=n))throw D(n,t.j);if(1>e)throw Error(`Invalid field number: ${e} (at position ${t.j})`);return t.m=e,t.i=n,!0}function gt(t){switch(t.i){case 0:0!=t.i?gt(t):rt(t.g);break;case 1:ct(t=t.g,t.g+8);break;case 2:if(2!=t.i)gt(t);else{var e=ot(t.g)>>>0;ct(t=t.g,t.g+e)}break;case 5:ct(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!dt(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.i){if(t.m!=e)throw Error("Unmatched end-group tag");break}gt(t)}break;default:throw D(t.i,t.j)}}function pt(t,e,n){const r=t.g.j,o=ot(t.g)>>>0,i=t.g.g+o;let s=i-r;if(0>=s&&(t.g.j=i,n(e,t,void 0,void 0,void 0),s=i-t.g.g),s)throw Error(`Message parsing ended unexpectedly. Expected to read ${o} bytes, instead read ${o-s} bytes, either the data ended unexpectedly or the message misreported its own length`);t.g.g=i,t.g.j=r}function mt(t){var e=ot(t.g)>>>0,a=lt(t=t.g,e);if(t=t.i,s){var u,c=t;(u=i)||(u=i=new TextDecoder("utf-8",{fatal:!0})),e=a+e,c=0===a&&e===c.length?c:c.subarray(a,e);try{var l=u.decode(c)}catch(t){if(void 0===o){try{u.decode(new Uint8Array([128]))}catch(t){}try{u.decode(new Uint8Array([97])),o=!0}catch(t){o=!1}}throw!o&&(i=void 0),t}}else{e=(l=a)+e,a=[];let o,i=null;for(;l<e;){var h=t[l++];128>h?a.push(h):224>h?l>=e?n():(o=t[l++],194>h||128!=(192&o)?(l--,n()):a.push((31&h)<<6|63&o)):240>h?l>=e-1?n():(o=t[l++],128!=(192&o)||224===h&&160>o||237===h&&160<=o||128!=(192&(u=t[l++]))?(l--,n()):a.push((15&h)<<12|(63&o)<<6|63&u)):244>=h?l>=e-2?n():(o=t[l++],128!=(192&o)||0!=o-144+(h<<28)>>30||128!=(192&(u=t[l++]))||128!=(192&(c=t[l++]))?(l--,n()):(h=(7&h)<<18|(63&o)<<12|(63&u)<<6|63&c,h-=65536,a.push(55296+(h>>10&1023),56320+(1023&h)))):n(),8192<=a.length&&(i=r(i,a),a.length=0)}l=r(i,a)}return l}function yt(t){const e=ot(t.g)>>>0;return ht(t.g,e)}function vt(t,e,n){var r=ot(t.g)>>>0;for(r=t.g.g+r;t.g.g<r;)n.push(e(t.g))}var bt=[];function wt(t){return t?/^\d+$/.test(t)?(tt(t),new _t(H,q)):null:At||=new _t(0,0)}var _t=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let At;function St(t){return t?/^-?\d+$/.test(t)?(tt(t),new Et(H,q)):null:Tt||=new Et(0,0)}var Et=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let Tt;function It(t,e,n){for(;0<n||127<e;)t.g.push(127&e|128),e=(e>>>7|n<<25)>>>0,n>>>=7;t.g.push(e)}function Pt(t,e){for(;127<e;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function Ut(t,e){if(0<=e)Pt(t,e);else{for(let n=0;9>n;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function xt(t,e){t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}function Lt(t,e){0!==e.length&&(t.j.push(e),t.i+=e.length)}function Ot(t,e,n){Pt(t.g,8*e+n)}function Vt(t,e){return Ot(t,e,2),e=t.g.end(),Lt(t,e),e.push(t.i),e}function Bt(t,e){var n=e.pop();for(n=t.i+t.g.length()-n;127<n;)e.push(127&n|128),n>>>=7,t.i++;e.push(n),t.i++}function kt(t,e,n){Ot(t,e,2),Pt(t.g,n.length),Lt(t,t.g.end()),Lt(t,n)}class Ft{constructor(t,e,n,r){this.g=t,this.i=e,this.j=n,this.J=r}}function jt(t){return Array.prototype.slice.call(t)}function Nt(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():t}var Mt=Nt(),Dt=Nt("2ex"),Ct=Nt("0dg"),Gt=Mt?(t,e)=>{t[Mt]|=e}:(t,e)=>{void 0!==t.g?t.g|=e:Object.defineProperties(t,{g:{value:e,configurable:!0,writable:!0,enumerable:!1}})},$t=Mt?(t,e)=>{t[Mt]&=~e}:(t,e)=>{void 0!==t.g&&(t.g&=~e)};function zt(t,e,n){return n?t|e:t&~e}var Wt=Mt?t=>0|t[Mt]:t=>0|t.g,Rt=Mt?t=>t[Mt]:t=>t.g,Ht=Mt?(t,e)=>(t[Mt]=e,t):(t,e)=>(void 0!==t.g?t.g=e:Object.defineProperties(t,{g:{value:e,configurable:!0,writable:!0,enumerable:!1}}),t);function qt(t,e){Ht(e,-14591&(0|t))}function Jt(t,e){Ht(e,-14557&(34|t))}function Kt(t){return 0===(t=t>>14&1023)?536870912:t}var Yt,Xt={},Qt={};function Zt(t){return!(!t||"object"!=typeof t||t.g!==Qt)}function te(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}function ee(t,e,n){if(null!=t)if("string"==typeof t)t=t?new M(t,B):j();else if(t.constructor!==M)if(L(t))t=t.length?new M(n?t:new Uint8Array(t),B):j();else{if(!e)throw Error();t=void 0}return t}function ne(t,e,n){if(!Array.isArray(t)||t.length)return!1;const r=Wt(t);return!!(1&r)||!(!e||!(Array.isArray(e)?e.includes(n):e.has(n)))&&(Ht(t,1|r),!0)}const re=[];function oe(t){if(2&t)throw Error()}let ie,se,ae;function ue(t,e){(e=ie?e[ie]:void 0)&&(t[ie]=jt(e))}Ht(re,55),Yt=Object.freeze(re);function ce(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function le(){const e=Error();ce(e,"incident"),function(e){t.setTimeout((()=>{throw e}),0)}(e)}function he(){const t=Error("int32");return ce(t,"warning"),t}function fe(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function de(t){if(null!=t&&"boolean"!=typeof t){var e=typeof t;throw Error(`Expected boolean but got ${"object"!=e?e:t?Array.isArray(t)?"array":e:"null"}: ${t}`)}return t}Object.freeze(new class{}),Object.freeze(new class{});const ge=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function pe(t){const e=typeof t;return"number"===e?Number.isFinite(t):"string"===e&&ge.test(t)}function me(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t&&Number.isFinite(t)?0|t:void 0}function ye(t){return"-"!==t[0]&&(20>t.length||20===t.length&&184467>Number(t.substring(0,6)))}function ve(t){return t=Math.trunc(t),Number.isSafeInteger(t)||(J(t),t=X(H,q)),t}function be(t){var e=Math.trunc(Number(t));if(Number.isSafeInteger(e))return String(e);if(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),!("-"===t[0]?20>t.length||20===t.length&&-922337<Number(t.substring(0,7)):19>t.length||19===t.length&&922337>Number(t.substring(0,6))))if(tt(t),t=H,2147483648&(e=q))if(z())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,r]=et(t,e);t="-"+Q(n,r)}else t=Q(t,e);return t}function we(t){if("string"!=typeof t)throw Error();return t}function _e(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function Ae(t){return null==t||"string"==typeof t?t:void 0}function Se(t,e,n){if(null!=t&&"object"==typeof t&&t.B===Xt)return t;if(Array.isArray(t)){var r=Wt(t),o=r;return 0===o&&(o|=32&n),(o|=2&n)!==r&&Ht(t,o),new e(t)}}let Ee,Te,Ie;function Pe(t){switch(typeof t){case"boolean":return Te||=[0,void 0,!0];case"number":return 0<t?void 0:0===t?Ie||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}function Ue(t,e,n){if(null==t&&(t=Ee),Ee=void 0,null==t){var r=96;n?(t=[n],r|=512):t=[],e&&(r=-16760833&r|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(2048&(r=Wt(t)))throw Error("farr");if(64&r)return t;if(r|=64,n&&(r|=512,n!==t[0]))throw Error("mid");t:{const o=(n=t).length;if(o){const t=o-1;if(te(n[t])){if(1024<=(e=t-(+!!(512&(r|=256))-1)))throw Error("pvtlmt");r=-16760833&r|(1023&e)<<14;break t}}if(e){if(1024<(e=Math.max(e,o-(+!!(512&r)-1))))throw Error("spvt");r=-16760833&r|(1023&e)<<14}}}return Ht(t,r),t}function xe(t,e,n,r,o){if(null!=t){if(Array.isArray(t))t=ne(t,void 0,0)?void 0:o&&2&Wt(t)?t:Le(t,e,n,void 0!==r,o);else if(te(t)){const i={};for(let s in t)i[s]=xe(t[s],e,n,r,o);t=i}else t=e(t,r);return t}}function Le(t,e,n,r,o){const i=r||n?Wt(t):0;r=r?!!(32&i):void 0;const s=jt(t);for(let t=0;t<s.length;t++)s[t]=xe(s[t],e,n,r,o);return n&&(ue(s,t),n(i,s)),s}function Oe(t){return t.B===Xt?t.toJSON():function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"boolean":return t?1:0;case"object":if(t)if(Array.isArray(t)){if(ne(t,void 0,0))return}else{if(L(t))return T(t);if(t instanceof M){const e=t.g;return null==e?"":"string"==typeof e?e:t.g=T(e)}}}return t}(t)}function Ve(t,e,n=Jt){if(null!=t){if(S&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var r=Wt(t);return 2&r?t:(e&&=0===r||!!(32&r)&&!(64&r||!(16&r)),e?Ht(t,-12293&(34|r)):Le(t,Ve,4&r?Jt:n,!0,!0))}return t.B===Xt&&(n=t.l,t=2&(r=Rt(n))?t:ke(t,n,r,!0)),t}}function Be(t){const e=t.l;return ke(t,e,Rt(e),!1)}function ke(t,e,n,r){return t=t.constructor,Ee=e=Fe(e,n,r),e=new t(e),Ee=void 0,e}function Fe(t,e,n){const r=n||2&e?Jt:qt,o=!!(32&e);return t=function(t,e,n){const r=jt(t);var o=r.length;const i=256&e?r[o-1]:void 0;for(o+=i?-1:0,e=512&e?1:0;e<o;e++)r[e]=n(r[e]);if(i){e=r[e]={};for(const t in i)e[t]=n(i[t])}return ue(r,t),r}(t,e,(t=>Ve(t,o,r))),Gt(t,32|(n?2:0)),t}function je(t){const e=t.l,n=Rt(e);return 2&n?ke(t,e,n,!1):t}function Ne(t,e,n,r){return!(4&e)||null!=n&&(!r&&0===n&&(4096&e||8192&e)&&5>(t.constructor[Ct]=1+(0|t.constructor[Ct]))&&le(),0!==n&&!(n&e))}function Me(t,e){return Ce(t=t.l,Rt(t),e)}function De(t,e,n,r){if(!(0>(e=r+(+!!(512&e)-1))||e>=t.length||e>=n))return t[e]}function Ce(t,e,n,r){if(-1===n)return null;const o=Kt(e);if(!(n>=o)){var i=t.length;return r&&256&e&&null!=(r=t[i-1][n])?(De(t,e,o,n)&&null!=Dt&&(4<=(e=(t=ae??={})[Dt]||0)||(t[Dt]=e+1,le())),r):De(t,e,o,n)}return 256&e?t[t.length-1][n]:void 0}function Ge(t,e,n,r){const o=t.l;let i=Rt(o);return oe(i),$e(o,i,e,n,r),t}function $e(t,e,n,r,o){const i=Kt(e);if(n>=i||o){let s=e;if(256&e)o=t[t.length-1];else{if(null==r)return s;o=t[i+(+!!(512&e)-1)]={},s|=256}return o[n]=r,n<i&&(t[n+(+!!(512&e)-1)]=void 0),s!==e&&Ht(t,s),s}return t[n+(+!!(512&e)-1)]=r,256&e&&(n in(t=t[t.length-1])&&delete t[n]),e}function ze(t,e,n,r,o){var i=2&e;let s=Ce(t,e,n,o);Array.isArray(s)||(s=Yt);const a=!(2&r);r=!(1&r);const u=!!(32&e);let c=Wt(s);return 0!==c||!u||i||a?1&c||(c|=1,Ht(s,c)):(c|=33,Ht(s,c)),i?(t=!1,2&c||(Gt(s,34),t=!!(4&c)),(r||t)&&Object.freeze(s)):(i=!!(2&c)||!!(2048&c),r&&i?(s=jt(s),r=1,u&&!a&&(r|=32),Ht(s,r),$e(t,e,n,s,o)):a&&32&c&&!i&&$t(s,32)),s}function We(t){t=t.l;let e=Rt(t);const n=Ce(t,e,1),r=ee(n,!0,!!(34&e));return null!=r&&r!==n&&$e(t,e,1,r),r}function Re(t,e){return t=Ce(t,e,1),Array.isArray(t)?t:Yt}function He(t,e){return 0===t&&(t=un(t,e)),zt(t,1,!0)}function qe(t){return!!(2&t)&&!!(4&t)||!!(2048&t)}function Je(t,e,n){{const a=t.l;let u=Rt(a);if(oe(u),null==n)$e(a,u,e);else{var r,o=Wt(n),i=o,s=!!(2&o)||Object.isFrozen(n);if((r=!s)&&(r=!1),Ne(t,o))for(o=21,s&&(n=jt(n),i=0,o=cn(o=un(o,u),u,!0)),t=0;t<n.length;t++)n[t]=we(n[t]);r&&(n=jt(n),i=0,o=cn(o=un(o,u),u,!0)),o!==i&&Ht(n,o),$e(a,u,e,n)}}}function Ke(t,e){t=t.l;let n=Rt(t);oe(n),$e(t,n,2,""===e?void 0:e)}function Ye(t,e,n,r){const o=Rt(t);oe(o),t=ze(t,o,e,2),r=n(r,!!(4&(e=Wt(t)))&&!!(4096&e)),t.push(r)}function Xe(t){return t}function Qe(t,e){return Ze(t=t.l,Rt(t),yo)===e?e:-1}function Ze(t,e,n){let r=0;for(let o=0;o<n.length;o++){const i=n[o];null!=Ce(t,e,i)&&(0!==r&&(e=$e(t,e,r)),r=i)}return r}function tn(t,e,n,r){let o=Rt(t);oe(o);const i=Ce(t,o,n,r);let s;if(null!=i&&i.B===Xt)return(e=je(i))!==i&&$e(t,o,n,e,r),e.l;if(Array.isArray(i)){const t=Wt(i);s=2&t?Fe(i,t,!1):i,s=Ue(s,e[0],e[1])}else s=Ue(void 0,e[0],e[1]);return s!==i&&$e(t,o,n,s,r),s}function en(t,e,n,r){t=t.l;let o=Rt(t);const i=Ce(t,o,n,r);return(e=Se(i,e,o))!==i&&null!=e&&$e(t,o,n,e,r),e}function nn(t,e,n){if(null==(e=en(t,e,n,!1)))return e;t=t.l;let r=Rt(t);if(!(2&r)){const o=je(e);o!==e&&$e(t,r,n,e=o,!1)}return e}function rn(t,e,n,r,o){var i=!!(2&e);const s=i?1:2;r=!!r,o&&=!i,i=Re(t,e);var a=Wt(i);const u=!!(4&a);if(!u){var c=i,l=e;const t=!!(2&(a=He(a,e)));t&&(l=zt(l,2,!0));let r=!t,o=!0,s=0,u=0;for(;s<c.length;s++){const e=Se(c[s],n,l);if(e instanceof n){if(!t){const t=!!(2&Wt(e.l));r&&=!t,o&&=t}c[u++]=e}}u<s&&(c.length=u),a=zt(a,4,!0),a=zt(a,16,o),a=zt(a,8,r),Ht(c,a),t&&Object.freeze(c)}if(o&&!(8&a||!i.length&&(1===s||4===s&&32&a))){for(qe(a)&&(i=jt(i),a=un(a,e),e=$e(t,e,1,i)),n=i,o=a,c=0;c<n.length;c++)(a=n[c])!==(l=je(a))&&(n[c]=l);o=zt(o,8,!0),o=zt(o,16,!n.length),Ht(n,o),a=o}return qe(a)||(n=a,(a=(o=1===s||4===s&&!!(32&a))?zt(a,!i.length||16&a&&(!u||32&a)?2:2048,!0):cn(a,e,r))!==n&&Ht(i,a),o&&Object.freeze(i)),2===s&&qe(a)&&(i=jt(i),a=cn(a=un(a,e),e,r),Ht(i,a),$e(t,e,1,i)),i}function on(t,e){t=t.l;const n=Rt(t);return rn(t,n,e,!1,!(2&n))}function sn(t,e,n,r,o){return null==r&&(r=void 0),Ge(t,n,r,o)}function an(t,e,n){var r=to;null==n&&(n=void 0),t=t.l;let o=Rt(t);oe(o),(r=Ze(t,o,r))&&r!==e&&null!=n&&(o=$e(t,o,r)),$e(t,o,e,n)}function un(t,e){return t=zt(t,2,!!(2&e)),t=zt(t,32,!0),zt(t,2048,!1)}function cn(t,e,n){return 32&e&&n||(t=zt(t,32,!1)),t}function ln(t,e){var n=Cr;t=t.l;const r=Rt(t);oe(r),t=rn(t,r,n,!0),e=null!=e?e:new n,t.push(e),2&Wt(e.l)?$t(t,8):$t(t,16)}function hn(t){return null==(t=Me(t,2))?t:pe(t)?"number"==typeof t?ve(t):be(t):void 0}function fn(t,e){return t??e}function dn(t,e,n){Ye(t.l,e,we,n)}function gn(t,e,n){e.g?e.j(t,e.g,e.i,n,!0):e.j(t,e.i,n,!0)}var pn=class{constructor(t,e){this.l=Ue(t,e)}toJSON(){return mn(this,Le(this.l,Oe,void 0,void 0,!1),!0)}v(){return!!(2&Wt(this.l))}};function mn(t,e,n){var r=f?void 0:t.constructor.u;const o=Rt(n?t.l:e);if(!(t=e.length))return e;let i,s;if(te(n=e[t-1])){t:{var a=n;let t={},e=!1;for(var u in a){let n=a[u];if(Array.isArray(n)){let t=n;(ne(n,r,+u)||Zt(n)&&0===n.size)&&(n=null),n!=t&&(e=!0)}null!=n?t[u]=n:e=!0}if(e){for(var c in t){a=t;break t}a=null}}a!=n&&(i=!0),t--}for(u=+!!(512&o)-1;0<t&&(n=e[c=t-1],c-=u,null==n||ne(n,r,c)||Zt(n)&&0===n.size);t--)s=!0;return i||s?(e=Array.prototype.slice.call(e,0,t),a&&e.push(a),e):e}function yn(t){return Array.isArray(t)?t[0]instanceof Ft?t:[gr,t]:[t,void 0]}function vn(t,e){if(Array.isArray(e)){var n=Wt(e);if(4&n)return e;for(var r=0,o=0;r<e.length;r++){const n=t(e[r]);null!=n&&(e[o++]=n)}return o<r&&(e.length=o),Ht(e,-12289&(5|n)),2&n&&Object.freeze(e),e}}pn.prototype.B=Xt,pn.prototype.toString=function(){return mn(this,this.l,!1).toString()};const bn=Symbol();function wn(t){let e=t[bn];if(!e){const n=Un(t),r=Cn(t),o=r.j;e=o?(t,e)=>o(t,e,r):(t,e)=>{for(;dt(e)&&4!=e.i;){var o=e.m,i=r[o];if(!i){var s=r.D;s&&(s=s[o])&&(i=r[o]=_n(s))}i&&i(e,t,o)||(o=(i=e).j,gt(i),i.I?i=void 0:(s=i.g.g-o,i.g.g=o,i=ht(i.g,s)),o=t,i&&(ie||=Symbol(),(s=o[ie])?s.push(i):o[ie]=[i]))}n===Sn||n===En||n.s||(t[se||=Symbol()]=n)},t[bn]=e}return e}function _n(t){const e=(t=yn(t))[0].g;if(t=t[1]){const n=wn(t),r=Cn(t).A;return(t,o,i)=>e(t,o,i,r,n)}return e}class An{}let Sn,En;const Tn=Symbol();function In(t,e,n){const r=n[1];let o;if(r){const n=r[Tn];o=n?n.A:Pe(r[0]),t[e]=n??r}o&&o===Te?(t.g||(t.g=new Set)).add(e):n[0]&&(t.i||(t.i=new Set)).add(e)}function Pn(t,e){return[t.j,!e||0<e[0]?void 0:e]}function Un(t){var e=t[Tn];if(e)return e;if(!(e=Ln(t,t[Tn]=new An,Pn,Pn,In)).D&&!e.i&&!e.g){let n=!0;for(let t in e)isNaN(t)||(n=!1);n?(Pe(t[0])===Te?En?e=En:((e=new An).A=Pe(!0),e=En=e):e=Sn||=new An,e=t[Tn]=e):e.s=!0}return e}function xn(t,e,n){t[e]=n}function Ln(t,e,n,r,o=xn){e.A=Pe(t[0]);let i=0;var s=t[++i];s&&s.constructor===Object&&(e.D=s,"function"==typeof(s=t[++i])&&(e.j=s,e.m=t[++i],s=t[++i]));const a={};for(;Array.isArray(s)&&"number"==typeof s[0]&&0<s[0];){for(var u=0;u<s.length;u++)a[s[u]]=s;s=t[++i]}for(u=1;void 0!==s;){let h;"number"==typeof s&&(u+=s,s=t[++i]);var c=void 0;if(s instanceof Ft?h=s:(h=pr,i--),h.J){s=t[++i],c=t;var l=i;"function"==typeof s&&(s=s(),c[l]=s),c=s}for(l=u+1,"number"==typeof(s=t[++i])&&0>s&&(l-=s,s=t[++i]);u<l;u++){const t=a[u];o(e,u,c?r(h,c,t):n(h,t))}}return e}const On=Symbol();function Vn(t){let e=t[On];if(!e){const n=jn(t);e=(t,e)=>zn(t,e,n),t[On]=e}return e}const Bn=Symbol();function kn(t){return t.i}function Fn(t,e){let n,r;const o=t.i;return(t,i,s)=>o(t,i,s,r||=jn(e).A,n||=Vn(e))}function jn(t){let e=t[Bn];return e||(e=Ln(t,t[Bn]={},kn,Fn),Gn(t),e)}const Nn=Symbol();function Mn(t,e){const n=t.g;return e?(t,r,o)=>n(t,r,o,e):n}function Dn(t,e,n){const r=t.g;let o,i;return(t,s,a)=>r(t,s,a,i||=Cn(e).A,o||=wn(e),n)}function Cn(t){let e=t[Nn];return e||(Un(t),e=Ln(t,t[Nn]={},Mn,Dn),Gn(t),e)}function Gn(t){Nn in t&&Tn in t&&Bn in t&&(t.length=0)}function $n(t,e){var n=t[e];if(n)return n;if((n=t.D)&&(n=n[e])){var r=(n=yn(n))[0].i;if(n=n[1]){const e=Vn(n),o=jn(n).A;n=(n=t.m)?n(o,e):(t,n,i)=>r(t,n,i,o,e)}else n=r;return t[e]=n}}function zn(t,e,n){for(var r=Rt(t),o=+!!(512&r)-1,i=t.length,s=512&r?1:0,a=i+(256&r?-1:0);s<a;s++){const r=t[s];if(null==r)continue;const i=s-o,a=$n(n,i);a&&a(e,r,i)}if(256&r){r=t[i-1];for(let t in r)o=+t,Number.isNaN(o)||null!=(i=r[t])&&(a=$n(n,o))&&a(e,i,o)}if(t=ie?t[ie]:void 0)for(Lt(e,e.g.end()),n=0;n<t.length;n++)Lt(e,N(t[n])||V())}function Wn(t,e){return new Ft(t,e,!1,!1)}function Rn(t,e){return new Ft(t,e,!0,!1)}function Hn(t,e,n){$e(t,Rt(t),e,n)}function qn(t,e,n){t:if(null!=e){if(pe(e)){if("string"==typeof e){e=be(e);break t}if("number"==typeof e){e=ve(e);break t}}e=void 0}null!=e&&("string"==typeof e&&St(e),null!=e&&(Ot(t,n,0),"number"==typeof e?(t=t.g,J(e),It(t,H,q)):(n=St(e),It(t.g,n.i,n.g))))}function Jn(t,e,n){null!=(e=me(e))&&null!=e&&(Ot(t,n,0),Ut(t.g,e))}function Kn(t,e,n){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(Ot(t,n,0),t.g.g.push(e?1:0))}function Yn(t,e,n){null!=(e=Ae(e))&&kt(t,n,c(e))}function Xn(t,e,n,r,o){null!=(e=e instanceof pn?e.l:Array.isArray(e)?Ue(e,r[0],r[1]):void 0)&&(n=Vt(t,n),o(e,t),Bt(t,n))}function Qn(t,e,n){null!=(e=null==e||"string"==typeof e||L(e)||e instanceof M?e:void 0)&&kt(t,n,$(e).buffer)}var Zn,tr=Wn((function(t,e,n){if(1!==t.i)return!1;var r=t.g;t=it(r);const o=it(r);r=2*(o>>31)+1;const i=o>>>20&2047;return t=4294967296*(1048575&o)+t,Hn(e,n,2047==i?t?NaN:1/0*r:0==i?r*Math.pow(2,-1074)*t:r*Math.pow(2,i-1075)*(t+4503599627370496)),!0}),(function(t,e,n){null!=(e=fe(e))&&(Ot(t,n,1),t=t.g,(n=R||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),H=n.getUint32(0,!0),q=n.getUint32(4,!0),xt(t,H),xt(t,q))})),er=Wn((function(t,e,n){return 5===t.i&&(Hn(e,n,st(t.g)),!0)}),(function(t,e,n){null!=(e=fe(e))&&(Ot(t,n,5),t=t.g,K(e),xt(t,H))})),nr=Rn((function(t,e,n){return(5===t.i||2===t.i)&&(e=ze(e,Rt(e),n,2,!1),2==t.i?vt(t,st,e):e.push(st(t.g)),!0)}),(function(t,e,n){if(null!=(e=vn(fe,e))&&e.length){Ot(t,n,2),Pt(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,K(e[r]),xt(n,H)}})),rr=Wn((function(t,e,n){return 0===t.i&&(Hn(e,n,nt(t.g,X)),!0)}),qn),or=Wn((function(t,e,n){return 0===t.i&&(Hn(e,n,0===(t=nt(t.g,X))?void 0:t),!0)}),qn),ir=Wn((function(t,e,n){return 0===t.i&&(Hn(e,n,nt(t.g,Y)),!0)}),(function(t,e,n){t:if(null!=e){if(pe(e)){if("string"==typeof e){var r=Math.trunc(Number(e));Number.isSafeInteger(r)&&0<=r?e=String(r):(-1!==(r=e.indexOf("."))&&(e=e.substring(0,r)),ye(e)||(tt(e),e=Q(H,q)));break t}if("number"==typeof e){e=0<=(e=Math.trunc(e))&&Number.isSafeInteger(e)?e:function(t){if(0>t){J(t);const e=Q(H,q);return t=Number(e),Number.isSafeInteger(t)?t:e}return ye(String(t))?t:(J(t),Y(H,q))}(e);break t}}e=void 0}null!=e&&("string"==typeof e&&wt(e),null!=e&&(Ot(t,n,0),"number"==typeof e?(t=t.g,J(e),It(t,H,q)):(n=wt(e),It(t.g,n.i,n.g))))})),sr=Wn((function(t,e,n){return 0===t.i&&(Hn(e,n,ot(t.g)),!0)}),Jn),ar=Rn((function(t,e,n){return(0===t.i||2===t.i)&&(e=ze(e,Rt(e),n,2,!1),2==t.i?vt(t,ot,e):e.push(ot(t.g)),!0)}),(function(t,e,n){if(null!=(e=vn(me,e))&&e.length){n=Vt(t,n);for(let n=0;n<e.length;n++)Ut(t.g,e[n]);Bt(t,n)}})),ur=Wn((function(t,e,n){return 0===t.i&&(Hn(e,n,0===(t=ot(t.g))?void 0:t),!0)}),Jn),cr=Wn((function(t,e,n){return 0===t.i&&(Hn(e,n,rt(t.g)),!0)}),Kn),lr=Wn((function(t,e,n){return 0===t.i&&(Hn(e,n,!1===(t=rt(t.g))?void 0:t),!0)}),Kn),hr=Rn((function(t,e,n){return 2===t.i&&(Ye(e,n,Xe,t=mt(t)),!0)}),(function(t,e,n){if(null!=(e=vn(Ae,e)))for(let s=0;s<e.length;s++){var r=t,o=n,i=e[s];null!=i&&kt(r,o,c(i))}})),fr=Wn((function(t,e,n){return 2===t.i&&(Hn(e,n,""===(t=mt(t))?void 0:t),!0)}),Yn),dr=Wn((function(t,e,n){return 2===t.i&&(Hn(e,n,mt(t)),!0)}),Yn),gr=new Ft((function(t,e,n,r,o){return 2===t.i&&(pt(t,tn(e,r,n,!0),o),!0)}),Xn,!1,!0),pr=new Ft((function(t,e,n,r,o){return 2===t.i&&(pt(t,tn(e,r,n),o),!0)}),Xn,!1,!0);Zn=new Ft((function(t,e,n,r,o){if(2!==t.i)return!1;r=Ue(void 0,r[0],r[1]);let i=Rt(e);oe(i);let s=ze(e,i,n,3);return i=Rt(e),4&Wt(s)&&(s=jt(s),Ht(s,-2079&(1|Wt(s))),$e(e,i,n,s)),s.push(r),pt(t,r,o),!0}),(function(t,e,n,r,o){if(Array.isArray(e))for(let i=0;i<e.length;i++)Xn(t,e[i],n,r,o)}),!0,!0);var mr=new Ft((function(t,e,n,r,o,i){if(2!==t.i)return!1;let s=Rt(e);return oe(s),(i=Ze(e,s,i))&&n!==i&&$e(e,s,i),pt(t,e=tn(e,r,n),o),!0}),Xn,!1,!0),yr=Wn((function(t,e,n){return 2===t.i&&(Hn(e,n,yt(t)),!0)}),Qn),vr=Wn((function(t,e,n){return 0===t.i&&(Hn(e,n,ot(t.g)),!0)}),(function(t,e,n){null!=(e=me(e))&&(e=parseInt(e,10),Ot(t,n,0),Ut(t.g,e))})),br=Rn((function(t,e,n){return(0===t.i||2===t.i)&&(e=ze(e,Rt(e),n,2,!1),2==t.i?vt(t,at,e):e.push(ot(t.g)),!0)}),(function(t,e,n){if(null!=(e=vn(me,e))&&e.length){n=Vt(t,n);for(let n=0;n<e.length;n++)Ut(t.g,e[n]);Bt(t,n)}}));class wr{constructor(t,e){this.i=t,this.g=e,this.j=sn,this.defaultValue=void 0}}function _r(t,e){return(n,r)=>{t:{if(bt.length){const t=bt.pop();t.o(r),ut(t.g,n,r),n=t}else n=new class{constructor(t,e){if(ft.length){const n=ft.pop();ut(n,t,e),t=n}else t=new class{constructor(t,e){this.i=null,this.m=!1,this.g=this.j=this.s=0,ut(this,t,e)}clear(){this.i=null,this.m=!1,this.g=this.j=this.s=0,this.C=!1}}(t,e);this.g=t,this.j=this.g.g,this.i=this.m=-1,this.o(e)}o({I:t=!1}={}){this.I=t}}(n,r);try{const r=new t,i=r.l;wn(e)(i,n);var o=r;break t}finally{n.g.clear(),n.m=-1,n.i=-1,100>bt.length&&bt.push(n)}o=void 0}return o}}var Ar=[0,fr,Wn((function(t,e,n){return 2===t.i&&(Hn(e,n,(t=yt(t))===j()?void 0:t),!0)}),(function(t,e,n){if(null!=e){if(e instanceof pn){const r=e.P;return void(r&&(e=r(e),null!=e&&kt(t,n,$(e).buffer)))}if(Array.isArray(e))return}Qn(t,e,n)}))],Sr=[0,dr],Er=[0,sr,vr,cr,-1,ar,vr,-1],Tr=[0,cr,-1],Ir=class extends pn{constructor(){super()}};Ir.u=[6];var Pr=[0,cr,dr,cr,vr,-1,br,dr,-1,Tr,vr],Ur=[0,dr,-2],xr=class extends pn{constructor(){super()}},Lr=[0],Or=[0,sr,cr,-4],Vr=class extends pn{constructor(t){super(t,2)}},Br={},kr=[-2,Br,cr];Br[336783863]=[0,dr,cr,-1,sr,[0,[1,2,3,4,5,6],mr,Lr,mr,Pr,mr,Ur,mr,Or,mr,Er,mr,[0,dr]],Sr,cr,[0,[1,3],[2,4],mr,[0,ar],-1,mr,[0,hr],-1],dr];var Fr=[0,fr,lr],jr=[0,or,-1,lr,-3,or,ar,fr,ur,or,-1,lr,ur,lr,-2,fr],Nr=[-1,{}],Mr=[0,dr,1,Nr],Dr=[0,dr,hr,Nr],Cr=class extends pn{constructor(t){super(t,500)}o(t){return sn(this,0,7,t)}};Cr.u=[3,4,5,6,8,13,17,1005];var Gr,$r=[-500,fr,-1,hr,-3,kr,Zn,Ar,ur,-1,Mr,Dr,Zn,Fr,fr,jr,ur,hr,987,hr],zr=[0,fr,-1,Nr],Wr=[-500,dr,-1,[-1,{}],998,dr],Rr=[-500,dr,hr,-1,[-2,{},cr],997,hr,-1],Hr=[-500,dr,hr,Nr,998,hr],qr=class extends pn{constructor(){super(void 0,500)}o(t){return sn(this,0,1001,t)}};qr.u=[1,6,7,9,10,15,16,17,14,1002],qr.prototype.g=(Gr=[-500,Zn,$r,4,Zn,Wr,Zn,Rr,ur,Zn,Hr,hr,ur,Mr,Dr,Zn,zr,hr,-2,jr,fr,-1,lr,979,Nr,Zn,Ar],function(){const t=new class{constructor(){this.j=[],this.i=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const t=this.g;return this.g=[],t}}}};zn(this.l,t,jn(Gr)),Lt(t,t.g.end());const e=new Uint8Array(t.i),n=t.j,r=n.length;let o=0;for(let t=0;t<r;t++){const r=n[t];e.set(r,o),o+=r.length}return t.j=[e],e});var Jr=class extends pn{constructor(t){super(t)}},Kr=[0,sr,er,dr,-1],Yr=class extends pn{constructor(t){super(t)}g(){return on(this,Jr)}};Yr.u=[1];var Xr=[0,Zn,Kr],Qr=class extends pn{constructor(t){super(t)}};Qr.u=[4,5];var Zr=class extends pn{constructor(t){super(t)}},to=[1,2,3,4,5],eo=class extends pn{constructor(t){super(t)}g(){return null!=We(this)}i(){return null!=Ae(Me(this,2))}},no=class extends pn{constructor(t){super(t)}},ro=[0,[0,yr,dr,[0,sr,rr,-1],[0,ir,rr]],cr,[0,to,mr,Or,mr,Pr,mr,Er,mr,Lr,mr,Ur],vr],oo=class extends pn{constructor(t){super(t)}},io=new wr(451755788,oo);Br[451755788]=[0,ro,[0,dr,sr,er,hr,-1],tr];var so=class extends pn{constructor(t){super(t)}},ao=class extends pn{constructor(t){super(t)}},uo=new wr(487277289,ao);Br[487277289]=[0,ro,[0,cr,-1]];var co=class extends pn{constructor(t){super(t)}},lo=[0,1,sr,dr,Xr],ho=class extends pn{constructor(t){super(t)}};ho.u=[1];var fo=_r(ho,[0,Zn,lo,rr]),go=class extends pn{constructor(t){super(t)}};go.u=[1];var po=class extends pn{constructor(t){super(t)}K(){const t=We(this);return null==t?j():t}},mo=class extends pn{constructor(t){super(t)}},yo=[1,2],vo=[0,yo,mr,[0,nr],mr,[0,yr],sr,dr],bo=class extends pn{constructor(t){super(t)}};bo.u=[1];var wo=_r(bo,[0,Zn,vo,rr]);function _o(){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/))&&1<=t.length&&17<=Number(t[1])))}async function Ao(t){if("function"!=typeof importScripts){const e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise(((t,n)=>{e.addEventListener("load",(()=>{t()}),!1),e.addEventListener("error",(t=>{n(t)}),!1),document.body.appendChild(e)}))}importScripts(t.toString())}function So(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),n(e=t.h.stringToNewUTF8(e)),t.h._free(e)}function Eo(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const r=new Uint32Array(e.length);for(let n=0;n<e.length;n++)r[n]=t.h.stringToNewUTF8(e[n]);e=t.h._malloc(4*r.length),t.h.HEAPU32.set(r,e>>2),n(e);for(const e of r)t.h._free(e);t.h._free(e)}function To(t,e,n){t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=n}function Io(t,e,n){let r=[];t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=(t,e,o)=>{e?(n(r,o),r=[]):r.push(t)}}const Po=function(t){return class extends t{N(){this.h._registerModelResourcesGraphService()}}}(class{constructor(t,e){this.j=!0,this.h=t,this.g=null,this.i=0,this.m="function"==typeof this.h._addIntToInputStream,void 0!==e?this.h.canvas=e:_o()?this.h.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.h.canvas=document.createElement("canvas"))}async initializeGraph(t){const e=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(e),t)}setGraphFromString(t){this.setGraph((new TextEncoder).encode(t),!1)}setGraph(t,e){const n=t.length,r=this.h._malloc(n);this.h.HEAPU8.set(t,r),e?this.h._changeBinaryGraph(n,r):this.h._changeTextGraph(n,r),this.h._free(r)}configureAudio(t,e,n,r,o){this.h._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),So(this,r||"input_audio",(r=>{So(this,o=o||"audio_header",(o=>{this.h._configureAudio(r,o,t,e,n)}))}))}setAutoResizeCanvas(t){this.j=t}setAutoRenderToScreen(t){this.h._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.h.gpuOriginForWebTexturesIsBottomLeft=t}attachErrorListener(t){this.h.errorListener=t}attachEmptyPacketListener(t,e){this.h.emptyPacketListeners=this.h.emptyPacketListeners||{},this.h.emptyPacketListeners[t]=e}addAudioToStream(t,e,n){this.addAudioToStreamWithShape(t,0,0,e,n)}addAudioToStreamWithShape(t,e,n,r,o){const i=4*t.length;this.i!==i&&(this.g&&this.h._free(this.g),this.g=this.h._malloc(i),this.i=i),this.h.HEAPF32.set(t,this.g/4),So(this,r,(t=>{this.h._addAudioToInputStream(this.g,e,n,t,o)}))}addGpuBufferToStream(t,e,n){So(this,e,(e=>{if(!this.h.canvas)throw Error("No OpenGL canvas configured.");e?this.h._bindTextureToStream(e):this.h._bindTextureToCanvas();const r=this.h.canvas.getContext("webgl2")||this.h.canvas.getContext("webgl");if(!r)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");this.h.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t),this.h.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);const[o,i]=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.j||o===this.h.canvas.width&&i===this.h.canvas.height||(this.h.canvas.width=o,this.h.canvas.height=i);const[s,a]=[o,i];this.h._addBoundTextureToStream(e,s,a,n)}))}addBoolToStream(t,e,n){So(this,e,(e=>{this.h._addBoolToInputStream(t,e,n)}))}addDoubleToStream(t,e,n){So(this,e,(e=>{this.h._addDoubleToInputStream(t,e,n)}))}addFloatToStream(t,e,n){So(this,e,(e=>{this.h._addFloatToInputStream(t,e,n)}))}addIntToStream(t,e,n){So(this,e,(e=>{this.h._addIntToInputStream(t,e,n)}))}addUintToStream(t,e,n){So(this,e,(e=>{this.h._addUintToInputStream(t,e,n)}))}addStringToStream(t,e,n){So(this,e,(e=>{So(this,t,(t=>{this.h._addStringToInputStream(t,e,n)}))}))}addStringRecordToStream(t,e,n){So(this,e,(e=>{Eo(this,Object.keys(t),(r=>{Eo(this,Object.values(t),(o=>{this.h._addFlatHashMapToInputStream(r,o,Object.keys(t).length,e,n)}))}))}))}addProtoToStream(t,e,n,r){So(this,n,(n=>{So(this,e,(e=>{const o=this.h._malloc(t.length);this.h.HEAPU8.set(t,o),this.h._addProtoToInputStream(o,t.length,e,n,r),this.h._free(o)}))}))}addEmptyPacketToStream(t,e){So(this,t,(t=>{this.h._addEmptyPacketToInputStream(t,e)}))}addBoolVectorToStream(t,e,n){So(this,e,(e=>{const r=this.h._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.h._addBoolVectorEntry(r,e);this.h._addBoolVectorToInputStream(r,e,n)}))}addDoubleVectorToStream(t,e,n){So(this,e,(e=>{const r=this.h._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.h._addDoubleVectorEntry(r,e);this.h._addDoubleVectorToInputStream(r,e,n)}))}addFloatVectorToStream(t,e,n){So(this,e,(e=>{const r=this.h._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.h._addFloatVectorEntry(r,e);this.h._addFloatVectorToInputStream(r,e,n)}))}addIntVectorToStream(t,e,n){So(this,e,(e=>{const r=this.h._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.h._addIntVectorEntry(r,e);this.h._addIntVectorToInputStream(r,e,n)}))}addUintVectorToStream(t,e,n){So(this,e,(e=>{const r=this.h._allocateUintVector(t.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(const e of t)this.h._addUintVectorEntry(r,e);this.h._addUintVectorToInputStream(r,e,n)}))}addStringVectorToStream(t,e,n){So(this,e,(e=>{const r=this.h._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(const e of t)So(this,e,(t=>{this.h._addStringVectorEntry(r,t)}));this.h._addStringVectorToInputStream(r,e,n)}))}addBoolToInputSidePacket(t,e){So(this,e,(e=>{this.h._addBoolToInputSidePacket(t,e)}))}addDoubleToInputSidePacket(t,e){So(this,e,(e=>{this.h._addDoubleToInputSidePacket(t,e)}))}addFloatToInputSidePacket(t,e){So(this,e,(e=>{this.h._addFloatToInputSidePacket(t,e)}))}addIntToInputSidePacket(t,e){So(this,e,(e=>{this.h._addIntToInputSidePacket(t,e)}))}addUintToInputSidePacket(t,e){So(this,e,(e=>{this.h._addUintToInputSidePacket(t,e)}))}addStringToInputSidePacket(t,e){So(this,e,(e=>{So(this,t,(t=>{this.h._addStringToInputSidePacket(t,e)}))}))}addProtoToInputSidePacket(t,e,n){So(this,n,(n=>{So(this,e,(e=>{const r=this.h._malloc(t.length);this.h.HEAPU8.set(t,r),this.h._addProtoToInputSidePacket(r,t.length,e,n),this.h._free(r)}))}))}addBoolVectorToInputSidePacket(t,e){So(this,e,(e=>{const n=this.h._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.h._addBoolVectorEntry(n,e);this.h._addBoolVectorToInputSidePacket(n,e)}))}addDoubleVectorToInputSidePacket(t,e){So(this,e,(e=>{const n=this.h._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.h._addDoubleVectorEntry(n,e);this.h._addDoubleVectorToInputSidePacket(n,e)}))}addFloatVectorToInputSidePacket(t,e){So(this,e,(e=>{const n=this.h._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.h._addFloatVectorEntry(n,e);this.h._addFloatVectorToInputSidePacket(n,e)}))}addIntVectorToInputSidePacket(t,e){So(this,e,(e=>{const n=this.h._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.h._addIntVectorEntry(n,e);this.h._addIntVectorToInputSidePacket(n,e)}))}addUintVectorToInputSidePacket(t,e){So(this,e,(e=>{const n=this.h._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(const e of t)this.h._addUintVectorEntry(n,e);this.h._addUintVectorToInputSidePacket(n,e)}))}addStringVectorToInputSidePacket(t,e){So(this,e,(e=>{const n=this.h._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const e of t)So(this,e,(t=>{this.h._addStringVectorEntry(n,t)}));this.h._addStringVectorToInputSidePacket(n,e)}))}attachBoolListener(t,e){To(this,t,e),So(this,t,(t=>{this.h._attachBoolListener(t)}))}attachBoolVectorListener(t,e){Io(this,t,e),So(this,t,(t=>{this.h._attachBoolVectorListener(t)}))}attachIntListener(t,e){To(this,t,e),So(this,t,(t=>{this.h._attachIntListener(t)}))}attachIntVectorListener(t,e){Io(this,t,e),So(this,t,(t=>{this.h._attachIntVectorListener(t)}))}attachUintListener(t,e){To(this,t,e),So(this,t,(t=>{this.h._attachUintListener(t)}))}attachUintVectorListener(t,e){Io(this,t,e),So(this,t,(t=>{this.h._attachUintVectorListener(t)}))}attachDoubleListener(t,e){To(this,t,e),So(this,t,(t=>{this.h._attachDoubleListener(t)}))}attachDoubleVectorListener(t,e){Io(this,t,e),So(this,t,(t=>{this.h._attachDoubleVectorListener(t)}))}attachFloatListener(t,e){To(this,t,e),So(this,t,(t=>{this.h._attachFloatListener(t)}))}attachFloatVectorListener(t,e){Io(this,t,e),So(this,t,(t=>{this.h._attachFloatVectorListener(t)}))}attachStringListener(t,e){To(this,t,e),So(this,t,(t=>{this.h._attachStringListener(t)}))}attachStringVectorListener(t,e){Io(this,t,e),So(this,t,(t=>{this.h._attachStringVectorListener(t)}))}attachProtoListener(t,e,n){To(this,t,e),So(this,t,(t=>{this.h._attachProtoListener(t,n||!1)}))}attachProtoVectorListener(t,e,n){Io(this,t,e),So(this,t,(t=>{this.h._attachProtoVectorListener(t,n||!1)}))}attachAudioListener(t,e,n){this.h._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),To(this,t,((t,n)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,n)})),So(this,t,(t=>{this.h._attachAudioListener(t,n||!1)}))}finishProcessing(){this.h._waitUntilIdle()}closeGraph(){this.h._closeGraph(),this.h.simpleListeners=void 0,this.h.emptyPacketListeners=void 0}});var Uo=class extends Po{};async function xo(t,e,n){return t=await(async(t,e,n,r)=>{if(e&&await Ao(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(n&&(await Ao(n),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&r&&((e=self.Module).locateFile=r.locateFile,r.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=r.mainScriptUrlOrBlob)),r=await self.ModuleFactory(self.Module||r),self.ModuleFactory=self.Module=void 0,new t(r,null)})(t,e.wasmLoaderPath,e.assetLoaderPath,{locateFile:t=>t.endsWith(".wasm")?e.wasmBinaryPath.toString():e.assetBinaryPath&&t.endsWith(".data")?e.assetBinaryPath.toString():t}),await t.o(n),t}async function Lo(t,e,n){return xo(t,e,n)}function Oo(t,e){const n=nn(t.baseOptions,eo,1)||new eo;"string"==typeof e?(Ge(n,2,_e(e)),Ge(n,1)):e instanceof Uint8Array&&(Ge(n,1,ee(e,!1,!1)),Ge(n,2)),sn(t.baseOptions,0,1,n)}function Vo(t,e){const n=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(nn(t.baseOptions,eo,1)?.g()||nn(t.baseOptions,eo,1)?.i()||e.baseOptions?.modelAssetBuffer||e.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");return function(t,e){let n=nn(t.baseOptions,Zr,3);if(!n){var r=n=new Zr;an(r,4,new xr)}"delegate"in e&&("GPU"===e.delegate?an(e=n,2,r=new Ir):an(e=n,4,r=new xr)),sn(t.baseOptions,0,3,n)}(t,n),n.modelAssetPath?fetch(n.modelAssetPath.toString()).then((t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${n.modelAssetPath} (${t.status})`)})).then((e=>{try{t.g.h.FS_unlink("/model.dat")}catch{}t.g.h.FS_createDataFile("/","model.dat",new Uint8Array(e),!0,!1,!1),Oo(t,"/model.dat"),t.H()})):(Oo(t,n.modelAssetBuffer),t.H(),Promise.resolve())}function Bo(t){try{const e=t.j.length;if(1===e)throw Error(t.j[0].message);if(1<e)throw Error("Encountered multiple errors: "+t.j.map((t=>t.message)).join(", "))}finally{t.j=[]}}function ko(t,e){t.s=Math.max(t.s,e)}var Fo=class{constructor(t){this.g=t,this.j=[],this.s=0,this.g.setAutoRenderToScreen(!1)}setGraph(t,e){this.g.attachErrorListener(((t,e)=>{this.j.push(Error(e))})),this.g.N(),this.g.setGraph(t,e),Bo(this)}finishProcessing(){this.g.finishProcessing(),Bo(this)}close(){this.g.closeGraph()}};async function jo(t,e,n){return Lo(t,e,n)}Fo.prototype.close=Fo.prototype.close;var No=class extends Fo{constructor(){super(...arguments),this.G=48e3}O(t){this.G=t}};function Mo(t){const e={classifications:on(t,co).map((t=>function(t,e=-1,n=""){return{categories:t.map((t=>{var e=me(Me(t,1))??0??-1;const n=t.l;let r=Rt(n);const o=Ce(n,r,2),i=fe(o);return null!=i&&i!==o&&$e(n,r,2,i),{index:e,score:i??0??0,categoryName:fn(Ae(Me(t,3)),"")??"",displayName:fn(Ae(Me(t,4)),"")??""}})),headIndex:e,headName:n}}(nn(t,Yr,4)?.g()??[],me(Me(t,2))??0,fn(Ae(Me(t,3)),""))))};return null!=hn(t)&&(e.timestampMs=fn(hn(t),0)),e}No.prototype.setDefaultSampleRate=No.prototype.O;var Do=class extends No{constructor(t,e){super(new Uo(t,e)),this.m=[],sn(t=this.i=new oo,0,1,e=new no)}get baseOptions(){return nn(this.i,no,1)}set baseOptions(t){sn(this.i,0,1,t)}o(t){var e=this.i,n=nn(this.i,Qr,2);if(n=n?Be(n):new Qr,void 0!==t.displayNamesLocale?Ge(n,1,_e(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Ge(n,1),void 0!==t.maxResults){var r=t.maxResults;if(null!=r){if("number"!=typeof r)throw he();if(!Number.isFinite(r))throw he();r|=0}Ge(n,2,r)}else"maxResults"in t&&Ge(n,2);if(void 0!==t.scoreThreshold){if(null!=(r=t.scoreThreshold)&&"number"!=typeof r)throw Error(`Value of float/double field must be a number, found ${typeof r}: ${r}`);Ge(n,3,r)}else"scoreThreshold"in t&&Ge(n,3);return void 0!==t.categoryAllowlist?Je(n,4,t.categoryAllowlist):"categoryAllowlist"in t&&Ge(n,4),void 0!==t.categoryDenylist?Je(n,5,t.categoryDenylist):"categoryDenylist"in t&&Ge(n,5),sn(e,0,2,n),Vo(this,t)}L(t,e){return this.F(t,e??this.G,this.s+1)}F(t,e,n){return this.g.addDoubleToStream(e,"sample_rate",n),this.g.addAudioToStreamWithShape(t,1,t.length,"audio_in",n),this.m=[],this.finishProcessing(),[...this.m]}H(){var t=new qr;dn(t,10,"audio_in"),dn(t,10,"sample_rate"),dn(t,15,"timestamped_classifications");const e=new Vr;gn(e,io,this.i);const n=new Cr;Ke(n,_e("mediapipe.tasks.audio.audio_classifier.AudioClassifierGraph")),dn(n,3,"AUDIO:audio_in"),dn(n,3,"SAMPLE_RATE:sample_rate"),dn(n,4,"TIMESTAMPED_CLASSIFICATIONS:timestamped_classifications"),n.o(e),ln(t,n),this.g.attachProtoVectorListener("timestamped_classifications",((t,e)=>{!function(t,e){e.forEach((e=>{e=fo(e),t.m.push(Mo(e))}))}(this,t),ko(this,e)})),this.g.attachEmptyPacketListener("timestamped_classifications",(t=>{ko(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function Co(t){return{embeddings:on(t,mo).map((t=>{const e={headIndex:me(Me(t,3))??0??-1,headName:fn(Ae(Me(t,4)),"")??""};if(void 0!==en(t,go,Qe(t,1))){var n=nn(t,go,Qe(t,1));t=n.l;var r=Rt(t);const s=2&r?1:2;let a=Re(t,r);var o=Wt(a);if(Ne(n,o,void 0,!1)){(4&o||Object.isFrozen(a))&&(a=jt(a),o=un(o,r),r=$e(t,r,1,a));for(var i=n=0;n<a.length;n++){const t=fe(a[n]);null!=t&&(a[i++]=t)}i<n&&(a.length=i),o=zt(o=He(o,r),20,!0),o=zt(o,4096,!1),o=zt(o,8192,!1),Ht(a,o),2&o&&Object.freeze(a)}qe(o)||(n=o,(o=(i=1===s||4===s&&!!(32&o))?zt(o,2,!0):cn(o,r,!1))!==n&&Ht(a,o),i&&Object.freeze(a)),2===s&&qe(o)&&(a=jt(a),o=cn(o=un(o,r),r,!1),Ht(a,o),$e(t,r,1,a)),e.floatEmbedding=a.slice()}else r=new Uint8Array(0),e.quantizedEmbedding=nn(t,po,Qe(t,2))?.K()?.i()??r;return e})),timestampMs:fn(hn(t),0)}}Do.prototype.classify=Do.prototype.L,Do.prototype.setOptions=Do.prototype.o,Do.createFromModelPath=function(t,e){return Lo(Do,t,{baseOptions:{modelAssetPath:e}})},Do.createFromModelBuffer=function(t,e){return jo(Do,t,{baseOptions:{modelAssetBuffer:e}})},Do.createFromOptions=function(t,e){return jo(Do,t,e)};var Go=class extends No{constructor(t,e){super(new Uo(t,e)),this.m=[],sn(t=this.i=new ao,0,1,e=new no)}get baseOptions(){return nn(this.i,no,1)}set baseOptions(t){sn(this.i,0,1,t)}o(t){var e=this.i,n=nn(this.i,so,2);return n=n?Be(n):new so,void 0!==t.l2Normalize?Ge(n,1,de(t.l2Normalize)):"l2Normalize"in t&&Ge(n,1),void 0!==t.quantize?Ge(n,2,de(t.quantize)):"quantize"in t&&Ge(n,2),sn(e,0,2,n),Vo(this,t)}M(t,e){return this.F(t,e??this.G,this.s+1)}F(t,e,n){return this.g.addDoubleToStream(e,"sample_rate",n),this.g.addAudioToStreamWithShape(t,1,t.length,"audio_in",n),this.m=[],this.finishProcessing(),this.m}H(){var t=new qr;dn(t,10,"audio_in"),dn(t,10,"sample_rate"),dn(t,15,"embeddings_out"),dn(t,15,"timestamped_embeddings_out");const e=new Vr;gn(e,uo,this.i);const n=new Cr;Ke(n,_e("mediapipe.tasks.audio.audio_embedder.AudioEmbedderGraph")),dn(n,3,"AUDIO:audio_in"),dn(n,3,"SAMPLE_RATE:sample_rate"),dn(n,4,"EMBEDDINGS:embeddings_out"),dn(n,4,"TIMESTAMPED_EMBEDDINGS:timestamped_embeddings_out"),n.o(e),ln(t,n),this.g.attachProtoListener("embeddings_out",((t,e)=>{t=wo(t),this.m.push(Co(t)),ko(this,e)})),this.g.attachEmptyPacketListener("embeddings_out",(t=>{ko(this,t)})),this.g.attachProtoVectorListener("timestamped_embeddings_out",((t,e)=>{for(const e of t)t=wo(e),this.m.push(Co(t));ko(this,e)})),this.g.attachEmptyPacketListener("timestamped_embeddings_out",(t=>{ko(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};let $o;Go.prototype.embed=Go.prototype.M,Go.prototype.setOptions=Go.prototype.o,Go.createFromModelPath=function(t,e){return jo(Go,t,{baseOptions:{modelAssetPath:e}})},Go.createFromModelBuffer=function(t,e){return jo(Go,t,{baseOptions:{modelAssetBuffer:e}})},Go.createFromOptions=function(t,e){return jo(Go,t,e)};const zo=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 Wo(){if(void 0===$o)try{await WebAssembly.instantiate(zo),$o=!0}catch{$o=!1}return $o}async function Ro(t,e=""){const n=await Wo()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var Ho=class{};Ho.forVisionTasks=function(t){return Ro("vision",t)},Ho.forTextTasks=function(t){return Ro("text",t)},Ho.forGenAiExperimentalTasks=function(t){return Ro("genai_experimental",t)},Ho.forGenAiTasks=function(t){return Ro("genai",t)},Ho.forAudioTasks=function(t){return Ro("audio",t)},Ho.isSimdSupported=function(){return Wo()},exports.AudioClassifier=Do,exports.AudioEmbedder=Go,exports.AudioTaskRunner=No,exports.FilesetResolver=Ho,exports.TaskRunner=Fo;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t="undefined"!=typeof self?self:{};function e(e){t:{for(var n=["CLOSURE_FLAGS"],r=t,i=0;i<n.length;i++)if(null==(r=r[n[i]])){n=null;break t}n=r}return null!=(e=n&&n[e])&&e}function n(){throw Error("Invalid UTF8")}function r(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}let i,o;const s="undefined"!=typeof TextDecoder;let a;const u="undefined"!=typeof TextEncoder;function c(t){if(u)t=(a||=new TextEncoder).encode(t);else{let n=0;const r=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(128>e)r[n++]=e;else{if(2048>e)r[n++]=e>>6|192;else{if(55296<=e&&57343>=e){if(56319>=e&&i<t.length){const o=t.charCodeAt(++i);if(56320<=o&&57343>=o){e=1024*(e-55296)+o-56320+65536,r[n++]=e>>18|240,r[n++]=e>>12&63|128,r[n++]=e>>6&63|128,r[n++]=63&e|128;continue}i--}e=65533}r[n++]=e>>12|224,r[n++]=e>>6&63|128}r[n++]=63&e|128}}t=n===r.length?r:r.subarray(0,n)}return t}var l,h=e(610401301),f=e(188588736);const d=t.navigator;function g(t){return!!h&&(!!l&&l.brands.some((({brand:e})=>e&&-1!=e.indexOf(t))))}function p(e){var n;return(n=t.navigator)&&(n=n.userAgent)||(n=""),-1!=n.indexOf(e)}function m(){return!!h&&(!!l&&0<l.brands.length)}function y(){return m()?g("Chromium"):(p("Chrome")||p("CriOS"))&&!(!m()&&p("Edge"))||p("Silk")}l=d&&d.userAgentData||null;var v=!m()&&(p("Trident")||p("MSIE"));!p("Android")||y(),y(),p("Safari")&&(y()||!m()&&p("Coast")||!m()&&p("Opera")||!m()&&p("Edge")||(m()?g("Microsoft Edge"):p("Edg/"))||m()&&g("Opera"));var b={},w=null;function _(t){var e=t.length,n=3*e/4;n%3?n=Math.floor(n):-1!="=.".indexOf(t[e-1])&&(n=-1!="=.".indexOf(t[e-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),i=w[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}A();for(var r=0;;){var i=n(-1),o=n(0),s=n(64),a=n(64);if(64===a&&-1===i)break;e(i<<2|o>>4),64!=s&&(e(o<<4&240|s>>2),64!=a&&e(s<<6&192|a))}}(t,(function(t){r[i++]=t})),i!==n?r.subarray(0,i):r}function A(){if(!w){w={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=t.concat(e[n].split(""));b[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===w[o]&&(w[o]=i)}}}}var S="undefined"!=typeof Uint8Array,E=!v&&"function"==typeof btoa;function T(t){if(!E){var e;void 0===e&&(e=0),A(),e=b[e];var n=Array(Math.floor(t.length/3)),r=e[64]||"";let u=0,c=0;for(;u<t.length-2;u+=3){var i=t[u],o=t[u+1],s=t[u+2],a=e[i>>2];i=e[(3&i)<<4|o>>4],o=e[(15&o)<<2|s>>6],s=e[63&s],n[c++]=a+i+o+s}switch(a=0,s=r,t.length-u){case 2:s=e[(15&(a=t[u+1]))<<2]||r;case 1:t=t[u],n[c]=e[t>>2]+e[(3&t)<<4|a>>4]+s+r}return n.join("")}for(e="",n=0,r=t.length-10240;n<r;)e+=String.fromCharCode.apply(null,t.subarray(n,n+=10240));return e+=String.fromCharCode.apply(null,n?t.subarray(n):t),btoa(e)}const I=/[-_.]/g,P={"-":"+",_:"/",".":"="};function U(t){return P[t]||""}function x(t){if(!E)return _(t);I.test(t)&&(t=t.replace(I,U)),t=atob(t);const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function L(t){return S&&null!=t&&t instanceof Uint8Array}let O;function B(){return O||=new Uint8Array(0)}var V={};let k;function j(t){if(t!==V)throw Error("illegal external caller")}function F(){return k||=new M(null,V)}function N(t){j(V);var e=t.g;return null==(e=null==e||L(e)?e:"string"==typeof e?x(e):null)?e:t.g=e}var M=class{constructor(t,e){if(j(e),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}i(){const t=N(this);return t?new Uint8Array(t):B()}};function D(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function C(){return Error("Failed to read varint, encoding is invalid.")}function G(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function $(t){if("string"==typeof t)return{buffer:x(t),v:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),v:!1};if(t.constructor===Uint8Array)return{buffer:t,v:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),v:!1};if(t.constructor===M)return{buffer:N(t)||B(),v:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),v:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function z(){return"function"==typeof BigInt}const W="function"==typeof Uint8Array.prototype.slice;let R,H=0,q=0;function J(t){const e=0>t;let n=(t=Math.abs(t))>>>0;if(t=Math.floor((t-n)/4294967296),e){const[e,r]=et(n,t);t=r,n=e}H=n>>>0,q=t>>>0}function K(t){const e=R||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),q=0,H=e.getUint32(0,!0)}function Y(t,e){return 4294967296*e+(t>>>0)}function X(t,e){const n=2147483648&e;return n&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),t=Y(t,e),n?-t:t}function Q(t,e){if(t>>>=0,2097151>=(e>>>=0))var n=""+(4294967296*e+t);else z()?n=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(n=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),n+=8147497*e,e*=2,1e7<=t&&(n+=Math.floor(t/1e7),t%=1e7),1e7<=n&&(e+=Math.floor(n/1e7),n%=1e7),n=e+Z(n)+Z(t));return n}function Z(t){return t=String(t),"0000000".slice(t.length)+t}function tt(t){if(16>t.length)J(Number(t));else if(z())t=BigInt(t),H=Number(t&BigInt(4294967295))>>>0,q=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);q=H=0;const n=t.length;for(let r=e,i=(n-e)%6+e;i<=n;r=i,i+=6){const e=Number(t.slice(r,i));q*=1e6,H=1e6*H+e,4294967296<=H&&(q+=Math.trunc(H/4294967296),q>>>=0,H>>>=0)}if(e){const[t,e]=et(H,q);H=t,q=e}}}function et(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function nt(t,e){let n,r=0,i=0,o=0;const s=t.i;let a=t.g;do{n=s[a++],r|=(127&n)<<o,o+=7}while(32>o&&128&n);for(32<o&&(i|=(127&n)>>4),o=3;32>o&&128&n;o+=7)n=s[a++],i|=(127&n)<<o;if(ct(t,a),128>n)return e(r>>>0,i>>>0);throw C()}function rt(t){let e=0,n=t.g;const r=n+10,i=t.i;for(;n<r;){const r=i[n++];if(e|=r,0==(128&r))return ct(t,n),!!(127&e)}throw C()}function it(t){const e=t.i;let n=t.g,r=e[n++],i=127&r;if(128&r&&(r=e[n++],i|=(127&r)<<7,128&r&&(r=e[n++],i|=(127&r)<<14,128&r&&(r=e[n++],i|=(127&r)<<21,128&r&&(r=e[n++],i|=r<<28,128&r&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++])))))throw C();return ct(t,n),i}function ot(t){var e=t.i;const n=t.g,r=e[n],i=e[n+1],o=e[n+2];return e=e[n+3],ct(t,t.g+4),(r<<0|i<<8|o<<16|e<<24)>>>0}function st(t){var e=ot(t);t=2*(e>>31)+1;const n=e>>>23&255;return e&=8388607,255==n?e?NaN:1/0*t:0==n?t*Math.pow(2,-149)*e:t*Math.pow(2,n-150)*(e+Math.pow(2,23))}function at(t){return it(t)}function ut(t,e,{D:n=!1}={}){t.D=n,e&&(e=$(e),t.i=e.buffer,t.m=e.v,t.s=0,t.j=t.i.length,t.g=t.s)}function ct(t,e){if(t.g=e,e>t.j)throw G(t.j,e)}function lt(t,e){if(0>e)throw Error(`Tried to read a negative byte length: ${e}`);const n=t.g,r=n+e;if(r>t.j)throw G(e,t.j-n);return t.g=r,n}function ht(t,e){if(0==e)return F();var n=lt(t,e);return t.D&&t.m?n=t.i.subarray(n,n+e):(t=t.i,n=n===(e=n+e)?B():W?t.slice(n,e):new Uint8Array(t.subarray(n,e))),0==n.length?F():new M(n,V)}var ft=[];function dt(t){var e=t.g;if(e.g==e.j)return!1;t.j=t.g.g;var n=it(t.g)>>>0;if(e=n>>>3,!(0<=(n&=7)&&5>=n))throw D(n,t.j);if(1>e)throw Error(`Invalid field number: ${e} (at position ${t.j})`);return t.m=e,t.i=n,!0}function gt(t){switch(t.i){case 0:0!=t.i?gt(t):rt(t.g);break;case 1:ct(t=t.g,t.g+8);break;case 2:if(2!=t.i)gt(t);else{var e=it(t.g)>>>0;ct(t=t.g,t.g+e)}break;case 5:ct(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!dt(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.i){if(t.m!=e)throw Error("Unmatched end-group tag");break}gt(t)}break;default:throw D(t.i,t.j)}}function pt(t,e,n){const r=t.g.j,i=it(t.g)>>>0,o=t.g.g+i;let s=o-r;if(0>=s&&(t.g.j=o,n(e,t,void 0,void 0,void 0),s=o-t.g.g),s)throw Error(`Message parsing ended unexpectedly. Expected to read ${i} bytes, instead read ${i-s} bytes, either the data ended unexpectedly or the message misreported its own length`);t.g.g=o,t.g.j=r}function mt(t){var e=it(t.g)>>>0,a=lt(t=t.g,e);if(t=t.i,s){var u,c=t;(u=o)||(u=o=new TextDecoder("utf-8",{fatal:!0})),e=a+e,c=0===a&&e===c.length?c:c.subarray(a,e);try{var l=u.decode(c)}catch(t){if(void 0===i){try{u.decode(new Uint8Array([128]))}catch(t){}try{u.decode(new Uint8Array([97])),i=!0}catch(t){i=!1}}throw!i&&(o=void 0),t}}else{e=(l=a)+e,a=[];let i,o=null;for(;l<e;){var h=t[l++];128>h?a.push(h):224>h?l>=e?n():(i=t[l++],194>h||128!=(192&i)?(l--,n()):a.push((31&h)<<6|63&i)):240>h?l>=e-1?n():(i=t[l++],128!=(192&i)||224===h&&160>i||237===h&&160<=i||128!=(192&(u=t[l++]))?(l--,n()):a.push((15&h)<<12|(63&i)<<6|63&u)):244>=h?l>=e-2?n():(i=t[l++],128!=(192&i)||0!=i-144+(h<<28)>>30||128!=(192&(u=t[l++]))||128!=(192&(c=t[l++]))?(l--,n()):(h=(7&h)<<18|(63&i)<<12|(63&u)<<6|63&c,h-=65536,a.push(55296+(h>>10&1023),56320+(1023&h)))):n(),8192<=a.length&&(o=r(o,a),a.length=0)}l=r(o,a)}return l}function yt(t){const e=it(t.g)>>>0;return ht(t.g,e)}function vt(t,e,n){var r=it(t.g)>>>0;for(r=t.g.g+r;t.g.g<r;)n.push(e(t.g))}var bt=[];function wt(t){return t?/^\d+$/.test(t)?(tt(t),new _t(H,q)):null:At||=new _t(0,0)}var _t=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let At;function St(t){return t?/^-?\d+$/.test(t)?(tt(t),new Et(H,q)):null:Tt||=new Et(0,0)}var Et=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let Tt;function It(t,e,n){for(;0<n||127<e;)t.g.push(127&e|128),e=(e>>>7|n<<25)>>>0,n>>>=7;t.g.push(e)}function Pt(t,e){for(;127<e;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function Ut(t,e){if(0<=e)Pt(t,e);else{for(let n=0;9>n;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function xt(t,e){t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}function Lt(t,e){0!==e.length&&(t.j.push(e),t.i+=e.length)}function Ot(t,e,n){Pt(t.g,8*e+n)}function Bt(t,e){return Ot(t,e,2),e=t.g.end(),Lt(t,e),e.push(t.i),e}function Vt(t,e){var n=e.pop();for(n=t.i+t.g.length()-n;127<n;)e.push(127&n|128),n>>>=7,t.i++;e.push(n),t.i++}function kt(t,e,n){Ot(t,e,2),Pt(t.g,n.length),Lt(t,t.g.end()),Lt(t,n)}class jt{constructor(t,e,n,r){this.g=t,this.i=e,this.j=n,this.J=r}}function Ft(t){return Array.prototype.slice.call(t)}function Nt(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():t}var Mt=Nt(),Dt=Nt("2ex"),Ct=Nt("0dg"),Gt=Mt?(t,e)=>{t[Mt]|=e}:(t,e)=>{void 0!==t.g?t.g|=e:Object.defineProperties(t,{g:{value:e,configurable:!0,writable:!0,enumerable:!1}})},$t=Mt?(t,e)=>{t[Mt]&=~e}:(t,e)=>{void 0!==t.g&&(t.g&=~e)};function zt(t,e,n){return n?t|e:t&~e}var Wt=Mt?t=>0|t[Mt]:t=>0|t.g,Rt=Mt?t=>t[Mt]:t=>t.g,Ht=Mt?(t,e)=>(t[Mt]=e,t):(t,e)=>(void 0!==t.g?t.g=e:Object.defineProperties(t,{g:{value:e,configurable:!0,writable:!0,enumerable:!1}}),t);function qt(t,e){Ht(e,-14591&(0|t))}function Jt(t,e){Ht(e,-14557&(34|t))}function Kt(t){return 0===(t=t>>14&1023)?536870912:t}var Yt,Xt={},Qt={};function Zt(t){return!(!t||"object"!=typeof t||t.g!==Qt)}function te(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}function ee(t,e,n){if(null!=t)if("string"==typeof t)t=t?new M(t,V):F();else if(t.constructor!==M)if(L(t))t=t.length?new M(n?t:new Uint8Array(t),V):F();else{if(!e)throw Error();t=void 0}return t}function ne(t,e,n){if(!Array.isArray(t)||t.length)return!1;const r=Wt(t);return!!(1&r)||!(!e||!(Array.isArray(e)?e.includes(n):e.has(n)))&&(Ht(t,1|r),!0)}const re=[];function ie(t){if(2&t)throw Error()}let oe,se,ae;function ue(t,e){(e=oe?e[oe]:void 0)&&(t[oe]=Ft(e))}Ht(re,55),Yt=Object.freeze(re);function ce(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function le(){const e=Error();ce(e,"incident"),function(e){t.setTimeout((()=>{throw e}),0)}(e)}function he(){const t=Error("int32");return ce(t,"warning"),t}function fe(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function de(t){if(null!=t&&"boolean"!=typeof t){var e=typeof t;throw Error(`Expected boolean but got ${"object"!=e?e:t?Array.isArray(t)?"array":e:"null"}: ${t}`)}return t}Object.freeze(new class{}),Object.freeze(new class{});const ge=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function pe(t){const e=typeof t;return"number"===e?Number.isFinite(t):"string"===e&&ge.test(t)}function me(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t&&Number.isFinite(t)?0|t:void 0}function ye(t){return"-"!==t[0]&&(20>t.length||20===t.length&&184467>Number(t.substring(0,6)))}function ve(t){return t=Math.trunc(t),Number.isSafeInteger(t)||(J(t),t=X(H,q)),t}function be(t){var e=Math.trunc(Number(t));if(Number.isSafeInteger(e))return String(e);if(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),!("-"===t[0]?20>t.length||20===t.length&&-922337<Number(t.substring(0,7)):19>t.length||19===t.length&&922337>Number(t.substring(0,6))))if(tt(t),t=H,2147483648&(e=q))if(z())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,r]=et(t,e);t="-"+Q(n,r)}else t=Q(t,e);return t}function we(t){if("string"!=typeof t)throw Error();return t}function _e(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function Ae(t){return null==t||"string"==typeof t?t:void 0}function Se(t,e,n){if(null!=t&&"object"==typeof t&&t.C===Xt)return t;if(Array.isArray(t)){var r=Wt(t),i=r;return 0===i&&(i|=32&n),(i|=2&n)!==r&&Ht(t,i),new e(t)}}let Ee,Te,Ie;function Pe(t){switch(typeof t){case"boolean":return Te||=[0,void 0,!0];case"number":return 0<t?void 0:0===t?Ie||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}function Ue(t,e,n){if(null==t&&(t=Ee),Ee=void 0,null==t){var r=96;n?(t=[n],r|=512):t=[],e&&(r=-16760833&r|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(2048&(r=Wt(t)))throw Error("farr");if(64&r)return t;if(r|=64,n&&(r|=512,n!==t[0]))throw Error("mid");t:{const i=(n=t).length;if(i){const t=i-1;if(te(n[t])){if(1024<=(e=t-(+!!(512&(r|=256))-1)))throw Error("pvtlmt");r=-16760833&r|(1023&e)<<14;break t}}if(e){if(1024<(e=Math.max(e,i-(+!!(512&r)-1))))throw Error("spvt");r=-16760833&r|(1023&e)<<14}}}return Ht(t,r),t}function xe(t,e,n,r,i){if(null!=t){if(Array.isArray(t))t=ne(t,void 0,0)?void 0:i&&2&Wt(t)?t:Le(t,e,n,void 0!==r,i);else if(te(t)){const o={};for(let s in t)o[s]=xe(t[s],e,n,r,i);t=o}else t=e(t,r);return t}}function Le(t,e,n,r,i){const o=r||n?Wt(t):0;r=r?!!(32&o):void 0;const s=Ft(t);for(let t=0;t<s.length;t++)s[t]=xe(s[t],e,n,r,i);return n&&(ue(s,t),n(o,s)),s}function Oe(t){return t.C===Xt?t.toJSON():function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"boolean":return t?1:0;case"object":if(t)if(Array.isArray(t)){if(ne(t,void 0,0))return}else{if(L(t))return T(t);if(t instanceof M){const e=t.g;return null==e?"":"string"==typeof e?e:t.g=T(e)}}}return t}(t)}function Be(t,e,n=Jt){if(null!=t){if(S&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var r=Wt(t);return 2&r||(e&&=0===r||!!(32&r)&&!(64&r||!(16&r)),t=e?Ht(t,-12293&(34|r)):Le(t,Be,4&r?Jt:n,!0,!0)),t}return t.C===Xt&&(n=t.l,t=2&(r=Rt(n))?t:ke(t,n,r,!0)),t}}function Ve(t){const e=t.l;return ke(t,e,Rt(e),!1)}function ke(t,e,n,r){return t=t.constructor,Ee=e=je(e,n,r),e=new t(e),Ee=void 0,e}function je(t,e,n){const r=n||2&e?Jt:qt,i=!!(32&e);return t=function(t,e,n){const r=Ft(t);var i=r.length;const o=256&e?r[i-1]:void 0;for(i+=o?-1:0,e=512&e?1:0;e<i;e++)r[e]=n(r[e]);if(o){e=r[e]={};for(const t in o)e[t]=n(o[t])}return ue(r,t),r}(t,e,(t=>Be(t,i,r))),Gt(t,32|(n?2:0)),t}function Fe(t){const e=t.l,n=Rt(e);return 2&n?ke(t,e,n,!1):t}function Ne(t,e,n,r){return!(4&e)||null!=n&&(!r&&0===n&&(4096&e||8192&e)&&5>(t.constructor[Ct]=1+(0|t.constructor[Ct]))&&le(),0!==n&&!(n&e))}function Me(t,e){return Ce(t=t.l,Rt(t),e)}function De(t,e,n,r){if(!(0>(e=r+(+!!(512&e)-1))||e>=t.length||e>=n))return t[e]}function Ce(t,e,n,r){if(-1===n)return null;const i=Kt(e);if(!(n>=i)){var o=t.length;return r&&256&e&&null!=(r=t[o-1][n])?(De(t,e,i,n)&&null!=Dt&&(4<=(e=(t=ae??={})[Dt]||0)||(t[Dt]=e+1,le())),r):De(t,e,i,n)}return 256&e?t[t.length-1][n]:void 0}function Ge(t,e,n,r){const i=t.l;let o=Rt(i);return ie(o),$e(i,o,e,n,r),t}function $e(t,e,n,r,i){const o=Kt(e);if(n>=o||i){let s=e;if(256&e)i=t[t.length-1];else{if(null==r)return s;i=t[o+(+!!(512&e)-1)]={},s|=256}return i[n]=r,n<o&&(t[n+(+!!(512&e)-1)]=void 0),s!==e&&Ht(t,s),s}return t[n+(+!!(512&e)-1)]=r,256&e&&(n in(t=t[t.length-1])&&delete t[n]),e}function ze(t,e,n,r,i){var o=2&e;let s=Ce(t,e,n,i);Array.isArray(s)||(s=Yt);const a=!(2&r);r=!(1&r);const u=!!(32&e);let c=Wt(s);return 0!==c||!u||o||a?1&c||(c|=1,Ht(s,c)):(c|=33,Ht(s,c)),o?(t=!1,2&c||(Gt(s,34),t=!!(4&c)),(r||t)&&Object.freeze(s)):(o=!!(2&c)||!!(2048&c),r&&o?(s=Ft(s),r=1,u&&!a&&(r|=32),Ht(s,r),$e(t,e,n,s,i)):a&&32&c&&!o&&$t(s,32)),s}function We(t){t=t.l;let e=Rt(t);const n=Ce(t,e,1),r=ee(n,!0,!!(34&e));return null!=r&&r!==n&&$e(t,e,1,r),r}function Re(t,e){return t=Ce(t,e,1),Array.isArray(t)?t:Yt}function He(t,e){return 0===t&&(t=un(t,e)),zt(t,1,!0)}function qe(t){return!!(2&t)&&!!(4&t)||!!(2048&t)}function Je(t,e,n){{const a=t.l;let u=Rt(a);if(ie(u),null==n)$e(a,u,e);else{var r,i=Wt(n),o=i,s=!!(2&i)||Object.isFrozen(n);if((r=!s)&&(r=!1),Ne(t,i))for(i=21,s&&(n=Ft(n),o=0,i=cn(i=un(i,u),u,!0)),t=0;t<n.length;t++)n[t]=we(n[t]);r&&(n=Ft(n),o=0,i=cn(i=un(i,u),u,!0)),i!==o&&Ht(n,i),$e(a,u,e,n)}}}function Ke(t,e){t=t.l;let n=Rt(t);ie(n),$e(t,n,2,""===e?void 0:e)}function Ye(t,e,n,r){const i=Rt(t);ie(i),t=ze(t,i,e,2),r=n(r,!!(4&(e=Wt(t)))&&!!(4096&e)),t.push(r)}function Xe(t){return t}function Qe(t,e){return Ze(t=t.l,Rt(t),mi)===e?e:-1}function Ze(t,e,n){let r=0;for(let i=0;i<n.length;i++){const o=n[i];null!=Ce(t,e,o)&&(0!==r&&(e=$e(t,e,r)),r=o)}return r}function tn(t,e,n,r){let i=Rt(t);ie(i);const o=Ce(t,i,n,r);let s;if(null!=o&&o.C===Xt)return(e=Fe(o))!==o&&$e(t,i,n,e,r),e.l;if(Array.isArray(o)){const t=Wt(o);s=2&t?je(o,t,!1):o,s=Ue(s,e[0],e[1])}else s=Ue(void 0,e[0],e[1]);return s!==o&&$e(t,i,n,s,r),s}function en(t,e,n,r){t=t.l;let i=Rt(t);const o=Ce(t,i,n,r);return(e=Se(o,e,i))!==o&&null!=e&&$e(t,i,n,e,r),e}function nn(t,e,n){if(null==(e=en(t,e,n,!1)))return e;t=t.l;let r=Rt(t);if(!(2&r)){const i=Fe(e);i!==e&&$e(t,r,n,e=i,!1)}return e}function rn(t,e,n,r,i){var o=!!(2&e);const s=o?1:2;r=!!r,i&&=!o,o=Re(t,e);var a=Wt(o);const u=!!(4&a);if(!u){var c=o,l=e;const t=!!(2&(a=He(a,e)));t&&(l=zt(l,2,!0));let r=!t,i=!0,s=0,u=0;for(;s<c.length;s++){const e=Se(c[s],n,l);if(e instanceof n){if(!t){const t=!!(2&Wt(e.l));r&&=!t,i&&=t}c[u++]=e}}u<s&&(c.length=u),a=zt(a,4,!0),a=zt(a,16,i),a=zt(a,8,r),Ht(c,a),t&&Object.freeze(c)}if(i&&!(8&a||!o.length&&(1===s||4===s&&32&a))){for(qe(a)&&(o=Ft(o),a=un(a,e),e=$e(t,e,1,o)),n=o,i=a,c=0;c<n.length;c++)(a=n[c])!==(l=Fe(a))&&(n[c]=l);i=zt(i,8,!0),i=zt(i,16,!n.length),Ht(n,i),a=i}return qe(a)||(n=a,(a=(i=1===s||4===s&&!!(32&a))?zt(a,!o.length||16&a&&(!u||32&a)?2:2048,!0):cn(a,e,r))!==n&&Ht(o,a),i&&Object.freeze(o)),2===s&&qe(a)&&(o=Ft(o),a=cn(a=un(a,e),e,r),Ht(o,a),$e(t,e,1,o)),o}function on(t,e){t=t.l;const n=Rt(t);return rn(t,n,e,!1,!(2&n))}function sn(t,e,n,r,i){return null==r&&(r=void 0),Ge(t,n,r,i)}function an(t,e,n){var r=ti;null==n&&(n=void 0),t=t.l;let i=Rt(t);ie(i),(r=Ze(t,i,r))&&r!==e&&null!=n&&(i=$e(t,i,r)),$e(t,i,e,n)}function un(t,e){return t=zt(t,2,!!(2&e)),t=zt(t,32,!0),zt(t,2048,!1)}function cn(t,e,n){return 32&e&&n||(t=zt(t,32,!1)),t}function ln(t,e){var n=Cr;t=t.l;const r=Rt(t);ie(r),t=rn(t,r,n,!0),e=null!=e?e:new n,t.push(e),2&Wt(e.l)?$t(t,8):$t(t,16)}function hn(t){return null==(t=Me(t,2))?t:pe(t)?"number"==typeof t?ve(t):be(t):void 0}function fn(t,e){return t??e}function dn(t,e,n){Ye(t.l,e,we,n)}function gn(t,e,n){e.g?e.j(t,e.g,e.i,n,!0):e.j(t,e.i,n,!0)}var pn=class{constructor(t,e){this.l=Ue(t,e)}toJSON(){return mn(this,Le(this.l,Oe,void 0,void 0,!1),!0)}v(){return!!(2&Wt(this.l))}};function mn(t,e,n){var r=f?void 0:t.constructor.u;const i=Rt(n?t.l:e);if(!(t=e.length))return e;let o,s;if(te(n=e[t-1])){t:{var a=n;let t={},e=!1;for(var u in a){let n=a[u];if(Array.isArray(n)){let t=n;(ne(n,r,+u)||Zt(n)&&0===n.size)&&(n=null),n!=t&&(e=!0)}null!=n?t[u]=n:e=!0}if(e){for(var c in t){a=t;break t}a=null}}a!=n&&(o=!0),t--}for(u=+!!(512&i)-1;0<t&&(n=e[c=t-1],c-=u,null==n||ne(n,r,c)||Zt(n)&&0===n.size);t--)s=!0;return o||s?(e=Array.prototype.slice.call(e,0,t),a&&e.push(a),e):e}function yn(t){return Array.isArray(t)?t[0]instanceof jt?t:[gr,t]:[t,void 0]}function vn(t,e){if(Array.isArray(e)){var n=Wt(e);if(4&n)return e;for(var r=0,i=0;r<e.length;r++){const n=t(e[r]);null!=n&&(e[i++]=n)}return i<r&&(e.length=i),Ht(e,-12289&(5|n)),2&n&&Object.freeze(e),e}}pn.prototype.C=Xt,pn.prototype.toString=function(){return mn(this,this.l,!1).toString()};const bn=Symbol();function wn(t){let e=t[bn];if(!e){const n=Un(t),r=Cn(t),i=r.j;e=i?(t,e)=>i(t,e,r):(t,e)=>{for(;dt(e)&&4!=e.i;){var i=e.m,o=r[i];if(!o){var s=r.F;s&&(s=s[i])&&(o=r[i]=_n(s))}o&&o(e,t,i)||(i=(o=e).j,gt(o),o.I?o=void 0:(s=o.g.g-i,o.g.g=i,o=ht(o.g,s)),i=t,o&&(oe||=Symbol(),(s=i[oe])?s.push(o):i[oe]=[o]))}n===Sn||n===En||n.s||(t[se||=Symbol()]=n)},t[bn]=e}return e}function _n(t){const e=(t=yn(t))[0].g;if(t=t[1]){const n=wn(t),r=Cn(t).A;return(t,i,o)=>e(t,i,o,r,n)}return e}class An{}let Sn,En;const Tn=Symbol();function In(t,e,n){const r=n[1];let i;if(r){const n=r[Tn];i=n?n.A:Pe(r[0]),t[e]=n??r}i&&i===Te?(t.g||(t.g=new Set)).add(e):n[0]&&(t.i||(t.i=new Set)).add(e)}function Pn(t,e){return[t.j,!e||0<e[0]?void 0:e]}function Un(t){var e=t[Tn];if(e)return e;if(!(e=Ln(t,t[Tn]=new An,Pn,Pn,In)).F&&!e.i&&!e.g){let n=!0;for(let t in e)isNaN(t)||(n=!1);n?(Pe(t[0])===Te?En?e=En:((e=new An).A=Pe(!0),e=En=e):e=Sn||=new An,e=t[Tn]=e):e.s=!0}return e}function xn(t,e,n){t[e]=n}function Ln(t,e,n,r,i=xn){e.A=Pe(t[0]);let o=0;var s=t[++o];s&&s.constructor===Object&&(e.F=s,"function"==typeof(s=t[++o])&&(e.j=s,e.m=t[++o],s=t[++o]));const a={};for(;Array.isArray(s)&&"number"==typeof s[0]&&0<s[0];){for(var u=0;u<s.length;u++)a[s[u]]=s;s=t[++o]}for(u=1;void 0!==s;){let h;"number"==typeof s&&(u+=s,s=t[++o]);var c=void 0;if(s instanceof jt?h=s:(h=pr,o--),h.J){s=t[++o],c=t;var l=o;"function"==typeof s&&(s=s(),c[l]=s),c=s}for(l=u+1,"number"==typeof(s=t[++o])&&0>s&&(l-=s,s=t[++o]);u<l;u++){const t=a[u];i(e,u,c?r(h,c,t):n(h,t))}}return e}const On=Symbol();function Bn(t){let e=t[On];if(!e){const n=Fn(t);e=(t,e)=>zn(t,e,n),t[On]=e}return e}const Vn=Symbol();function kn(t){return t.i}function jn(t,e){let n,r;const i=t.i;return(t,o,s)=>i(t,o,s,r||=Fn(e).A,n||=Bn(e))}function Fn(t){let e=t[Vn];return e||(e=Ln(t,t[Vn]={},kn,jn),Gn(t),e)}const Nn=Symbol();function Mn(t,e){const n=t.g;return e?(t,r,i)=>n(t,r,i,e):n}function Dn(t,e,n){const r=t.g;let i,o;return(t,s,a)=>r(t,s,a,o||=Cn(e).A,i||=wn(e),n)}function Cn(t){let e=t[Nn];return e||(Un(t),e=Ln(t,t[Nn]={},Mn,Dn),Gn(t),e)}function Gn(t){Nn in t&&Tn in t&&Vn in t&&(t.length=0)}function $n(t,e){var n=t[e];if(n)return n;if((n=t.F)&&(n=n[e])){var r=(n=yn(n))[0].i;if(n=n[1]){const e=Bn(n),i=Fn(n).A;n=(n=t.m)?n(i,e):(t,n,o)=>r(t,n,o,i,e)}else n=r;return t[e]=n}}function zn(t,e,n){for(var r=Rt(t),i=+!!(512&r)-1,o=t.length,s=512&r?1:0,a=o+(256&r?-1:0);s<a;s++){const r=t[s];if(null==r)continue;const o=s-i,a=$n(n,o);a&&a(e,r,o)}if(256&r){r=t[o-1];for(let t in r)i=+t,Number.isNaN(i)||null!=(o=r[t])&&(a=$n(n,i))&&a(e,o,i)}if(t=oe?t[oe]:void 0)for(Lt(e,e.g.end()),n=0;n<t.length;n++)Lt(e,N(t[n])||B())}function Wn(t,e){return new jt(t,e,!1,!1)}function Rn(t,e){return new jt(t,e,!0,!1)}function Hn(t,e,n){$e(t,Rt(t),e,n)}function qn(t,e,n){t:if(null!=e){if(pe(e)){if("string"==typeof e){e=be(e);break t}if("number"==typeof e){e=ve(e);break t}}e=void 0}null!=e&&("string"==typeof e&&St(e),null!=e&&(Ot(t,n,0),"number"==typeof e?(t=t.g,J(e),It(t,H,q)):(n=St(e),It(t.g,n.i,n.g))))}function Jn(t,e,n){null!=(e=me(e))&&null!=e&&(Ot(t,n,0),Ut(t.g,e))}function Kn(t,e,n){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(Ot(t,n,0),t.g.g.push(e?1:0))}function Yn(t,e,n){null!=(e=Ae(e))&&kt(t,n,c(e))}function Xn(t,e,n,r,i){null!=(e=e instanceof pn?e.l:Array.isArray(e)?Ue(e,r[0],r[1]):void 0)&&(n=Bt(t,n),i(e,t),Vt(t,n))}function Qn(t,e,n){null!=(e=null==e||"string"==typeof e||L(e)||e instanceof M?e:void 0)&&kt(t,n,$(e).buffer)}var Zn,tr=Wn((function(t,e,n){if(1!==t.i)return!1;var r=t.g;t=ot(r);const i=ot(r);r=2*(i>>31)+1;const o=i>>>20&2047;return t=4294967296*(1048575&i)+t,Hn(e,n,2047==o?t?NaN:1/0*r:0==o?r*Math.pow(2,-1074)*t:r*Math.pow(2,o-1075)*(t+4503599627370496)),!0}),(function(t,e,n){null!=(e=fe(e))&&(Ot(t,n,1),t=t.g,(n=R||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),H=n.getUint32(0,!0),q=n.getUint32(4,!0),xt(t,H),xt(t,q))})),er=Wn((function(t,e,n){return 5===t.i&&(Hn(e,n,st(t.g)),!0)}),(function(t,e,n){null!=(e=fe(e))&&(Ot(t,n,5),t=t.g,K(e),xt(t,H))})),nr=Rn((function(t,e,n){return(5===t.i||2===t.i)&&(e=ze(e,Rt(e),n,2,!1),2==t.i?vt(t,st,e):e.push(st(t.g)),!0)}),(function(t,e,n){if(null!=(e=vn(fe,e))&&e.length){Ot(t,n,2),Pt(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,K(e[r]),xt(n,H)}})),rr=Wn((function(t,e,n){return 0===t.i&&(Hn(e,n,nt(t.g,X)),!0)}),qn),ir=Wn((function(t,e,n){return 0===t.i&&(Hn(e,n,0===(t=nt(t.g,X))?void 0:t),!0)}),qn),or=Wn((function(t,e,n){return 0===t.i&&(Hn(e,n,nt(t.g,Y)),!0)}),(function(t,e,n){t:if(null!=e){if(pe(e)){if("string"==typeof e){var r=Math.trunc(Number(e));Number.isSafeInteger(r)&&0<=r?e=String(r):(-1!==(r=e.indexOf("."))&&(e=e.substring(0,r)),ye(e)||(tt(e),e=Q(H,q)));break t}if("number"==typeof e){e=0<=(e=Math.trunc(e))&&Number.isSafeInteger(e)?e:function(t){if(0>t){J(t);const e=Q(H,q);return t=Number(e),Number.isSafeInteger(t)?t:e}return ye(String(t))?t:(J(t),Y(H,q))}(e);break t}}e=void 0}null!=e&&("string"==typeof e&&wt(e),null!=e&&(Ot(t,n,0),"number"==typeof e?(t=t.g,J(e),It(t,H,q)):(n=wt(e),It(t.g,n.i,n.g))))})),sr=Wn((function(t,e,n){return 0===t.i&&(Hn(e,n,it(t.g)),!0)}),Jn),ar=Rn((function(t,e,n){return(0===t.i||2===t.i)&&(e=ze(e,Rt(e),n,2,!1),2==t.i?vt(t,it,e):e.push(it(t.g)),!0)}),(function(t,e,n){if(null!=(e=vn(me,e))&&e.length){n=Bt(t,n);for(let n=0;n<e.length;n++)Ut(t.g,e[n]);Vt(t,n)}})),ur=Wn((function(t,e,n){return 0===t.i&&(Hn(e,n,0===(t=it(t.g))?void 0:t),!0)}),Jn),cr=Wn((function(t,e,n){return 0===t.i&&(Hn(e,n,rt(t.g)),!0)}),Kn),lr=Wn((function(t,e,n){return 0===t.i&&(Hn(e,n,!1===(t=rt(t.g))?void 0:t),!0)}),Kn),hr=Rn((function(t,e,n){return 2===t.i&&(Ye(e,n,Xe,t=mt(t)),!0)}),(function(t,e,n){if(null!=(e=vn(Ae,e)))for(let s=0;s<e.length;s++){var r=t,i=n,o=e[s];null!=o&&kt(r,i,c(o))}})),fr=Wn((function(t,e,n){return 2===t.i&&(Hn(e,n,""===(t=mt(t))?void 0:t),!0)}),Yn),dr=Wn((function(t,e,n){return 2===t.i&&(Hn(e,n,mt(t)),!0)}),Yn),gr=new jt((function(t,e,n,r,i){return 2===t.i&&(pt(t,tn(e,r,n,!0),i),!0)}),Xn,!1,!0),pr=new jt((function(t,e,n,r,i){return 2===t.i&&(pt(t,tn(e,r,n),i),!0)}),Xn,!1,!0);Zn=new jt((function(t,e,n,r,i){if(2!==t.i)return!1;r=Ue(void 0,r[0],r[1]);let o=Rt(e);ie(o);let s=ze(e,o,n,3);return o=Rt(e),4&Wt(s)&&(s=Ft(s),Ht(s,-2079&(1|Wt(s))),$e(e,o,n,s)),s.push(r),pt(t,r,i),!0}),(function(t,e,n,r,i){if(Array.isArray(e))for(let o=0;o<e.length;o++)Xn(t,e[o],n,r,i)}),!0,!0);var mr=new jt((function(t,e,n,r,i,o){if(2!==t.i)return!1;let s=Rt(e);return ie(s),(o=Ze(e,s,o))&&n!==o&&$e(e,s,o),pt(t,e=tn(e,r,n),i),!0}),Xn,!1,!0),yr=Wn((function(t,e,n){return 2===t.i&&(Hn(e,n,yt(t)),!0)}),Qn),vr=Wn((function(t,e,n){return 0===t.i&&(Hn(e,n,it(t.g)),!0)}),(function(t,e,n){null!=(e=me(e))&&(e=parseInt(e,10),Ot(t,n,0),Ut(t.g,e))})),br=Rn((function(t,e,n){return(0===t.i||2===t.i)&&(e=ze(e,Rt(e),n,2,!1),2==t.i?vt(t,at,e):e.push(it(t.g)),!0)}),(function(t,e,n){if(null!=(e=vn(me,e))&&e.length){n=Bt(t,n);for(let n=0;n<e.length;n++)Ut(t.g,e[n]);Vt(t,n)}}));class wr{constructor(t,e){this.i=t,this.g=e,this.j=sn,this.defaultValue=void 0}}function _r(t,e){return(n,r)=>{if(bt.length){const t=bt.pop();t.o(r),ut(t.g,n,r),n=t}else n=new class{constructor(t,e){if(ft.length){const n=ft.pop();ut(n,t,e),t=n}else t=new class{constructor(t,e){this.i=null,this.m=!1,this.g=this.j=this.s=0,ut(this,t,e)}clear(){this.i=null,this.m=!1,this.g=this.j=this.s=0,this.D=!1}}(t,e);this.g=t,this.j=this.g.g,this.i=this.m=-1,this.o(e)}o({I:t=!1}={}){this.I=t}}(n,r);try{const r=new t,o=r.l;wn(e)(o,n);var i=r}finally{n.g.clear(),n.m=-1,n.i=-1,100>bt.length&&bt.push(n)}return i}}var Ar=[0,fr,Wn((function(t,e,n){return 2===t.i&&(Hn(e,n,(t=yt(t))===F()?void 0:t),!0)}),(function(t,e,n){if(null!=e){if(e instanceof pn){const r=e.P;return void(r&&(e=r(e),null!=e&&kt(t,n,$(e).buffer)))}if(Array.isArray(e))return}Qn(t,e,n)}))],Sr=[0,dr],Er=[0,sr,vr,cr,-1,ar,vr,-1],Tr=[0,cr,-1],Ir=class extends pn{constructor(){super()}};Ir.u=[6];var Pr=[0,cr,dr,cr,vr,-1,br,dr,-1,Tr,vr],Ur=[0,dr,-2],xr=class extends pn{constructor(){super()}},Lr=[0],Or=[0,sr,cr,-4],Br=class extends pn{constructor(t){super(t,2)}},Vr={},kr=[-2,Vr,cr];Vr[336783863]=[0,dr,cr,-1,sr,[0,[1,2,3,4,5,6],mr,Lr,mr,Pr,mr,Ur,mr,Or,mr,Er,mr,[0,dr]],Sr,cr,[0,[1,3],[2,4],mr,[0,ar],-1,mr,[0,hr],-1,Zn,[0,dr,-1]],dr];var jr=[0,fr,lr],Fr=[0,ir,-1,lr,-3,ir,ar,fr,ur,ir,-1,lr,ur,lr,-2,fr],Nr=[-1,{}],Mr=[0,dr,1,Nr],Dr=[0,dr,hr,Nr],Cr=class extends pn{constructor(t){super(t,500)}o(t){return sn(this,0,7,t)}};Cr.u=[3,4,5,6,8,13,17,1005];var Gr,$r=[-500,fr,-1,hr,-3,kr,Zn,Ar,ur,-1,Mr,Dr,Zn,jr,fr,Fr,ur,hr,987,hr],zr=[0,fr,-1,Nr],Wr=[-500,dr,-1,[-1,{}],998,dr],Rr=[-500,dr,hr,-1,[-2,{},cr],997,hr,-1],Hr=[-500,dr,hr,Nr,998,hr],qr=class extends pn{constructor(){super(void 0,500)}o(t){return sn(this,0,1001,t)}};qr.u=[1,6,7,9,10,15,16,17,14,1002],qr.prototype.g=(Gr=[-500,Zn,$r,4,Zn,Wr,Zn,Rr,ur,Zn,Hr,hr,ur,Mr,Dr,Zn,zr,hr,-2,Fr,fr,-1,lr,979,Nr,Zn,Ar],function(){const t=new class{constructor(){this.j=[],this.i=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const t=this.g;return this.g=[],t}}}};zn(this.l,t,Fn(Gr)),Lt(t,t.g.end());const e=new Uint8Array(t.i),n=t.j,r=n.length;let i=0;for(let t=0;t<r;t++){const r=n[t];e.set(r,i),i+=r.length}return t.j=[e],e});var Jr=class extends pn{constructor(t){super(t)}},Kr=[0,sr,er,dr,-1],Yr=class extends pn{constructor(t){super(t)}g(){return on(this,Jr)}};Yr.u=[1];var Xr=[0,Zn,Kr],Qr=class extends pn{constructor(t){super(t)}};Qr.u=[4,5];var Zr=class extends pn{constructor(t){super(t)}},ti=[1,2,3,4,5],ei=class extends pn{constructor(t){super(t)}g(){return null!=We(this)}i(){return null!=Ae(Me(this,2))}},ni=class extends pn{constructor(t){super(t)}},ri=[0,[0,yr,dr,[0,sr,rr,-1],[0,or,rr]],cr,[0,ti,mr,Or,mr,Pr,mr,Er,mr,Lr,mr,Ur],vr],ii=class extends pn{constructor(t){super(t)}},oi=new wr(451755788,ii);Vr[451755788]=[0,ri,[0,dr,sr,er,hr,-1],tr];var si=class extends pn{constructor(t){super(t)}},ai=class extends pn{constructor(t){super(t)}},ui=new wr(487277289,ai);Vr[487277289]=[0,ri,[0,cr,-1]];var ci=class extends pn{constructor(t){super(t)}},li=[0,1,sr,dr,Xr],hi=class extends pn{constructor(t){super(t)}};hi.u=[1];var fi=_r(hi,[0,Zn,li,rr]),di=class extends pn{constructor(t){super(t)}};di.u=[1];var gi=class extends pn{constructor(t){super(t)}K(){const t=We(this);return null==t?F():t}},pi=class extends pn{constructor(t){super(t)}},mi=[1,2],yi=[0,mi,mr,[0,nr],mr,[0,yr],sr,dr],vi=class extends pn{constructor(t){super(t)}};vi.u=[1];var bi=_r(vi,[0,Zn,yi,rr]);function wi(){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/))&&1<=t.length&&17<=Number(t[1])))}async function _i(t){if("function"!=typeof importScripts){const e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise(((t,n)=>{e.addEventListener("load",(()=>{t()}),!1),e.addEventListener("error",(t=>{n(t)}),!1),document.body.appendChild(e)}))}importScripts(t.toString())}function Ai(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),n(e=t.h.stringToNewUTF8(e)),t.h._free(e)}function Si(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const r=new Uint32Array(e.length);for(let n=0;n<e.length;n++)r[n]=t.h.stringToNewUTF8(e[n]);e=t.h._malloc(4*r.length),t.h.HEAPU32.set(r,e>>2),n(e);for(const e of r)t.h._free(e);t.h._free(e)}function Ei(t,e,n){t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=n}function Ti(t,e,n){let r=[];t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=(t,e,i)=>{e?(n(r,i),r=[]):r.push(t)}}const Ii=function(t){return class extends t{N(){this.h._registerModelResourcesGraphService()}}}(class{constructor(t,e){this.j=!0,this.h=t,this.g=null,this.i=0,this.m="function"==typeof this.h._addIntToInputStream,void 0!==e?this.h.canvas=e:wi()?this.h.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.h.canvas=document.createElement("canvas"))}async initializeGraph(t){const e=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(e),t)}setGraphFromString(t){this.setGraph((new TextEncoder).encode(t),!1)}setGraph(t,e){const n=t.length,r=this.h._malloc(n);this.h.HEAPU8.set(t,r),e?this.h._changeBinaryGraph(n,r):this.h._changeTextGraph(n,r),this.h._free(r)}configureAudio(t,e,n,r,i){this.h._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),Ai(this,r||"input_audio",(r=>{Ai(this,i=i||"audio_header",(i=>{this.h._configureAudio(r,i,t,e,n)}))}))}setAutoResizeCanvas(t){this.j=t}setAutoRenderToScreen(t){this.h._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.h.gpuOriginForWebTexturesIsBottomLeft=t}attachErrorListener(t){this.h.errorListener=t}attachEmptyPacketListener(t,e){this.h.emptyPacketListeners=this.h.emptyPacketListeners||{},this.h.emptyPacketListeners[t]=e}addAudioToStream(t,e,n){this.addAudioToStreamWithShape(t,0,0,e,n)}addAudioToStreamWithShape(t,e,n,r,i){const o=4*t.length;this.i!==o&&(this.g&&this.h._free(this.g),this.g=this.h._malloc(o),this.i=o),this.h.HEAPF32.set(t,this.g/4),Ai(this,r,(t=>{this.h._addAudioToInputStream(this.g,e,n,t,i)}))}addGpuBufferToStream(t,e,n){Ai(this,e,(e=>{if(!this.h.canvas)throw Error("No OpenGL canvas configured.");e?this.h._bindTextureToStream(e):this.h._bindTextureToCanvas();const r=this.h.canvas.getContext("webgl2")||this.h.canvas.getContext("webgl");if(!r)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");this.h.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t),this.h.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);const[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.j||i===this.h.canvas.width&&o===this.h.canvas.height||(this.h.canvas.width=i,this.h.canvas.height=o);const[s,a]=[i,o];this.h._addBoundTextureToStream(e,s,a,n)}))}addBoolToStream(t,e,n){Ai(this,e,(e=>{this.h._addBoolToInputStream(t,e,n)}))}addDoubleToStream(t,e,n){Ai(this,e,(e=>{this.h._addDoubleToInputStream(t,e,n)}))}addFloatToStream(t,e,n){Ai(this,e,(e=>{this.h._addFloatToInputStream(t,e,n)}))}addIntToStream(t,e,n){Ai(this,e,(e=>{this.h._addIntToInputStream(t,e,n)}))}addUintToStream(t,e,n){Ai(this,e,(e=>{this.h._addUintToInputStream(t,e,n)}))}addStringToStream(t,e,n){Ai(this,e,(e=>{Ai(this,t,(t=>{this.h._addStringToInputStream(t,e,n)}))}))}addStringRecordToStream(t,e,n){Ai(this,e,(e=>{Si(this,Object.keys(t),(r=>{Si(this,Object.values(t),(i=>{this.h._addFlatHashMapToInputStream(r,i,Object.keys(t).length,e,n)}))}))}))}addProtoToStream(t,e,n,r){Ai(this,n,(n=>{Ai(this,e,(e=>{const i=this.h._malloc(t.length);this.h.HEAPU8.set(t,i),this.h._addProtoToInputStream(i,t.length,e,n,r),this.h._free(i)}))}))}addEmptyPacketToStream(t,e){Ai(this,t,(t=>{this.h._addEmptyPacketToInputStream(t,e)}))}addBoolVectorToStream(t,e,n){Ai(this,e,(e=>{const r=this.h._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.h._addBoolVectorEntry(r,e);this.h._addBoolVectorToInputStream(r,e,n)}))}addDoubleVectorToStream(t,e,n){Ai(this,e,(e=>{const r=this.h._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.h._addDoubleVectorEntry(r,e);this.h._addDoubleVectorToInputStream(r,e,n)}))}addFloatVectorToStream(t,e,n){Ai(this,e,(e=>{const r=this.h._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.h._addFloatVectorEntry(r,e);this.h._addFloatVectorToInputStream(r,e,n)}))}addIntVectorToStream(t,e,n){Ai(this,e,(e=>{const r=this.h._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.h._addIntVectorEntry(r,e);this.h._addIntVectorToInputStream(r,e,n)}))}addUintVectorToStream(t,e,n){Ai(this,e,(e=>{const r=this.h._allocateUintVector(t.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(const e of t)this.h._addUintVectorEntry(r,e);this.h._addUintVectorToInputStream(r,e,n)}))}addStringVectorToStream(t,e,n){Ai(this,e,(e=>{const r=this.h._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(const e of t)Ai(this,e,(t=>{this.h._addStringVectorEntry(r,t)}));this.h._addStringVectorToInputStream(r,e,n)}))}addBoolToInputSidePacket(t,e){Ai(this,e,(e=>{this.h._addBoolToInputSidePacket(t,e)}))}addDoubleToInputSidePacket(t,e){Ai(this,e,(e=>{this.h._addDoubleToInputSidePacket(t,e)}))}addFloatToInputSidePacket(t,e){Ai(this,e,(e=>{this.h._addFloatToInputSidePacket(t,e)}))}addIntToInputSidePacket(t,e){Ai(this,e,(e=>{this.h._addIntToInputSidePacket(t,e)}))}addUintToInputSidePacket(t,e){Ai(this,e,(e=>{this.h._addUintToInputSidePacket(t,e)}))}addStringToInputSidePacket(t,e){Ai(this,e,(e=>{Ai(this,t,(t=>{this.h._addStringToInputSidePacket(t,e)}))}))}addProtoToInputSidePacket(t,e,n){Ai(this,n,(n=>{Ai(this,e,(e=>{const r=this.h._malloc(t.length);this.h.HEAPU8.set(t,r),this.h._addProtoToInputSidePacket(r,t.length,e,n),this.h._free(r)}))}))}addBoolVectorToInputSidePacket(t,e){Ai(this,e,(e=>{const n=this.h._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.h._addBoolVectorEntry(n,e);this.h._addBoolVectorToInputSidePacket(n,e)}))}addDoubleVectorToInputSidePacket(t,e){Ai(this,e,(e=>{const n=this.h._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.h._addDoubleVectorEntry(n,e);this.h._addDoubleVectorToInputSidePacket(n,e)}))}addFloatVectorToInputSidePacket(t,e){Ai(this,e,(e=>{const n=this.h._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.h._addFloatVectorEntry(n,e);this.h._addFloatVectorToInputSidePacket(n,e)}))}addIntVectorToInputSidePacket(t,e){Ai(this,e,(e=>{const n=this.h._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.h._addIntVectorEntry(n,e);this.h._addIntVectorToInputSidePacket(n,e)}))}addUintVectorToInputSidePacket(t,e){Ai(this,e,(e=>{const n=this.h._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(const e of t)this.h._addUintVectorEntry(n,e);this.h._addUintVectorToInputSidePacket(n,e)}))}addStringVectorToInputSidePacket(t,e){Ai(this,e,(e=>{const n=this.h._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const e of t)Ai(this,e,(t=>{this.h._addStringVectorEntry(n,t)}));this.h._addStringVectorToInputSidePacket(n,e)}))}attachBoolListener(t,e){Ei(this,t,e),Ai(this,t,(t=>{this.h._attachBoolListener(t)}))}attachBoolVectorListener(t,e){Ti(this,t,e),Ai(this,t,(t=>{this.h._attachBoolVectorListener(t)}))}attachIntListener(t,e){Ei(this,t,e),Ai(this,t,(t=>{this.h._attachIntListener(t)}))}attachIntVectorListener(t,e){Ti(this,t,e),Ai(this,t,(t=>{this.h._attachIntVectorListener(t)}))}attachUintListener(t,e){Ei(this,t,e),Ai(this,t,(t=>{this.h._attachUintListener(t)}))}attachUintVectorListener(t,e){Ti(this,t,e),Ai(this,t,(t=>{this.h._attachUintVectorListener(t)}))}attachDoubleListener(t,e){Ei(this,t,e),Ai(this,t,(t=>{this.h._attachDoubleListener(t)}))}attachDoubleVectorListener(t,e){Ti(this,t,e),Ai(this,t,(t=>{this.h._attachDoubleVectorListener(t)}))}attachFloatListener(t,e){Ei(this,t,e),Ai(this,t,(t=>{this.h._attachFloatListener(t)}))}attachFloatVectorListener(t,e){Ti(this,t,e),Ai(this,t,(t=>{this.h._attachFloatVectorListener(t)}))}attachStringListener(t,e){Ei(this,t,e),Ai(this,t,(t=>{this.h._attachStringListener(t)}))}attachStringVectorListener(t,e){Ti(this,t,e),Ai(this,t,(t=>{this.h._attachStringVectorListener(t)}))}attachProtoListener(t,e,n){Ei(this,t,e),Ai(this,t,(t=>{this.h._attachProtoListener(t,n||!1)}))}attachProtoVectorListener(t,e,n){Ti(this,t,e),Ai(this,t,(t=>{this.h._attachProtoVectorListener(t,n||!1)}))}attachAudioListener(t,e,n){this.h._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Ei(this,t,((t,n)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,n)})),Ai(this,t,(t=>{this.h._attachAudioListener(t,n||!1)}))}finishProcessing(){this.h._waitUntilIdle()}closeGraph(){this.h._closeGraph(),this.h.simpleListeners=void 0,this.h.emptyPacketListeners=void 0}});var Pi=class extends Ii{};async function Ui(t,e,n){return t=await(async(t,e,n,r)=>{if(e&&await _i(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(n&&(await _i(n),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&r&&((e=self.Module).locateFile=r.locateFile,r.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=r.mainScriptUrlOrBlob)),r=await self.ModuleFactory(self.Module||r),self.ModuleFactory=self.Module=void 0,new t(r,null)})(t,e.wasmLoaderPath,e.assetLoaderPath,{locateFile:t=>t.endsWith(".wasm")?e.wasmBinaryPath.toString():e.assetBinaryPath&&t.endsWith(".data")?e.assetBinaryPath.toString():t}),await t.o(n),t}async function xi(t,e,n){return Ui(t,e,n)}function Li(t,e){const n=nn(t.baseOptions,ei,1)||new ei;"string"==typeof e?(Ge(n,2,_e(e)),Ge(n,1)):e instanceof Uint8Array&&(Ge(n,1,ee(e,!1,!1)),Ge(n,2)),sn(t.baseOptions,0,1,n)}function Oi(t,e){const n=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(nn(t.baseOptions,ei,1)?.g()||nn(t.baseOptions,ei,1)?.i()||e.baseOptions?.modelAssetBuffer||e.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,e){let n=nn(t.baseOptions,Zr,3);if(!n){var r=n=new Zr;an(r,4,new xr)}"delegate"in e&&("GPU"===e.delegate?an(e=n,2,r=new Ir):an(e=n,4,r=new xr)),sn(t.baseOptions,0,3,n)}(t,n),n.modelAssetPath)return fetch(n.modelAssetPath.toString()).then((t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${n.modelAssetPath} (${t.status})`)})).then((e=>{try{t.g.h.FS_unlink("/model.dat")}catch{}t.g.h.FS_createDataFile("/","model.dat",new Uint8Array(e),!0,!1,!1),Li(t,"/model.dat"),t.B()}));if(n.modelAssetBuffer instanceof Uint8Array)Li(t,n.modelAssetBuffer);else if(n.modelAssetBuffer)return async function(t){const e=[];for(var n=0;;){const{done:r,value:i}=await t.read();if(r)break;e.push(i),n+=i.length}if(0===e.length)return new Uint8Array(0);if(1===e.length)return e[0];t=new Uint8Array(n),n=0;for(const r of e)t.set(r,n),n+=r.length;return t}(n.modelAssetBuffer).then((e=>{Li(t,e),t.B()}));return t.B(),Promise.resolve()}function Bi(t){try{const e=t.j.length;if(1===e)throw Error(t.j[0].message);if(1<e)throw Error("Encountered multiple errors: "+t.j.map((t=>t.message)).join(", "))}finally{t.j=[]}}function Vi(t,e){t.s=Math.max(t.s,e)}var ki=class{constructor(t){this.g=t,this.j=[],this.s=0,this.g.setAutoRenderToScreen(!1)}setGraph(t,e){this.g.attachErrorListener(((t,e)=>{this.j.push(Error(e))})),this.g.N(),this.g.setGraph(t,e),Bi(this)}finishProcessing(){this.g.finishProcessing(),Bi(this)}close(){this.g.closeGraph()}};async function ji(t,e,n){return xi(t,e,n)}ki.prototype.close=ki.prototype.close,function(e,n){e=e.split(".");var r,i=t;e[0]in i||void 0===i.execScript||i.execScript("var "+e[0]);for(;e.length&&(r=e.shift());)e.length||void 0===n?i=i[r]&&i[r]!==Object.prototype[r]?i[r]:i[r]={}:i[r]=n}("TaskRunner",ki);var Fi=class extends ki{constructor(){super(...arguments),this.H=48e3}O(t){this.H=t}};function Ni(t){const e={classifications:on(t,ci).map((t=>function(t,e=-1,n=""){return{categories:t.map((t=>{var e=me(Me(t,1))??0??-1;const n=t.l;let r=Rt(n);const i=Ce(n,r,2),o=fe(i);return null!=o&&o!==i&&$e(n,r,2,o),{index:e,score:o??0??0,categoryName:fn(Ae(Me(t,3)),"")??"",displayName:fn(Ae(Me(t,4)),"")??""}})),headIndex:e,headName:n}}(nn(t,Yr,4)?.g()??[],me(Me(t,2))??0,fn(Ae(Me(t,3)),""))))};return null!=hn(t)&&(e.timestampMs=fn(hn(t),0)),e}Fi.prototype.setDefaultSampleRate=Fi.prototype.O;var Mi=class extends Fi{constructor(t,e){super(new Pi(t,e)),this.m=[],sn(t=this.i=new ii,0,1,e=new ni)}get baseOptions(){return nn(this.i,ni,1)}set baseOptions(t){sn(this.i,0,1,t)}o(t){var e=this.i,n=nn(this.i,Qr,2);if(n=n?Ve(n):new Qr,void 0!==t.displayNamesLocale?Ge(n,1,_e(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Ge(n,1),void 0!==t.maxResults){var r=t.maxResults;if(null!=r){if("number"!=typeof r)throw he();if(!Number.isFinite(r))throw he();r|=0}Ge(n,2,r)}else"maxResults"in t&&Ge(n,2);if(void 0!==t.scoreThreshold){if(null!=(r=t.scoreThreshold)&&"number"!=typeof r)throw Error(`Value of float/double field must be a number, found ${typeof r}: ${r}`);Ge(n,3,r)}else"scoreThreshold"in t&&Ge(n,3);return void 0!==t.categoryAllowlist?Je(n,4,t.categoryAllowlist):"categoryAllowlist"in t&&Ge(n,4),void 0!==t.categoryDenylist?Je(n,5,t.categoryDenylist):"categoryDenylist"in t&&Ge(n,5),sn(e,0,2,n),Oi(this,t)}L(t,e){return this.G(t,e??this.H,this.s+1)}G(t,e,n){return this.g.addDoubleToStream(e,"sample_rate",n),this.g.addAudioToStreamWithShape(t,1,t.length,"audio_in",n),this.m=[],this.finishProcessing(),[...this.m]}B(){var t=new qr;dn(t,10,"audio_in"),dn(t,10,"sample_rate"),dn(t,15,"timestamped_classifications");const e=new Br;gn(e,oi,this.i);const n=new Cr;Ke(n,_e("mediapipe.tasks.audio.audio_classifier.AudioClassifierGraph")),dn(n,3,"AUDIO:audio_in"),dn(n,3,"SAMPLE_RATE:sample_rate"),dn(n,4,"TIMESTAMPED_CLASSIFICATIONS:timestamped_classifications"),n.o(e),ln(t,n),this.g.attachProtoVectorListener("timestamped_classifications",((t,e)=>{!function(t,e){e.forEach((e=>{e=fi(e),t.m.push(Ni(e))}))}(this,t),Vi(this,e)})),this.g.attachEmptyPacketListener("timestamped_classifications",(t=>{Vi(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function Di(t){return{embeddings:on(t,pi).map((t=>{const e={headIndex:me(Me(t,3))??0??-1,headName:fn(Ae(Me(t,4)),"")??""};if(void 0!==en(t,di,Qe(t,1))){var n=nn(t,di,Qe(t,1));t=n.l;var r=Rt(t);const s=2&r?1:2;let a=Re(t,r);var i=Wt(a);if(Ne(n,i,void 0,!1)){(4&i||Object.isFrozen(a))&&(a=Ft(a),i=un(i,r),r=$e(t,r,1,a));for(var o=n=0;n<a.length;n++){const t=fe(a[n]);null!=t&&(a[o++]=t)}o<n&&(a.length=o),i=zt(i=He(i,r),20,!0),i=zt(i,4096,!1),i=zt(i,8192,!1),Ht(a,i),2&i&&Object.freeze(a)}qe(i)||(n=i,(i=(o=1===s||4===s&&!!(32&i))?zt(i,2,!0):cn(i,r,!1))!==n&&Ht(a,i),o&&Object.freeze(a)),2===s&&qe(i)&&(a=Ft(a),i=cn(i=un(i,r),r,!1),Ht(a,i),$e(t,r,1,a)),e.floatEmbedding=a.slice()}else r=new Uint8Array(0),e.quantizedEmbedding=nn(t,gi,Qe(t,2))?.K()?.i()??r;return e})),timestampMs:fn(hn(t),0)}}Mi.prototype.classify=Mi.prototype.L,Mi.prototype.setOptions=Mi.prototype.o,Mi.createFromModelPath=function(t,e){return xi(Mi,t,{baseOptions:{modelAssetPath:e}})},Mi.createFromModelBuffer=function(t,e){return ji(Mi,t,{baseOptions:{modelAssetBuffer:e}})},Mi.createFromOptions=function(t,e){return ji(Mi,t,e)};var Ci=class extends Fi{constructor(t,e){super(new Pi(t,e)),this.m=[],sn(t=this.i=new ai,0,1,e=new ni)}get baseOptions(){return nn(this.i,ni,1)}set baseOptions(t){sn(this.i,0,1,t)}o(t){var e=this.i,n=nn(this.i,si,2);return n=n?Ve(n):new si,void 0!==t.l2Normalize?Ge(n,1,de(t.l2Normalize)):"l2Normalize"in t&&Ge(n,1),void 0!==t.quantize?Ge(n,2,de(t.quantize)):"quantize"in t&&Ge(n,2),sn(e,0,2,n),Oi(this,t)}M(t,e){return this.G(t,e??this.H,this.s+1)}G(t,e,n){return this.g.addDoubleToStream(e,"sample_rate",n),this.g.addAudioToStreamWithShape(t,1,t.length,"audio_in",n),this.m=[],this.finishProcessing(),this.m}B(){var t=new qr;dn(t,10,"audio_in"),dn(t,10,"sample_rate"),dn(t,15,"embeddings_out"),dn(t,15,"timestamped_embeddings_out");const e=new Br;gn(e,ui,this.i);const n=new Cr;Ke(n,_e("mediapipe.tasks.audio.audio_embedder.AudioEmbedderGraph")),dn(n,3,"AUDIO:audio_in"),dn(n,3,"SAMPLE_RATE:sample_rate"),dn(n,4,"EMBEDDINGS:embeddings_out"),dn(n,4,"TIMESTAMPED_EMBEDDINGS:timestamped_embeddings_out"),n.o(e),ln(t,n),this.g.attachProtoListener("embeddings_out",((t,e)=>{t=bi(t),this.m.push(Di(t)),Vi(this,e)})),this.g.attachEmptyPacketListener("embeddings_out",(t=>{Vi(this,t)})),this.g.attachProtoVectorListener("timestamped_embeddings_out",((t,e)=>{for(const e of t)t=bi(e),this.m.push(Di(t));Vi(this,e)})),this.g.attachEmptyPacketListener("timestamped_embeddings_out",(t=>{Vi(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};let Gi;Ci.prototype.embed=Ci.prototype.M,Ci.prototype.setOptions=Ci.prototype.o,Ci.createFromModelPath=function(t,e){return ji(Ci,t,{baseOptions:{modelAssetPath:e}})},Ci.createFromModelBuffer=function(t,e){return ji(Ci,t,{baseOptions:{modelAssetBuffer:e}})},Ci.createFromOptions=function(t,e){return ji(Ci,t,e)};const $i=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 zi(){if(void 0===Gi)try{await WebAssembly.instantiate($i),Gi=!0}catch{Gi=!1}return Gi}async function Wi(t,e=""){const n=await zi()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var Ri=class{};Ri.forVisionTasks=function(t){return Wi("vision",t)},Ri.forTextTasks=function(t){return Wi("text",t)},Ri.forGenAiExperimentalTasks=function(t){return Wi("genai_experimental",t)},Ri.forGenAiTasks=function(t){return Wi("genai",t)},Ri.forAudioTasks=function(t){return Wi("audio",t)},Ri.isSimdSupported=function(){return zi()},exports.AudioClassifier=Mi,exports.AudioEmbedder=Ci,exports.AudioTaskRunner=Fi,exports.FilesetResolver=Ri;
|
|
2
2
|
//# sourceMappingURL=audio_bundle_cjs.js.map
|