@mediapipe/tasks-text 0.10.22-rc.20250304 → 0.10.32

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediapipe/tasks-text",
3
- "version": "0.10.22-rc.20250304",
3
+ "version": "0.10.32",
4
4
  "description": "MediaPipe Text Tasks",
5
5
  "main": "text_bundle.cjs",
6
6
  "browser": "text_bundle.mjs",
package/text_bundle.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t="undefined"!=typeof self?self:{};function e(){throw Error("Invalid UTF8")}function n(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}let r,i;const o="undefined"!=typeof TextDecoder;let s;const a="undefined"!=typeof TextEncoder;function u(t){if(a)t=(s||=new TextEncoder).encode(t);else{let n=0;const r=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(e<128)r[n++]=e;else{if(e<2048)r[n++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&i<t.length){const o=t.charCodeAt(++i);if(o>=56320&&o<=57343){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 c,l;t:{for(var h=["CLOSURE_FLAGS"],f=t,d=0;d<h.length;d++)if(null==(f=f[h[d]])){l=null;break t}l=f}var g,p=l&&l[610401301];c=null!=p&&p;const m=t.navigator;function y(t){return!!c&&(!!g&&g.brands.some((({brand:e})=>e&&-1!=e.indexOf(t))))}function b(e){var n;return(n=t.navigator)&&(n=n.userAgent)||(n=""),-1!=n.indexOf(e)}function v(){return!!c&&(!!g&&g.brands.length>0)}function w(){return v()?y("Chromium"):(b("Chrome")||b("CriOS"))&&!(!v()&&b("Edge"))||b("Silk")}function _(t){return _[" "](t),t}g=m&&m.userAgentData||null,_[" "]=function(){};var S=!v()&&(b("Trident")||b("MSIE"));!b("Android")||w(),w(),b("Safari")&&(w()||!v()&&b("Coast")||!v()&&b("Opera")||!v()&&b("Edge")||(v()?y("Microsoft Edge"):b("Edg/"))||v()&&y("Opera"));var A={},E=null;function I(t){const e=t.length;let n=3*e/4;n%3?n=Math.floor(n):-1!="=.".indexOf(t[e-1])&&(n=-1!="=.".indexOf(t[e-2])?n-2:n-1);const r=new Uint8Array(n);let i=0;return function(t,e){function n(e){for(;r<t.length;){const e=t.charAt(r++),n=E[e];if(null!=n)return n;if(!/^[\s\xa0]*$/.test(e))throw Error("Unknown base64 encoding at char: "+e)}return e}T();let r=0;for(;;){const t=n(-1),r=n(0),i=n(64),o=n(64);if(64===o&&-1===t)break;e(t<<2|r>>4),64!=i&&(e(r<<4&240|i>>2),64!=o&&e(i<<6&192|o))}}(t,(function(t){r[i++]=t})),i!==n?r.subarray(0,i):r}function T(){if(!E){E={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let n=0;n<5;n++){const r=t.concat(e[n].split(""));A[n]=r;for(let t=0;t<r.length;t++){const e=r[t];void 0===E[e]&&(E[e]=t)}}}}var x="undefined"!=typeof Uint8Array,U=!S&&"function"==typeof btoa;function P(t){if(!U){var e;void 0===e&&(e=0),T(),e=A[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 B=/[-_.]/g,L={"-":"+",_:"/",".":"="};function O(t){return L[t]||""}function k(t){if(!U)return I(t);B.test(t)&&(t=t.replace(B,O)),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 F(t){return x&&null!=t&&t instanceof Uint8Array}var N={};function V(){return M||=new C(null,N)}function j(t){D(N);var e=t.g;return null==(e=null==e||F(e)?e:"string"==typeof e?k(e):null)?e:t.g=e}var C=class{i(){return new Uint8Array(j(this)||0)}constructor(t,e){if(D(e),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};let M,G;function D(t){if(t!==N)throw Error("illegal external caller")}function $(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function z(){const t=Error("int32");return $(t,"warning"),t}function R(e){if(null!=e){var n=G??={},r=n[e]||0;r>=5||(n[e]=r+1,$(e=Error(),"incident"),function(e){t.setTimeout((()=>{throw e}),0)}(e))}}var W="function"==typeof Symbol&&"symbol"==typeof Symbol();function H(t,e,n=!1){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?n&&Symbol.for&&t?Symbol.for(t):null!=t?Symbol(t):Symbol():e}var q=H("jas",void 0,!0),K=H(void 0,"1oa"),X=H(void 0,Symbol()),J=H(void 0,"0actk"),Y=H(void 0,"8utk");const Q=W?q:"L",Z={L:{value:0,configurable:!0,writable:!0,enumerable:!1}},tt=Object.defineProperties;function et(t,e){W||Q in t||tt(t,Z),t[Q]|=e}function nt(t,e){W||Q in t||tt(t,Z),t[Q]=e}function rt(t,e){nt(e,-15615&(0|t))}function it(t,e){nt(e,-15581&(34|t))}function ot(){return"function"==typeof BigInt}function st(t){return Array.prototype.slice.call(t)}var at,ut={};function ct(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}function lt(t,e){if(null!=t)if("string"==typeof t)t=t?new C(t,N):V();else if(t.constructor!==C)if(F(t))t=t.length?new C(new Uint8Array(t),N):V();else{if(!e)throw Error();t=void 0}return t}const ht=[];function ft(t){if(2&t)throw Error()}function dt(t){return X?t[X]:void 0}nt(ht,55),at=Object.freeze(ht);var gt=Object.freeze({});var pt="function"==typeof t.BigInt&&"bigint"==typeof t.BigInt(0),mt=t=>pt?t>=bt&&t<=wt:"-"===t[0]?_t(t,yt):_t(t,vt);const yt=Number.MIN_SAFE_INTEGER.toString(),bt=pt?BigInt(Number.MIN_SAFE_INTEGER):void 0,vt=Number.MAX_SAFE_INTEGER.toString(),wt=pt?BigInt(Number.MAX_SAFE_INTEGER):void 0;function _t(t,e){if(t.length>e.length)return!1;if(t.length<e.length||t===e)return!0;for(let n=0;n<t.length;n++){const r=t[n],i=e[n];if(r>i)return!1;if(r<i)return!0}}const St="function"==typeof Uint8Array.prototype.slice;let At,Et=0,It=0;function Tt(t){const e=t>>>0;Et=e,It=(t-e)/4294967296>>>0}function xt(t){if(t<0){Tt(-t);const[e,n]=Ft(Et,It);Et=e>>>0,It=n>>>0}else Tt(t)}function Ut(t){const e=At||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),It=0,Et=e.getUint32(0,!0)}function Pt(t,e){const n=4294967296*e+(t>>>0);return Number.isSafeInteger(n)?n:Lt(t,e)}function Bt(t,e){const n=2147483648&e;return n&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),"number"==typeof(t=Pt(t,e))?n?-t:t:n?"-"+t:t}function Lt(t,e){if(t>>>=0,(e>>>=0)<=2097151)var n=""+(4294967296*e+t);else ot()?n=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(n=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),n+=8147497*e,e*=2,t>=1e7&&(n+=t/1e7>>>0,t%=1e7),n>=1e7&&(e+=n/1e7>>>0,n%=1e7),n=e+Ot(n)+Ot(t));return n}function Ot(t){return t=String(t),"0000000".slice(t.length)+t}function kt(t){if(t.length<16)xt(Number(t));else if(ot())t=BigInt(t),Et=Number(t&BigInt(4294967295))>>>0,It=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);It=Et=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));It*=1e6,Et=1e6*Et+e,Et>=4294967296&&(It+=Math.trunc(Et/4294967296),It>>>=0,Et>>>=0)}if(e){const[t,e]=Ft(Et,It);Et=t,It=e}}}function Ft(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}const Nt="function"==typeof BigInt?BigInt.asIntN:void 0,Vt="function"==typeof BigInt?BigInt.asUintN:void 0,jt=Number.isSafeInteger,Ct=Number.isFinite,Mt=Math.trunc;function Gt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function Dt(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}const $t=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function zt(t){switch(typeof t){case"bigint":return!0;case"number":return Ct(t);case"string":return $t.test(t);default:return!1}}function Rt(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Ct(t)?0|t:void 0}function Wt(t){if("-"===t[0])return!1;const e=t.length;return e<20||20===e&&Number(t.substring(0,6))<184467}function Ht(t){return t=Mt(t),jt(t)||(xt(t),t=Bt(Et,It)),t}function qt(t){var e=Mt(Number(t));if(jt(e))return String(e);if(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),e=t.length,!("-"===t[0]?e<20||20===e&&Number(t.substring(0,7))>-922337:e<19||19===e&&Number(t.substring(0,6))<922337))if(kt(t),t=Et,2147483648&(e=It))if(ot())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,r]=Ft(t,e);t="-"+Lt(n,r)}else t=Lt(t,e);return t}function Kt(t){return null==t?t:"bigint"==typeof t?(mt(t)?t=Number(t):(t=Nt(64,t),t=mt(t)?Number(t):String(t)),t):zt(t)?"number"==typeof t?Ht(t):qt(t):void 0}function Xt(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(Vt(64,t));if(zt(t)){if("string"===e)return e=Mt(Number(t)),jt(e)&&e>=0?t=String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),Wt(t)||(kt(t),t=Lt(Et,It))),t;if("number"===e)return(t=Mt(t))>=0&&jt(t)?t:function(t){if(t<0){xt(t);var e=Lt(Et,It);return t=Number(e),jt(t)?t:e}return Wt(e=String(t))?e:(xt(t),Pt(Et,It))}(t)}}function Jt(t){if("string"!=typeof t)throw Error();return t}function Yt(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function Qt(t){return null==t||"string"==typeof t?t:void 0}function Zt(t,e,n){if(null!=t&&"object"==typeof t&&t.B===ut)return t;if(Array.isArray(t)){var r=0|t[Q],i=r;return 0===i&&(i|=32&n),(i|=2&n)!==r&&nt(t,i),new e(t)}}function te(t){return t}function ee(t,e,n,r,i){if(null!=t){if(Array.isArray(t)){const o=0|t[Q];return 0===t.length&&1&o?void 0:i&&2&o?t:ne(t,e,n,void 0!==r,i)}return e(t,r)}}function ne(t,e,n,r,i){const o=r||n?0|t[Q]:0,s=r?!!(32&o):void 0;let a=0;const u=(r=st(t)).length;for(let t=0;t<u;t++){var c=r[t];if(t===u-1&&ct(c)){var l=e,h=n,f=s,d=i;let t;for(let e in c){const n=ee(c[e],l,h,f,d);null!=n&&((t??={})[e]=n)}c=t}else c=ee(r[t],e,n,s,i);r[t]=c,null!=c&&(a=t+1)}return a<u&&(r.length=a),n&&((t=dt(t))&&(r[X]=st(t)),n(o,r)),r}function re(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return mt(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(F(t))return F(t)&&R(Y),P(t);if(t.B===ut)return ae(t);if(t instanceof C){const e=t.g;return null==e?"":"string"==typeof e?e:t.g=P(e)}return}return t}let ie,oe,se;function ae(t){var e=t.l;t=ne(e,re,void 0,void 0,!1);var n=0|e[Q];if((e=t.length)&&!(512&n)){var r=t[e-1],i=!1;ct(r)?(e--,i=!0):r=void 0;var o=e-(n=512&n?0:-1),s=(ie??te)(o,n,t,r);if(r&&(t[e]=void 0),o<s&&r){for(var a in o=!0,r){const u=+a;u<=s?(t[i=u+n]=r[a],e=Math.max(i+1,e),i=!1,delete r[a]):o=!1}o&&(r=void 0)}for(o=e-1;e>0;o=e-1)if(null==(a=t[o]))e--,i=!0;else{if(!((o-=n)>=s))break;(r??={})[o]=a,e--,i=!0}i&&(t.length=e),r&&t.push(r)}return t}function ue(t,e,n){return t=ce(t,e[0],e[1],n?1:2),e!==oe&&n&&et(t,8192),t}function ce(t,e,n,r){if(null==t){var i=96;n?(t=[n],i|=512):t=[],e&&(i=-16760833&i|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(8192&(i=0|t[Q])||!(64&i)||2&i||R(J),1024&i)throw Error("farr");if(64&i)return t;if(1===r||2===r||(i|=64),n&&(i|=512,n!==t[0]))throw Error("mid");t:{var o=(n=t).length;if(o){var s=o-1;if(ct(r=n[s])){if((s-=e=512&(i|=256)?0:-1)>=1024)throw Error("pvtlmt");for(var a in r)(o=+a)<s&&(n[o+e]=r[a],delete r[a]);i=-16760833&i|(1023&s)<<14;break t}}if(e){if((a=Math.max(e,o-(512&i?0:-1)))>1024)throw Error("spvt");i=-16760833&i|(1023&a)<<14}}}return nt(t,i),t}function le(t,e,n=it){if(null!=t){if(x&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var r=0|t[Q];return 2&r?t:(e&&=0===r||!!(32&r)&&!(64&r||!(16&r)),e?(nt(t,34|r),4&r&&Object.freeze(t),t):ne(t,le,4&r?it:n,!0,!0))}return t.B===ut&&(t=2&(r=0|(n=t.l)[Q])?t:new t.constructor(fe(n,r,!0))),t}}function he(t){const e=t.l;return new t.constructor(fe(e,0|e[Q],!1))}function fe(t,e,n){const r=n||2&e?it:rt,i=!!(32&e);return t=function(t,e,n){const r=st(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(t=dt(t))&&(r[X]=st(t)),r}(t,e,(t=>le(t,i,r))),et(t,32|(n?2:0)),t}function de(t){const e=t.l,n=0|e[Q];return 2&n?new t.constructor(fe(e,n,!1)):t}function ge(t,e){return pe(t=t.l,0|t[Q],e)}function pe(t,e,n){if(-1===n)return null;const r=n+(512&e?0:-1),i=t.length-1;return r>=i&&256&e?t[i][n]:r<=i?t[r]:void 0}function me(t,e,n){const r=t.l;let i=0|r[Q];return ft(i),ye(r,i,e,n),t}function ye(t,e,n,r){const i=512&e?0:-1,o=n+i;var s=t.length-1;return o>=s&&256&e?(t[s][n]=r,e):o<=s?(t[o]=r,e):(void 0!==r&&(n>=(s=e>>14&1023||536870912)?null!=r&&(t[s+i]={[n]:r},nt(t,e|=256)):t[o]=r),e)}function be(t){let e=0|(t=t.l)[Q];const n=pe(t,e,1),r=lt(n,!0);return null!=r&&r!==n&&ye(t,e,1,r),r}function ve(t,e,n,r,i){const o=t.l,s=2&(t=0|o[Q])?1:r;i=!!i;let a=0|(r=we(o,t,e))[Q];if(!(4&a)){4&a&&(r=st(r),a=je(a,t),t=ye(o,t,e,r));let i=0,s=0;for(;i<r.length;i++){const t=n(r[i]);null!=t&&(r[s++]=t)}s<i&&(r.length=s),a=_e(a,t),n=-2049&(20|a),a=n&=-4097,nt(r,a),2&a&&Object.freeze(r)}return 1===s||4===s&&32&a?Se(a)||(i=a,a|=2,a!==i&&nt(r,a),Object.freeze(r)):(2===s&&Se(a)&&(r=st(r),a=je(a,t),a=Ce(a,t,i),nt(r,a),t=ye(o,t,e,r)),Se(a)||(e=a,a=Ce(a,t,i),a!==e&&nt(r,a))),r}function we(t,e,n){return t=pe(t,e,n),Array.isArray(t)?t:at}function _e(t,e){return 0===t&&(t=je(t,e)),1|t}function Se(t){return!!(2&t)&&!!(4&t)||!!(1024&t)}function Ae(t,e,n){let r=0|(t=t.l)[Q];if(ft(r),null==n)ye(t,r,e);else{var i=0|n[Q],o=i,s=Se(i),a=s||Object.isFrozen(n);for(s||(i=0),a||(n=st(n),o=0,i=Ce(i=je(i,r),r,!0),a=!1),i|=21,s=0;s<n.length;s++){const t=n[s],e=Jt(t);Object.is(t,e)||(a&&(n=st(n),o=0,i=Ce(i=je(i,r),r,!0),a=!1),n[s]=e)}i!==o&&(a&&(n=st(n),i=Ce(i=je(i,r),r,!0)),nt(n,i)),ye(t,r,e,n)}}function Ee(t,e){let n=0|(t=t.l)[Q];ft(n),ye(t,n,2,""===e?void 0:e)}function Ie(t,e,n,r){ft(e);let i=we(t,e,n);const o=i!==at;if(64&e||!(8192&e)||!o){const s=o?0|i[Q]:0;let a=s;(!o||2&a||Se(a)||4&a&&!(32&a))&&(i=st(i),a=je(a,e),e=ye(t,e,n,i)),a=-13&_e(a,e),a=Ce(r?-17&a:16|a,e,!0),a!==s&&nt(i,a)}return i}function Te(t,e){var n=ci;return Pe(xe(t=t.l),t,0|t[Q],n)===e?e:-1}function xe(t){if(W)return t[K]??(t[K]=new Map);if(K in t)return t[K];const e=new Map;return Object.defineProperty(t,K,{value:e}),e}function Ue(t,e,n,r){const i=xe(t),o=Pe(i,t,e,n);return o!==r&&(o&&(e=ye(t,e,o)),i.set(n,r)),e}function Pe(t,e,n,r){let i=t.get(r);if(null!=i)return i;i=0;for(let t=0;t<r.length;t++){const o=r[t];null!=pe(e,n,o)&&(0!==i&&(n=ye(e,n,i)),i=o)}return t.set(r,i),i}function Be(t,e,n){let r=0|t[Q];const i=pe(t,r,n);let o;if(null!=i&&i.B===ut)return(e=de(i))!==i&&ye(t,r,n,e),e.l;if(Array.isArray(i)){const t=0|i[Q];o=2&t?ue(fe(i,t,!1),e,!0):64&t?i:ue(o,e,!0)}else o=ue(void 0,e,!0);return o!==i&&ye(t,r,n,o),o}function Le(t,e,n){let r=0|(t=t.l)[Q];const i=pe(t,r,n);return(e=Zt(i,e,r))!==i&&null!=e&&ye(t,r,n,e),e}function Oe(t,e,n){if(null==(e=Le(t,e,n)))return e;let r=0|(t=t.l)[Q];if(!(2&r)){const i=de(e);i!==e&&ye(t,r,n,e=i)}return e}function ke(t,e,n,r,i,o){t=t.l;var s=!!(2&e);const a=s?1:r;i=!!i,o&&=!s;var u=0|(r=we(t,e,1))[Q];if(!(s=!!(4&u))){var c=r,l=e;const t=!!(2&(u=_e(u,e)));t&&(l|=2);let i=!t,o=!0,s=0,a=0;for(;s<c.length;s++){const e=Zt(c[s],n,l);if(e instanceof n){if(!t){const t=!!(2&(0|e.l[Q]));i&&=!t,o&&=t}c[a++]=e}}a<s&&(c.length=a),u|=4,u=o?16|u:-17&u,nt(c,u=i?8|u:-9&u),t&&Object.freeze(c)}if(o&&!(8&u||!r.length&&(1===a||4===a&&32&u))){for(Se(u)&&(r=st(r),u=je(u,e),e=ye(t,e,1,r)),n=r,o=u,c=0;c<n.length;c++)(u=n[c])!==(l=de(u))&&(n[c]=l);o|=8,nt(n,o=n.length?-17&o:16|o),u=o}return 1===a||4===a&&32&u?Se(u)||(e=u,(u|=!r.length||16&u&&(!s||32&u)?2:1024)!==e&&nt(r,u),Object.freeze(r)):(2===a&&Se(u)&&(nt(r=st(r),u=Ce(u=je(u,e),e,i)),e=ye(t,e,1,r)),Se(u)||(t=u,(u=Ce(u,e,i))!==t&&nt(r,u))),r}function Fe(t,e){const n=0|t.l[Q];return ke(t,n,e,void 0===gt?2:4,!1,!(2&n))}function Ne(t,e,n,r){return null==r&&(r=void 0),me(t,n,r)}function Ve(t,e,n){var r=pi;null==n&&(n=void 0);t:{let i=0|(t=t.l)[Q];if(ft(i),null==n){const n=xe(t);if(Pe(n,t,i,r)!==e)break t;n.set(r,0)}else i=Ue(t,i,r,e);ye(t,i,e,n)}}function je(t,e){return-1025&(t=32|(2&e?2|t:-3&t))}function Ce(t,e,n){return 32&e&&n||(t&=-33),t}function Me(t,e,n){ft(0|t.l[Q]),ve(t,e,Qt,2,!0).push(Jt(n))}function Ge(t,e){var n=Xr;const r=0|t.l[Q];ft(r),t=ke(t,r,n,2,!0),e=null!=e?e:new n,t.push(e),t[Q]=2&(0|e.l[Q])?-9&t[Q]:-17&t[Q]}function De(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function $e(){return Error("Failed to read varint, encoding is invalid.")}function ze(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function Re(t){if("string"==typeof t)return{buffer:k(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===C)return{buffer:j(t)||new Uint8Array(0),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 We(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(o<32&&128&n);for(o>32&&(i|=(127&n)>>4),o=3;o<32&&128&n;o+=7)n=s[a++],i|=(127&n)<<o;if(Ye(t,a),n<128)return e(r>>>0,i>>>0);throw $e()}function He(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 Ye(t,n),!!(127&e)}throw $e()}function qe(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 $e();return Ye(t,n),i}function Ke(t){var e=t.i;const n=t.g;var r=e[n],i=e[n+1];const o=e[n+2];return e=e[n+3],Ye(t,t.g+4),t=2*((i=(r<<0|i<<8|o<<16|e<<24)>>>0)>>31)+1,r=i>>>23&255,i&=8388607,255==r?i?NaN:t*(1/0):0==r?1401298464324817e-60*t*i:t*Math.pow(2,r-150)*(i+8388608)}function Xe(t){return qe(t)}function Je(t,e,{C:n=!1}={}){t.C=n,e&&(e=Re(e),t.i=e.buffer,t.m=e.v,t.u=0,t.j=t.i.length,t.g=t.u)}function Ye(t,e){if(t.g=e,e>t.j)throw ze(t.j,e)}function Qe(t,e){if(e<0)throw Error(`Tried to read a negative byte length: ${e}`);const n=t.g,r=n+e;if(r>t.j)throw ze(e,t.j-n);return t.g=r,n}function Ze(t,e){if(0==e)return V();var n=Qe(t,e);return t.C&&t.m?n=t.i.subarray(n,n+e):(t=t.i,n=n===(e=n+e)?new Uint8Array(0):St?t.slice(n,e):new Uint8Array(t.subarray(n,e))),0==n.length?V():new C(n,N)}var tn=[];function en(t){var e=t.g;if(e.g==e.j)return!1;t.j=t.g.g;var n=qe(t.g)>>>0;if(e=n>>>3,!((n&=7)>=0&&n<=5))throw De(n,t.j);if(e<1)throw Error(`Invalid field number: ${e} (at position ${t.j})`);return t.m=e,t.i=n,!0}function nn(t){switch(t.i){case 0:0!=t.i?nn(t):He(t.g);break;case 1:Ye(t=t.g,t.g+8);break;case 2:if(2!=t.i)nn(t);else{var e=qe(t.g)>>>0;Ye(t=t.g,t.g+e)}break;case 5:Ye(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!en(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.i){if(t.m!=e)throw Error("Unmatched end-group tag");break}nn(t)}break;default:throw De(t.i,t.j)}}function rn(t,e,n){const r=t.g.j,i=qe(t.g)>>>0,o=t.g.g+i;let s=o-r;if(s<=0&&(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 on(t){var s=qe(t.g)>>>0,a=Qe(t=t.g,s);if(t=t.i,o){var u,c=t;(u=i)||(u=i=new TextDecoder("utf-8",{fatal:!0})),s=a+s,c=0===a&&s===c.length?c:c.subarray(a,s);try{var l=u.decode(c)}catch(t){if(void 0===r){try{u.decode(new Uint8Array([128]))}catch(t){}try{u.decode(new Uint8Array([97])),r=!0}catch(t){r=!1}}throw!r&&(i=void 0),t}}else{s=(l=a)+s,a=[];let r,i=null;for(;l<s;){var h=t[l++];h<128?a.push(h):h<224?l>=s?e():(r=t[l++],h<194||128!=(192&r)?(l--,e()):a.push((31&h)<<6|63&r)):h<240?l>=s-1?e():(r=t[l++],128!=(192&r)||224===h&&r<160||237===h&&r>=160||128!=(192&(u=t[l++]))?(l--,e()):a.push((15&h)<<12|(63&r)<<6|63&u)):h<=244?l>=s-2?e():(r=t[l++],128!=(192&r)||r-144+(h<<28)>>30!=0||128!=(192&(u=t[l++]))||128!=(192&(c=t[l++]))?(l--,e()):(h=(7&h)<<18|(63&r)<<12|(63&u)<<6|63&c,h-=65536,a.push(55296+(h>>10&1023),56320+(1023&h)))):e(),a.length>=8192&&(i=n(i,a),a.length=0)}l=n(i,a)}return l}function sn(t){const e=qe(t.g)>>>0;return Ze(t.g,e)}function an(t,e,n){var r=qe(t.g)>>>0;for(r=t.g.g+r;t.g.g<r;)n.push(e(t.g))}var un=[];function cn(t,e,n){e.g?e.j(t,e.g,e.i,n):e.j(t,e.i,n)}var ln=class{constructor(t,e){this.l=ce(t,e)}toJSON(){try{var t=ae(this)}finally{ie=void 0}return t}v(){return!!(2&(0|this.l[Q]))}};function hn(t){return t?/^\d+$/.test(t)?(kt(t),new fn(Et,It)):null:dn||=new fn(0,0)}ln.prototype.B=ut,ln.prototype.toString=function(){return this.l.toString()};var fn=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let dn;function gn(t){return t?/^-?\d+$/.test(t)?(kt(t),new pn(Et,It)):null:mn||=new pn(0,0)}var pn=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let mn;function yn(t,e,n){for(;n>0||e>127;)t.g.push(127&e|128),e=(e>>>7|n<<25)>>>0,n>>>=7;t.g.push(e)}function bn(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function vn(t,e){if(e>=0)bn(t,e);else{for(let n=0;n<9;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function wn(t){var e=Et;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 _n(t,e){0!==e.length&&(t.j.push(e),t.i+=e.length)}function Sn(t,e,n){bn(t.g,8*e+n)}function An(t,e){return Sn(t,e,2),e=t.g.end(),_n(t,e),e.push(t.i),e}function En(t,e){var n=e.pop();for(n=t.i+t.g.length()-n;n>127;)e.push(127&n|128),n>>>=7,t.i++;e.push(n),t.i++}function In(t,e,n){Sn(t,e,2),bn(t.g,n.length),_n(t,t.g.end()),_n(t,n)}function Tn(){const t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var xn=Tn(),Un=Tn(),Pn=Tn(),Bn=Tn(),Ln=Tn(),On=Tn(),kn=Tn(),Fn=Tn(),Nn=class{constructor(t,e,n){this.g=t,this.i=e,t=xn,this.j=!!t&&n===t||!1}};function Vn(t,e){return new Nn(t,e,xn)}function jn(t,e,n,r,i){null!=(e=Kn(e,r))&&(n=An(t,n),i(e,t),En(t,n))}const Cn=Vn((function(t,e,n,r,i){return 2===t.i&&(rn(t,Be(e,r,n),i),!0)}),jn),Mn=Vn((function(t,e,n,r,i){return 2===t.i&&(rn(t,Be(e,r,n),i),!0)}),jn);var Gn=Symbol(),Dn=Symbol(),$n=Symbol(),zn=Symbol();let Rn,Wn;function Hn(t,e,n,r){var i=r[t];if(i)return i;(i={}).N=r,i.A=function(t){switch(typeof t){case"boolean":return oe||=[0,void 0,!0];case"number":return t>0?void 0:0===t?se||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(r[0]);var o=r[1];let s=1;o&&o.constructor===Object&&(i.F=o,"function"==typeof(o=r[++s])&&(i.G=!0,Rn??=o,Wn??=r[s+1],o=r[s+=2]));const a={};for(;o&&Array.isArray(o)&&o.length&&"number"==typeof o[0]&&o[0]>0;){for(var u=0;u<o.length;u++)a[o[u]]=o;o=r[++s]}for(u=1;void 0!==o;){let t;"number"==typeof o&&(u+=o,o=r[++s]);var c=void 0;if(o instanceof Nn?t=o:(t=Cn,s--),t?.j){o=r[++s],c=r;var l=s;"function"==typeof o&&(o=o(),c[l]=o),c=o}for(l=u+1,"number"==typeof(o=r[++s])&&o<0&&(l-=o,o=r[++s]);u<l;u++){const r=a[u];c?n(i,u,t,c,r):e(i,u,t,r)}}return r[t]=i}function qn(t){return Array.isArray(t)?t[0]instanceof Nn?t:[Mn,t]:[t,void 0]}function Kn(t,e){return t instanceof ln?t.l:Array.isArray(t)?ue(t,e,!1):void 0}function Xn(t,e,n,r){const i=n.g;t[e]=r?(t,e,n)=>i(t,e,n,r):i}function Jn(t,e,n,r,i){const o=n.g;let s,a;t[e]=(t,e,n)=>o(t,e,n,a||=Hn(Dn,Xn,Jn,r).A,s||=Yn(r),i)}function Yn(t){let e=t[$n];if(null!=e)return e;const n=Hn(Dn,Xn,Jn,t);return e=n.G?(t,e)=>Rn(t,e,n):(t,e)=>{const r=0|t[Q];for(;en(e)&&4!=e.i;){var i=e.m,o=n[i];if(null==o){var s=n.F;s&&(s=s[i])&&(null!=(s=Qn(s))&&(o=n[i]=s))}null!=o&&o(e,t,i)||(i=(o=e).j,nn(o),o.D?o=void 0:(s=o.g.g-i,o.g.g=i,o=Ze(o.g,s)),i=t,o&&((s=i[X])?s.push(o):i[X]=[o]))}return 8192&r&&et(t,34),!0},t[$n]=e}function Qn(t){const e=(t=qn(t))[0].g;if(t=t[1]){const n=Yn(t),r=Hn(Dn,Xn,Jn,t).A;return(t,i,o)=>e(t,i,o,r,n)}return e}function Zn(t,e,n){t[e]=n.i}function tr(t,e,n,r){let i,o;const s=n.i;t[e]=(t,e,n)=>s(t,e,n,o||=Hn(Gn,Zn,tr,r).A,i||=er(r))}function er(t){let e=t[zn];if(!e){const n=Hn(Gn,Zn,tr,t);e=(t,e)=>nr(t,e,n),t[zn]=e}return e}function nr(t,e,n){!function(t,e,n){const r=512&e?0:-1,i=t.length,o=i+((e=64&e?256&e:!!i&&ct(t[i-1]))?-1:0);for(let e=0;e<o;e++)n(e-r,t[e]);if(e){t=t[i-1];for(const e in t)!isNaN(e)&&n(+e,t[e])}}(t,0|t[Q]|(n.A[1]?512:0),((t,r)=>{if(null!=r){var i=function(t,e){var n=t[e];if(n)return n;if((n=t.F)&&(n=n[e])){var r=(n=qn(n))[0].i;if(n=n[1]){const e=er(n),i=Hn(Gn,Zn,tr,n).A;n=t.G?Wn(i,e):(t,n,o)=>r(t,n,o,i,e)}else n=r;return t[e]=n}}(n,t);i&&i(e,r,t)}})),(t=dt(t))&&function(t,e){_n(t,t.g.end());for(let n=0;n<e.length;n++)_n(t,j(e[n])||new Uint8Array(0))}(e,t)}function rr(t,e){if(Array.isArray(e)){var n=0|e[Q];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),nt(e,-6145&(5|n)),2&n&&Object.freeze(e),e}}function ir(t,e,n){return new Nn(t,e,n)}function or(t,e,n){return new Nn(t,e,n)}function sr(t,e,n){ye(t,0|t[Q],e,n)}function ar(t,e,n){if(e=function(t){if(null==t)return t;const e=typeof t;if("bigint"===e)return String(Nt(64,t));if(zt(t)){if("string"===e)return qt(t);if("number"===e)return Ht(t)}}(e),null!=e){if("string"==typeof e)gn(e);if(null!=e)switch(Sn(t,n,0),typeof e){case"number":t=t.g,xt(e),yn(t,Et,It);break;case"bigint":n=BigInt.asUintN(64,e),n=new pn(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),yn(t.g,n.i,n.g);break;default:n=gn(e),yn(t.g,n.i,n.g)}}}function ur(t,e,n){null!=(e=Rt(e))&&null!=e&&(Sn(t,n,0),vn(t.g,e))}function cr(t,e,n){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(Sn(t,n,0),t.g.g.push(e?1:0))}function lr(t,e,n){null!=(e=Qt(e))&&In(t,n,u(e))}function hr(t,e,n,r,i){null!=(e=Kn(e,r))&&(n=An(t,n),i(e,t),En(t,n))}function fr(t,e,n){null==e||"string"==typeof e||e instanceof C||(F(e)?F(e)&&R(Y):e=void 0),null!=e&&In(t,n,Re(e).buffer)}var dr=ir((function(t,e,n){return 5===t.i&&(sr(e,n,Ke(t.g)),!0)}),(function(t,e,n){null!=(e=Gt(e))&&(Sn(t,n,5),t=t.g,Ut(e),wn(t))}),On),gr=or((function(t,e,n){return(5===t.i||2===t.i)&&(e=Ie(e,0|e[Q],n,!1),2==t.i?an(t,Ke,e):e.push(Ke(t.g)),!0)}),(function(t,e,n){if(null!=(e=rr(Gt,e))&&e.length){Sn(t,n,2),bn(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,Ut(e[r]),wn(n)}}),On),pr=ir((function(t,e,n){return 0===t.i&&(sr(e,n,We(t.g,Bt)),!0)}),ar,Ln),mr=ir((function(t,e,n){return 0===t.i&&(sr(e,n,0===(t=We(t.g,Bt))?void 0:t),!0)}),ar,Ln),yr=ir((function(t,e,n){return 0===t.i&&(sr(e,n,We(t.g,Pt)),!0)}),(function(t,e,n){if(null!=(e=Xt(e))){if("string"==typeof e)hn(e);if(null!=e)switch(Sn(t,n,0),typeof e){case"number":t=t.g,xt(e),yn(t,Et,It);break;case"bigint":n=BigInt.asUintN(64,e),n=new fn(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),yn(t.g,n.i,n.g);break;default:n=hn(e),yn(t.g,n.i,n.g)}}}),Tn()),br=ir((function(t,e,n){return 0===t.i&&(sr(e,n,qe(t.g)),!0)}),ur,Bn),vr=or((function(t,e,n){return(0===t.i||2===t.i)&&(e=Ie(e,0|e[Q],n,!1),2==t.i?an(t,qe,e):e.push(qe(t.g)),!0)}),(function(t,e,n){if(null!=(e=rr(Rt,e))&&e.length){n=An(t,n);for(let n=0;n<e.length;n++)vn(t.g,e[n]);En(t,n)}}),Bn),wr=ir((function(t,e,n){return 0===t.i&&(sr(e,n,0===(t=qe(t.g))?void 0:t),!0)}),ur,Bn),_r=ir((function(t,e,n){return 0===t.i&&(sr(e,n,He(t.g)),!0)}),cr,Un),Sr=ir((function(t,e,n){return 0===t.i&&(sr(e,n,!1===(t=He(t.g))?void 0:t),!0)}),cr,Un),Ar=or((function(t,e,n){return 2===t.i&&(t=on(t),Ie(e,0|e[Q],n,!1).push(t),!0)}),(function(t,e,n){if(null!=(e=rr(Qt,e)))for(let s=0;s<e.length;s++){var r=t,i=n,o=e[s];null!=o&&In(r,i,u(o))}}),Pn),Er=ir((function(t,e,n){return 2===t.i&&(sr(e,n,""===(t=on(t))?void 0:t),!0)}),lr,Pn),Ir=ir((function(t,e,n){return 2===t.i&&(sr(e,n,on(t)),!0)}),lr,Pn),Tr=function(t,e,n=xn){return new Nn(t,e,n)}((function(t,e,n,r,i){return 2===t.i&&(r=ue(void 0,r,!0),Ie(e,0|e[Q],n,!0).push(r),rn(t,r,i),!0)}),(function(t,e,n,r,i){if(Array.isArray(e))for(let o=0;o<e.length;o++)hr(t,e[o],n,r,i)})),xr=Vn((function(t,e,n,r,i,o){return 2===t.i&&(Ue(e,0|e[Q],o,n),rn(t,e=Be(e,r,n),i),!0)}),hr),Ur=ir((function(t,e,n){return 2===t.i&&(sr(e,n,sn(t)),!0)}),fr,kn),Pr=ir((function(t,e,n){return 0===t.i&&(sr(e,n,0===(t=qe(t.g)>>>0)?void 0:t),!0)}),(function(t,e,n){e=function(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Ct(t)?t>>>0:void 0}(e),null!=e&&null!=e&&(Sn(t,n,0),bn(t.g,e))}),Tn()),Br=ir((function(t,e,n){return 0===t.i&&(sr(e,n,qe(t.g)),!0)}),(function(t,e,n){null!=(e=Rt(e))&&(e=parseInt(e,10),Sn(t,n,0),vn(t.g,e))}),Fn);class Lr{constructor(t,e){this.i=t,this.g=e,this.j=Ne,this.defaultValue=void 0}register(){_(this)}}function Or(t,e){return(n,r)=>{if(un.length){const t=un.pop();t.o(r),Je(t.g,n,r),n=t}else n=new class{constructor(t,e){if(tn.length){const n=tn.pop();Je(n,t,e),t=n}else t=new class{constructor(t,e){this.i=null,this.m=!1,this.g=this.j=this.u=0,Je(this,t,e)}clear(){this.i=null,this.m=!1,this.g=this.j=this.u=0,this.C=!1}}(t,e);this.g=t,this.j=this.g.g,this.i=this.m=-1,this.o(e)}o({D:t=!1}={}){this.D=t}}(n,r);try{const r=new t,o=r.l;Yn(e)(o,n);var i=r}finally{n.g.clear(),n.m=-1,n.i=-1,un.length<100&&un.push(n)}return i}}var kr=[0,Er,ir((function(t,e,n){return 2===t.i&&(sr(e,n,(t=sn(t))===V()?void 0:t),!0)}),(function(t,e,n){if(null!=e){if(e instanceof ln){const r=e.O;return void(r&&(e=r(e),null!=e&&In(t,n,Re(e).buffer)))}if(Array.isArray(e))return}fr(t,e,n)}),kn)];let Fr,Nr=globalThis.trustedTypes;function Vr(t){void 0===Fr&&(Fr=function(){let t=null;if(!Nr)return t;try{const e=t=>t;t=Nr.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(t){}return t}());var e=Fr;return new class{constructor(t){this.g=t}toString(){return this.g+""}}(e?e.createScriptURL(t):t)}function jr(t,...e){if(0===e.length)return Vr(t[0]);let n=t[0];for(let r=0;r<e.length;r++)n+=encodeURIComponent(e[r])+t[r+1];return Vr(n)}var Cr=[0,br,Br,_r,-1,vr,Br,-1],Mr=class extends ln{constructor(t){super(t)}},Gr=[0,_r,Ir,_r,Br,-1,or((function(t,e,n){return(0===t.i||2===t.i)&&(e=Ie(e,0|e[Q],n,!1),2==t.i?an(t,Xe,e):e.push(qe(t.g)),!0)}),(function(t,e,n){if(null!=(e=rr(Rt,e))&&e.length){n=An(t,n);for(let n=0;n<e.length;n++)vn(t.g,e[n]);En(t,n)}}),Fn),Ir,-1,[0,_r,-1],Br,_r,-1],Dr=[0,Ir,-2],$r=class extends ln{constructor(t){super(t)}},zr=[0],Rr=[0,br,_r,1,_r,-3],Wr=class extends ln{constructor(t){super(t,2)}},Hr={};Hr[336783863]=[0,Ir,_r,-1,br,[0,[1,2,3,4,5,6,7,8,9],xr,zr,xr,Gr,xr,Dr,xr,Rr,xr,Cr,xr,[0,Ir,-2],xr,[0,Ir,Br],xr,[0,Br,Ir,-1],xr,[0,Br,-1]],[0,Ir],_r,[0,[1,3],[2,4],xr,[0,vr],-1,xr,[0,Ar],-1,Tr,[0,Ir,-1]],Ir];var qr=[0,mr,-1,Sr,-3,mr,vr,Er,wr,mr,-1,Sr,wr,Sr,-2,Er];function Kr(t){Me(t,3,"TEXT:text_in")}var Xr=class extends ln{constructor(t){super(t,500)}o(t){return Ne(this,0,7,t)}},Jr=[-1,{}],Yr=[0,Ir,1,Jr],Qr=[0,Ir,Ar,Jr];function Zr(t){Me(t,10,"text_in")}var ti,ei=class extends ln{constructor(t){super(t,500)}o(t){return Ne(this,0,1001,t)}};ei.prototype.g=(ti=[-500,Tr,[-500,Er,-1,Ar,-3,[-2,Hr,_r],Tr,kr,wr,-1,Yr,Qr,Tr,[0,Er,Sr],Er,qr,wr,Ar,987,Ar],4,Tr,[-500,Ir,-1,[-1,{}],998,Ir],Tr,[-500,Ir,Ar,-1,[-2,{},_r],997,Ar,-1],wr,Tr,[-500,Ir,Ar,Jr,998,Ar],Ar,wr,Yr,Qr,Tr,[0,Er,-1,Jr],Ar,-2,qr,Er,-1,Sr,[0,Sr,Pr],978,Jr,Tr,kr],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}}}};nr(this.l,t,Hn(Gn,Zn,tr,ti)),_n(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 ni=class extends ln{constructor(t){super(t)}},ri=class extends ln{constructor(t){super(t)}g(){return Fe(this,ni)}},ii=class extends ln{constructor(t){super(t)}},oi=Or(class extends ln{constructor(t){super(t)}},[0,Tr,[0,1,br,Ir,[0,Tr,[0,br,dr,Ir,-1]]],pr]),si=class extends ln{constructor(t){super(t)}},ai=class extends ln{constructor(t){super(t)}H(){const t=be(this);return null==t?V():t}},ui=class extends ln{constructor(t){super(t)}},ci=[1,2],li=Or(class extends ln{constructor(t){super(t)}},[0,Tr,[0,ci,xr,[0,gr],xr,[0,Ur],br,Ir],pr]),hi=class extends ln{constructor(t){super(t)}},fi=class extends ln{constructor(t){super(t)}},di=[0,_r,-1],gi=class extends ln{constructor(t){super(t)}},pi=[1,2,3,4,5],mi=class extends ln{constructor(t){super(t)}g(){return null!=be(this)}i(){return null!=Qt(ge(this,2))}},yi=class extends ln{constructor(t){super(t)}},bi=[0,[0,Ur,Ir,[0,br,pr,-1],[0,yr,pr]],_r,[0,pi,xr,Rr,xr,Gr,xr,Cr,xr,zr,xr,Dr],Br],vi=class extends ln{constructor(t){super(t)}},wi=new Lr(462704549,vi);Hr[462704549]=[0,bi,[0,Ir,br,dr,Ar,-1]];var _i=class extends ln{constructor(t){super(t)}},Si=new Lr(477589892,_i);function Ai(t,e){if(e=e?he(e):new hi,void 0!==t.displayNamesLocale?me(e,1,Yt(t.displayNamesLocale)):void 0===t.displayNamesLocale&&me(e,1),void 0!==t.maxResults){var n=t.maxResults;if(null!=n){if("number"!=typeof n)throw z();if(!Ct(n))throw z();n|=0}me(e,2,n)}else"maxResults"in t&&me(e,2);if(void 0!==t.scoreThreshold){if(null!=(n=t.scoreThreshold)&&"number"!=typeof n)throw Error(`Value of float/double field must be a number, found ${typeof n}: ${n}`);me(e,3,n)}else"scoreThreshold"in t&&me(e,3);return void 0!==t.categoryAllowlist?Ae(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&me(e,4),void 0!==t.categoryDenylist?Ae(e,5,t.categoryDenylist):"categoryDenylist"in t&&me(e,5),e}function Ei(t){const e={classifications:Fe(t,ii).map((t=>function(t,e=-1,n=""){return{categories:t.map((t=>{var e=Rt(ge(t,1))??0??-1;const n=t.l;let r=0|n[Q];const i=pe(n,r,2),o=Gt(i);return null!=o&&o!==i&&ye(n,r,2,o),{index:e,score:o??0??0,categoryName:Qt(ge(t,3))??""??"",displayName:Qt(ge(t,4))??""??""}})),headIndex:e,headName:n}}(Oe(t,ri,4)?.g()??[],Rt(ge(t,2))??0,Qt(ge(t,3))??"")))};return null!=Kt(ge(t,2))&&(e.timestampMs=Kt(ge(t,2))??0),e}function Ii(t){return Array.from(t,(t=>t>127?t-256:t))}function Ti(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);let n=0,r=0,i=0;for(let o=0;o<t.length;o++)n+=t[o]*e[o],r+=t[o]*t[o],i+=e[o]*e[o];if(r<=0||i<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return n/Math.sqrt(r*i)}let xi;Hr[477589892]=[0,bi,di];const Ui=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 Pi(){if(void 0===xi)try{await WebAssembly.instantiate(Ui),xi=!0}catch{xi=!1}return xi}async function Bi(t,e=jr``){const n=await Pi()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var Li=class{};function Oi(){var t=navigator;return"undefined"!=typeof OffscreenCanvas&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(t)||!!((t=t.userAgent.match(/Version\/([\d]+).*Safari/))&&t.length>=1&&Number(t[1])>=17))}async function ki(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())}Li.forVisionTasks=function(t){return Bi("vision",t)},Li.forTextTasks=function(t){return Bi("text",t)},Li.forGenAiExperimentalTasks=function(t){return Bi("genai_experimental",t)},Li.forGenAiTasks=function(t){return Bi("genai",t)},Li.forAudioTasks=function(t){return Bi("audio",t)},Li.isSimdSupported=function(){return Pi()};function Fi(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 Ni(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 Vi(t,e,n){t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=n}function ji(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 Ci=function(t){return class extends t{M(){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:Oi()?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?'),Fi(this,r||"input_audio",(r=>{Fi(this,i=i||"audio_header",(i=>{this.h._configureAudio(r,i,t,e??0,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),Fi(this,r,(t=>{this.h._addAudioToInputStream(this.g,e,n,t,i)}))}addGpuBufferToStream(t,e,n){Fi(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){Fi(this,e,(e=>{this.h._addBoolToInputStream(t,e,n)}))}addDoubleToStream(t,e,n){Fi(this,e,(e=>{this.h._addDoubleToInputStream(t,e,n)}))}addFloatToStream(t,e,n){Fi(this,e,(e=>{this.h._addFloatToInputStream(t,e,n)}))}addIntToStream(t,e,n){Fi(this,e,(e=>{this.h._addIntToInputStream(t,e,n)}))}addUintToStream(t,e,n){Fi(this,e,(e=>{this.h._addUintToInputStream(t,e,n)}))}addStringToStream(t,e,n){Fi(this,e,(e=>{Fi(this,t,(t=>{this.h._addStringToInputStream(t,e,n)}))}))}addStringRecordToStream(t,e,n){Fi(this,e,(e=>{Ni(this,Object.keys(t),(r=>{Ni(this,Object.values(t),(i=>{this.h._addFlatHashMapToInputStream(r,i,Object.keys(t).length,e,n)}))}))}))}addProtoToStream(t,e,n,r){Fi(this,n,(n=>{Fi(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){Fi(this,t,(t=>{this.h._addEmptyPacketToInputStream(t,e)}))}addBoolVectorToStream(t,e,n){Fi(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){Fi(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){Fi(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){Fi(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){Fi(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){Fi(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)Fi(this,e,(t=>{this.h._addStringVectorEntry(r,t)}));this.h._addStringVectorToInputStream(r,e,n)}))}addBoolToInputSidePacket(t,e){Fi(this,e,(e=>{this.h._addBoolToInputSidePacket(t,e)}))}addDoubleToInputSidePacket(t,e){Fi(this,e,(e=>{this.h._addDoubleToInputSidePacket(t,e)}))}addFloatToInputSidePacket(t,e){Fi(this,e,(e=>{this.h._addFloatToInputSidePacket(t,e)}))}addIntToInputSidePacket(t,e){Fi(this,e,(e=>{this.h._addIntToInputSidePacket(t,e)}))}addUintToInputSidePacket(t,e){Fi(this,e,(e=>{this.h._addUintToInputSidePacket(t,e)}))}addStringToInputSidePacket(t,e){Fi(this,e,(e=>{Fi(this,t,(t=>{this.h._addStringToInputSidePacket(t,e)}))}))}addProtoToInputSidePacket(t,e,n){Fi(this,n,(n=>{Fi(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){Fi(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){Fi(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){Fi(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){Fi(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){Fi(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){Fi(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)Fi(this,e,(t=>{this.h._addStringVectorEntry(n,t)}));this.h._addStringVectorToInputSidePacket(n,e)}))}attachBoolListener(t,e){Vi(this,t,e),Fi(this,t,(t=>{this.h._attachBoolListener(t)}))}attachBoolVectorListener(t,e){ji(this,t,e),Fi(this,t,(t=>{this.h._attachBoolVectorListener(t)}))}attachIntListener(t,e){Vi(this,t,e),Fi(this,t,(t=>{this.h._attachIntListener(t)}))}attachIntVectorListener(t,e){ji(this,t,e),Fi(this,t,(t=>{this.h._attachIntVectorListener(t)}))}attachUintListener(t,e){Vi(this,t,e),Fi(this,t,(t=>{this.h._attachUintListener(t)}))}attachUintVectorListener(t,e){ji(this,t,e),Fi(this,t,(t=>{this.h._attachUintVectorListener(t)}))}attachDoubleListener(t,e){Vi(this,t,e),Fi(this,t,(t=>{this.h._attachDoubleListener(t)}))}attachDoubleVectorListener(t,e){ji(this,t,e),Fi(this,t,(t=>{this.h._attachDoubleVectorListener(t)}))}attachFloatListener(t,e){Vi(this,t,e),Fi(this,t,(t=>{this.h._attachFloatListener(t)}))}attachFloatVectorListener(t,e){ji(this,t,e),Fi(this,t,(t=>{this.h._attachFloatVectorListener(t)}))}attachStringListener(t,e){Vi(this,t,e),Fi(this,t,(t=>{this.h._attachStringListener(t)}))}attachStringVectorListener(t,e){ji(this,t,e),Fi(this,t,(t=>{this.h._attachStringVectorListener(t)}))}attachProtoListener(t,e,n){Vi(this,t,e),Fi(this,t,(t=>{this.h._attachProtoListener(t,n||!1)}))}attachProtoVectorListener(t,e,n){ji(this,t,e),Fi(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?'),Vi(this,t,((t,n)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,n)})),Fi(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 Mi=class extends Ci{};async function Gi(t,e,n){return t=await(async(t,e,n,r)=>{if(e&&await ki(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(n&&(await ki(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 Di(t,e,n){return Gi(t,e,n)}function $i(t,e){const n=Oe(t.baseOptions,mi,1)||new mi;"string"==typeof e?(me(n,2,Yt(e)),me(n,1)):e instanceof Uint8Array&&(me(n,1,lt(e,!1)),me(n,2)),Ne(t.baseOptions,0,1,n)}function zi(t,e){const n=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Oe(t.baseOptions,mi,1)?.g()||Oe(t.baseOptions,mi,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=Oe(t.baseOptions,gi,3);if(!n){var r=n=new gi;Ve(r,4,new $r)}"delegate"in e&&("GPU"===e.delegate?Ve(e=n,2,r=new Mr):Ve(e=n,4,r=new $r)),Ne(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),$i(t,"/model.dat"),t.u()}));if(n.modelAssetBuffer instanceof Uint8Array)$i(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=>{$i(t,e),t.u()}));return t.u(),Promise.resolve()}function Ri(t){try{const e=t.m.length;if(1===e)throw Error(t.m[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.m.map((t=>t.message)).join(", "))}finally{t.m=[]}}function Wi(t,e){t.j=Math.max(t.j,e)}var Hi=class{constructor(t){this.g=t,this.m=[],this.j=0,this.g.setAutoRenderToScreen(!1)}setGraph(t,e){this.g.attachErrorListener(((t,e)=>{this.m.push(Error(e))})),this.g.M(),this.g.setGraph(t,e),Ri(this)}finishProcessing(){this.g.finishProcessing(),Ri(this)}close(){this.g.closeGraph()}};Hi.prototype.close=Hi.prototype.close;var qi=class extends Hi{constructor(t,e){super(new Mi(t,e)),this.s={languages:[]},Ne(t=this.i=new vi,0,1,e=new yi)}o(t){return Ne(this.i,0,2,Ai(t,Oe(this.i,hi,2))),zi(this,t)}get baseOptions(){return Oe(this.i,yi,1)}set baseOptions(t){Ne(this.i,0,1,t)}J(t){return this.s={languages:[]},this.g.addStringToStream(t,"text_in",this.j+1),this.finishProcessing(),this.s}u(){var t=new ei;Zr(t),Me(t,15,"classifications_out");const e=new Wr;cn(e,wi,this.i);const n=new Xr;Ee(n,Yt("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),Kr(n),Me(n,4,"CLASSIFICATIONS:classifications_out"),n.o(e),Ge(t,n),this.g.attachProtoListener("classifications_out",((t,e)=>{if(({classifications:t}=Ei(oi(t))),1!==t.length)throw Error(`Expected 1 classification head, got ${t.length}`);this.s.languages=t[0].categories.map((t=>({languageCode:t.categoryName,probability:t.score}))),Wi(this,e)})),this.g.attachEmptyPacketListener("classifications_out",(t=>{Wi(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};qi.prototype.detect=qi.prototype.J,qi.prototype.setOptions=qi.prototype.o,qi.createFromModelPath=function(t,e){return Di(qi,t,{baseOptions:{modelAssetPath:e}})},qi.createFromModelBuffer=function(t,e){return Di(qi,t,{baseOptions:{modelAssetBuffer:e}})},qi.createFromOptions=function(t,e){return Di(qi,t,e)};var Ki=class extends Hi{constructor(t,e){super(new Mi(t,e)),this.s={classifications:[]},Ne(t=this.i=new vi,0,1,e=new yi)}o(t){return Ne(this.i,0,2,Ai(t,Oe(this.i,hi,2))),zi(this,t)}get baseOptions(){return Oe(this.i,yi,1)}set baseOptions(t){Ne(this.i,0,1,t)}I(t){return this.s={classifications:[]},this.g.addStringToStream(t,"text_in",this.j+1),this.finishProcessing(),this.s}u(){var t=new ei;Zr(t),Me(t,15,"classifications_out");const e=new Wr;cn(e,wi,this.i);const n=new Xr;Ee(n,Yt("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),Kr(n),Me(n,4,"CLASSIFICATIONS:classifications_out"),n.o(e),Ge(t,n),this.g.attachProtoListener("classifications_out",((t,e)=>{this.s=Ei(oi(t)),Wi(this,e)})),this.g.attachEmptyPacketListener("classifications_out",(t=>{Wi(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Ki.prototype.classify=Ki.prototype.I,Ki.prototype.setOptions=Ki.prototype.o,Ki.createFromModelPath=function(t,e){return Di(Ki,t,{baseOptions:{modelAssetPath:e}})},Ki.createFromModelBuffer=function(t,e){return Di(Ki,t,{baseOptions:{modelAssetBuffer:e}})},Ki.createFromOptions=function(t,e){return Di(Ki,t,e)};var Xi=class extends Hi{constructor(t,e){super(new Mi(t,e)),this.s={embeddings:[]},Ne(t=this.i=new _i,0,1,e=new yi)}o(t){var e=this.i,n=Oe(this.i,fi,2);return n=n?he(n):new fi,void 0!==t.l2Normalize?me(n,1,Dt(t.l2Normalize)):"l2Normalize"in t&&me(n,1),void 0!==t.quantize?me(n,2,Dt(t.quantize)):"quantize"in t&&me(n,2),Ne(e,0,2,n),zi(this,t)}get baseOptions(){return Oe(this.i,yi,1)}set baseOptions(t){Ne(this.i,0,1,t)}K(t){return this.g.addStringToStream(t,"text_in",this.j+1),this.finishProcessing(),this.s}u(){var t=new ei;Zr(t),Me(t,15,"embeddings_out");const e=new Wr;cn(e,Si,this.i);const n=new Xr;Ee(n,Yt("mediapipe.tasks.text.text_embedder.TextEmbedderGraph")),Kr(n),Me(n,4,"EMBEDDINGS:embeddings_out"),n.o(e),Ge(t,n),this.g.attachProtoListener("embeddings_out",((t,e)=>{t=li(t),this.s=function(t){return{embeddings:Fe(t,ui).map((t=>{const e={headIndex:Rt(ge(t,3))??0??-1,headName:Qt(ge(t,4))??""??""};if(void 0!==Le(t,si,Te(t,1)))e.floatEmbedding=ve(Oe(t,si,Te(t,1)),1,Gt,void 0===gt?2:4).slice();else{const n=new Uint8Array(0);e.quantizedEmbedding=Oe(t,ai,Te(t,2))?.H()?.i()??n}return e})),timestampMs:Kt(ge(t,2))??0}}(t),Wi(this,e)})),this.g.attachEmptyPacketListener("embeddings_out",(t=>{Wi(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Xi.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=Ti(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=Ti(Ii(t.quantizedEmbedding),Ii(e.quantizedEmbedding))}return t},Xi.prototype.embed=Xi.prototype.K,Xi.prototype.setOptions=Xi.prototype.o,Xi.createFromModelPath=function(t,e){return Di(Xi,t,{baseOptions:{modelAssetPath:e}})},Xi.createFromModelBuffer=function(t,e){return Di(Xi,t,{baseOptions:{modelAssetBuffer:e}})},Xi.createFromOptions=function(t,e){return Di(Xi,t,e)},exports.FilesetResolver=Li,exports.LanguageDetector=qi,exports.TaskRunner=Hi,exports.TextClassifier=Ki,exports.TextEmbedder=Xi;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t="undefined"!=typeof self?self:{};function n(n,e){t:{for(var r=["CLOSURE_FLAGS"],i=t,o=0;o<r.length;o++)if(null==(i=i[r[o]])){r=null;break t}r=i}return null!=(n=r&&r[n])?n:e}function e(){throw Error("Invalid UTF8")}function r(t,n){return n=String.fromCharCode.apply(null,n),null==t?n:t+n}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 e=0;const r=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var n=t.charCodeAt(i);if(n<128)r[e++]=n;else{if(n<2048)r[e++]=n>>6|192;else{if(n>=55296&&n<=57343){if(n<=56319&&i<t.length){const o=t.charCodeAt(++i);if(o>=56320&&o<=57343){n=1024*(n-55296)+o-56320+65536,r[e++]=n>>18|240,r[e++]=n>>12&63|128,r[e++]=n>>6&63|128,r[e++]=63&n|128;continue}i--}n=65533}r[e++]=n>>12|224,r[e++]=n>>6&63|128}r[e++]=63&n|128}}t=e===r.length?r:r.subarray(0,e)}return t}var l,h=n(610401301,!1),f=n(748402147,!0),d=n(824648567,!0),g=n(824656860,n(1,!0));function p(){var n=t.navigator;return n&&(n=n.userAgent)?n:""}const m=t.navigator;function v(t){return v[" "](t),t}l=m&&m.userAgentData||null,v[" "]=function(){};const y={};let b=null;function w(t){const n=t.length;let e=3*n/4;e%3?e=Math.floor(e):-1!="=.".indexOf(t[n-1])&&(e=-1!="=.".indexOf(t[n-2])?e-2:e-1);const r=new Uint8Array(e);let i=0;return function(t,n){function e(n){for(;r<t.length;){const n=t.charAt(r++),e=b[n];if(null!=e)return e;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return n}_();let r=0;for(;;){const t=e(-1),r=e(0),i=e(64),o=e(64);if(64===o&&-1===t)break;n(t<<2|r>>4),64!=i&&(n(r<<4&240|i>>2),64!=o&&n(i<<6&192|o))}}(t,(function(t){r[i++]=t})),i!==e?r.subarray(0,i):r}function _(){if(!b){b={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),n=["+/=","+/","-_=","-_.","-_"];for(let e=0;e<5;e++){const r=t.concat(n[e].split(""));y[e]=r;for(let t=0;t<r.length;t++){const n=r[t];void 0===b[n]&&(b[n]=t)}}}}var S="undefined"!=typeof Uint8Array,A=!(!(h&&l&&l.brands.length>0)&&(-1!=p().indexOf("Trident")||-1!=p().indexOf("MSIE")))&&"function"==typeof btoa;const E=/[-_.]/g,I={"-":"+",_:"/",".":"="};function T(t){return I[t]||""}function B(t){if(!A)return w(t);t=E.test(t)?t.replace(E,T):t,t=atob(t);const n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}var x={};function P(){return L||=new O(null,x)}function U(t){j(x);var n=t.g;return null==(n=null==n||S&&null!=n&&n instanceof Uint8Array?n:"string"==typeof n?B(n):null)?n:t.g=n}var O=class{i(){return new Uint8Array(U(this)||0)}constructor(t,n){if(j(n),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};let L,N;function j(t){if(t!==x)throw Error("illegal external caller")}function k(t,n){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=n}function V(){const t=Error("int32");return k(t,"warning"),t}function F(n,e){if(null!=n){var r=N??={},i=r[n]||0;i>=e||(r[n]=i+1,k(n=Error(),"incident"),function(n){t.setTimeout((()=>{throw n}),0)}(n))}}function C(){return"function"==typeof BigInt}var G="function"==typeof Symbol&&"symbol"==typeof Symbol();function M(t,n,e=!1){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?e&&Symbol.for&&t?Symbol.for(t):null!=t?Symbol(t):Symbol():n}var D=M("jas",void 0,!0),R=M(void 0,"1oa"),z=M(void 0,Symbol()),W=M(void 0,"0ubs"),$=M(void 0,"0ubsb"),H=M(void 0,"0actk"),q=M("m_m","R",!0);const K={M:{value:0,configurable:!0,writable:!0,enumerable:!1}},X=Object.defineProperties,J=G?D:"M";var Y;const Q=[];function Z(t,n){G||J in t||X(t,K),t[J]|=n}function tt(t,n){G||J in t||X(t,K),t[J]=n}tt(Q,7),Y=Object.freeze(Q);var nt={};function et(t,n){return void 0===n?t.g!==rt&&!!(2&(0|t.l[J])):!!(2&n)&&t.g!==rt}const rt={};function it(t,n){if(null!=t)if("string"==typeof t)t=t?new O(t,x):P();else if(t.constructor!==O)if(S&&null!=t&&t instanceof Uint8Array)t=t.length?new O(new Uint8Array(t),x):P();else{if(!n)throw Error();t=void 0}return t}var ot=Object.freeze({});function st(t,n,e){const r=128&n?0:-1,i=t.length;var o;(o=!!i)&&(o=null!=(o=t[i-1])&&"object"==typeof o&&o.constructor===Object);const s=i+(o?-1:0);for(n=128&n?1:0;n<s;n++)e(n-r,t[n]);if(o){t=t[i-1];for(const n in t)!isNaN(n)&&e(+n,t[n])}}var at={};function ut(t){return 128&t?at:void 0}function ct(t){return t.O=!0,t}var lt=ct((t=>"number"==typeof t)),ht=ct((t=>"string"==typeof t)),ft=ct((t=>"boolean"==typeof t)),dt="function"==typeof t.BigInt&&"bigint"==typeof t.BigInt(0);function gt(t){var n=t;if(ht(n)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(n))throw Error(String(n))}else if(lt(n)&&!Number.isSafeInteger(n))throw Error(String(n));return dt?BigInt(t):t=ft(t)?t?"1":"0":ht(t)?t.trim()||"0":String(t)}var pt=ct((t=>dt?t>=vt&&t<=bt:"-"===t[0]?wt(t,mt):wt(t,yt)));const mt=Number.MIN_SAFE_INTEGER.toString(),vt=dt?BigInt(Number.MIN_SAFE_INTEGER):void 0,yt=Number.MAX_SAFE_INTEGER.toString(),bt=dt?BigInt(Number.MAX_SAFE_INTEGER):void 0;function wt(t,n){if(t.length>n.length)return!1;if(t.length<n.length||t===n)return!0;for(let e=0;e<t.length;e++){const r=t[e],i=n[e];if(r>i)return!1;if(r<i)return!0}}const _t="function"==typeof Uint8Array.prototype.slice;let St,At=0,Et=0;function It(t){const n=t>>>0;At=n,Et=(t-n)/4294967296>>>0}function Tt(t){if(t<0){It(-t);const[n,e]=Vt(At,Et);At=n>>>0,Et=e>>>0}else It(t)}function Bt(t){const n=St||=new DataView(new ArrayBuffer(8));n.setFloat32(0,+t,!0),Et=0,At=n.getUint32(0,!0)}function xt(t,n){const e=4294967296*n+(t>>>0);return Number.isSafeInteger(e)?e:Lt(t,n)}function Pt(t,n){return gt(C()?BigInt.asUintN(64,(BigInt(n>>>0)<<BigInt(32))+BigInt(t>>>0)):Lt(t,n))}function Ut(t,n){const e=2147483648&n;return e&&(n=~n>>>0,0==(t=1+~t>>>0)&&(n=n+1>>>0)),"number"==typeof(t=xt(t,n))?e?-t:t:e?"-"+t:t}function Ot(t,n){return C()?gt(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(n))<<BigInt(32))+BigInt.asUintN(32,BigInt(t)))):gt(jt(t,n))}function Lt(t,n){if(t>>>=0,(n>>>=0)<=2097151)var e=""+(4294967296*n+t);else C()?e=""+(BigInt(n)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(e=16777215&(t>>>24|n<<8))+6710656*(n=n>>16&65535),e+=8147497*n,n*=2,t>=1e7&&(e+=t/1e7>>>0,t%=1e7),e>=1e7&&(n+=e/1e7>>>0,e%=1e7),e=n+Nt(e)+Nt(t));return e}function Nt(t){return t=String(t),"0000000".slice(t.length)+t}function jt(t,n){if(2147483648&n)if(C())t=""+(BigInt(0|n)<<BigInt(32)|BigInt(t>>>0));else{const[e,r]=Vt(t,n);t="-"+Lt(e,r)}else t=Lt(t,n);return t}function kt(t){if(t.length<16)Tt(Number(t));else if(C())t=BigInt(t),At=Number(t&BigInt(4294967295))>>>0,Et=Number(t>>BigInt(32)&BigInt(4294967295));else{const n=+("-"===t[0]);Et=At=0;const e=t.length;for(let r=n,i=(e-n)%6+n;i<=e;r=i,i+=6){const n=Number(t.slice(r,i));Et*=1e6,At=1e6*At+n,At>=4294967296&&(Et+=Math.trunc(At/4294967296),Et>>>=0,At>>>=0)}if(n){const[t,n]=Vt(At,Et);At=t,Et=n}}}function Vt(t,n){return n=~n,t?t=1+~t:n+=1,[t,n]}function Ft(t){return Array.prototype.slice.call(t)}const Ct="function"==typeof BigInt?BigInt.asIntN:void 0,Gt="function"==typeof BigInt?BigInt.asUintN:void 0,Mt=Number.isSafeInteger,Dt=Number.isFinite,Rt=Math.trunc;function zt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function Wt(t){if(null!=t&&"boolean"!=typeof t){var n=typeof t;throw Error(`Expected boolean but got ${"object"!=n?n:t?Array.isArray(t)?"array":n:"null"}: ${t}`)}return t}const $t=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Ht(t){switch(typeof t){case"bigint":return!0;case"number":return Dt(t);case"string":return $t.test(t);default:return!1}}function qt(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Dt(t)?0|t:void 0}function Kt(t){const n=t.length;return("-"===t[0]?n<20||20===n&&t<="-9223372036854775808":n<19||19===n&&t<="9223372036854775807")?t:(kt(t),jt(At,Et))}function Xt(t){return t=Rt(t),Mt(t)||(Tt(t),t=Ut(At,Et)),t}function Jt(t){var n=Rt(Number(t));return Mt(n)?String(n):(-1!==(n=t.indexOf("."))&&(t=t.substring(0,n)),Kt(t))}function Yt(t){return null==t?t:"bigint"==typeof t?(pt(t)?t=Number(t):(t=Ct(64,t),t=pt(t)?Number(t):String(t)),t):Ht(t)?"number"==typeof t?Xt(t):Jt(t):void 0}function Qt(t){var n=typeof t;return null==t?t:"bigint"===n?gt(Ct(64,t)):Ht(t)?("string"===n?(n=Rt(Number(t)),Mt(n)?t=gt(n):(-1!==(n=t.indexOf("."))&&(t=t.substring(0,n)),t=C()?gt(Ct(64,BigInt(t))):gt(Kt(t)))):Mt(t)?t=gt(Xt(t)):(t=Rt(t),Mt(t)?t=String(t):(Tt(t),t=jt(At,Et)),t=gt(t)),t):void 0}function Zt(t){if("string"!=typeof t)throw Error();return t}function tn(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function nn(t){return null==t||"string"==typeof t?t:void 0}function en(t,n,e){if(null!=t&&t[q]===nt)return t;if(Array.isArray(t)){var r=0|t[J];return(e=r|32&e|2&e)!==r&&tt(t,e),new n(t)}}function rn(t){return z?t[z]:void 0}function on(t,n){for(const e in t)!isNaN(e)&&n(t,+e,t[e])}var sn=class{};function an(t,n){n<100||F(W,1)}function un(t,n,e,r){const i=void 0!==r;r=!!r;var o,s=z;!i&&G&&s&&(o=t[s])&&on(o,an),s=[];var a=t.length;let u;o=4294967295;let c=!1;const l=!!(64&n),h=l?128&n?0:-1:void 0;1&n||(u=a&&t[a-1],null!=u&&"object"==typeof u&&u.constructor===Object?o=--a:u=void 0,!l||128&n||i||(c=!0,o=o-h+h)),n=void 0;for(var f=0;f<a;f++){let i=t[f];if(null!=i&&null!=(i=e(i,r)))if(l&&f>=o){const t=f-h;(n??={})[t]=i}else s[f]=i}if(u)for(let t in u){if(null==(a=u[t])||null==(a=e(a,r)))continue;let i;f=+t,l&&!Number.isNaN(f)&&(i=f+h)<o?s[i]=a:(n??={})[t]=a}return n&&(c?s.push(n):s[o]=n),i&&z&&(t=rn(t))&&t instanceof sn&&(s[z]=function(t){const n=new sn;return on(t,((t,e,r)=>{n[e]=Ft(r)})),n.g=t.g,n}(t)),s}function cn(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return pt(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(Array.isArray(t)){var n=0|t[J];return 0===t.length&&1&n?void 0:un(t,n,cn)}if(null!=t&&t[q]===nt)return ln(t);if(t instanceof O){if(null==(n=t.g))t="";else if("string"==typeof n)t=n;else{if(A){for(var e="",r=0,i=n.length-10240;r<i;)e+=String.fromCharCode.apply(null,n.subarray(r,r+=10240));e+=String.fromCharCode.apply(null,r?n.subarray(r):n),n=btoa(e)}else{void 0===e&&(e=0),_(),e=y[e],r=Array(Math.floor(n.length/3)),i=e[64]||"";let t=0,c=0;for(;t<n.length-2;t+=3){var o=n[t],s=n[t+1],a=n[t+2],u=e[o>>2];o=e[(3&o)<<4|s>>4],s=e[(15&s)<<2|a>>6],a=e[63&a],r[c++]=u+o+s+a}switch(u=0,a=i,n.length-t){case 2:a=e[(15&(u=n[t+1]))<<2]||i;case 1:n=n[t],r[c]=e[n>>2]+e[(3&n)<<4|u>>4]+a+i}n=r.join("")}t=t.g=n}return t}return}return t}function ln(t){return un(t=t.l,0|t[J],cn)}let hn,fn;function dn(t,n){return gn(t,n[0],n[1])}function gn(t,n,e,r=0){if(null==t){var i=32;e?(t=[e],i|=128):t=[],n&&(i=-16760833&i|(1023&n)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(i=0|t[J],f&&1&i)throw Error("rfarr");if(2048&i&&!(2&i)&&function(){if(f)throw Error("carr");F(H,5)}(),256&i)throw Error("farr");if(64&i)return(i|r)!==i&&tt(t,i|r),t;if(e&&(i|=128,e!==t[0]))throw Error("mid");t:{i|=64;var o=(e=t).length;if(o){var s=o-1;const t=e[s];if(null!=t&&"object"==typeof t&&t.constructor===Object){if((s-=n=128&i?0:-1)>=1024)throw Error("pvtlmt");for(var a in t)(o=+a)<s&&(e[o+n]=t[a],delete t[a]);i=-16760833&i|(1023&s)<<14;break t}}if(n){if((a=Math.max(n,o-(128&i?0:-1)))>1024)throw Error("spvt");i=-16760833&i|(1023&a)<<14}}}return tt(t,64|i|r),t}function pn(t,n){if("object"!=typeof t)return t;if(Array.isArray(t)){var e=0|t[J];return 0===t.length&&1&e?t=void 0:2&e||(!n||4096&e||16&e?t=yn(t,e,!1,n&&!(16&e)):(Z(t,34),4&e&&Object.freeze(t))),t}return null!=t&&t[q]===nt?et(t,e=0|(n=t.l)[J])?t:An(t,n,e)?mn(t,n):yn(n,e):t instanceof O?t:void 0}function mn(t,n,e){return t=new t.constructor(n),e&&(t.g=rt),t.m=rt,t}function vn(t){const n=t.l,e=0|n[J];return An(t,n,e)?mn(t,n,!0):new t.constructor(yn(n,e,!1))}function yn(t,n,e,r){return r??=!!(34&n),t=un(t,n,pn,r),r=32,e&&(r|=2),tt(t,n=16769217&n|r),t}function bn(t){const n=t.l,e=0|n[J];return et(t,e)?An(t,n,e)?mn(t,n,!0):new t.constructor(yn(n,e,!1)):t}function wn(t){if(t.g!==rt)return!1;var n=t.l;return Z(n=yn(n,0|n[J]),2048),t.l=n,t.g=void 0,t.m=void 0,!0}function _n(t){if(!wn(t)&&et(t,0|t.l[J]))throw Error()}function Sn(t,n){void 0===n&&(n=0|t[J]),32&n&&!(4096&n)&&tt(t,4096|n)}function An(t,n,e){return!!(2&e)||!(!(32&e)||4096&e)&&(tt(n,2|e),t.g=rt,!0)}const En=gt(0);function In(t,n,e,r){if(null!==(t=Tn(t.l,n,e,r)))return t}function Tn(t,n,e,r){if(-1===n)return null;const i=n+(e?0:-1),o=t.length-1;let s,a;if(!(o<1+(e?0:-1))){if(i>=o)if(s=t[o],null!=s&&"object"==typeof s&&s.constructor===Object)e=s[n],a=!0;else{if(i!==o)return;e=s}else e=t[i];if(r&&null!=e){if(null==(r=r(e)))return r;if(!Object.is(r,e))return a?s[n]=r:t[i]=r,r}return e}}function Bn(t,n,e,r){_n(t),xn(t=t.l,0|t[J],n,e,r)}function xn(t,n,e,r,i){const o=e+(i?0:-1);var s=t.length-1;if(s>=1+(i?0:-1)&&o>=s){const i=t[s];if(null!=i&&"object"==typeof i&&i.constructor===Object)return i[e]=r,n}return o<=s?(t[o]=r,n):(void 0!==r&&(e>=(s=(n??=0|t[J])>>14&1023||536870912)?null!=r&&(t[s+(i?0:-1)]={[e]:r}):t[o]=r),n)}function Pn(t,n,e,r,i){let o=t.l,s=0|o[J];r=et(t,s)?1:r,i=!!i||3===r,2===r&&wn(t)&&(o=t.l,s=0|o[J]);let a=(t=On(o,n))===Y?7:0|t[J],u=Ln(a,s);var c=!(4&u);if(c){4&u&&(t=Ft(t),a=0,u=Jn(u,s),s=xn(o,s,n,t));let r=0,i=0;for(;r<t.length;r++){const n=e(t[r]);null!=n&&(t[i++]=n)}i<r&&(t.length=i),e=-513&(4|u),u=e&=-1025,u&=-4097}return u!==a&&(tt(t,u),2&u&&Object.freeze(t)),Un(t,u,o,s,n,r,c,i)}function Un(t,n,e,r,i,o,s,a){let u=n;return 1===o||4===o&&(2&n||!(16&n)&&32&r)?Nn(n)||((n|=!t.length||s&&!(4096&n)||32&r&&!(4096&n||16&n)?2:256)!==u&&tt(t,n),Object.freeze(t)):(2===o&&Nn(n)&&(t=Ft(t),u=0,n=Jn(n,r),r=xn(e,r,i,t)),Nn(n)||(a||(n|=16),n!==u&&tt(t,n))),2&n||!(4096&n||16&n)||Sn(e,r),t}function On(t,n,e){return t=Tn(t,n,e),Array.isArray(t)?t:Y}function Ln(t,n){return 2&n&&(t|=2),1|t}function Nn(t){return!!(2&t)&&!!(4&t)||!!(256&t)}function jn(t){return it(t,!0)}function kn(t,n,e){_n(t);let r=0|(t=t.l)[J];if(null==e)xn(t,r,n);else{var i=e===Y?7:0|e[J],o=i,s=Nn(i),a=s||Object.isFrozen(e);for(s||(i=0),a||(e=Ft(e),o=0,i=Jn(i,r),a=!1),i|=5,i|=(4&i?512&i?512:1024&i?1024:0:void 0)??(g?1024:0),s=0;s<e.length;s++){const t=e[s],n=Zt(t);Object.is(t,n)||(a&&(e=Ft(e),o=0,i=Jn(i,r),a=!1),e[s]=n)}i!==o&&(a&&(e=Ft(e),i=Jn(i,r)),tt(e,i)),xn(t,r,n,e)}}function Vn(t,n){_n(t),xn(t=t.l,0|t[J],2,""===n?void 0:n)}function Fn(t,n,e){if(2&n)throw Error();const r=ut(n);let i=On(t,e,r),o=i===Y?7:0|i[J],s=Ln(o,n);return(2&s||Nn(s)||16&s)&&(s===o||Nn(s)||tt(i,s),i=Ft(i),o=0,s=Jn(s,n),xn(t,n,e,i,r)),s&=-13,s!==o&&tt(i,s),i}function Cn(t,n){var e=Bi;return Dn(Gn(t=t.l),t,void 0,e)===n?n:-1}function Gn(t){if(G)return t[R]??(t[R]=new Map);if(R in t)return t[R];const n=new Map;return Object.defineProperty(t,R,{value:n}),n}function Mn(t,n,e,r,i){const o=Gn(t),s=Dn(o,t,n,e,i);return s!==r&&(s&&(n=xn(t,n,s,void 0,i)),o.set(e,r)),n}function Dn(t,n,e,r,i){let o=t.get(r);if(null!=o)return o;o=0;for(let t=0;t<r.length;t++){const s=r[t];null!=Tn(n,s,i)&&(0!==o&&(e=xn(n,e,o,void 0,i)),o=s)}return t.set(r,o),o}function Rn(t,n,e){let r=0|t[J];const i=ut(r),o=Tn(t,e,i);let s;if(null!=o&&o[q]===nt){if(!et(o))return wn(o),o.l;s=o.l}else Array.isArray(o)&&(s=o);if(s){const t=0|s[J];2&t&&(s=yn(s,t))}return s=dn(s,n),s!==o&&xn(t,r,e,s,i),s}function zn(t,n,e,r){let i=!1;if(null!=(r=Tn(t,r,void 0,(t=>{const r=en(t,e,n);return i=r!==t&&null!=r,r}))))return i&&!et(r)&&Sn(t,n),r}function Wn(t,n,e){let r=t.l,i=0|r[J];if(null==(n=zn(r,i,n,e)))return n;if(i=0|r[J],!et(t,i)){const o=bn(n);o!==n&&(wn(t)&&(r=t.l,i=0|r[J]),i=xn(r,i,e,n=o),Sn(r,i))}return n}function $n(t,n,e,r,i,o,s){var a=et(t,e);i=a?1:i,o=!!o||3===i,a=s&&!a,(2===i||a)&&wn(t)&&(e=0|(n=t.l)[J]);var u=(t=On(n,1))===Y?7:0|t[J],c=Ln(u,e);if(s=!(4&c)){var l=t,h=e;const n=!!(2&c);n&&(h|=2);let i=!n,o=!0,s=0,a=0;for(;s<l.length;s++){const t=en(l[s],r,h);if(t instanceof r){if(!n){const n=et(t);i&&=!n,o&&=n}l[a++]=t}}a<s&&(l.length=a),c|=4,c=o?-4097&c:4096|c,c=i?8|c:-9&c}if(c!==u&&(tt(t,c),2&c&&Object.freeze(t)),a&&!(8&c||!t.length&&(1===i||4===i&&(2&c||!(16&c)&&32&e)))){for(Nn(c)&&(t=Ft(t),c=Jn(c,e),e=xn(n,e,1,t)),r=t,a=c,u=0;u<r.length;u++)(l=r[u])!==(c=bn(l))&&(r[u]=c);a|=8,tt(t,c=a=r.length?4096|a:-4097&a)}return Un(t,c,n,e,1,i,s,o)}function Hn(t,n){const e=t.l;return $n(t,e,0|e[J],n,void 0===ot?2:4,!1,!0)}function qn(t){return null==t&&(t=void 0),t}function Kn(t,n,e,r,i){return Bn(t,e,r=qn(r),i),r&&!et(r)&&Sn(t.l),t}function Xn(t,n,e){var r=Ni;t:{var i=e=qn(e);_n(t);const o=t.l;let s=0|o[J];if(null==i){const t=Gn(o);if(Dn(t,o,s,r)!==n)break t;t.set(r,0)}else s=Mn(o,s,r,n);xn(o,s,n,i)}e&&!et(e)&&Sn(t.l)}function Jn(t,n){return-273&(2&n?2|t:-3&t)}function Yn(t,n){var e=di;_n(t);const r=t.l;t=$n(t,r,0|r[J],e,2,!0),n=null!=n?n:new e,t.push(n);const i=e=t===Y?7:0|t[J];(n=et(n))?(e&=-9,1===t.length&&(e&=-4097)):e|=4096,e!==i&&tt(t,e),n||Sn(r)}function Qn(t){return(g?In(t,2,void 0,Qt):Qt(In(t,2)))??En}function Zn(t,n,e){_n(t),Pn(t,n,nn,2,!0).push(Zt(e))}var te=class{constructor(t,n,e){if(this.buffer=t,e&&!n)throw Error();this.g=n}};function ne(t,n){if("string"==typeof t)return new te(B(t),n);if(Array.isArray(t))return new te(new Uint8Array(t),n);if(t.constructor===Uint8Array)return new te(t,!1);if(t.constructor===ArrayBuffer)return t=new Uint8Array(t),new te(t,!1);if(t.constructor===O)return n=U(t)||new Uint8Array(0),new te(n,!0,t);if(t instanceof Uint8Array)return t=t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new te(t,!1);throw Error()}function ee(t,n){let e,r=0,i=0,o=0;const s=t.i;let a=t.g;do{e=s[a++],r|=(127&e)<<o,o+=7}while(o<32&&128&e);if(o>32)for(i|=(127&e)>>4,o=3;o<32&&128&e;o+=7)e=s[a++],i|=(127&e)<<o;if(ae(t,a),!(128&e))return n(r>>>0,i>>>0);throw Error()}function re(t){let n=0,e=t.g;const r=e+10,i=t.i;for(;e<r;){const r=i[e++];if(n|=r,0==(128&r))return ae(t,e),!!(127&n)}throw Error()}function ie(t){const n=t.i;let e=t.g,r=n[e++],i=127&r;if(128&r&&(r=n[e++],i|=(127&r)<<7,128&r&&(r=n[e++],i|=(127&r)<<14,128&r&&(r=n[e++],i|=(127&r)<<21,128&r&&(r=n[e++],i|=r<<28,128&r&&128&n[e++]&&128&n[e++]&&128&n[e++]&&128&n[e++]&&128&n[e++])))))throw Error();return ae(t,e),i}function oe(t){var n=t.i;const e=t.g;var r=n[e],i=n[e+1];const o=n[e+2];return n=n[e+3],ae(t,t.g+4),t=2*((i=(r<<0|i<<8|o<<16|n<<24)>>>0)>>31)+1,r=i>>>23&255,i&=8388607,255==r?i?NaN:t*(1/0):0==r?1401298464324817e-60*t*i:t*Math.pow(2,r-150)*(i+8388608)}function se(t){return ie(t)}function ae(t,n){if(t.g=n,n>t.j)throw Error()}function ue(t,n){if(n<0)throw Error();const e=t.g;if((n=e+n)>t.j)throw Error();return t.g=n,e}function ce(t,n){if(0==n)return P();var e=ue(t,n);return t.B&&t.v?e=t.i.subarray(e,e+n):(t=t.i,e=e===(n=e+n)?new Uint8Array(0):_t?t.slice(e,n):new Uint8Array(t.subarray(e,n))),0==e.length?P():new O(e,x)}var le=[];function he(t,n,e,r){if(we.length){const i=we.pop();return i.o(r),i.g.init(t,n,e,r),i}return new be(t,n,e,r)}function fe(t){t.g.clear(),t.j=-1,t.i=-1,we.length<100&&we.push(t)}function de(t){var n=t.g;if(n.g==n.j)return!1;t.m=t.g.g;var e=ie(t.g)>>>0;if(n=e>>>3,!((e&=7)>=0&&e<=5))throw Error();if(n<1)throw Error();return t.j=n,t.i=e,!0}function ge(t){switch(t.i){case 0:0!=t.i?ge(t):re(t.g);break;case 1:ae(t=t.g,t.g+8);break;case 2:if(2!=t.i)ge(t);else{var n=ie(t.g)>>>0;ae(t=t.g,t.g+n)}break;case 5:ae(t=t.g,t.g+4);break;case 3:for(n=t.j;;){if(!de(t))throw Error();if(4==t.i){if(t.j!=n)throw Error();break}ge(t)}break;default:throw Error()}}function pe(t,n,e){const r=t.g.j;var i=ie(t.g)>>>0;let o=(i=t.g.g+i)-r;if(o<=0&&(t.g.j=i,e(n,t,void 0,void 0,void 0),o=i-t.g.g),o)throw Error();t.g.g=i,t.g.j=r}function me(t){var n=ie(t.g)>>>0,a=ue(t=t.g,n);if(t=t.i,s){var u,c=t;(u=o)||(u=o=new TextDecoder("utf-8",{fatal:!0})),n=a+n,c=0===a&&n===c.length?c:c.subarray(a,n);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{n=(l=a)+n,a=[];let i,o=null;for(;l<n;){var h=t[l++];h<128?a.push(h):h<224?l>=n?e():(i=t[l++],h<194||128!=(192&i)?(l--,e()):a.push((31&h)<<6|63&i)):h<240?l>=n-1?e():(i=t[l++],128!=(192&i)||224===h&&i<160||237===h&&i>=160||128!=(192&(u=t[l++]))?(l--,e()):a.push((15&h)<<12|(63&i)<<6|63&u)):h<=244?l>=n-2?e():(i=t[l++],128!=(192&i)||i-144+(h<<28)>>30!=0||128!=(192&(u=t[l++]))||128!=(192&(c=t[l++]))?(l--,e()):(h=(7&h)<<18|(63&i)<<12|(63&u)<<6|63&c,h-=65536,a.push(55296+(h>>10&1023),56320+(1023&h)))):e(),a.length>=8192&&(o=r(o,a),a.length=0)}l=r(o,a)}return l}function ve(t){const n=ie(t.g)>>>0;return ce(t.g,n)}function ye(t,n,e){var r=ie(t.g)>>>0;for(r=t.g.g+r;t.g.g<r;)e.push(n(t.g))}var be=class{constructor(t,n,e,r){if(le.length){const i=le.pop();i.init(t,n,e,r),t=i}else t=new class{constructor(t,n,e,r){this.i=null,this.v=!1,this.g=this.j=this.m=0,this.init(t,n,e,r)}init(t,n,e,{B:r=!1,D:i=!1}={}){this.B=r,this.D=i,t&&(t=ne(t,this.D),this.i=t.buffer,this.v=t.g,this.m=n||0,this.j=void 0!==e?this.m+e:this.i.length,this.g=this.m)}clear(){this.i=null,this.v=!1,this.g=this.j=this.m=0,this.B=!1}}(t,n,e,r);this.g=t,this.m=this.g.g,this.i=this.j=-1,this.o(r)}o({F:t=!1}={}){this.F=t}},we=[];function _e(t){return t?/^\d+$/.test(t)?(kt(t),new Se(At,Et)):null:Ae||=new Se(0,0)}var Se=class{constructor(t,n){this.i=t>>>0,this.g=n>>>0}};let Ae;function Ee(t){return t?/^-?\d+$/.test(t)?(kt(t),new Ie(At,Et)):null:Te||=new Ie(0,0)}var Ie=class{constructor(t,n){this.i=t>>>0,this.g=n>>>0}};let Te;function Be(t,n,e){for(;e>0||n>127;)t.g.push(127&n|128),n=(n>>>7|e<<25)>>>0,e>>>=7;t.g.push(n)}function xe(t,n){for(;n>127;)t.g.push(127&n|128),n>>>=7;t.g.push(n)}function Pe(t,n){if(n>=0)xe(t,n);else{for(let e=0;e<9;e++)t.g.push(127&n|128),n>>=7;t.g.push(1)}}function Ue(t){var n=At;t.g.push(n>>>0&255),t.g.push(n>>>8&255),t.g.push(n>>>16&255),t.g.push(n>>>24&255)}function Oe(t,n){0!==n.length&&(t.j.push(n),t.i+=n.length)}function Le(t,n,e){xe(t.g,8*n+e)}function Ne(t,n){return Le(t,n,2),n=t.g.end(),Oe(t,n),n.push(t.i),n}function je(t,n){var e=n.pop();for(e=t.i+t.g.length()-e;e>127;)n.push(127&e|128),e>>>=7,t.i++;n.push(e),t.i++}function ke(t,n,e){Le(t,n,2),xe(t.g,e.length),Oe(t,t.g.end()),Oe(t,e)}function Ve(){const t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var Fe=Ve(),Ce=Ve(),Ge=Ve(),Me=Ve(),De=Ve(),Re=Ve(),ze=Ve(),We=Ve(),$e=Ve(),He=Ve();function qe(t,n,e){var r=t.l;z&&z in r&&(r=r[z])&&delete r[n.g],n.i?n.m(t,n.i,n.g,e,n.j):n.m(t,n.g,e,n.j)}var Ke=class{constructor(t,n){this.l=gn(t,n,void 0,2048)}toJSON(){return ln(this)}};Ke.prototype[q]=nt,Ke.prototype.toString=function(){return this.l.toString()};var Xe=class{constructor(t,n,e){this.g=t,this.i=n,t=Fe,this.j=!!t&&e===t||!1}};function Je(t,n){return new Xe(t,n,Fe)}function Ye(t,n,e,r,i){null!=(n=cr(n,r))&&(e=Ne(t,e),i(n,t),je(t,e))}const Qe=Je((function(t,n,e,r,i){return 2===t.i&&(pe(t,Rn(n,r,e),i),!0)}),Ye),Ze=Je((function(t,n,e,r,i){return 2===t.i&&(pe(t,Rn(n,r,e),i),!0)}),Ye);var tr=Symbol(),nr=Symbol(),er=Symbol(),rr=Symbol(),ir=Symbol();let or,sr;function ar(t,n,e,r){var i=r[t];if(i)return i;(i={}).I=r,i.A=function(t){switch(typeof t){case"boolean":return hn||=[0,void 0,!0];case"number":return t>0?void 0:0===t?fn||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(r[0]);var o=r[1];let s=1;o&&o.constructor===Object&&(i.C=o,"function"==typeof(o=r[++s])&&(i.G=!0,or??=o,sr??=r[s+1],o=r[s+=2]));const a={};for(;o&&Array.isArray(o)&&o.length&&"number"==typeof o[0]&&o[0]>0;){for(var u=0;u<o.length;u++)a[o[u]]=o;o=r[++s]}for(u=1;void 0!==o;){let t;"number"==typeof o&&(u+=o,o=r[++s]);var c=void 0;if(o instanceof Xe?t=o:(t=Qe,s--),t?.j){o=r[++s],c=r;var l=s;"function"==typeof o&&(o=o(),c[l]=o),c=o}for(l=u+1,"number"==typeof(o=r[++s])&&o<0&&(l-=o,o=r[++s]);u<l;u++){const r=a[u];c?e(i,u,t,c,r):n(i,u,t,r)}}return r[t]=i}function ur(t){return Array.isArray(t)?t[0]instanceof Xe?t:[Ze,t]:[t,void 0]}function cr(t,n){return t instanceof Ke?t.l:Array.isArray(t)?dn(t,n):void 0}function lr(t,n,e,r){const i=e.g;t[n]=r?(t,n,e)=>i(t,n,e,r):i}function hr(t,n,e,r,i){const o=e.g;let s,a;t[n]=(t,n,e)=>o(t,n,e,a||=ar(nr,lr,hr,r).A,s||=fr(r),i)}function fr(t){let n=t[er];if(null!=n)return n;const e=ar(nr,lr,hr,t);return n=e.G?(t,n)=>or(t,n,e):(t,n)=>{for(;de(n)&&4!=n.i;){var r=n.j,i=e[r];if(null==i){var o=e.C;o&&(o=o[r])&&(null!=(o=gr(o))&&(i=e[r]=o))}if(null==i||!i(n,t,r)){if(i=(o=n).m,ge(o),o.F)var s=void 0;else s=o.g.g-i,o.g.g=i,s=ce(o.g,s);i=void 0,o=t,s&&((i=o[z]??(o[z]=new sn))[r]??(i[r]=[])).push(s)}}return(t=rn(t))&&(t.g=e.I[ir]),!0},t[er]=n,t[ir]=dr.bind(t),n}function dr(t,n,e,r){var i=this[nr];const o=this[er],s=dn(void 0,i.A),a=rn(t);if(a){var u=!1,c=i.C;if(c){if(i=(n,e,i)=>{if(0!==i.length)if(c[e])for(const t of i){n=he(t);try{u=!0,o(s,n)}finally{fe(n)}}else r?.(t,e,i)},null==n)on(a,i);else if(null!=a){const t=a[n];t&&i(a,n,t)}if(u){let r=0|t[J];if(2&r&&2048&r&&!e?.T)throw Error();const i=ut(r),o=(n,o)=>{if(null!=Tn(t,n,i)){if(1===e?.S)return;throw Error()}null!=o&&(r=xn(t,r,n,o,i)),delete a[n]};null==n?st(s,0|s[J],((t,n)=>{o(t,n)})):o(n,Tn(s,n,i))}}}}function gr(t){const n=(t=ur(t))[0].g;if(t=t[1]){const e=fr(t),r=ar(nr,lr,hr,t).A;return(t,i,o)=>n(t,i,o,r,e)}return n}function pr(t,n,e){t[n]=e.i}function mr(t,n,e,r){let i,o;const s=e.i;t[n]=(t,n,e)=>s(t,n,e,o||=ar(tr,pr,mr,r).A,i||=vr(r))}function vr(t){let n=t[rr];if(!n){const e=ar(tr,pr,mr,t);n=(t,n)=>yr(t,n,e),t[rr]=n}return n}function yr(t,n,e){st(t,0|t[J],((t,r)=>{if(null!=r){var i=function(t,n){var e=t[n];if(e)return e;if((e=t.C)&&(e=e[n])){var r=(e=ur(e))[0].i;if(e=e[1]){const n=vr(e),i=ar(tr,pr,mr,e).A;e=t.G?sr(i,n):(t,e,o)=>r(t,e,o,i,n)}else e=r;return t[n]=e}}(e,t);i?i(n,r,t):t<500||F($,3)}})),(t=rn(t))&&on(t,((t,e,r)=>{for(Oe(n,n.g.end()),t=0;t<r.length;t++)Oe(n,U(r[t])||new Uint8Array(0))}))}const br=gt(0);function wr(t,n){if(Array.isArray(n)){var e=0|n[J];if(4&e)return n;for(var r=0,i=0;r<n.length;r++){const e=t(n[r]);null!=e&&(n[i++]=e)}return i<r&&(n.length=i),(t=-1537&(5|e))!==e&&tt(n,t),2&t&&Object.freeze(n),n}}function _r(t,n,e){return new Xe(t,n,e)}function Sr(t,n,e){return new Xe(t,n,e)}function Ar(t,n,e){xn(t,0|t[J],n,e,ut(0|t[J]))}function Er(t,n,e){if(n=function(t){if(null==t)return t;const n=typeof t;if("bigint"===n)return String(Ct(64,t));if(Ht(t)){if("string"===n)return Jt(t);if("number"===n)return Xt(t)}}(n),null!=n){if("string"==typeof n)Ee(n);if(null!=n)switch(Le(t,e,0),typeof n){case"number":t=t.g,Tt(n),Be(t,At,Et);break;case"bigint":e=BigInt.asUintN(64,n),e=new Ie(Number(e&BigInt(4294967295)),Number(e>>BigInt(32))),Be(t.g,e.i,e.g);break;default:e=Ee(n),Be(t.g,e.i,e.g)}}}function Ir(t,n,e){null!=(n=qt(n))&&null!=n&&(Le(t,e,0),Pe(t.g,n))}function Tr(t,n,e){null!=(n=null==n||"boolean"==typeof n?n:"number"==typeof n?!!n:void 0)&&(Le(t,e,0),t.g.g.push(n?1:0))}function Br(t,n,e){null!=(n=nn(n))&&ke(t,e,c(n))}function xr(t,n,e,r,i){null!=(n=cr(n,r))&&(e=Ne(t,e),i(n,t),je(t,e))}function Pr(t,n,e){null!=(n=null==n||"string"==typeof n||n instanceof O?n:void 0)&&ke(t,e,ne(n,!0).buffer)}var Ur=_r((function(t,n,e){return 5===t.i&&(Ar(n,e,oe(t.g)),!0)}),(function(t,n,e){null!=(n=zt(n))&&(Le(t,e,5),t=t.g,Bt(n),Ue(t))}),We),Or=Sr((function(t,n,e){return(5===t.i||2===t.i)&&(n=Fn(n,0|n[J],e),2==t.i?ye(t,oe,n):n.push(oe(t.g)),!0)}),(function(t,n,e){if(null!=(n=wr(zt,n))&&n.length){Le(t,e,2),xe(t.g,4*n.length);for(let r=0;r<n.length;r++)e=t.g,Bt(n[r]),Ue(e)}}),We),Lr=_r((function(t,n,e){return d?(0!==t.i?t=!1:(Ar(n,e,ee(t.g,Ot)),t=!0),t):0===t.i&&(Ar(n,e,ee(t.g,Ut)),!0)}),Er,Re),Nr=_r((function(t,n,e){return d?(0!==t.i?n=!1:(Ar(n,e,(t=ee(t.g,Ot))===br?void 0:t),n=!0),n):0===t.i&&(Ar(n,e,0===(t=ee(t.g,Ut))?void 0:t),!0)}),Er,Re),jr=_r((function(t,n,e){return d?(0!==t.i?t=!1:(Ar(n,e,ee(t.g,Pt)),t=!0),t):0===t.i&&(Ar(n,e,ee(t.g,xt)),!0)}),(function(t,n,e){if(n=function(t){if(null==t)return t;var n=typeof t;if("bigint"===n)return String(Gt(64,t));if(Ht(t)){if("string"===n)return n=Rt(Number(t)),Mt(n)&&n>=0?t=String(n):(-1!==(n=t.indexOf("."))&&(t=t.substring(0,n)),(n="-"!==t[0]&&((n=t.length)<20||20===n&&t<="18446744073709551615"))||(kt(t),t=Lt(At,Et))),t;if("number"===n)return(t=Rt(t))>=0&&Mt(t)||(Tt(t),t=xt(At,Et)),t}}(n),null!=n){if("string"==typeof n)_e(n);if(null!=n)switch(Le(t,e,0),typeof n){case"number":t=t.g,Tt(n),Be(t,At,Et);break;case"bigint":e=BigInt.asUintN(64,n),e=new Se(Number(e&BigInt(4294967295)),Number(e>>BigInt(32))),Be(t.g,e.i,e.g);break;default:e=_e(n),Be(t.g,e.i,e.g)}}}),ze),kr=_r((function(t,n,e){return 0===t.i&&(Ar(n,e,ie(t.g)),!0)}),Ir,Me),Vr=Sr((function(t,n,e){return(0===t.i||2===t.i)&&(n=Fn(n,0|n[J],e),2==t.i?ye(t,ie,n):n.push(ie(t.g)),!0)}),(function(t,n,e){if(null!=(n=wr(qt,n))&&n.length){e=Ne(t,e);for(let e=0;e<n.length;e++)Pe(t.g,n[e]);je(t,e)}}),Me),Fr=_r((function(t,n,e){return 0===t.i&&(Ar(n,e,0===(t=ie(t.g))?void 0:t),!0)}),Ir,Me),Cr=_r((function(t,n,e){return 0===t.i&&(Ar(n,e,re(t.g)),!0)}),Tr,Ce),Gr=_r((function(t,n,e){return 0===t.i&&(Ar(n,e,!1===(t=re(t.g))?void 0:t),!0)}),Tr,Ce),Mr=Sr((function(t,n,e){return 2===t.i&&(t=me(t),Fn(n,0|n[J],e).push(t),!0)}),(function(t,n,e){if(null!=(n=wr(nn,n)))for(let s=0;s<n.length;s++){var r=t,i=e,o=n[s];null!=o&&ke(r,i,c(o))}}),Ge),Dr=_r((function(t,n,e){return 2===t.i&&(Ar(n,e,""===(t=me(t))?void 0:t),!0)}),Br,Ge),Rr=_r((function(t,n,e){return 2===t.i&&(Ar(n,e,me(t)),!0)}),Br,Ge),zr=function(t,n,e=Fe){return new Xe(t,n,e)}((function(t,n,e,r,i){return 2===t.i&&(r=dn(void 0,r),Fn(n,0|n[J],e).push(r),pe(t,r,i),!0)}),(function(t,n,e,r,i){if(Array.isArray(n)){for(let o=0;o<n.length;o++)xr(t,n[o],e,r,i);1&(t=0|n[J])||tt(n,1|t)}})),Wr=Je((function(t,n,e,r,i,o){if(2!==t.i)return!1;let s=0|n[J];return Mn(n,s,o,e,ut(s)),pe(t,n=Rn(n,r,e),i),!0}),xr),$r=_r((function(t,n,e){return 2===t.i&&(Ar(n,e,ve(t)),!0)}),Pr,$e),Hr=_r((function(t,n,e){return 0===t.i&&(Ar(n,e,0===(t=ie(t.g)>>>0)?void 0:t),!0)}),(function(t,n,e){n=function(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Dt(t)?t>>>0:void 0}(n),null!=n&&null!=n&&(Le(t,e,0),xe(t.g,n))}),De),qr=_r((function(t,n,e){return 0===t.i&&(Ar(n,e,ie(t.g)),!0)}),(function(t,n,e){null!=(n=qt(n))&&(n=parseInt(n,10),Le(t,e,0),Pe(t.g,n))}),He);class Kr{constructor(t,n){var e=ci;this.g=t,this.i=n,this.m=Kn,this.defaultValue=void 0,this.j=null!=e.P?at:void 0}register(){v(this)}}function Xr(t,n){return(e,r)=>{{const o={D:!0};r&&Object.assign(o,r),e=he(e,void 0,void 0,o);try{const r=new t,o=r.l;fr(n)(o,e);var i=r}finally{fe(e)}}return i}}var Jr=[0,Dr,_r((function(t,n,e){return 2===t.i&&(Ar(n,e,(t=ve(t))===P()?void 0:t),!0)}),(function(t,n,e){if(null!=n){if(n instanceof Ke){const r=n.U;return void(r?(n=r(n),null!=n&&ke(t,e,ne(n,!0).buffer)):F($,3))}if(Array.isArray(n))return void F($,3)}Pr(t,n,e)}),$e)];let Yr,Qr=globalThis.trustedTypes;function Zr(t){var n;return void 0===Yr&&(Yr=function(){let t=null;if(!Qr)return t;try{const n=t=>t;t=Qr.createPolicy("goog#html",{createHTML:n,createScript:n,createScriptURL:n})}catch(t){}return t}()),t=(n=Yr)?n.createScriptURL(t):t,new class{constructor(t){this.g=t}toString(){return this.g+""}}(t)}function ti(t,...n){if(0===n.length)return Zr(t[0]);let e=t[0];for(let r=0;r<n.length;r++)e+=encodeURIComponent(n[r])+t[r+1];return Zr(e)}var ni=[0,kr,qr,Cr,-1,Vr,qr,-1,Cr],ei=class extends Ke{constructor(t){super(t)}},ri=[0,Cr,Rr,Cr,qr,-1,Sr((function(t,n,e){return(0===t.i||2===t.i)&&(n=Fn(n,0|n[J],e),2==t.i?ye(t,se,n):n.push(ie(t.g)),!0)}),(function(t,n,e){if(null!=(n=wr(qt,n))&&n.length){e=Ne(t,e);for(let e=0;e<n.length;e++)Pe(t.g,n[e]);je(t,e)}}),He),Rr,-1,[0,Cr,-1],qr,Cr,-1],ii=[0,3,Cr,-1,2,[0,kr],[0,qr,Cr],[0,Rr,-1],[0]],oi=[0,Rr,-2],si=class extends Ke{constructor(t){super(t)}},ai=[0],ui=[0,kr,Cr,1,Cr,-4],ci=class extends Ke{constructor(t){super(t,2)}},li={};li[336783863]=[0,Rr,Cr,-1,kr,[0,[1,2,3,4,5,6,7,8,9],Wr,ai,Wr,ri,Wr,oi,Wr,ui,Wr,ni,Wr,[0,Rr,-2],Wr,[0,Rr,qr],Wr,ii,Wr,[0,qr,-1,Cr]],[0,Rr],Cr,[0,[1,3],[2,4],Wr,[0,Vr],-1,Wr,[0,Mr],-1,zr,[0,Rr,-1]],Rr];var hi=[0,Nr,-1,Gr,-3,Nr,Vr,Dr,Fr,Nr,-1,Gr,Fr,Gr,-2,Dr];function fi(t){Zn(t,3,"TEXT:text_in")}var di=class extends Ke{constructor(t){super(t,500)}o(t){return Kn(this,0,7,t)}},gi=[-1,{}],pi=[0,Rr,1,gi],mi=[0,Rr,Mr,gi];function vi(t){Zn(t,10,"text_in")}var yi,bi=class extends Ke{constructor(t){super(t,500)}o(t){return Kn(this,0,1001,t)}};bi.prototype.i=(yi=[-500,zr,[-500,Dr,-1,Mr,-3,[-2,li,Cr],zr,Jr,Fr,-1,pi,mi,zr,[0,Dr,Gr],Dr,hi,Fr,Mr,987,Mr],4,zr,[-500,Rr,-1,[-1,{}],998,Rr],zr,[-500,Rr,Mr,-1,[-2,{},Cr],997,Mr,-1],Fr,zr,[-500,Rr,Mr,gi,998,Mr],Mr,Fr,pi,mi,zr,[0,Dr,-1,gi],Mr,-2,hi,Dr,-1,Gr,[0,Gr,Hr],978,gi,zr,Jr],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}}}};yr(this.l,t,ar(tr,pr,mr,yi)),Oe(t,t.g.end());const n=new Uint8Array(t.i),e=t.j,r=e.length;let i=0;for(let t=0;t<r;t++){const r=e[t];n.set(r,i),i+=r.length}return t.j=[n],n});var wi=class extends Ke{constructor(t){super(t)}},_i=class extends Ke{constructor(t){super(t)}i(){return Hn(this,wi)}},Si=class extends Ke{constructor(t){super(t)}},Ai=Xr(class extends Ke{constructor(t){super(t)}},[0,zr,[0,1,kr,Rr,[0,zr,[0,kr,Ur,Rr,-1]]],Lr]),Ei=class extends Ke{constructor(t){super(t)}},Ii=class extends Ke{constructor(t){super(t)}H(){const t=In(this,1,void 0,jn);return null==t?P():t}},Ti=class extends Ke{constructor(t){super(t)}},Bi=[1,2],xi=Xr(class extends Ke{constructor(t){super(t)}},[0,zr,[0,Bi,Wr,[0,Or],Wr,[0,$r],kr,Rr],Lr]),Pi=class extends Ke{constructor(t){super(t)}},Ui=class extends Ke{constructor(t){super(t)}},Oi=[0,Cr,-1],Li=class extends Ke{constructor(t){super(t)}},Ni=[1,2,3,4,5,6],ji=class extends Ke{constructor(t){super(t)}i(){return null!=In(this,1,void 0,jn)}j(){return null!=nn(In(this,2))}},ki=class extends Ke{constructor(t){super(t)}},Vi=[0,[0,$r,Rr,[0,kr,Lr,-1],[0,jr,Lr]],Cr,[0,Ni,Wr,ui,Wr,ri,Wr,ni,Wr,ai,Wr,oi,Wr,ii],qr],Fi=class extends Ke{constructor(t){super(t)}},Ci=new Kr(462704549,Fi);li[462704549]=[0,Vi,[0,Rr,kr,Ur,Mr,-1]];var Gi=class extends Ke{constructor(t){super(t)}},Mi=new Kr(477589892,Gi);function Di(t,n){if(n=n?vn(n):new Pi,void 0!==t.displayNamesLocale?Bn(n,1,tn(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Bn(n,1),void 0!==t.maxResults){var e=t.maxResults;if(null!=e){if("number"!=typeof e)throw V();if(!Dt(e))throw V();e|=0}Bn(n,2,e)}else"maxResults"in t&&Bn(n,2);if(void 0!==t.scoreThreshold){if(null!=(e=t.scoreThreshold)&&"number"!=typeof e)throw Error(`Value of float/double field must be a number, found ${typeof e}: ${e}`);Bn(n,3,e)}else"scoreThreshold"in t&&Bn(n,3);return void 0!==t.categoryAllowlist?kn(n,4,t.categoryAllowlist):"categoryAllowlist"in t&&Bn(n,4),void 0!==t.categoryDenylist?kn(n,5,t.categoryDenylist):"categoryDenylist"in t&&Bn(n,5),n}function Ri(t){const n=Number(t);return Number.isSafeInteger(n)?n:String(t)}function zi(t){const n={classifications:Hn(t,Si).map((t=>function(t,n=-1,e=""){return{categories:t.map((t=>({index:qt(In(t,1))??0??-1,score:In(t,2,void 0,zt)??0??0,categoryName:nn(In(t,3))??""??"",displayName:nn(In(t,4))??""??""}))),headIndex:n,headName:e}}(Wn(t,_i,4)?.i()??[],qt(In(t,2))??0,nn(In(t,3))??"")))};return null!=function(t){return Yt(g?In(t,2,void 0,Qt):In(t,2))}(t)&&(n.timestampMs=Ri(Qn(t))),n}function Wi(t){return Array.from(t,(t=>t>127?t-256:t))}function $i(t,n){if(t.length!==n.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${n.length}).`);let e=0,r=0,i=0;for(let o=0;o<t.length;o++)e+=t[o]*n[o],r+=t[o]*t[o],i+=n[o]*n[o];if(r<=0||i<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return e/Math.sqrt(r*i)}let Hi;li[477589892]=[0,Vi,Oi];const qi=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 Ki(){if(void 0===Hi)try{await WebAssembly.instantiate(qi),Hi=!0}catch{Hi=!1}return Hi}async function Xi(t,n=ti``){const e=await Ki()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${n}/${t}_${e}.js`,wasmBinaryPath:`${n}/${t}_${e}.wasm`}}var Ji=class{};function Yi(){var t=navigator;return"undefined"!=typeof OffscreenCanvas&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(t)||!!((t=t.userAgent.match(/Version\/([\d]+).*Safari/))&&t.length>=1&&Number(t[1])>=17))}async function Qi(t){if("function"!=typeof importScripts){const n=document.createElement("script");return n.src=t.toString(),n.crossOrigin="anonymous",new Promise(((t,e)=>{n.addEventListener("load",(()=>{t()}),!1),n.addEventListener("error",(t=>{e(t)}),!1),document.body.appendChild(n)}))}try{importScripts(t.toString())}catch(n){if(!(n instanceof TypeError))throw n;await self.import(t.toString())}}Ji.forVisionTasks=function(t){return Xi("vision",t)},Ji.forTextTasks=function(t){return Xi("text",t)},Ji.forGenAiExperimentalTasks=function(t){return Xi("genai_experimental",t)},Ji.forGenAiTasks=function(t){return Xi("genai",t)},Ji.forAudioTasks=function(t){return Xi("audio",t)},Ji.isSimdSupported=function(){return Ki()};function Zi(t,n,e){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),e(n=t.h.stringToNewUTF8(n)),t.h._free(n)}function to(t,n,e){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const r=new Uint32Array(n.length);for(let e=0;e<n.length;e++)r[e]=t.h.stringToNewUTF8(n[e]);n=t.h._malloc(4*r.length),t.h.HEAPU32.set(r,n>>2),e(n);for(const n of r)t.h._free(n);t.h._free(n)}function no(t,n,e){t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[n]=e}function eo(t,n,e){let r=[];t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[n]=(t,n,i)=>{n?(e(r,i),r=[]):r.push(t)}}const ro=function(t){return class extends t{N(){this.h._registerModelResourcesGraphService()}}}(class{constructor(t,n){this.j=!0,this.h=t,this.g=null,this.i=0,this.m="function"==typeof this.h._addIntToInputStream,void 0!==n?this.h.canvas=n:Yi()?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 n=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(n),t)}setGraphFromString(t){this.setGraph((new TextEncoder).encode(t),!1)}setGraph(t,n){const e=t.length,r=this.h._malloc(e);this.h.HEAPU8.set(t,r),n?this.h._changeBinaryGraph(e,r):this.h._changeTextGraph(e,r),this.h._free(r)}configureAudio(t,n,e,r,i){this.h._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),Zi(this,r||"input_audio",(r=>{Zi(this,i=i||"audio_header",(i=>{this.h._configureAudio(r,i,t,n??0,e)}))}))}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,n){this.h.emptyPacketListeners=this.h.emptyPacketListeners||{},this.h.emptyPacketListeners[t]=n}addAudioToStream(t,n,e){this.addAudioToStreamWithShape(t,0,0,n,e)}addAudioToStreamWithShape(t,n,e,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),Zi(this,r,(t=>{this.h._addAudioToInputStream(this.g,n,e,t,i)}))}addGpuBufferToStream(t,n,e){Zi(this,n,(n=>{if(!this.h.canvas)throw Error("No OpenGL canvas configured.");n?this.h._bindTextureToStream(n):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(n,s,a,e)}))}addBoolToStream(t,n,e){Zi(this,n,(n=>{this.h._addBoolToInputStream(t,n,e)}))}addDoubleToStream(t,n,e){Zi(this,n,(n=>{this.h._addDoubleToInputStream(t,n,e)}))}addFloatToStream(t,n,e){Zi(this,n,(n=>{this.h._addFloatToInputStream(t,n,e)}))}addIntToStream(t,n,e){Zi(this,n,(n=>{this.h._addIntToInputStream(t,n,e)}))}addUintToStream(t,n,e){Zi(this,n,(n=>{this.h._addUintToInputStream(t,n,e)}))}addStringToStream(t,n,e){Zi(this,n,(n=>{Zi(this,t,(t=>{this.h._addStringToInputStream(t,n,e)}))}))}addStringRecordToStream(t,n,e){Zi(this,n,(n=>{to(this,Object.keys(t),(r=>{to(this,Object.values(t),(i=>{this.h._addFlatHashMapToInputStream(r,i,Object.keys(t).length,n,e)}))}))}))}addProtoToStream(t,n,e,r){Zi(this,e,(e=>{Zi(this,n,(n=>{const i=this.h._malloc(t.length);this.h.HEAPU8.set(t,i),this.h._addProtoToInputStream(i,t.length,n,e,r),this.h._free(i)}))}))}addEmptyPacketToStream(t,n){Zi(this,t,(t=>{this.h._addEmptyPacketToInputStream(t,n)}))}addBoolVectorToStream(t,n,e){Zi(this,n,(n=>{const r=this.h._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(const n of t)this.h._addBoolVectorEntry(r,n);this.h._addBoolVectorToInputStream(r,n,e)}))}addDoubleVectorToStream(t,n,e){Zi(this,n,(n=>{const r=this.h._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(const n of t)this.h._addDoubleVectorEntry(r,n);this.h._addDoubleVectorToInputStream(r,n,e)}))}addFloatVectorToStream(t,n,e){Zi(this,n,(n=>{const r=this.h._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(const n of t)this.h._addFloatVectorEntry(r,n);this.h._addFloatVectorToInputStream(r,n,e)}))}addIntVectorToStream(t,n,e){Zi(this,n,(n=>{const r=this.h._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(const n of t)this.h._addIntVectorEntry(r,n);this.h._addIntVectorToInputStream(r,n,e)}))}addUintVectorToStream(t,n,e){Zi(this,n,(n=>{const r=this.h._allocateUintVector(t.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(const n of t)this.h._addUintVectorEntry(r,n);this.h._addUintVectorToInputStream(r,n,e)}))}addStringVectorToStream(t,n,e){Zi(this,n,(n=>{const r=this.h._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(const n of t)Zi(this,n,(t=>{this.h._addStringVectorEntry(r,t)}));this.h._addStringVectorToInputStream(r,n,e)}))}addBoolToInputSidePacket(t,n){Zi(this,n,(n=>{this.h._addBoolToInputSidePacket(t,n)}))}addDoubleToInputSidePacket(t,n){Zi(this,n,(n=>{this.h._addDoubleToInputSidePacket(t,n)}))}addFloatToInputSidePacket(t,n){Zi(this,n,(n=>{this.h._addFloatToInputSidePacket(t,n)}))}addIntToInputSidePacket(t,n){Zi(this,n,(n=>{this.h._addIntToInputSidePacket(t,n)}))}addUintToInputSidePacket(t,n){Zi(this,n,(n=>{this.h._addUintToInputSidePacket(t,n)}))}addStringToInputSidePacket(t,n){Zi(this,n,(n=>{Zi(this,t,(t=>{this.h._addStringToInputSidePacket(t,n)}))}))}addProtoToInputSidePacket(t,n,e){Zi(this,e,(e=>{Zi(this,n,(n=>{const r=this.h._malloc(t.length);this.h.HEAPU8.set(t,r),this.h._addProtoToInputSidePacket(r,t.length,n,e),this.h._free(r)}))}))}addBoolVectorToInputSidePacket(t,n){Zi(this,n,(n=>{const e=this.h._allocateBoolVector(t.length);if(!e)throw Error("Unable to allocate new bool vector on heap.");for(const n of t)this.h._addBoolVectorEntry(e,n);this.h._addBoolVectorToInputSidePacket(e,n)}))}addDoubleVectorToInputSidePacket(t,n){Zi(this,n,(n=>{const e=this.h._allocateDoubleVector(t.length);if(!e)throw Error("Unable to allocate new double vector on heap.");for(const n of t)this.h._addDoubleVectorEntry(e,n);this.h._addDoubleVectorToInputSidePacket(e,n)}))}addFloatVectorToInputSidePacket(t,n){Zi(this,n,(n=>{const e=this.h._allocateFloatVector(t.length);if(!e)throw Error("Unable to allocate new float vector on heap.");for(const n of t)this.h._addFloatVectorEntry(e,n);this.h._addFloatVectorToInputSidePacket(e,n)}))}addIntVectorToInputSidePacket(t,n){Zi(this,n,(n=>{const e=this.h._allocateIntVector(t.length);if(!e)throw Error("Unable to allocate new int vector on heap.");for(const n of t)this.h._addIntVectorEntry(e,n);this.h._addIntVectorToInputSidePacket(e,n)}))}addUintVectorToInputSidePacket(t,n){Zi(this,n,(n=>{const e=this.h._allocateUintVector(t.length);if(!e)throw Error("Unable to allocate new unsigned int vector on heap.");for(const n of t)this.h._addUintVectorEntry(e,n);this.h._addUintVectorToInputSidePacket(e,n)}))}addStringVectorToInputSidePacket(t,n){Zi(this,n,(n=>{const e=this.h._allocateStringVector(t.length);if(!e)throw Error("Unable to allocate new string vector on heap.");for(const n of t)Zi(this,n,(t=>{this.h._addStringVectorEntry(e,t)}));this.h._addStringVectorToInputSidePacket(e,n)}))}attachBoolListener(t,n){no(this,t,n),Zi(this,t,(t=>{this.h._attachBoolListener(t)}))}attachBoolVectorListener(t,n){eo(this,t,n),Zi(this,t,(t=>{this.h._attachBoolVectorListener(t)}))}attachIntListener(t,n){no(this,t,n),Zi(this,t,(t=>{this.h._attachIntListener(t)}))}attachIntVectorListener(t,n){eo(this,t,n),Zi(this,t,(t=>{this.h._attachIntVectorListener(t)}))}attachUintListener(t,n){no(this,t,n),Zi(this,t,(t=>{this.h._attachUintListener(t)}))}attachUintVectorListener(t,n){eo(this,t,n),Zi(this,t,(t=>{this.h._attachUintVectorListener(t)}))}attachDoubleListener(t,n){no(this,t,n),Zi(this,t,(t=>{this.h._attachDoubleListener(t)}))}attachDoubleVectorListener(t,n){eo(this,t,n),Zi(this,t,(t=>{this.h._attachDoubleVectorListener(t)}))}attachFloatListener(t,n){no(this,t,n),Zi(this,t,(t=>{this.h._attachFloatListener(t)}))}attachFloatVectorListener(t,n){eo(this,t,n),Zi(this,t,(t=>{this.h._attachFloatVectorListener(t)}))}attachStringListener(t,n){no(this,t,n),Zi(this,t,(t=>{this.h._attachStringListener(t)}))}attachStringVectorListener(t,n){eo(this,t,n),Zi(this,t,(t=>{this.h._attachStringVectorListener(t)}))}attachProtoListener(t,n,e){no(this,t,n),Zi(this,t,(t=>{this.h._attachProtoListener(t,e||!1)}))}attachProtoVectorListener(t,n,e){eo(this,t,n),Zi(this,t,(t=>{this.h._attachProtoVectorListener(t,e||!1)}))}attachAudioListener(t,n,e){this.h._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),no(this,t,((t,e)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),n(t,e)})),Zi(this,t,(t=>{this.h._attachAudioListener(t,e||!1)}))}finishProcessing(){this.h._waitUntilIdle()}closeGraph(){this.h._closeGraph(),this.h.simpleListeners=void 0,this.h.emptyPacketListeners=void 0}});var io=class extends ro{};async function oo(t,n,e){return t=await(async(t,n,e,r)=>{if(n&&await Qi(n),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(e&&(await Qi(e),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&r&&((n=self.Module).locateFile=r.locateFile,r.mainScriptUrlOrBlob&&(n.mainScriptUrlOrBlob=r.mainScriptUrlOrBlob)),r=await self.ModuleFactory(self.Module||r),self.ModuleFactory=self.Module=void 0,new t(r,null)})(t,n.wasmLoaderPath,n.assetLoaderPath,{locateFile:t=>t.endsWith(".wasm")?n.wasmBinaryPath.toString():n.assetBinaryPath&&t.endsWith(".data")?n.assetBinaryPath.toString():t}),await t.o(e),t}async function so(t,n,e){return oo(t,n,e)}function ao(t,n){const e=Wn(t.baseOptions,ji,1)||new ji;"string"==typeof n?(Bn(e,2,tn(n)),Bn(e,1)):n instanceof Uint8Array&&(Bn(e,1,it(n,!1)),Bn(e,2)),Kn(t.baseOptions,0,1,e)}function uo(t,n){const e=n.baseOptions||{};if(n.baseOptions?.modelAssetBuffer&&n.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Wn(t.baseOptions,ji,1)?.i()||Wn(t.baseOptions,ji,1)?.j()||n.baseOptions?.modelAssetBuffer||n.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,n){let e=Wn(t.baseOptions,Li,3);if(!e){var r=e=new Li;Xn(r,4,new si)}"delegate"in n&&("GPU"===n.delegate?Xn(n=e,2,r=new ei):Xn(n=e,4,r=new si)),Kn(t.baseOptions,0,3,e)}(t,e),e.modelAssetPath)return fetch(e.modelAssetPath.toString()).then((t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${e.modelAssetPath} (${t.status})`)})).then((n=>{try{t.g.h.FS_unlink("/model.dat")}catch{}t.g.h.FS_createDataFile("/","model.dat",new Uint8Array(n),!0,!1,!1),ao(t,"/model.dat"),t.v()}));if(e.modelAssetBuffer instanceof Uint8Array)ao(t,e.modelAssetBuffer);else if(e.modelAssetBuffer)return async function(t){const n=[];for(var e=0;;){const{done:r,value:i}=await t.read();if(r)break;n.push(i),e+=i.length}if(0===n.length)return new Uint8Array(0);if(1===n.length)return n[0];t=new Uint8Array(e),e=0;for(const r of n)t.set(r,e),e+=r.length;return t}(e.modelAssetBuffer).then((n=>{ao(t,n),t.v()}));return t.v(),Promise.resolve()}function co(t){try{const n=t.m.length;if(1===n)throw Error(t.m[0].message);if(n>1)throw Error("Encountered multiple errors: "+t.m.map((t=>t.message)).join(", "))}finally{t.m=[]}}function lo(t,n){t.j=Math.max(t.j,n)}var ho=class{constructor(t){this.g=t,this.m=[],this.j=0,this.g.setAutoRenderToScreen(!1)}setGraph(t,n){this.g.attachErrorListener(((t,n)=>{this.m.push(Error(n))})),this.g.N(),this.g.setGraph(t,n),co(this)}finishProcessing(){this.g.finishProcessing(),co(this)}close(){this.g.closeGraph()}};ho.prototype.close=ho.prototype.close;var fo=class extends ho{constructor(t,n){super(new io(t,n)),this.u={languages:[]},Kn(t=this.i=new Fi,0,1,n=new ki)}o(t){return Kn(this.i,0,2,Di(t,Wn(this.i,Pi,2))),uo(this,t)}get baseOptions(){return Wn(this.i,ki,1)}set baseOptions(t){Kn(this.i,0,1,t)}K(t){return this.u={languages:[]},this.g.addStringToStream(t,"text_in",this.j+1),this.finishProcessing(),this.u}v(){var t=new bi;vi(t),Zn(t,15,"classifications_out");const n=new ci;qe(n,Ci,this.i);const e=new di;Vn(e,tn("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),fi(e),Zn(e,4,"CLASSIFICATIONS:classifications_out"),e.o(n),Yn(t,e),this.g.attachProtoListener("classifications_out",((t,n)=>{if(({classifications:t}=zi(Ai(t))),1!==t.length)throw Error(`Expected 1 classification head, got ${t.length}`);this.u.languages=t[0].categories.map((t=>({languageCode:t.categoryName,probability:t.score}))),lo(this,n)})),this.g.attachEmptyPacketListener("classifications_out",(t=>{lo(this,t)})),t=t.i(),this.setGraph(new Uint8Array(t),!0)}};fo.prototype.detect=fo.prototype.K,fo.prototype.setOptions=fo.prototype.o,fo.createFromModelPath=function(t,n){return so(fo,t,{baseOptions:{modelAssetPath:n}})},fo.createFromModelBuffer=function(t,n){return so(fo,t,{baseOptions:{modelAssetBuffer:n}})},fo.createFromOptions=function(t,n){return so(fo,t,n)};var go=class extends ho{constructor(t,n){super(new io(t,n)),this.u={classifications:[]},Kn(t=this.i=new Fi,0,1,n=new ki)}o(t){return Kn(this.i,0,2,Di(t,Wn(this.i,Pi,2))),uo(this,t)}get baseOptions(){return Wn(this.i,ki,1)}set baseOptions(t){Kn(this.i,0,1,t)}J(t){return this.u={classifications:[]},this.g.addStringToStream(t,"text_in",this.j+1),this.finishProcessing(),this.u}v(){var t=new bi;vi(t),Zn(t,15,"classifications_out");const n=new ci;qe(n,Ci,this.i);const e=new di;Vn(e,tn("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),fi(e),Zn(e,4,"CLASSIFICATIONS:classifications_out"),e.o(n),Yn(t,e),this.g.attachProtoListener("classifications_out",((t,n)=>{this.u=zi(Ai(t)),lo(this,n)})),this.g.attachEmptyPacketListener("classifications_out",(t=>{lo(this,t)})),t=t.i(),this.setGraph(new Uint8Array(t),!0)}};go.prototype.classify=go.prototype.J,go.prototype.setOptions=go.prototype.o,go.createFromModelPath=function(t,n){return so(go,t,{baseOptions:{modelAssetPath:n}})},go.createFromModelBuffer=function(t,n){return so(go,t,{baseOptions:{modelAssetBuffer:n}})},go.createFromOptions=function(t,n){return so(go,t,n)};var po=class extends ho{constructor(t,n){super(new io(t,n)),this.u={embeddings:[]},Kn(t=this.i=new Gi,0,1,n=new ki)}o(t){var n=this.i,e=Wn(this.i,Ui,2);return e=e?vn(e):new Ui,void 0!==t.l2Normalize?Bn(e,1,Wt(t.l2Normalize)):"l2Normalize"in t&&Bn(e,1),void 0!==t.quantize?Bn(e,2,Wt(t.quantize)):"quantize"in t&&Bn(e,2),Kn(n,0,2,e),uo(this,t)}get baseOptions(){return Wn(this.i,ki,1)}set baseOptions(t){Kn(this.i,0,1,t)}L(t){return this.g.addStringToStream(t,"text_in",this.j+1),this.finishProcessing(),this.u}v(){var t=new bi;vi(t),Zn(t,15,"embeddings_out");const n=new ci;qe(n,Mi,this.i);const e=new di;Vn(e,tn("mediapipe.tasks.text.text_embedder.TextEmbedderGraph")),fi(e),Zn(e,4,"EMBEDDINGS:embeddings_out"),e.o(n),Yn(t,e),this.g.attachProtoListener("embeddings_out",((t,n)=>{t=xi(t),this.u=function(t){return{embeddings:Hn(t,Ti).map((t=>{const n={headIndex:qt(In(t,3))??0??-1,headName:nn(In(t,4))??""??""};var e=t.l;return void 0!==zn(e,0|e[J],Ei,Cn(t,1))?(t=Pn(t=Wn(t,Ei,Cn(t,1)),1,zt,void 0===ot?2:4),n.floatEmbedding=t.slice()):(e=new Uint8Array(0),n.quantizedEmbedding=Wn(t,Ii,Cn(t,2))?.H()?.i()??e),n})),timestampMs:Ri(Qn(t))}}(t),lo(this,n)})),this.g.attachEmptyPacketListener("embeddings_out",(t=>{lo(this,t)})),t=t.i(),this.setGraph(new Uint8Array(t),!0)}};po.cosineSimilarity=function(t,n){if(t.floatEmbedding&&n.floatEmbedding)t=$i(t.floatEmbedding,n.floatEmbedding);else{if(!t.quantizedEmbedding||!n.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=$i(Wi(t.quantizedEmbedding),Wi(n.quantizedEmbedding))}return t},po.prototype.embed=po.prototype.L,po.prototype.setOptions=po.prototype.o,po.createFromModelPath=function(t,n){return so(po,t,{baseOptions:{modelAssetPath:n}})},po.createFromModelBuffer=function(t,n){return so(po,t,{baseOptions:{modelAssetBuffer:n}})},po.createFromOptions=function(t,n){return so(po,t,n)},exports.FilesetResolver=Ji,exports.LanguageDetector=fo,exports.TaskRunner=ho,exports.TextClassifier=go,exports.TextEmbedder=po;
2
2
  //# sourceMappingURL=text_bundle_cjs.js.map