@mediapipe/tasks-text 1.0.1-rc.20260813 → 1.0.1-rc.20260815

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/NOTICE CHANGED
@@ -25834,6 +25834,33 @@ Files under /tests/fuzzer/* have a "Apache-2.0" license:
25834
25834
  See the License for the specific language governing permissions and
25835
25835
  limitations under the License.
25836
25836
 
25837
+ --------------------------------------------------------------------------------
25838
+
25839
+ The file tests/fuzzer/nalloc.h has a "MIT" license:
25840
+
25841
+ --------------------------------------------------------------------------------
25842
+ MIT License
25843
+
25844
+ Copyright (c) 2025 Catena cyber
25845
+
25846
+ Permission is hereby granted, free of charge, to any person obtaining a copy
25847
+ of this software and associated documentation files (the "Software"), to deal
25848
+ in the Software without restriction, including without limitation the rights
25849
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25850
+ copies of the Software, and to permit persons to whom the Software is
25851
+ furnished to do so, subject to the following conditions:
25852
+
25853
+ The above copyright notice and this permission notice shall be included in all
25854
+ copies or substantial portions of the Software.
25855
+
25856
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25857
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25858
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25859
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25860
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25861
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25862
+ SOFTWARE.
25863
+
25837
25864
  =========================================================================
25838
25865
  perfetto
25839
25866
  =========================================================================
@@ -26670,6 +26697,33 @@ Files under /tests/fuzzer/* have a "Apache-2.0" license:
26670
26697
  See the License for the specific language governing permissions and
26671
26698
  limitations under the License.
26672
26699
 
26700
+ --------------------------------------------------------------------------------
26701
+
26702
+ The file tests/fuzzer/nalloc.h has a "MIT" license:
26703
+
26704
+ --------------------------------------------------------------------------------
26705
+ MIT License
26706
+
26707
+ Copyright (c) 2025 Catena cyber
26708
+
26709
+ Permission is hereby granted, free of charge, to any person obtaining a copy
26710
+ of this software and associated documentation files (the "Software"), to deal
26711
+ in the Software without restriction, including without limitation the rights
26712
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
26713
+ copies of the Software, and to permit persons to whom the Software is
26714
+ furnished to do so, subject to the following conditions:
26715
+
26716
+ The above copyright notice and this permission notice shall be included in all
26717
+ copies or substantial portions of the Software.
26718
+
26719
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26720
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26721
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26722
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26723
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26724
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26725
+ SOFTWARE.
26726
+
26673
26727
  =========================================================================
26674
26728
  ruy
26675
26729
  =========================================================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediapipe/tasks-text",
3
- "version": "1.0.1-rc.20260813",
3
+ "version": "1.0.1-rc.20260815",
4
4
  "description": "MediaPipe Text Tasks. See the privacy notice at https://goo.gle/mediapipe-privacy.",
5
5
  "main": "text_bundle.cjs",
6
6
  "browser": "text_bundle.mjs",
package/text_bundle.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var t="undefined"!=typeof self?self:{};function e(e,r){t:{for(var n=["CLOSURE_FLAGS"],i=t,o=0;o<n.length;o++)if(null==(i=i[n[o]])){n=null;break t}n=i}return null!=(e=n&&n[e])?e:r}function r(){throw Error("Invalid UTF8")}function n(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}var i,o,s=void 0,a="undefined"!=typeof TextDecoder,u="undefined"!=typeof TextEncoder;function c(t){if(u)t=(o||=new TextEncoder).encode(t);else{let r=0,n=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(e<128)n[r++]=e;else{if(e<2048)n[r++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&i<t.length){let o=t.charCodeAt(++i);if(o>=56320&&o<=57343){e=1024*(e-55296)+o-56320+65536,n[r++]=e>>18|240,n[r++]=e>>12&63|128,n[r++]=e>>6&63|128,n[r++]=63&e|128;continue}i--}e=65533}n[r++]=e>>12|224,n[r++]=e>>6&63|128}n[r++]=63&e|128}}t=r===n.length?n:n.subarray(0,r)}return t}var l=e(610401301,!1),h=e(748402147,!0);function f(){var e=t.navigator;return e&&(e=e.userAgent)?e:""}var d,g=t.navigator;function p(t){return p[" "](t),t}d=g&&g.userAgentData||null,p[" "]=function(){};var v={},m=null;function y(t){var e=t.length,r=3*e/4;r%3?r=Math.floor(r):-1!="=.".indexOf(t[e-1])&&(r=-1!="=.".indexOf(t[e-2])?r-2:r-1);var n=new Uint8Array(r),i=0;return function(t,e){function r(e){for(;n<t.length;){let e=t.charAt(n++),r=m[e];if(null!=r)return r;if(!/^[\s\xa0]*$/.test(e))throw Error("Unknown base64 encoding at char: "+e)}return e}b();for(var n=0;;){let t=r(-1),n=r(0),i=r(64),o=r(64);if(64===o&&-1===t)break;e(t<<2|n>>4),64!=i&&(e(n<<4&240|i>>2),64!=o&&e(i<<6&192|o))}}(t,function(t){n[i++]=t}),i!==r?n.subarray(0,i):n}function b(){if(!m){m={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){let n=t.concat(e[r].split(""));v[r]=n;for(let t=0;t<n.length;t++){let e=n[t];void 0===m[e]&&(m[e]=t)}}}}var w="undefined"!=typeof Uint8Array,_=!(!(l&&d&&d.brands.length>0)&&(-1!=f().indexOf("Trident")||-1!=f().indexOf("MSIE")))&&"function"==typeof btoa,S=/[-_.]/g,E={"-":"+",_:"/",".":"="};function I(t){return E[t]||""}function A(t){if(!_)return y(t);t=S.test(t)?t.replace(S,I):t,t=atob(t);var e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}var T={};function x(){return L||=new U(null,T)}function B(t){N(T);var e=t.g;return null==(e=null==e||w&&null!=e&&e instanceof Uint8Array?e:"string"==typeof e?A(e):null)?e:t.g=e}var L,U=class{i(){return new Uint8Array(B(this)||0)}constructor(t,e){if(N(e),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};function N(t){if(t!==T)throw Error("illegal external caller")}function O(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}var P=void 0;function j(t){return O(t=Error(t),"warning"),t}function k(e,r){if(null!=e){var n=P??={},i=n[e]||0;i>=r||(n[e]=i+1,O(e=Error(),"incident"),function(e){t.setTimeout(()=>{throw e},0)}(e))}}function F(){return"function"==typeof BigInt}var V="function"==typeof Symbol&&"symbol"==typeof Symbol();function C(t,e,r=!1){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?r&&Symbol.for&&t?Symbol.for(t):null!=t?Symbol(t):Symbol():e}var M,G=C("jas",void 0,!0),R=C(void 0,"1oa"),D=C(void 0,Symbol()),$=C(void 0,"0ubs"),z=C(void 0,"0ubsb"),W=C(void 0,"0actk"),H=C("m_m","ja",!0),q={aa:{value:0,configurable:!0,writable:!0,enumerable:!1}},K=Object.defineProperties,Y=V?G:"aa",J=[];function X(t,e){V||Y in t||K(t,q),t[Y]|=e}function Q(t,e){V||Y in t||K(t,q),t[Y]=e}Q(J,7),M=Object.freeze(J);var Z={};function tt(t,e){return void 0===e?t.g!==et&&!!(2&t.l[Y]):!!(2&e)&&t.g!==et}var et={};function rt(t,e){if(null!=t)if("string"==typeof t)t=t?new U(t,T):x();else if(t.constructor!==U)if(w&&null!=t&&t instanceof Uint8Array)t=t.length?new U(new Uint8Array(t),T):x();else{if(!e)throw Error();t=void 0}return t}var nt=Object.freeze({});function it(t,e,r){var n,i=128&e?0:-1,o=t.length;(n=!!o)&&(n=null!=(n=t[o-1])&&"object"==typeof n&&n.constructor===Object);var s=o+(n?-1:0);for(e=128&e?1:0;e<s;e++)r(e-i,t[e]);if(n){t=t[o-1];for(let e in t)!isNaN(e)&&r(+e,t[e])}}var ot={};function st(t){return 128&t?ot:void 0}function at(t){return t.ha=!0,t}var ut=at(t=>"number"==typeof t),ct=at(t=>"string"==typeof t),lt=at(t=>"boolean"==typeof t),ht="function"==typeof t.BigInt&&"bigint"==typeof t.BigInt(0);function ft(t){var e=t;if(ct(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(ut(e)&&!Number.isSafeInteger(e))throw Error(String(e));return ht?BigInt(t):t=lt(t)?t?"1":"0":ct(t)?t.trim()||"0":String(t)}var dt=at(t=>ht?t>=pt&&t<=mt:"-"===t[0]?yt(t,gt):yt(t,vt)),gt=Number.MIN_SAFE_INTEGER.toString(),pt=ht?BigInt(Number.MIN_SAFE_INTEGER):void 0,vt=Number.MAX_SAFE_INTEGER.toString(),mt=ht?BigInt(Number.MAX_SAFE_INTEGER):void 0;function yt(t,e){if(t.length>e.length)return!1;if(t.length<e.length||t===e)return!0;for(let r=0;r<t.length;r++){let n=t[r],i=e[r];if(n>i)return!1;if(n<i)return!0}}var bt,wt="function"==typeof Uint8Array.prototype.slice,_t=0,St=0;function Et(t){var e=t>>>0;_t=e,St=(t-e)/4294967296>>>0}function It(t){if(t<0){Et(-t);let[e,r]=Pt(_t,St);_t=e>>>0,St=r>>>0}else Et(t)}function At(t){var e=bt||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),St=0,_t=e.getUint32(0,!0)}function Tt(t,e){var r=4294967296*e+(t>>>0);return Number.isSafeInteger(r)?r:Lt(t,e)}function xt(t,e){return ft(F()?BigInt.asUintN(64,(BigInt(e>>>0)<<BigInt(32))+BigInt(t>>>0)):Lt(t,e))}function Bt(t,e){return F()?ft(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(e))<<BigInt(32))+BigInt.asUintN(32,BigInt(t)))):ft(Nt(t,e))}function Lt(t,e){if(t>>>=0,(e>>>=0)<=2097151)var r=""+(4294967296*e+t);else F()?r=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(r=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),r+=8147497*e,e*=2,t>=1e7&&(r+=t/1e7>>>0,t%=1e7),r>=1e7&&(e+=r/1e7>>>0,r%=1e7),r=e+Ut(r)+Ut(t));return r}function Ut(t){return t=String(t),"0000000".slice(t.length)+t}function Nt(t,e){if(2147483648&e)if(F())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{let[r,n]=Pt(t,e);t="-"+Lt(r,n)}else t=Lt(t,e);return t}function Ot(t){if(t.length<16)It(Number(t));else if(F())t=BigInt(t),_t=Number(t&BigInt(4294967295))>>>0,St=Number(t>>BigInt(32)&BigInt(4294967295));else{let e=+("-"===t[0]);St=_t=0;let r=t.length;for(let n=e,i=(r-e)%6+e;i<=r;n=i,i+=6){let e=Number(t.slice(n,i));St*=1e6,(_t=1e6*_t+e)>=4294967296&&(St+=Math.trunc(_t/4294967296),St>>>=0,_t>>>=0)}if(e){let[t,e]=Pt(_t,St);_t=t,St=e}}}function Pt(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function jt(t){return Array.prototype.slice.call(t)}var kt="function"==typeof BigInt?BigInt.asIntN:void 0,Ft="function"==typeof BigInt?BigInt.asUintN:void 0,Vt=Number.isSafeInteger,Ct=Number.isFinite,Mt=Math.trunc;function Gt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function Rt(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}var Dt=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function $t(t){switch(typeof t){case"bigint":return!0;case"number":return Ct(t);case"string":return Dt.test(t);default:return!1}}function zt(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Ct(t)?0|t:void 0}function Wt(t){var e=t.length;return("-"===t[0]?e<20||20===e&&t<="-9223372036854775808":e<19||19===e&&t<="9223372036854775807")?t:(Ot(t),Nt(_t,St))}function Ht(t){if("-"===t[0])var e=!1;else e=(e=t.length)<20||20===e&&t<="18446744073709551615";return e?t:(Ot(t),Lt(_t,St))}function qt(t){if(t=Mt(t),!Vt(t)){It(t);var e=_t,r=St;(t=2147483648&r)&&(r=~r>>>0,0==(e=1+~e>>>0)&&(r=r+1>>>0)),t="number"==typeof(e=Tt(e,r))?t?-e:e:t?"-"+e:e}return t}function Kt(t){return(t=Mt(t))>=0&&Vt(t)||(It(t),t=Tt(_t,St)),t}function Yt(t){var e=Mt(Number(t));return Vt(e)?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),Wt(t))}function Jt(t){var e=Mt(Number(t));return Vt(e)?ft(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),F()?ft(kt(64,BigInt(t))):ft(Wt(t)))}function Xt(t){return Vt(t)?t=ft(qt(t)):(t=Mt(t),Vt(t)?t=String(t):(It(t),t=Nt(_t,St)),t=ft(t)),t}function Qt(t){var e=typeof t;return null==t?t:"bigint"===e?ft(kt(64,t)):$t(t)?"string"===e?Jt(t):Xt(t):void 0}function Zt(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(kt(64,t));if($t(t)){if("string"===e)return Yt(t);if("number"===e)return qt(t)}}function te(t){if(null==t||"string"==typeof t||t instanceof U)return t}function ee(t){if("string"!=typeof t)throw Error();return t}function re(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function ne(t){return null==t||"string"==typeof t?t:void 0}function ie(t,e,r){if(null!=t&&t[H]===Z)return t;if(Array.isArray(t)){var n=0|t[Y];return(r=n|32&r|2&r)!==n&&Q(t,r),new e(t)}}function oe(t){return t}function se(t){return D?t[D]:void 0}function ae(t,e){for(let r in t)!isNaN(r)&&e(t,+r,t[r])}var ue,ce,le,he=class{};function fe(t,e){e<100||k($,1)}function de(t,e,r,n){var i=void 0!==n;n=!!n;var o,s=D;!i&&V&&s&&(o=t[s])&&ae(o,fe),s=[];var a=t.length;o=4294967295;var u=!1,c=!!(64&e),l=c?128&e?0:-1:void 0;if(!(1&e)){var h=a&&t[a-1];null!=h&&"object"==typeof h&&h.constructor===Object?o=--a:h=void 0,!c||128&e||i||(u=!0,o=(ue??oe)(o-l,l,t,h,void 0)+l)}e=void 0;for(var f=0;f<a;f++){let i=t[f];if(null!=i&&null!=(i=r(i,n)))if(c&&f>=o){let t=f-l;(e??={})[t]=i}else s[f]=i}if(h)for(let t in h){if(null==(a=h[t])||null==(a=r(a,n)))continue;let i;f=+t,c&&!Number.isNaN(f)&&(i=f+l)<o?s[i]=a:(e??={})[t]=a}return e&&(u?s.push(e):s[o]=e),i&&D&&(t=se(t))&&t instanceof he&&(s[D]=function(t){var e=new he;return ae(t,(t,r,n)=>{e[r]=jt(n)}),e.g=t.g,e}(t)),s}function ge(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return dt(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(Array.isArray(t)){var e=0|t[Y];return 0===t.length&&1&e?void 0:de(t,e,ge)}if(null!=t&&t[H]===Z)return pe(t);if(t instanceof U){if(null==(e=t.g))t="";else if("string"==typeof e)t=e;else{if(_){for(var r="",n=0,i=e.length-10240;n<i;)r+=String.fromCharCode.apply(null,e.subarray(n,n+=10240));r+=String.fromCharCode.apply(null,n?e.subarray(n):e),e=btoa(r)}else{void 0===r&&(r=0),b(),r=v[r],n=Array(Math.floor(e.length/3)),i=r[64]||"";let t=0,c=0;for(;t<e.length-2;t+=3){var o=e[t],s=e[t+1],a=e[t+2],u=r[o>>2];o=r[(3&o)<<4|s>>4],s=r[(15&s)<<2|a>>6],a=r[63&a],n[c++]=u+o+s+a}switch(u=0,a=i,e.length-t){case 2:a=r[(15&(u=e[t+1]))<<2]||i;case 1:e=e[t],n[c]=r[e>>2]+r[(3&e)<<4|u>>4]+a+i}e=n.join("")}t=t.g=e}return t}return}return t}function pe(t){return de(t=t.l,0|t[Y],ge)}function ve(t,e){return me(t,e[0],e[1])}function me(t,e,r,n=0){if(null==t){var i=32;r?(t=[r],i|=128):t=[],e&&(i=-16760833&i|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(i=0|t[Y],h&&1&i)throw Error("rfarr");if(2048&i&&!(2&i)&&function(){if(h)throw Error("carr");k(W,5)}(),256&i)throw Error("farr");if(64&i)return(i|n)!==i&&Q(t,i|n),t;if(r&&(i|=128,r!==t[0]))throw Error("mid");t:{i|=64;var o=(r=t).length;if(o){var s=o-1;let t=r[s];if(null!=t&&"object"==typeof t&&t.constructor===Object){if((s-=e=128&i?0:-1)>=1024)throw Error("pvtlmt");for(var a in t)(o=+a)<s&&(r[o+e]=t[a],delete t[a]);i=-16760833&i|(1023&s)<<14;break t}}if(e){if((a=Math.max(e,o-(128&i?0:-1)))>1024)throw Error("spvt");i=-16760833&i|(1023&a)<<14}}}return Q(t,64|i|n),t}function ye(t,e){if("object"!=typeof t)return t;if(Array.isArray(t)){var r=0|t[Y];return 0===t.length&&1&r?t=void 0:2&r||(!e||4096&r||16&r?t=_e(t,r,!1,e&&!(16&r)):(X(t,34),4&r&&Object.freeze(t))),t}return null!=t&&t[H]===Z?tt(t,r=0|(e=t.l)[Y])?t:Te(t,e,r)?be(t,e):_e(e,r):t instanceof U?t:void 0}function be(t,e,r){return t=new t.constructor(e),r&&(t.g=et),t.m=et,t}function we(t){var e=t.l,r=0|e[Y];return Te(t,e,r)?be(t,e,!0):new t.constructor(_e(e,r,!1))}function _e(t,e,r,n){return n??=!!(34&e),t=de(t,e,ye,n),n=32,r&&(n|=2),Q(t,e=16769217&e|n),t}function Se(t){var e=t.l,r=0|e[Y];return tt(t,r)?Te(t,e,r)?be(t,e,!0):new t.constructor(_e(e,r,!1)):t}function Ee(t){if(t.g!==et)return!1;var e=t.l;return X(e=_e(e,0|e[Y]),2048),t.l=e,t.g=void 0,t.m=void 0,!0}function Ie(t){if(!Ee(t)&&tt(t,0|t.l[Y]))throw Error()}function Ae(t,e){void 0===e&&(e=0|t[Y]),32&e&&!(4096&e)&&Q(t,4096|e)}function Te(t,e,r){return!!(2&r)||!(!(32&r)||4096&r)&&(Q(e,2|r),t.g=et,!0)}var xe=ft(0);function Be(t,e,r,n){if(null!==(t=Le(t.l,e,r,n)))return t}function Le(t,e,r,n){if(-1===e)return null;var i=e+(r?0:-1),o=t.length-1;if(!(o<1+(r?0:-1))){if(i>=o){var s=t[o];if(null!=s&&"object"==typeof s&&s.constructor===Object){r=s[e];var a=!0}else{if(i!==o)return;r=s}}else r=t[i];if(n&&null!=r){if(null==(n=n(r)))return n;if(!Object.is(n,r))return a?s[e]=n:t[i]=n,n}return r}}function Ue(t,e,r,n){Ie(t);var i=t.l;return Ne(i,0|i[Y],e,r,n),t}function Ne(t,e,r,n,i){var o=r+(i?0:-1),s=t.length-1;if(s>=1+(i?0:-1)&&o>=s){let i=t[s];if(null!=i&&"object"==typeof i&&i.constructor===Object)return i[r]=n,e}return o<=s?(t[o]=n,e):(void 0!==n&&(r>=(s=(e??=0|t[Y])>>14&1023||536870912)?null!=n&&(t[s+(i?0:-1)]={[r]:n}):t[o]=n),e)}function Oe(t,e,r,n){var i=t.l;return void 0!==qe(i,0|i[Y],e,t=De(t,n)===r?r:-1)}function Pe(t,e,r,n,i){var o=t.l,s=0|o[Y];n=tt(t,s)?1:n,i=!!i||3===n,2===n&&Ee(t)&&(s=0|(o=t.l)[Y]);var a=(t=ke(o,e))===M?7:0|t[Y],u=Fe(a,s),c=!(4&u);if(c){4&u&&(t=jt(t),a=0,u=tr(u,s),s=Ne(o,s,e,t));let n=0,i=0;for(;n<t.length;n++){let e=r(t[n]);null!=e&&(t[i++]=e)}i<n&&(t.length=i),r=-513&u|4,u=r&=-1025,u&=-4097}return u!==a&&(Q(t,u),2&u&&Object.freeze(t)),je(t,u,o,s,e,n,c,i)}function je(t,e,r,n,i,o,s,a){var u=e;return 1===o||4===o&&(2&e||!(16&e)&&32&n)?Ve(e)||((e|=!t.length||s&&!(4096&e)||32&n&&!(4096&e||16&e)?2:256)!==u&&Q(t,e),Object.freeze(t)):(2===o&&Ve(e)&&(t=jt(t),u=0,e=tr(e,n),n=Ne(r,n,i,t)),Ve(e)||(a||(e|=16),e!==u&&Q(t,e))),2&e||!(4096&e||16&e)||Ae(r,n),t}function ke(t,e,r){return t=Le(t,e,r),Array.isArray(t)?t:M}function Fe(t,e){return 2&e&&(t|=2),1|t}function Ve(t){return!!(2&t)&&!!(4&t)||!!(256&t)}function Ce(t){return rt(t,!0)}function Me(t,e,r){Ie(t);var n=0|(t=t.l)[Y];if(null==r)Ne(t,n,e);else{var i=r===M?7:0|r[Y],o=i,s=Ve(i),a=s||Object.isFrozen(r);for(s||(i=0),a||(r=jt(r),o=0,i=tr(i,n),a=!1),i|=5,i|=(4&i?512&i?512:1024&i?1024:0:void 0)??1024,s=0;s<r.length;s++){let t=r[s],e=ee(t);Object.is(t,e)||(a&&(r=jt(r),o=0,i=tr(i,n),a=!1),r[s]=e)}i!==o&&(a&&(r=jt(r),i=tr(i,n)),Q(r,i)),Ne(t,n,e,r)}}function Ge(t,e){Ie(t),Ne(t=t.l,0|t[Y],2,""===e?void 0:e)}function Re(t,e,r){if(2&e)throw Error();var n=st(e),i=ke(t,r,n),o=i===M?7:0|i[Y],s=Fe(o,e);return(2&s||Ve(s)||16&s)&&(s===o||Ve(s)||Q(i,s),i=jt(i),o=0,s=tr(s,e),Ne(t,e,r,i,n)),(s&=-13)!==o&&Q(i,s),i}function De(t,e){return We($e(t=t.l),t,void 0,e)}function $e(t){if(V)return t[R]??(t[R]=new Map);if(R in t)return t[R];var e=new Map;return Object.defineProperty(t,R,{value:e}),e}function ze(t,e,r,n,i){var o=$e(t),s=We(o,t,e,r,i);return s!==n&&(s&&(e=Ne(t,e,s,void 0,i)),o.set(r,n)),e}function We(t,e,r,n,i){var o=t.get(n);if(null!=o)return o;o=0;for(let t=0;t<n.length;t++){let s=n[t];null!=Le(e,s,i)&&(0!==o&&(r=Ne(e,r,o,void 0,i)),o=s)}return t.set(n,o),o}function He(t,e,r){var n=0|t[Y],i=st(n),o=Le(t,r,i);if(null!=o&&o[H]===Z){if(!tt(o))return Ee(o),o.l;var s=o.l}else Array.isArray(o)&&(s=o);if(s){let t=0|s[Y];2&t&&(s=_e(s,t))}return(s=ve(s,e))!==o&&Ne(t,n,r,s,i),s}function qe(t,e,r,n){var i=!1;if(null!=(n=Le(t,n,void 0,t=>{var n=ie(t,r,e);return i=n!==t&&null!=n,n})))return i&&!tt(n)&&Ae(t,e),n}function Ke(t,e,r){var n=t.l,i=0|n[Y];if(null==(e=qe(n,i,e,r)))return e;if(!tt(t,i=0|n[Y])){let o=Se(e);o!==e&&(Ee(t)&&(i=0|(n=t.l)[Y]),Ae(n,i=Ne(n,i,r,e=o)))}return e}function Ye(t,e,r,n,i,o,s,a){var u=tt(t,r);o=u?1:o,s=!!s||3===o,u=a&&!u,(2===o||u)&&Ee(t)&&(r=0|(e=t.l)[Y]);var c=(t=ke(e,i))===M?7:0|t[Y],l=Fe(c,r);if(a=!(4&l)){var h=t,f=r;let e=!!(2&l);e&&(f|=2);let i=!e,o=!0,s=0,a=0;for(;s<h.length;s++){let t=ie(h[s],n,f);if(t instanceof n){if(!e){let e=tt(t);i&&=!e,o&&=e}h[a++]=t}}a<s&&(h.length=a),l|=4,l=o?-4097&l:4096|l,l=i?8|l:-9&l}if(l!==c&&(Q(t,l),2&l&&Object.freeze(t)),u&&!(8&l||!t.length&&(1===o||4===o&&(2&l||!(16&l)&&32&r)))){for(Ve(l)&&(t=jt(t),l=tr(l,r),r=Ne(e,r,i,t)),n=t,u=l,c=0;c<n.length;c++)(h=n[c])!==(l=Se(h))&&(n[c]=l);u|=8,Q(t,l=u=n.length?4096|u:-4097&u)}return je(t,l,e,r,i,o,a,s)}function Je(t,e){var r=t.l;return Ye(t,r,0|r[Y],e,1,void 0===nt?2:4,!1,!0)}function Xe(t){return null==t&&(t=void 0),t}function Qe(t,e,r,n,i){return Ue(t,r,n=Xe(n),i),n&&!tt(n)&&Ae(t.l),t}function Ze(t,e,r,n){t:{var i=n=Xe(n);Ie(t);let o=t.l,s=0|o[Y];if(null==i){let t=$e(o);if(We(t,o,s,r)!==e)break t;t.set(r,0)}else s=ze(o,s,r,e);Ne(o,s,e,i)}return n&&!tt(n)&&Ae(t.l),t}function tr(t,e){return-273&(2&e?2|t:-3&t)}function er(t,e,r,n){Ie(t);var i=t.l;t=Ye(t,i,0|i[Y],r,e,2,!0),n=null!=n?n:new r,t.push(n),e=r=t===M?7:0|t[Y],(n=tt(n))?(r&=-9,1===t.length&&(r&=-4097)):r|=4096,r!==e&&Q(t,r),n||Ae(i)}function rr(t,e,r){return Ke(t,e,r=De(t,Eo)===r?r:-1)}function nr(t,e,r){if(null!=r)t:{if(!$t(r))throw j("int64");switch(typeof r){case"string":r=Jt(r);break t;case"bigint":r=ft(kt(64,r));break t;default:r=Xt(r)}}return Ue(t,e,r)}function ir(t,e,r){return Ue(t,e,null==r?r:function(t){if(!$t(t))throw j("uint64");switch(typeof t){case"string":var e=Mt(Number(t));return Vt(e)&&e>=0?t=ft(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),t=F()?ft(Ft(64,BigInt(t))):ft(Ht(t))),t;case"bigint":return ft(Ft(64,t));default:return Vt(t)?t=ft(Kt(t)):((t=Mt(t))>=0&&Vt(t)?t=String(t):(It(t),t=Lt(_t,St)),t=ft(t)),t}}(r))}function or(t,e,r){if(null!=r){if(!Ct(r))throw j("enum");r|=0}return Ue(t,e,r)}function sr(t,e,r){Ie(t),Pe(t,e,ne,2,!0).push(ee(r))}var ar=class{constructor(t,e,r){if(this.buffer=t,r&&!e)throw Error();this.g=e}};function ur(t,e){if("string"==typeof t)return new ar(A(t),e);if(Array.isArray(t))return new ar(new Uint8Array(t),e);if(t.constructor===Uint8Array)return new ar(t,!1);if(t.constructor===ArrayBuffer)return t=new Uint8Array(t),new ar(t,!1);if(t.constructor===U)return e=B(t)||new Uint8Array(0),new ar(e,!0,t);if(t instanceof Uint8Array)return t=t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new ar(t,!1);throw Error()}function cr(t,e){var r=0,n=0,i=0,o=t.i,s=t.g;do{var a=o[s++];r|=(127&a)<<i,i+=7}while(i<32&&128&a);if(i>32)for(n|=(127&a)>>4,i=3;i<32&&128&a;i+=7)n|=(127&(a=o[s++]))<<i;if(vr(t,s),!(128&a))return e(r>>>0,n>>>0);throw Error()}function lr(t){for(var e=0,r=t.g,n=r+10,i=t.i;r<n;){let n=i[r++];if(e|=n,!(128&n))return vr(t,r),!!(127&e)}throw Error()}function hr(t){var e=t.i,r=t.g,n=e[r++],i=127&n;if(128&n&&(i|=(127&(n=e[r++]))<<7,128&n&&(i|=(127&(n=e[r++]))<<14,128&n&&(i|=(127&(n=e[r++]))<<21,128&n&&(i|=(n=e[r++])<<28,128&n&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++])))))throw Error();return vr(t,r),i}function fr(t){return cr(t,Bt)}function dr(t){var e=t.i,r=t.g,n=e[r],i=e[r+1],o=e[r+2];return e=e[r+3],vr(t,t.g+4),(n|i<<8|o<<16|e<<24)>>>0}function gr(t){var e=dr(t);t=2*(e>>31)+1;var r=e>>>23&255;return e&=8388607,255==r?e?NaN:t*(1/0):0==r?1401298464324817e-60*t*e:t*Math.pow(2,r-150)*(e+8388608)}function pr(t){return hr(t)}function vr(t,e){if(t.g=e,e>t.j)throw Error()}function mr(t,e){if(e<0)throw Error();var r=t.g;if((e=r+e)>t.j)throw Error();return t.g=e,r}function yr(t,e){if(0==e)return x();var r=mr(t,e);return t.L&&t.u?r=t.i.subarray(r,r+e):(t=t.i,r=r===(e=r+e)?new Uint8Array(0):wt?t.slice(r,e):new Uint8Array(t.subarray(r,e))),0==r.length?x():new U(r,T)}var br=class{constructor(t,e,r,n){this.i=null,this.u=!1,this.g=this.j=this.m=0,this.init(t,e,r,n)}init(t,e,r,{L:n=!1,O:i=!1}={}){this.L=n,this.O=i,t&&(t=ur(t,this.O),this.i=t.buffer,this.u=t.g,this.m=e||0,this.j=void 0!==r?this.m+r:this.i.length,this.g=this.m)}clear(){this.i=null,this.u=!1,this.g=this.j=this.m=0,this.L=!1}},wr=[],_r=0;function Sr(t,e,r,n){if(Or.length){let i=Or.pop();return i.o(n),i.g.init(t,e,r,n),i}return new Nr(t,e,r,n)}function Er(t){t.g.clear(),t.j=-1,t.i=-1,Or.length<100&&Or.push(t)}function Ir(t){var e=t.g;if(e.g==e.j)return!1;t.m=t.g.g;var r=hr(t.g)>>>0;if(e=r>>>3,!((r&=7)>=0&&r<=5))throw Error();if(e<1)throw Error();return t.j=e,t.i=r,!0}function Ar(t){try{switch(t.i){case 0:0!=t.i?Ar(t):lr(t.g);break;case 1:var e=t.g;vr(e,e.g+8);break;case 2:if(2!=t.i)Ar(t);else{var r=hr(t.g)>>>0,n=t.g;vr(n,n.g+r)}break;case 5:var i=t.g;vr(i,i.g+4);break;case 3:Tr();let o=t.j;try{for(;;){if(!Ir(t))throw Error();if(4==t.i){if(t.j!=o)throw Error();break}Ar(t)}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{_r>0&&_r--}break;default:throw Error()}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}}function Tr(){if(_r>=100)throw new SyntaxError;_r++}function xr(t,e,r){var n=t.g.j,i=hr(t.g)>>>0,o=(i=t.g.g+i)-n;if(o<=0&&(t.g.j=i,r(e,t,void 0,void 0,void 0),o=i-t.g.g),o)throw Error();t.g.g=i,t.g.j=n}function Br(t){var e=hr(t.g)>>>0,o=mr(t=t.g,e);if(t=t.i,a){var u,c=t;(u=i)||(u=i=new TextDecoder("utf-8",{fatal:!0})),e=o+e,c=0===o&&e===c.length?c:c.subarray(o,e);try{var l=u.decode(c)}catch(t){if(void 0===s){try{u.decode(new Uint8Array([128]))}catch(t){}try{u.decode(new Uint8Array([97])),s=!0}catch(t){s=!1}}throw!s&&(i=void 0),t}}else{e=(l=o)+e,o=[];let i,s=null;for(;l<e;){var h=t[l++];h<128?o.push(h):h<224?l>=e?r():(i=t[l++],h<194||128!=(192&i)?(l--,r()):o.push((31&h)<<6|63&i)):h<240?l>=e-1?r():(i=t[l++],128!=(192&i)||224===h&&i<160||237===h&&i>=160||128!=(192&(u=t[l++]))?(l--,r()):o.push((15&h)<<12|(63&i)<<6|63&u)):h<=244?l>=e-2?r():(i=t[l++],128!=(192&i)||i-144+(h<<28)>>30||128!=(192&(u=t[l++]))||128!=(192&(c=t[l++]))?(l--,r()):(h=(7&h)<<18|(63&i)<<12|(63&u)<<6|63&c,h-=65536,o.push(55296+(h>>10&1023),56320+(1023&h)))):r(),o.length>=8192&&(s=n(s,o),o.length=0)}l=n(s,o)}return l}function Lr(t){var e=hr(t.g)>>>0;return yr(t.g,e)}function Ur(t,e,r){var n=hr(t.g)>>>0;for(n=t.g.g+n;t.g.g<n;)r.push(e(t.g))}var Nr=class{constructor(t,e,r,n){if(wr.length){let i=wr.pop();i.init(t,e,r,n),t=i}else t=new br(t,e,r,n);this.g=t,this.m=this.g.g,this.i=this.j=-1,this.o(n)}o({R:t=!1}={}){this.R=t}},Or=[];function Pr(t){return new Fr(4294967295&t,Math.floor(t/4294967296))}function jr(t){return t?/^\d+$/.test(t)?(Ot(t),new Fr(_t,St)):null:kr||=new Fr(0,0)}var kr,Fr=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};function Vr(t){return new qr(4294967295&t,Math.floor(t/4294967296))}function Cr(t){return t?/^-?\d+$/.test(t)?(Ot(t),new qr(_t,St)):null:Mr||=new qr(0,0)}var Mr,Gr,Rr,Dr,$r,zr,Wr,Hr,qr=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};function Kr(t,e,r){return"undefined"!=typeof BigInt64Array?(Wr||(Wr=new BigInt64Array(1),Hr=new Uint32Array(Wr.buffer),Wr[0]=BigInt(1),zr=1===Hr[0]),Wr[0]=t,new e(Hr[t=zr?0:1],Hr[1-t])):($r||(Gr=BigInt(Number.MIN_SAFE_INTEGER),Rr=BigInt(Number.MAX_SAFE_INTEGER),Dr=BigInt(4294967295),$r=BigInt(32)),t>=Gr&&t<=Rr?r(Number(t)):(t=BigInt.asUintN(64,t),new e(Number(t&Dr),Number(t>>$r))))}function Yr(t,e,r){for(;r>0||e>127;)t.g.push(127&e|128),e=(e>>>7|r<<25)>>>0,r>>>=7;t.g.push(e)}function Jr(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function Xr(t,e){if(e>=0)Jr(t,e);else{for(let r=0;r<9;r++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function Qr(t,e){Ot(e),function(t){var e=St>>31;t(_t<<1^e,(St<<1|_t>>>31)^e)}((e,r)=>{Yr(t,e>>>0,r>>>0)})}function Zr(t,e){t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}var tn=class{constructor(){this.g=[]}length(){return this.g.length}end(){var t=this.g;return this.g=[],t}};function en(t,e){0!==e.length&&(t.j.push(e),t.i+=e.length)}function rn(t,e,r){Jr(t.g,8*e+r)}function nn(t,e){return rn(t,e,2),e=t.g.end(),en(t,e),e.push(t.i),e}function on(t,e){var r=e.pop();for(r=t.i+t.g.length()-r;r>127;)e.push(127&r|128),r>>>=7,t.i++;e.push(r),t.i++}function sn(t,e,r){if(null!=r)switch(rn(t,e,0),typeof r){case"number":t=t.g,It(r),Yr(t,_t,St);break;case"bigint":r=Kr(r,qr,Vr),Yr(t.g,r.i,r.g);break;default:r=Cr(r),Yr(t.g,r.i,r.g)}}function an(t,e,r){rn(t,e,2),Jr(t.g,r.length),en(t,t.g.end()),en(t,r)}var un=class{constructor(){this.j=[],this.i=0,this.g=new tn}};function cn(t){if("string"==typeof t)Cr(t)}function ln(){var t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var hn=ln(),fn=ln(),dn=ln(),gn=ln(),pn=ln(),vn=ln(),mn=ln(),yn=ln(),bn=ln(),wn=ln(),_n=ln(),Sn=ln();function En(t,e,r){var n=t.l;D&&D in n&&(n=n[D])&&delete n[e.g],e.i?e.m(t,e.i,e.g,r,e.j):e.m(t,e.g,r,e.j)}var In=class{constructor(t,e){this.l=me(t,e,void 0,2048)}toJSON(){return pe(this)}};In.prototype[H]=Z,In.prototype.toString=function(){return this.l.toString()};var An=class{constructor(t,e,r){this.g=t,this.i=e,t=hn,this.j=!!t&&r===t||!1}};function Tn(t,e){return new An(t,e,hn)}function xn(t,e,r,n,i){null!=(e=Mn(e,n))&&(r=nn(t,r),i(e,t),on(t,r))}var Bn,Ln,Un=Tn(function(t,e,r,n,i){return 2===t.i&&(xr(t,He(e,n,r),i),!0)},xn),Nn=Tn(function(t,e,r,n,i){return 2===t.i&&(xr(t,He(e,n,r),i),!0)},xn),On=Symbol(),Pn=Symbol(),jn=Symbol(),kn=Symbol(),Fn=Symbol();function Vn(t,e,r,n){var i=n[t];if(i)return i;(i={}).V=n,i.K=function(t){switch(typeof t){case"boolean":return ce||=[0,void 0,!0];case"number":return t>0?void 0:0===t?le||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(n[0]);var o=n[1],s=1;o&&o.constructor===Object&&(i.M=o,"function"==typeof(o=n[++s])&&(i.S=!0,Bn??=o,Ln??=n[s+1],o=n[s+=2]));for(var a={};o&&Array.isArray(o)&&o.length&&"number"==typeof o[0]&&o[0]>0;){for(var u=0;u<o.length;u++)a[o[u]]=o;o=n[++s]}for(u=1;void 0!==o;){let t;"number"==typeof o&&(u+=o,o=n[++s]);var c=void 0;if(o instanceof An?t=o:(t=Un,s--),t?.j){o=n[++s],c=n;var l=s;"function"==typeof o&&(o=o(),c[l]=o),c=o}for(l=u+1,"number"==typeof(o=n[++s])&&o<0&&(l-=o,o=n[++s]);u<l;u++){let n=a[u];c?r(i,u,t,c,n):e(i,u,t,n)}}return n[t]=i}function Cn(t){return Array.isArray(t)?t[0]instanceof An?t:[Nn,t]:[t,void 0]}function Mn(t,e){return t instanceof In?t.l:Array.isArray(t)?ve(t,e):void 0}function Gn(t,e,r,n){var i=r.g;t[e]=n?(t,e,r)=>i(t,e,r,n):i}function Rn(t,e,r,n,i){var o,s,a=r.g;t[e]=(t,e,r)=>a(t,e,r,s||=Vn(Pn,Gn,Rn,n).K,o||=Dn(n),i)}function Dn(t){var e=t[jn];if(null!=e)return e;var r=Vn(Pn,Gn,Rn,t);return e=r.S?(t,e)=>Bn(t,e,r):(t,e)=>{t:{Tr();try{for(;Ir(e)&&4!=e.i;){let u=e.j,c=r[u];if(null==c){let t=r.M;if(t){let e=t[u];if(e){let t=zn(e);null!=t&&(c=r[u]=t)}}}if(null==c||!c(e,t,u)){var n=e;let r=n.m;if(Ar(n),n.R)var i=void 0;else{let t=n.g.g-r;n.g.g=r,i=yr(n.g,t)}n=void 0;var o=t,s=u,a=i;a&&((n=o[D]??(o[D]=new he))[s]??(n[s]=[])).push(a)}}let c=se(t);c&&(c.g=r.V[Fn]);var u=!0;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{_r>0&&_r--}u=void 0}return u},t[jn]=e,t[Fn]=$n.bind(t),e}function $n(t,e,r,n){var i=this[Pn],o=this[jn],s=ve(void 0,i.K),a=se(t);if(a){var u=!1,c=i.M;if(c){if(i=(e,r,i)=>{if(0!==i.length)if(c[r])for(let t of i){e=Sr(t);try{u=!0,o(s,e)}finally{Er(e)}}else n?.(t,r,i)},null==e)ae(a,i);else if(null!=a){let t=a[e];t&&i(a,e,t)}if(u){let n=0|t[Y];if(2&n&&2048&n&&!r?.la)throw Error();let i=st(n),o=(e,o)=>{if(null!=Le(t,e,i)){if(1===r?.ka)return;throw Error()}null!=o&&(n=Ne(t,n,e,o,i)),delete a[e]};null==e?it(s,0|s[Y],(t,e)=>{o(t,e)}):o(e,Le(s,e,i))}}}}function zn(t){var e=(t=Cn(t))[0].g;if(t=t[1]){let r=Dn(t),n=Vn(Pn,Gn,Rn,t).K;return(t,i,o)=>e(t,i,o,n,r)}return e}function Wn(t,e,r){t[e]=r.i}function Hn(t,e,r,n){var i,o,s=r.i;t[e]=(t,e,r)=>s(t,e,r,o||=Vn(On,Wn,Hn,n).K,i||=qn(n))}function qn(t){var e=t[kn];if(!e){let r=Vn(On,Wn,Hn,t);e=(t,e)=>Kn(t,e,r),t[kn]=e}return e}function Kn(t,e,r){it(t,0|t[Y],(t,n)=>{if(null!=n){var i=function(t,e){var r=t[e];if(r)return r;if((r=t.M)&&(r=r[e])){var n=(r=Cn(r))[0].i;if(r=r[1]){let e=qn(r),i=Vn(On,Wn,Hn,r).K;r=t.S?Ln(i,e):(t,r,o)=>n(t,r,o,i,e)}else r=n;return t[e]=r}}(r,t);i?i(e,n,t):t<500||k(z,3)}}),(t=se(t))&&ae(t,(t,r,n)=>{for(en(e,e.g.end()),t=0;t<n.length;t++)en(e,B(n[t])||new Uint8Array(0))})}var Yn=ft(0);function Jn(t,e,r){if(Array.isArray(e)){var n=0|e[Y];if(4&n)return e;for(var i=0,o=0;i<e.length;i++){let r=t(e[i]);null!=r&&(e[o++]=r)}return o<i&&(e.length=o),t=1|n,r&&(t=-1537&t|4),t!==n&&Q(e,t),r&&2&t&&Object.freeze(e),e}}var Xn=(t,e)=>{var r=new un;Kn(t.l,r,Vn(On,Wn,Hn,e)),en(r,r.g.end()),t=new Uint8Array(r.i);var n=(e=r.j).length,i=0;for(let r=0;r<n;r++){let n=e[r];t.set(n,i),i+=n.length}return r.j=[t],t};function Qn(t,e,r){return new An(t,e,r)}function Zn(t,e,r){return new An(t,e,r)}function ti(t,e,r){Ne(t,0|t[Y],e,r,st(0|t[Y]))}function ei(t,e,r){null!=(e=Zt(e))&&(cn(e),sn(t,r,e))}function ri(t,e,r){null!=(e=zt(e))&&null!=e&&(rn(t,r,0),Xr(t.g,e))}function ni(t,e,r){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(rn(t,r,0),t.g.g.push(e?1:0))}function ii(t,e,r){null!=(e=ne(e))&&an(t,r,c(e))}function oi(t,e,r,n,i){null!=(e=Mn(e,n))&&(r=nn(t,r),i(e,t),on(t,r))}function si(t,e,r){null!=(e=te(e))&&an(t,r,ur(e,!0).buffer)}function ai(t,e,r){e=function(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Ct(t)?t>>>0:void 0}(e),null!=e&&null!=e&&(rn(t,r,0),Jr(t.g,e))}function ui(t,e,r){null!=(e=zt(e))&&(e=parseInt(e,10),rn(t,r,0),Xr(t.g,e))}function ci(t,e,r){return 0===t.i&&(ti(e,r,fr(t.g)),!0)}function li(t,e,r){return(0===t.i||2===t.i)&&(e=Re(e,0|e[Y],r),2==t.i?Ur(t,hr,e):e.push(hr(t.g)),!0)}function hi(t,e,r){return 2===t.i&&(ti(e,r,(t=Lr(t))===x()?void 0:t),!0)}var fi=Qn(function(t,e,r){if(1!==t.i)return!1;var n=t.g;t=dr(n);var i=dr(n);n=2*(i>>31)+1;var o=i>>>20&2047;return t=4294967296*(1048575&i)+t,ti(e,r,2047==o?t?NaN:n*(1/0):0==o?5e-324*n*t:n*Math.pow(2,o-1075)*(t+4503599627370496)),!0},function(t,e,r){null!=(e=Gt(e))&&(rn(t,r,1),t=t.g,(r=bt||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),_t=r.getUint32(0,!0),St=r.getUint32(4,!0),Zr(t,_t),Zr(t,St))},wn),di=Qn(function(t,e,r){return 5===t.i&&(ti(e,r,gr(t.g)),!0)},function(t,e,r){null!=(e=Gt(e))&&(rn(t,r,5),t=t.g,At(e),Zr(t,_t))},bn),gi=Zn(function(t,e,r){return(5===t.i||2===t.i)&&(e=Re(e,0|e[Y],r),2==t.i?Ur(t,gr,e):e.push(gr(t.g)),!0)},function(t,e,r){if(null!=(e=Jn(Gt,e,!0))&&e.length){rn(t,r,2),Jr(t.g,4*e.length);for(let n=0;n<e.length;n++)r=t.g,At(e[n]),Zr(r,_t)}},bn),pi=Qn(function(t,e,r){return ci(t,e,r)},ei,vn),vi=Qn(function(t,e,r){return ci(t,e,r)},ei,vn),mi=Zn(function(t,e,r){return 0!==t.i&&2!==t.i?t=!1:(e=Re(e,0|e[Y],r),2==t.i?Ur(t,fr,e):e.push(fr(t.g)),t=!0),t},function(t,e,r){if(null!=(e=Jn(Zt,e,!1)))for(let n=0;n<e.length;n++)sn(t,r,e[n])},vn),yi=Qn(function(t,e,r){return 0!==t.i?e=!1:(ti(e,r,(t=fr(t.g))===Yn?void 0:t),e=!0),e},ei,vn),bi=Qn(function(t,e,r){return 0!==t.i?t=!1:(ti(e,r,cr(t.g,xt)),t=!0),t},function(t,e,r){if(e=function(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(Ft(64,t));if($t(t)){if("string"===e)return e=Mt(Number(t)),Vt(e)&&e>=0?t=String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),t=Ht(t)),t;if("number"===e)return Kt(t)}}(e),null!=e){if("string"==typeof e)jr(e);if(null!=e)switch(rn(t,r,0),typeof e){case"number":t=t.g,It(e),Yr(t,_t,St);break;case"bigint":r=Kr(e,Fr,Pr),Yr(t.g,r.i,r.g);break;default:r=jr(e),Yr(t.g,r.i,r.g)}}},mn),wi=Qn(function(t,e,r){return 0===t.i&&(ti(e,r,hr(t.g)),!0)},ri,gn),_i=Zn(li,function(t,e,r){if(null!=(e=Jn(zt,e,!0)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&(rn(n,i,0),Xr(n.g,o))}},gn),Si=Zn(li,function(t,e,r){if(null!=(e=Jn(zt,e,!0))&&e.length){r=nn(t,r);for(let r=0;r<e.length;r++)Xr(t.g,e[r]);on(t,r)}},gn),Ei=Qn(function(t,e,r){return 0===t.i&&(ti(e,r,0===(t=hr(t.g))?void 0:t),!0)},ri,gn),Ii=Qn(function(t,e,r){return 0===t.i&&(ti(e,r,lr(t.g)),!0)},ni,fn),Ai=Qn(function(t,e,r){return 0===t.i&&(ti(e,r,!1===(t=lr(t.g))?void 0:t),!0)},ni,fn),Ti=Zn(function(t,e,r){return 2===t.i&&(t=Br(t),Re(e,0|e[Y],r).push(t),!0)},function(t,e,r){if(null!=(e=Jn(ne,e,!0)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&an(n,i,c(o))}},dn),xi=Qn(function(t,e,r){return 2===t.i&&(ti(e,r,""===(t=Br(t))?void 0:t),!0)},ii,dn),Bi=Qn(function(t,e,r){return 2===t.i&&(ti(e,r,Br(t)),!0)},ii,dn),Li=function(t,e,r=hn){return new An(t,e,r)}(function(t,e,r,n,i){return 2===t.i&&(n=ve(void 0,n),Re(e,0|e[Y],r).push(n),xr(t,n,i),!0)},function(t,e,r,n,i){if(Array.isArray(e)){for(let o=0;o<e.length;o++)oi(t,e[o],r,n,i);1&(t=0|e[Y])||Q(e,1|t)}}),Ui=Tn(function(t,e,r,n,i,o){if(2!==t.i)return!1;var s=0|e[Y];return ze(e,s,o,r,st(s)),xr(t,e=He(e,n,r),i),!0},oi),Ni=Qn(function(t,e,r){return 2===t.i&&(ti(e,r,Lr(t)),!0)},si,_n),Oi=Zn(function(t,e,r){return 2===t.i&&(t=Lr(t),Re(e,0|e[Y],r).push(t),!0)},function(t,e,r){if(null!=(e=Jn(te,e,!1)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&an(n,i,ur(o,!0).buffer)}},_n),Pi=Qn(function(t,e,r){return 0===t.i&&(ti(e,r,hr(t.g)>>>0),!0)},ai,pn),ji=Qn(function(t,e,r){return 0===t.i&&(ti(e,r,0===(t=hr(t.g)>>>0)?void 0:t),!0)},ai,pn),ki=Qn(function(t,e,r){return 0===t.i&&(ti(e,r,hr(t.g)),!0)},ui,Sn),Fi=Qn(function(t,e,r){return 0===t.i&&(ti(e,r,0===(t=hr(t.g))?void 0:t),!0)},ui,Sn),Vi=Qn(function(t,e,r){return 0!==t.i?t=!1:(ti(e,r,function(t){return cr(t,(t,e)=>{var r=-(1&t);return Bt(t=(t>>>1|e<<31)^r,e>>>1^r)})}(t.g)),t=!0),t},function(t,e,r){if(null!=(e=Zt(e))&&(cn(e),null!=e))switch(rn(t,r,0),typeof e){case"number":t=t.g,e=(r=e)<0,Et(r=2*Math.abs(r)),r=_t;let n=St;e&&(0==r?0==n?n=r=4294967295:(n--,r=4294967295):r--),Yr(t,_t=r,St=n);break;case"bigint":t=t.g,e=e<<BigInt(1)^e>>BigInt(63),_t=Number(BigInt.asUintN(32,e)),St=Number(BigInt.asUintN(32,e>>BigInt(32))),Yr(t,_t,St);break;default:Qr(t.g,e)}},yn);class Ci{constructor(t,e){var r=oo;this.g=t,this.i=e,this.m=Qe,this.defaultValue=void 0,this.j=null!=r.ia?ot:void 0}register(){p(this)}}function Mi(t,e){return(r,n)=>{t:{let o={O:!0};n&&Object.assign(o,n),r=Sr(r,void 0,void 0,o);try{let n=new t,o=n.l;Dn(e)(o,r);var i=n;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{Er(r)}i=void 0}return i}}function Gi(t){return function(){return Xn(this,t)}}var Ri,Di=[0,Ni,Oi,Ii,Bi],$i=[0,xi,[0,Fi,[0,yi,Ei],Fi,-1,[0,ki],Fi,-1],Qn(hi,si,_n)],zi=[0,xi,Qn(hi,function(t,e,r){if(null!=e){if(e instanceof In){let n=e.na;return void(n?(e=n(e),null!=e&&an(t,r,ur(e,!0).buffer)):k(z,3))}if(Array.isArray(e))return void k(z,3)}si(t,e,r)},_n)],Wi=[0,1,[0,12,wi,10,Ii],[0,7,[0,wi,-1]]],Hi=globalThis.trustedTypes;var qi=class{constructor(t){this.g=t}toString(){return this.g+""}};function Ki(t){var e;return void 0===Ri&&(Ri=function(){var t=null;if(!Hi)return t;try{let e=t=>t;t=Hi.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(t){}return t}()),t=(e=Ri)?e.createScriptURL(t):t,new qi(t)}function Yi(t,...e){if(0===e.length)return Ki(t[0]);var r=t[0];for(let n=0;n<e.length;n++)r+=encodeURIComponent(e[n])+t[n+1];return Ki(r)}var Ji=[0,wi,ki,Ii,-1,Si,ki,-1,Ii,-1],Xi=[0,ki,-1,Ii],Qi=class extends In{constructor(t){super(t)}},Zi=[0,Ii,Bi,Ii,ki,-1,Zn(function(t,e,r){return(0===t.i||2===t.i)&&(e=Re(e,0|e[Y],r),2==t.i?Ur(t,pr,e):e.push(hr(t.g)),!0)},function(t,e,r){if(null!=(e=Jn(zt,e,!0))&&e.length){r=nn(t,r);for(let r=0;r<e.length;r++)Xr(t.g,e[r]);on(t,r)}},Sn),Bi,-1,[0,Ii,-1],ki,Ii,-1,Xi],to=[0,3,Ii,-1,2,[0,[2],wi,Ui,[0,Pi]],[0,ki,Ii,ki,Ii,ki,4,[0,Ii,Bi,-1,Ii]],[0,[3,4],Bi,-1,Ui,[0,wi],Ui,[0,ki,-1]],[0]],eo=[0,Bi,-2],ro=class extends In{constructor(t){super(t)}},no=[0],io=[0,wi,Ii,1,Ii,-4],oo=class extends In{constructor(t){super(t,2)}},so={};so[336783863]=[0,Bi,Ii,-1,wi,[0,[1,2,3,4,5,6,7,8,9],Ui,no,Ui,Zi,Ui,eo,Ui,io,Ui,Ji,Ui,[0,Bi,-2],Ui,[0,Bi,ki],Ui,to,Ui,Xi],[0,Bi],Ii,[0,[1,3],[2,4],Ui,[0,Si],-1,Ui,[0,Ti],-1,Li,[0,Bi,-1]],Bi];var ao=[0,yi,-1,Ai,-3,yi,Si,xi,Ei,yi,-1,Ai,Ei,Ai,-2,xi];function uo(t){sr(t,3,"TEXT:text_in")}var co=class extends In{constructor(t){super(t,500)}o(t){return Qe(this,0,7,t)}},lo=[-1,{}],ho=[0,Bi,1,lo],fo=[0,Bi,Ti,lo];function go(t){sr(t,10,"text_in")}var po=class extends In{constructor(t){super(t,500)}o(t){return Qe(this,0,1001,t)}};po.prototype.i=Gi([-500,Li,[-500,xi,-1,Ti,-3,[-2,so,Ii],Li,zi,Ei,-1,ho,fo,Li,[0,xi,Ai],xi,ao,Ei,Ti,987,Ti],4,Li,[-500,Bi,-1,[-1,{}],998,Bi],Li,[-500,Bi,Ti,-1,[-2,{},Ii],997,Ti,-1],Ei,Li,[-500,Bi,Ti,lo,998,Ti],Ti,Ei,ho,fo,Li,[0,xi,-1,lo],Ti,-2,ao,xi,-1,Ai,[0,Ai,ji],978,lo,Li,zi]);var vo=class extends In{constructor(t){super(t)}},mo=class extends In{constructor(t){super(t)}i(){return Je(this,vo)}},yo=class extends In{constructor(t){super(t)}},bo=Mi(class extends In{constructor(t){super(t)}},[0,Li,[0,1,wi,Bi,[0,Li,[0,wi,di,Bi,-1]]],vi]),wo=class extends In{constructor(t){super(t)}},_o=class extends In{constructor(t){super(t)}i(){var t=Be(this,1,void 0,Ce);return null==t?x():t}},So=class extends In{constructor(t){super(t)}},Eo=[1,2],Io=Mi(class extends In{constructor(t){super(t)}},[0,Li,[0,Eo,Ui,[0,gi],Ui,[0,Ni],wi,Bi],vi]),Ao=class extends In{constructor(t){super(t)}},To=class extends In{constructor(t){super(t)}},xo=[0,Ii,-1],Bo=class extends In{constructor(t){super(t)}i(){return Oe(this,Qi,2,Lo)}},Lo=[1,2,3,4,5,6],Uo=class extends In{constructor(t){super(t)}i(){return null!=Be(this,1,void 0,Ce)}j(){return null!=ne(Be(this,2))}},No=class extends In{constructor(t){super(t)}},Oo=[0,Ni,Bi,[0,wi,vi,-1],[0,bi,vi]],Po=[0,Oo,Ii,[0,Lo,Ui,io,Ui,Zi,Ui,Ji,Ui,no,Ui,eo,Ui,to],ki],jo=class extends In{constructor(t){super(t)}},ko=new Ci(462704549,jo);so[462704549]=[0,Po,[0,Bi,wi,di,Ti,-1]];var Fo=class extends In{constructor(t){super(t)}},Vo=new Ci(477589892,Fo);function Co(t,e){if(e=e?we(e):new Ao,void 0!==t.displayNamesLocale?Ue(e,1,re(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Ue(e,1),void 0!==t.maxResults){var r=t.maxResults;if(null!=r){if("number"!=typeof r)throw j("int32");if(!Ct(r))throw j("int32");r|=0}Ue(e,2,r)}else"maxResults"in t&&Ue(e,2);if(void 0!==t.scoreThreshold){if(null!=(r=t.scoreThreshold)&&"number"!=typeof r)throw Error(`Value of float/double field must be a number, found ${typeof r}: ${r}`);Ue(e,3,r)}else"scoreThreshold"in t&&Ue(e,3);return void 0!==t.categoryAllowlist?Me(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&Ue(e,4),void 0!==t.categoryDenylist?Me(e,5,t.categoryDenylist):"categoryDenylist"in t&&Ue(e,5),e}function Mo(t){var e=Number(t);return Number.isSafeInteger(e)?e:String(t)}function Go(t){var e={classifications:Je(t,yo).map(t=>function(t,e=-1,r=""){return{categories:t.map(t=>({index:zt(Be(t,1))??0??-1,score:Be(t,2,void 0,Gt)??0??0,categoryName:ne(Be(t,3))??""??"",displayName:ne(Be(t,4))??""??""})),headIndex:e,headName:r}}(Ke(t,mo,4)?.i()??[],zt(Be(t,2))??0,ne(Be(t,3))??""))};return null!=function(t){return null==t?t:"bigint"==typeof t?(dt(t)?t=Number(t):(t=kt(64,t),t=dt(t)?Number(t):String(t)),t):$t(t)?"number"==typeof t?qt(t):Yt(t):void 0}(Be(t,2,void 0,Qt))&&(e.timestampMs=Mo(Be(t,2,void 0,Qt)??xe)),e}function Ro(t){return Array.from(t,t=>t>127?t-256:t)}function Do(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);var r=0,n=0,i=0;for(let o=0;o<t.length;o++)r+=t[o]*e[o],n+=t[o]*t[o],i+=e[o]*e[o];if(n<=0||i<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(n*i)}so[477589892]=[0,Po,xo,1,Oo];var $o,zo=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function Wo(t){if(t)return!0;if(void 0===$o)try{await WebAssembly.instantiate(zo),$o=!0}catch{$o=!1}return $o}async function Ho(t,e,r){return{wasmLoaderPath:`${e}/${t}_${r=`wasm${r?"_module":""}${await Wo(r)?"":"_nosimd"}_internal`}.js`,wasmBinaryPath:`${e}/${t}_${r}.wasm`}}var qo=class{};function Ko(t){return or(new Yo,1,t)}qo.forVisionTasks=function(t,e=!1){return Ho("vision",t??Yi``,e)},qo.forTextTasks=function(t,e=!1){return Ho("text",t??Yi``,e)},qo.forGenAiTasks=function(t,e=!1){return Ho("genai",t??Yi``,e)},qo.forAudioTasks=function(t,e=!1){return Ho("audio",t??Yi``,e)},qo.isSimdSupported=function(t=!1){return Wo(t)};var Yo=class extends In{constructor(t){super(t)}},Jo=class extends In{constructor(t){super(t)}},Xo=[0,ki,2,bi,-2,vi,Li,[0,ki,vi]],Qo=class extends In{constructor(t){super(t)}},Zo=class extends In{constructor(t){super(t)}};function ts(t,e){return or(t,1,e)}function es(t,e){return or(t,2,e)}var rs=class extends In{constructor(t){super(t)}},ns=[3,4,5,6,7],is=class extends In{constructor(t){super(t)}},os=class extends In{constructor(t){super(t)}};os.prototype.i=Gi([0,[0,ki,Bi,-3,ki],[0,ns,ki,-1,Ui,[0,ki,Bi,bi],Ui,Xo,Ui,[0,1,Xo],Ui,[0,ki],Ui,[0,ki,Bi,bi]]]);var ss=class{constructor(){this.g="undefined"!=typeof AbortController}async send(t,e,r){var n=this.g?new AbortController:void 0,i=n&&t.N>0?setTimeout(()=>{n.abort()},t.N):void 0;try{let i=await fetch(t.url,{method:t.fa,headers:{...t.ea},...t.body&&{body:t.body},...t.withCredentials&&{credentials:"include"},signal:t.N&&n?n.signal:null});200===i.status?e?.(await i.text()):r?.(i.status)}catch(t){if("AbortError"===t?.name)r?.(408);else r?.(400)}finally{clearTimeout(i)}}},as=class extends In{constructor(t){super(t,37)}},us=[-4,{},Wi,ki,$i],cs=[0,Bi,ki,1,Bi,-1,ki,1,ki,1,vi],ls=[0,ki,Bi,-2],hs=[0,Bi,ki],fs=[0,Bi,ki],ds=[0,Ii,-3],gs=[0,ki,Bi,-1,vi,wi,-1,Bi,-5,Li,[0,Bi,-4],-1,Ii,[0,Ii,-3],ki];var ps,vs=class extends In{constructor(t){super(t,19)}},ms=(ps=[-19,{},[0,ki,1,[0,Bi,-6,vi,wi,Bi,-1,vi],1,[0,Bi,1,Bi,-5],Bi,-1,[0,ki,Bi,-8],[0,Bi,-3],[0,Bi,ki,Bi,-2],[0,Bi,-1,ki,Bi,-1,ki,Bi,-1,[0,Li,[0,Bi,-1],Ii,Bi,-5],[0,ki,Ii,wi,-2]],vi,[0,Bi,-3,vi,wi,Bi,-1],[0,ki,Bi,-1],[0,Bi,-9],[0,Bi,-6,ki,Bi,1,Bi,Ii,ki,-1,Ii,Bi,-2,ki,Bi,ki,Bi,wi,-1],1,[0,ki],1,[0,Bi,-4],1,cs,[0,[1,2,3,4,5,6],Ui,cs,Ui,hs,Ui,fs,Ui,[0,ki],Ui,gs,Ui,ls],hs,fs,gs,[0,[0,ki,Bi,-1,vi,wi,-1,Bi,-4,Li,[0,Bi,-4],-1,1,ds],[0,ki,Bi,-1,vi,wi,-1,Bi,-4,ds]],ls,[0,Bi,[0,wi,-3,ki],ki,-2,[0,wi,-1],Ii],4,[0,Bi,ki,Bi,-1,vi,ki,Bi,-1,ki,wi,-1]],ki,Li,[-37,{},pi,Bi,Li,[0,Bi,-1],Ni,1,Ni,[0,Ti,-1,_i,mi,-1],Bi,[0,wi,Bi,-1],Ii,wi,vi,Bi,-1,Vi,Di,pi,Ni,ki,_i,vi,-1,[0,ki,-1],Bi,Ii,Bi,Si,Bi,-1,fi,1,fi,us,Ii,[0,ki,[0,di,wi,-2],[0,di]],[0,ki,vi]],pi,Oi,Bi,-1,pi,ki,-1,[0,Ii,-1,ki,Ii],[0,vi,-1,Bi],[0,pi,Ii,vi],vi,1,Pi,1,us],t=>Xn(t,ps)),ys=class{constructor(t){this.i=[],this.m=new ss,this.j=t??"",this.g=setInterval(()=>{this.flush()},6e4)}close(){void 0!==this.g&&(clearInterval(this.g),this.g=void 0),this.flush()}flush(t,e){if(this.error)e?.("net-send-failed");else if(0===this.i.length)t?.();else{var r=this.i;this.i=[],r=function(t){var e=new vs;{Ie(e=or(e,2,1786));let c=e.l,l=0|c[Y];if(null==t)Ne(c,l,3);else{var r=t===M?7:0|t[Y],n=r,i=Ve(r),o=i||Object.isFrozen(t),s=!0,a=!0;for(let e=0;e<t.length;e++){var u=t[e];i||(u=tt(u),s&&=!u,a&&=u)}i||(r=s?13:5,r=a?-4097&r:4096|r),o&&r===n||(t=jt(t),n=0,r=tr(r,l)),r!==n&&Q(t,r),l=Ne(c,l,3,t),2&r||!(4096&r||16&r)||Ae(c,l)}}return e}(r),r=ms(r),this.m.send({url:"https://odml.pa.googleapis.com/v1/log",fa:"POST",N:1e4,body:r,ga:2,ea:{"Content-Type":"application/x-protobuf","x-goog-api-key":this.j},withCredentials:!1},()=>{t?.()},t=>{this.error=Error(`Logging failed with HTTP error: ${t}`),this.i=[],void 0!==this.g&&(clearInterval(this.g),this.g=void 0),e?.("net-send-failed",t)})}}};class bs{constructor(){this.J=this.C=this.H=this.B=this.F=this.G=this.D=0}}function ws(t,e){var r=new os;r=Qe(r,0,1,t.U),r=Qe(r,0,2,e),e=Ue(e=new as,6,rt(r=r.i(),!1)),(t=t.v).error||t.i.push(e)}function _s(t,e){var r={D:e.D-t.j.D,G:e.G-t.j.G,F:e.F-t.j.F,B:e.B-t.j.B,H:e.H-t.j.H,C:e.C,J:e.J},n=es(ts(new rs,t.A),1);r=Ss(t,r),ws(t,n=Ze(n,4,ns,r)),t.j=e}function Ss(t,e){var r=new Jo;return t=ir(t=nr(t=or(r,1,t.I),7,e.B),5,e.C),t=ir(t,6,e.J),e.F>0&&ir(t,4,e.H/e.F),0!==e.D&&(r=nr(r=Ko(3),2,e.D),er(t,8,Yo,r)),0!==e.G&&(e=nr(r=Ko(4),2,e.G),er(t,8,Yo,e)),t}var Es=class{constructor(t,e,r){this.T=performance.now(),this.m=performance.now(),this.i=new Map,this.u=0,this.g=new bs,this.j=new bs,this.v=new ys(r),this.A=function(t){switch(t){case"AudioClassifier":return 4;case"AudioEmbedder":return 5;case"TextClassifier":return 6;case"TextEmbedder":return 7;case"GestureRecognizer":return 8;case"HandDetector":return 9;case"HandLandmarker":return 10;case"ImageClassifier":return 11;case"ImageEmbedder":return 12;case"ImageSegmenter":return 13;case"ObjectDetector":return 14;case"FaceDetector":return 15;case"FaceLandmarker":return 16;case"InteractiveSegmenter":case"InteractiveSegmenterLegacy":return 18;case"HolisticLandmarker":return 20;case"LlmInference":return 21;case"LanguageDetector":return 22;case"PoseLandmarker":return 23;default:return 0}}(t),this.I=function(t){switch(t){case"IMAGE":return 11;case"VIDEO":return 12;case"LIVE_STREAM":return 13;case"AUDIO_CLIPS":return 14;case"AUDIO_STREAM":return 15;default:return 10}}(e),t=new is,"undefined"==typeof window?e=0:(e=navigator.userAgent,e=/Android/i.test(e)?1:/iPhone|iPad|iPod/i.test(e)?2:/Windows/i.test(e)?5:/Macintosh/i.test(e)?4:/Linux/i.test(e)?3:0),t=Ue(t=or(t,1,e),2,re("")),t=Ue(t,3,re("")),t=Ue(t,4,re("1.0.1")),t=Ue(t,5,re("")),this.U=or(t,6,4)}ca(){var t=new Zo;t=ir(t=or(t,1,this.I),3,performance.now()-this.T),ws(this,t=Ze(es(ts(new rs,this.A),0),3,ns,t)),this.m=performance.now()}ba(){var t={...this.g,B:this.g.B+this.i.size,C:this.u,J:performance.now()-this.T};_s(this,t);var e=new Qo;e=Qe(e,0,2,t=Ss(this,t)),ws(this,e=Ze(t=es(ts(new rs,this.A),2),5,ns,e))}close(){var t=this.v;"function"==typeof t.close?t.close():t.flush()}};function Is(){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 As(t){if("function"!=typeof importScripts){let e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise((t,r)=>{e.addEventListener("load",()=>{t()},!1),e.addEventListener("error",t=>{r(t)},!1),document.body.appendChild(e)})}try{importScripts(t.toString())}catch(e){if(!(e instanceof TypeError))throw e;{let e=self.import;e?await e(t.toString()):await import(t.toString())}}}function Ts(t,e,r){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(e=t.h.stringToNewUTF8(e)),t.h._free(e)}function xs(t,e,r){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");var n=new Uint32Array(e.length);for(let r=0;r<e.length;r++)n[r]=t.h.stringToNewUTF8(e[r]);e=t.h._malloc(4*n.length),t.h.HEAPU32.set(n,e>>2),r(e);for(let e of n)t.h._free(e);t.h._free(e)}function Bs(t,e,r){t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=r}function Ls(t,e,r){var n=[];t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=(t,e,i)=>{e?(r(n,i),n=[]):n.push(t)}}var Us=function(t){return class extends t{get P(){return this.h}Z(){if("function"==typeof this.P._mediapipeLoggerGetEncodedApiKey){let t=this.P._mediapipeLoggerGetEncodedApiKey();return this.P._decodeBase64(t)}}}}(function(t){return class extends t{da(){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:Is()?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){var 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){var r=t.length,n=this.h._malloc(r);this.h.HEAPU8.set(t,n),e?this.h._changeBinaryGraph(r,n):this.h._changeTextGraph(r,n),this.h._free(n)}configureAudio(t,e,r,n,i){this.h._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),Ts(this,n||"input_audio",n=>{Ts(this,i=i||"audio_header",i=>{this.h._configureAudio(n,i,t,e??0,r)})})}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,r){this.addAudioToStreamWithShape(t,0,0,e,r)}addAudioToStreamWithShape(t,e,r,n,i){var 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),Ts(this,n,t=>{this.h._addAudioToInputStream(this.g,e,r,t,i)})}addGpuBufferToStream(t,e,r){Ts(this,e,e=>{if(!this.h.canvas)throw Error("No OpenGL canvas configured.");e?this.h._bindTextureToStream(e):this.h._bindTextureToCanvas();var n=this.h.canvas.getContext("webgl2")||this.h.canvas.getContext("webgl");if(!n)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");this.h.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),this.h.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);var[i,o]=void 0!==t.videoWidth?[t.videoWidth,t.videoHeight]:void 0!==t.naturalWidth?[t.naturalWidth,t.naturalHeight]:void 0!==t.displayWidth?[t.displayWidth,t.displayHeight]:[t.width,t.height];!this.j||i===this.h.canvas.width&&o===this.h.canvas.height||(this.h.canvas.width=i,this.h.canvas.height=o);var[s,a]=[i,o];this.h._addBoundTextureToStream(e,s,a,r)})}addBoolToStream(t,e,r){Ts(this,e,e=>{this.h._addBoolToInputStream(t,e,r)})}addDoubleToStream(t,e,r){Ts(this,e,e=>{this.h._addDoubleToInputStream(t,e,r)})}addFloatToStream(t,e,r){Ts(this,e,e=>{this.h._addFloatToInputStream(t,e,r)})}addIntToStream(t,e,r){Ts(this,e,e=>{this.h._addIntToInputStream(t,e,r)})}addUintToStream(t,e,r){Ts(this,e,e=>{this.h._addUintToInputStream(t,e,r)})}addStringToStream(t,e,r){Ts(this,e,e=>{Ts(this,t,t=>{this.h._addStringToInputStream(t,e,r)})})}addStringRecordToStream(t,e,r){Ts(this,e,e=>{xs(this,Object.keys(t),n=>{xs(this,Object.values(t),i=>{this.h._addFlatHashMapToInputStream(n,i,Object.keys(t).length,e,r)})})})}addProtoToStream(t,e,r,n){Ts(this,r,r=>{Ts(this,e,e=>{var i=this.h._malloc(t.length);this.h.HEAPU8.set(t,i),this.h._addProtoToInputStream(i,t.length,e,r,n),this.h._free(i)})})}addEmptyPacketToStream(t,e){Ts(this,t,t=>{this.h._addEmptyPacketToInputStream(t,e)})}addBoolVectorToStream(t,e,r){Ts(this,e,e=>{var n=this.h._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(let e of t)this.h._addBoolVectorEntry(n,e);this.h._addBoolVectorToInputStream(n,e,r)})}addDoubleVectorToStream(t,e,r){Ts(this,e,e=>{var n=this.h._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(let e of t)this.h._addDoubleVectorEntry(n,e);this.h._addDoubleVectorToInputStream(n,e,r)})}addFloatVectorToStream(t,e,r){Ts(this,e,e=>{var n=this.h._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(let e of t)this.h._addFloatVectorEntry(n,e);this.h._addFloatVectorToInputStream(n,e,r)})}addIntVectorToStream(t,e,r){Ts(this,e,e=>{var n=this.h._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(let e of t)this.h._addIntVectorEntry(n,e);this.h._addIntVectorToInputStream(n,e,r)})}addUintVectorToStream(t,e,r){Ts(this,e,e=>{var n=this.h._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(let e of t)this.h._addUintVectorEntry(n,e);this.h._addUintVectorToInputStream(n,e,r)})}addStringVectorToStream(t,e,r){Ts(this,e,e=>{var n=this.h._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(let e of t)Ts(this,e,t=>{this.h._addStringVectorEntry(n,t)});this.h._addStringVectorToInputStream(n,e,r)})}addBoolToInputSidePacket(t,e){Ts(this,e,e=>{this.h._addBoolToInputSidePacket(t,e)})}addDoubleToInputSidePacket(t,e){Ts(this,e,e=>{this.h._addDoubleToInputSidePacket(t,e)})}addFloatToInputSidePacket(t,e){Ts(this,e,e=>{this.h._addFloatToInputSidePacket(t,e)})}addIntToInputSidePacket(t,e){Ts(this,e,e=>{this.h._addIntToInputSidePacket(t,e)})}addUintToInputSidePacket(t,e){Ts(this,e,e=>{this.h._addUintToInputSidePacket(t,e)})}addStringToInputSidePacket(t,e){Ts(this,e,e=>{Ts(this,t,t=>{this.h._addStringToInputSidePacket(t,e)})})}addProtoToInputSidePacket(t,e,r){Ts(this,r,r=>{Ts(this,e,e=>{var n=this.h._malloc(t.length);this.h.HEAPU8.set(t,n),this.h._addProtoToInputSidePacket(n,t.length,e,r),this.h._free(n)})})}addBoolVectorToInputSidePacket(t,e){Ts(this,e,e=>{var r=this.h._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(let e of t)this.h._addBoolVectorEntry(r,e);this.h._addBoolVectorToInputSidePacket(r,e)})}addDoubleVectorToInputSidePacket(t,e){Ts(this,e,e=>{var r=this.h._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(let e of t)this.h._addDoubleVectorEntry(r,e);this.h._addDoubleVectorToInputSidePacket(r,e)})}addFloatVectorToInputSidePacket(t,e){Ts(this,e,e=>{var r=this.h._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(let e of t)this.h._addFloatVectorEntry(r,e);this.h._addFloatVectorToInputSidePacket(r,e)})}addIntVectorToInputSidePacket(t,e){Ts(this,e,e=>{var r=this.h._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(let e of t)this.h._addIntVectorEntry(r,e);this.h._addIntVectorToInputSidePacket(r,e)})}addUintVectorToInputSidePacket(t,e){Ts(this,e,e=>{var r=this.h._allocateUintVector(t.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(let e of t)this.h._addUintVectorEntry(r,e);this.h._addUintVectorToInputSidePacket(r,e)})}addStringVectorToInputSidePacket(t,e){Ts(this,e,e=>{var r=this.h._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(let e of t)Ts(this,e,t=>{this.h._addStringVectorEntry(r,t)});this.h._addStringVectorToInputSidePacket(r,e)})}attachBoolListener(t,e){Bs(this,t,e),Ts(this,t,t=>{this.h._attachBoolListener(t)})}attachBoolVectorListener(t,e){Ls(this,t,e),Ts(this,t,t=>{this.h._attachBoolVectorListener(t)})}attachIntListener(t,e){Bs(this,t,e),Ts(this,t,t=>{this.h._attachIntListener(t)})}attachIntVectorListener(t,e){Ls(this,t,e),Ts(this,t,t=>{this.h._attachIntVectorListener(t)})}attachUintListener(t,e){Bs(this,t,e),Ts(this,t,t=>{this.h._attachUintListener(t)})}attachUintVectorListener(t,e){Ls(this,t,e),Ts(this,t,t=>{this.h._attachUintVectorListener(t)})}attachDoubleListener(t,e){Bs(this,t,e),Ts(this,t,t=>{this.h._attachDoubleListener(t)})}attachDoubleVectorListener(t,e){Ls(this,t,e),Ts(this,t,t=>{this.h._attachDoubleVectorListener(t)})}attachFloatListener(t,e){Bs(this,t,e),Ts(this,t,t=>{this.h._attachFloatListener(t)})}attachFloatVectorListener(t,e){Ls(this,t,e),Ts(this,t,t=>{this.h._attachFloatVectorListener(t)})}attachStringListener(t,e){Bs(this,t,e),Ts(this,t,t=>{this.h._attachStringListener(t)})}attachStringVectorListener(t,e){Ls(this,t,e),Ts(this,t,t=>{this.h._attachStringVectorListener(t)})}attachProtoListener(t,e,r){Bs(this,t,e),Ts(this,t,t=>{this.h._attachProtoListener(t,r||!1)})}attachProtoVectorListener(t,e,r){Ls(this,t,e),Ts(this,t,t=>{this.h._attachProtoVectorListener(t,r||!1)})}attachAudioListener(t,e,r){this.h._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Bs(this,t,(t,r)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,r)}),Ts(this,t,t=>{this.h._attachAudioListener(t,r||!1)})}finishProcessing(){this.h._waitUntilIdle()}closeGraph(){this.h._closeGraph(),this.h.simpleListeners=void 0,this.h.emptyPacketListeners=void 0}})),Ns=class extends Us{};async function Os(t,e,r){return t=await(async(t,e,r,n)=>{if(e&&await As(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(r&&(await As(r),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&n&&((e=self.Module).locateFile=n.locateFile,n.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=n.mainScriptUrlOrBlob)),n=await self.ModuleFactory(self.Module||n),self.ModuleFactory=self.Module=void 0,new t(n,null)})(t,e.wasmLoaderPath,e.assetLoaderPath,{locateFile:t=>t.endsWith(".wasm")?e.wasmBinaryPath.toString():e.assetBinaryPath&&t.endsWith(".data")?e.assetBinaryPath.toString():t}),function(t,e){e=e.ma??"";var r=t.g.Z();t.i=new Es(t.I(),e,r)}(t,r),await t.o(r),t}async function Ps(t,e,r){return Os(t,e,r)}function js(t,e){var r=Ke(t.baseOptions,Uo,1)||new Uo;"string"==typeof e?(Ue(r,2,re(e)),Ue(r,1)):e instanceof Uint8Array&&(Ue(r,1,rt(e,!1)),Ue(r,2)),Qe(t.baseOptions,0,1,r)}function ks(t,e){var r=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Ke(t.baseOptions,Uo,1)?.i()||Ke(t.baseOptions,Uo,1)?.j()||e.baseOptions?.modelAssetBuffer||e.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,e){var r=Ke(t.baseOptions,Bo,3);if(!r){var n=r=new Bo,i=new ro;Ze(n,4,Lo,i)}"delegate"in e&&("GPU"===e.delegate?(e=r,n=new Qi,Ze(e,2,Lo,n)):(e=r,n=new ro,Ze(e,4,Lo,n))),Qe(t.baseOptions,0,3,r)}(t,r),r.modelAssetPath)return fetch(r.modelAssetPath.toString()).then(t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${r.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),js(t,"/model.dat"),t.A()});if(r.modelAssetBuffer instanceof Uint8Array)js(t,r.modelAssetBuffer);else if(r.modelAssetBuffer)return async function(t){for(var e=[],r=0;;){let{done:n,value:i}=await t.read();if(n)break;e.push(i),r+=i.length}if(0===e.length)return new Uint8Array(0);if(1===e.length)return e[0];t=new Uint8Array(r),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}(r.modelAssetBuffer).then(e=>{js(t,e),t.A()});return t.A(),Promise.resolve()}function Fs(t){try{let e=t.u.length;if(1===e)throw Error(t.u[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.u.map(t=>t.message).join(", "))}finally{t.u=[]}}function Vs(t,e){t.i&&void 0!==e&&(Ke(t.baseOptions,Bo,3)?.i()?(++(t=t.i).g.G,t.i.set(e,performance.now())):(++(t=t.i).g.D,t.i.set(e,performance.now())))}function Cs(t,e){t.m=Math.max(t.m,e)}var Ms=class{constructor(t){this.g=t,this.u=[],this.m=0,this.g.setAutoRenderToScreen(!1)}setGraph(t,e){this.g.attachErrorListener((t,e)=>{this.u.push(Error(e))}),this.g.da(),this.g.setGraph(t,e),this.i?.ca(),Fs(this)}finishProcessing(t){if(this.g.finishProcessing(),Fs(this),this.i&&void 0!==t){var e=this.i,r=e.i.get(t);if(void 0!==r&&(e.i.delete(t),t=performance.now()-r,++e.g.F,e.g.H+=t,e.g.C=Math.max(e.g.C,t),e.u=Math.max(e.u,t),performance.now()>e.m+3e4)){for(let[n,i]of e.i.entries())t=n,i<r&&(e.g.B++,e.i.delete(t));r={...e.g,J:performance.now()-e.m},e.g.C=0,e.m=performance.now(),_s(e,r)}}}close(){this.i?.ba(),this.i?.close(),this.g.closeGraph()}};Ms.prototype.close=Ms.prototype.close;var Gs=class extends Ms{constructor(t,e){super(new Ns(t,e)),this.v={languages:[]},Qe(t=this.j=new jo,0,1,e=new No)}I(){return"LanguageDetector"}o(t){return Qe(this.j,0,2,Co(t,Ke(this.j,Ao,2))),ks(this,t)}get baseOptions(){return Ke(this.j,No,1)}set baseOptions(t){Qe(this.j,0,1,t)}X(t){this.v={languages:[]};var e=this.m+1;return Vs(this,e),this.g.addStringToStream(t,"text_in",e),this.finishProcessing(e),this.v}A(){var t=new po;go(t),sr(t,15,"classifications_out");var e=new oo;En(e,ko,this.j);var r=new co;Ge(r,re("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),uo(r),sr(r,4,"CLASSIFICATIONS:classifications_out"),r.o(e),er(t,1,co,r),this.g.attachProtoListener("classifications_out",(t,e)=>{if(({classifications:t}=Go(bo(t))),1!==t.length)throw Error(`Expected 1 classification head, got ${t.length}`);this.v.languages=t[0].categories.map(t=>({languageCode:t.categoryName,probability:t.score})),Cs(this,e)}),this.g.attachEmptyPacketListener("classifications_out",t=>{Cs(this,t)}),t=t.i(),this.setGraph(new Uint8Array(t),!0)}};Gs.prototype.detect=Gs.prototype.X,Gs.prototype.setOptions=Gs.prototype.o,Gs.createFromModelPath=function(t,e){return Ps(Gs,t,{baseOptions:{modelAssetPath:e}})},Gs.createFromModelBuffer=function(t,e){return Ps(Gs,t,{baseOptions:{modelAssetBuffer:e}})},Gs.createFromOptions=function(t,e){return Ps(Gs,t,e)};var Rs=class extends Ms{constructor(t,e){super(new Ns(t,e)),this.v={classifications:[]},Qe(t=this.j=new jo,0,1,e=new No)}I(){return"TextClassifier"}o(t){return Qe(this.j,0,2,Co(t,Ke(this.j,Ao,2))),ks(this,t)}get baseOptions(){return Ke(this.j,No,1)}set baseOptions(t){Qe(this.j,0,1,t)}W(t){this.v={classifications:[]};var e=this.m+1;return Vs(this,e),this.g.addStringToStream(t,"text_in",e),this.finishProcessing(e),this.v}A(){var t=new po;go(t),sr(t,15,"classifications_out");var e=new oo;En(e,ko,this.j);var r=new co;Ge(r,re("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),uo(r),sr(r,4,"CLASSIFICATIONS:classifications_out"),r.o(e),er(t,1,co,r),this.g.attachProtoListener("classifications_out",(t,e)=>{this.v=Go(bo(t)),Cs(this,e)}),this.g.attachEmptyPacketListener("classifications_out",t=>{Cs(this,t)}),t=t.i(),this.setGraph(new Uint8Array(t),!0)}};function Ds(t){switch(t){case"RETRIEVAL_QUERY":default:return"search result";case"SEMANTIC_SIMILARITY":return"sentence similarity";case"CLASSIFICATION":return"classification";case"CLUSTERING":return"clustering";case"QUESTION_ANSWERING":return"question answering";case"FACT_CHECKING":return"fact checking";case"CODE_RETRIEVAL":return"code retrieval"}}Rs.prototype.classify=Rs.prototype.W,Rs.prototype.setOptions=Rs.prototype.o,Rs.createFromModelPath=function(t,e){return Ps(Rs,t,{baseOptions:{modelAssetPath:e}})},Rs.createFromModelBuffer=function(t,e){return Ps(Rs,t,{baseOptions:{modelAssetBuffer:e}})},Rs.createFromOptions=function(t,e){return Ps(Rs,t,e)};var $s=class extends Ms{constructor(t,e){super(new Ns(t,e)),this.v={embeddings:[]},Qe(t=this.j=new Fo,0,1,e=new No)}I(){return"TextEmbedder"}o(t){var e=this.j,r=Ke(this.j,To,2);return r=r?we(r):new To,void 0!==t.l2Normalize?Ue(r,1,Rt(t.l2Normalize)):"l2Normalize"in t&&Ue(r,1),void 0!==t.quantize?Ue(r,2,Rt(t.quantize)):"quantize"in t&&Ue(r,2),Qe(e,0,2,r),ks(this,t)}get baseOptions(){return Ke(this.j,No,1)}set baseOptions(t){Qe(this.j,0,1,t)}Y(t,e){var r=this.m+1;if(Vs(this,r),e)t:{let r=e.type,n=e.title&&e.title.length>0?e.title:"none";switch(e="DOCUMENT"!==e.textRole,r){case"RETRIEVAL_DOCUMENT":t=`title: ${n} | text: ${t}`;break t;case"RETRIEVAL_QUERY":t=`task: ${Ds(r)} | query: ${t}`;break t;case"QUESTION_ANSWERING":case"FACT_CHECKING":case"CODE_RETRIEVAL":t=e?`task: ${Ds(r)} | query: ${t}`:`title: ${n} | text: ${t}`;break t;default:t=`task: ${Ds(r)} | query: ${t}`}}return this.g.addStringToStream(t,"text_in",r),this.finishProcessing(r),this.v}A(){var t=new po;go(t),sr(t,15,"embeddings_out");var e=new oo;En(e,Vo,this.j);var r=new co;Ge(r,re("mediapipe.tasks.text.text_embedder.TextEmbedderGraph")),uo(r),sr(r,4,"EMBEDDINGS:embeddings_out"),r.o(e),er(t,1,co,r),this.g.attachProtoListener("embeddings_out",(t,e)=>{t=Io(t),this.v=function(t){return{embeddings:Je(t,So).map(t=>{var e={headIndex:zt(Be(t,3))??0??-1,headName:ne(Be(t,4))??""??""};if(Oe(t,wo,1,Eo))t=Pe(t=rr(t,wo,1),1,Gt,void 0===nt?2:4),e.floatEmbedding=t.slice();else{let r=new Uint8Array(0);e.quantizedEmbedding=rr(t,_o,2)?.i()?.i()??r}return e}),timestampMs:Mo(Be(t,2,void 0,Qt)??xe)}}(t),Cs(this,e)}),this.g.attachEmptyPacketListener("embeddings_out",t=>{Cs(this,t)}),t=t.i(),this.setGraph(new Uint8Array(t),!0)}};$s.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=Do(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=Do(Ro(t.quantizedEmbedding),Ro(e.quantizedEmbedding))}return t},$s.prototype.embed=$s.prototype.Y,$s.prototype.setOptions=$s.prototype.o,$s.createFromModelPath=function(t,e){return Ps($s,t,{baseOptions:{modelAssetPath:e}})},$s.createFromModelBuffer=function(t,e){return Ps($s,t,{baseOptions:{modelAssetBuffer:e}})},$s.createFromOptions=function(t,e){return Ps($s,t,e)},exports.FilesetResolver=qo,exports.LanguageDetector=Gs,exports.TaskRunner=Ms,exports.TextClassifier=Rs,exports.TextEmbedder=$s;
1
+ "use strict";var t="undefined"!=typeof self?self:{};function e(e,r){t:{for(var n=["CLOSURE_FLAGS"],i=t,o=0;o<n.length;o++)if(null==(i=i[n[o]])){n=null;break t}n=i}return null!=(e=n&&n[e])?e:r}function r(){throw Error("Invalid UTF8")}function n(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}var i,o,s=void 0,a="undefined"!=typeof TextDecoder,u="undefined"!=typeof TextEncoder;function l(t){if(u)t=(o||=new TextEncoder).encode(t);else{let r=0,n=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(e<128)n[r++]=e;else{if(e<2048)n[r++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&i<t.length){let o=t.charCodeAt(++i);if(o>=56320&&o<=57343){e=1024*(e-55296)+o-56320+65536,n[r++]=e>>18|240,n[r++]=e>>12&63|128,n[r++]=e>>6&63|128,n[r++]=63&e|128;continue}i--}e=65533}n[r++]=e>>12|224,n[r++]=e>>6&63|128}n[r++]=63&e|128}}t=r===n.length?n:n.subarray(0,r)}return t}var c=e(610401301,!1),h=e(748402147,!0);function f(){var e=t.navigator;return e&&(e=e.userAgent)?e:""}var d,p=t.navigator;function v(t){return v[" "](t),t}d=p&&p.userAgentData||null,v[" "]=function(){};var g={},m=null;function y(t){var e=t.length,r=3*e/4;r%3?r=Math.floor(r):-1!="=.".indexOf(t[e-1])&&(r=-1!="=.".indexOf(t[e-2])?r-2:r-1);var n=new Uint8Array(r),i=0;return function(t,e){function r(e){for(;n<t.length;){let e=t.charAt(n++),r=m[e];if(null!=r)return r;if(!/^[\s\xa0]*$/.test(e))throw Error("Unknown base64 encoding at char: "+e)}return e}b();for(var n=0;;){let t=r(-1),n=r(0),i=r(64),o=r(64);if(64===o&&-1===t)break;e(t<<2|n>>4),64!=i&&(e(n<<4&240|i>>2),64!=o&&e(i<<6&192|o))}}(t,function(t){n[i++]=t}),i!==r?n.subarray(0,i):n}function b(){if(!m){m={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){let n=t.concat(e[r].split(""));g[r]=n;for(let t=0;t<n.length;t++){let e=n[t];void 0===m[e]&&(m[e]=t)}}}}var w="undefined"!=typeof Uint8Array,_=!(!(c&&d&&d.brands.length>0)&&(-1!=f().indexOf("Trident")||-1!=f().indexOf("MSIE")))&&"function"==typeof btoa,S=/[-_.]/g,A={"-":"+",_:"/",".":"="};function E(t){return A[t]||""}function I(t){if(!_)return y(t);t=S.test(t)?t.replace(S,E):t,t=atob(t);var e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}var j={};function T(){return B||=new L(null,j)}function x(t){U(j);var e=t.h;return null==(e=null==e||w&&null!=e&&e instanceof Uint8Array?e:"string"==typeof e?I(e):null)?e:t.h=e}var B,L=class{j(){return new Uint8Array(x(this)||0)}constructor(t,e){if(U(e),this.h=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};function U(t){if(t!==j)throw Error("illegal external caller")}function N(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}var O=void 0;function P(t){return N(t=Error(t),"warning"),t}function k(e,r){if(null!=e){var n=O??={},i=n[e]||0;i>=r||(n[e]=i+1,N(e=Error(),"incident"),function(e){t.setTimeout(()=>{throw e},0)}(e))}}function F(){return"function"==typeof BigInt}var V="function"==typeof Symbol&&"symbol"==typeof Symbol();function C(t,e,r=!1){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?r&&Symbol.for&&t?Symbol.for(t):null!=t?Symbol(t):Symbol():e}var M,G=C("jas",void 0,!0),R=C(void 0,"1oa"),D=C(void 0,Symbol()),$=C(void 0,"0ubs"),z=C(void 0,"0ubsb"),W=C(void 0,"0actk"),H=C("m_m","ka",!0),q={ba:{value:0,configurable:!0,writable:!0,enumerable:!1}},K=Object.defineProperties,J=V?G:"ba",Y=[];function X(t,e){V||J in t||K(t,q),t[J]|=e}function Q(t,e){V||J in t||K(t,q),t[J]=e}Q(Y,7),M=Object.freeze(Y);var Z={};function tt(t,e){return void 0===e?t.h!==et&&!!(2&t.m[J]):!!(2&e)&&t.h!==et}var et={};function rt(t,e){if(null!=t)if("string"==typeof t)t=t?new L(t,j):T();else if(t.constructor!==L)if(w&&null!=t&&t instanceof Uint8Array)t=t.length?new L(new Uint8Array(t),j):T();else{if(!e)throw Error();t=void 0}return t}var nt=Object.freeze({});function it(t,e,r){var n,i=128&e?0:-1,o=t.length;(n=!!o)&&(n=null!=(n=t[o-1])&&"object"==typeof n&&n.constructor===Object);var s=o+(n?-1:0);for(e=128&e?1:0;e<s;e++)r(e-i,t[e]);if(n){t=t[o-1];for(let e in t)!isNaN(e)&&r(+e,t[e])}}var ot={};function st(t){return 128&t?ot:void 0}function at(t){return t.ia=!0,t}var ut=at(t=>"number"==typeof t),lt=at(t=>"string"==typeof t),ct=at(t=>"boolean"==typeof t),ht="function"==typeof t.BigInt&&"bigint"==typeof t.BigInt(0);function ft(t){var e=t;if(lt(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(ut(e)&&!Number.isSafeInteger(e))throw Error(String(e));return ht?BigInt(t):t=ct(t)?t?"1":"0":lt(t)?t.trim()||"0":String(t)}var dt=at(t=>ht?t>=vt&&t<=mt:"-"===t[0]?yt(t,pt):yt(t,gt)),pt=Number.MIN_SAFE_INTEGER.toString(),vt=ht?BigInt(Number.MIN_SAFE_INTEGER):void 0,gt=Number.MAX_SAFE_INTEGER.toString(),mt=ht?BigInt(Number.MAX_SAFE_INTEGER):void 0;function yt(t,e){if(t.length>e.length)return!1;if(t.length<e.length||t===e)return!0;for(let r=0;r<t.length;r++){let n=t[r],i=e[r];if(n>i)return!1;if(n<i)return!0}}var bt,wt="function"==typeof Uint8Array.prototype.slice,_t=0,St=0;function At(t){var e=t>>>0;_t=e,St=(t-e)/4294967296>>>0}function Et(t){if(t<0){At(-t);let[e,r]=Ot(_t,St);_t=e>>>0,St=r>>>0}else At(t)}function It(t){var e=bt||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),St=0,_t=e.getUint32(0,!0)}function jt(t,e){var r=4294967296*e+(t>>>0);return Number.isSafeInteger(r)?r:Bt(t,e)}function Tt(t,e){return ft(F()?BigInt.asUintN(64,(BigInt(e>>>0)<<BigInt(32))+BigInt(t>>>0)):Bt(t,e))}function xt(t,e){return F()?ft(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(e))<<BigInt(32))+BigInt.asUintN(32,BigInt(t)))):ft(Ut(t,e))}function Bt(t,e){if(t>>>=0,(e>>>=0)<=2097151)var r=""+(4294967296*e+t);else F()?r=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(r=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),r+=8147497*e,e*=2,t>=1e7&&(r+=t/1e7>>>0,t%=1e7),r>=1e7&&(e+=r/1e7>>>0,r%=1e7),r=e+Lt(r)+Lt(t));return r}function Lt(t){return t=String(t),"0000000".slice(t.length)+t}function Ut(t,e){if(2147483648&e)if(F())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{let[r,n]=Ot(t,e);t="-"+Bt(r,n)}else t=Bt(t,e);return t}function Nt(t){if(t.length<16)Et(Number(t));else if(F())t=BigInt(t),_t=Number(t&BigInt(4294967295))>>>0,St=Number(t>>BigInt(32)&BigInt(4294967295));else{let e=+("-"===t[0]);St=_t=0;let r=t.length;for(let n=e,i=(r-e)%6+e;i<=r;n=i,i+=6){let e=Number(t.slice(n,i));St*=1e6,(_t=1e6*_t+e)>=4294967296&&(St+=Math.trunc(_t/4294967296),St>>>=0,_t>>>=0)}if(e){let[t,e]=Ot(_t,St);_t=t,St=e}}}function Ot(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function Pt(t){return Array.prototype.slice.call(t)}var kt="function"==typeof BigInt?BigInt.asIntN:void 0,Ft="function"==typeof BigInt?BigInt.asUintN:void 0,Vt=Number.isSafeInteger,Ct=Number.isFinite,Mt=Math.trunc;function Gt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function Rt(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}var Dt=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function $t(t){switch(typeof t){case"bigint":return!0;case"number":return Ct(t);case"string":return Dt.test(t);default:return!1}}function zt(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Ct(t)?0|t:void 0}function Wt(t){var e=t.length;return("-"===t[0]?e<20||20===e&&t<="-9223372036854775808":e<19||19===e&&t<="9223372036854775807")?t:(Nt(t),Ut(_t,St))}function Ht(t){if("-"===t[0])var e=!1;else e=(e=t.length)<20||20===e&&t<="18446744073709551615";return e?t:(Nt(t),Bt(_t,St))}function qt(t){if(t=Mt(t),!Vt(t)){Et(t);var e=_t,r=St;(t=2147483648&r)&&(r=~r>>>0,0==(e=1+~e>>>0)&&(r=r+1>>>0)),t="number"==typeof(e=jt(e,r))?t?-e:e:t?"-"+e:e}return t}function Kt(t){return(t=Mt(t))>=0&&Vt(t)||(Et(t),t=jt(_t,St)),t}function Jt(t){var e=Mt(Number(t));return Vt(e)?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),Wt(t))}function Yt(t){var e=Mt(Number(t));return Vt(e)?ft(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),F()?ft(kt(64,BigInt(t))):ft(Wt(t)))}function Xt(t){return Vt(t)?t=ft(qt(t)):(t=Mt(t),Vt(t)?t=String(t):(Et(t),t=Ut(_t,St)),t=ft(t)),t}function Qt(t){var e=typeof t;return null==t?t:"bigint"===e?ft(kt(64,t)):$t(t)?"string"===e?Yt(t):Xt(t):void 0}function Zt(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(kt(64,t));if($t(t)){if("string"===e)return Jt(t);if("number"===e)return qt(t)}}function te(t){if(null==t||"string"==typeof t||t instanceof L)return t}function ee(t){if("string"!=typeof t)throw Error();return t}function re(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function ne(t){return null==t||"string"==typeof t?t:void 0}function ie(t,e,r){if(null!=t&&t[H]===Z)return t;if(Array.isArray(t)){var n=0|t[J];return(r=n|32&r|2&r)!==n&&Q(t,r),new e(t)}}function oe(t){return t}function se(t){return D?t[D]:void 0}function ae(t,e){for(let r in t)!isNaN(r)&&e(t,+r,t[r])}var ue,le,ce,he=class{};function fe(t,e){e<100||k($,1)}function de(t,e,r,n){var i=void 0!==n;n=!!n;var o,s=D;!i&&V&&s&&(o=t[s])&&ae(o,fe),s=[];var a=t.length;o=4294967295;var u=!1,l=!!(64&e),c=l?128&e?0:-1:void 0;if(!(1&e)){var h=a&&t[a-1];null!=h&&"object"==typeof h&&h.constructor===Object?o=--a:h=void 0,!l||128&e||i||(u=!0,o=(ue??oe)(o-c,c,t,h,void 0)+c)}e=void 0;for(var f=0;f<a;f++){let i=t[f];if(null!=i&&null!=(i=r(i,n)))if(l&&f>=o){let t=f-c;(e??={})[t]=i}else s[f]=i}if(h)for(let t in h){if(null==(a=h[t])||null==(a=r(a,n)))continue;let i;f=+t,l&&!Number.isNaN(f)&&(i=f+c)<o?s[i]=a:(e??={})[t]=a}return e&&(u?s.push(e):s[o]=e),i&&D&&(t=se(t))&&t instanceof he&&(s[D]=function(t){var e=new he;return ae(t,(t,r,n)=>{e[r]=Pt(n)}),e.h=t.h,e}(t)),s}function pe(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return dt(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(Array.isArray(t)){var e=0|t[J];return 0===t.length&&1&e?void 0:de(t,e,pe)}if(null!=t&&t[H]===Z)return ve(t);if(t instanceof L){if(null==(e=t.h))t="";else if("string"==typeof e)t=e;else{if(_){for(var r="",n=0,i=e.length-10240;n<i;)r+=String.fromCharCode.apply(null,e.subarray(n,n+=10240));r+=String.fromCharCode.apply(null,n?e.subarray(n):e),e=btoa(r)}else{void 0===r&&(r=0),b(),r=g[r],n=Array(Math.floor(e.length/3)),i=r[64]||"";let t=0,l=0;for(;t<e.length-2;t+=3){var o=e[t],s=e[t+1],a=e[t+2],u=r[o>>2];o=r[(3&o)<<4|s>>4],s=r[(15&s)<<2|a>>6],a=r[63&a],n[l++]=u+o+s+a}switch(u=0,a=i,e.length-t){case 2:a=r[(15&(u=e[t+1]))<<2]||i;case 1:e=e[t],n[l]=r[e>>2]+r[(3&e)<<4|u>>4]+a+i}e=n.join("")}t=t.h=e}return t}return}return t}function ve(t){return de(t=t.m,0|t[J],pe)}function ge(t,e){return me(t,e[0],e[1])}function me(t,e,r,n=0){if(null==t){var i=32;r?(t=[r],i|=128):t=[],e&&(i=-16760833&i|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(i=0|t[J],h&&1&i)throw Error("rfarr");if(2048&i&&!(2&i)&&function(){if(h)throw Error("carr");k(W,5)}(),256&i)throw Error("farr");if(64&i)return(i|n)!==i&&Q(t,i|n),t;if(r&&(i|=128,r!==t[0]))throw Error("mid");t:{i|=64;var o=(r=t).length;if(o){var s=o-1;let t=r[s];if(null!=t&&"object"==typeof t&&t.constructor===Object){if((s-=e=128&i?0:-1)>=1024)throw Error("pvtlmt");for(var a in t)(o=+a)<s&&(r[o+e]=t[a],delete t[a]);i=-16760833&i|(1023&s)<<14;break t}}if(e){if((a=Math.max(e,o-(128&i?0:-1)))>1024)throw Error("spvt");i=-16760833&i|(1023&a)<<14}}}return Q(t,64|i|n),t}function ye(t,e){if("object"!=typeof t)return t;if(Array.isArray(t)){var r=0|t[J];return 0===t.length&&1&r?t=void 0:2&r||(!e||4096&r||16&r?t=_e(t,r,!1,e&&!(16&r)):(X(t,34),4&r&&Object.freeze(t))),t}return null!=t&&t[H]===Z?tt(t,r=0|(e=t.m)[J])?t:je(t,e,r)?be(t,e):_e(e,r):t instanceof L?t:void 0}function be(t,e,r){return t=new t.constructor(e),r&&(t.h=et),t.o=et,t}function we(t){var e=t.m,r=0|e[J];return je(t,e,r)?be(t,e,!0):new t.constructor(_e(e,r,!1))}function _e(t,e,r,n){return n??=!!(34&e),t=de(t,e,ye,n),n=32,r&&(n|=2),Q(t,e=16769217&e|n),t}function Se(t){var e=t.m,r=0|e[J];return tt(t,r)?je(t,e,r)?be(t,e,!0):new t.constructor(_e(e,r,!1)):t}function Ae(t){if(t.h!==et)return!1;var e=t.m;return X(e=_e(e,0|e[J]),2048),t.m=e,t.h=void 0,t.o=void 0,!0}function Ee(t){if(!Ae(t)&&tt(t,0|t.m[J]))throw Error()}function Ie(t,e){void 0===e&&(e=0|t[J]),32&e&&!(4096&e)&&Q(t,4096|e)}function je(t,e,r){return!!(2&r)||!(!(32&r)||4096&r)&&(Q(e,2|r),t.h=et,!0)}var Te=ft(0);function xe(t,e,r,n){if(null!==(t=Be(t.m,e,r,n)))return t}function Be(t,e,r,n){if(-1===e)return null;var i=e+(r?0:-1),o=t.length-1;if(!(o<1+(r?0:-1))){if(i>=o){var s=t[o];if(null!=s&&"object"==typeof s&&s.constructor===Object){r=s[e];var a=!0}else{if(i!==o)return;r=s}}else r=t[i];if(n&&null!=r){if(null==(n=n(r)))return n;if(!Object.is(n,r))return a?s[e]=n:t[i]=n,n}return r}}function Le(t,e,r,n){Ee(t);var i=t.m;return Ue(i,0|i[J],e,r,n),t}function Ue(t,e,r,n,i){var o=r+(i?0:-1),s=t.length-1;if(s>=1+(i?0:-1)&&o>=s){let i=t[s];if(null!=i&&"object"==typeof i&&i.constructor===Object)return i[r]=n,e}return o<=s?(t[o]=n,e):(void 0!==n&&(r>=(s=(e??=0|t[J])>>14&1023||536870912)?null!=n&&(t[s+(i?0:-1)]={[r]:n}):t[o]=n),e)}function Ne(t,e,r,n){var i=t.m;return void 0!==qe(i,0|i[J],e,t=De(t,n)===r?r:-1)}function Oe(t,e,r,n,i){var o=t.m,s=0|o[J];n=tt(t,s)?1:n,i=!!i||3===n,2===n&&Ae(t)&&(s=0|(o=t.m)[J]);var a=(t=ke(o,e))===M?7:0|t[J],u=Fe(a,s),l=!(4&u);if(l){4&u&&(t=Pt(t),a=0,u=tr(u,s),s=Ue(o,s,e,t));let n=0,i=0;for(;n<t.length;n++){let e=r(t[n]);null!=e&&(t[i++]=e)}i<n&&(t.length=i),r=-513&u|4,u=r&=-1025,u&=-4097}return u!==a&&(Q(t,u),2&u&&Object.freeze(t)),Pe(t,u,o,s,e,n,l,i)}function Pe(t,e,r,n,i,o,s,a){var u=e;return 1===o||4===o&&(2&e||!(16&e)&&32&n)?Ve(e)||((e|=!t.length||s&&!(4096&e)||32&n&&!(4096&e||16&e)?2:256)!==u&&Q(t,e),Object.freeze(t)):(2===o&&Ve(e)&&(t=Pt(t),u=0,e=tr(e,n),n=Ue(r,n,i,t)),Ve(e)||(a||(e|=16),e!==u&&Q(t,e))),2&e||!(4096&e||16&e)||Ie(r,n),t}function ke(t,e,r){return t=Be(t,e,r),Array.isArray(t)?t:M}function Fe(t,e){return 2&e&&(t|=2),1|t}function Ve(t){return!!(2&t)&&!!(4&t)||!!(256&t)}function Ce(t){return rt(t,!0)}function Me(t,e,r){Ee(t);var n=0|(t=t.m)[J];if(null==r)Ue(t,n,e);else{var i=r===M?7:0|r[J],o=i,s=Ve(i),a=s||Object.isFrozen(r);for(s||(i=0),a||(r=Pt(r),o=0,i=tr(i,n),a=!1),i|=5,i|=(4&i?512&i?512:1024&i?1024:0:void 0)??1024,s=0;s<r.length;s++){let t=r[s],e=ee(t);Object.is(t,e)||(a&&(r=Pt(r),o=0,i=tr(i,n),a=!1),r[s]=e)}i!==o&&(a&&(r=Pt(r),i=tr(i,n)),Q(r,i)),Ue(t,n,e,r)}}function Ge(t,e){Ee(t),Ue(t=t.m,0|t[J],2,""===e?void 0:e)}function Re(t,e,r){if(2&e)throw Error();var n=st(e),i=ke(t,r,n),o=i===M?7:0|i[J],s=Fe(o,e);return(2&s||Ve(s)||16&s)&&(s===o||Ve(s)||Q(i,s),i=Pt(i),o=0,s=tr(s,e),Ue(t,e,r,i,n)),(s&=-13)!==o&&Q(i,s),i}function De(t,e){return We($e(t=t.m),t,void 0,e)}function $e(t){if(V)return t[R]??(t[R]=new Map);if(R in t)return t[R];var e=new Map;return Object.defineProperty(t,R,{value:e}),e}function ze(t,e,r,n,i){var o=$e(t),s=We(o,t,e,r,i);return s!==n&&(s&&(e=Ue(t,e,s,void 0,i)),o.set(r,n)),e}function We(t,e,r,n,i){var o=t.get(n);if(null!=o)return o;o=0;for(let t=0;t<n.length;t++){let s=n[t];null!=Be(e,s,i)&&(0!==o&&(r=Ue(e,r,o,void 0,i)),o=s)}return t.set(n,o),o}function He(t,e,r){var n=0|t[J],i=st(n),o=Be(t,r,i);if(null!=o&&o[H]===Z){if(!tt(o))return Ae(o),o.m;var s=o.m}else Array.isArray(o)&&(s=o);if(s){let t=0|s[J];2&t&&(s=_e(s,t))}return(s=ge(s,e))!==o&&Ue(t,n,r,s,i),s}function qe(t,e,r,n){var i=!1;if(null!=(n=Be(t,n,void 0,t=>{var n=ie(t,r,e);return i=n!==t&&null!=n,n})))return i&&!tt(n)&&Ie(t,e),n}function Ke(t,e,r){var n=t.m,i=0|n[J];if(null==(e=qe(n,i,e,r)))return e;if(!tt(t,i=0|n[J])){let o=Se(e);o!==e&&(Ae(t)&&(i=0|(n=t.m)[J]),Ie(n,i=Ue(n,i,r,e=o)))}return e}function Je(t,e,r,n,i,o,s,a){var u=tt(t,r);o=u?1:o,s=!!s||3===o,u=a&&!u,(2===o||u)&&Ae(t)&&(r=0|(e=t.m)[J]);var l=(t=ke(e,i))===M?7:0|t[J],c=Fe(l,r);if(a=!(4&c)){var h=t,f=r;let e=!!(2&c);e&&(f|=2);let i=!e,o=!0,s=0,a=0;for(;s<h.length;s++){let t=ie(h[s],n,f);if(t instanceof n){if(!e){let e=tt(t);i&&=!e,o&&=e}h[a++]=t}}a<s&&(h.length=a),c|=4,c=o?-4097&c:4096|c,c=i?8|c:-9&c}if(c!==l&&(Q(t,c),2&c&&Object.freeze(t)),u&&!(8&c||!t.length&&(1===o||4===o&&(2&c||!(16&c)&&32&r)))){for(Ve(c)&&(t=Pt(t),c=tr(c,r),r=Ue(e,r,i,t)),n=t,u=c,l=0;l<n.length;l++)(h=n[l])!==(c=Se(h))&&(n[l]=c);u|=8,Q(t,c=u=n.length?4096|u:-4097&u)}return Pe(t,c,e,r,i,o,a,s)}function Ye(t,e){var r=t.m;return Je(t,r,0|r[J],e,1,void 0===nt?2:4,!1,!0)}function Xe(t){return null==t&&(t=void 0),t}function Qe(t,e,r,n,i){return Le(t,r,n=Xe(n),i),n&&!tt(n)&&Ie(t.m),t}function Ze(t,e,r,n){t:{var i=n=Xe(n);Ee(t);let o=t.m,s=0|o[J];if(null==i){let t=$e(o);if(We(t,o,s,r)!==e)break t;t.set(r,0)}else s=ze(o,s,r,e);Ue(o,s,e,i)}return n&&!tt(n)&&Ie(t.m),t}function tr(t,e){return-273&(2&e?2|t:-3&t)}function er(t,e,r,n){Ee(t);var i=t.m;t=Je(t,i,0|i[J],r,e,2,!0),n=null!=n?n:new r,t.push(n),e=r=t===M?7:0|t[J],(n=tt(n))?(r&=-9,1===t.length&&(r&=-4097)):r|=4096,r!==e&&Q(t,r),n||Ie(i)}function rr(t,e,r){return Ke(t,e,r=De(t,Ao)===r?r:-1)}function nr(t,e,r){if(null!=r)t:{if(!$t(r))throw P("int64");switch(typeof r){case"string":r=Yt(r);break t;case"bigint":r=ft(kt(64,r));break t;default:r=Xt(r)}}return Le(t,e,r)}function ir(t,e,r){return Le(t,e,null==r?r:function(t){if(!$t(t))throw P("uint64");switch(typeof t){case"string":var e=Mt(Number(t));return Vt(e)&&e>=0?t=ft(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),t=F()?ft(Ft(64,BigInt(t))):ft(Ht(t))),t;case"bigint":return ft(Ft(64,t));default:return Vt(t)?t=ft(Kt(t)):((t=Mt(t))>=0&&Vt(t)?t=String(t):(Et(t),t=Bt(_t,St)),t=ft(t)),t}}(r))}function or(t,e,r){if(null!=r){if(!Ct(r))throw P("enum");r|=0}return Le(t,e,r)}function sr(t,e,r){Ee(t),Oe(t,e,ne,2,!0).push(ee(r))}var ar=class{constructor(t,e,r){if(this.buffer=t,r&&!e)throw Error();this.h=e}};function ur(t,e){if("string"==typeof t)return new ar(I(t),e);if(Array.isArray(t))return new ar(new Uint8Array(t),e);if(t.constructor===Uint8Array)return new ar(t,!1);if(t.constructor===ArrayBuffer)return t=new Uint8Array(t),new ar(t,!1);if(t.constructor===L)return e=x(t)||new Uint8Array(0),new ar(e,!0,t);if(t instanceof Uint8Array)return t=t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new ar(t,!1);throw Error()}function lr(t,e){var r=0,n=0,i=0,o=t.j,s=t.h;do{var a=o[s++];r|=(127&a)<<i,i+=7}while(i<32&&128&a);if(i>32)for(n|=(127&a)>>4,i=3;i<32&&128&a;i+=7)n|=(127&(a=o[s++]))<<i;if(gr(t,s),!(128&a))return e(r>>>0,n>>>0);throw Error()}function cr(t){for(var e=0,r=t.h,n=r+10,i=t.j;r<n;){let n=i[r++];if(e|=n,!(128&n))return gr(t,r),!!(127&e)}throw Error()}function hr(t){var e=t.j,r=t.h,n=e[r++],i=127&n;if(128&n&&(i|=(127&(n=e[r++]))<<7,128&n&&(i|=(127&(n=e[r++]))<<14,128&n&&(i|=(127&(n=e[r++]))<<21,128&n&&(i|=(n=e[r++])<<28,128&n&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++])))))throw Error();return gr(t,r),i}function fr(t){return lr(t,xt)}function dr(t){var e=t.j,r=t.h,n=e[r],i=e[r+1],o=e[r+2];return e=e[r+3],gr(t,t.h+4),(n|i<<8|o<<16|e<<24)>>>0}function pr(t){var e=dr(t);t=2*(e>>31)+1;var r=e>>>23&255;return e&=8388607,255==r?e?NaN:t*(1/0):0==r?1401298464324817e-60*t*e:t*Math.pow(2,r-150)*(e+8388608)}function vr(t){return hr(t)}function gr(t,e){if(t.h=e,e>t.l)throw Error()}function mr(t,e){if(e<0)throw Error();var r=t.h;if((e=r+e)>t.l)throw Error();return t.h=e,r}function yr(t,e){if(0==e)return T();var r=mr(t,e);return t.M&&t.v?r=t.j.subarray(r,r+e):(t=t.j,r=r===(e=r+e)?new Uint8Array(0):wt?t.slice(r,e):new Uint8Array(t.subarray(r,e))),0==r.length?T():new L(r,j)}var br=class{constructor(t,e,r,n){this.j=null,this.v=!1,this.h=this.l=this.o=0,this.init(t,e,r,n)}init(t,e,r,{M:n=!1,P:i=!1}={}){this.M=n,this.P=i,t&&(t=ur(t,this.P),this.j=t.buffer,this.v=t.h,this.o=e||0,this.l=void 0!==r?this.o+r:this.j.length,this.h=this.o)}clear(){this.j=null,this.v=!1,this.h=this.l=this.o=0,this.M=!1}},wr=[],_r=0;function Sr(t,e,r,n){if(Nr.length){let i=Nr.pop();return i.u(n),i.h.init(t,e,r,n),i}return new Ur(t,e,r,n)}function Ar(t){t.h.clear(),t.l=-1,t.j=-1,Nr.length<100&&Nr.push(t)}function Er(t){var e=t.h;if(e.h==e.l)return!1;t.o=t.h.h;var r=hr(t.h)>>>0;if(e=r>>>3,!((r&=7)>=0&&r<=5))throw Error();if(e<1)throw Error();return t.l=e,t.j=r,!0}function Ir(t){try{switch(t.j){case 0:0!=t.j?Ir(t):cr(t.h);break;case 1:var e=t.h;gr(e,e.h+8);break;case 2:if(2!=t.j)Ir(t);else{var r=hr(t.h)>>>0,n=t.h;gr(n,n.h+r)}break;case 5:var i=t.h;gr(i,i.h+4);break;case 3:jr();let o=t.l;try{for(;;){if(!Er(t))throw Error();if(4==t.j){if(t.l!=o)throw Error();break}Ir(t)}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{_r>0&&_r--}break;default:throw Error()}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}}function jr(){if(_r>=100)throw new SyntaxError;_r++}function Tr(t,e,r){var n=t.h.l,i=hr(t.h)>>>0,o=(i=t.h.h+i)-n;if(o<=0&&(t.h.l=i,r(e,t,void 0,void 0,void 0),o=i-t.h.h),o)throw Error();t.h.h=i,t.h.l=n}function xr(t){var e=hr(t.h)>>>0,o=mr(t=t.h,e);if(t=t.j,a){var u,l=t;(u=i)||(u=i=new TextDecoder("utf-8",{fatal:!0})),e=o+e,l=0===o&&e===l.length?l:l.subarray(o,e);try{var c=u.decode(l)}catch(t){if(void 0===s){try{u.decode(new Uint8Array([128]))}catch(t){}try{u.decode(new Uint8Array([97])),s=!0}catch(t){s=!1}}throw!s&&(i=void 0),t}}else{e=(c=o)+e,o=[];let i,s=null;for(;c<e;){var h=t[c++];h<128?o.push(h):h<224?c>=e?r():(i=t[c++],h<194||128!=(192&i)?(c--,r()):o.push((31&h)<<6|63&i)):h<240?c>=e-1?r():(i=t[c++],128!=(192&i)||224===h&&i<160||237===h&&i>=160||128!=(192&(u=t[c++]))?(c--,r()):o.push((15&h)<<12|(63&i)<<6|63&u)):h<=244?c>=e-2?r():(i=t[c++],128!=(192&i)||i-144+(h<<28)>>30||128!=(192&(u=t[c++]))||128!=(192&(l=t[c++]))?(c--,r()):(h=(7&h)<<18|(63&i)<<12|(63&u)<<6|63&l,h-=65536,o.push(55296+(h>>10&1023),56320+(1023&h)))):r(),o.length>=8192&&(s=n(s,o),o.length=0)}c=n(s,o)}return c}function Br(t){var e=hr(t.h)>>>0;return yr(t.h,e)}function Lr(t,e,r){var n=hr(t.h)>>>0;for(n=t.h.h+n;t.h.h<n;)r.push(e(t.h))}var Ur=class{constructor(t,e,r,n){if(wr.length){let i=wr.pop();i.init(t,e,r,n),t=i}else t=new br(t,e,r,n);this.h=t,this.o=this.h.h,this.j=this.l=-1,this.u(n)}u({T:t=!1}={}){this.T=t}},Nr=[];function Or(t){return new Fr(4294967295&t,Math.floor(t/4294967296))}function Pr(t){return t?/^\d+$/.test(t)?(Nt(t),new Fr(_t,St)):null:kr||=new Fr(0,0)}var kr,Fr=class{constructor(t,e){this.j=t>>>0,this.h=e>>>0}};function Vr(t){return new qr(4294967295&t,Math.floor(t/4294967296))}function Cr(t){return t?/^-?\d+$/.test(t)?(Nt(t),new qr(_t,St)):null:Mr||=new qr(0,0)}var Mr,Gr,Rr,Dr,$r,zr,Wr,Hr,qr=class{constructor(t,e){this.j=t>>>0,this.h=e>>>0}};function Kr(t,e,r){return"undefined"!=typeof BigInt64Array?(Wr||(Wr=new BigInt64Array(1),Hr=new Uint32Array(Wr.buffer),Wr[0]=BigInt(1),zr=1===Hr[0]),Wr[0]=t,new e(Hr[t=zr?0:1],Hr[1-t])):($r||(Gr=BigInt(Number.MIN_SAFE_INTEGER),Rr=BigInt(Number.MAX_SAFE_INTEGER),Dr=BigInt(4294967295),$r=BigInt(32)),t>=Gr&&t<=Rr?r(Number(t)):(t=BigInt.asUintN(64,t),new e(Number(t&Dr),Number(t>>$r))))}function Jr(t,e,r){for(;r>0||e>127;)t.h.push(127&e|128),e=(e>>>7|r<<25)>>>0,r>>>=7;t.h.push(e)}function Yr(t,e){for(;e>127;)t.h.push(127&e|128),e>>>=7;t.h.push(e)}function Xr(t,e){if(e>=0)Yr(t,e);else{for(let r=0;r<9;r++)t.h.push(127&e|128),e>>=7;t.h.push(1)}}function Qr(t,e){Nt(e),function(t){var e=St>>31;t(_t<<1^e,(St<<1|_t>>>31)^e)}((e,r)=>{Jr(t,e>>>0,r>>>0)})}function Zr(t,e){t.h.push(e>>>0&255),t.h.push(e>>>8&255),t.h.push(e>>>16&255),t.h.push(e>>>24&255)}var tn=class{constructor(){this.h=[]}length(){return this.h.length}end(){var t=this.h;return this.h=[],t}};function en(t,e){0!==e.length&&(t.l.push(e),t.j+=e.length)}function rn(t,e,r){Yr(t.h,8*e+r)}function nn(t,e){return rn(t,e,2),e=t.h.end(),en(t,e),e.push(t.j),e}function on(t,e){var r=e.pop();for(r=t.j+t.h.length()-r;r>127;)e.push(127&r|128),r>>>=7,t.j++;e.push(r),t.j++}function sn(t,e,r){if(null!=r)switch(rn(t,e,0),typeof r){case"number":t=t.h,Et(r),Jr(t,_t,St);break;case"bigint":r=Kr(r,qr,Vr),Jr(t.h,r.j,r.h);break;default:r=Cr(r),Jr(t.h,r.j,r.h)}}function an(t,e,r){rn(t,e,2),Yr(t.h,r.length),en(t,t.h.end()),en(t,r)}var un=class{constructor(){this.l=[],this.j=0,this.h=new tn}};function ln(t){if("string"==typeof t)Cr(t)}function cn(){var t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var hn=cn(),fn=cn(),dn=cn(),pn=cn(),vn=cn(),gn=cn(),mn=cn(),yn=cn(),bn=cn(),wn=cn(),_n=cn(),Sn=cn();function An(t,e,r){var n=t.m;D&&D in n&&(n=n[D])&&delete n[e.h],e.j?e.o(t,e.j,e.h,r,e.l):e.o(t,e.h,r,e.l)}var En=class{constructor(t,e){this.m=me(t,e,void 0,2048)}toJSON(){return ve(this)}};En.prototype[H]=Z,En.prototype.toString=function(){return this.m.toString()};var In=class{constructor(t,e,r){this.h=t,this.j=e,t=hn,this.l=!!t&&r===t||!1}};function jn(t,e){return new In(t,e,hn)}function Tn(t,e,r,n,i){null!=(e=Mn(e,n))&&(r=nn(t,r),i(e,t),on(t,r))}var xn,Bn,Ln=jn(function(t,e,r,n,i){return 2===t.j&&(Tr(t,He(e,n,r),i),!0)},Tn),Un=jn(function(t,e,r,n,i){return 2===t.j&&(Tr(t,He(e,n,r),i),!0)},Tn),Nn=Symbol(),On=Symbol(),Pn=Symbol(),kn=Symbol(),Fn=Symbol();function Vn(t,e,r,n){var i=n[t];if(i)return i;(i={}).W=n,i.L=function(t){switch(typeof t){case"boolean":return le||=[0,void 0,!0];case"number":return t>0?void 0:0===t?ce||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(n[0]);var o=n[1],s=1;o&&o.constructor===Object&&(i.N=o,"function"==typeof(o=n[++s])&&(i.U=!0,xn??=o,Bn??=n[s+1],o=n[s+=2]));for(var a={};o&&Array.isArray(o)&&o.length&&"number"==typeof o[0]&&o[0]>0;){for(var u=0;u<o.length;u++)a[o[u]]=o;o=n[++s]}for(u=1;void 0!==o;){let t;"number"==typeof o&&(u+=o,o=n[++s]);var l=void 0;if(o instanceof In?t=o:(t=Ln,s--),t?.l){o=n[++s],l=n;var c=s;"function"==typeof o&&(o=o(),l[c]=o),l=o}for(c=u+1,"number"==typeof(o=n[++s])&&o<0&&(c-=o,o=n[++s]);u<c;u++){let n=a[u];l?r(i,u,t,l,n):e(i,u,t,n)}}return n[t]=i}function Cn(t){return Array.isArray(t)?t[0]instanceof In?t:[Un,t]:[t,void 0]}function Mn(t,e){return t instanceof En?t.m:Array.isArray(t)?ge(t,e):void 0}function Gn(t,e,r,n){var i=r.h;t[e]=n?(t,e,r)=>i(t,e,r,n):i}function Rn(t,e,r,n,i){var o,s,a=r.h;t[e]=(t,e,r)=>a(t,e,r,s||=Vn(On,Gn,Rn,n).L,o||=Dn(n),i)}function Dn(t){var e=t[Pn];if(null!=e)return e;var r=Vn(On,Gn,Rn,t);return e=r.U?(t,e)=>xn(t,e,r):(t,e)=>{t:{jr();try{for(;Er(e)&&4!=e.j;){let u=e.l,l=r[u];if(null==l){let t=r.N;if(t){let e=t[u];if(e){let t=zn(e);null!=t&&(l=r[u]=t)}}}if(null==l||!l(e,t,u)){var n=e;let r=n.o;if(Ir(n),n.T)var i=void 0;else{let t=n.h.h-r;n.h.h=r,i=yr(n.h,t)}n=void 0;var o=t,s=u,a=i;a&&((n=o[D]??(o[D]=new he))[s]??(n[s]=[])).push(a)}}let l=se(t);l&&(l.h=r.W[Fn]);var u=!0;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{_r>0&&_r--}u=void 0}return u},t[Pn]=e,t[Fn]=$n.bind(t),e}function $n(t,e,r,n){var i=this[On],o=this[Pn],s=ge(void 0,i.L),a=se(t);if(a){var u=!1,l=i.N;if(l){if(i=(e,r,i)=>{if(0!==i.length)if(l[r])for(let t of i){e=Sr(t);try{u=!0,o(s,e)}finally{Ar(e)}}else n?.(t,r,i)},null==e)ae(a,i);else if(null!=a){let t=a[e];t&&i(a,e,t)}if(u){let n=0|t[J];if(2&n&&2048&n&&!r?.ma)throw Error();let i=st(n),o=(e,o)=>{if(null!=Be(t,e,i)){if(1===r?.la)return;throw Error()}null!=o&&(n=Ue(t,n,e,o,i)),delete a[e]};null==e?it(s,0|s[J],(t,e)=>{o(t,e)}):o(e,Be(s,e,i))}}}}function zn(t){var e=(t=Cn(t))[0].h;if(t=t[1]){let r=Dn(t),n=Vn(On,Gn,Rn,t).L;return(t,i,o)=>e(t,i,o,n,r)}return e}function Wn(t,e,r){t[e]=r.j}function Hn(t,e,r,n){var i,o,s=r.j;t[e]=(t,e,r)=>s(t,e,r,o||=Vn(Nn,Wn,Hn,n).L,i||=qn(n))}function qn(t){var e=t[kn];if(!e){let r=Vn(Nn,Wn,Hn,t);e=(t,e)=>Kn(t,e,r),t[kn]=e}return e}function Kn(t,e,r){it(t,0|t[J],(t,n)=>{if(null!=n){var i=function(t,e){var r=t[e];if(r)return r;if((r=t.N)&&(r=r[e])){var n=(r=Cn(r))[0].j;if(r=r[1]){let e=qn(r),i=Vn(Nn,Wn,Hn,r).L;r=t.U?Bn(i,e):(t,r,o)=>n(t,r,o,i,e)}else r=n;return t[e]=r}}(r,t);i?i(e,n,t):t<500||k(z,3)}}),(t=se(t))&&ae(t,(t,r,n)=>{for(en(e,e.h.end()),t=0;t<n.length;t++)en(e,x(n[t])||new Uint8Array(0))})}var Jn=ft(0);function Yn(t,e,r){if(Array.isArray(e)){var n=0|e[J];if(4&n)return e;for(var i=0,o=0;i<e.length;i++){let r=t(e[i]);null!=r&&(e[o++]=r)}return o<i&&(e.length=o),t=1|n,r&&(t=-1537&t|4),t!==n&&Q(e,t),r&&2&t&&Object.freeze(e),e}}var Xn=(t,e)=>{var r=new un;Kn(t.m,r,Vn(Nn,Wn,Hn,e)),en(r,r.h.end()),t=new Uint8Array(r.j);var n=(e=r.l).length,i=0;for(let r=0;r<n;r++){let n=e[r];t.set(n,i),i+=n.length}return r.l=[t],t};function Qn(t,e,r){return new In(t,e,r)}function Zn(t,e,r){return new In(t,e,r)}function ti(t,e,r){Ue(t,0|t[J],e,r,st(0|t[J]))}function ei(t,e,r){null!=(e=Zt(e))&&(ln(e),sn(t,r,e))}function ri(t,e,r){null!=(e=zt(e))&&null!=e&&(rn(t,r,0),Xr(t.h,e))}function ni(t,e,r){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(rn(t,r,0),t.h.h.push(e?1:0))}function ii(t,e,r){null!=(e=ne(e))&&an(t,r,l(e))}function oi(t,e,r,n,i){null!=(e=Mn(e,n))&&(r=nn(t,r),i(e,t),on(t,r))}function si(t,e,r){null!=(e=te(e))&&an(t,r,ur(e,!0).buffer)}function ai(t,e,r){e=function(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Ct(t)?t>>>0:void 0}(e),null!=e&&null!=e&&(rn(t,r,0),Yr(t.h,e))}function ui(t,e,r){null!=(e=zt(e))&&(e=parseInt(e,10),rn(t,r,0),Xr(t.h,e))}function li(t,e,r){return 0===t.j&&(ti(e,r,fr(t.h)),!0)}function ci(t,e,r){return(0===t.j||2===t.j)&&(e=Re(e,0|e[J],r),2==t.j?Lr(t,hr,e):e.push(hr(t.h)),!0)}function hi(t,e,r){return 2===t.j&&(ti(e,r,(t=Br(t))===T()?void 0:t),!0)}var fi=Qn(function(t,e,r){if(1!==t.j)return!1;var n=t.h;t=dr(n);var i=dr(n);n=2*(i>>31)+1;var o=i>>>20&2047;return t=4294967296*(1048575&i)+t,ti(e,r,2047==o?t?NaN:n*(1/0):0==o?5e-324*n*t:n*Math.pow(2,o-1075)*(t+4503599627370496)),!0},function(t,e,r){null!=(e=Gt(e))&&(rn(t,r,1),t=t.h,(r=bt||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),_t=r.getUint32(0,!0),St=r.getUint32(4,!0),Zr(t,_t),Zr(t,St))},wn),di=Qn(function(t,e,r){return 5===t.j&&(ti(e,r,pr(t.h)),!0)},function(t,e,r){null!=(e=Gt(e))&&(rn(t,r,5),t=t.h,It(e),Zr(t,_t))},bn),pi=Zn(function(t,e,r){return(5===t.j||2===t.j)&&(e=Re(e,0|e[J],r),2==t.j?Lr(t,pr,e):e.push(pr(t.h)),!0)},function(t,e,r){if(null!=(e=Yn(Gt,e,!0))&&e.length){rn(t,r,2),Yr(t.h,4*e.length);for(let n=0;n<e.length;n++)r=t.h,It(e[n]),Zr(r,_t)}},bn),vi=Qn(function(t,e,r){return li(t,e,r)},ei,gn),gi=Qn(function(t,e,r){return li(t,e,r)},ei,gn),mi=Zn(function(t,e,r){return 0!==t.j&&2!==t.j?t=!1:(e=Re(e,0|e[J],r),2==t.j?Lr(t,fr,e):e.push(fr(t.h)),t=!0),t},function(t,e,r){if(null!=(e=Yn(Zt,e,!1)))for(let n=0;n<e.length;n++)sn(t,r,e[n])},gn),yi=Qn(function(t,e,r){return 0!==t.j?e=!1:(ti(e,r,(t=fr(t.h))===Jn?void 0:t),e=!0),e},ei,gn),bi=Qn(function(t,e,r){return 0!==t.j?t=!1:(ti(e,r,lr(t.h,Tt)),t=!0),t},function(t,e,r){if(e=function(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(Ft(64,t));if($t(t)){if("string"===e)return e=Mt(Number(t)),Vt(e)&&e>=0?t=String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),t=Ht(t)),t;if("number"===e)return Kt(t)}}(e),null!=e){if("string"==typeof e)Pr(e);if(null!=e)switch(rn(t,r,0),typeof e){case"number":t=t.h,Et(e),Jr(t,_t,St);break;case"bigint":r=Kr(e,Fr,Or),Jr(t.h,r.j,r.h);break;default:r=Pr(e),Jr(t.h,r.j,r.h)}}},mn),wi=Qn(function(t,e,r){return 0===t.j&&(ti(e,r,hr(t.h)),!0)},ri,pn),_i=Zn(ci,function(t,e,r){if(null!=(e=Yn(zt,e,!0)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&(rn(n,i,0),Xr(n.h,o))}},pn),Si=Zn(ci,function(t,e,r){if(null!=(e=Yn(zt,e,!0))&&e.length){r=nn(t,r);for(let r=0;r<e.length;r++)Xr(t.h,e[r]);on(t,r)}},pn),Ai=Qn(function(t,e,r){return 0===t.j&&(ti(e,r,0===(t=hr(t.h))?void 0:t),!0)},ri,pn),Ei=Qn(function(t,e,r){return 0===t.j&&(ti(e,r,cr(t.h)),!0)},ni,fn),Ii=Qn(function(t,e,r){return 0===t.j&&(ti(e,r,!1===(t=cr(t.h))?void 0:t),!0)},ni,fn),ji=Zn(function(t,e,r){return 2===t.j&&(t=xr(t),Re(e,0|e[J],r).push(t),!0)},function(t,e,r){if(null!=(e=Yn(ne,e,!0)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&an(n,i,l(o))}},dn),Ti=Qn(function(t,e,r){return 2===t.j&&(ti(e,r,""===(t=xr(t))?void 0:t),!0)},ii,dn),xi=Qn(function(t,e,r){return 2===t.j&&(ti(e,r,xr(t)),!0)},ii,dn),Bi=function(t,e,r=hn){return new In(t,e,r)}(function(t,e,r,n,i){return 2===t.j&&(n=ge(void 0,n),Re(e,0|e[J],r).push(n),Tr(t,n,i),!0)},function(t,e,r,n,i){if(Array.isArray(e)){for(let o=0;o<e.length;o++)oi(t,e[o],r,n,i);1&(t=0|e[J])||Q(e,1|t)}}),Li=jn(function(t,e,r,n,i,o){if(2!==t.j)return!1;var s=0|e[J];return ze(e,s,o,r,st(s)),Tr(t,e=He(e,n,r),i),!0},oi),Ui=Qn(function(t,e,r){return 2===t.j&&(ti(e,r,Br(t)),!0)},si,_n),Ni=Zn(function(t,e,r){return 2===t.j&&(t=Br(t),Re(e,0|e[J],r).push(t),!0)},function(t,e,r){if(null!=(e=Yn(te,e,!1)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&an(n,i,ur(o,!0).buffer)}},_n),Oi=Qn(function(t,e,r){return 0===t.j&&(ti(e,r,hr(t.h)>>>0),!0)},ai,vn),Pi=Qn(function(t,e,r){return 0===t.j&&(ti(e,r,0===(t=hr(t.h)>>>0)?void 0:t),!0)},ai,vn),ki=Qn(function(t,e,r){return 0===t.j&&(ti(e,r,hr(t.h)),!0)},ui,Sn),Fi=Qn(function(t,e,r){return 0===t.j&&(ti(e,r,0===(t=hr(t.h))?void 0:t),!0)},ui,Sn),Vi=Qn(function(t,e,r){return 0!==t.j?t=!1:(ti(e,r,function(t){return lr(t,(t,e)=>{var r=-(1&t);return xt(t=(t>>>1|e<<31)^r,e>>>1^r)})}(t.h)),t=!0),t},function(t,e,r){if(null!=(e=Zt(e))&&(ln(e),null!=e))switch(rn(t,r,0),typeof e){case"number":t=t.h,e=(r=e)<0,At(r=2*Math.abs(r)),r=_t;let n=St;e&&(0==r?0==n?n=r=4294967295:(n--,r=4294967295):r--),Jr(t,_t=r,St=n);break;case"bigint":t=t.h,e=e<<BigInt(1)^e>>BigInt(63),_t=Number(BigInt.asUintN(32,e)),St=Number(BigInt.asUintN(32,e>>BigInt(32))),Jr(t,_t,St);break;default:Qr(t.h,e)}},yn);class Ci{constructor(t,e){var r=oo;this.h=t,this.j=e,this.o=Qe,this.defaultValue=void 0,this.l=null!=r.ja?ot:void 0}register(){v(this)}}function Mi(t,e){return(r,n)=>{t:{let o={P:!0};n&&Object.assign(o,n),r=Sr(r,void 0,void 0,o);try{let n=new t,o=n.m;Dn(e)(o,r);var i=n;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{Ar(r)}i=void 0}return i}}function Gi(t){return function(){return Xn(this,t)}}var Ri,Di=[0,Ui,Ni,Ei,xi],$i=[0,Ti,[0,Fi,[0,yi,Ai],Fi,-1,[0,ki],Fi,-1],Qn(hi,si,_n)],zi=[0,Ti,Qn(hi,function(t,e,r){if(null!=e){if(e instanceof En){let n=e.oa;return void(n?(e=n(e),null!=e&&an(t,r,ur(e,!0).buffer)):k(z,3))}if(Array.isArray(e))return void k(z,3)}si(t,e,r)},_n)],Wi=[0,1,[0,12,wi,10,Ei],[0,7,[0,wi,-1]]],Hi=globalThis.trustedTypes;var qi=class{constructor(t){this.h=t}toString(){return this.h+""}};function Ki(t){var e;return void 0===Ri&&(Ri=function(){var t=null;if(!Hi)return t;try{let e=t=>t;t=Hi.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(t){}return t}()),t=(e=Ri)?e.createScriptURL(t):t,new qi(t)}function Ji(t,...e){if(0===e.length)return Ki(t[0]);var r=t[0];for(let n=0;n<e.length;n++)r+=encodeURIComponent(e[n])+t[n+1];return Ki(r)}var Yi=[0,wi,ki,Ei,-1,Si,ki,-1,Ei,-1],Xi=[0,ki,-1,Ei],Qi=class extends En{constructor(t){super(t)}},Zi=[0,Ei,xi,Ei,ki,-1,Zn(function(t,e,r){return(0===t.j||2===t.j)&&(e=Re(e,0|e[J],r),2==t.j?Lr(t,vr,e):e.push(hr(t.h)),!0)},function(t,e,r){if(null!=(e=Yn(zt,e,!0))&&e.length){r=nn(t,r);for(let r=0;r<e.length;r++)Xr(t.h,e[r]);on(t,r)}},Sn),xi,-1,[0,Ei,-1],ki,Ei,-1,Xi],to=[0,3,Ei,-1,2,[0,[2],wi,Li,[0,Oi]],[0,ki,Ei,ki,Ei,ki,4,[0,Ei,xi,-1,Ei]],[0,[3,4],xi,-1,Li,[0,wi],Li,[0,ki,-1]],[0]],eo=[0,xi,-2],ro=class extends En{constructor(t){super(t)}},no=[0],io=[0,wi,Ei,1,Ei,-4],oo=class extends En{constructor(t){super(t,2)}},so={};so[336783863]=[0,xi,Ei,-1,wi,[0,[1,2,3,4,5,6,7,8,9],Li,no,Li,Zi,Li,eo,Li,io,Li,Yi,Li,[0,xi,-2],Li,[0,xi,ki],Li,to,Li,Xi],[0,xi],Ei,[0,[1,3],[2,4],Li,[0,Si],-1,Li,[0,ji],-1,Bi,[0,xi,-1]],xi];var ao=[0,yi,-1,Ii,-3,yi,Si,Ti,Ai,yi,-1,Ii,Ai,Ii,-2,Ti];function uo(t){sr(t,3,"TEXT:text_in")}var lo=class extends En{constructor(t){super(t,500)}u(t){return Qe(this,0,7,t)}},co=[-1,{}],ho=[0,xi,1,co],fo=[0,xi,ji,co];function po(t){sr(t,10,"text_in")}var vo=class extends En{constructor(t){super(t,500)}u(t){return Qe(this,0,1001,t)}};vo.prototype.j=Gi([-500,Bi,[-500,Ti,-1,ji,-3,[-2,so,Ei],Bi,zi,Ai,-1,ho,fo,Bi,[0,Ti,Ii],Ti,ao,Ai,ji,987,ji],4,Bi,[-500,xi,-1,[-1,{}],998,xi],Bi,[-500,xi,ji,-1,[-2,{},Ei],997,ji,-1],Ai,Bi,[-500,xi,ji,co,998,ji],ji,Ai,ho,fo,Bi,[0,Ti,-1,co],ji,-2,ao,Ti,-1,Ii,[0,Ii,Pi],978,co,Bi,zi]);var go=class extends En{constructor(t){super(t)}},mo=class extends En{constructor(t){super(t)}j(){return Ye(this,go)}},yo=class extends En{constructor(t){super(t)}},bo=Mi(class extends En{constructor(t){super(t)}},[0,Bi,[0,1,wi,xi,[0,Bi,[0,wi,di,xi,-1]]],gi]),wo=class extends En{constructor(t){super(t)}},_o=class extends En{constructor(t){super(t)}j(){var t=xe(this,1,void 0,Ce);return null==t?T():t}},So=class extends En{constructor(t){super(t)}},Ao=[1,2],Eo=Mi(class extends En{constructor(t){super(t)}},[0,Bi,[0,Ao,Li,[0,pi],Li,[0,Ui],wi,xi],gi]),Io=class extends En{constructor(t){super(t)}},jo=class extends En{constructor(t){super(t)}},To=[0,Ei,-1],xo=class extends En{constructor(t){super(t)}j(){return Ne(this,Qi,2,Bo)}},Bo=[1,2,3,4,5,6],Lo=class extends En{constructor(t){super(t)}j(){return null!=xe(this,1,void 0,Ce)}l(){return null!=ne(xe(this,2))}},Uo=class extends En{constructor(t){super(t)}},No=[0,Ui,xi,[0,wi,gi,-1],[0,bi,gi]],Oo=[0,No,Ei,[0,Bo,Li,io,Li,Zi,Li,Yi,Li,no,Li,eo,Li,to],ki],Po=class extends En{constructor(t){super(t)}},ko=new Ci(462704549,Po);so[462704549]=[0,Oo,[0,xi,wi,di,ji,-1]];var Fo=class extends En{constructor(t){super(t)}},Vo=new Ci(477589892,Fo);function Co(t,e){if(e=e?we(e):new Io,void 0!==t.displayNamesLocale?Le(e,1,re(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Le(e,1),void 0!==t.maxResults){var r=t.maxResults;if(null!=r){if("number"!=typeof r)throw P("int32");if(!Ct(r))throw P("int32");r|=0}Le(e,2,r)}else"maxResults"in t&&Le(e,2);if(void 0!==t.scoreThreshold){if(null!=(r=t.scoreThreshold)&&"number"!=typeof r)throw Error(`Value of float/double field must be a number, found ${typeof r}: ${r}`);Le(e,3,r)}else"scoreThreshold"in t&&Le(e,3);return void 0!==t.categoryAllowlist?Me(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&Le(e,4),void 0!==t.categoryDenylist?Me(e,5,t.categoryDenylist):"categoryDenylist"in t&&Le(e,5),e}function Mo(t){var e=Number(t);return Number.isSafeInteger(e)?e:String(t)}function Go(t){var e={classifications:Ye(t,yo).map(t=>function(t,e=-1,r=""){return{categories:t.map(t=>({index:zt(xe(t,1))??0??-1,score:xe(t,2,void 0,Gt)??0??0,categoryName:ne(xe(t,3))??""??"",displayName:ne(xe(t,4))??""??""})),headIndex:e,headName:r}}(Ke(t,mo,4)?.j()??[],zt(xe(t,2))??0,ne(xe(t,3))??""))};return null!=function(t){return null==t?t:"bigint"==typeof t?(dt(t)?t=Number(t):(t=kt(64,t),t=dt(t)?Number(t):String(t)),t):$t(t)?"number"==typeof t?qt(t):Jt(t):void 0}(xe(t,2,void 0,Qt))&&(e.timestampMs=Mo(xe(t,2,void 0,Qt)??Te)),e}function Ro(t){return Array.from(t,t=>t>127?t-256:t)}function Do(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);var r=0,n=0,i=0;for(let o=0;o<t.length;o++)r+=t[o]*e[o],n+=t[o]*t[o],i+=e[o]*e[o];if(n<=0||i<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(n*i)}so[477589892]=[0,Oo,To,1,No];var $o,zo=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function Wo(t){if(t)return!0;if(void 0===$o)try{await WebAssembly.instantiate(zo),$o=!0}catch{$o=!1}return $o}async function Ho(t,e,r){return{wasmLoaderPath:`${e}/${t}_${r=`wasm${r?"_module":""}${await Wo(r)?"":"_nosimd"}_internal`}.js`,wasmBinaryPath:`${e}/${t}_${r}.wasm`}}var qo=class{};function Ko(t){return or(new Jo,1,t)}qo.forVisionTasks=function(t,e=!1){return Ho("vision",t??Ji``,e)},qo.forTextTasks=function(t,e=!1){return Ho("text",t??Ji``,e)},qo.forGenAiTasks=function(t,e=!1){return Ho("genai",t??Ji``,e)},qo.forAudioTasks=function(t,e=!1){return Ho("audio",t??Ji``,e)},qo.isSimdSupported=function(t=!1){return Wo(t)};var Jo=class extends En{constructor(t){super(t)}},Yo=class extends En{constructor(t){super(t)}},Xo=[0,ki,2,bi,-2,gi,Bi,[0,ki,gi]],Qo=class extends En{constructor(t){super(t)}},Zo=class extends En{constructor(t){super(t)}};function ts(t,e){return or(t,1,e)}function es(t,e){return or(t,2,e)}var rs=class extends En{constructor(t){super(t)}},ns=[3,4,5,6,7],is=class extends En{constructor(t){super(t)}},os=class extends En{constructor(t){super(t)}};os.prototype.j=Gi([0,[0,ki,xi,-3,ki],[0,ns,ki,-1,Li,[0,ki,xi,bi],Li,Xo,Li,[0,1,Xo],Li,[0,ki],Li,[0,ki,xi,bi]]]);var ss=class{constructor(){this.h="undefined"!=typeof AbortController}async send(t,e,r){var n=this.h?new AbortController:void 0,i=n&&t.O>0?setTimeout(()=>{n.abort()},t.O):void 0;try{let i=await fetch(t.url,{method:t.ga,headers:{...t.fa},...t.body&&{body:t.body},...t.withCredentials&&{credentials:"include"},signal:t.O&&n?n.signal:null});200===i.status?e?.(await i.text()):r?.(i.status)}catch(t){if("AbortError"===t?.name)r?.(408);else r?.(400)}finally{clearTimeout(i)}}},as=class extends En{constructor(t){super(t,37)}},us=[-4,{},Wi,ki,$i],ls=[0,xi,ki,1,xi,-1,ki,1,ki,1,gi],cs=[0,ki,xi,-2],hs=[0,xi,ki],fs=[0,xi,ki],ds=[0,Ei,-3],ps=[0,ki,xi,-1,gi,wi,-1,xi,-5,Bi,[0,xi,-4],-1,Ei,[0,Ei,-3],ki];var vs,gs=class extends En{constructor(t){super(t,19)}},ms=(vs=[-19,{},[0,ki,1,[0,xi,-6,gi,wi,xi,-1,gi],1,[0,xi,1,xi,-5],xi,-1,[0,ki,xi,-8],[0,xi,-3],[0,xi,ki,xi,-2],[0,xi,-1,ki,xi,-1,ki,xi,-1,[0,Bi,[0,xi,-1],Ei,xi,-5],[0,ki,Ei,wi,-2]],gi,[0,xi,-3,gi,wi,xi,-1],[0,ki,xi,-1],[0,xi,-9],[0,xi,-6,ki,xi,1,xi,Ei,ki,-1,Ei,xi,-2,ki,xi,ki,xi,wi,-1],1,[0,ki],1,[0,xi,-4],1,ls,[0,[1,2,3,4,5,6],Li,ls,Li,hs,Li,fs,Li,[0,ki],Li,ps,Li,cs],hs,fs,ps,[0,[0,ki,xi,-1,gi,wi,-1,xi,-4,Bi,[0,xi,-4],-1,1,ds],[0,ki,xi,-1,gi,wi,-1,xi,-4,ds]],cs,[0,xi,[0,wi,-3,ki],ki,-2,[0,wi,-1],Ei],4,[0,xi,ki,xi,-1,gi,ki,xi,-1,ki,wi,-1]],ki,Bi,[-37,{},vi,xi,Bi,[0,xi,-1],Ui,1,Ui,[0,ji,-1,_i,mi,-1],xi,[0,wi,xi,-1],Ei,wi,gi,xi,-1,Vi,Di,vi,Ui,ki,_i,gi,-1,[0,ki,-1],xi,Ei,xi,Si,xi,-1,fi,1,fi,us,Ei,[0,ki,[0,di,wi,-2],[0,di]],[0,ki,gi]],vi,Ni,xi,-1,vi,ki,-1,[0,Ei,-1,ki,Ei],[0,gi,-1,xi],[0,vi,Ei,gi],gi,1,Oi,1,us],t=>Xn(t,vs)),ys=class{constructor(t){this.j=[],this.o=new ss,this.l=t??"",this.h=setInterval(()=>{this.flush()},6e4)}close(){void 0!==this.h&&(clearInterval(this.h),this.h=void 0),this.flush()}flush(t,e){if(this.error)e?.("net-send-failed");else if(0===this.j.length)t?.();else{var r=this.j;this.j=[],r=function(t){var e=new gs;{Ee(e=or(e,2,1786));let l=e.m,c=0|l[J];if(null==t)Ue(l,c,3);else{var r=t===M?7:0|t[J],n=r,i=Ve(r),o=i||Object.isFrozen(t),s=!0,a=!0;for(let e=0;e<t.length;e++){var u=t[e];i||(u=tt(u),s&&=!u,a&&=u)}i||(r=s?13:5,r=a?-4097&r:4096|r),o&&r===n||(t=Pt(t),n=0,r=tr(r,c)),r!==n&&Q(t,r),c=Ue(l,c,3,t),2&r||!(4096&r||16&r)||Ie(l,c)}}return e}(r),r=ms(r),this.o.send({url:"https://odml.pa.googleapis.com/v1/log",ga:"POST",O:1e4,body:r,ha:2,fa:{"Content-Type":"application/x-protobuf","x-goog-api-key":this.l},withCredentials:!1},()=>{t?.()},t=>{this.error=Error(`Logging failed with HTTP error: ${t}`),this.j=[],void 0!==this.h&&(clearInterval(this.h),this.h=void 0),e?.("net-send-failed",t)})}}};class bs{constructor(){this.K=this.D=this.I=this.C=this.G=this.H=this.F=0}}function ws(t,e){var r=new os;r=Qe(r,0,1,t.V),r=Qe(r,0,2,e),e=Le(e=new as,6,rt(r=r.j(),!1)),(t=t.A).error||t.j.push(e)}function _s(t,e){var r={F:e.F-t.l.F,H:e.H-t.l.H,G:e.G-t.l.G,C:e.C-t.l.C,I:e.I-t.l.I,D:e.D,K:e.K},n=es(ts(new rs,t.B),1);r=Ss(t,r),ws(t,n=Ze(n,4,ns,r)),t.l=e}function Ss(t,e){var r=new Yo;return t=ir(t=nr(t=or(r,1,t.J),7,e.C),5,e.D),t=ir(t,6,e.K),e.G>0&&ir(t,4,e.I/e.G),0!==e.F&&(r=nr(r=Ko(3),2,e.F),er(t,8,Jo,r)),0!==e.H&&(e=nr(r=Ko(4),2,e.H),er(t,8,Jo,e)),t}var As=class{constructor(t,e,r){this.S=performance.now(),this.o=performance.now(),this.j=new Map,this.v=0,this.h=new bs,this.l=new bs,this.A=new ys(r),this.B=function(t){switch(t){case"AudioClassifier":return 4;case"AudioEmbedder":return 5;case"TextClassifier":return 6;case"TextEmbedder":return 7;case"GestureRecognizer":return 8;case"HandDetector":return 9;case"HandLandmarker":return 10;case"ImageClassifier":return 11;case"ImageEmbedder":return 12;case"ImageSegmenter":return 13;case"ObjectDetector":return 14;case"FaceDetector":return 15;case"FaceLandmarker":return 16;case"InteractiveSegmenter":case"InteractiveSegmenterLegacy":return 18;case"HolisticLandmarker":return 20;case"LlmInference":return 21;case"LanguageDetector":return 22;case"PoseLandmarker":return 23;default:return 0}}(t),this.J=function(t){switch(t){case"IMAGE":return 11;case"VIDEO":return 12;case"LIVE_STREAM":return 13;case"AUDIO_CLIPS":return 14;case"AUDIO_STREAM":return 15;default:return 10}}(e),t=new is,"undefined"==typeof window?e=0:(e=navigator.userAgent,e=/Android/i.test(e)?1:/iPhone|iPad|iPod/i.test(e)?2:/Windows/i.test(e)?5:/Macintosh/i.test(e)?4:/Linux/i.test(e)?3:0),t=Le(t=or(t,1,e),2,re("")),t=Le(t,3,re("")),t=Le(t,4,re("1.0.1")),t=Le(t,5,re("")),this.V=or(t,6,4)}da(){var t=new Zo;t=ir(t=or(t,1,this.J),3,performance.now()-this.S),ws(this,t=Ze(es(ts(new rs,this.B),0),3,ns,t)),this.o=performance.now()}ca(){var t={...this.h,C:this.h.C+this.j.size,D:this.v,K:performance.now()-this.S};_s(this,t);var e=new Qo;e=Qe(e,0,2,t=Ss(this,t)),ws(this,e=Ze(t=es(ts(new rs,this.B),2),5,ns,e))}close(){var t=this.A;"function"==typeof t.close?t.close():t.flush()}};function Es(){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 Is(t){if("function"!=typeof importScripts){let e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise((t,r)=>{e.addEventListener("load",()=>{t()},!1),e.addEventListener("error",t=>{r(t)},!1),document.body.appendChild(e)})}try{importScripts(t.toString())}catch(e){if(!(e instanceof TypeError))throw e;{let e=self.import;e?await e(t.toString()):await import(t.toString())}}}function js(t,e,r){t.o||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function Ts(t,e,r){t.o||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");var n=new Uint32Array(e.length);for(let r=0;r<e.length;r++)n[r]=t.i.stringToNewUTF8(e[r]);e=t.i._malloc(4*n.length),t.i.HEAPU32.set(n,e>>2),r(e);for(let e of n)t.i._free(e);t.i._free(e)}function xs(t,e,r){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=r}function Bs(t,e,r){var n=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(t,e,i)=>{e?(r(n,i),n=[]):n.push(t)}}var Ls=function(t){return class extends t{get R(){return this.i}aa(){if("function"==typeof this.R._mediapipeLoggerGetEncodedApiKey){let t=this.R._mediapipeLoggerGetEncodedApiKey();return this.R._decodeBase64(t)}}}}(function(t){return class extends t{ea(){this.i._registerModelResourcesGraphService()}}}(class{constructor(t,e){this.l=!0,this.i=t,this.h=null,this.j=0,this.o="function"==typeof this.i._addIntToInputStream,void 0!==e?this.i.canvas=e:Es()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}async initializeGraph(t){var 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){var r=t.length,n=this.i._malloc(r);this.i.HEAPU8.set(t,n),e?this.i._changeBinaryGraph(r,n):this.i._changeTextGraph(r,n),this.i._free(n)}configureAudio(t,e,r,n,i){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),js(this,n||"input_audio",n=>{js(this,i=i||"audio_header",i=>{this.i._configureAudio(n,i,t,e??0,r)})})}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}attachErrorListener(t){this.i.errorListener=t}attachEmptyPacketListener(t,e){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[t]=e}addAudioToStream(t,e,r){this.addAudioToStreamWithShape(t,0,0,e,r)}addAudioToStreamWithShape(t,e,r,n,i){var o=4*t.length;this.j!==o&&(this.h&&this.i._free(this.h),this.h=this.i._malloc(o),this.j=o),this.i.HEAPF32.set(t,this.h/4),js(this,n,t=>{this.i._addAudioToInputStream(this.h,e,r,t,i)})}addGpuBufferToStream(t,e,r){js(this,e,e=>{if(!this.i.canvas)throw Error("No OpenGL canvas configured.");e?this.i._bindTextureToStream(e):this.i._bindTextureToCanvas();var n=this.i.canvas.getContext("webgl2")||this.i.canvas.getContext("webgl");if(!n)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");this.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),this.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);var[i,o]=void 0!==t.videoWidth?[t.videoWidth,t.videoHeight]:void 0!==t.naturalWidth?[t.naturalWidth,t.naturalHeight]:void 0!==t.displayWidth?[t.displayWidth,t.displayHeight]:[t.width,t.height];!this.l||i===this.i.canvas.width&&o===this.i.canvas.height||(this.i.canvas.width=i,this.i.canvas.height=o);var[s,a]=[i,o];this.i._addBoundTextureToStream(e,s,a,r)})}addBoolToStream(t,e,r){js(this,e,e=>{this.i._addBoolToInputStream(t,e,r)})}addDoubleToStream(t,e,r){js(this,e,e=>{this.i._addDoubleToInputStream(t,e,r)})}addFloatToStream(t,e,r){js(this,e,e=>{this.i._addFloatToInputStream(t,e,r)})}addIntToStream(t,e,r){js(this,e,e=>{this.i._addIntToInputStream(t,e,r)})}addUintToStream(t,e,r){js(this,e,e=>{this.i._addUintToInputStream(t,e,r)})}addStringToStream(t,e,r){js(this,e,e=>{js(this,t,t=>{this.i._addStringToInputStream(t,e,r)})})}addStringRecordToStream(t,e,r){js(this,e,e=>{Ts(this,Object.keys(t),n=>{Ts(this,Object.values(t),i=>{this.i._addFlatHashMapToInputStream(n,i,Object.keys(t).length,e,r)})})})}addProtoToStream(t,e,r,n){js(this,r,r=>{js(this,e,e=>{var i=this.i._malloc(t.length);this.i.HEAPU8.set(t,i),this.i._addProtoToInputStream(i,t.length,e,r,n),this.i._free(i)})})}addEmptyPacketToStream(t,e){js(this,t,t=>{this.i._addEmptyPacketToInputStream(t,e)})}addBoolVectorToStream(t,e,r){js(this,e,e=>{var n=this.i._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(let e of t)this.i._addBoolVectorEntry(n,e);this.i._addBoolVectorToInputStream(n,e,r)})}addDoubleVectorToStream(t,e,r){js(this,e,e=>{var n=this.i._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(let e of t)this.i._addDoubleVectorEntry(n,e);this.i._addDoubleVectorToInputStream(n,e,r)})}addFloatVectorToStream(t,e,r){js(this,e,e=>{var n=this.i._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(let e of t)this.i._addFloatVectorEntry(n,e);this.i._addFloatVectorToInputStream(n,e,r)})}addIntVectorToStream(t,e,r){js(this,e,e=>{var n=this.i._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(let e of t)this.i._addIntVectorEntry(n,e);this.i._addIntVectorToInputStream(n,e,r)})}addUintVectorToStream(t,e,r){js(this,e,e=>{var n=this.i._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(let e of t)this.i._addUintVectorEntry(n,e);this.i._addUintVectorToInputStream(n,e,r)})}addStringVectorToStream(t,e,r){js(this,e,e=>{var n=this.i._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(let e of t)js(this,e,t=>{this.i._addStringVectorEntry(n,t)});this.i._addStringVectorToInputStream(n,e,r)})}addBoolToInputSidePacket(t,e){js(this,e,e=>{this.i._addBoolToInputSidePacket(t,e)})}addDoubleToInputSidePacket(t,e){js(this,e,e=>{this.i._addDoubleToInputSidePacket(t,e)})}addFloatToInputSidePacket(t,e){js(this,e,e=>{this.i._addFloatToInputSidePacket(t,e)})}addIntToInputSidePacket(t,e){js(this,e,e=>{this.i._addIntToInputSidePacket(t,e)})}addUintToInputSidePacket(t,e){js(this,e,e=>{this.i._addUintToInputSidePacket(t,e)})}addStringToInputSidePacket(t,e){js(this,e,e=>{js(this,t,t=>{this.i._addStringToInputSidePacket(t,e)})})}addProtoToInputSidePacket(t,e,r){js(this,r,r=>{js(this,e,e=>{var n=this.i._malloc(t.length);this.i.HEAPU8.set(t,n),this.i._addProtoToInputSidePacket(n,t.length,e,r),this.i._free(n)})})}addBoolVectorToInputSidePacket(t,e){js(this,e,e=>{var r=this.i._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(let e of t)this.i._addBoolVectorEntry(r,e);this.i._addBoolVectorToInputSidePacket(r,e)})}addDoubleVectorToInputSidePacket(t,e){js(this,e,e=>{var r=this.i._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(let e of t)this.i._addDoubleVectorEntry(r,e);this.i._addDoubleVectorToInputSidePacket(r,e)})}addFloatVectorToInputSidePacket(t,e){js(this,e,e=>{var r=this.i._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(let e of t)this.i._addFloatVectorEntry(r,e);this.i._addFloatVectorToInputSidePacket(r,e)})}addIntVectorToInputSidePacket(t,e){js(this,e,e=>{var r=this.i._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(let e of t)this.i._addIntVectorEntry(r,e);this.i._addIntVectorToInputSidePacket(r,e)})}addUintVectorToInputSidePacket(t,e){js(this,e,e=>{var r=this.i._allocateUintVector(t.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(let e of t)this.i._addUintVectorEntry(r,e);this.i._addUintVectorToInputSidePacket(r,e)})}addStringVectorToInputSidePacket(t,e){js(this,e,e=>{var r=this.i._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(let e of t)js(this,e,t=>{this.i._addStringVectorEntry(r,t)});this.i._addStringVectorToInputSidePacket(r,e)})}attachBoolListener(t,e){xs(this,t,e),js(this,t,t=>{this.i._attachBoolListener(t)})}attachBoolVectorListener(t,e){Bs(this,t,e),js(this,t,t=>{this.i._attachBoolVectorListener(t)})}attachIntListener(t,e){xs(this,t,e),js(this,t,t=>{this.i._attachIntListener(t)})}attachIntVectorListener(t,e){Bs(this,t,e),js(this,t,t=>{this.i._attachIntVectorListener(t)})}attachUintListener(t,e){xs(this,t,e),js(this,t,t=>{this.i._attachUintListener(t)})}attachUintVectorListener(t,e){Bs(this,t,e),js(this,t,t=>{this.i._attachUintVectorListener(t)})}attachDoubleListener(t,e){xs(this,t,e),js(this,t,t=>{this.i._attachDoubleListener(t)})}attachDoubleVectorListener(t,e){Bs(this,t,e),js(this,t,t=>{this.i._attachDoubleVectorListener(t)})}attachFloatListener(t,e){xs(this,t,e),js(this,t,t=>{this.i._attachFloatListener(t)})}attachFloatVectorListener(t,e){Bs(this,t,e),js(this,t,t=>{this.i._attachFloatVectorListener(t)})}attachStringListener(t,e){xs(this,t,e),js(this,t,t=>{this.i._attachStringListener(t)})}attachStringVectorListener(t,e){Bs(this,t,e),js(this,t,t=>{this.i._attachStringVectorListener(t)})}attachProtoListener(t,e,r){xs(this,t,e),js(this,t,t=>{this.i._attachProtoListener(t,r||!1)})}attachProtoVectorListener(t,e,r){Bs(this,t,e),js(this,t,t=>{this.i._attachProtoVectorListener(t,r||!1)})}attachAudioListener(t,e,r){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),xs(this,t,(t,r)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,r)}),js(this,t,t=>{this.i._attachAudioListener(t,r||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}})),Us=class extends Ls{};async function Ns(t,e,r){return t=await(async(t,e,r,n)=>{if(e&&await Is(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(r&&(await Is(r),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&n&&((e=self.Module).locateFile=n.locateFile,n.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=n.mainScriptUrlOrBlob)),n=await self.ModuleFactory(self.Module||n),self.ModuleFactory=self.Module=void 0,new t(n,null)})(t,e.wasmLoaderPath,e.assetLoaderPath,{locateFile:t=>t.endsWith(".wasm")?e.wasmBinaryPath.toString():e.assetBinaryPath&&t.endsWith(".data")?e.assetBinaryPath.toString():t}),function(t,e){e=e.na??"";var r=t.h.aa();t.j=new As(t.J(),e,r)}(t,r),await t.u(r),t}async function Os(t,e,r){return Ns(t,e,r)}function Ps(t,e){var r=Ke(t.baseOptions,Lo,1)||new Lo;"string"==typeof e?(Le(r,2,re(e)),Le(r,1)):e instanceof Uint8Array&&(Le(r,1,rt(e,!1)),Le(r,2)),Qe(t.baseOptions,0,1,r)}function ks(t,e){var r=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Ke(t.baseOptions,Lo,1)?.j()||Ke(t.baseOptions,Lo,1)?.l()||e.baseOptions?.modelAssetBuffer||e.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,e){var r=Ke(t.baseOptions,xo,3);if(!r){var n=r=new xo,i=new ro;Ze(n,4,Bo,i)}"delegate"in e&&("GPU"===e.delegate?(e=r,n=new Qi,Ze(e,2,Bo,n)):(e=r,n=new ro,Ze(e,4,Bo,n))),Qe(t.baseOptions,0,3,r)}(t,r),r.modelAssetPath)return fetch(r.modelAssetPath.toString()).then(t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${r.modelAssetPath} (${t.status})`)}).then(e=>{try{t.h.i.FS_unlink("/model.dat")}catch{}t.h.i.FS_createDataFile("/","model.dat",new Uint8Array(e),!0,!1,!1),Ps(t,"/model.dat"),t.B()});if(r.modelAssetBuffer instanceof Uint8Array)Ps(t,r.modelAssetBuffer);else if(r.modelAssetBuffer)return async function(t){for(var e=[],r=0;;){let{done:n,value:i}=await t.read();if(n)break;e.push(i),r+=i.length}if(0===e.length)return new Uint8Array(0);if(1===e.length)return e[0];t=new Uint8Array(r),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}(r.modelAssetBuffer).then(e=>{Ps(t,e),t.B()});return t.B(),Promise.resolve()}function Fs(t){try{let e=t.v.length;if(1===e)throw Error(t.v[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.v.map(t=>t.message).join(", "))}finally{t.v=[]}}function Vs(t,e){t.j&&void 0!==e&&(Ke(t.baseOptions,xo,3)?.j()?(++(t=t.j).h.H,t.j.set(e,performance.now())):(++(t=t.j).h.F,t.j.set(e,performance.now())))}function Cs(t,e){t.o=Math.max(t.o,e)}var Ms=class{constructor(t){this.h=t,this.v=[],this.o=0,this.h.setAutoRenderToScreen(!1)}setGraph(t,e){this.h.attachErrorListener((t,e)=>{this.v.push(Error(e))}),this.h.ea(),this.h.setGraph(t,e),this.j?.da(),Fs(this)}finishProcessing(t){if(this.h.finishProcessing(),Fs(this),this.j&&void 0!==t){var e=this.j,r=e.j.get(t);if(void 0!==r&&(e.j.delete(t),t=performance.now()-r,++e.h.G,e.h.I+=t,e.h.D=Math.max(e.h.D,t),e.v=Math.max(e.v,t),performance.now()>e.o+3e4)){for(let[n,i]of e.j.entries())t=n,i<r&&(e.h.C++,e.j.delete(t));r={...e.h,K:performance.now()-e.o},e.h.D=0,e.o=performance.now(),_s(e,r)}}}close(){this.j?.ca(),this.j?.close(),this.h.closeGraph()}};Ms.prototype.close=Ms.prototype.close;var Gs=class extends Ms{constructor(t,e){super(new Us(t,e)),this.A={languages:[]},Qe(t=this.l=new Po,0,1,e=new Uo)}J(){return"LanguageDetector"}u(t){return Qe(this.l,0,2,Co(t,Ke(this.l,Io,2))),ks(this,t)}get baseOptions(){return Ke(this.l,Uo,1)}set baseOptions(t){Qe(this.l,0,1,t)}Y(t){this.A={languages:[]};var e=this.o+1;return Vs(this,e),this.h.addStringToStream(t,"text_in",e),this.finishProcessing(e),this.A}B(){var t=new vo;po(t),sr(t,15,"classifications_out");var e=new oo;An(e,ko,this.l);var r=new lo;Ge(r,re("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),uo(r),sr(r,4,"CLASSIFICATIONS:classifications_out"),r.u(e),er(t,1,lo,r),this.h.attachProtoListener("classifications_out",(t,e)=>{if(({classifications:t}=Go(bo(t))),1!==t.length)throw Error(`Expected 1 classification head, got ${t.length}`);this.A.languages=t[0].categories.map(t=>({languageCode:t.categoryName,probability:t.score})),Cs(this,e)}),this.h.attachEmptyPacketListener("classifications_out",t=>{Cs(this,t)}),t=t.j(),this.setGraph(new Uint8Array(t),!0)}};Gs.prototype.detect=Gs.prototype.Y,Gs.prototype.setOptions=Gs.prototype.u,Gs.createFromModelPath=function(t,e){return Os(Gs,t,{baseOptions:{modelAssetPath:e}})},Gs.createFromModelBuffer=function(t,e){return Os(Gs,t,{baseOptions:{modelAssetBuffer:e}})},Gs.createFromOptions=function(t,e){return Os(Gs,t,e)};var Rs=class extends Ms{constructor(t,e){super(new Us(t,e)),this.A={classifications:[]},Qe(t=this.l=new Po,0,1,e=new Uo)}J(){return"TextClassifier"}u(t){return Qe(this.l,0,2,Co(t,Ke(this.l,Io,2))),ks(this,t)}get baseOptions(){return Ke(this.l,Uo,1)}set baseOptions(t){Qe(this.l,0,1,t)}X(t){this.A={classifications:[]};var e=this.o+1;return Vs(this,e),this.h.addStringToStream(t,"text_in",e),this.finishProcessing(e),this.A}B(){var t=new vo;po(t),sr(t,15,"classifications_out");var e=new oo;An(e,ko,this.l);var r=new lo;Ge(r,re("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),uo(r),sr(r,4,"CLASSIFICATIONS:classifications_out"),r.u(e),er(t,1,lo,r),this.h.attachProtoListener("classifications_out",(t,e)=>{this.A=Go(bo(t)),Cs(this,e)}),this.h.attachEmptyPacketListener("classifications_out",t=>{Cs(this,t)}),t=t.j(),this.setGraph(new Uint8Array(t),!0)}};function Ds(t){switch(t){case"RETRIEVAL_QUERY":default:return"search result";case"SEMANTIC_SIMILARITY":return"sentence similarity";case"CLASSIFICATION":return"classification";case"CLUSTERING":return"clustering";case"QUESTION_ANSWERING":return"question answering";case"FACT_CHECKING":return"fact checking";case"CODE_RETRIEVAL":return"code retrieval"}}Rs.prototype.classify=Rs.prototype.X,Rs.prototype.setOptions=Rs.prototype.u,Rs.createFromModelPath=function(t,e){return Os(Rs,t,{baseOptions:{modelAssetPath:e}})},Rs.createFromModelBuffer=function(t,e){return Os(Rs,t,{baseOptions:{modelAssetBuffer:e}})},Rs.createFromOptions=function(t,e){return Os(Rs,t,e)};var $s=class extends Ms{constructor(t,e){super(new Us(t,e)),this.A={embeddings:[]},Qe(t=this.l=new Fo,0,1,e=new Uo)}J(){return"TextEmbedder"}u(t){var e=this.l,r=Ke(this.l,jo,2);return r=r?we(r):new jo,void 0!==t.l2Normalize?Le(r,1,Rt(t.l2Normalize)):"l2Normalize"in t&&Le(r,1),void 0!==t.quantize?Le(r,2,Rt(t.quantize)):"quantize"in t&&Le(r,2),Qe(e,0,2,r),ks(this,t)}get baseOptions(){return Ke(this.l,Uo,1)}set baseOptions(t){Qe(this.l,0,1,t)}Z(t,e){var r=this.o+1;if(Vs(this,r),e)t:{let r=e.type,n=e.title&&e.title.length>0?e.title:"none";switch(e="DOCUMENT"!==e.textRole,r){case"RETRIEVAL_DOCUMENT":t=`title: ${n} | text: ${t}`;break t;case"RETRIEVAL_QUERY":t=`task: ${Ds(r)} | query: ${t}`;break t;case"QUESTION_ANSWERING":case"FACT_CHECKING":case"CODE_RETRIEVAL":t=e?`task: ${Ds(r)} | query: ${t}`:`title: ${n} | text: ${t}`;break t;default:t=`task: ${Ds(r)} | query: ${t}`}}return this.h.addStringToStream(t,"text_in",r),this.finishProcessing(r),this.A}B(){var t=new vo;po(t),sr(t,15,"embeddings_out");var e=new oo;An(e,Vo,this.l);var r=new lo;Ge(r,re("mediapipe.tasks.text.text_embedder.TextEmbedderGraph")),uo(r),sr(r,4,"EMBEDDINGS:embeddings_out"),r.u(e),er(t,1,lo,r),this.h.attachProtoListener("embeddings_out",(t,e)=>{t=Eo(t),this.A=function(t){return{embeddings:Ye(t,So).map(t=>{var e={headIndex:zt(xe(t,3))??0??-1,headName:ne(xe(t,4))??""??""};if(Ne(t,wo,1,Ao))t=Oe(t=rr(t,wo,1),1,Gt,void 0===nt?2:4),e.floatEmbedding=t.slice();else{let r=new Uint8Array(0);e.quantizedEmbedding=rr(t,_o,2)?.j()?.j()??r}return e}),timestampMs:Mo(xe(t,2,void 0,Qt)??Te)}}(t),Cs(this,e)}),this.h.attachEmptyPacketListener("embeddings_out",t=>{Cs(this,t)}),t=t.j(),this.setGraph(new Uint8Array(t),!0)}};$s.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=Do(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=Do(Ro(t.quantizedEmbedding),Ro(e.quantizedEmbedding))}return t},$s.prototype.embed=$s.prototype.Z,$s.prototype.setOptions=$s.prototype.u,$s.createFromModelPath=function(t,e){return Os($s,t,{baseOptions:{modelAssetPath:e}})},$s.createFromModelBuffer=function(t,e){return Os($s,t,{baseOptions:{modelAssetBuffer:e}})},$s.createFromOptions=function(t,e){return Os($s,t,e)},exports.FilesetResolver=qo,exports.LanguageDetector=Gs,exports.TaskRunner=Ms,exports.TextClassifier=Rs,exports.TextEmbedder=$s;
2
2
  //# sourceMappingURL=text_bundle_cjs.js.map