@mediapipe/tasks-text 0.10.15-rc.20240721 → 0.10.15-rc.20240723
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 +1 -1
- package/text_bundle.cjs +1 -1
- package/text_bundle.cjs.map +1 -1
- package/text_bundle.mjs +1 -1
- package/text_bundle.mjs.map +1 -1
package/package.json
CHANGED
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(e,n){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!=(e=r&&r[e])?e:n}function n(){throw Error("Invalid UTF8")}function r(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}let i,o;const s="undefined"!=typeof TextDecoder;let a;const u="undefined"!=typeof TextEncoder;function c(t){if(u)t=(a||=new TextEncoder).encode(t);else{let n=0;const r=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(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}const l=e(1,!0);var h,f=e(610401301,!1),d=e(188588736,!0),g=e(645172343,l),p=e(653718497,l);const m=t.navigator;function y(t){return!!f&&(!!h&&h.brands.some((({brand:e})=>e&&-1!=e.indexOf(t))))}function v(e){var n;return(n=t.navigator)&&(n=n.userAgent)||(n=""),-1!=n.indexOf(e)}function b(){return!!f&&(!!h&&h.brands.length>0)}function w(){return b()?y("Chromium"):(v("Chrome")||v("CriOS"))&&!(!b()&&v("Edge"))||v("Silk")}h=m&&m.userAgentData||null;var _=!b()&&(v("Trident")||v("MSIE"));!v("Android")||w(),w(),v("Safari")&&(w()||!b()&&v("Coast")||!b()&&v("Opera")||!b()&&v("Edge")||(b()?y("Microsoft Edge"):v("Edg/"))||b()&&y("Opera"));var A={},S=null;function E(t){var e=t.length,n=3*e/4;n%3?n=Math.floor(n):-1!="=.".indexOf(t[e-1])&&(n=-1!="=.".indexOf(t[e-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),i=S[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}T();for(var r=0;;){var i=n(-1),o=n(0),s=n(64),a=n(64);if(64===a&&-1===i)break;e(i<<2|o>>4),64!=s&&(e(o<<4&240|s>>2),64!=a&&e(s<<6&192|a))}}(t,(function(t){r[i++]=t})),i!==n?r.subarray(0,i):r}function T(){if(!S){S={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;n<5;n++){var r=t.concat(e[n].split(""));A[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===S[o]&&(S[o]=i)}}}}var I="undefined"!=typeof Uint8Array,x=!_&&"function"==typeof btoa;function P(t){if(!x){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 U=/[-_.]/g,O={"-":"+",_:"/",".":"="};function L(t){return O[t]||""}function B(t){if(!x)return E(t);U.test(t)&&(t=t.replace(U,L)),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 k(t){return I&&null!=t&&t instanceof Uint8Array}var F={};let j;function V(t){if(t!==F)throw Error("illegal external caller")}function N(){return j||=new M(null,F)}function C(t){V(F);var e=t.g;return null==(e=null==e||k(e)?e:"string"==typeof e?B(e):null)?e:t.g=e}var M=class{constructor(t,e){if(V(e),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}i(){return new Uint8Array(C(this)||0)}};function G(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function D(){return Error("Failed to read varint, encoding is invalid.")}function z(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function $(t){if("string"==typeof t)return{buffer:B(t),A:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),A:!1};if(t.constructor===Uint8Array)return{buffer:t,A:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),A:!1};if(t.constructor===M)return{buffer:C(t)||new Uint8Array(0),A:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),A:!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 W(){return"function"==typeof BigInt}const R="function"==typeof Uint8Array.prototype.slice;let H,q=0,J=0;function K(t){const e=t>>>0;q=e,J=(t-e)/4294967296>>>0}function Y(t){if(t<0){K(-t);const[e,n]=rt(q,J);q=e>>>0,J=n>>>0}else K(t)}function X(t){const e=H||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),J=0,q=e.getUint32(0,!0)}function Q(t,e){return 4294967296*e+(t>>>0)}function Z(t,e){const n=2147483648&e;return n&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),t=Q(t,e),n?-t:t}function tt(t,e){if(t>>>=0,(e>>>=0)<=2097151)var n=""+(4294967296*e+t);else W()?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+et(n)+et(t));return n}function et(t){return t=String(t),"0000000".slice(t.length)+t}function nt(t){if(t.length<16)Y(Number(t));else if(W())t=BigInt(t),q=Number(t&BigInt(4294967295))>>>0,J=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);J=q=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));J*=1e6,q=1e6*q+e,q>=4294967296&&(J+=Math.trunc(q/4294967296),J>>>=0,q>>>=0)}if(e){const[t,e]=rt(q,J);q=t,J=e}}}function rt(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function it(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(lt(t,a),n<128)return e(r>>>0,i>>>0);throw D()}function ot(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 lt(t,n),!!(127&e)}throw D()}function st(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 D();return lt(t,n),i}function at(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],lt(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?t*Math.pow(2,-149)*i:t*Math.pow(2,r-150)*(i+Math.pow(2,23))}function ut(t){return st(t)}function ct(t,e,{D:n=!1}={}){t.D=n,e&&(e=$(e),t.i=e.buffer,t.m=e.A,t.s=0,t.j=t.i.length,t.g=t.s)}function lt(t,e){if(t.g=e,e>t.j)throw z(t.j,e)}function ht(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 z(e,t.j-n);return t.g=r,n}function ft(t,e){if(0==e)return N();var n=ht(t,e);return t.D&&t.m?n=t.i.subarray(n,n+e):(t=t.i,n=n===(e=n+e)?new Uint8Array(0):R?t.slice(n,e):new Uint8Array(t.subarray(n,e))),0==n.length?N():new M(n,F)}var dt=[];function gt(t){var e=t.g;if(e.g==e.j)return!1;t.j=t.g.g;var n=st(t.g)>>>0;if(e=n>>>3,!((n&=7)>=0&&n<=5))throw G(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 pt(t){switch(t.i){case 0:0!=t.i?pt(t):ot(t.g);break;case 1:lt(t=t.g,t.g+8);break;case 2:if(2!=t.i)pt(t);else{var e=st(t.g)>>>0;lt(t=t.g,t.g+e)}break;case 5:lt(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!gt(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.i){if(t.m!=e)throw Error("Unmatched end-group tag");break}pt(t)}break;default:throw G(t.i,t.j)}}function mt(t,e,n){const r=t.g.j,i=st(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 yt(t){var e=st(t.g)>>>0,a=ht(t=t.g,e);if(t=t.i,s){var u,c=t;(u=o)||(u=o=new TextDecoder("utf-8",{fatal:!0})),e=a+e,c=0===a&&e===c.length?c:c.subarray(a,e);try{var l=u.decode(c)}catch(t){if(void 0===i){try{u.decode(new Uint8Array([128]))}catch(t){}try{u.decode(new Uint8Array([97])),i=!0}catch(t){i=!1}}throw!i&&(o=void 0),t}}else{e=(l=a)+e,a=[];let i,o=null;for(;l<e;){var h=t[l++];h<128?a.push(h):h<224?l>=e?n():(i=t[l++],h<194||128!=(192&i)?(l--,n()):a.push((31&h)<<6|63&i)):h<240?l>=e-1?n():(i=t[l++],128!=(192&i)||224===h&&i<160||237===h&&i>=160||128!=(192&(u=t[l++]))?(l--,n()):a.push((15&h)<<12|(63&i)<<6|63&u)):h<=244?l>=e-2?n():(i=t[l++],128!=(192&i)||i-144+(h<<28)>>30!=0||128!=(192&(u=t[l++]))||128!=(192&(c=t[l++]))?(l--,n()):(h=(7&h)<<18|(63&i)<<12|(63&u)<<6|63&c,h-=65536,a.push(55296+(h>>10&1023),56320+(1023&h)))):n(),a.length>=8192&&(o=r(o,a),a.length=0)}l=r(o,a)}return l}function vt(t){const e=st(t.g)>>>0;return ft(t.g,e)}function bt(t,e,n){var r=st(t.g)>>>0;for(r=t.g.g+r;t.g.g<r;)n.push(e(t.g))}var wt=[];function _t(t){return t?/^\d+$/.test(t)?(nt(t),new At(q,J)):null:St||=new At(0,0)}var At=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let St;function Et(t){return t?/^-?\d+$/.test(t)?(nt(t),new Tt(q,J)):null:It||=new Tt(0,0)}var Tt=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let It;function xt(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 Pt(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function Ut(t,e){if(e>=0)Pt(t,e);else{for(let n=0;n<9;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function Ot(t){var e=q;t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}function Lt(t,e){0!==e.length&&(t.j.push(e),t.i+=e.length)}function Bt(t,e,n){Pt(t.g,8*e+n)}function kt(t,e){return Bt(t,e,2),e=t.g.end(),Lt(t,e),e.push(t.i),e}function Ft(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 jt(t,e,n){Bt(t,e,2),Pt(t.g,n.length),Lt(t,t.g.end()),Lt(t,n)}class Vt{constructor(t,e,n,r){this.g=t,this.i=e,this.j=n,this.H=r}}function Nt(t){return Array.prototype.slice.call(t)}var Ct="function"==typeof Symbol&&"symbol"==typeof Symbol();function Mt(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():t}var Gt=Mt(),Dt=Mt("2ex"),zt=Mt("0dg"),$t=Mt("1oa"),Wt=Ct?(t,e)=>{t[Gt]|=e}:(t,e)=>{void 0!==t.g?t.g|=e:Object.defineProperties(t,{g:{value:e,configurable:!0,writable:!0,enumerable:!1}})},Rt=Ct?(t,e)=>{t[Gt]&=~e}:(t,e)=>{void 0!==t.g&&(t.g&=~e)},Ht=Ct?t=>0|t[Gt]:t=>0|t.g,qt=Ct?t=>t[Gt]:t=>t.g,Jt=Ct?(t,e)=>{t[Gt]=e}:(t,e)=>{void 0!==t.g?t.g=e:Object.defineProperties(t,{g:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function Kt(t,e){Jt(e,-14591&(0|t))}function Yt(t,e){Jt(e,-14557&(34|t))}var Xt,Qt={},Zt={};function te(t){return!(!t||"object"!=typeof t||t.g!==Zt)}function ee(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}function ne(t,e,n){if(null!=t)if("string"==typeof t)t=t?new M(t,F):N();else if(t.constructor!==M)if(k(t))t=t.length?new M(n?t:new Uint8Array(t),F):N();else{if(!e)throw Error();t=void 0}return t}function re(t,e,n){if(!Array.isArray(t)||t.length)return!1;const r=Ht(t);return!!(1&r)||!(!e||!(Array.isArray(e)?e.includes(n):e.has(n)))&&(Jt(t,1|r),!0)}const ie=[];function oe(t){if(2&t)throw Error()}let se,ae;function ue(t,e){(e=se?e[se]:void 0)&&(t[se]=Nt(e))}Jt(ie,55),Xt=Object.freeze(ie);var ce=Object.freeze({});Object.freeze({});var le=Object.freeze({});function he(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}let fe;function de(){const e=Error();he(e,"incident"),function(e){t.setTimeout((()=>{throw e}),0)}(e)}function ge(){const t=Error("int32");return he(t,"warning"),t}function pe(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function me(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 ye=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function ve(t){const e=typeof t;return"number"===e?Number.isFinite(t):"string"===e&&ye.test(t)}function be(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t&&Number.isFinite(t)?0|t:void 0}function we(t){return"-"!==t[0]&&(t.length<20||20===t.length&&Number(t.substring(0,6))<184467)}function _e(t){return t=Math.trunc(t),Number.isSafeInteger(t)||(Y(t),t=Z(q,J)),t}function Ae(t){var e=Math.trunc(Number(t));if(Number.isSafeInteger(e))return String(e);if(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),!("-"===t[0]?t.length<20||20===t.length&&Number(t.substring(0,7))>-922337:t.length<19||19===t.length&&Number(t.substring(0,6))<922337))if(nt(t),t=q,2147483648&(e=J))if(W())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,r]=rt(t,e);t="-"+tt(n,r)}else t=tt(t,e);return t}function Se(t){if("string"!=typeof t)throw Error();return t}function Ee(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function Te(t){return null==t||"string"==typeof t?t:void 0}function Ie(t,e,n){if(null!=t&&"object"==typeof t&&t.C===Qt)return t;if(Array.isArray(t)){var r=Ht(t),i=r;return 0===i&&(i|=32&n),(i|=2&n)!==r&&Jt(t,i),new e(t)}}let xe,Pe,Ue,Oe,Le,Be;function ke(t){switch(typeof t){case"boolean":return Pe||=[0,void 0,!0];case"number":return t>0?void 0:0===t?Ue||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}function Fe(t,e,n){if(null==t&&(t=xe),xe=void 0,null==t){var r=96;n?(t=[n],r|=512):t=[],e&&(r=-16760833&r|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(2048&(r=Ht(t)))throw Error("farr");if(64&r)return t;if(r|=64,n&&(r|=512,n!==t[0]))throw Error("mid");t:{const i=(n=t).length;if(i){const t=i-1;if(ee(n[t])){if((e=t-(+!!(512&(r|=256))-1))>=1024)throw Error("pvtlmt");r=-16760833&r|(1023&e)<<14;break t}}if(e){if((e=Math.max(e,i-(+!!(512&r)-1)))>1024)throw Error("spvt");r=-16760833&r|(1023&e)<<14}}}return Jt(t,r),t}function je(t){if("function"!=typeof Proxy)return t;let e=Oe?.get(t);return e||(e=new Proxy(t,{set:(t,e,n)=>(de(),t[e]=n,!0)}),function(t,e){(Oe||=new WeakMap).set(t,e),(Le||=new WeakMap).set(e,t)}(t,e),e)}function Ve(t,e,n,r,i){if(null!=t){if(Array.isArray(t))t=re(t,void 0,0)?void 0:i&&2&Ht(t)?t:Ne(t,e,n,void 0!==r,i);else if(ee(t)){const o={};for(let s in t)o[s]=Ve(t[s],e,n,r,i);t=o}else t=e(t,r);return t}}function Ne(t,e,n,r,i){const o=r||n?Ht(t):0;r=r?!!(32&o):void 0;const s=Nt(t);for(let t=0;t<s.length;t++)s[t]=Ve(s[t],e,n,r,i);return n&&(ue(s,t),n(o,s)),s}function Ce(t){return t.C===Qt?t.toJSON():function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"boolean":return t?1:0;case"object":if(t)if(Array.isArray(t)){if(re(t,void 0,0))return}else{if(k(t))return P(t);if(t instanceof M){const e=t.g;return null==e?"":"string"==typeof e?e:t.g=P(e)}}}return t}(t)}function Me(t,e,n=Yt){if(null!=t){if(I&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var r=Ht(t);return 2&r?t:(e&&=0===r||!!(32&r)&&!(64&r||!(16&r)),e?(Jt(t,-12293&(34|r)),t):Ne(t,Me,4&r?Yt:n,!0,!0))}return t.C===Qt&&(n=t.l,t=2&(r=qt(n))?t:De(t,n,r,!0)),t}}function Ge(t){const e=t.l;return De(t,e,qt(e),!1)}function De(t,e,n,r){return t=t.constructor,xe=e=ze(e,n,r),e=new t(e),xe=void 0,e}function ze(t,e,n){const r=n||2&e?Yt:Kt,i=!!(32&e);return t=function(t,e,n){const r=Nt(t);var i=r.length;const o=256&e?r[i-1]:void 0;for(i+=o?-1:0,e=512&e?1:0;e<i;e++)r[e]=n(r[e]);if(o){e=r[e]={};for(const t in o)e[t]=n(o[t])}return ue(r,t),r}(t,e,(t=>Me(t,i,r))),Wt(t,32|(n?2:0)),t}function $e(t){const e=t.l,n=qt(e);return 2&n?De(t,e,n,!1):t}function We(t,e,n,r){return!(4&e)||null!=n&&(!r&&0===n&&(4096&e||8192&e)&&(t.constructor[zt]=1+(0|t.constructor[zt]))<5&&de(),0!==n&&!(n&e))}function Re(t,e){return qe(t=t.l,qt(t),e)}function He(t,e,n,r){if(!((e=r+(+!!(512&e)-1))<0||e>=t.length||e>=n))return t[e]}function qe(t,e,n,r){if(-1===n)return null;const i=e>>14&1023||536870912;if(!(n>=i)){var o=t.length;return r&&256&e&&null!=(r=t[o-1][n])?(He(t,e,i,n)&&null!=Dt&&((e=(t=fe??={})[Dt]||0)>=4||(t[Dt]=e+1,de())),r):He(t,e,i,n)}return 256&e?t[t.length-1][n]:void 0}function Je(t,e,n,r){const i=t.l;let o=qt(i);return oe(o),Ke(i,o,e,n,r),t}function Ke(t,e,n,r,i){const o=e>>14&1023||536870912;if(n>=o||i&&!g){let s=e;if(256&e)i=t[t.length-1];else{if(null==r)return s;i=t[o+(+!!(512&e)-1)]={},s|=256}return i[n]=r,n<o&&(t[n+(+!!(512&e)-1)]=void 0),s!==e&&Jt(t,s),s}return t[n+(+!!(512&e)-1)]=r,256&e&&(n in(t=t[t.length-1])&&delete t[n]),e}function Ye(t,e,n,r,i){var o=2&e;let s=qe(t,e,n,i);Array.isArray(s)||(s=Xt);const a=!(2&r);r=!(1&r);const u=!!(32&e);let c=Ht(s);return 0!==c||!u||o||a?1&c||(c|=1,Jt(s,c)):(c|=33,Jt(s,c)),o?(t=!1,2&c||(Wt(s,34),t=!!(4&c)),(r||t)&&Object.freeze(s)):(o=!!(2&c)||!!(2048&c),r&&o?(s=Nt(s),r=1,u&&!a&&(r|=32),Jt(s,r),Ke(t,e,n,s,i)):a&&32&c&&!o&&Rt(s,32)),s}function Xe(t){t=t.l;let e=qt(t);const n=qe(t,e,1),r=ne(n,!0,!!(34&e));return null!=r&&r!==n&&Ke(t,e,1,r),r}function Qe(t,e){return t=qe(t,e,1),Array.isArray(t)?t:Xt}function Ze(t,e){return 0===t&&(t=mn(t,e)),1|t}function tn(t){return!!(2&t)&&!!(4&t)||!!(2048&t)}function en(t,e){t=t.l;let n=qt(t);oe(n),Ke(t,n,2,""===e?void 0:e)}function nn(t,e,n,r){const i=qt(t);oe(i),t=Ye(t,i,e,2),r=n(r,!!(4&(e=Ht(t)))&&!!(4096&e)),t.push(r)}function rn(t){return t}function on(t,e){var n=gi;return un(sn(t=t.l),t,qt(t),n)===e?e:-1}function sn(t){if(Ct)return t[$t]??(t[$t]=new Map);if($t in t)return t[$t];const e=new Map;return Object.defineProperty(t,$t,{value:e}),e}function an(t,e,n,r){const i=sn(t),o=un(i,t,e,n);return o!==r&&(o&&(e=Ke(t,e,o)),i.set(n,r)),e}function un(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!=qe(e,n,o)&&(0!==i&&(n=Ke(e,n,i)),i=o)}return t.set(r,i),i}function cn(t,e,n,r){let i=qt(t);const o=qe(t,i,n,r);let s;if(null!=o&&o.C===Qt)return(e=$e(o))!==o&&Ke(t,i,n,e,r),e.l;if(Array.isArray(o)){const t=Ht(o);s=2&t?ze(o,t,!1):o,s=Fe(s,e[0],e[1])}else s=Fe(void 0,e[0],e[1]);return s!==o&&Ke(t,i,n,s,r),s}function ln(t,e,n,r){t=t.l;let i=qt(t);const o=qe(t,i,n,r);return(e=Ie(o,e,i))!==o&&null!=e&&Ke(t,i,n,e,r),e}function hn(t,e,n){if(null==(e=ln(t,e,n,!1)))return e;t=t.l;let r=qt(t);if(!(2&r)){const i=$e(e);i!==e&&Ke(t,r,n,e=i,!1)}return e}function fn(t,e,n,r,i,o){var s=!!(2&e);r=s?1:r,i=!!i,o&&=!s,s=Qe(t,e);var a=Ht(s),u=!!(4&a);if(!u){var c,l=s,h=e;(c=!!(2&(a=Ze(a,e))))&&(h|=2);let t=!c,r=!0,i=0,o=0;for(;i<l.length;i++){const e=Ie(l[i],n,h);if(e instanceof n){if(!c){const n=!!(2&Ht(e.l));t&&=!n,r&&=n}l[o++]=e}}o<i&&(l.length=o),a|=4,a=r?16|a:-17&a,Jt(l,a=t?8|a:-9&a),c&&Object.freeze(l)}if(o&&!(8&a||!s.length&&(1===r||4===r&&32&a))){for(tn(a)&&(s=Nt(s),a=mn(a,e),e=Ke(t,e,1,s)),n=s,o=a,l=0;l<n.length;l++)(a=n[l])!==(h=$e(a))&&(n[l]=h);o|=8,o=n.length?-17&o:16|o,Jt(n,o),a=o}let f;return 1===r||4===r&&32&a?tn(a)||(e=a,(a|=!s.length||16&a&&(!u||32&a)?2:2048)!==e&&Jt(s,a),Object.freeze(s)):(u=5===r&&(!!(32&a)||tn(a)||!!Oe?.get(s)),(2===r||u)&&tn(a)&&(s=Nt(s),a=yn(a=mn(a,e),e,i),Jt(s,a),e=Ke(t,e,1,s)),tn(a)||(t=a,(a=yn(a,e,i))!==t&&Jt(s,a)),u&&(f=je(s))),f||s}function dn(t,e){t=t.l;const n=qt(t);return fn(t,n,e,void 0===ce?2:p?5:2,!1,!(2&n))}function gn(t,e,n,r,i){return null==r&&(r=void 0),Je(t,n,r,i)}function pn(t,e,n){var r=Ai;null==n&&(n=void 0);t:{t=t.l;let i=qt(t);if(oe(i),null==n){const n=sn(t);if(un(n,t,i,r)!==e)break t;n.set(r,0)}else i=an(t,i,r,e);Ke(t,i,e,n)}}function mn(t,e){return-2049&(t=32|(2&e?2|t:-3&t))}function yn(t,e,n){return 32&e&&n||(t&=-33),t}function vn(t,e){var n=Kr;t=t.l;const r=qt(t);oe(r),t=fn(t,r,n,2,!0),e=null!=e?e:new n,t.push(e),2&Ht(e.l)?Rt(t,8):Rt(t,16)}function bn(t){return null==(t=Re(t,2))?t:ve(t)?"number"==typeof t?_e(t):Ae(t):void 0}function wn(t,e){return t??e}function _n(t,e,n){{const a=t.l;let u=qt(a);if(oe(u),null==n)Ke(a,u,e);else{n=Le?.get(n)||n;var r,i=Ht(n),o=i,s=!!(2&i)||Object.isFrozen(n);if((r=!s)&&(r=void 0===le||!1),We(t,i))for(i=21,s&&(n=Nt(n),o=0,i=yn(i=mn(i,u),u,!0)),t=0;t<n.length;t++)n[t]=Se(n[t]);r&&(n=Nt(n),o=0,i=yn(i=mn(i,u),u,!0)),i!==o&&Jt(n,i),Ke(a,u,e,n)}}}function An(t,e,n){nn(t.l,e,Se,n)}function Sn(t,e,n){e.g?e.j(t,e.g,e.i,n,!0):e.j(t,e.i,n,!0)}var En=class{constructor(t,e){this.l=Fe(t,e)}toJSON(){return Tn(this)}A(){return!!(2&Ht(this.l))}};function Tn(t){var e=Be?t.l:Ne(t.l,Ce,void 0,void 0,!1),n=!Be,r=d?void 0:t.constructor.v,i=qt(n?t.l:e);if(t=e.length){var o=e[t-1],s=ee(o);s?t--:o=void 0,i=+!!(512&i)-1;var a,u=e;if(s){t:{var c=o,l={};if(s=!1,c)for(var h in c){if(isNaN(+h)){l[h]=c[h];continue}let t=c[h];Array.isArray(t)&&(re(t,r,+h)||te(t)&&0===t.size)&&(t=null),null==t&&(s=!0),null!=t&&(l[h]=t)}if(s){for(var f in l)break t;l=null}else l=c}c=null==l?null!=o:l!==o}for(;t>0&&(h=u[f=t-1],f-=i,null==h||re(h,r,f)||te(h)&&0===h.size);t--)a=!0;(u!==e||c||a)&&(n?(a||c||l)&&(u.length=t):u=Array.prototype.slice.call(u,0,t),l&&u.push(l)),e=u}return e}function In(t){return Array.isArray(t)?t[0]instanceof Vt?t:[Ar,t]:[t,void 0]}function xn(t,e){if(Array.isArray(e)){var n=Ht(e);if(4&n)return e;for(var r=0,i=0;r<e.length;r++){const n=t(e[r]);null!=n&&(e[i++]=n)}return i<r&&(e.length=i),Jt(e,-12289&(5|n)),2&n&&Object.freeze(e),e}}En.prototype.C=Qt,En.prototype.toString=function(){try{return Be=!0,Tn(this).toString()}finally{Be=!1}};const Pn=Symbol();function Un(t){let e=t[Pn];if(!e){const n=Nn(t),r=Kn(t),i=r.j;e=i?(t,e)=>i(t,e,r):(t,e)=>{for(;gt(e)&&4!=e.i;){var i=e.m,o=r[i];if(!o){var s=r.F;s&&(s=s[i])&&(o=r[i]=On(s))}o&&o(e,t,i)||(i=(o=e).j,pt(o),o.G?o=void 0:(s=o.g.g-i,o.g.g=i,o=ft(o.g,s)),i=t,o&&(se||=Symbol(),(s=i[se])?s.push(o):i[se]=[o]))}n===Bn||n===kn||n.s||(t[ae||=Symbol()]=n)},t[Pn]=e}return e}function On(t){const e=(t=In(t))[0].g;if(t=t[1]){const n=Un(t),r=Kn(t).B;return(t,i,o)=>e(t,i,o,r,n)}return e}class Ln{}let Bn,kn;const Fn=Symbol();function jn(t,e,n){const r=n[1];let i;if(r){const n=r[Fn];i=n?n.B:ke(r[0]),t[e]=n??r}i&&i===Pe?(t.g||(t.g=new Set)).add(e):n[0]&&(t.i||(t.i=new Set)).add(e)}function Vn(t,e){return[t.j,!e||e[0]>0?void 0:e]}function Nn(t){var e=t[Fn];if(e)return e;if(!(e=Mn(t,t[Fn]=new Ln,Vn,Vn,jn)).F&&!e.i&&!e.g){let n=!0;for(let t in e)isNaN(t)||(n=!1);n?(ke(t[0])===Pe?kn?e=kn:((e=new Ln).B=ke(!0),e=kn=e):e=Bn||=new Ln,e=t[Fn]=e):e.s=!0}return e}function Cn(t,e,n){t[e]=n}function Mn(t,e,n,r,i=Cn){e.B=ke(t[0]);let o=0;var s=t[++o];s&&s.constructor===Object&&(e.F=s,"function"==typeof(s=t[++o])&&(e.j=s,e.m=t[++o],s=t[++o]));const a={};for(;Array.isArray(s)&&"number"==typeof s[0]&&s[0]>0;){for(var u=0;u<s.length;u++)a[s[u]]=s;s=t[++o]}for(u=1;void 0!==s;){let h;"number"==typeof s&&(u+=s,s=t[++o]);var c=void 0;if(s instanceof Vt?h=s:(h=Sr,o--),h.H){s=t[++o],c=t;var l=o;"function"==typeof s&&(s=s(),c[l]=s),c=s}for(l=u+1,"number"==typeof(s=t[++o])&&s<0&&(l-=s,s=t[++o]);u<l;u++){const t=a[u];i(e,u,c?r(h,c,t):n(h,t))}}return e}const Gn=Symbol();function Dn(t){let e=t[Gn];if(!e){const n=Rn(t);e=(t,e)=>Qn(t,e,n),t[Gn]=e}return e}const zn=Symbol();function $n(t){return t.i}function Wn(t,e){let n,r;const i=t.i;return(t,o,s)=>i(t,o,s,r||=Rn(e).B,n||=Dn(e))}function Rn(t){let e=t[zn];return e||(e=Mn(t,t[zn]={},$n,Wn),Yn(t),e)}const Hn=Symbol();function qn(t,e){const n=t.g;return e?(t,r,i)=>n(t,r,i,e):n}function Jn(t,e,n){const r=t.g;let i,o;return(t,s,a)=>r(t,s,a,o||=Kn(e).B,i||=Un(e),n)}function Kn(t){let e=t[Hn];return e||(Nn(t),e=Mn(t,t[Hn]={},qn,Jn),Yn(t),e)}function Yn(t){Hn in t&&Fn in t&&zn in t&&(t.length=0)}function Xn(t,e){var n=t[e];if(n)return n;if((n=t.F)&&(n=n[e])){var r=(n=In(n))[0].i;if(n=n[1]){const e=Dn(n),i=Rn(n).B;n=(n=t.m)?n(i,e):(t,n,o)=>r(t,n,o,i,e)}else n=r;return t[e]=n}}function Qn(t,e,n){for(var r=qt(t),i=+!!(512&r)-1,o=t.length,s=512&r?1:0,a=o+(256&r?-1:0);s<a;s++){const r=t[s];if(null==r)continue;const o=s-i,a=Xn(n,o);a&&a(e,r,o)}if(256&r){r=t[o-1];for(let t in r)i=+t,Number.isNaN(i)||null!=(o=r[t])&&(a=Xn(n,i))&&a(e,o,i)}if(t=se?t[se]:void 0)for(Lt(e,e.g.end()),n=0;n<t.length;n++)Lt(e,C(t[n])||new Uint8Array(0))}function Zn(t,e){return new Vt(t,e,!1,!1)}function tr(t,e){return new Vt(t,e,!0,!1)}function er(t,e,n){Ke(t,qt(t),e,n)}function nr(t,e,n){t:if(null!=e){if(ve(e)){if("string"==typeof e){e=Ae(e);break t}if("number"==typeof e){e=_e(e);break t}}e=void 0}null!=e&&("string"==typeof e&&Et(e),null!=e&&(Bt(t,n,0),"number"==typeof e?(t=t.g,Y(e),xt(t,q,J)):(n=Et(e),xt(t.g,n.i,n.g))))}function rr(t,e,n){null!=(e=be(e))&&null!=e&&(Bt(t,n,0),Ut(t.g,e))}function ir(t,e,n){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(Bt(t,n,0),t.g.g.push(e?1:0))}function or(t,e,n){null!=(e=Te(e))&&jt(t,n,c(e))}function sr(t,e,n,r,i){null!=(e=e instanceof En?e.l:Array.isArray(e)?Fe(e,r[0],r[1]):void 0)&&(n=kt(t,n),i(e,t),Ft(t,n))}function ar(t,e,n){null!=(e=null==e||"string"==typeof e||k(e)||e instanceof M?e:void 0)&&jt(t,n,$(e).buffer)}var ur,cr=Zn((function(t,e,n){return 5===t.i&&(er(e,n,at(t.g)),!0)}),(function(t,e,n){null!=(e=pe(e))&&(Bt(t,n,5),t=t.g,X(e),Ot(t))})),lr=tr((function(t,e,n){return(5===t.i||2===t.i)&&(e=Ye(e,qt(e),n,2,!1),2==t.i?bt(t,at,e):e.push(at(t.g)),!0)}),(function(t,e,n){if(null!=(e=xn(pe,e))&&e.length){Bt(t,n,2),Pt(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,X(e[r]),Ot(n)}})),hr=Zn((function(t,e,n){return 0===t.i&&(er(e,n,it(t.g,Z)),!0)}),nr),fr=Zn((function(t,e,n){return 0===t.i&&(er(e,n,0===(t=it(t.g,Z))?void 0:t),!0)}),nr),dr=Zn((function(t,e,n){return 0===t.i&&(er(e,n,it(t.g,Q)),!0)}),(function(t,e,n){t:if(null!=e){if(ve(e)){if("string"==typeof e){var r=Math.trunc(Number(e));Number.isSafeInteger(r)&&r>=0?e=String(r):(-1!==(r=e.indexOf("."))&&(e=e.substring(0,r)),we(e)||(nt(e),e=tt(q,J)));break t}if("number"==typeof e){e=(e=Math.trunc(e))>=0&&Number.isSafeInteger(e)?e:function(t){if(t<0){Y(t);const e=tt(q,J);return t=Number(e),Number.isSafeInteger(t)?t:e}return we(String(t))?t:(Y(t),Q(q,J))}(e);break t}}e=void 0}null!=e&&("string"==typeof e&&_t(e),null!=e&&(Bt(t,n,0),"number"==typeof e?(t=t.g,Y(e),xt(t,q,J)):(n=_t(e),xt(t.g,n.i,n.g))))})),gr=Zn((function(t,e,n){return 0===t.i&&(er(e,n,st(t.g)),!0)}),rr),pr=tr((function(t,e,n){return(0===t.i||2===t.i)&&(e=Ye(e,qt(e),n,2,!1),2==t.i?bt(t,st,e):e.push(st(t.g)),!0)}),(function(t,e,n){if(null!=(e=xn(be,e))&&e.length){n=kt(t,n);for(let n=0;n<e.length;n++)Ut(t.g,e[n]);Ft(t,n)}})),mr=Zn((function(t,e,n){return 0===t.i&&(er(e,n,0===(t=st(t.g))?void 0:t),!0)}),rr),yr=Zn((function(t,e,n){return 0===t.i&&(er(e,n,ot(t.g)),!0)}),ir),vr=Zn((function(t,e,n){return 0===t.i&&(er(e,n,!1===(t=ot(t.g))?void 0:t),!0)}),ir),br=tr((function(t,e,n){return 2===t.i&&(nn(e,n,rn,t=yt(t)),!0)}),(function(t,e,n){if(null!=(e=xn(Te,e)))for(let s=0;s<e.length;s++){var r=t,i=n,o=e[s];null!=o&&jt(r,i,c(o))}})),wr=Zn((function(t,e,n){return 2===t.i&&(er(e,n,""===(t=yt(t))?void 0:t),!0)}),or),_r=Zn((function(t,e,n){return 2===t.i&&(er(e,n,yt(t)),!0)}),or),Ar=new Vt((function(t,e,n,r,i){return 2===t.i&&(mt(t,cn(e,r,n,!0),i),!0)}),sr,!1,!0),Sr=new Vt((function(t,e,n,r,i){return 2===t.i&&(mt(t,cn(e,r,n),i),!0)}),sr,!1,!0);ur=new Vt((function(t,e,n,r,i){if(2!==t.i)return!1;r=Fe(void 0,r[0],r[1]);let o=qt(e);oe(o);let s=Ye(e,o,n,3);return o=qt(e),4&Ht(s)&&(s=Nt(s),Jt(s,-2079&(1|Ht(s))),Ke(e,o,n,s)),s.push(r),mt(t,r,i),!0}),(function(t,e,n,r,i){if(Array.isArray(e))for(let o=0;o<e.length;o++)sr(t,e[o],n,r,i)}),!0,!0);var Er=new Vt((function(t,e,n,r,i,o){return 2===t.i&&(an(e,qt(e),o,n),mt(t,e=cn(e,r,n),i),!0)}),sr,!1,!0),Tr=Zn((function(t,e,n){return 2===t.i&&(er(e,n,vt(t)),!0)}),ar),Ir=Zn((function(t,e,n){return 0===t.i&&(er(e,n,st(t.g)),!0)}),(function(t,e,n){null!=(e=be(e))&&(e=parseInt(e,10),Bt(t,n,0),Ut(t.g,e))})),xr=tr((function(t,e,n){return(0===t.i||2===t.i)&&(e=Ye(e,qt(e),n,2,!1),2==t.i?bt(t,ut,e):e.push(st(t.g)),!0)}),(function(t,e,n){if(null!=(e=xn(be,e))&&e.length){n=kt(t,n);for(let n=0;n<e.length;n++)Ut(t.g,e[n]);Ft(t,n)}}));class Pr{constructor(t,e){this.i=t,this.g=e,this.j=gn,this.defaultValue=void 0}}function Ur(t,e){return(n,r)=>{if(wt.length){const t=wt.pop();t.o(r),ct(t.g,n,r),n=t}else n=new class{constructor(t,e){if(dt.length){const n=dt.pop();ct(n,t,e),t=n}else t=new class{constructor(t,e){this.i=null,this.m=!1,this.g=this.j=this.s=0,ct(this,t,e)}clear(){this.i=null,this.m=!1,this.g=this.j=this.s=0,this.D=!1}}(t,e);this.g=t,this.j=this.g.g,this.i=this.m=-1,this.o(e)}o({G:t=!1}={}){this.G=t}}(n,r);try{const r=new t,o=r.l;Un(e)(o,n);var i=r}finally{n.g.clear(),n.m=-1,n.i=-1,wt.length<100&&wt.push(n)}return i}}var Or=[0,wr,Zn((function(t,e,n){return 2===t.i&&(er(e,n,(t=vt(t))===N()?void 0:t),!0)}),(function(t,e,n){if(null!=e){if(e instanceof En){const r=e.N;return void(r&&(e=r(e),null!=e&&jt(t,n,$(e).buffer)))}if(Array.isArray(e))return}ar(t,e,n)}))],Lr=[0,_r],Br=[0,gr,Ir,yr,-1,pr,Ir,-1],kr=[0,yr,-1],Fr=class extends En{constructor(){super()}};Fr.v=[6];var jr=[0,yr,_r,yr,Ir,-1,xr,_r,-1,kr,Ir],Vr=[0,_r,-2],Nr=class extends En{constructor(){super()}},Cr=[0],Mr=[0,gr,yr,1,yr,-3],Gr=class extends En{constructor(t){super(t,2)}},Dr={},zr=[-2,Dr,yr];Dr[336783863]=[0,_r,yr,-1,gr,[0,[1,2,3,4,5,6],Er,Cr,Er,jr,Er,Vr,Er,Mr,Er,Br,Er,[0,_r,-2]],Lr,yr,[0,[1,3],[2,4],Er,[0,pr],-1,Er,[0,br],-1,ur,[0,_r,-1]],_r];var $r=[0,wr,vr],Wr=[0,fr,-1,vr,-3,fr,pr,wr,mr,fr,-1,vr,mr,vr,-2,wr],Rr=[-1,{}],Hr=[0,_r,1,Rr],qr=[0,_r,br,Rr];function Jr(t){An(t,3,"TEXT:text_in")}var Kr=class extends En{constructor(t){super(t,500)}o(t){return gn(this,0,7,t)}};Kr.v=[3,4,5,6,8,13,17,1005];var Yr=[-500,wr,-1,br,-3,zr,ur,Or,mr,-1,Hr,qr,ur,$r,wr,Wr,mr,br,987,br],Xr=[0,wr,-1,Rr],Qr=[-500,_r,-1,[-1,{}],998,_r],Zr=[-500,_r,br,-1,[-2,{},yr],997,br,-1],ti=[-500,_r,br,Rr,998,br];function ei(t){An(t,10,"text_in")}var ni,ri=class extends En{constructor(){super(void 0,500)}o(t){return gn(this,0,1001,t)}};ri.v=[1,6,7,9,10,15,16,17,14,1002],ri.prototype.g=(ni=[-500,ur,Yr,4,ur,Qr,ur,Zr,mr,ur,ti,br,mr,Hr,qr,ur,Xr,br,-2,Wr,wr,-1,vr,979,Rr,ur,Or],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}}}};Qn(this.l,t,Rn(ni)),Lt(t,t.g.end());const e=new Uint8Array(t.i),n=t.j,r=n.length;let i=0;for(let t=0;t<r;t++){const r=n[t];e.set(r,i),i+=r.length}return t.j=[e],e});var ii=class extends En{constructor(t){super(t)}},oi=[0,gr,cr,_r,-1],si=class extends En{constructor(t){super(t)}g(){return dn(this,ii)}};si.v=[1];var ai=class extends En{constructor(t){super(t)}},ui=[0,1,gr,_r,[0,ur,oi]],ci=class extends En{constructor(t){super(t)}};ci.v=[1];var li=Ur(ci,[0,ur,ui,hr]),hi=class extends En{constructor(t){super(t)}};hi.v=[1];var fi=class extends En{constructor(t){super(t)}I(){const t=Xe(this);return null==t?N():t}},di=class extends En{constructor(t){super(t)}},gi=[1,2],pi=[0,gi,Er,[0,lr],Er,[0,Tr],gr,_r],mi=class extends En{constructor(t){super(t)}};mi.v=[1];var yi=Ur(mi,[0,ur,pi,hr]),vi=class extends En{constructor(t){super(t)}};vi.v=[4,5];var bi=class extends En{constructor(t){super(t)}},wi=[0,yr,-1],_i=class extends En{constructor(t){super(t)}},Ai=[1,2,3,4,5],Si=class extends En{constructor(t){super(t)}g(){return null!=Xe(this)}i(){return null!=Te(Re(this,2))}},Ei=class extends En{constructor(t){super(t)}},Ti=[0,[0,Tr,_r,[0,gr,hr,-1],[0,dr,hr]],yr,[0,Ai,Er,Mr,Er,jr,Er,Br,Er,Cr,Er,Vr],Ir],Ii=class extends En{constructor(t){super(t)}},xi=new Pr(462704549,Ii);Dr[462704549]=[0,Ti,[0,_r,gr,cr,br,-1]];var Pi=class extends En{constructor(t){super(t)}},Ui=new Pr(477589892,Pi);function Oi(t,e){if(e=e?Ge(e):new vi,void 0!==t.displayNamesLocale?Je(e,1,Ee(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Je(e,1),void 0!==t.maxResults){var n=t.maxResults;if(null!=n){if("number"!=typeof n)throw ge();if(!Number.isFinite(n))throw ge();n|=0}Je(e,2,n)}else"maxResults"in t&&Je(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}`);Je(e,3,n)}else"scoreThreshold"in t&&Je(e,3);return void 0!==t.categoryAllowlist?_n(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&Je(e,4),void 0!==t.categoryDenylist?_n(e,5,t.categoryDenylist):"categoryDenylist"in t&&Je(e,5),e}function Li(t){const e={classifications:dn(t,ai).map((t=>function(t,e=-1,n=""){return{categories:t.map((t=>{var e=wn(be(Re(t,1)),0)??-1;const n=t.l;let r=qt(n);const i=qe(n,r,2),o=pe(i);return null!=o&&o!==i&&Ke(n,r,2,o),{index:e,score:o??0??0,categoryName:wn(Te(Re(t,3)),"")??"",displayName:wn(Te(Re(t,4)),"")??""}})),headIndex:e,headName:n}}(hn(t,si,4)?.g()??[],wn(be(Re(t,2)),0),wn(Te(Re(t,3)),""))))};return null!=bn(t)&&(e.timestampMs=wn(bn(t),0)),e}function Bi(t){return Array.from(t,(t=>t>127?t-256:t))}function ki(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 Fi;Dr[477589892]=[0,Ti,wi];const ji=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 Vi(){if(void 0===Fi)try{await WebAssembly.instantiate(ji),Fi=!0}catch{Fi=!1}return Fi}async function Ni(t,e=""){const n=await Vi()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var Ci=class{};function Mi(){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 Gi(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())}Ci.forVisionTasks=function(t){return Ni("vision",t)},Ci.forTextTasks=function(t){return Ni("text",t)},Ci.forGenAiExperimentalTasks=function(t){return Ni("genai_experimental",t)},Ci.forGenAiTasks=function(t){return Ni("genai",t)},Ci.forAudioTasks=function(t){return Ni("audio",t)},Ci.isSimdSupported=function(){return Vi()};function Di(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 zi(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 $i(t,e,n){t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=n}function Wi(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 Ri=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:Mi()?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?'),Di(this,r||"input_audio",(r=>{Di(this,i=i||"audio_header",(i=>{this.h._configureAudio(r,i,t,e,n)}))}))}setAutoResizeCanvas(t){this.j=t}setAutoRenderToScreen(t){this.h._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.h.gpuOriginForWebTexturesIsBottomLeft=t}attachErrorListener(t){this.h.errorListener=t}attachEmptyPacketListener(t,e){this.h.emptyPacketListeners=this.h.emptyPacketListeners||{},this.h.emptyPacketListeners[t]=e}addAudioToStream(t,e,n){this.addAudioToStreamWithShape(t,0,0,e,n)}addAudioToStreamWithShape(t,e,n,r,i){const o=4*t.length;this.i!==o&&(this.g&&this.h._free(this.g),this.g=this.h._malloc(o),this.i=o),this.h.HEAPF32.set(t,this.g/4),Di(this,r,(t=>{this.h._addAudioToInputStream(this.g,e,n,t,i)}))}addGpuBufferToStream(t,e,n){Di(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){Di(this,e,(e=>{this.h._addBoolToInputStream(t,e,n)}))}addDoubleToStream(t,e,n){Di(this,e,(e=>{this.h._addDoubleToInputStream(t,e,n)}))}addFloatToStream(t,e,n){Di(this,e,(e=>{this.h._addFloatToInputStream(t,e,n)}))}addIntToStream(t,e,n){Di(this,e,(e=>{this.h._addIntToInputStream(t,e,n)}))}addUintToStream(t,e,n){Di(this,e,(e=>{this.h._addUintToInputStream(t,e,n)}))}addStringToStream(t,e,n){Di(this,e,(e=>{Di(this,t,(t=>{this.h._addStringToInputStream(t,e,n)}))}))}addStringRecordToStream(t,e,n){Di(this,e,(e=>{zi(this,Object.keys(t),(r=>{zi(this,Object.values(t),(i=>{this.h._addFlatHashMapToInputStream(r,i,Object.keys(t).length,e,n)}))}))}))}addProtoToStream(t,e,n,r){Di(this,n,(n=>{Di(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){Di(this,t,(t=>{this.h._addEmptyPacketToInputStream(t,e)}))}addBoolVectorToStream(t,e,n){Di(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){Di(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){Di(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){Di(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){Di(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){Di(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)Di(this,e,(t=>{this.h._addStringVectorEntry(r,t)}));this.h._addStringVectorToInputStream(r,e,n)}))}addBoolToInputSidePacket(t,e){Di(this,e,(e=>{this.h._addBoolToInputSidePacket(t,e)}))}addDoubleToInputSidePacket(t,e){Di(this,e,(e=>{this.h._addDoubleToInputSidePacket(t,e)}))}addFloatToInputSidePacket(t,e){Di(this,e,(e=>{this.h._addFloatToInputSidePacket(t,e)}))}addIntToInputSidePacket(t,e){Di(this,e,(e=>{this.h._addIntToInputSidePacket(t,e)}))}addUintToInputSidePacket(t,e){Di(this,e,(e=>{this.h._addUintToInputSidePacket(t,e)}))}addStringToInputSidePacket(t,e){Di(this,e,(e=>{Di(this,t,(t=>{this.h._addStringToInputSidePacket(t,e)}))}))}addProtoToInputSidePacket(t,e,n){Di(this,n,(n=>{Di(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){Di(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){Di(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){Di(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){Di(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){Di(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){Di(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)Di(this,e,(t=>{this.h._addStringVectorEntry(n,t)}));this.h._addStringVectorToInputSidePacket(n,e)}))}attachBoolListener(t,e){$i(this,t,e),Di(this,t,(t=>{this.h._attachBoolListener(t)}))}attachBoolVectorListener(t,e){Wi(this,t,e),Di(this,t,(t=>{this.h._attachBoolVectorListener(t)}))}attachIntListener(t,e){$i(this,t,e),Di(this,t,(t=>{this.h._attachIntListener(t)}))}attachIntVectorListener(t,e){Wi(this,t,e),Di(this,t,(t=>{this.h._attachIntVectorListener(t)}))}attachUintListener(t,e){$i(this,t,e),Di(this,t,(t=>{this.h._attachUintListener(t)}))}attachUintVectorListener(t,e){Wi(this,t,e),Di(this,t,(t=>{this.h._attachUintVectorListener(t)}))}attachDoubleListener(t,e){$i(this,t,e),Di(this,t,(t=>{this.h._attachDoubleListener(t)}))}attachDoubleVectorListener(t,e){Wi(this,t,e),Di(this,t,(t=>{this.h._attachDoubleVectorListener(t)}))}attachFloatListener(t,e){$i(this,t,e),Di(this,t,(t=>{this.h._attachFloatListener(t)}))}attachFloatVectorListener(t,e){Wi(this,t,e),Di(this,t,(t=>{this.h._attachFloatVectorListener(t)}))}attachStringListener(t,e){$i(this,t,e),Di(this,t,(t=>{this.h._attachStringListener(t)}))}attachStringVectorListener(t,e){Wi(this,t,e),Di(this,t,(t=>{this.h._attachStringVectorListener(t)}))}attachProtoListener(t,e,n){$i(this,t,e),Di(this,t,(t=>{this.h._attachProtoListener(t,n||!1)}))}attachProtoVectorListener(t,e,n){Wi(this,t,e),Di(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?'),$i(this,t,((t,n)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,n)})),Di(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 Hi=class extends Ri{};async function qi(t,e,n){return t=await(async(t,e,n,r)=>{if(e&&await Gi(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(n&&(await Gi(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 Ji(t,e,n){return qi(t,e,n)}function Ki(t,e){const n=hn(t.baseOptions,Si,1)||new Si;"string"==typeof e?(Je(n,2,Ee(e)),Je(n,1)):e instanceof Uint8Array&&(Je(n,1,ne(e,!1,!1)),Je(n,2)),gn(t.baseOptions,0,1,n)}function Yi(t,e){const n=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(hn(t.baseOptions,Si,1)?.g()||hn(t.baseOptions,Si,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=hn(t.baseOptions,_i,3);if(!n){var r=n=new _i;pn(r,4,new Nr)}"delegate"in e&&("GPU"===e.delegate?pn(e=n,2,r=new Fr):pn(e=n,4,r=new Nr)),gn(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),Ki(t,"/model.dat"),t.s()}));if(n.modelAssetBuffer instanceof Uint8Array)Ki(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=>{Ki(t,e),t.s()}));return t.s(),Promise.resolve()}function Xi(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 Qi(t,e){t.j=Math.max(t.j,e)}var Zi=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),Xi(this)}finishProcessing(){this.g.finishProcessing(),Xi(this)}close(){this.g.closeGraph()}};Zi.prototype.close=Zi.prototype.close,function(e,n){e=e.split(".");var r,i=t;e[0]in i||void 0===i.execScript||i.execScript("var "+e[0]);for(;e.length&&(r=e.shift());)e.length||void 0===n?i=i[r]&&i[r]!==Object.prototype[r]?i[r]:i[r]={}:i[r]=n}("TaskRunner",Zi);var to=class extends Zi{constructor(t,e){super(new Hi(t,e)),this.u={languages:[]},gn(t=this.i=new Ii,0,1,e=new Ei)}o(t){return gn(this.i,0,2,Oi(t,hn(this.i,vi,2))),Yi(this,t)}get baseOptions(){return hn(this.i,Ei,1)}set baseOptions(t){gn(this.i,0,1,t)}K(t){return this.u={languages:[]},this.g.addStringToStream(t,"text_in",this.j+1),this.finishProcessing(),this.u}s(){var t=new ri;ei(t),An(t,15,"classifications_out");const e=new Gr;Sn(e,xi,this.i);const n=new Kr;en(n,Ee("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),Jr(n),An(n,4,"CLASSIFICATIONS:classifications_out"),n.o(e),vn(t,n),this.g.attachProtoListener("classifications_out",((t,e)=>{if(({classifications:t}=Li(li(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}))),Qi(this,e)})),this.g.attachEmptyPacketListener("classifications_out",(t=>{Qi(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};to.prototype.detect=to.prototype.K,to.prototype.setOptions=to.prototype.o,to.createFromModelPath=function(t,e){return Ji(to,t,{baseOptions:{modelAssetPath:e}})},to.createFromModelBuffer=function(t,e){return Ji(to,t,{baseOptions:{modelAssetBuffer:e}})},to.createFromOptions=function(t,e){return Ji(to,t,e)};var eo=class extends Zi{constructor(t,e){super(new Hi(t,e)),this.u={classifications:[]},gn(t=this.i=new Ii,0,1,e=new Ei)}o(t){return gn(this.i,0,2,Oi(t,hn(this.i,vi,2))),Yi(this,t)}get baseOptions(){return hn(this.i,Ei,1)}set baseOptions(t){gn(this.i,0,1,t)}J(t){return this.u={classifications:[]},this.g.addStringToStream(t,"text_in",this.j+1),this.finishProcessing(),this.u}s(){var t=new ri;ei(t),An(t,15,"classifications_out");const e=new Gr;Sn(e,xi,this.i);const n=new Kr;en(n,Ee("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),Jr(n),An(n,4,"CLASSIFICATIONS:classifications_out"),n.o(e),vn(t,n),this.g.attachProtoListener("classifications_out",((t,e)=>{this.u=Li(li(t)),Qi(this,e)})),this.g.attachEmptyPacketListener("classifications_out",(t=>{Qi(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};eo.prototype.classify=eo.prototype.J,eo.prototype.setOptions=eo.prototype.o,eo.createFromModelPath=function(t,e){return Ji(eo,t,{baseOptions:{modelAssetPath:e}})},eo.createFromModelBuffer=function(t,e){return Ji(eo,t,{baseOptions:{modelAssetBuffer:e}})},eo.createFromOptions=function(t,e){return Ji(eo,t,e)};var no=class extends Zi{constructor(t,e){super(new Hi(t,e)),this.u={embeddings:[]},gn(t=this.i=new Pi,0,1,e=new Ei)}o(t){var e=this.i,n=hn(this.i,bi,2);return n=n?Ge(n):new bi,void 0!==t.l2Normalize?Je(n,1,me(t.l2Normalize)):"l2Normalize"in t&&Je(n,1),void 0!==t.quantize?Je(n,2,me(t.quantize)):"quantize"in t&&Je(n,2),gn(e,0,2,n),Yi(this,t)}get baseOptions(){return hn(this.i,Ei,1)}set baseOptions(t){gn(this.i,0,1,t)}L(t){return this.g.addStringToStream(t,"text_in",this.j+1),this.finishProcessing(),this.u}s(){var t=new ri;ei(t),An(t,15,"embeddings_out");const e=new Gr;Sn(e,Ui,this.i);const n=new Kr;en(n,Ee("mediapipe.tasks.text.text_embedder.TextEmbedderGraph")),Jr(n),An(n,4,"EMBEDDINGS:embeddings_out"),n.o(e),vn(t,n),this.g.attachProtoListener("embeddings_out",((t,e)=>{t=yi(t),this.u=function(t){return{embeddings:dn(t,di).map((t=>{const e={headIndex:wn(be(Re(t,3)),0)??-1,headName:wn(Te(Re(t,4)),"")??""};if(void 0!==ln(t,hi,on(t,1))){var n=hn(t,hi,on(t,1)),r=void 0===ce?2:p?5:2,i=n.l;const s=2&(t=qt(i))?1:r;r=Qe(i,t);let a=Ht(r);if(We(n,a,void 0,!1)){(4&a||Object.isFrozen(r))&&(r=Nt(r),a=mn(a,t),t=Ke(i,t,1,r));let e=n=0;for(;n<r.length;n++){const t=pe(r[n]);null!=t&&(r[e++]=t)}e<n&&(r.length=e),a=Ze(a,t),a=-12289&(20|a),Jt(r,a),2&a&&Object.freeze(r)}var o;1===s||4===s&&32&a?tn(a)||(t=a,a|=2,a!==t&&Jt(r,a),Object.freeze(r)):(n=5===s&&(!!(32&a)||tn(a)||!!Oe?.get(r)),(2===s||n)&&tn(a)&&(r=Nt(r),a=mn(a,t),a=yn(a,t,!1),Jt(r,a),t=Ke(i,t,1,r)),tn(a)||(i=a,a=yn(a,t,!1),a!==i&&Jt(r,a)),n&&(o=je(r))),e.floatEmbedding=(o||r).slice()}else o=new Uint8Array(0),e.quantizedEmbedding=hn(t,fi,on(t,2))?.I()?.i()??o;return e})),timestampMs:wn(bn(t),0)}}(t),Qi(this,e)})),this.g.attachEmptyPacketListener("embeddings_out",(t=>{Qi(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};no.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=ki(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=ki(Bi(t.quantizedEmbedding),Bi(e.quantizedEmbedding))}return t},no.prototype.embed=no.prototype.L,no.prototype.setOptions=no.prototype.o,no.createFromModelPath=function(t,e){return Ji(no,t,{baseOptions:{modelAssetPath:e}})},no.createFromModelBuffer=function(t,e){return Ji(no,t,{baseOptions:{modelAssetBuffer:e}})},no.createFromOptions=function(t,e){return Ji(no,t,e)},exports.FilesetResolver=Ci,exports.LanguageDetector=to,exports.TextClassifier=eo,exports.TextEmbedder=no;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t="undefined"!=typeof self?self:{};function e(e,n){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!=(e=r&&r[e])?e:n}function n(){throw Error("Invalid UTF8")}function r(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}let i,o;const s="undefined"!=typeof TextDecoder;let a;const u="undefined"!=typeof TextEncoder;function c(t){if(u)t=(a||=new TextEncoder).encode(t);else{let n=0;const r=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(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}const l=e(1,!0);var h,f=e(610401301,!1),d=e(188588736,!0),g=e(645172343,l),p=e(653718497,l);const m=t.navigator;function y(t){return!!f&&(!!h&&h.brands.some((({brand:e})=>e&&-1!=e.indexOf(t))))}function v(e){var n;return(n=t.navigator)&&(n=n.userAgent)||(n=""),-1!=n.indexOf(e)}function b(){return!!f&&(!!h&&h.brands.length>0)}function w(){return b()?y("Chromium"):(v("Chrome")||v("CriOS"))&&!(!b()&&v("Edge"))||v("Silk")}h=m&&m.userAgentData||null;var _=!b()&&(v("Trident")||v("MSIE"));!v("Android")||w(),w(),v("Safari")&&(w()||!b()&&v("Coast")||!b()&&v("Opera")||!b()&&v("Edge")||(b()?y("Microsoft Edge"):v("Edg/"))||b()&&y("Opera"));var A={},S=null;function E(t){var e=t.length,n=3*e/4;n%3?n=Math.floor(n):-1!="=.".indexOf(t[e-1])&&(n=-1!="=.".indexOf(t[e-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),i=S[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}T();for(var r=0;;){var i=n(-1),o=n(0),s=n(64),a=n(64);if(64===a&&-1===i)break;e(i<<2|o>>4),64!=s&&(e(o<<4&240|s>>2),64!=a&&e(s<<6&192|a))}}(t,(function(t){r[i++]=t})),i!==n?r.subarray(0,i):r}function T(){if(!S){S={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;n<5;n++){var r=t.concat(e[n].split(""));A[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===S[o]&&(S[o]=i)}}}}var I="undefined"!=typeof Uint8Array,x=!_&&"function"==typeof btoa;function P(t){if(!x){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 U=/[-_.]/g,O={"-":"+",_:"/",".":"="};function L(t){return O[t]||""}function B(t){if(!x)return E(t);U.test(t)&&(t=t.replace(U,L)),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 k(t){return I&&null!=t&&t instanceof Uint8Array}var F={};let j;function V(t){if(t!==F)throw Error("illegal external caller")}function N(){return j||=new M(null,F)}function C(t){V(F);var e=t.g;return null==(e=null==e||k(e)?e:"string"==typeof e?B(e):null)?e:t.g=e}var M=class{constructor(t,e){if(V(e),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}i(){return new Uint8Array(C(this)||0)}};function G(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}let D;function z(){const e=Error();G(e,"incident"),function(e){t.setTimeout((()=>{throw e}),0)}(e)}function $(){const t=Error("int32");return G(t,"warning"),t}function W(){return"function"==typeof BigInt}function R(t){return Array.prototype.slice.call(t)}var H="function"==typeof Symbol&&"symbol"==typeof Symbol();function q(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():t}var J=q(),K=q("2ex"),Y=q("0dg"),X=q("1oa"),Q=H?(t,e)=>{t[J]|=e}:(t,e)=>{void 0!==t.g?t.g|=e:Object.defineProperties(t,{g:{value:e,configurable:!0,writable:!0,enumerable:!1}})},Z=H?(t,e)=>{t[J]&=~e}:(t,e)=>{void 0!==t.g&&(t.g&=~e)},tt=H?t=>0|t[J]:t=>0|t.g,et=H?t=>t[J]:t=>t.g,nt=H?(t,e)=>{t[J]=e}:(t,e)=>{void 0!==t.g?t.g=e:Object.defineProperties(t,{g:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function rt(t,e){nt(e,-14591&(0|t))}function it(t,e){nt(e,-14557&(34|t))}var ot,st={},at={};function ut(t){return!(!t||"object"!=typeof t||t.g!==at)}function ct(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}function lt(t,e,n){if(null!=t)if("string"==typeof t)t=t?new M(t,F):N();else if(t.constructor!==M)if(k(t))t=t.length?new M(n?t:new Uint8Array(t),F):N();else{if(!e)throw Error();t=void 0}return t}function ht(t,e,n){if(!Array.isArray(t)||t.length)return!1;const r=tt(t);return!!(1&r)||!(!e||!(Array.isArray(e)?e.includes(n):e.has(n)))&&(nt(t,1|r),!0)}const ft=[];function dt(t){if(2&t)throw Error()}let gt,pt;function mt(t,e){(e=gt?e[gt]:void 0)&&(t[gt]=R(e))}nt(ft,55),ot=Object.freeze(ft);var yt=Object.freeze({});Object.freeze({});var vt=Object.freeze({});const bt="function"==typeof Uint8Array.prototype.slice;let wt,_t=0,At=0;function St(t){const e=t>>>0;_t=e,At=(t-e)/4294967296>>>0}function Et(t){if(t<0){St(-t);const[e,n]=Lt(_t,At);_t=e>>>0,At=n>>>0}else St(t)}function Tt(t){const e=wt||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),At=0,_t=e.getUint32(0,!0)}function It(t,e){return 4294967296*e+(t>>>0)}function xt(t,e){const n=2147483648&e;return n&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),t=It(t,e),n?-t:t}function Pt(t,e){if(t>>>=0,(e>>>=0)<=2097151)var n=""+(4294967296*e+t);else W()?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+Ut(n)+Ut(t));return n}function Ut(t){return t=String(t),"0000000".slice(t.length)+t}function Ot(t){if(t.length<16)Et(Number(t));else if(W())t=BigInt(t),_t=Number(t&BigInt(4294967295))>>>0,At=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);At=_t=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));At*=1e6,_t=1e6*_t+e,_t>=4294967296&&(At+=Math.trunc(_t/4294967296),At>>>=0,_t>>>=0)}if(e){const[t,e]=Lt(_t,At);_t=t,At=e}}}function Lt(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function Bt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function kt(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 Ft=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function jt(t){const e=typeof t;return"number"===e?Number.isFinite(t):"string"===e&&Ft.test(t)}function Vt(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t&&Number.isFinite(t)?0|t:void 0}function Nt(t){return"-"!==t[0]&&(t.length<20||20===t.length&&Number(t.substring(0,6))<184467)}function Ct(t){return t=Math.trunc(t),Number.isSafeInteger(t)||(Et(t),t=xt(_t,At)),t}function Mt(t){var e=Math.trunc(Number(t));if(Number.isSafeInteger(e))return String(e);if(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),!("-"===t[0]?t.length<20||20===t.length&&Number(t.substring(0,7))>-922337:t.length<19||19===t.length&&Number(t.substring(0,6))<922337))if(Ot(t),t=_t,2147483648&(e=At))if(W())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,r]=Lt(t,e);t="-"+Pt(n,r)}else t=Pt(t,e);return t}function Gt(t){if("string"!=typeof t)throw Error();return t}function Dt(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function zt(t){return null==t||"string"==typeof t?t:void 0}function $t(t,e,n){if(null!=t&&"object"==typeof t&&t.C===st)return t;if(Array.isArray(t)){var r=tt(t),i=r;return 0===i&&(i|=32&n),(i|=2&n)!==r&&nt(t,i),new e(t)}}function Wt(t){if("function"!=typeof Proxy)return t;let e=Rt?.get(t);return e||(e=new Proxy(t,{set:(t,e,n)=>(z(),t[e]=n,!0)}),function(t,e){(Rt||=new WeakMap).set(t,e),(Ht||=new WeakMap).set(e,t)}(t,e),e)}let Rt,Ht,qt,Jt,Kt;function Yt(t){switch(typeof t){case"boolean":return Jt||=[0,void 0,!0];case"number":return t>0?void 0:0===t?Kt||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}function Xt(t,e,n){if(null==t&&(t=qt),qt=void 0,null==t){var r=96;n?(t=[n],r|=512):t=[],e&&(r=-16760833&r|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(2048&(r=tt(t)))throw Error("farr");if(64&r)return t;if(r|=64,n&&(r|=512,n!==t[0]))throw Error("mid");t:{const i=(n=t).length;if(i){const t=i-1;if(ct(n[t])){if((e=t-(+!!(512&(r|=256))-1))>=1024)throw Error("pvtlmt");r=-16760833&r|(1023&e)<<14;break t}}if(e){if((e=Math.max(e,i-(+!!(512&r)-1)))>1024)throw Error("spvt");r=-16760833&r|(1023&e)<<14}}}return nt(t,r),t}function Qt(t,e,n,r,i){if(null!=t){if(Array.isArray(t))t=ht(t,void 0,0)?void 0:i&&2&tt(t)?t:Zt(t,e,n,void 0!==r,i);else if(ct(t)){const o={};for(let s in t)o[s]=Qt(t[s],e,n,r,i);t=o}else t=e(t,r);return t}}function Zt(t,e,n,r,i){const o=r||n?tt(t):0;r=r?!!(32&o):void 0;const s=R(t);for(let t=0;t<s.length;t++)s[t]=Qt(s[t],e,n,r,i);return n&&(mt(s,t),n(o,s)),s}function te(t){return t.C===st?t.toJSON():function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"boolean":return t?1:0;case"object":if(t)if(Array.isArray(t)){if(ht(t,void 0,0))return}else{if(k(t))return P(t);if(t instanceof M){const e=t.g;return null==e?"":"string"==typeof e?e:t.g=P(e)}}}return t}(t)}function ee(t,e,n=it){if(null!=t){if(I&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var r=tt(t);return 2&r?t:(e&&=0===r||!!(32&r)&&!(64&r||!(16&r)),e?(nt(t,-12293&(34|r)),t):Zt(t,ee,4&r?it:n,!0,!0))}return t.C===st&&(n=t.l,t=2&(r=et(n))?t:re(t,n,r,!0)),t}}function ne(t){const e=t.l;return re(t,e,et(e),!1)}function re(t,e,n,r){return t=t.constructor,qt=e=ie(e,n,r),e=new t(e),qt=void 0,e}function ie(t,e,n){const r=n||2&e?it:rt,i=!!(32&e);return t=function(t,e,n){const r=R(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 mt(r,t),r}(t,e,(t=>ee(t,i,r))),Q(t,32|(n?2:0)),t}function oe(t){const e=t.l,n=et(e);return 2&n?re(t,e,n,!1):t}function se(t,e,n,r){return!(4&e)||null!=n&&(!r&&0===n&&(4096&e||8192&e)&&(t.constructor[Y]=1+(0|t.constructor[Y]))<5&&z(),0!==n&&!(n&e))}function ae(t,e){return ce(t=t.l,et(t),e)}function ue(t,e,n,r){if(!((e=r+(+!!(512&e)-1))<0||e>=t.length||e>=n))return t[e]}function ce(t,e,n,r){if(-1===n)return null;const i=e>>14&1023||536870912;if(!(n>=i)){var o=t.length;return r&&256&e&&null!=(r=t[o-1][n])?(ue(t,e,i,n)&&null!=K&&((e=(t=D??={})[K]||0)>=4||(t[K]=e+1,z())),r):ue(t,e,i,n)}return 256&e?t[t.length-1][n]:void 0}function le(t,e,n,r){const i=t.l;let o=et(i);return dt(o),he(i,o,e,n,r),t}function he(t,e,n,r,i){const o=e>>14&1023||536870912;if(n>=o||i&&!g){let s=e;if(256&e)i=t[t.length-1];else{if(null==r)return s;i=t[o+(+!!(512&e)-1)]={},s|=256}return i[n]=r,n<o&&(t[n+(+!!(512&e)-1)]=void 0),s!==e&&nt(t,s),s}return t[n+(+!!(512&e)-1)]=r,256&e&&(n in(t=t[t.length-1])&&delete t[n]),e}function fe(t,e,n,r,i){var o=2&e;let s=ce(t,e,n,i);Array.isArray(s)||(s=ot);const a=!(2&r);r=!(1&r);const u=!!(32&e);let c=tt(s);return 0!==c||!u||o||a?1&c||(c|=1,nt(s,c)):(c|=33,nt(s,c)),o?(t=!1,2&c||(Q(s,34),t=!!(4&c)),(r||t)&&Object.freeze(s)):(o=!!(2&c)||!!(2048&c),r&&o?(s=R(s),r=1,u&&!a&&(r|=32),nt(s,r),he(t,e,n,s,i)):a&&32&c&&!o&&Z(s,32)),s}function de(t){t=t.l;let e=et(t);const n=ce(t,e,1),r=lt(n,!0,!!(34&e));return null!=r&&r!==n&&he(t,e,1,r),r}function ge(t,e){return t=ce(t,e,1),Array.isArray(t)?t:ot}function pe(t,e){return 0===t&&(t=Le(t,e)),1|t}function me(t){return!!(2&t)&&!!(4&t)||!!(2048&t)}function ye(t,e){t=t.l;let n=et(t);dt(n),he(t,n,2,""===e?void 0:e)}function ve(t,e,n,r){const i=et(t);dt(i),t=fe(t,i,e,2),r=n(r,!!(4&(e=tt(t)))&&!!(4096&e)),t.push(r)}function be(t){return t}function we(t,e){var n=li;return Se(_e(t=t.l),t,et(t),n)===e?e:-1}function _e(t){if(H)return t[X]??(t[X]=new Map);if(X in t)return t[X];const e=new Map;return Object.defineProperty(t,X,{value:e}),e}function Ae(t,e,n,r){const i=_e(t),o=Se(i,t,e,n);return o!==r&&(o&&(e=he(t,e,o)),i.set(n,r)),e}function Se(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!=ce(e,n,o)&&(0!==i&&(n=he(e,n,i)),i=o)}return t.set(r,i),i}function Ee(t,e,n,r){let i=et(t);const o=ce(t,i,n,r);let s;if(null!=o&&o.C===st)return(e=oe(o))!==o&&he(t,i,n,e,r),e.l;if(Array.isArray(o)){const t=tt(o);s=2&t?ie(o,t,!1):o,s=Xt(s,e[0],e[1])}else s=Xt(void 0,e[0],e[1]);return s!==o&&he(t,i,n,s,r),s}function Te(t,e,n,r){t=t.l;let i=et(t);const o=ce(t,i,n,r);return(e=$t(o,e,i))!==o&&null!=e&&he(t,i,n,e,r),e}function Ie(t,e,n){if(null==(e=Te(t,e,n,!1)))return e;t=t.l;let r=et(t);if(!(2&r)){const i=oe(e);i!==e&&he(t,r,n,e=i,!1)}return e}function xe(t,e,n,r,i,o){var s=!!(2&e);r=s?1:r,i=!!i,o&&=!s,s=ge(t,e);var a=tt(s),u=!!(4&a);if(!u){var c,l=s,h=e;(c=!!(2&(a=pe(a,e))))&&(h|=2);let t=!c,r=!0,i=0,o=0;for(;i<l.length;i++){const e=$t(l[i],n,h);if(e instanceof n){if(!c){const n=!!(2&tt(e.l));t&&=!n,r&&=n}l[o++]=e}}o<i&&(l.length=o),a|=4,a=r?16|a:-17&a,nt(l,a=t?8|a:-9&a),c&&Object.freeze(l)}if(o&&!(8&a||!s.length&&(1===r||4===r&&32&a))){for(me(a)&&(s=R(s),a=Le(a,e),e=he(t,e,1,s)),n=s,o=a,l=0;l<n.length;l++)(a=n[l])!==(h=oe(a))&&(n[l]=h);o|=8,o=n.length?-17&o:16|o,nt(n,o),a=o}let f;return 1===r||4===r&&32&a?me(a)||(e=a,(a|=!s.length||16&a&&(!u||32&a)?2:2048)!==e&&nt(s,a),Object.freeze(s)):(u=5===r&&(!!(32&a)||me(a)||!!Rt?.get(s)),(2===r||u)&&me(a)&&(s=R(s),a=Be(a=Le(a,e),e,i),nt(s,a),e=he(t,e,1,s)),me(a)||(t=a,(a=Be(a,e,i))!==t&&nt(s,a)),u&&(f=Wt(s))),f||s}function Pe(t,e){t=t.l;const n=et(t);return xe(t,n,e,void 0===yt?2:p?5:2,!1,!(2&n))}function Ue(t,e,n,r,i){return null==r&&(r=void 0),le(t,n,r,i)}function Oe(t,e,n){var r=vi;null==n&&(n=void 0);t:{t=t.l;let i=et(t);if(dt(i),null==n){const n=_e(t);if(Se(n,t,i,r)!==e)break t;n.set(r,0)}else i=Ae(t,i,r,e);he(t,i,e,n)}}function Le(t,e){return-2049&(t=32|(2&e?2|t:-3&t))}function Be(t,e,n){return 32&e&&n||(t&=-33),t}function ke(t,e){var n=Rr;t=t.l;const r=et(t);dt(r),t=xe(t,r,n,2,!0),e=null!=e?e:new n,t.push(e),2&tt(e.l)?Z(t,8):Z(t,16)}function Fe(t){return null==(t=ae(t,2))?t:jt(t)?"number"==typeof t?Ct(t):Mt(t):void 0}function je(t,e){return t??e}function Ve(t,e,n){{const a=t.l;let u=et(a);if(dt(u),null==n)he(a,u,e);else{n=Ht?.get(n)||n;var r,i=tt(n),o=i,s=!!(2&i)||Object.isFrozen(n);if((r=!s)&&(r=void 0===vt||!1),se(t,i))for(i=21,s&&(n=R(n),o=0,i=Be(i=Le(i,u),u,!0)),t=0;t<n.length;t++)n[t]=Gt(n[t]);r&&(n=R(n),o=0,i=Be(i=Le(i,u),u,!0)),i!==o&&nt(n,i),he(a,u,e,n)}}}function Ne(t,e,n){ve(t.l,e,Gt,n)}function Ce(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function Me(){return Error("Failed to read varint, encoding is invalid.")}function Ge(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function De(t){if("string"==typeof t)return{buffer:B(t),A:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),A:!1};if(t.constructor===Uint8Array)return{buffer:t,A:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),A:!1};if(t.constructor===M)return{buffer:C(t)||new Uint8Array(0),A:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),A:!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 ze(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(Je(t,a),n<128)return e(r>>>0,i>>>0);throw Me()}function $e(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 Je(t,n),!!(127&e)}throw Me()}function We(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 Me();return Je(t,n),i}function Re(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],Je(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?t*Math.pow(2,-149)*i:t*Math.pow(2,r-150)*(i+Math.pow(2,23))}function He(t){return We(t)}function qe(t,e,{D:n=!1}={}){t.D=n,e&&(e=De(e),t.i=e.buffer,t.m=e.A,t.s=0,t.j=t.i.length,t.g=t.s)}function Je(t,e){if(t.g=e,e>t.j)throw Ge(t.j,e)}function Ke(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 Ge(e,t.j-n);return t.g=r,n}function Ye(t,e){if(0==e)return N();var n=Ke(t,e);return t.D&&t.m?n=t.i.subarray(n,n+e):(t=t.i,n=n===(e=n+e)?new Uint8Array(0):bt?t.slice(n,e):new Uint8Array(t.subarray(n,e))),0==n.length?N():new M(n,F)}var Xe=[];function Qe(t){var e=t.g;if(e.g==e.j)return!1;t.j=t.g.g;var n=We(t.g)>>>0;if(e=n>>>3,!((n&=7)>=0&&n<=5))throw Ce(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 Ze(t){switch(t.i){case 0:0!=t.i?Ze(t):$e(t.g);break;case 1:Je(t=t.g,t.g+8);break;case 2:if(2!=t.i)Ze(t);else{var e=We(t.g)>>>0;Je(t=t.g,t.g+e)}break;case 5:Je(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!Qe(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.i){if(t.m!=e)throw Error("Unmatched end-group tag");break}Ze(t)}break;default:throw Ce(t.i,t.j)}}function tn(t,e,n){const r=t.g.j,i=We(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 en(t){var e=We(t.g)>>>0,a=Ke(t=t.g,e);if(t=t.i,s){var u,c=t;(u=o)||(u=o=new TextDecoder("utf-8",{fatal:!0})),e=a+e,c=0===a&&e===c.length?c:c.subarray(a,e);try{var l=u.decode(c)}catch(t){if(void 0===i){try{u.decode(new Uint8Array([128]))}catch(t){}try{u.decode(new Uint8Array([97])),i=!0}catch(t){i=!1}}throw!i&&(o=void 0),t}}else{e=(l=a)+e,a=[];let i,o=null;for(;l<e;){var h=t[l++];h<128?a.push(h):h<224?l>=e?n():(i=t[l++],h<194||128!=(192&i)?(l--,n()):a.push((31&h)<<6|63&i)):h<240?l>=e-1?n():(i=t[l++],128!=(192&i)||224===h&&i<160||237===h&&i>=160||128!=(192&(u=t[l++]))?(l--,n()):a.push((15&h)<<12|(63&i)<<6|63&u)):h<=244?l>=e-2?n():(i=t[l++],128!=(192&i)||i-144+(h<<28)>>30!=0||128!=(192&(u=t[l++]))||128!=(192&(c=t[l++]))?(l--,n()):(h=(7&h)<<18|(63&i)<<12|(63&u)<<6|63&c,h-=65536,a.push(55296+(h>>10&1023),56320+(1023&h)))):n(),a.length>=8192&&(o=r(o,a),a.length=0)}l=r(o,a)}return l}function nn(t){const e=We(t.g)>>>0;return Ye(t.g,e)}function rn(t,e,n){var r=We(t.g)>>>0;for(r=t.g.g+r;t.g.g<r;)n.push(e(t.g))}var on=[];let sn;function an(t,e,n){e.g?e.j(t,e.g,e.i,n,!0):e.j(t,e.i,n,!0)}var un=class{constructor(t,e){this.l=Xt(t,e)}toJSON(){return cn(this)}A(){return!!(2&tt(this.l))}};function cn(t){var e=sn?t.l:Zt(t.l,te,void 0,void 0,!1),n=!sn,r=d?void 0:t.constructor.v,i=et(n?t.l:e);if(t=e.length){var o=e[t-1],s=ct(o);s?t--:o=void 0,i=+!!(512&i)-1;var a,u=e;if(s){t:{var c=o,l={};if(s=!1,c)for(var h in c){if(isNaN(+h)){l[h]=c[h];continue}let t=c[h];Array.isArray(t)&&(ht(t,r,+h)||ut(t)&&0===t.size)&&(t=null),null==t&&(s=!0),null!=t&&(l[h]=t)}if(s){for(var f in l)break t;l=null}else l=c}c=null==l?null!=o:l!==o}for(;t>0&&(h=u[f=t-1],f-=i,null==h||ht(h,r,f)||ut(h)&&0===h.size);t--)a=!0;(u!==e||c||a)&&(n?(a||c||l)&&(u.length=t):u=Array.prototype.slice.call(u,0,t),l&&u.push(l)),e=u}return e}function ln(t){return t?/^\d+$/.test(t)?(Ot(t),new hn(_t,At)):null:fn||=new hn(0,0)}un.prototype.C=st,un.prototype.toString=function(){try{return sn=!0,cn(this).toString()}finally{sn=!1}};var hn=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let fn;function dn(t){return t?/^-?\d+$/.test(t)?(Ot(t),new gn(_t,At)):null:pn||=new gn(0,0)}var gn=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let pn;function mn(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 yn(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function vn(t,e){if(e>=0)yn(t,e);else{for(let n=0;n<9;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function bn(t){var e=_t;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 wn(t,e){0!==e.length&&(t.j.push(e),t.i+=e.length)}function _n(t,e,n){yn(t.g,8*e+n)}function An(t,e){return _n(t,e,2),e=t.g.end(),wn(t,e),e.push(t.i),e}function Sn(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 En(t,e,n){_n(t,e,2),yn(t.g,n.length),wn(t,t.g.end()),wn(t,n)}class Tn{constructor(t,e,n,r){this.g=t,this.i=e,this.j=n,this.H=r}}function In(t){return Array.isArray(t)?t[0]instanceof Tn?t:[Ar,t]:[t,void 0]}function xn(t,e){if(Array.isArray(e)){var n=tt(e);if(4&n)return e;for(var r=0,i=0;r<e.length;r++){const n=t(e[r]);null!=n&&(e[i++]=n)}return i<r&&(e.length=i),nt(e,-12289&(5|n)),2&n&&Object.freeze(e),e}}const Pn=Symbol();function Un(t){let e=t[Pn];if(!e){const n=Nn(t),r=Kn(t),i=r.j;e=i?(t,e)=>i(t,e,r):(t,e)=>{for(;Qe(e)&&4!=e.i;){var i=e.m,o=r[i];if(!o){var s=r.F;s&&(s=s[i])&&(o=r[i]=On(s))}o&&o(e,t,i)||(i=(o=e).j,Ze(o),o.G?o=void 0:(s=o.g.g-i,o.g.g=i,o=Ye(o.g,s)),i=t,o&&(gt||=Symbol(),(s=i[gt])?s.push(o):i[gt]=[o]))}n===Bn||n===kn||n.s||(t[pt||=Symbol()]=n)},t[Pn]=e}return e}function On(t){const e=(t=In(t))[0].g;if(t=t[1]){const n=Un(t),r=Kn(t).B;return(t,i,o)=>e(t,i,o,r,n)}return e}class Ln{}let Bn,kn;const Fn=Symbol();function jn(t,e,n){const r=n[1];let i;if(r){const n=r[Fn];i=n?n.B:Yt(r[0]),t[e]=n??r}i&&i===Jt?(t.g||(t.g=new Set)).add(e):n[0]&&(t.i||(t.i=new Set)).add(e)}function Vn(t,e){return[t.j,!e||e[0]>0?void 0:e]}function Nn(t){var e=t[Fn];if(e)return e;if(!(e=Mn(t,t[Fn]=new Ln,Vn,Vn,jn)).F&&!e.i&&!e.g){let n=!0;for(let t in e)isNaN(t)||(n=!1);n?(Yt(t[0])===Jt?kn?e=kn:((e=new Ln).B=Yt(!0),e=kn=e):e=Bn||=new Ln,e=t[Fn]=e):e.s=!0}return e}function Cn(t,e,n){t[e]=n}function Mn(t,e,n,r,i=Cn){e.B=Yt(t[0]);let o=0;var s=t[++o];s&&s.constructor===Object&&(e.F=s,"function"==typeof(s=t[++o])&&(e.j=s,e.m=t[++o],s=t[++o]));const a={};for(;Array.isArray(s)&&"number"==typeof s[0]&&s[0]>0;){for(var u=0;u<s.length;u++)a[s[u]]=s;s=t[++o]}for(u=1;void 0!==s;){let h;"number"==typeof s&&(u+=s,s=t[++o]);var c=void 0;if(s instanceof Tn?h=s:(h=Sr,o--),h.H){s=t[++o],c=t;var l=o;"function"==typeof s&&(s=s(),c[l]=s),c=s}for(l=u+1,"number"==typeof(s=t[++o])&&s<0&&(l-=s,s=t[++o]);u<l;u++){const t=a[u];i(e,u,c?r(h,c,t):n(h,t))}}return e}const Gn=Symbol();function Dn(t){let e=t[Gn];if(!e){const n=Rn(t);e=(t,e)=>Qn(t,e,n),t[Gn]=e}return e}const zn=Symbol();function $n(t){return t.i}function Wn(t,e){let n,r;const i=t.i;return(t,o,s)=>i(t,o,s,r||=Rn(e).B,n||=Dn(e))}function Rn(t){let e=t[zn];return e||(e=Mn(t,t[zn]={},$n,Wn),Yn(t),e)}const Hn=Symbol();function qn(t,e){const n=t.g;return e?(t,r,i)=>n(t,r,i,e):n}function Jn(t,e,n){const r=t.g;let i,o;return(t,s,a)=>r(t,s,a,o||=Kn(e).B,i||=Un(e),n)}function Kn(t){let e=t[Hn];return e||(Nn(t),e=Mn(t,t[Hn]={},qn,Jn),Yn(t),e)}function Yn(t){Hn in t&&Fn in t&&zn in t&&(t.length=0)}function Xn(t,e){var n=t[e];if(n)return n;if((n=t.F)&&(n=n[e])){var r=(n=In(n))[0].i;if(n=n[1]){const e=Dn(n),i=Rn(n).B;n=(n=t.m)?n(i,e):(t,n,o)=>r(t,n,o,i,e)}else n=r;return t[e]=n}}function Qn(t,e,n){for(var r=et(t),i=+!!(512&r)-1,o=t.length,s=512&r?1:0,a=o+(256&r?-1:0);s<a;s++){const r=t[s];if(null==r)continue;const o=s-i,a=Xn(n,o);a&&a(e,r,o)}if(256&r){r=t[o-1];for(let t in r)i=+t,Number.isNaN(i)||null!=(o=r[t])&&(a=Xn(n,i))&&a(e,o,i)}if(t=gt?t[gt]:void 0)for(wn(e,e.g.end()),n=0;n<t.length;n++)wn(e,C(t[n])||new Uint8Array(0))}function Zn(t,e){return new Tn(t,e,!1,!1)}function tr(t,e){return new Tn(t,e,!0,!1)}function er(t,e,n){he(t,et(t),e,n)}function nr(t,e,n){t:if(null!=e){if(jt(e)){if("string"==typeof e){e=Mt(e);break t}if("number"==typeof e){e=Ct(e);break t}}e=void 0}null!=e&&("string"==typeof e&&dn(e),null!=e&&(_n(t,n,0),"number"==typeof e?(t=t.g,Et(e),mn(t,_t,At)):(n=dn(e),mn(t.g,n.i,n.g))))}function rr(t,e,n){null!=(e=Vt(e))&&null!=e&&(_n(t,n,0),vn(t.g,e))}function ir(t,e,n){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(_n(t,n,0),t.g.g.push(e?1:0))}function or(t,e,n){null!=(e=zt(e))&&En(t,n,c(e))}function sr(t,e,n,r,i){null!=(e=e instanceof un?e.l:Array.isArray(e)?Xt(e,r[0],r[1]):void 0)&&(n=An(t,n),i(e,t),Sn(t,n))}function ar(t,e,n){null!=(e=null==e||"string"==typeof e||k(e)||e instanceof M?e:void 0)&&En(t,n,De(e).buffer)}var ur,cr=Zn((function(t,e,n){return 5===t.i&&(er(e,n,Re(t.g)),!0)}),(function(t,e,n){null!=(e=Bt(e))&&(_n(t,n,5),t=t.g,Tt(e),bn(t))})),lr=tr((function(t,e,n){return(5===t.i||2===t.i)&&(e=fe(e,et(e),n,2,!1),2==t.i?rn(t,Re,e):e.push(Re(t.g)),!0)}),(function(t,e,n){if(null!=(e=xn(Bt,e))&&e.length){_n(t,n,2),yn(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,Tt(e[r]),bn(n)}})),hr=Zn((function(t,e,n){return 0===t.i&&(er(e,n,ze(t.g,xt)),!0)}),nr),fr=Zn((function(t,e,n){return 0===t.i&&(er(e,n,0===(t=ze(t.g,xt))?void 0:t),!0)}),nr),dr=Zn((function(t,e,n){return 0===t.i&&(er(e,n,ze(t.g,It)),!0)}),(function(t,e,n){t:if(null!=e){if(jt(e)){if("string"==typeof e){var r=Math.trunc(Number(e));Number.isSafeInteger(r)&&r>=0?e=String(r):(-1!==(r=e.indexOf("."))&&(e=e.substring(0,r)),Nt(e)||(Ot(e),e=Pt(_t,At)));break t}if("number"==typeof e){e=(e=Math.trunc(e))>=0&&Number.isSafeInteger(e)?e:function(t){if(t<0){Et(t);const e=Pt(_t,At);return t=Number(e),Number.isSafeInteger(t)?t:e}return Nt(String(t))?t:(Et(t),It(_t,At))}(e);break t}}e=void 0}null!=e&&("string"==typeof e&&ln(e),null!=e&&(_n(t,n,0),"number"==typeof e?(t=t.g,Et(e),mn(t,_t,At)):(n=ln(e),mn(t.g,n.i,n.g))))})),gr=Zn((function(t,e,n){return 0===t.i&&(er(e,n,We(t.g)),!0)}),rr),pr=tr((function(t,e,n){return(0===t.i||2===t.i)&&(e=fe(e,et(e),n,2,!1),2==t.i?rn(t,We,e):e.push(We(t.g)),!0)}),(function(t,e,n){if(null!=(e=xn(Vt,e))&&e.length){n=An(t,n);for(let n=0;n<e.length;n++)vn(t.g,e[n]);Sn(t,n)}})),mr=Zn((function(t,e,n){return 0===t.i&&(er(e,n,0===(t=We(t.g))?void 0:t),!0)}),rr),yr=Zn((function(t,e,n){return 0===t.i&&(er(e,n,$e(t.g)),!0)}),ir),vr=Zn((function(t,e,n){return 0===t.i&&(er(e,n,!1===(t=$e(t.g))?void 0:t),!0)}),ir),br=tr((function(t,e,n){return 2===t.i&&(ve(e,n,be,t=en(t)),!0)}),(function(t,e,n){if(null!=(e=xn(zt,e)))for(let s=0;s<e.length;s++){var r=t,i=n,o=e[s];null!=o&&En(r,i,c(o))}})),wr=Zn((function(t,e,n){return 2===t.i&&(er(e,n,""===(t=en(t))?void 0:t),!0)}),or),_r=Zn((function(t,e,n){return 2===t.i&&(er(e,n,en(t)),!0)}),or),Ar=new Tn((function(t,e,n,r,i){return 2===t.i&&(tn(t,Ee(e,r,n,!0),i),!0)}),sr,!1,!0),Sr=new Tn((function(t,e,n,r,i){return 2===t.i&&(tn(t,Ee(e,r,n),i),!0)}),sr,!1,!0);ur=new Tn((function(t,e,n,r,i){if(2!==t.i)return!1;r=Xt(void 0,r[0],r[1]);let o=et(e);dt(o);let s=fe(e,o,n,3);return o=et(e),4&tt(s)&&(s=R(s),nt(s,-2079&(1|tt(s))),he(e,o,n,s)),s.push(r),tn(t,r,i),!0}),(function(t,e,n,r,i){if(Array.isArray(e))for(let o=0;o<e.length;o++)sr(t,e[o],n,r,i)}),!0,!0);var Er=new Tn((function(t,e,n,r,i,o){return 2===t.i&&(Ae(e,et(e),o,n),tn(t,e=Ee(e,r,n),i),!0)}),sr,!1,!0),Tr=Zn((function(t,e,n){return 2===t.i&&(er(e,n,nn(t)),!0)}),ar),Ir=Zn((function(t,e,n){return 0===t.i&&(er(e,n,We(t.g)),!0)}),(function(t,e,n){null!=(e=Vt(e))&&(e=parseInt(e,10),_n(t,n,0),vn(t.g,e))})),xr=tr((function(t,e,n){return(0===t.i||2===t.i)&&(e=fe(e,et(e),n,2,!1),2==t.i?rn(t,He,e):e.push(We(t.g)),!0)}),(function(t,e,n){if(null!=(e=xn(Vt,e))&&e.length){n=An(t,n);for(let n=0;n<e.length;n++)vn(t.g,e[n]);Sn(t,n)}}));class Pr{constructor(t,e){this.i=t,this.g=e,this.j=Ue,this.defaultValue=void 0}}function Ur(t,e){return(n,r)=>{if(on.length){const t=on.pop();t.o(r),qe(t.g,n,r),n=t}else n=new class{constructor(t,e){if(Xe.length){const n=Xe.pop();qe(n,t,e),t=n}else t=new class{constructor(t,e){this.i=null,this.m=!1,this.g=this.j=this.s=0,qe(this,t,e)}clear(){this.i=null,this.m=!1,this.g=this.j=this.s=0,this.D=!1}}(t,e);this.g=t,this.j=this.g.g,this.i=this.m=-1,this.o(e)}o({G:t=!1}={}){this.G=t}}(n,r);try{const r=new t,o=r.l;Un(e)(o,n);var i=r}finally{n.g.clear(),n.m=-1,n.i=-1,on.length<100&&on.push(n)}return i}}var Or=[0,wr,Zn((function(t,e,n){return 2===t.i&&(er(e,n,(t=nn(t))===N()?void 0:t),!0)}),(function(t,e,n){if(null!=e){if(e instanceof un){const r=e.N;return void(r&&(e=r(e),null!=e&&En(t,n,De(e).buffer)))}if(Array.isArray(e))return}ar(t,e,n)}))],Lr=[0,_r],Br=[0,gr,Ir,yr,-1,pr,Ir,-1],kr=[0,yr,-1],Fr=class extends un{constructor(){super()}};Fr.v=[6];var jr=[0,yr,_r,yr,Ir,-1,xr,_r,-1,kr,Ir],Vr=[0,_r,-2],Nr=class extends un{constructor(){super()}},Cr=[0],Mr=[0,gr,yr,1,yr,-3],Gr=class extends un{constructor(t){super(t,2)}},Dr={};Dr[336783863]=[0,_r,yr,-1,gr,[0,[1,2,3,4,5,6],Er,Cr,Er,jr,Er,Vr,Er,Mr,Er,Br,Er,[0,_r,-2]],Lr,yr,[0,[1,3],[2,4],Er,[0,pr],-1,Er,[0,br],-1,ur,[0,_r,-1]],_r];var zr=[0,wr,vr],$r=[0,fr,-1,vr,-3,fr,pr,wr,mr,fr,-1,vr,mr,vr,-2,wr];function Wr(t){Ne(t,3,"TEXT:text_in")}var Rr=class extends un{constructor(t){super(t,500)}o(t){return Ue(this,0,7,t)}};Rr.v=[3,4,5,6,8,13,17,1005];var Hr=[-1,{}],qr=[0,_r,1,Hr],Jr=[0,_r,br,Hr],Kr=[-500,wr,-1,br,-3,[-2,Dr,yr],ur,Or,mr,-1,qr,Jr,ur,zr,wr,$r,mr,br,987,br],Yr=[0,wr,-1,Hr];function Xr(t){Ne(t,10,"text_in")}var Qr,Zr=class extends un{constructor(){super(void 0,500)}o(t){return Ue(this,0,1001,t)}};Zr.v=[1,6,7,9,10,15,16,17,14,1002],Zr.prototype.g=(Qr=[-500,ur,Kr,4,ur,[-500,_r,-1,[-1,{}],998,_r],ur,[-500,_r,br,-1,[-2,{},yr],997,br,-1],mr,ur,[-500,_r,br,Hr,998,br],br,mr,qr,Jr,ur,Yr,br,-2,$r,wr,-1,vr,979,Hr,ur,Or],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}}}};Qn(this.l,t,Rn(Qr)),wn(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 ti=class extends un{constructor(t){super(t)}},ei=[0,gr,cr,_r,-1],ni=class extends un{constructor(t){super(t)}g(){return Pe(this,ti)}};ni.v=[1];var ri=class extends un{constructor(t){super(t)}},ii=[0,1,gr,_r,[0,ur,ei]],oi=class extends un{constructor(t){super(t)}};oi.v=[1];var si=Ur(oi,[0,ur,ii,hr]),ai=class extends un{constructor(t){super(t)}};ai.v=[1];var ui=class extends un{constructor(t){super(t)}I(){const t=de(this);return null==t?N():t}},ci=class extends un{constructor(t){super(t)}},li=[1,2],hi=[0,li,Er,[0,lr],Er,[0,Tr],gr,_r],fi=class extends un{constructor(t){super(t)}};fi.v=[1];var di=Ur(fi,[0,ur,hi,hr]),gi=class extends un{constructor(t){super(t)}};gi.v=[4,5];var pi=class extends un{constructor(t){super(t)}},mi=[0,yr,-1],yi=class extends un{constructor(t){super(t)}},vi=[1,2,3,4,5],bi=class extends un{constructor(t){super(t)}g(){return null!=de(this)}i(){return null!=zt(ae(this,2))}},wi=class extends un{constructor(t){super(t)}},_i=[0,[0,Tr,_r,[0,gr,hr,-1],[0,dr,hr]],yr,[0,vi,Er,Mr,Er,jr,Er,Br,Er,Cr,Er,Vr],Ir],Ai=class extends un{constructor(t){super(t)}},Si=new Pr(462704549,Ai);Dr[462704549]=[0,_i,[0,_r,gr,cr,br,-1]];var Ei=class extends un{constructor(t){super(t)}},Ti=new Pr(477589892,Ei);function Ii(t,e){if(e=e?ne(e):new gi,void 0!==t.displayNamesLocale?le(e,1,Dt(t.displayNamesLocale)):void 0===t.displayNamesLocale&&le(e,1),void 0!==t.maxResults){var n=t.maxResults;if(null!=n){if("number"!=typeof n)throw $();if(!Number.isFinite(n))throw $();n|=0}le(e,2,n)}else"maxResults"in t&&le(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}`);le(e,3,n)}else"scoreThreshold"in t&&le(e,3);return void 0!==t.categoryAllowlist?Ve(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&le(e,4),void 0!==t.categoryDenylist?Ve(e,5,t.categoryDenylist):"categoryDenylist"in t&&le(e,5),e}function xi(t){const e={classifications:Pe(t,ri).map((t=>function(t,e=-1,n=""){return{categories:t.map((t=>{var e=je(Vt(ae(t,1)),0)??-1;const n=t.l;let r=et(n);const i=ce(n,r,2),o=Bt(i);return null!=o&&o!==i&&he(n,r,2,o),{index:e,score:o??0??0,categoryName:je(zt(ae(t,3)),"")??"",displayName:je(zt(ae(t,4)),"")??""}})),headIndex:e,headName:n}}(Ie(t,ni,4)?.g()??[],je(Vt(ae(t,2)),0),je(zt(ae(t,3)),""))))};return null!=Fe(t)&&(e.timestampMs=je(Fe(t),0)),e}function Pi(t){return Array.from(t,(t=>t>127?t-256:t))}function Ui(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 Oi;Dr[477589892]=[0,_i,mi];const Li=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 Bi(){if(void 0===Oi)try{await WebAssembly.instantiate(Li),Oi=!0}catch{Oi=!1}return Oi}async function ki(t,e=""){const n=await Bi()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var Fi=class{};function ji(){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 Vi(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())}Fi.forVisionTasks=function(t){return ki("vision",t)},Fi.forTextTasks=function(t){return ki("text",t)},Fi.forGenAiExperimentalTasks=function(t){return ki("genai_experimental",t)},Fi.forGenAiTasks=function(t){return ki("genai",t)},Fi.forAudioTasks=function(t){return ki("audio",t)},Fi.isSimdSupported=function(){return Bi()};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"),n(e=t.h.stringToNewUTF8(e)),t.h._free(e)}function Ci(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 Mi(t,e,n){t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=n}function Gi(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 Di=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:ji()?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?'),Ni(this,r||"input_audio",(r=>{Ni(this,i=i||"audio_header",(i=>{this.h._configureAudio(r,i,t,e,n)}))}))}setAutoResizeCanvas(t){this.j=t}setAutoRenderToScreen(t){this.h._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.h.gpuOriginForWebTexturesIsBottomLeft=t}attachErrorListener(t){this.h.errorListener=t}attachEmptyPacketListener(t,e){this.h.emptyPacketListeners=this.h.emptyPacketListeners||{},this.h.emptyPacketListeners[t]=e}addAudioToStream(t,e,n){this.addAudioToStreamWithShape(t,0,0,e,n)}addAudioToStreamWithShape(t,e,n,r,i){const o=4*t.length;this.i!==o&&(this.g&&this.h._free(this.g),this.g=this.h._malloc(o),this.i=o),this.h.HEAPF32.set(t,this.g/4),Ni(this,r,(t=>{this.h._addAudioToInputStream(this.g,e,n,t,i)}))}addGpuBufferToStream(t,e,n){Ni(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){Ni(this,e,(e=>{this.h._addBoolToInputStream(t,e,n)}))}addDoubleToStream(t,e,n){Ni(this,e,(e=>{this.h._addDoubleToInputStream(t,e,n)}))}addFloatToStream(t,e,n){Ni(this,e,(e=>{this.h._addFloatToInputStream(t,e,n)}))}addIntToStream(t,e,n){Ni(this,e,(e=>{this.h._addIntToInputStream(t,e,n)}))}addUintToStream(t,e,n){Ni(this,e,(e=>{this.h._addUintToInputStream(t,e,n)}))}addStringToStream(t,e,n){Ni(this,e,(e=>{Ni(this,t,(t=>{this.h._addStringToInputStream(t,e,n)}))}))}addStringRecordToStream(t,e,n){Ni(this,e,(e=>{Ci(this,Object.keys(t),(r=>{Ci(this,Object.values(t),(i=>{this.h._addFlatHashMapToInputStream(r,i,Object.keys(t).length,e,n)}))}))}))}addProtoToStream(t,e,n,r){Ni(this,n,(n=>{Ni(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){Ni(this,t,(t=>{this.h._addEmptyPacketToInputStream(t,e)}))}addBoolVectorToStream(t,e,n){Ni(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){Ni(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){Ni(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){Ni(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){Ni(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){Ni(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)Ni(this,e,(t=>{this.h._addStringVectorEntry(r,t)}));this.h._addStringVectorToInputStream(r,e,n)}))}addBoolToInputSidePacket(t,e){Ni(this,e,(e=>{this.h._addBoolToInputSidePacket(t,e)}))}addDoubleToInputSidePacket(t,e){Ni(this,e,(e=>{this.h._addDoubleToInputSidePacket(t,e)}))}addFloatToInputSidePacket(t,e){Ni(this,e,(e=>{this.h._addFloatToInputSidePacket(t,e)}))}addIntToInputSidePacket(t,e){Ni(this,e,(e=>{this.h._addIntToInputSidePacket(t,e)}))}addUintToInputSidePacket(t,e){Ni(this,e,(e=>{this.h._addUintToInputSidePacket(t,e)}))}addStringToInputSidePacket(t,e){Ni(this,e,(e=>{Ni(this,t,(t=>{this.h._addStringToInputSidePacket(t,e)}))}))}addProtoToInputSidePacket(t,e,n){Ni(this,n,(n=>{Ni(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){Ni(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){Ni(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){Ni(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){Ni(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){Ni(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){Ni(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)Ni(this,e,(t=>{this.h._addStringVectorEntry(n,t)}));this.h._addStringVectorToInputSidePacket(n,e)}))}attachBoolListener(t,e){Mi(this,t,e),Ni(this,t,(t=>{this.h._attachBoolListener(t)}))}attachBoolVectorListener(t,e){Gi(this,t,e),Ni(this,t,(t=>{this.h._attachBoolVectorListener(t)}))}attachIntListener(t,e){Mi(this,t,e),Ni(this,t,(t=>{this.h._attachIntListener(t)}))}attachIntVectorListener(t,e){Gi(this,t,e),Ni(this,t,(t=>{this.h._attachIntVectorListener(t)}))}attachUintListener(t,e){Mi(this,t,e),Ni(this,t,(t=>{this.h._attachUintListener(t)}))}attachUintVectorListener(t,e){Gi(this,t,e),Ni(this,t,(t=>{this.h._attachUintVectorListener(t)}))}attachDoubleListener(t,e){Mi(this,t,e),Ni(this,t,(t=>{this.h._attachDoubleListener(t)}))}attachDoubleVectorListener(t,e){Gi(this,t,e),Ni(this,t,(t=>{this.h._attachDoubleVectorListener(t)}))}attachFloatListener(t,e){Mi(this,t,e),Ni(this,t,(t=>{this.h._attachFloatListener(t)}))}attachFloatVectorListener(t,e){Gi(this,t,e),Ni(this,t,(t=>{this.h._attachFloatVectorListener(t)}))}attachStringListener(t,e){Mi(this,t,e),Ni(this,t,(t=>{this.h._attachStringListener(t)}))}attachStringVectorListener(t,e){Gi(this,t,e),Ni(this,t,(t=>{this.h._attachStringVectorListener(t)}))}attachProtoListener(t,e,n){Mi(this,t,e),Ni(this,t,(t=>{this.h._attachProtoListener(t,n||!1)}))}attachProtoVectorListener(t,e,n){Gi(this,t,e),Ni(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?'),Mi(this,t,((t,n)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,n)})),Ni(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 zi=class extends Di{};async function $i(t,e,n){return t=await(async(t,e,n,r)=>{if(e&&await Vi(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(n&&(await Vi(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 Wi(t,e,n){return $i(t,e,n)}function Ri(t,e){const n=Ie(t.baseOptions,bi,1)||new bi;"string"==typeof e?(le(n,2,Dt(e)),le(n,1)):e instanceof Uint8Array&&(le(n,1,lt(e,!1,!1)),le(n,2)),Ue(t.baseOptions,0,1,n)}function Hi(t,e){const n=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Ie(t.baseOptions,bi,1)?.g()||Ie(t.baseOptions,bi,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=Ie(t.baseOptions,yi,3);if(!n){var r=n=new yi;Oe(r,4,new Nr)}"delegate"in e&&("GPU"===e.delegate?Oe(e=n,2,r=new Fr):Oe(e=n,4,r=new Nr)),Ue(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),Ri(t,"/model.dat"),t.s()}));if(n.modelAssetBuffer instanceof Uint8Array)Ri(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=>{Ri(t,e),t.s()}));return t.s(),Promise.resolve()}function qi(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 Ji(t,e){t.j=Math.max(t.j,e)}var Ki=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),qi(this)}finishProcessing(){this.g.finishProcessing(),qi(this)}close(){this.g.closeGraph()}};Ki.prototype.close=Ki.prototype.close,function(e,n){e=e.split(".");var r,i=t;e[0]in i||void 0===i.execScript||i.execScript("var "+e[0]);for(;e.length&&(r=e.shift());)e.length||void 0===n?i=i[r]&&i[r]!==Object.prototype[r]?i[r]:i[r]={}:i[r]=n}("TaskRunner",Ki);var Yi=class extends Ki{constructor(t,e){super(new zi(t,e)),this.u={languages:[]},Ue(t=this.i=new Ai,0,1,e=new wi)}o(t){return Ue(this.i,0,2,Ii(t,Ie(this.i,gi,2))),Hi(this,t)}get baseOptions(){return Ie(this.i,wi,1)}set baseOptions(t){Ue(this.i,0,1,t)}K(t){return this.u={languages:[]},this.g.addStringToStream(t,"text_in",this.j+1),this.finishProcessing(),this.u}s(){var t=new Zr;Xr(t),Ne(t,15,"classifications_out");const e=new Gr;an(e,Si,this.i);const n=new Rr;ye(n,Dt("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),Wr(n),Ne(n,4,"CLASSIFICATIONS:classifications_out"),n.o(e),ke(t,n),this.g.attachProtoListener("classifications_out",((t,e)=>{if(({classifications:t}=xi(si(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}))),Ji(this,e)})),this.g.attachEmptyPacketListener("classifications_out",(t=>{Ji(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Yi.prototype.detect=Yi.prototype.K,Yi.prototype.setOptions=Yi.prototype.o,Yi.createFromModelPath=function(t,e){return Wi(Yi,t,{baseOptions:{modelAssetPath:e}})},Yi.createFromModelBuffer=function(t,e){return Wi(Yi,t,{baseOptions:{modelAssetBuffer:e}})},Yi.createFromOptions=function(t,e){return Wi(Yi,t,e)};var Xi=class extends Ki{constructor(t,e){super(new zi(t,e)),this.u={classifications:[]},Ue(t=this.i=new Ai,0,1,e=new wi)}o(t){return Ue(this.i,0,2,Ii(t,Ie(this.i,gi,2))),Hi(this,t)}get baseOptions(){return Ie(this.i,wi,1)}set baseOptions(t){Ue(this.i,0,1,t)}J(t){return this.u={classifications:[]},this.g.addStringToStream(t,"text_in",this.j+1),this.finishProcessing(),this.u}s(){var t=new Zr;Xr(t),Ne(t,15,"classifications_out");const e=new Gr;an(e,Si,this.i);const n=new Rr;ye(n,Dt("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),Wr(n),Ne(n,4,"CLASSIFICATIONS:classifications_out"),n.o(e),ke(t,n),this.g.attachProtoListener("classifications_out",((t,e)=>{this.u=xi(si(t)),Ji(this,e)})),this.g.attachEmptyPacketListener("classifications_out",(t=>{Ji(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Xi.prototype.classify=Xi.prototype.J,Xi.prototype.setOptions=Xi.prototype.o,Xi.createFromModelPath=function(t,e){return Wi(Xi,t,{baseOptions:{modelAssetPath:e}})},Xi.createFromModelBuffer=function(t,e){return Wi(Xi,t,{baseOptions:{modelAssetBuffer:e}})},Xi.createFromOptions=function(t,e){return Wi(Xi,t,e)};var Qi=class extends Ki{constructor(t,e){super(new zi(t,e)),this.u={embeddings:[]},Ue(t=this.i=new Ei,0,1,e=new wi)}o(t){var e=this.i,n=Ie(this.i,pi,2);return n=n?ne(n):new pi,void 0!==t.l2Normalize?le(n,1,kt(t.l2Normalize)):"l2Normalize"in t&&le(n,1),void 0!==t.quantize?le(n,2,kt(t.quantize)):"quantize"in t&&le(n,2),Ue(e,0,2,n),Hi(this,t)}get baseOptions(){return Ie(this.i,wi,1)}set baseOptions(t){Ue(this.i,0,1,t)}L(t){return this.g.addStringToStream(t,"text_in",this.j+1),this.finishProcessing(),this.u}s(){var t=new Zr;Xr(t),Ne(t,15,"embeddings_out");const e=new Gr;an(e,Ti,this.i);const n=new Rr;ye(n,Dt("mediapipe.tasks.text.text_embedder.TextEmbedderGraph")),Wr(n),Ne(n,4,"EMBEDDINGS:embeddings_out"),n.o(e),ke(t,n),this.g.attachProtoListener("embeddings_out",((t,e)=>{t=di(t),this.u=function(t){return{embeddings:Pe(t,ci).map((t=>{const e={headIndex:je(Vt(ae(t,3)),0)??-1,headName:je(zt(ae(t,4)),"")??""};if(void 0!==Te(t,ai,we(t,1))){var n=Ie(t,ai,we(t,1)),r=void 0===yt?2:p?5:2,i=n.l;const s=2&(t=et(i))?1:r;r=ge(i,t);let a=tt(r);if(se(n,a,void 0,!1)){(4&a||Object.isFrozen(r))&&(r=R(r),a=Le(a,t),t=he(i,t,1,r));let e=n=0;for(;n<r.length;n++){const t=Bt(r[n]);null!=t&&(r[e++]=t)}e<n&&(r.length=e),a=pe(a,t),a=-12289&(20|a),nt(r,a),2&a&&Object.freeze(r)}var o;1===s||4===s&&32&a?me(a)||(t=a,a|=2,a!==t&&nt(r,a),Object.freeze(r)):(n=5===s&&(!!(32&a)||me(a)||!!Rt?.get(r)),(2===s||n)&&me(a)&&(r=R(r),a=Le(a,t),a=Be(a,t,!1),nt(r,a),t=he(i,t,1,r)),me(a)||(i=a,a=Be(a,t,!1),a!==i&&nt(r,a)),n&&(o=Wt(r))),e.floatEmbedding=(o||r).slice()}else o=new Uint8Array(0),e.quantizedEmbedding=Ie(t,ui,we(t,2))?.I()?.i()??o;return e})),timestampMs:je(Fe(t),0)}}(t),Ji(this,e)})),this.g.attachEmptyPacketListener("embeddings_out",(t=>{Ji(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Qi.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=Ui(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=Ui(Pi(t.quantizedEmbedding),Pi(e.quantizedEmbedding))}return t},Qi.prototype.embed=Qi.prototype.L,Qi.prototype.setOptions=Qi.prototype.o,Qi.createFromModelPath=function(t,e){return Wi(Qi,t,{baseOptions:{modelAssetPath:e}})},Qi.createFromModelBuffer=function(t,e){return Wi(Qi,t,{baseOptions:{modelAssetBuffer:e}})},Qi.createFromOptions=function(t,e){return Wi(Qi,t,e)},exports.FilesetResolver=Fi,exports.LanguageDetector=Yi,exports.TextClassifier=Xi,exports.TextEmbedder=Qi;
|
|
2
2
|
//# sourceMappingURL=text_bundle_cjs.js.map
|