www_duniayetu/public/1/img/(2) WhatsApp_files/app.cbe2fde94befbde07514.js
sasha-astiadi b0a7d95a9d edit
2022-12-16 22:24:00 +08:00

78 lines
4.0 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! Copyright (c) 2022 WhatsApp Inc. All Rights Reserved. */
(self.webpackChunkwhatsapp_web_client=self.webpackChunkwhatsapp_web_client||[]).push([[2143],{363509:(e,t,n)=>{var r={"./f00.png":192256,"./f01.png":107151,"./f02.png":329449,"./f03.png":594719,"./f04.png":783004,"./f05.png":99381,"./f06.png":604893,"./f07.png":761353,"./f08.png":945598,"./f09.png":379575,"./f10.png":105211,"./f11.png":419751,"./f12.png":61294,"./f13.png":970938,"./f14.png":381790,"./f15.png":8669,"./f16.png":130047,"./f17.png":361022,"./f18.png":633295,"./f19.png":299635,"./f20.png":882645,"./f21.png":367083,"./f22.png":755359,"./f23.png":30003,"./f24.png":677659,"./f25.png":81024,"./f26.png":564195,"./f27.png":837704,"./f28.png":393374,"./f29.png":712282,"./f30.png":657894,"./f31.png":353320,"./f32.png":918234,"./f33.png":537426,"./f34.png":37382,"./f35.png":380904,"./f36.png":605193,"./f37.png":838324,"./f38.png":683149,"./f39.png":968480,"./f40.png":235741,"./f41.png":424081,"./f42.png":709062,"./f43.png":951839,"./f44.png":477271,"./f45.png":39622,"./f46.png":148373,"./f47.png":51400,"./f48.png":542720,"./f49.png":243805,"./f50.png":56995,"./f51.png":575688,"./f52.png":131796,"./f53.png":173785,"./f54.png":162521,"./f55.png":471449,"./f56.png":298224,"./f57.png":710601,"./f58.png":972870,"./f59.png":493224,"./f60.png":921564,"./f61.png":93169,"./f62.png":154423,"./f63.png":303491,"./f64.png":886262,"./f65.png":37806,"./f66.png":135049,"./f67.png":704971,"./f68.png":332845,"./f69.png":529664,"./f70.png":29469,"./f71.png":860540,"./f72.png":114364,"./f73.png":34476,"./f74.png":280952,"./f75.png":547236,"./f76.png":991385,"./f77.png":886342,"./f78.png":593828,"./f79.png":407026,"./f80.png":659076,"./f81.png":686555,"./f82.png":215330,"./f83.png":751331,"./f84.png":844780,"./f85.png":902506,"./f86.png":527300,"./f87.png":235074,"./f88.png":583020,"./f89.png":558516,"./f90.png":615707,"./f91.png":871247,"./f92.png":654647,"./f93.png":167517,"./f94.png":383439,"./f95.png":938404,"./f96.png":550273,"./f97.png":312123,"./f98.png":879144,"./f99.png":440594,"./favicon-error.png":172654,"./favicon-error2.png":819528,"./favicon.png":429242};function i(e){var t=a(e);return n(t)}function a(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=a,e.exports=i,i.id=363509},276554:(e,t,n)=>{var r={"./f00.png":211372,"./f01.png":648039,"./f02.png":149519,"./f03.png":298446,"./f04.png":868917,"./f05.png":146454,"./f06.png":580841,"./f07.png":941038,"./f08.png":457522,"./f09.png":604754,"./f10.png":644183,"./f11.png":899233,"./f12.png":800347,"./f13.png":452761,"./f14.png":219754,"./f15.png":318613,"./f16.png":117613,"./f17.png":670322,"./f18.png":55928,"./f19.png":98442,"./f20.png":732677,"./f21.png":664770,"./f22.png":643426,"./f23.png":31644,"./f24.png":106597,"./f25.png":407210,"./f26.png":561890,"./f27.png":258229,"./f28.png":181250,"./f29.png":341431,"./f30.png":60853,"./f31.png":875920,"./f32.png":621202,"./f33.png":523022,"./f34.png":746622,"./f35.png":13683,"./f36.png":945274,"./f37.png":374507,"./f38.png":536466,"./f39.png":855254,"./f40.png":695725,"./f41.png":297585,"./f42.png":175218,"./f43.png":81303,"./f44.png":249465,"./f45.png":55625,"./f46.png":448475,"./f47.png":767848,"./f48.png":658139,"./f49.png":697019,"./f50.png":263744,"./f51.png":814517,"./f52.png":302181,"./f53.png":665405,"./f54.png":661605,"./f55.png":990866,"./f56.png":671888,"./f57.png":435515,"./f58.png":18457,"./f59.png":820009,"./f60.png":63163,"./f61.png":820930,"./f62.png":969341,"./f63.png":108373,"./f64.png":399910,"./f65.png":510127,"./f66.png":134843,"./f67.png":168683,"./f68.png":279587,"./f69.png":481265,"./f70.png":929761,"./f71.png":67156,"./f72.png":14427,"./f73.png":118241,"./f74.png":555948,"./f75.png":305193,"./f76.png":585044,"./f77.png":56746,"./f78.png":973675,"./f79.png":263159,"./f80.png":437160,"./f81.png":331456,"./f82.png":958193,"./f83.png":68436,"./f84.png":15188,"./f85.png":335444,"./f86.png":961218,"./f87.png":712535,"./f88.png":756277,"./f89.png":111847,"./f90.png":83242,"./f91.png":697168,"./f92.png":906763,"./f93.png":169685,"./f94.png":234887,"./f95.png":424111,"./f96.png":271972,"./f97.png":739920,"./f98.png":694784,"./f99.png":760795,"./favicon-error.png":306769,"./favicon-error2.png":477238,"./favicon.png":56216};function i(e){var t=a(e);return n(t)}function a(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=a,e.exports=i,i.id=276554},123098:module=>{var e={},aa={},l;for(l in e)e.hasOwnProperty(l)&&(aa[l]=e[l]);function ba(e){eval.call(null,e)}for(l in e.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},"undefined"!=typeof arguments&&(e.arguments=arguments),"undefined"!=typeof console?(e.print||(e.print=function(e){console.log(e)}),e.printErr||(e.printErr=function(e){console.log(e)})):e.print||(e.print=function(){}),void 0===e.setWindowTitle&&(e.setWindowTitle=function(e){document.title=e}),!e.load&&e.read&&(e.load=function(t){ba(e.read(t))}),e.print||(e.print=function(){}),e.printErr||(e.printErr=e.print),e.arguments||(e.arguments=[]),e.thisProgram||(e.thisProgram="./this.program"),e.print=e.print,e.S=e.printErr,e.preRun=[],e.postRun=[],aa)aa.hasOwnProperty(l)&&(e[l]=aa[l]);var n={cb:function(e){ca=e},Ua:function(){return ca},na:function(){return m},X:function(e){m=e},Aa:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:return"*"===e[e.length-1]?n.H:"i"===e[0]?(assert(0==(e=parseInt(e.substr(1)))%8),e/8):0}},Ta:function(e){return Math.max(n.Aa(e),n.H)},dd:16,Bd:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},od:function(e,t,r){return r||"i64"!=e&&"double"!=e?e?Math.min(t||(e?n.Ta(e):0),n.H):Math.min(t,8):8},J:function(t,n,r){return r&&r.length?(r.splice||(r=Array.prototype.slice.call(r)),r.splice(0,0,n),e["dynCall_"+t].apply(null,r)):e["dynCall_"+t].call(null,n)},U:[],Ma:function(e){for(var t=0;t<n.U.length;t++)if(!n.U[t])return n.U[t]=e,2*(1+t);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."},$a:function(e){n.U[(e-2)/2]=null},M:function(t){n.M.ma||(n.M.ma={}),n.M.ma[t]||(n.M.ma[t]=1,e.S(t))},ha:{},rd:function(e,t){assert(t),n.ha[t]||(n.ha[t]={});var r=n.ha[t];return r[e]||(r[e]=function(){return n.J(t,e,arguments)}),r[e]},pd:function(){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"},W:function(e){var t=m;return m=(m=m+e|0)+15&-16,t},Ia:function(e){var t=p;return p=(p=p+e|0)+15&-16,t},P:function(e){var t=v;return(e=(v=(v=v+e|0)+15&-16)>=w)&&(z("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+w+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 "),e=!0),e?(v=t,0):t},ea:function(e,t){return Math.ceil(e/(t||16))*(t||16)},xd:function(e,t,n){return n?+(e>>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t)},La:8,H:4,ed:0};e.Runtime=n,n.addFunction=n.Ma,n.removeFunction=n.$a;var A=!1,da,fa,ca,ha,ia,buffer;function assert(e,t){e||z("Assertion failed: "+t)}function ga(a){var b=e["_"+a];if(!b)try{b=eval("_"+a)}catch(e){}return assert(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)"),b}function ma(e,t,n){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":D[e>>0]=t;break;case"i16":E[e>>1]=t;break;case"i32":F[e>>2]=t;break;case"i64":fa=[t>>>0,(da=t,1<=+na(da)?0<da?(0|oa(+pa(da/4294967296),4294967295))>>>0:~~+qa((da-+(~~da>>>0))/4294967296)>>>0:0)],F[e>>2]=fa[0],F[e+4>>2]=fa[1];break;case"float":ra[e>>2]=t;break;case"double":sa[e>>3]=t;break;default:z("invalid type for setValue: "+n)}}function ta(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return D[e>>0];case"i16":return E[e>>1];case"i32":case"i64":return F[e>>2];case"float":return ra[e>>2];case"double":return sa[e>>3];default:z("invalid type for setValue: "+t)}return null}function G(e,t,r,i){var a,o;"number"==typeof e?(a=!0,o=e):(a=!1,o=e.length);var s,l,u="string"==typeof t?t:null;if(r=4==r?i:[ua,n.W,n.Ia,n.P][void 0===r?2:r](Math.max(o,u?1:t.length)),a){for(i=r,assert(0==(3&r)),e=r+(-4&o);i<e;i+=4)F[i>>2]=0;for(e=r+o;i<e;)D[i++>>0]=0;return r}if("i8"===u)return e.subarray||e.slice?H.set(e,r):H.set(new Uint8Array(e),r),r;for(i=0;i<o;){var c=e[i];"function"==typeof c&&(c=n.sd(c)),0===(a=u||t[i])?i++:("i64"==a&&(a="i32"),ma(r+i,c,a),l!==a&&(s=n.Aa(a),l=a),i+=s)}return r}function la(t,n){if(0===n||!t)return"";for(var r,i=0,a=0;(i|=r=H[t+a>>0],0!=r||n)&&(a++,!n||a!=n););if(n||(n=a),r="",128>i){for(;0<n;)i=String.fromCharCode.apply(String,H.subarray(t,t+Math.min(n,1024))),r=r?r+i:i,t+=1024,n-=1024;return r}return e.UTF8ToString(t)}function za(e,t){for(var n,r,i,a,o,s="";;){if(!(n=e[t++]))return s;128&n?(r=63&e[t++],192==(224&n)?s+=String.fromCharCode((31&n)<<6|r):(i=63&e[t++],224==(240&n)?n=(15&n)<<12|r<<6|i:(a=63&e[t++],240==(248&n)?n=(7&n)<<18|r<<12|i<<6|a:(o=63&e[t++],248==(252&n)?n=(3&n)<<24|r<<18|i<<12|a<<6|o:n=(1&n)<<30|r<<24|i<<18|a<<12|o<<6|63&e[t++])),65536>n?s+=String.fromCharCode(n):(n-=65536,s+=String.fromCharCode(55296|n>>10,56320|1023&n)))):s+=String.fromCharCode(n)}}function Aa(e,t,n,r){if(!(0<r))return 0;var i=n;r=n+r-1;for(var a=0;a<e.length;++a){var o=e.charCodeAt(a);if(55296<=o&&57343>=o&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++a)),127>=o){if(n>=r)break;t[n++]=o}else{if(2047>=o){if(n+1>=r)break;t[n++]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;t[n++]=224|o>>12}else{if(2097151>=o){if(n+3>=r)break;t[n++]=240|o>>18}else{if(67108863>=o){if(n+4>=r)break;t[n++]=248|o>>24}else{if(n+5>=r)break;t[n++]=252|o>>30,t[n++]=128|o>>24&63}t[n++]=128|o>>18&63}t[n++]=128|o>>12&63}t[n++]=128|o>>6&63}t[n++]=128|63&o}}return t[n]=0,n-i}function Ba(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);55296<=r&&57343>=r&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++n)),127>=r?++t:t=2047>=r?t+2:65535>=r?t+3:2097151>=r?t+4:67108863>=r?t+5:t+6}return t}function Ca(t){var r=!!e.___cxa_demangle;if(r)try{var i=ua(t.length);ka(t.substr(1),i);var a=ua(4),o=e.___cxa_demangle(i,0,0,a);if(0===ta(a,"i32")&&o)return la(o)}catch(e){}finally{i&&Da(i),a&&Da(a),o&&Da(o)}var s=3,l={v:"void",b:"bool",c:"char",s:"short",i:"int",l:"long",f:"float",d:"double",w:"wchar_t",a:"signed char",h:"unsigned char",t:"unsigned short",j:"unsigned int",m:"unsigned long",x:"long long",y:"unsigned long long",z:"..."},u=[],c=!0;i=t;try{if("Object._main"==t||"_main"==t)return"main()";if("number"==typeof t&&(t=la(t)),"_"!==t[0]||"_"!==t[1]||"Z"!==t[2])return t;switch(t[3]){case"n":return"operator new()";case"d":return"operator delete()"}i=function e(n,r,i){r=r||1/0;var a,o="",d=[];if("N"===t[s]){for(s++,"K"===t[s]&&s++,a=[];"E"!==t[s];)if("S"===t[s]){s++;var p=t.indexOf("_",s);a.push(u[t.substring(s,p)||0]||"?"),s=p+1}else if("C"===t[s])a.push(a[a.length-1]),s+=2;else{var _=(p=parseInt(t.substr(s))).toString().length;if(!p||!_){s--;break}var f=t.substr(s+_,p);a.push(f),u.push(f),s+=_+p}if(s++,a=a.join("::"),0==--r)return n?[a]:a}else("K"===t[s]||c&&"L"===t[s])&&s++,(p=parseInt(t.substr(s)))&&(_=p.toString().length,a=t.substr(s+_,p),s+=_+p);c=!1,"I"===t[s]?(s++,p=e(!0),o+=(_=e(!0,1,!0))[0]+" "+a+"<"+p.join(", ")+">"):o=a;e:for(;s<t.length&&0<r--;)if(a=t[s++],a in l)d.push(l[a]);else switch(a){case"P":d.push(e(!0,1,!0)[0]+"*");break;case"R":d.push(e(!0,1,!0)[0]+"&");break;case"L":s++,p=t.indexOf("E",s)-s,d.push(t.substr(s,p)),s+=p+2;break;case"A":if(p=parseInt(t.substr(s)),s+=p.toString().length,"_"!==t[s])throw"?";s++,d.push(e(!0,1,!0)[0]+" ["+p+"]");break;case"E":break e;default:o+="?"+a;break e}return i||1!==d.length||"void"!==d[0]||(d=[]),n?(o&&d.push(o+"?"),d):o+"("+d.join(", ")+")"}()}catch(e){i+="?"}return 0<=i.indexOf("?")&&!r&&n.M("warning: a problem occurred in builtin C++ name demangling; build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),i}function Ea(){return Fa().replace(/__Z[\w\d_]+/g,(function(e){var t=Ca(e);return e===t?e:e+" ["+t+"]"}))}function Fa(){var e=Error();if(!e.stack){try{throw Error(0)}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function Ga(){var e=v;return 0<e%4096&&(e+=4096-e%4096),e}(function(){function a(e){return{arguments:(e=e.toString().match(d).slice(1))[0],body:e[1],returnValue:e[2]}}var b={stackSave:function(){n.na()},stackRestore:function(){n.X()},arrayToC:function(e){var t=n.W(e.length);return ja(e,t),t},stringToC:function(e){var t=0;return null!=e&&0!==e&&ka(e,t=n.W(1+(e.length<<2))),t}},c={string:b.stringToC,array:b.arrayToC};ia=function(e,t,r,i,a){e=ga(e);var o=[],s=0;if(i)for(var l=0;l<i.length;l++){var u=c[r[l]];u?(0===s&&(s=n.na()),o[l]=u(i[l])):o[l]=i[l]}if(r=e.apply(null,o),"string"===t&&(r=la(r)),0!==s){if(a&&a.async)return void EmterpreterAsync.hd.push((function(){n.X(s)}));n.X(s)}return r};var d=/^function\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/,f={},h;for(h in b)b.hasOwnProperty(h)&&(f[h]=a(b[h]));ha=function(b,c,d){d=d||[];var h=ga(b);b=d.every((function(e){return"number"===e}));var u="string"!==c;if(u&&b)return h;var q=d.map((function(e,t){return"$"+t}));c="(function("+q.join(",")+") {";var y=d.length;if(!b){c+="var stack = "+f.stackSave.body+";";for(var B=0;B<y;B++){var J=q[B],ea=d[B];"number"!==ea&&(ea=f[ea+"ToC"],c+="var "+ea.arguments+" = "+J+";",c+=ea.body+";",c+=J+"="+ea.returnValue+";")}}return d=a((function(){return h})).returnValue,c+="var ret = "+d+"("+q.join(",")+");",u||(d=a((function(){return la})).returnValue,c+="ret = "+d+"(ret);"),b||(c+=f.stackRestore.body.replace("()","(stack)")+";"),eval(c+"return ret})")}})(),e.ccall=ia,e.cwrap=ha,e.setValue=ma,e.getValue=ta,e.ALLOC_NORMAL=0,e.ALLOC_STACK=1,e.ALLOC_STATIC=2,e.ALLOC_DYNAMIC=3,e.ALLOC_NONE=4,e.allocate=G,e.getMemory=function(e){return va?void 0!==wa&&!wa.C||!xa?n.P(e):ua(e):n.Ia(e)},e.Pointer_stringify=la,e.AsciiToString=function(e){for(var t="";;){var n=D[e++>>0];if(!n)return t;t+=String.fromCharCode(n)}},e.stringToAscii=function(e,t){return ya(e,t,!1)},e.UTF8ArrayToString=za,e.UTF8ToString=function(e){return za(H,e)},e.stringToUTF8Array=Aa,e.stringToUTF8=function(e,t,n){return Aa(e,H,t,n)},e.lengthBytesUTF8=Ba,e.UTF16ToString=function(e){for(var t=0,n="";;){var r=E[e+2*t>>1];if(0==r)return n;++t,n+=String.fromCharCode(r)}},e.stringToUTF16=function(e,t,n){if(void 0===n&&(n=2147483647),2>n)return 0;var r=t;n=(n-=2)<2*e.length?n/2:e.length;for(var i=0;i<n;++i)E[t>>1]=e.charCodeAt(i),t+=2;return E[t>>1]=0,t-r},e.lengthBytesUTF16=function(e){return 2*e.length},e.UTF32ToString=function(e){for(var t=0,n="";;){var r=F[e+4*t>>2];if(0==r)return n;++t,65536<=r?(r-=65536,n+=String.fromCharCode(55296|r>>10,56320|1023&r)):n+=String.fromCharCode(r)}},e.stringToUTF32=function(e,t,n){if(void 0===n&&(n=2147483647),4>n)return 0;var r=t;n=r+n-4;for(var i=0;i<e.length;++i){if(55296<=(a=e.charCodeAt(i))&&57343>=a)var a=65536+((1023&a)<<10)|1023&e.charCodeAt(++i);if(F[t>>2]=a,(t+=4)+4>n)break}return F[t>>2]=0,t-r},e.lengthBytesUTF32=function(e){for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);55296<=r&&57343>=r&&++n,t+=4}return t},e.stackTrace=function(){return Ea()};for(var D,H,E,Ha,F,Ia,ra,sa,Ja=0,p=0,va=!1,Ka=0,m=0,La=0,Ma=0,v=0,Na=e.TOTAL_STACK||5242880,w=e.TOTAL_MEMORY||16777216,I=65536;I<w||I<2*Na;)I=16777216>I?2*I:I+16777216;function Oa(e){for(;0<e.length;){var t=e.shift();if("function"==typeof t)t();else{var r=t.Qa;"number"==typeof r?void 0===t.T?n.J("v",r):n.J("vi",r,[t.T]):r(void 0===t.T?null:t.T)}}}I!==w&&(w=I),assert("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&!!new Int32Array(1).subarray&&!!new Int32Array(1).set,"JS engine does not provide full typed array support"),buffer=new ArrayBuffer(w),D=new Int8Array(buffer),E=new Int16Array(buffer),F=new Int32Array(buffer),H=new Uint8Array(buffer),Ha=new Uint16Array(buffer),Ia=new Uint32Array(buffer),ra=new Float32Array(buffer),sa=new Float64Array(buffer),F[0]=255,assert(255===H[0]&&0===H[3],"Typed arrays 2 must be run on a little-endian system"),e.HEAP=void 0,e.buffer=buffer,e.HEAP8=D,e.HEAP16=E,e.HEAP32=F,e.HEAPU8=H,e.HEAPU16=Ha,e.HEAPU32=Ia,e.HEAPF32=ra,e.HEAPF64=sa;var Pa=[],Qa=[],Ra=[],K=[],Sa=[],xa=!1;function Ta(e){Pa.unshift(e)}function Ua(e){Sa.unshift(e)}function Va(e,t,n){return e=Aa(e,n=Array(0<n?n:Ba(e)+1),0,n.length),t&&(n.length=e),n}function ka(e,t,n){for(e=Va(e,n),n=0;n<e.length;)D[t+n>>0]=e[n],n+=1}function ja(e,t){for(var n=0;n<e.length;n++)D[t++>>0]=e[n]}function ya(e,t,n){for(var r=0;r<e.length;++r)D[t++>>0]=e.charCodeAt(r);n||(D[t>>0]=0)}e.addOnPreRun=Ta,e.addOnInit=function(e){Qa.unshift(e)},e.addOnPreMain=function(e){Ra.unshift(e)},e.addOnExit=function(e){K.unshift(e)},e.addOnPostRun=Ua,e.intArrayFromString=Va,e.intArrayToString=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];255<r&&(r&=255),t.push(String.fromCharCode(r))}return t.join("")},e.writeStringToMemory=ka,e.writeArrayToMemory=ja,e.writeAsciiToMemory=ya,Math.imul&&-5===Math.imul(4294967295,5)||(Math.imul=function(e,t){var n=65535&e,r=65535&t;return n*r+((e>>>16)*r+n*(t>>>16)<<16)|0}),Math.td=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;32>t;t++)if(e&1<<31-t)return t;return 32}),Math.kd=Math.clz32;var na=Math.abs,qa=Math.ceil,pa=Math.floor,oa=Math.min,L=0,Wa=null,Xa=null;function Ya(){L++,e.monitorRunDependencies&&e.monitorRunDependencies(L)}function Za(){if(L--,e.monitorRunDependencies&&e.monitorRunDependencies(L),0==L&&(null!==Wa&&(clearInterval(Wa),Wa=null),Xa)){var t=Xa;Xa=null,t()}}e.addRunDependency=Ya,e.removeRunDependency=Za,e.preloadedImages={},e.preloadedAudios={},Ja=8,p=Ja+1696,Qa.push(),G([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,164,2,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"i8",4,n.La);var $a=n.ea(G(12,"i8",2),8);function eb(e,t){K.push((function(){n.J("vi",e,[t])})),eb.level=K.length}assert(0==$a%8),e._bitshift64Ashr=ab,e._i64Subtract=bb,e._i64Add=cb,e._memset=db,e._bitshift64Lshr=fb,e._bitshift64Shl=gb;var M={G:1,B:2,Qc:3,Nb:4,F:5,sa:6,gb:7,kc:8,Z:9,ub:10,oa:11,$c:11,Ka:12,Y:13,Gb:14,wc:15,$:16,pa:17,ad:18,ba:19,qa:20,N:21,u:22,fc:23,Ja:24,O:25,Xc:26,Hb:27,sc:28,da:29,Nc:30,Zb:31,Gc:32,Db:33,Kc:34,oc:42,Kb:43,vb:44,Qb:45,Rb:46,Sb:47,Yb:48,Yc:49,ic:50,Pb:51,Ab:35,lc:37,mb:52,pb:53,bd:54,gc:55,qb:56,rb:57,Bb:35,sb:59,uc:60,jc:61,Uc:62,tc:63,pc:64,qc:65,Mc:66,mc:67,jb:68,Rc:69,wb:70,Hc:71,ac:72,Eb:73,ob:74,Bc:76,nb:77,Lc:78,Tb:79,Ub:80,Xb:81,Wb:82,Vb:83,vc:38,ra:39,bc:36,aa:40,Cc:95,Fc:96,zb:104,hc:105,kb:97,Jc:91,zc:88,rc:92,Oc:108,yb:111,hb:98,xb:103,ec:101,cc:100,Vc:110,Ib:112,Jb:113,Mb:115,lb:114,Cb:89,$b:90,Ic:93,Pc:94,ib:99,dc:102,Ob:106,xc:107,Wc:109,Zc:87,Fb:122,Sc:116,Ac:95,nc:123,Lb:84,Dc:75,tb:125,yc:131,Ec:130,Tc:86},hb={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function ib(t){return e.___errno_location&&(F[e.___errno_location()>>2]=t),t}function jb(e,t){for(var n=0,r=e.length-1;0<=r;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function N(e){var t="/"===e.charAt(0),n="/"===e.substr(-1);return(e=jb(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e}function kb(e){var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&(t=t.substr(0,t.length-1)),e+t):"."}function lb(e){if("/"===e)return"/";var t=e.lastIndexOf("/");return-1===t?e:e.substr(t+1)}function mb(){for(var e="",t=!1,n=arguments.length-1;-1<=n&&!t;n--){if("string"!=typeof(t=0<=n?arguments[n]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=jb(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."}var nb=[];function ob(e,t){nb[e]={input:[],output:[],L:t},pb(e,qb)}var qb={open:function(e){var t=nb[e.g.rdev];if(!t)throw new O(M.ba);e.tty=t,e.seekable=!1},close:function(e){e.tty.L.flush(e.tty)},flush:function(e){e.tty.L.flush(e.tty)},read:function(e,t,n,r){if(!e.tty||!e.tty.L.Ba)throw new O(M.sa);for(var i=0,a=0;a<r;a++){var o;try{o=e.tty.L.Ba(e.tty)}catch(e){throw new O(M.F)}if(void 0===o&&0===i)throw new O(M.oa);if(null==o)break;i++,t[n+a]=o}return i&&(e.g.timestamp=Date.now()),i},write:function(e,t,n,r){if(!e.tty||!e.tty.L.ja)throw new O(M.sa);for(var i=0;i<r;i++)try{e.tty.L.ja(e.tty,t[n+i])}catch(e){throw new O(M.F)}return r&&(e.g.timestamp=Date.now()),i}},rb={Ba:function(e){if(!e.input.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&(null!==(t=readline())&&(t+="\n")),!t)return null;e.input=Va(t,!0)}return e.input.shift()},ja:function(t,n){null===n||10===n?(e.print(za(t.output,0)),t.output=[]):0!=n&&t.output.push(n)},flush:function(t){t.output&&0<t.output.length&&(e.print(za(t.output,0)),t.output=[])}},sb={ja:function(t,n){null===n||10===n?(e.printErr(za(t.output,0)),t.output=[]):0!=n&&t.output.push(n)},flush:function(t){t.output&&0<t.output.length&&(e.printErr(za(t.output,0)),t.output=[])}},P={q:null,A:function(){return P.createNode(null,"/",16895,0)},createNode:function(e,t,n,r){if(24576==(61440&n)||4096==(61440&n))throw new O(M.G);return P.q||(P.q={dir:{g:{D:P.k.D,p:P.k.p,lookup:P.k.lookup,V:P.k.V,rename:P.k.rename,unlink:P.k.unlink,rmdir:P.k.rmdir,readdir:P.k.readdir,symlink:P.k.symlink},stream:{I:P.n.I}},file:{g:{D:P.k.D,p:P.k.p},stream:{I:P.n.I,read:P.n.read,write:P.n.write,ta:P.n.ta,Ea:P.n.Ea,Ga:P.n.Ga}},link:{g:{D:P.k.D,p:P.k.p,readlink:P.k.readlink},stream:{}},va:{g:{D:P.k.D,p:P.k.p},stream:tb}}),16384==(61440&(n=ub(e,t,n,r)).mode)?(n.k=P.q.dir.g,n.n=P.q.dir.stream,n.e={}):32768==(61440&n.mode)?(n.k=P.q.file.g,n.n=P.q.file.stream,n.o=0,n.e=null):40960==(61440&n.mode)?(n.k=P.q.link.g,n.n=P.q.link.stream):8192==(61440&n.mode)&&(n.k=P.q.va.g,n.n=P.q.va.stream),n.timestamp=Date.now(),e&&(e.e[t]=n),n},Sa:function(e){if(e.e&&e.e.subarray){for(var t=[],n=0;n<e.o;++n)t.push(e.e[n]);return t}return e.e},qd:function(e){return e.e?e.e.subarray?e.e.subarray(0,e.o):new Uint8Array(e.e):new Uint8Array},ya:function(e,t){if(e.e&&e.e.subarray&&t>e.e.length&&(e.e=P.Sa(e),e.o=e.e.length),!e.e||e.e.subarray){var n=e.e?e.e.buffer.byteLength:0;n>=t||(t=Math.max(t,n*(1048576>n?2:1.125)|0),0!=n&&(t=Math.max(t,256)),n=e.e,e.e=new Uint8Array(t),0<e.o&&e.e.set(n.subarray(0,e.o),0))}else for(!e.e&&0<t&&(e.e=[]);e.e.length<t;)e.e.push(0)},ab:function(e,t){if(e.o!=t)if(0==t)e.e=null,e.o=0;else{if(!e.e||e.e.subarray){var n=e.e;e.e=new Uint8Array(new ArrayBuffer(t)),n&&e.e.set(n.subarray(0,Math.min(t,e.o)))}else if(e.e||(e.e=[]),e.e.length>t)e.e.length=t;else for(;e.e.length<t;)e.e.push(0);e.o=t}},k:{D:function(e){var t={};return t.dev=8192==(61440&e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,16384==(61440&e.mode)?t.size=4096:32768==(61440&e.mode)?t.size=e.o:40960==(61440&e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.Pa=4096,t.blocks=Math.ceil(t.size/t.Pa),t},p:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&P.ab(e,t.size)},lookup:function(){throw vb[M.B]},V:function(e,t,n,r){return P.createNode(e,t,n,r)},rename:function(e,t,n){if(16384==(61440&e.mode)){var r;try{r=wb(t,n)}catch(e){}if(r)for(var i in r.e)throw new O(M.ra)}delete e.parent.e[e.name],e.name=n,t.e[n]=e,e.parent=t},unlink:function(e,t){delete e.e[t]},rmdir:function(e,t){var n,r=wb(e,t);for(n in r.e)throw new O(M.ra);delete e.e[t]},readdir:function(e){var t,n=[".",".."];for(t in e.e)e.e.hasOwnProperty(t)&&n.push(t);return n},symlink:function(e,t,n){return(e=P.createNode(e,t,41471,0)).link=n,e},readlink:function(e){if(40960!=(61440&e.mode))throw new O(M.u);return e.link}},n:{read:function(e,t,n,r,i){var a=e.g.e;if(i>=e.g.o)return 0;if(assert(0<=(e=Math.min(e.g.o-i,r))),8<e&&a.subarray)t.set(a.subarray(i,i+e),n);else for(r=0;r<e;r++)t[n+r]=a[i+r];return e},write:function(e,t,n,r,i,a){if(!r)return 0;if((e=e.g).timestamp=Date.now(),t.subarray&&(!e.e||e.e.subarray)){if(a)return e.e=t.subarray(n,n+r),e.o=r;if(0===e.o&&0===i)return e.e=new Uint8Array(t.subarray(n,n+r)),e.o=r;if(i+r<=e.o)return e.e.set(t.subarray(n,n+r),i),r}if(P.ya(e,i+r),e.e.subarray&&t.subarray)e.e.set(t.subarray(n,n+r),i);else for(a=0;a<r;a++)e.e[i+a]=t[n+a];return e.o=Math.max(e.o,i+r),r},I:function(e,t,n){if(1===n?t+=e.position:2===n&&32768==(61440&e.g.mode)&&(t+=e.g.o),0>t)throw new O(M.u);return t},ta:function(e,t,n){P.ya(e.g,t+n),e.g.o=Math.max(e.g.o,t+n)},Ea:function(e,t,n,r,i,a,o){if(32768!=(61440&e.g.mode))throw new O(M.ba);if(n=e.g.e,2&o||n.buffer!==t&&n.buffer!==t.buffer){if((0<i||i+r<e.g.o)&&(n=n.subarray?n.subarray(i,i+r):Array.prototype.slice.call(n,i,i+r)),e=!0,!(r=ua(r)))throw new O(M.Ka);t.set(n,r)}else e=!1,r=n.byteOffset;return{Cd:r,gd:e}},Ga:function(e,t,n,r,i){if(32768!=(61440&e.g.mode))throw new O(M.ba);return 2&i||P.n.write(e,t,0,r,n,!1),0}}};G(1,"i32*",2),G(1,"i32*",2),G(1,"i32*",2);var xb=null,yb=[null],zb=[],Ab=1,R=null,Cb=!0,S={},O=null,vb={};function T(e,t){if(t=t||{},!(e=mb("/",e)))return{path:"",g:null};var n,r={za:!0,ka:0};for(n in r)void 0===t[n]&&(t[n]=r[n]);if(8<t.ka)throw new O(M.aa);r=jb(e.split("/").filter((function(e){return!!e})),!1);var i=xb;n="/";for(var a=0;a<r.length;a++){var o=a===r.length-1;if(o&&t.parent)break;if(i=wb(i,r[a]),n=N(n+"/"+r[a]),i.R&&(!o||o&&t.za)&&(i=i.R.root),!o||t.ga)for(o=0;40960==(61440&i.mode);)if(i=Db(n),i=T(n=mb(kb(n),i),{ka:t.ka}).g,40<o++)throw new O(M.aa)}return{path:n,g:i}}function U(e){for(var t;;){if(e===e.parent)return e=e.A.Fa,t?"/"!==e[e.length-1]?e+"/"+t:e+t:e;t=t?e.name+"/"+t:e.name,e=e.parent}}function Eb(e,t){for(var n=0,r=0;r<t.length;r++)n=(n<<5)-n+t.charCodeAt(r)|0;return(e+n>>>0)%R.length}function Fb(e){var t=Eb(e.parent.id,e.name);e.K=R[t],R[t]=e}function wb(e,t){var n;if(n=(n=Gb(e,"x"))?n:e.k.lookup?0:M.Y)throw new O(n,e);for(n=R[Eb(e.id,t)];n;n=n.K){var r=n.name;if(n.parent.id===e.id&&r===t)return n}return e.k.lookup(e,t)}function ub(e,t,n,r){return Hb||((Hb=function(e,t,n,r){e||(e=this),this.parent=e,this.A=e.A,this.R=null,this.id=Ab++,this.name=t,this.mode=n,this.k={},this.n={},this.rdev=r}).prototype={},Object.defineProperties(Hb.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},Xa:{get:function(){return 16384==(61440&this.mode)}},Ca:{get:function(){return 8192==(61440&this.mode)}}})),Fb(e=new Hb(e,t,n,r)),e}var Ib={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218};function Gb(e,t){return Cb||(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:M.Y}function Jb(e,t){try{return wb(e,t),M.pa}catch(e){}return Gb(e,"wx")}function Kb(){for(var e=0;e<=4096;e++)if(!zb[e])return e;throw new O(M.Ja)}function Lb(e){Mb||((Mb=function(){}).prototype={},Object.defineProperties(Mb.prototype,{object:{get:function(){return this.g},set:function(e){this.g=e}},vd:{get:function(){return 1!=(2097155&this.flags)}},wd:{get:function(){return 0!=(2097155&this.flags)}},ud:{get:function(){return 1024&this.flags}}}));var t,n=new Mb;for(t in e)n[t]=e[t];return e=n,n=Kb(),e.fd=n,zb[n]=e}var tb={open:function(e){e.n=yb[e.g.rdev].n,e.n.open&&e.n.open(e)},I:function(){throw new O(M.da)}},Zb;function pb(e,t){yb[e]={n:t}}function Nb(e,t){var n,r="/"===t,i=!t;if(r&&xb)throw new O(M.$);if(!r&&!i){if(t=(n=T(t,{za:!1})).path,(n=n.g).R)throw new O(M.$);if(16384!=(61440&n.mode))throw new O(M.qa)}i={type:e,Ad:{},Fa:t,Ya:[]};var a=e.A(i);a.A=i,i.root=a,r?xb=a:n&&(n.R=i,n.A&&n.A.Ya.push(i))}function Ob(e,t,n){var r=T(e,{parent:!0}).g;if(!(e=lb(e))||"."===e||".."===e)throw new O(M.u);var i=Jb(r,e);if(i)throw new O(i);if(!r.k.V)throw new O(M.G);return r.k.V(r,e,t,n)}function Pb(e,t){return t=4095&(void 0!==t?t:438),Ob(e,t|=32768,0)}function V(e,t){return t=1023&(void 0!==t?t:511),Ob(e,t|=16384,0)}function Qb(e,t,n){return void 0===n&&(n=t,t=438),Ob(e,8192|t,n)}function Rb(e,t){if(!mb(e))throw new O(M.B);var n=T(t,{parent:!0}).g;if(!n)throw new O(M.B);var r=lb(t),i=Jb(n,r);if(i)throw new O(i);if(!n.k.symlink)throw new O(M.G);return n.k.symlink(n,r,e)}function Db(e){if(!(e=T(e).g))throw new O(M.B);if(!e.k.readlink)throw new O(M.u);return mb(U(e.parent),e.k.readlink(e))}function Sb(e,t){var n;if(!(n="string"==typeof e?T(e,{ga:!0}).g:e).k.p)throw new O(M.G);n.k.p(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})}function Tb(t,n){var r,i,a;if(""===t)throw new O(M.B);if("string"==typeof n){if(void 0===(i=Ib[n]))throw Error("Unknown file open mode: "+n)}else i=n;if(r=64&(n=i)?4095&(void 0===r?438:r)|32768:0,"object"==typeof t)a=t;else{t=N(t);try{a=T(t,{ga:!(131072&n)}).g}catch(e){}}if(i=!1,64&n)if(a){if(128&n)throw new O(M.pa)}else a=Ob(t,r,0),i=!0;if(!a)throw new O(M.B);if(8192==(61440&a.mode)&&(n&=-513),65536&n&&16384!=(61440&a.mode))throw new O(M.qa);if(!i&&(a?40960==(61440&a.mode)?r=M.aa:16384==(61440&a.mode)&&(0!=(2097155&n)||512&n)?r=M.N:(r=["r","w","rw"][3&n],512&n&&(r+="w"),r=Gb(a,r)):r=M.B,r))throw new O(r);if(512&n){var o;if(!(o="string"==typeof(r=a)?T(r,{ga:!0}).g:r).k.p)throw new O(M.G);if(16384==(61440&o.mode))throw new O(M.N);if(32768!=(61440&o.mode))throw new O(M.u);if(r=Gb(o,"w"))throw new O(r);o.k.p(o,{size:0,timestamp:Date.now()})}n&=-641,(a=Lb({g:a,path:U(a),flags:n,seekable:!0,position:0,n:a.n,eb:[],error:!1})).n.open&&a.n.open(a),!e.logReadFiles||1&n||(Ub||(Ub={}),t in Ub||(Ub[t]=1,e.printErr("read file: "+t)));try{S.onOpenFile&&(o=0,1!=(2097155&n)&&(o|=1),0!=(2097155&n)&&(o|=2),S.onOpenFile(t,o))}catch(e){console.log("FS.trackingDelegate['onOpenFile']('"+t+"', flags) threw an exception: "+e.message)}return a}function Vb(e){e.ia&&(e.ia=null);try{e.n.close&&e.n.close(e)}catch(e){throw e}finally{zb[e.fd]=null}}function Wb(e,t,n){if(!e.seekable||!e.n.I)throw new O(M.da);e.position=e.n.I(e,t,n),e.eb=[]}function Xb(e,t,n,r,i,a){if(0>r||0>i)throw new O(M.u);if(0==(2097155&e.flags))throw new O(M.Z);if(16384==(61440&e.g.mode))throw new O(M.N);if(!e.n.write)throw new O(M.u);1024&e.flags&&Wb(e,0,2);var o=!0;if(void 0===i)i=e.position,o=!1;else if(!e.seekable)throw new O(M.da);t=e.n.write(e,t,n,r,i,a),o||(e.position+=t);try{e.path&&S.onWriteToFile&&S.onWriteToFile(e.path)}catch(e){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+e.message)}return t}function Yb(){O||((O=function(e,t){this.g=t,this.bb=function(e){for(var t in this.Q=e,M)if(M[t]===e){this.code=t;break}},this.bb(e),this.message=hb[e]}).prototype=Error(),O.prototype.constructor=O,[M.B].forEach((function(e){vb[e]=new O(e),vb[e].stack="<generic error, no stack>"})))}function $b(e,t){var n=0;return e&&(n|=365),t&&(n|=146),n}function ac(e,t,n,r){return Pb(e=N(("string"==typeof e?e:U(e))+"/"+t),$b(n,r))}function bc(e,t,n,r,i,a){if(i=Pb(e=t?N(("string"==typeof e?e:U(e))+"/"+t):e,r=$b(r,i)),n){if("string"==typeof n){e=Array(n.length),t=0;for(var o=n.length;t<o;++t)e[t]=n.charCodeAt(t);n=e}Sb(i,146|r),Xb(e=Tb(i,"w"),n,0,n.length,0,a),Vb(e),Sb(i,r)}return i}function W(e,t,n,r){e=N(("string"==typeof e?e:U(e))+"/"+t),t=$b(!!n,!!r),W.Da||(W.Da=64);var i=W.Da++<<8|0;return pb(i,{open:function(e){e.seekable=!1},close:function(){r&&r.buffer&&r.buffer.length&&r(10)},read:function(e,t,r,i){for(var a=0,o=0;o<i;o++){var s;try{s=n()}catch(e){throw new O(M.F)}if(void 0===s&&0===a)throw new O(M.oa);if(null==s)break;a++,t[r+o]=s}return a&&(e.g.timestamp=Date.now()),a},write:function(e,t,n,i){for(var a=0;a<i;a++)try{r(t[n+a])}catch(e){throw new O(M.F)}return i&&(e.g.timestamp=Date.now()),a}}),Qb(e,t,i)}function cc(t){if(t.Ca||t.Xa||t.link||t.e)return!0;var n=!0;if("undefined"!=typeof XMLHttpRequest)throw Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!e.read)throw Error("Cannot load without read() or XMLHttpRequest.");try{t.e=Va(e.read(t.url),!0),t.o=t.e.length}catch(e){n=!1}return n||ib(M.F),n}var dc={},Hb,Mb,Ub,ec=0;function X(){return F[(ec+=4)-4>>2]}function fc(){var e;if(e=X(),!(e=zb[e]))throw new O(M.Z);return e}function wa(e){wa.C||(v=Ga(),wa.C=!0,assert(n.P),wa.Ra=n.P,n.P=function(){z("cannot dynamically allocate, sbrk now has control")});var t=v;return 0==e||wa.Ra(e)?t:4294967295}function hc(e,t){if(ic=e,jc=t,!kc)return 1;if(0==e)Y=function(){setTimeout(lc,t)},mc="timeout";else if(1==e)Y=function(){nc(lc)},mc="rAF";else if(2==e){if(!window.setImmediate){var n=[];window.addEventListener("message",(function(e){e.source===window&&"__emcc"===e.data&&(e.stopPropagation(),n.shift()())}),!0),window.setImmediate=function(e){n.push(e),window.postMessage("__emcc","*")}}Y=function(){window.setImmediate(lc)},mc="immediate"}return 0}function oc(t,r,i,a,o){e.noExitRuntime=!0,assert(!kc,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),kc=t,pc=a;var s=qc;if(lc=function(){if(!A)if(0<rc.length){var r=Date.now(),i=rc.shift();if(i.Qa(i.T),sc){var o=sc,l=0==o%1?o-1:Math.floor(o);sc=i.ld?l:(8*o+(l+.5))/9}console.log('main loop blocker "'+i.name+'" took '+(Date.now()-r)+" ms"),tc(),setTimeout(lc,0)}else s<qc||(uc=uc+1|0,1==ic&&1<jc&&0!=uc%jc?Y():("timeout"===mc&&e.fa&&(e.S("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),mc=""),vc((function(){void 0!==a?n.J("vi",t,[a]):n.J("v",t)})),s<qc||("object"==typeof SDL&&SDL.audio&&SDL.audio.Za&&SDL.audio.Za(),Y())))},o||(r&&0<r?hc(0,1e3/r):hc(1,1),Y()),i)throw"SimulateInfiniteLoop"}e._memcpy=gc;var Y=null,mc="",qc=0,kc=null,pc=0,ic=0,jc=0,uc=0,rc=[];function tc(){if(e.setStatus){var t=e.statusMessage||"Please wait...",n=sc,r=wc.nd;n?n<r?e.setStatus(t+" ("+(r-n)+"/"+r+")"):e.setStatus(t):e.setStatus("")}}function vc(t){if(!(A||e.preMainLoop&&!1===e.preMainLoop())){try{t()}catch(t){if(t instanceof xc)return;throw t&&"object"==typeof t&&t.stack&&e.S("exception thrown: "+[t,t.stack]),t}e.postMainLoop&&e.postMainLoop()}}var wc={},lc,sc,yc=!1,zc=!1,Ac=[];function Bc(){function t(){zc=document.pointerLockElement===r||document.mozPointerLockElement===r||document.webkitPointerLockElement===r||document.msPointerLockElement===r}if(e.preloadPlugins||(e.preloadPlugins=[]),!Cc){Cc=!0;try{Dc=!0}catch(e){Dc=!1,console.log("warning: no blob constructor, cannot create blobs with mimetypes")}Ec="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:Dc?null:console.log("warning: no BlobBuilder"),Fc="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,e.Ha||void 0!==Fc||(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),e.Ha=!0),e.preloadPlugins.push({canHandle:function(t){return!e.Ha&&/\.(jpg|jpeg|png|bmp)$/i.test(t)},handle:function(t,r,i,a){var o=null;if(Dc)try{(o=new Blob([t],{type:Gc(r)})).size!==t.length&&(o=new Blob([new Uint8Array(t).buffer],{type:Gc(r)}))}catch(e){n.M("Blob constructor present but fails: "+e+"; falling back to blob builder")}o||((o=new Ec).append(new Uint8Array(t).buffer),o=o.getBlob());var s=Fc.createObjectURL(o),l=new Image;l.onload=function(){assert(l.complete,"Image "+r+" could not be decoded");var n=document.createElement("canvas");n.width=l.width,n.height=l.height,n.getContext("2d").drawImage(l,0,0),e.preloadedImages[r]=n,Fc.revokeObjectURL(s),i&&i(t)},l.onerror=function(){console.log("Image "+s+" could not be decoded"),a&&a()},l.src=s}}),e.preloadPlugins.push({canHandle:function(t){return!e.zd&&t.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(t,n,r,i){function a(i){s||(s=!0,e.preloadedAudios[n]=i,r&&r(t))}function o(){s||(s=!0,e.preloadedAudios[n]=new Audio,i&&i())}var s=!1;if(!Dc)return o();try{var l=new Blob([t],{type:Gc(n)})}catch(e){return o()}l=Fc.createObjectURL(l);var u=new Audio;u.addEventListener("canplaythrough",(function(){a(u)}),!1),u.onerror=function(){if(!s){console.log("warning: browser could not fully decode audio "+n+", trying slower base64 approach");for(var e="",r=0,i=0,o=0;o<t.length;o++)for(r=r<<8|t[o],i+=8;6<=i;){var l=r>>i-6&63;i=i-6,e=e+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[l]}2==i?(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&r)<<4],e+="=="):4==i&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&r)<<2],e+="="),u.src="data:audio/x-"+n.substr(-3)+";base64,"+e,a(u)}},u.src=l,Hc((function(){a(u)}))}});var r=e.canvas;r&&(r.la=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.wa=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.wa=r.wa.bind(document),document.addEventListener("pointerlockchange",t,!1),document.addEventListener("mozpointerlockchange",t,!1),document.addEventListener("webkitpointerlockchange",t,!1),document.addEventListener("mspointerlockchange",t,!1),e.elementPointerLock&&r.addEventListener("click",(function(e){!zc&&r.la&&(r.la(),e.preventDefault())}),!1))}}function Ic(t,n,r,i){if(n&&e.fa&&t==e.canvas)return e.fa;var a,o;if(n){if(o={antialias:!1,alpha:!1},i)for(var s in i)o[s]=i[s];(o=GL.createContext(t,o))&&(a=GL.getContext(o).cd),t.style.backgroundColor="black"}else a=t.getContext("2d");return a?(r&&(n||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),e.fa=a,n&&GL.yd(o),e.Dd=n,Ac.forEach((function(e){e()})),Bc()),a):null}var Jc=!1,Kc=void 0,Lc=void 0;function Mc(t,n,r){function i(){yc=!1;var t=a.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===t?(a.ua=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},a.ua=a.ua.bind(document),Kc&&a.la(),yc=!0,Lc&&Nc()):(t.parentNode.insertBefore(a,t),t.parentNode.removeChild(t),Lc&&Oc()),e.onFullScreen&&e.onFullScreen(yc),Pc(a)}void 0===(Kc=t)&&(Kc=!0),void 0===(Lc=n)&&(Lc=!1),void 0===(Qc=r)&&(Qc=null);var a=e.canvas;Jc||(Jc=!0,document.addEventListener("fullscreenchange",i,!1),document.addEventListener("mozfullscreenchange",i,!1),document.addEventListener("webkitfullscreenchange",i,!1),document.addEventListener("MSFullscreenChange",i,!1));var o=document.createElement("div");a.parentNode.insertBefore(o,a),o.appendChild(a),o.C=o.requestFullScreen||o.mozRequestFullScreen||o.msRequestFullscreen||(o.webkitRequestFullScreen?function(){o.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),r?o.C({Ed:r}):o.C()}var Rc=0;function Sc(e){var t=Date.now();if(0===Rc)Rc=t+1e3/60;else for(;t+2>=Rc;)Rc+=1e3/60;t=Math.max(Rc-t,0),setTimeout(e,t)}function nc(e){"undefined"==typeof window?Sc(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||Sc),window.requestAnimationFrame(e))}function Hc(t){e.noExitRuntime=!0,setTimeout((function(){A||t()}),1e4)}function Gc(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]}function Tc(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)}function Uc(e,t,n){Tc(e,(function(n){assert(n,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(n)),Za()}),(function(){if(!n)throw'Loading data file "'+e+'" failed.';n()})),Ya()}var Vc=[],Cc,Dc,Ec,Fc,Qc;function Wc(){var t=e.canvas;Vc.forEach((function(e){e(t.width,t.height)}))}function Nc(){if("undefined"!=typeof SDL){var e=Ia[SDL.screen+0*n.H>>2];F[SDL.screen+0*n.H>>2]=8388608|e}Wc()}function Oc(){if("undefined"!=typeof SDL){var e=Ia[SDL.screen+0*n.H>>2];F[SDL.screen+0*n.H>>2]=-8388609&e}Wc()}function Pc(t,n,r){n&&r?(t.fb=n,t.Va=r):(n=t.fb,r=t.Va);var i=n,a=r;if(e.forcedAspectRatio&&0<e.forcedAspectRatio&&(i/a<e.forcedAspectRatio?i=Math.round(a*e.forcedAspectRatio):a=Math.round(i/e.forcedAspectRatio)),(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===t.parentNode&&"undefined"!=typeof screen){var o=Math.min(screen.width/i,screen.height/a);i=Math.round(i*o),a=Math.round(a*o)}Lc?(t.width!=i&&(t.width=i),t.height!=a&&(t.height=a),void 0!==t.style&&(t.style.removeProperty("width"),t.style.removeProperty("height"))):(t.width!=n&&(t.width=n),t.height!=r&&(t.height=r),void 0!==t.style&&(i!=n||a!=r?(t.style.setProperty("width",i+"px","important"),t.style.setProperty("height",a+"px","important")):(t.style.removeProperty("width"),t.style.removeProperty("height"))))}Yb(),R=Array(4096),Nb(P,"/"),V("/tmp"),V("/home"),V("/home/web_user"),function(){var e;if(V("/dev"),pb(259,{read:function(){return 0},write:function(e,t,n,r){return r}}),Qb("/dev/null",259),ob(1280,rb),ob(1536,sb),Qb("/dev/tty",1280),Qb("/dev/tty1",1536),"undefined"!=typeof crypto){var t=new Uint8Array(1);e=function(){return crypto.getRandomValues(t),t[0]}}else e=function(){return 256*Math.random()|0};W("/dev","random",e),W("/dev","urandom",e),V("/dev/shm"),V("/dev/shm/tmp")}(),V("/proc"),V("/proc/self"),V("/proc/self/fd"),Nb({A:function(){var e=ub("/proc/self","fd",16895,73);return e.k={lookup:function(e,t){var n=zb[+t];if(!n)throw new O(M.Z);var r={parent:null,A:{Fa:"fake"},k:{readlink:function(){return n.path}}};return r.parent=r}},e}},"/proc/self/fd"),Qa.unshift((function(){if(!e.noFSInit&&!Zb){assert(!Zb,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),Zb=!0,Yb(),e.stdin=e.stdin,e.stdout=e.stdout,e.stderr=e.stderr,e.stdin?W("/dev","stdin",e.stdin):Rb("/dev/tty","/dev/stdin"),e.stdout?W("/dev","stdout",null,e.stdout):Rb("/dev/tty","/dev/stdout"),e.stderr?W("/dev","stderr",null,e.stderr):Rb("/dev/tty1","/dev/stderr");var t=Tb("/dev/stdin","r");assert(0===t.fd,"invalid handle for stdin ("+t.fd+")"),assert(1===(t=Tb("/dev/stdout","w")).fd,"invalid handle for stdout ("+t.fd+")"),assert(2===(t=Tb("/dev/stderr","w")).fd,"invalid handle for stderr ("+t.fd+")")}})),Ra.push((function(){Cb=!1})),K.push((function(){Zb=!1;var t=e._fflush;for(t&&t(0),t=0;t<zb.length;t++){var n=zb[t];n&&Vb(n)}})),e.FS_createFolder=function(e,t,n,r){return V(e=N(("string"==typeof e?e:U(e))+"/"+t),$b(n,r))},e.FS_createPath=function(e,t){e="string"==typeof e?e:U(e);for(var n=t.split("/").reverse();n.length;){var r=n.pop();if(r){var i=N(e+"/"+r);try{V(i)}catch(e){}e=i}}return i},e.FS_createDataFile=bc,e.FS_createPreloadedFile=function(t,n,r,i,a,o,s,l,u,c){function d(r){function d(e){c&&c(),l||bc(t,n,e,i,a,u),o&&o(),Za()}var _=!1;e.preloadPlugins.forEach((function(e){!_&&e.canHandle(p)&&(e.handle(r,p,d,(function(){s&&s(),Za()})),_=!0)})),_||d(r)}Bc();var p=n?mb(N(t+"/"+n)):t;Ya(),"string"==typeof r?Uc(r,(function(e){d(e)}),s):d(r)},e.FS_createLazyFile=function(e,t,n,r,i){if("undefined"!=typeof XMLHttpRequest)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";n={Ca:!1,url:n};var a=ac(e,t,r,i);n.e?a.e=n.e:n.url&&(a.e=null,a.url=n.url),Object.defineProperty(a,"usedBytes",{get:function(){return this.e.length}});var o={};return Object.keys(a.n).forEach((function(e){var t=a.n[e];o[e]=function(){if(!cc(a))throw new O(M.F);return t.apply(null,arguments)}})),o.read=function(e,t,n,r,i){if(!cc(a))throw new O(M.F);if(i>=(e=e.g.e).length)return 0;if(assert(0<=(r=Math.min(e.length-i,r))),e.slice)for(var o=0;o<r;o++)t[n+o]=e[i+o];else for(o=0;o<r;o++)t[n+o]=e.get(i+o);return r},a.n=o,a},e.FS_createLink=function(e,t,n){return Rb(n,e=N(("string"==typeof e?e:U(e))+"/"+t))},e.FS_createDevice=W,e.FS_unlink=function(e){var t,n=T(e,{parent:!0}).g,r=lb(e),i=wb(n,r);e:{try{t=wb(n,r)}catch(e){t=e.Q;break e}var a=Gb(n,"wx");t=a||(16384==(61440&t.mode)?M.N:0)}if(t)throw t===M.N&&(t=M.G),new O(t);if(!n.k.unlink)throw new O(M.G);if(i.R)throw new O(M.$);try{S.willDeletePath&&S.willDeletePath(e)}catch(t){console.log("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+t.message)}if(n.k.unlink(n,r),n=Eb(i.parent.id,i.name),R[n]===i)R[n]=i.K;else for(n=R[n];n;){if(n.K===i){n.K=i.K;break}n=n.K}try{S.onDeletePath&&S.onDeletePath(e)}catch(t){console.log("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+t.message)}},Qa.unshift((function(){})),K.push((function(){})),e.requestFullScreen=function(e,t,n){Mc(e,t,n)},e.requestAnimationFrame=function(e){nc(e)},e.setCanvasSize=function(t,n,r){Pc(e.canvas,t,n),r||Wc()},e.pauseMainLoop=function(){Y=null,qc++},e.resumeMainLoop=function(){qc++;var e=ic,t=jc,n=kc;kc=null,oc(n,0,!1,pc,!0),hc(e,t),Y()},e.getUserMedia=function(){window.C||(window.C=navigator.getUserMedia||navigator.mozGetUserMedia),window.C(void 0)},e.createContext=function(e,t,n,r){return Ic(e,t,n,r)},Ka=m=n.ea(p),va=!0,La=Ka+Na,Ma=v=n.ea(La),assert(Ma<w,"TOTAL_MEMORY not big enough for stack");var Xc=G([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",3);e.Na={Math,Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array,Float32Array,Float64Array,NaN:NaN,Infinity:1/0},e.Oa={abort:z,assert,invoke_ii:function(t,n){try{return e.dynCall_ii(t,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Z.setThrew(1,0)}},invoke_iiii:function(t,n,r,i){try{return e.dynCall_iiii(t,n,r,i)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Z.setThrew(1,0)}},invoke_vi:function(t,n){try{e.dynCall_vi(t,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;Z.setThrew(1,0)}},_pthread_cleanup_pop:function(){assert(eb.level==K.length,"cannot pop if something else added meanwhile!"),K.pop(),eb.level=K.length},___lock:function(){},_emscripten_set_main_loop:oc,_pthread_self:function(){return 0},___syscall6:function(e,t){ec=t;try{return Vb(fc()),0}catch(e){return void 0!==dc&&e instanceof O||z(e),-e.Q}},_emscripten_set_main_loop_timing:hc,_abort:function(){e.abort()},_sbrk:wa,_time:function(e){var t=Date.now()/1e3|0;return e&&(F[e>>2]=t),t},___setErrNo:ib,_emscripten_memcpy_big:function(e,t,n){return H.set(H.subarray(t,t+n),e),e},___syscall54:function(e,t){ec=t;try{var n=fc(),r=X();switch(r){case 21505:case 21506:return n.tty?0:-M.O;case 21519:if(!n.tty)return-M.O;var i=X();return F[i>>2]=0;case 21520:return n.tty?-M.u:-M.O;case 21531:if(i=X(),!n.n.Wa)throw new O(M.O);return n.n.Wa(n,r,i);default:z("bad ioctl syscall "+r)}}catch(e){return void 0!==dc&&e instanceof O||z(e),-e.Q}},___unlock:function(){},___syscall140:function(e,t){ec=t;try{var n=fc(),r=X(),i=X(),a=X(),o=X();return assert(0===r),Wb(n,i,o),F[a>>2]=n.position,n.ia&&0===i&&0===o&&(n.ia=null),0}catch(e){return void 0!==dc&&e instanceof O||z(e),-e.Q}},_pthread_cleanup_push:eb,_sysconf:function(e){switch(e){case 30:return 4096;case 85:return I/4096;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return ib(M.u),-1},___syscall146:function(e,t){ec=t;try{var n,r=fc(),i=X();e:{for(var a=X(),o=0,s=0;s<a;s++){var l=Xb(r,D,F[i+8*s>>2],F[i+(8*s+4)>>2],void 0);if(0>l){n=-1;break e}o+=l}n=o}return n}catch(e){return void 0!==dc&&e instanceof O||z(e),-e.Q}},STACKTOP:m,STACK_MAX:La,tempDoublePtr:$a,ABORT:A,cttz_i8:Xc};var Z=function(e,t,n){var r=new e.Int8Array(n),i=(new e.Int16Array(n),new e.Int32Array(n)),a=new e.Uint8Array(n),o=(new e.Uint16Array(n),new e.Uint32Array(n),new e.Float32Array(n),new e.Float64Array(n),0|t.STACKTOP),s=(t.STACK_MAX,t.tempDoublePtr,t.ABORT,t.cttz_i8,0),l=(e.NaN,e.Infinity,0),u=(e.Math.floor,e.Math.abs,e.Math.sqrt,e.Math.pow,e.Math.cos,e.Math.sin,e.Math.tan,e.Math.acos,e.Math.asin,e.Math.atan,e.Math.atan2,e.Math.exp,e.Math.log,e.Math.ceil,e.Math.imul),c=(e.Math.min,e.Math.clz32,t.abort),d=(t.assert,t.invoke_ii,t.invoke_iiii,t.invoke_vi,t._pthread_cleanup_pop),p=t.___lock,_=(t._emscripten_set_main_loop,t._pthread_self),f=t.___syscall6,h=(t._emscripten_set_main_loop_timing,t._abort),g=t._sbrk,m=t._time,y=(t.___setErrNo,t._emscripten_memcpy_big),E=t.___syscall54,S=t.___unlock,T=t.___syscall140,v=t._pthread_cleanup_push,A=t._sysconf,C=t.___syscall146;function P(e,t,n){e|=0;var r,a=0,s=0,u=0,c=0,d=0,p=0,_=0,f=0,h=0,g=0,m=0;r=o,o=o+160|0,O(a=r,t|=0,n|=0),t=0|i[(n=a+144|0)>>2],s=0|i[n+4>>2],c=0|i[(u=n=a+64|0)>>2],d=0|i[u+4>>2],u=0|F(0|t,0|s,18,0),p=l,_=0|U(0|c,0|d,0|t,0|s),s=0|U(0|_,0|l,0|u,0|p),i[(p=n)>>2]=s,i[p+4>>2]=l,s=0|i[(p=a+136|0)>>2],n=0|i[p+4>>2],_=0|i[(u=p=a+56|0)>>2],t=0|i[u+4>>2],u=0|F(0|s,0|n,18,0),d=l,c=0|U(0|_,0|t,0|s,0|n),n=0|U(0|c,0|l,0|u,0|d),i[(d=p)>>2]=n,i[d+4>>2]=l,n=0|i[(d=a+128|0)>>2],p=0|i[d+4>>2],c=0|i[(u=d=a+48|0)>>2],s=0|i[u+4>>2],u=0|F(0|n,0|p,18,0),t=l,_=0|U(0|c,0|s,0|n,0|p),p=0|U(0|_,0|l,0|u,0|t),i[(t=d)>>2]=p,i[t+4>>2]=l,p=0|i[(t=a+120|0)>>2],d=0|i[t+4>>2],_=0|i[(u=t=a+40|0)>>2],n=0|i[u+4>>2],u=0|F(0|p,0|d,18,0),s=l,c=0|U(0|_,0|n,0|p,0|d),d=0|U(0|c,0|l,0|u,0|s),i[(s=t)>>2]=d,i[s+4>>2]=l,d=0|i[(s=a+112|0)>>2],t=0|i[s+4>>2],c=0|i[(u=s=a+32|0)>>2],p=0|i[u+4>>2],u=0|F(0|d,0|t,18,0),n=l,_=0|U(0|c,0|p,0|d,0|t),t=0|U(0|_,0|l,0|u,0|n),i[(n=s)>>2]=t,i[n+4>>2]=l,t=0|i[(n=a+104|0)>>2],s=0|i[n+4>>2],_=0|i[(u=n=a+24|0)>>2],d=0|i[u+4>>2],u=0|F(0|t,0|s,18,0),p=l,c=0|U(0|_,0|d,0|t,0|s),s=0|U(0|c,0|l,0|u,0|p),i[(p=n)>>2]=s,i[p+4>>2]=l,s=0|i[(p=a+96|0)>>2],n=0|i[p+4>>2],c=0|i[(u=p=a+16|0)>>2],t=0|i[u+4>>2],u=0|F(0|s,0|n,18,0),d=l,_=0|U(0|c,0|t,0|s,0|n),n=0|U(0|_,0|l,0|u,0|d),i[(d=p)>>2]=n,i[d+4>>2]=l,n=0|i[(d=a+88|0)>>2],p=0|i[d+4>>2],_=0|i[(u=d=a+8|0)>>2],s=0|i[u+4>>2],u=0|F(0|n,0|p,18,0),t=l,c=0|U(0|_,0|s,0|n,0|p),p=0|U(0|c,0|l,0|u,0|t),i[(t=d)>>2]=p,i[t+4>>2]=l,u=0|i[(p=t=a+80|0)>>2],c=0|i[p+4>>2],n=0|i[(p=a)>>2],s=0|i[p+4>>2],p=0|F(0|u,0|c,18,0),_=l,f=0|U(0|n,0|s,0|u,0|c),c=0|U(0|f,0|l,0|p,0|_),_=l,i[(p=a)>>2]=c,i[p+4>>2]=_,i[(p=t)>>2]=0,i[p+4>>2]=0,p=_,_=c,c=0;do{n=0|k(0|_,0|p,0|(s=0|B(0|(u=0|D(0|(f=0|U(p>>31>>>6|0,0,0|_,0|p)),0|l,26)),0|(f=l),26)),0|l),i[(s=a+(c<<3)|0)>>2]=n,i[s+4>>2]=l,m=0|k(0|(h=0|U(0|u,0|f,0|i[(n=s=a+((1|c)<<3)|0)>>2],0|i[n+4>>2])),0|(n=l),0|(g=0|B(0|(u=0|D(0|(f=0|U(n>>31>>>7|0,0,0|h,0|n)),0|l,25)),0|(f=l),25)),0|l),i[(g=s)>>2]=m,i[g+4>>2]=l,_=0|U(0|u,0|f,0|i[(m=g=a+((c=c+2|0)<<3)|0)>>2],0|i[m+4>>2]),p=l,i[(m=g)>>2]=_,i[m+4>>2]=p}while(c>>>0<10);p=0|i[(c=t)>>2],_=0|i[c+4>>2],m=0|i[(c=a)>>2],g=0|i[c+4>>2],c=0|F(0|p,0|_,18,0),f=l,u=0|U(0|m,0|g,0|p,0|_),_=0|U(0|u,0|l,0|c,0|f),f=l,i[(c=t)>>2]=0,i[c+4>>2]=0,p=0|k(0|_,0|f,0|(u=0|B(0|(t=0|D(0|(c=0|U(f>>31>>>6|0,0,0|_,0|f)),0|l,26)),0|(c=l),26)),0|l),i[(u=a)>>2]=p,i[u+4>>2]=l,p=0|U(0|t,0|c,0|i[(u=d)>>2],0|i[u+4>>2]),i[(u=d)>>2]=p,i[u+4>>2]=l,u=e,e=a,a=u+80|0;do{i[u>>2]=i[e>>2],u=u+4|0,e=e+4|0}while((0|u)<(0|a));o=r}function O(e,t,n){e|=0,n|=0;var r=0,a=0,o=0,s=0,u=0,c=0,d=0,p=0,_=0,f=0,h=0,g=0,m=0,y=0,E=0,S=0,T=0,v=0,A=0,C=0,P=0,O=0,I=0;r=0|D(0,0|i[(t|=0)>>2],32),a=l,s=0|F(0|(o=0|D(0,0|i[n>>2],32)),0|l,0|r,0|a),i[(a=e)>>2]=s,i[a+4>>2]=l,a=0|D(0,0|i[t>>2],32),s=l,u=0|F(0|(o=0|D(0,0|i[(r=n+8|0)>>2],32)),0|l,0|a,0|s),s=l,o=0|D(0,0|i[(a=t+8|0)>>2],32),c=l,c=0|U(0|(p=0|F(0|(d=0|D(0,0|i[n>>2],32)),0|l,0|o,0|c)),0|l,0|u,0|s),i[(s=e+8|0)>>2]=c,i[s+4>>2]=l,s=0|D(0,0|i[a>>2],31),c=l,p=0|F(0|(u=0|D(0,0|i[r>>2],32)),0|l,0|s,0|c),c=l,s=0|D(0,0|i[t>>2],32),u=l,u=0|U(0|(_=0|F(0|(d=0|D(0,0|i[(o=n+16|0)>>2],32)),0|l,0|s,0|u)),0|l,0|p,0|c),c=l,_=0|D(0,0|i[(p=t+16|0)>>2],32),s=l,s=0|U(0|u,0|c,0|(f=0|F(0|(d=0|D(0,0|i[n>>2],32)),0|l,0|_,0|s)),0|l),i[(f=e+16|0)>>2]=s,i[f+4>>2]=l,f=0|D(0,0|i[a>>2],32),s=l,u=0|F(0|(c=0|D(0,0|i[o>>2],32)),0|l,0|f,0|s),s=l,f=0|D(0,0|i[p>>2],32),c=l,c=0|U(0|(d=0|F(0|(_=0|D(0,0|i[r>>2],32)),0|l,0|f,0|c)),0|l,0|u,0|s),s=l,u=0|D(0,0|i[t>>2],32),d=l,d=0|U(0|c,0|s,0|(h=0|F(0|(_=0|D(0,0|i[(f=n+24|0)>>2],32)),0|l,0|u,0|d)),0|l),h=l,c=0|D(0,0|i[(s=t+24|0)>>2],32),u=l,u=0|U(0|d,0|h,0|(g=0|F(0|(_=0|D(0,0|i[n>>2],32)),0|l,0|c,0|u)),0|l),i[(g=e+24|0)>>2]=u,i[g+4>>2]=l,g=0|D(0,0|i[p>>2],32),u=l,d=0|F(0|(h=0|D(0,0|i[o>>2],32)),0|l,0|g,0|u),u=l,g=0|D(0,0|i[a>>2],32),h=l,_=0|F(0|(c=0|D(0,0|i[f>>2],32)),0|l,0|g,0|h),h=l,g=0|D(0,0|i[s>>2],32),c=l,c=0|U(0|(y=0|F(0|(m=0|D(0,0|i[r>>2],32)),0|l,0|g,0|c)),0|l,0|_,0|h),c=0|U(0|(h=0|B(0|c,0|l,1)),0|l,0|d,0|u),u=l,d=0|D(0,0|i[t>>2],32),h=l,h=0|U(0|c,0|u,0|(g=0|F(0|(y=0|D(0,0|i[(_=n+32|0)>>2],32)),0|l,0|d,0|h)),0|l),g=l,c=0|D(0,0|i[(u=t+32|0)>>2],32),d=l,d=0|U(0|h,0|g,0|(m=0|F(0|(y=0|D(0,0|i[n>>2],32)),0|l,0|c,0|d)),0|l),i[(m=e+32|0)>>2]=d,i[m+4>>2]=l,m=0|D(0,0|i[p>>2],32),d=l,h=0|F(0|(g=0|D(0,0|i[f>>2],32)),0|l,0|m,0|d),d=l,m=0|D(0,0|i[s>>2],32),g=l,g=0|U(0|(y=0|F(0|(c=0|D(0,0|i[o>>2],32)),0|l,0|m,0|g)),0|l,0|h,0|d),d=l,h=0|D(0,0|i[a>>2],32),y=l,y=0|U(0|g,0|d,0|(c=0|F(0|(m=0|D(0,0|i[_>>2],32)),0|l,0|h,0|y)),0|l),c=l,d=0|D(0,0|i[u>>2],32),g=l,g=0|U(0|y,0|c,0|(m=0|F(0|(h=0|D(0,0|i[r>>2],32)),0|l,0|d,0|g)),0|l),m=l,c=0|D(0,0|i[t>>2],32),y=l,y=0|U(0|g,0|m,0|(E=0|F(0|(h=0|D(0,0|i[(d=n+40|0)>>2],32)),0|l,0|c,0|y)),0|l),E=l,g=0|D(0,0|i[(m=t+40|0)>>2],32),c=l,c=0|U(0|y,0|E,0|(S=0|F(0|(h=0|D(0,0|i[n>>2],32)),0|l,0|g,0|c)),0|l),i[(S=e+40|0)>>2]=c,i[S+4>>2]=l,S=0|D(0,0|i[s>>2],32),c=l,y=0|F(0|(E=0|D(0,0|i[f>>2],32)),0|l,0|S,0|c),c=l,S=0|D(0,0|i[a>>2],32),E=l,E=0|U(0|(h=0|F(0|(g=0|D(0,0|i[d>>2],32)),0|l,0|S,0|E)),0|l,0|y,0|c),c=l,y=0|D(0,0|i[m>>2],32),h=l,g=0|B(0|(h=0|U(0|E,0|c,0|(g=0|F(0|(S=0|D(0,0|i[r>>2],32)),0|l,0|y,0|h)),0|l)),0|l,1),h=l,c=0|D(0,0|i[p>>2],32),E=l,E=0|U(0|g,0|h,0|(S=0|F(0|(y=0|D(0,0|i[_>>2],32)),0|l,0|c,0|E)),0|l),S=l,h=0|D(0,0|i[u>>2],32),g=l,g=0|U(0|E,0|S,0|(y=0|F(0|(c=0|D(0,0|i[o>>2],32)),0|l,0|h,0|g)),0|l),y=l,S=0|D(0,0|i[t>>2],32),E=l,E=0|U(0|g,0|y,0|(T=0|F(0|(c=0|D(0,0|i[(h=n+48|0)>>2],32)),0|l,0|S,0|E)),0|l),T=l,g=0|D(0,0|i[(y=t+48|0)>>2],32),S=l,S=0|U(0|E,0|T,0|(v=0|F(0|(c=0|D(0,0|i[n>>2],32)),0|l,0|g,0|S)),0|l),i[(v=e+48|0)>>2]=S,i[v+4>>2]=l,v=0|D(0,0|i[s>>2],32),S=l,E=0|F(0|(T=0|D(0,0|i[_>>2],32)),0|l,0|v,0|S),S=l,v=0|D(0,0|i[u>>2],32),T=l,T=0|U(0|(c=0|F(0|(g=0|D(0,0|i[f>>2],32)),0|l,0|v,0|T)),0|l,0|E,0|S),S=l,E=0|D(0,0|i[p>>2],32),c=l,c=0|U(0|T,0|S,0|(g=0|F(0|(v=0|D(0,0|i[d>>2],32)),0|l,0|E,0|c)),0|l),g=l,S=0|D(0,0|i[m>>2],32),T=l,T=0|U(0|c,0|g,0|(v=0|F(0|(E=0|D(0,0|i[o>>2],32)),0|l,0|S,0|T)),0|l),v=l,g=0|D(0,0|i[a>>2],32),c=l,c=0|U(0|T,0|v,0|(E=0|F(0|(S=0|D(0,0|i[h>>2],32)),0|l,0|g,0|c)),0|l),E=l,v=0|D(0,0|i[y>>2],32),T=l,T=0|U(0|c,0|E,0|(S=0|F(0|(g=0|D(0,0|i[r>>2],32)),0|l,0|v,0|T)),0|l),S=l,E=0|D(0,0|i[t>>2],32),c=l,c=0|U(0|T,0|S,0|(A=0|F(0|(g=0|D(0,0|i[(v=n+56|0)>>2],32)),0|l,0|E,0|c)),0|l),A=l,T=0|D(0,0|i[(S=t+56|0)>>2],32),E=l,E=0|U(0|c,0|A,0|(C=0|F(0|(g=0|D(0,0|i[n>>2],32)),0|l,0|T,0|E)),0|l),i[(C=e+56|0)>>2]=E,i[C+4>>2]=l,C=0|D(0,0|i[u>>2],32),E=l,c=0|F(0|(A=0|D(0,0|i[_>>2],32)),0|l,0|C,0|E),E=l,C=0|D(0,0|i[s>>2],32),A=l,g=0|F(0|(T=0|D(0,0|i[d>>2],32)),0|l,0|C,0|A),A=l,C=0|D(0,0|i[m>>2],32),T=l,T=0|U(0|(O=0|F(0|(P=0|D(0,0|i[f>>2],32)),0|l,0|C,0|T)),0|l,0|g,0|A),A=l,g=0|D(0,0|i[a>>2],32),O=l,O=0|U(0|T,0|A,0|(P=0|F(0|(C=0|D(0,0|i[v>>2],32)),0|l,0|g,0|O)),0|l),P=l,A=0|D(0,0|i[S>>2],32),T=l,T=0|U(0|O,0|P,0|(C=0|F(0|(g=0|D(0,0|i[r>>2],32)),0|l,0|A,0|T)),0|l),T=0|U(0|(C=0|B(0|T,0|l,1)),0|l,0|c,0|E),E=l,c=0|D(0,0|i[p>>2],32),C=l,C=0|U(0|T,0|E,0|(O=0|F(0|(P=0|D(0,0|i[h>>2],32)),0|l,0|c,0|C)),0|l),O=l,E=0|D(0,0|i[y>>2],32),T=l,T=0|U(0|C,0|O,0|(P=0|F(0|(c=0|D(0,0|i[o>>2],32)),0|l,0|E,0|T)),0|l),P=l,O=0|D(0,0|i[t>>2],32),C=l,C=0|U(0|T,0|P,0|(A=0|F(0|(c=0|D(0,0|i[(E=n+64|0)>>2],32)),0|l,0|O,0|C)),0|l),A=l,T=0|D(0,0|i[(P=t+64|0)>>2],32),O=l,O=0|U(0|C,0|A,0|(g=0|F(0|(c=0|D(0,0|i[n>>2],32)),0|l,0|T,0|O)),0|l),i[(g=e+64|0)>>2]=O,i[g+4>>2]=l,g=0|D(0,0|i[u>>2],32),O=l,C=0|F(0|(A=0|D(0,0|i[d>>2],32)),0|l,0|g,0|O),O=l,g=0|D(0,0|i[m>>2],32),A=l,A=0|U(0|(c=0|F(0|(T=0|D(0,0|i[_>>2],32)),0|l,0|g,0|A)),0|l,0|C,0|O),O=l,C=0|D(0,0|i[s>>2],32),c=l,c=0|U(0|A,0|O,0|(T=0|F(0|(g=0|D(0,0|i[h>>2],32)),0|l,0|C,0|c)),0|l),T=l,O=0|D(0,0|i[y>>2],32),A=l,A=0|U(0|c,0|T,0|(g=0|F(0|(C=0|D(0,0|i[f>>2],32)),0|l,0|O,0|A)),0|l),g=l,T=0|D(0,0|i[p>>2],32),c=l,c=0|U(0|A,0|g,0|(C=0|F(0|(O=0|D(0,0|i[v>>2],32)),0|l,0|T,0|c)),0|l),C=l,g=0|D(0,0|i[S>>2],32),A=l,A=0|U(0|c,0|C,0|(O=0|F(0|(T=0|D(0,0|i[o>>2],32)),0|l,0|g,0|A)),0|l),O=l,C=0|D(0,0|i[a>>2],32),c=l,c=0|U(0|A,0|O,0|(T=0|F(0|(g=0|D(0,0|i[E>>2],32)),0|l,0|C,0|c)),0|l),T=l,O=0|D(0,0|i[P>>2],32),A=l,A=0|U(0|c,0|T,0|(g=0|F(0|(C=0|D(0,0|i[r>>2],32)),0|l,0|O,0|A)),0|l),g=l,T=0|D(0,0|i[t>>2],32),c=l,c=0|U(0|A,0|g,0|(I=0|F(0|(C=0|D(0,0|i[(O=n+72|0)>>2],32)),0|l,0|T,0|c)),0|l),I=l,t=0|D(0,0|i[(g=t+72|0)>>2],32),A=l,A=0|U(0|c,0|I,0|(n=0|F(0|(T=0|D(0,0|i[n>>2],32)),0|l,0|t,0|A)),0|l),i[(n=e+72|0)>>2]=A,i[n+4>>2]=l,n=0|D(0,0|i[m>>2],32),A=l,c=0|F(0|(I=0|D(0,0|i[d>>2],32)),0|l,0|n,0|A),A=l,n=0|D(0,0|i[s>>2],32),I=l,I=0|U(0|(T=0|F(0|(t=0|D(0,0|i[v>>2],32)),0|l,0|n,0|I)),0|l,0|c,0|A),A=l,c=0|D(0,0|i[S>>2],32),T=l,T=0|U(0|I,0|A,0|(t=0|F(0|(n=0|D(0,0|i[f>>2],32)),0|l,0|c,0|T)),0|l),t=l,A=0|D(0,0|i[a>>2],32),a=l,a=0|U(0|T,0|t,0|(c=0|F(0|(I=0|D(0,0|i[O>>2],32)),0|l,0|A,0|a)),0|l),c=l,t=0|D(0,0|i[g>>2],32),T=l,r=0|B(0|(T=0|U(0|a,0|c,0|(r=0|F(0|(A=0|D(0,0|i[r>>2],32)),0|l,0|t,0|T)),0|l)),0|l,1),T=l,c=0|D(0,0|i[u>>2],32),a=l,a=0|U(0|r,0|T,0|(A=0|F(0|(t=0|D(0,0|i[h>>2],32)),0|l,0|c,0|a)),0|l),A=l,T=0|D(0,0|i[y>>2],32),r=l,r=0|U(0|a,0|A,0|(t=0|F(0|(c=0|D(0,0|i[_>>2],32)),0|l,0|T,0|r)),0|l),t=l,A=0|D(0,0|i[p>>2],32),a=l,a=0|U(0|r,0|t,0|(c=0|F(0|(T=0|D(0,0|i[E>>2],32)),0|l,0|A,0|a)),0|l),c=l,t=0|D(0,0|i[P>>2],32),r=l,r=0|U(0|a,0|c,0|(T=0|F(0|(A=0|D(0,0|i[o>>2],32)),0|l,0|t,0|r)),0|l),i[(T=e+80|0)>>2]=r,i[T+4>>2]=l,T=0|D(0,0|i[m>>2],32),r=l,a=0|F(0|(c=0|D(0,0|i[h>>2],32)),0|l,0|T,0|r),r=l,T=0|D(0,0|i[y>>2],32),c=l,c=0|U(0|(A=0|F(0|(t=0|D(0,0|i[d>>2],32)),0|l,0|T,0|c)),0|l,0|a,0|r),r=l,a=0|D(0,0|i[u>>2],32),A=l,A=0|U(0|c,0|r,0|(t=0|F(0|(T=0|D(0,0|i[v>>2],32)),0|l,0|a,0|A)),0|l),t=l,r=0|D(0,0|i[S>>2],32),c=l,c=0|U(0|A,0|t,0|(T=0|F(0|(a=0|D(0,0|i[_>>2],32)),0|l,0|r,0|c)),0|l),T=l,t=0|D(0,0|i[s>>2],32),A=l,A=0|U(0|c,0|T,0|(a=0|F(0|(r=0|D(0,0|i[E>>2],32)),0|l,0|t,0|A)),0|l),a=l,T=0|D(0,0|i[P>>2],32),c=l,c=0|U(0|A,0|a,0|(r=0|F(0|(t=0|D(0,0|i[f>>2],32)),0|l,0|T,0|c)),0|l),r=l,a=0|D(0,0|i[p>>2],32),p=l,p=0|U(0|c,0|r,0|(T=0|F(0|(A=0|D(0,0|i[O>>2],32)),0|l,0|a,0|p)),0|l),T=l,r=0|D(0,0|i[g>>2],32),c=l,c=0|U(0|p,0|T,0|(o=0|F(0|(a=0|D(0,0|i[o>>2],32)),0|l,0|r,0|c)),0|l),i[(o=e+88|0)>>2]=c,i[o+4>>2]=l,o=0|D(0,0|i[y>>2],32),c=l,p=0|F(0|(T=0|D(0,0|i[h>>2],32)),0|l,0|o,0|c),c=l,o=0|D(0,0|i[m>>2],32),T=l,a=0|F(0|(r=0|D(0,0|i[v>>2],32)),0|l,0|o,0|T),T=l,o=0|D(0,0|i[S>>2],32),r=l,r=0|U(0|(t=0|F(0|(A=0|D(0,0|i[d>>2],32)),0|l,0|o,0|r)),0|l,0|a,0|T),T=l,a=0|D(0,0|i[s>>2],32),s=l,s=0|U(0|r,0|T,0|(o=0|F(0|(t=0|D(0,0|i[O>>2],32)),0|l,0|a,0|s)),0|l),o=l,T=0|D(0,0|i[g>>2],32),r=l,r=0|U(0|s,0|o,0|(f=0|F(0|(a=0|D(0,0|i[f>>2],32)),0|l,0|T,0|r)),0|l),r=0|U(0|(f=0|B(0|r,0|l,1)),0|l,0|p,0|c),c=l,p=0|D(0,0|i[u>>2],32),f=l,f=0|U(0|r,0|c,0|(s=0|F(0|(o=0|D(0,0|i[E>>2],32)),0|l,0|p,0|f)),0|l),s=l,c=0|D(0,0|i[P>>2],32),r=l,r=0|U(0|f,0|s,0|(o=0|F(0|(p=0|D(0,0|i[_>>2],32)),0|l,0|c,0|r)),0|l),i[(o=e+96|0)>>2]=r,i[o+4>>2]=l,o=0|D(0,0|i[y>>2],32),r=l,f=0|F(0|(s=0|D(0,0|i[v>>2],32)),0|l,0|o,0|r),r=l,o=0|D(0,0|i[S>>2],32),s=l,s=0|U(0|(p=0|F(0|(c=0|D(0,0|i[h>>2],32)),0|l,0|o,0|s)),0|l,0|f,0|r),r=l,f=0|D(0,0|i[m>>2],32),p=l,p=0|U(0|s,0|r,0|(c=0|F(0|(o=0|D(0,0|i[E>>2],32)),0|l,0|f,0|p)),0|l),c=l,r=0|D(0,0|i[P>>2],32),s=l,s=0|U(0|p,0|c,0|(o=0|F(0|(f=0|D(0,0|i[d>>2],32)),0|l,0|r,0|s)),0|l),o=l,c=0|D(0,0|i[u>>2],32),u=l,u=0|U(0|s,0|o,0|(r=0|F(0|(p=0|D(0,0|i[O>>2],32)),0|l,0|c,0|u)),0|l),r=l,o=0|D(0,0|i[g>>2],32),s=l,s=0|U(0|u,0|r,0|(_=0|F(0|(c=0|D(0,0|i[_>>2],32)),0|l,0|o,0|s)),0|l),i[(_=e+104|0)>>2]=s,i[_+4>>2]=l,_=0|D(0,0|i[S>>2],32),s=l,u=0|F(0|(r=0|D(0,0|i[v>>2],32)),0|l,0|_,0|s),s=l,_=0|D(0,0|i[m>>2],32),m=l,m=0|U(0|(o=0|F(0|(r=0|D(0,0|i[O>>2],32)),0|l,0|_,0|m)),0|l,0|u,0|s),s=l,u=0|D(0,0|i[g>>2],32),o=l,d=0|B(0|(o=0|U(0|m,0|s,0|(d=0|F(0|(_=0|D(0,0|i[d>>2],32)),0|l,0|u,0|o)),0|l)),0|l,1),o=l,s=0|D(0,0|i[y>>2],32),m=l,m=0|U(0|d,0|o,0|(_=0|F(0|(u=0|D(0,0|i[E>>2],32)),0|l,0|s,0|m)),0|l),_=l,o=0|D(0,0|i[P>>2],32),d=l,d=0|U(0|m,0|_,0|(u=0|F(0|(s=0|D(0,0|i[h>>2],32)),0|l,0|o,0|d)),0|l),i[(u=e+112|0)>>2]=d,i[u+4>>2]=l,u=0|D(0,0|i[S>>2],32),d=l,m=0|F(0|(_=0|D(0,0|i[E>>2],32)),0|l,0|u,0|d),d=l,u=0|D(0,0|i[P>>2],32),_=l,_=0|U(0|(s=0|F(0|(o=0|D(0,0|i[v>>2],32)),0|l,0|u,0|_)),0|l,0|m,0|d),d=l,m=0|D(0,0|i[y>>2],32),y=l,y=0|U(0|_,0|d,0|(u=0|F(0|(s=0|D(0,0|i[O>>2],32)),0|l,0|m,0|y)),0|l),u=l,d=0|D(0,0|i[g>>2],32),_=l,_=0|U(0|y,0|u,0|(h=0|F(0|(m=0|D(0,0|i[h>>2],32)),0|l,0|d,0|_)),0|l),i[(h=e+120|0)>>2]=_,i[h+4>>2]=l,h=0|D(0,0|i[P>>2],32),_=l,y=0|F(0|(u=0|D(0,0|i[E>>2],32)),0|l,0|h,0|_),_=l,h=0|D(0,0|i[S>>2],32),S=l,d=0|F(0|(u=0|D(0,0|i[O>>2],32)),0|l,0|h,0|S),S=l,h=0|D(0,0|i[g>>2],32),u=l,u=0|U(0|(v=0|F(0|(m=0|D(0,0|i[v>>2],32)),0|l,0|h,0|u)),0|l,0|d,0|S),u=0|U(0|(S=0|B(0|u,0|l,1)),0|l,0|y,0|_),i[(_=e+128|0)>>2]=u,i[_+4>>2]=l,_=0|D(0,0|i[P>>2],32),P=l,y=0|F(0|(u=0|D(0,0|i[O>>2],32)),0|l,0|_,0|P),P=l,_=0|D(0,0|i[g>>2],32),u=l,u=0|U(0|(E=0|F(0|(S=0|D(0,0|i[E>>2],32)),0|l,0|_,0|u)),0|l,0|y,0|P),i[(P=e+136|0)>>2]=u,i[P+4>>2]=l,P=0|D(0,0|i[g>>2],31),g=l,O=0|F(0|(u=0|D(0,0|i[O>>2],32)),0|l,0|P,0|g),i[(g=e+144|0)>>2]=O,i[g+4>>2]=l}function I(e,t){e|=0;var n,r,a,s=0,u=0,c=0,d=0,p=0,_=0,f=0,h=0,g=0,m=0,y=0,E=0,S=0,T=0,v=0,A=0,C=0,P=0,O=0,I=0,M=0,b=0,R=0,N=0,w=0,L=0,G=0,x=0,j=0,Y=0,K=0,H=0,W=0,V=0,$=0,z=0,q=0;n=o,o=o+160|0,s=n,d=0|F(0|(r=0|D(0,0|(u=0|i[(t|=0)>>2]),32)),0|(c=l),0|r,0|c),i[(p=s)>>2]=d,i[p+4>>2]=l,p=0|D(0,0|u,31),u=l,g=0|F(0|(f=0|D(0,0|(_=0|i[(d=t+8|0)>>2]),32)),0|(h=l),0|p,0|u),i[(m=a=s+8|0)>>2]=g,i[m+4>>2]=l,m=0|F(0|f,0|h,0|f,0|h),g=l,g=0|B(0|(v=0|U(0|(T=0|F(0|(E=0|D(0,0|i[(y=t+16|0)>>2],32)),0|(S=l),0|r,0|c)),0|l,0|m,0|g)),0|l,1),i[(m=v=s+16|0)>>2]=g,i[m+4>>2]=l,m=0|F(0|E,0|S,0|f,0|h),g=l,g=0|B(0|(O=0|U(0|(P=0|F(0|(A=0|D(0,0|i[(T=t+24|0)>>2],32)),0|(C=l),0|r,0|c)),0|l,0|m,0|g)),0|l,1),i[(m=O=s+24|0)>>2]=g,i[m+4>>2]=l,m=0|F(0|E,0|S,0|E,0|S),g=l,P=0|U(0|(I=0|F(0|A,0|C,0|(P=0|D(0,0|_,30)),0|l)),0|l,0|m,0|g),u=0|U(0|P,0|(g=l),0|(b=0|F(0|(I=0|D(0,0|i[(m=t+32|0)>>2],32)),0|(M=l),0|p,0|u)),0|l),i[(g=b=s+32|0)>>2]=u,i[g+4>>2]=l,g=0|F(0|A,0|C,0|E,0|S),u=l,p=0|U(0|(P=0|F(0|I,0|M,0|f,0|h)),0|l,0|g,0|u),N=0|B(0|(w=0|U(0|p,0|(u=l),0|(N=0|F(0|(P=0|D(0,0|i[(g=t+40|0)>>2],32)),0|(R=l),0|r,0|c)),0|l)),0|l,1),i[(u=w=s+40|0)>>2]=N,i[u+4>>2]=l,u=0|F(0|A,0|C,0|A,0|C),N=l,L=0|U(0|(p=0|F(0|I,0|M,0|E,0|S)),0|l,0|u,0|N),j=0|U(0|L,0|(N=l),0|(x=0|F(0|(p=0|D(0,0|i[(u=t+48|0)>>2],32)),0|(G=l),0|r,0|c)),0|l),_=0|B(0|(N=0|U(0|j,0|(x=l),0|(_=0|F(0|P,0|R,0|(N=0|D(0,0|_,31)),0|l)),0|l)),0|l,1),i[(x=N=s+48|0)>>2]=_,i[x+4>>2]=l,x=0|F(0|I,0|M,0|A,0|C),_=l,L=0|U(0|(j=0|F(0|P,0|R,0|E,0|S)),0|l,0|x,0|_),j=0|U(0|L,0|(_=l),0|(x=0|F(0|p,0|G,0|f,0|h)),0|l),K=0|B(0|(H=0|U(0|j,0|(x=l),0|(K=0|F(0|(L=0|D(0,0|i[(_=t+56|0)>>2],32)),0|(Y=l),0|r,0|c)),0|l)),0|l,1),i[(x=H=s+56|0)>>2]=K,i[x+4>>2]=l,x=0|F(0|I,0|M,0|I,0|M),K=l,j=0|F(0|p,0|G,0|E,0|S),W=l,c=0|U(0|(q=0|F(0|($=0|D(0,0|i[(V=t+64|0)>>2],32)),0|(z=l),0|r,0|c)),0|l,0|j,0|W),W=l,j=0|F(0|L,0|Y,0|f,0|h),h=l,q=0|U(0|(f=0|F(0|P,0|R,0|A,0|C)),0|l,0|j,0|h),q=0|U(0|c,0|W,0|(h=0|B(0|q,0|l,1)),0|l),q=0|U(0|(h=0|B(0|q,0|l,1)),0|l,0|x,0|K),i[(x=K=s+64|0)>>2]=q,i[x+4>>2]=l,x=0|F(0|P,0|R,0|I,0|M),q=l,C=0|U(0|(h=0|F(0|p,0|G,0|A,0|C)),0|l,0|x,0|q),S=0|U(0|C,0|(q=l),0|(x=0|F(0|L,0|Y,0|E,0|S)),0|l),E=0|U(0|S,0|(x=l),0|(C=0|F(0|$,0|z,0|(q=0|D(0,0|i[d>>2],32)),0|(d=l))),0|l),C=l,x=0|D(0,0|i[t>>2],32),S=l,W=0|B(0|(S=0|U(0|E,0|C,0|(W=0|F(0|(t=0|D(0,0|(h=0|i[t+72>>2]),32)),0|(A=l),0|x,0|S)),0|l)),0|l,1),i[(S=s+72|0)>>2]=W,i[S+4>>2]=l,S=0|F(0|P,0|R,0|P,0|R),W=l,M=0|U(0|(C=0|F(0|p,0|G,0|I,0|M)),0|l,0|S,0|W),I=0|U(0|M,0|(W=l),0|(C=0|F(0|$,0|z,0|(S=0|D(0,0|i[y>>2],32)),0|(y=l))),0|l),C=l,M=0|F(0|L,0|Y,0|(W=0|D(0,0|i[T>>2],32)),0|(T=l)),E=l,E=0|B(0|(d=0|U(0|(x=0|F(0|t,0|A,0|q,0|d)),0|l,0|M,0|E)),0|l,1),E=0|B(0|(d=0|U(0|I,0|C,0|E,0|l)),0|l,1),i[(C=d=s+80|0)>>2]=E,i[C+4>>2]=l,C=0|F(0|p,0|G,0|P,0|R),R=l,I=0|U(0|(E=0|F(0|L,0|Y,0|(P=0|D(0,0|i[m>>2],32)),0|(m=l))),0|l,0|C,0|R),E=0|U(0|I,0|(R=l),0|(C=0|F(0|$,0|z,0|W,0|T)),0|l),C=0|B(0|(y=0|U(0|E,0|(C=l),0|(R=0|F(0|t,0|A,0|S,0|y)),0|l)),0|(R=l),1),E=l,i[(S=s+88|0)>>2]=C,i[S+4>>2]=E,S=0|F(0|p,0|G,0|p,0|G),G=l,p=0|F(0|$,0|z,0|P,0|m),I=l,q=0|F(0|L,0|Y,0|(g=0|D(0,0|(M=0|i[g>>2]),32)),0|(x=l)),c=l,T=0|U(0|(j=0|F(0|t,0|A,0|W,0|T)),0|l,0|q,0|c),T=0|U(0|(c=0|B(0|T,0|l,1)),0|l,0|p,0|I),T=0|U(0|(I=0|B(0|T,0|l,1)),0|l,0|S,0|G),G=l,i[(S=s+96|0)>>2]=T,i[S+4>>2]=G,I=0|F(0|L,0|Y,0|(S=0|D(0,0|i[u>>2],32)),0|(u=l)),Y=l,x=0|U(0|(L=0|F(0|$,0|z,0|g,0|x)),0|l,0|I,0|Y),Y=0|B(0|(m=0|U(0|x,0|(Y=l),0|(I=0|F(0|t,0|A,0|P,0|m)),0|l)),0|(I=l),1),x=l,i[(P=s+104|0)>>2]=Y,i[P+4>>2]=x,g=0|F(0|(_=0|D(0,0|(P=0|i[_>>2]),32)),0|(L=l),0|_,0|L),p=l,z=0|U(0|(c=0|F(0|$,0|z,0|S,0|u)),0|l,0|g,0|p),p=0|B(0|(g=0|U(0|z,0|(p=l),0|(M=0|F(0|t,0|A,0|(g=0|D(0,0|M,31)),0|l)),0|l)),0|(M=l),1),z=l,i[(c=s+112|0)>>2]=p,i[c+4>>2]=z,q=0|F(0|(V=0|D(0,0|(c=0|i[V>>2]),32)),0|($=l),0|_,0|L),L=l,q=0|B(0|(u=0|U(0|(_=0|F(0|t,0|A,0|S,0|u)),0|l,0|q,0|L)),0|(L=l),1),_=l,i[(S=s+120|0)>>2]=q,i[S+4>>2]=_,S=0|F(0|V,0|$,0|V,0|$),$=l,V=0|U(0|(P=0|F(0|t,0|A,0|(V=0|D(0,0|P,30)),0|l)),0|l,0|S,0|$),$=l,i[(S=s+128|0)>>2]=V,i[S+4>>2]=$,c=0|F(0|t,0|A,0|(S=0|D(0,0|c,31)),0|l),S=l,i[(P=s+136|0)>>2]=c,i[P+4>>2]=S,h=0|F(0|(P=0|D(0,0|h,31)),0|l,0|t,0|A),A=l,i[(t=s+144|0)>>2]=h,i[t+4>>2]=A,P=0|i[(t=K)>>2],j=0|i[t+4>>2],t=0|F(0|h,0|A,18,0),W=l,f=0|U(0|h,0|A,0|P,0|j),j=0|U(0|f,0|l,0|t,0|W),i[(W=K)>>2]=j,i[W+4>>2]=l,j=0|i[(W=H)>>2],K=0|i[W+4>>2],W=0|F(0|c,0|S,18,0),t=l,f=0|U(0|j,0|K,0|c,0|S),S=0|U(0|f,0|l,0|W,0|t),i[(t=H)>>2]=S,i[t+4>>2]=l,S=0|i[(t=N)>>2],H=0|i[t+4>>2],t=0|F(0|V,0|$,18,0),W=l,f=0|U(0|S,0|H,0|V,0|$),$=0|U(0|f,0|l,0|t,0|W),i[(W=N)>>2]=$,i[W+4>>2]=l,$=0|i[(W=w)>>2],N=0|i[W+4>>2],W=0|F(0|u,0|L,36,0),L=l,u=0|U(0|$,0|N,0|q,0|_),_=0|U(0|u,0|l,0|W,0|L),i[(L=w)>>2]=_,i[L+4>>2]=l,_=0|i[(L=b)>>2],w=0|i[L+4>>2],L=0|F(0|g,0|M,36,0),M=l,g=0|U(0|_,0|w,0|p,0|z),z=0|U(0|g,0|l,0|L,0|M),i[(M=b)>>2]=z,i[M+4>>2]=l,z=0|i[(M=O)>>2],b=0|i[M+4>>2],M=0|F(0|m,0|I,36,0),I=l,m=0|U(0|z,0|b,0|Y,0|x),x=0|U(0|m,0|l,0|M,0|I),i[(I=O)>>2]=x,i[I+4>>2]=l,x=0|i[(I=v)>>2],O=0|i[I+4>>2],I=0|F(0|T,0|G,18,0),M=l,m=0|U(0|x,0|O,0|T,0|G),G=0|U(0|m,0|l,0|I,0|M),i[(M=v)>>2]=G,i[M+4>>2]=l,G=0|i[(M=a)>>2],v=0|i[M+4>>2],M=0|F(0|y,0|R,36,0),R=l,y=0|U(0|G,0|v,0|C,0|E),E=0|U(0|y,0|l,0|M,0|R),i[(R=a)>>2]=E,i[R+4>>2]=l,E=0|i[(R=d)>>2],M=0|i[R+4>>2],y=0|i[(R=s)>>2],C=0|i[R+4>>2],R=0|F(0|E,0|M,18,0),v=l,G=0|U(0|y,0|C,0|E,0|M),M=0|U(0|G,0|l,0|R,0|v),v=l,i[(R=s)>>2]=M,i[R+4>>2]=v,i[(R=d)>>2]=0,i[R+4>>2]=0,R=v,v=M,M=0;do{y=0|k(0|v,0|R,0|(C=0|B(0|(E=0|D(0|(G=0|U(R>>31>>>6|0,0,0|v,0|R)),0|l,26)),0|(G=l),26)),0|l),i[(C=s+(M<<3)|0)>>2]=y,i[C+4>>2]=l,T=0|k(0|(I=0|U(0|E,0|G,0|i[(y=C=s+((1|M)<<3)|0)>>2],0|i[y+4>>2])),0|(y=l),0|(m=0|B(0|(E=0|D(0|(G=0|U(y>>31>>>7|0,0,0|I,0|y)),0|l,25)),0|(G=l),25)),0|l),i[(m=C)>>2]=T,i[m+4>>2]=l,v=0|U(0|E,0|G,0|i[(T=m=s+((M=M+2|0)<<3)|0)>>2],0|i[T+4>>2]),R=l,i[(T=m)>>2]=v,i[T+4>>2]=R}while(M>>>0<10);R=0|i[(M=d)>>2],v=0|i[M+4>>2],T=0|i[(M=s)>>2],m=0|i[M+4>>2],M=0|F(0|R,0|v,18,0),G=l,E=0|U(0|T,0|m,0|R,0|v),v=0|U(0|E,0|l,0|M,0|G),G=l,i[(M=d)>>2]=0,i[M+4>>2]=0,R=0|k(0|v,0|G,0|(E=0|B(0|(d=0|D(0|(M=0|U(G>>31>>>6|0,0,0|v,0|G)),0|l,26)),0|(M=l),26)),0|l),i[(E=s)>>2]=R,i[E+4>>2]=l,R=0|U(0|d,0|M,0|i[(E=a)>>2],0|i[E+4>>2]),i[(E=a)>>2]=R,i[E+4>>2]=l,E=e,e=s,s=E+80|0;do{i[E>>2]=i[e>>2],E=E+4|0,e=e+4|0}while((0|E)<(0|s));o=n}function M(){return 0|(0|i[2]?0|i[60+(0|_())>>2]:56)}function b(e){var t=0;return(e|=0)>>>0>4294963200?(i[(0|M())>>2]=0-e,t=-1):t=e,0|t}function R(e){return 0,0}function N(e){0}function w(e,t,n){t|=0,n|=0;var r,a,s,l,u,c=0,p=0,_=0,f=0,h=0,g=0,m=0,y=0,E=0,S=0,T=0,A=0,P=0,O=0,I=0,M=0;for(r=o,o=o+48|0,a=r+16|0,s=r,c=r+32|0,p=0|i[(l=(e|=0)+28|0)>>2],i[c>>2]=p,_=(0|i[(u=e+20|0)>>2])-p|0,i[c+4>>2]=_,i[c+8>>2]=t,i[c+12>>2]=n,t=e+60|0,p=e+44|0,f=c,c=2,h=_+n|0;;){if(0|i[2]?(v(1,0|e),i[s>>2]=i[t>>2],i[s+4>>2]=f,i[s+8>>2]=c,_=0|b(0|C(146,0|s)),d(0),g=_):(i[a>>2]=i[t>>2],i[a+4>>2]=f,i[a+8>>2]=c,g=0|b(0|C(146,0|a))),(0|h)==(0|g)){m=6;break}if((0|g)<0){y=f,E=c,m=8;break}_=h-g|0,g>>>0<=(S=0|i[f+4>>2])>>>0?2==(0|c)?(i[l>>2]=(0|i[l>>2])+g,T=S,A=g,P=f,O=2):(T=S,A=g,P=f,O=c):(I=0|i[p>>2],i[l>>2]=I,i[u>>2]=I,T=0|i[f+12>>2],A=g-S|0,P=f+8|0,O=c+-1|0),i[P>>2]=(0|i[P>>2])+A,i[P+4>>2]=T-A,f=P,c=O,h=_}return 6==(0|m)?(h=0|i[p>>2],i[e+16>>2]=h+(0|i[e+48>>2]),p=h,i[l>>2]=p,i[u>>2]=p,M=n):8==(0|m)&&(i[e+16>>2]=0,i[l>>2]=0,i[u>>2]=0,i[e>>2]=32|i[e>>2],M=2==(0|E)?0:n-(0|i[y+4>>2])|0),o=r,0|M}function L(e){var t,n,r=0,a=0,o=0,s=0,l=0;return n=(e|=0)+28|0,(0|i[(t=e+20|0)>>2])>>>0>(0|i[n>>2])>>>0&&(Y[3&i[e+36>>2]](e,0,0),0==(0|i[t>>2]))?r=-1:((o=0|i[(a=e+4|0)>>2])>>>0<(l=0|i[(s=e+8|0)>>2])>>>0&&Y[3&i[e+40>>2]](e,o-l|0,1),i[e+16>>2]=0,i[n>>2]=0,i[t>>2]=0,i[s>>2]=0,i[a>>2]=0,r=0),0|r}function D(e,t,n){return e|=0,t|=0,(0|(n|=0))<32?(l=t>>n,e>>>n|(t&(1<<n)-1)<<32-n):(l=(0|t)<0?-1:0,t>>n-32|0)}function k(e,t,n,r){return(t|=0)-(r|=0)>>>0,0|(l=t-r-((n|=0)>>>0>(e|=0)>>>0|0)>>>0,e-n>>>0|0)}function U(e,t,n,r){var i;return 0|(l=(t|=0)+(r|=0)+((i=(e|=0)+(n|=0)>>>0)>>>0<e>>>0|0)>>>0,0|i)}function G(e,t,n){t|=0;var a,o=0,s=0,l=0;if(a=(e|=0)+(n|=0)|0,(0|n)>=20){if(s=(t&=255)|t<<8|t<<16|t<<24,l=-4&a,o=3&e)for(o=e+4-o|0;(0|e)<(0|o);)r[e>>0]=t,e=e+1|0;for(;(0|e)<(0|l);)i[e>>2]=s,e=e+4|0}for(;(0|e)<(0|a);)r[e>>0]=t,e=e+1|0;return e-n|0}function x(e,t,n){return e|=0,t|=0,(0|(n|=0))<32?(l=t>>>n,e>>>n|(t&(1<<n)-1)<<32-n):(l=0,t>>>n-32|0)}function B(e,t,n){return e|=0,t|=0,(0|(n|=0))<32?(l=t<<n|(e&(1<<n)-1<<32-n)>>>32-n,e<<n):(l=e<<n-32,0)}function F(e,t,n,r){t|=0,r|=0;var i,a;return n=0|function(e,t){var n,r,i,a=0;return e=((r=0|u(a=65535&(t|=0),n=65535&(e|=0)))>>>16)+(0|u(a,i=e>>>16))|0,t=0|u(a=t>>>16,n),0|(l=(e>>>16)+(0|u(a,i))+(((65535&e)+t|0)>>>16)|0,e+t<<16|65535&r|0)}(i=e|=0,e=n|=0),a=l,0|(l=(0|u(t,e))+(0|u(r,i))+a|0&a,0|n)}var j=[function(e){return 0,c(0),0},function(e){var t,n;return e|=0,t=o,o=o+16|0,i[(n=t)>>2]=i[e+60>>2],e=0|b(0|f(6,0|n)),o=t,0|e}],Y=[function(e,t,n){return 0,0,0,c(1),0},function(e,t,n){t|=0,n|=0;var a,s=0;return a=o,o=o+80|0,s=a,i[(e|=0)+36>>2]=3,0==(64&i[e>>2]|0)&&(i[s>>2]=i[e+60>>2],i[s+4>>2]=21505,i[s+8>>2]=a+12,0!=(0|E(54,0|s)))&&(r[e+75>>0]=-1),s=0|w(e,t,n),o=a,0|s},function(e,t,n){e|=0,t|=0,n|=0;var r,a,s,l=0;return r=o,o=o+32|0,s=r+20|0,i[(a=r)>>2]=i[e+60>>2],i[a+4>>2]=0,i[a+8>>2]=t,i[a+12>>2]=s,i[a+16>>2]=n,(0|b(0|T(140,0|a)))<0?(i[s>>2]=-1,l=-1):l=0|i[s>>2],o=r,0|l},w],K=[function(e){c(2)},function(e){0|i[(e|=0)+68>>2]||N()}];return{_curve25519_donna:function(e,t,n){e|=0,n|=0;var s,c,d,p,_,f,h,g,m,y,E,S,T,v,A,C,M,b,R,N,w,L,j,Y,K,H,W,V,$,z,q,J,Q,X,Z,ee,te,ne,re,ie,ae,oe,se,le,ue,ce,de,pe,_e,fe,he,ge,me,ye,Ee,Se,Te,ve,Ae,Ce=0,Pe=0,Oe=0,Ie=0,Me=0,be=0,Re=0,Ne=0,we=0,Le=0,De=0,ke=0,Ue=0,Ge=0,xe=0,Be=0,Fe=0,je=0,Ye=0,Ke=0,He=0,We=0,Ve=0,$e=0,ze=0,qe=0,Je=0,Qe=0,Xe=0,Ze=0,et=0,tt=0,nt=0,rt=0,it=0,at=0,ot=0,st=0,lt=0,ut=0,ct=0,dt=0,pt=0,_t=0,ft=0,ht=0,gt=0,mt=0,yt=0,Et=0,St=0,Tt=0,vt=0,At=0,Ct=0,Pt=0,Ot=0,It=0,Mt=0,bt=0,Rt=0,Nt=0,wt=0,Lt=0,Dt=0,kt=0,Ut=0,Gt=0,xt=0,Bt=0,Ft=0,jt=0,Yt=0,Kt=0,Ht=0,Wt=0,Vt=0,$t=0,zt=0,qt=0,Jt=0,Qt=0,Xt=0,Zt=0,en=0,tn=0,nn=0,rn=0,an=0,on=0,sn=0,ln=0,un=0,cn=0,dn=0,pn=0,_n=0,fn=0,hn=0,gn=0,mn=0,yn=0,En=0,Sn=0,Tn=0,vn=0,An=0,Cn=0,Pn=0,On=0,In=0,Mn=0,bn=0,Rn=0,Nn=0,wn=0,Ln=0,Dn=0;s=o,o=o+2640|0,Ce=s+2456|0,Pe=s+2304|0,Oe=s+2152|0,Ie=s+2e3|0,Me=s+1848|0,be=s+1696|0,Re=s+1544|0,Ne=s+1392|0,we=s+1240|0,Le=s+1088|0,De=s+936|0,ke=s+784|0,Ue=s+632|0,Ge=s+480|0,xe=s+328|0,c=s+248|0,Be=s+168|0,Fe=s+80|0,je=s,Ke=t|=0,t=(Ye=d=s+2608|0)+32|0;do{r[Ye>>0]=0|r[Ke>>0],Ye=Ye+1|0,Ke=Ke+1|0}while((0|Ye)<(0|t));r[d>>0]=248&(0|a[d>>0]),r[(He=d+31|0)>>0]=63&(0|a[He>>0])|64,He=0|a[n>>0],We=0|B(0|a[n+1>>0],0,8),Ve=l,$e=0|B(0|a[n+2>>0],0,16),ze=Ve|l,qe=0|B(0|(Ve=0|a[n+3>>0]),0,24),i[(Je=c)>>2]=We|He|$e|50331648&qe,i[Je+4>>2]=ze,ze=0|B(0|a[n+4>>0],0,8),Je=l,qe=0|B(0|a[n+5>>0],0,16),$e=Je|l,We=0|x(ze|Ve|qe|(He=0|B(0|(Je=0|a[n+6>>0]),0,24))|0,$e|l|0,2),i[($e=c+8|0)>>2]=33554431&We,i[$e+4>>2]=0,$e=0|B(0|a[n+7>>0],0,8),We=l,He=0|B(0|a[n+8>>0],0,16),qe=We|l,ze=0|x($e|Je|He|(Ve=0|B(0|(We=0|a[n+9>>0]),0,24))|0,qe|l|0,3),i[(qe=c+16|0)>>2]=67108863&ze,i[qe+4>>2]=0,qe=0|B(0|a[n+10>>0],0,8),ze=l,Ve=0|B(0|a[n+11>>0],0,16),He=ze|l,$e=0|x(qe|We|Ve|(Je=0|B(0|(ze=0|a[n+12>>0]),0,24))|0,He|l|0,5),i[(He=c+24|0)>>2]=33554431&$e,i[He+4>>2]=0,He=0|B(0|a[n+13>>0],0,8),$e=l,Je=0|B(0|a[n+14>>0],0,16),Ve=$e|l,We=0|x(He|ze|Je|($e=0|B(0|a[n+15>>0],0,24))|0,Ve|l|0,6),i[(Ve=c+32|0)>>2]=67108863&We,i[Ve+4>>2]=0,Ve=0|a[n+16>>0],We=0|B(0|a[n+17>>0],0,8),$e=l,Je=0|B(0|a[n+18>>0],0,16),ze=$e|l,He=0|B(0|($e=0|a[n+19>>0]),0,24),i[(qe=c+40|0)>>2]=We|Ve|Je|16777216&He,i[qe+4>>2]=ze,ze=0|B(0|a[n+20>>0],0,8),qe=l,He=0|B(0|a[n+21>>0],0,16),Je=qe|l,We=0|x(ze|$e|He|(Ve=0|B(0|(qe=0|a[n+22>>0]),0,24))|0,Je|l|0,1),i[(Je=c+48|0)>>2]=67108863&We,i[Je+4>>2]=0,Je=0|B(0|a[n+23>>0],0,8),We=l,Ve=0|B(0|a[n+24>>0],0,16),He=We|l,ze=0|x(Je|qe|Ve|($e=0|B(0|(We=0|a[n+25>>0]),0,24))|0,He|l|0,3),i[(He=c+56|0)>>2]=33554431&ze,i[He+4>>2]=0,He=0|B(0|a[n+26>>0],0,8),ze=l,$e=0|B(0|a[n+27>>0],0,16),Ve=ze|l,Je=0|x(He|We|$e|(qe=0|B(0|(ze=0|a[n+28>>0]),0,24))|0,Ve|l|0,4),i[(Ve=c+64|0)>>2]=67108863&Je,i[Ve+4>>2]=0,Ve=0|B(0|a[n+29>>0],0,8),Je=l,qe=0|B(0|a[n+30>>0],0,16),$e=Je|l,n=0|x(Ve|ze|qe|(Je=0|B(0|a[n+31>>0],0,24))|0,$e|l|0,6),i[($e=c+72|0)>>2]=33554431&n,i[$e+4>>2]=0,G(0|we,0,152),i[($e=we)>>2]=1,i[$e+4>>2]=0,G(0|Le,0,152),i[($e=Le)>>2]=1,i[$e+4>>2]=0,G(0|De,0,152),G(0|ke,0,152),G(0|Ue,0,152),i[($e=Ue)>>2]=1,i[$e+4>>2]=0,G(0|Ge,0,152),G(0|xe,0,152),i[($e=xe)>>2]=1,i[$e+4>>2]=0,t=(Ye=Ne+80|0)+72|0;do{i[Ye>>2]=0,Ye=Ye+4|0}while((0|Ye)<(0|t));Ke=c,t=(Ye=Ne)+80|0;do{i[Ye>>2]=i[Ke>>2],Ye=Ye+4|0,Ke=Ke+4|0}while((0|Ye)<(0|t));for($e=Ie+144|0,n=Ie+64|0,Je=Ie+136|0,qe=Ie+56|0,ze=Ie+128|0,Ve=Ie+48|0,We=Ie+120|0,He=Ie+40|0,p=Ie+112|0,_=Ie+32|0,f=Ie+104|0,h=Ie+24|0,g=Ie+96|0,m=Ie+16|0,y=Ie+88|0,E=Ie+8|0,S=Ie+80|0,T=Me+144|0,v=Me+64|0,A=Me+136|0,C=Me+56|0,M=Me+128|0,b=Me+48|0,R=Me+120|0,N=Me+40|0,w=Me+112|0,L=Me+32|0,j=Me+104|0,Y=Me+24|0,K=Me+96|0,H=Me+16|0,W=Me+88|0,V=Me+8|0,$=Me+80|0,z=Ie+72|0,q=Me+72|0,J=Pe+8|0,Q=Oe+8|0,X=Pe+16|0,Z=Oe+16|0,ee=Pe+24|0,te=Oe+24|0,ne=Pe+32|0,re=Oe+32|0,ie=Pe+40|0,ae=Oe+40|0,oe=Pe+48|0,se=Oe+48|0,le=Pe+56|0,ue=Oe+56|0,ce=Pe+64|0,de=Oe+64|0,pe=Pe+72|0,_e=Oe+72|0,fe=Ce+80|0,he=Ce+8|0,ge=Ce+16|0,me=Ce+24|0,ye=Ce+32|0,Ee=Ce+40|0,Se=Ce+48|0,Te=Ce+56|0,ve=Ce+64|0,Ae=Ce+72|0,Qe=0,Xe=Ne,Ze=ke,ke=we,et=Ue,Ue=Le,tt=Ge,Ge=De,De=xe;;){for(xe=0|r[d+(31-Qe)>>0],nt=0,rt=Xe,it=Ze,at=ke,ot=et,st=Ue,lt=tt,ut=Ge,ct=De;;){pt=0|k(0,0,(dt=255&xe)>>>7|0,0),_t=l,ft=0;do{mt=0|i[(gt=ht=st+(ft<<3)|0)>>2],yt=0|i[gt+4>>2],St=0|i[(Et=gt=rt+(ft<<3)|0)>>2],vt=((Tt=0|i[Et+4>>2])^yt)&_t,yt=0|D(0,(Et=(St^mt)&pt)^mt|0,32),i[(mt=ht)>>2]=yt,i[mt+4>>2]=l,mt=0|D(0,Et^St|0,32),i[(St=gt)>>2]=mt,i[St+4>>2]=l,ft=ft+1|0}while(10!=(0|ft));At=0;do{mt=0|i[(St=ft=ut+(At<<3)|0)>>2],gt=0|i[St+4>>2],yt=0|i[(Et=St=at+(At<<3)|0)>>2],Tt=((ht=0|i[Et+4>>2])^gt)&_t,gt=0|D(0,(Et=(yt^mt)&pt)^mt|0,32),i[(mt=ft)>>2]=gt,i[mt+4>>2]=l,mt=0|D(0,Et^yt|0,32),i[(yt=St)>>2]=mt,i[yt+4>>2]=l,At=At+1|0}while(10!=(0|At));mt=0|i[(yt=st)>>2],St=0|i[yt+4>>2],gt=0|i[(Et=yt=st+8|0)>>2],ft=0|i[Et+4>>2],Tt=0|i[(ht=Et=st+16|0)>>2],vt=0|i[ht+4>>2],Pt=0|i[(Ct=ht=st+24|0)>>2],Ot=0|i[Ct+4>>2],Mt=0|i[(It=Ct=st+32|0)>>2],bt=0|i[It+4>>2],Nt=0|i[(Rt=It=st+40|0)>>2],wt=0|i[Rt+4>>2],Dt=0|i[(Lt=Rt=st+48|0)>>2],kt=0|i[Lt+4>>2],Gt=0|i[(Ut=Lt=st+56|0)>>2],xt=0|i[Ut+4>>2],Ft=0|i[(Bt=Ut=st+64|0)>>2],jt=0|i[Bt+4>>2],Kt=0|i[(Yt=Bt=st+72|0)>>2],Ht=0|i[Yt+4>>2],Yt=0|U(0|(Wt=0|i[(Yt=ut)>>2]),0|(Vt=0|i[Yt+4>>2]),0|mt,0|St),i[($t=st)>>2]=Yt,i[$t+4>>2]=l,Yt=0|U(0|(zt=0|i[(Yt=$t=ut+8|0)>>2]),0|(qt=0|i[Yt+4>>2]),0|gt,0|ft),i[(Jt=yt)>>2]=Yt,i[Jt+4>>2]=l,Yt=0|U(0|(yt=0|i[(Yt=Jt=ut+16|0)>>2]),0|(Qt=0|i[Yt+4>>2]),0|Tt,0|vt),i[(Xt=Et)>>2]=Yt,i[Xt+4>>2]=l,Yt=0|U(0|(Et=0|i[(Yt=Xt=ut+24|0)>>2]),0|(Zt=0|i[Yt+4>>2]),0|Pt,0|Ot),i[(en=ht)>>2]=Yt,i[en+4>>2]=l,Yt=0|U(0|(ht=0|i[(Yt=en=ut+32|0)>>2]),0|(tn=0|i[Yt+4>>2]),0|Mt,0|bt),i[(nn=Ct)>>2]=Yt,i[nn+4>>2]=l,Yt=0|U(0|(Ct=0|i[(Yt=nn=ut+40|0)>>2]),0|(rn=0|i[Yt+4>>2]),0|Nt,0|wt),i[(an=It)>>2]=Yt,i[an+4>>2]=l,Yt=0|U(0|(It=0|i[(Yt=an=ut+48|0)>>2]),0|(on=0|i[Yt+4>>2]),0|Dt,0|kt),i[(sn=Rt)>>2]=Yt,i[sn+4>>2]=l,Yt=0|U(0|(Rt=0|i[(Yt=sn=ut+56|0)>>2]),0|(ln=0|i[Yt+4>>2]),0|Gt,0|xt),i[(un=Lt)>>2]=Yt,i[un+4>>2]=l,Yt=0|U(0|(Lt=0|i[(Yt=un=ut+64|0)>>2]),0|(cn=0|i[Yt+4>>2]),0|Ft,0|jt),i[(dn=Ut)>>2]=Yt,i[dn+4>>2]=l,Yt=0|U(0|(Ut=0|i[(Yt=dn=ut+72|0)>>2]),0|(pn=0|i[Yt+4>>2]),0|Kt,0|Ht),i[(_n=Bt)>>2]=Yt,i[_n+4>>2]=l,_n=0|k(0|mt,0|St,0|Wt,0|Vt),i[(Vt=ut)>>2]=_n,i[Vt+4>>2]=l,Vt=0|k(0|gt,0|ft,0|zt,0|qt),i[(qt=$t)>>2]=Vt,i[qt+4>>2]=l,qt=0|k(0|Tt,0|vt,0|yt,0|Qt),i[(Qt=Jt)>>2]=qt,i[Qt+4>>2]=l,Qt=0|k(0|Pt,0|Ot,0|Et,0|Zt),i[(Zt=Xt)>>2]=Qt,i[Zt+4>>2]=l,Zt=0|k(0|Mt,0|bt,0|ht,0|tn),i[(tn=en)>>2]=Zt,i[tn+4>>2]=l,tn=0|k(0|Nt,0|wt,0|Ct,0|rn),i[(rn=nn)>>2]=tn,i[rn+4>>2]=l,rn=0|k(0|Dt,0|kt,0|It,0|on),i[(on=an)>>2]=rn,i[on+4>>2]=l,on=0|k(0|Gt,0|xt,0|Rt,0|ln),i[(ln=sn)>>2]=on,i[ln+4>>2]=l,ln=0|k(0|Ft,0|jt,0|Lt,0|cn),i[(cn=un)>>2]=ln,i[cn+4>>2]=l,cn=0|k(0|Kt,0|Ht,0|Ut,0|pn),i[(pn=dn)>>2]=cn,i[pn+4>>2]=l,cn=0|i[(pn=rt)>>2],dn=0|i[pn+4>>2],Ht=0|i[(Ut=pn=rt+8|0)>>2],Kt=0|i[Ut+4>>2],un=0|i[(ln=Ut=rt+16|0)>>2],Lt=0|i[ln+4>>2],Ft=0|i[(jt=ln=rt+24|0)>>2],on=0|i[jt+4>>2],Rt=0|i[(sn=jt=rt+32|0)>>2],xt=0|i[sn+4>>2],rn=0|i[(Gt=sn=rt+40|0)>>2],an=0|i[Gt+4>>2],kt=0|i[(It=Gt=rt+48|0)>>2],Dt=0|i[It+4>>2],nn=0|i[(tn=It=rt+56|0)>>2],Ct=0|i[tn+4>>2],Nt=0|i[(wt=tn=rt+64|0)>>2],Zt=0|i[wt+4>>2],ht=0|i[(en=wt=rt+72|0)>>2],bt=0|i[en+4>>2],en=0|U(0|(Mt=0|i[(en=at)>>2]),0|(Qt=0|i[en+4>>2]),0|cn,0|dn),i[(Xt=rt)>>2]=en,i[Xt+4>>2]=l,en=0|U(0|(Et=0|i[(en=Xt=at+8|0)>>2]),0|(Ot=0|i[en+4>>2]),0|Ht,0|Kt),i[(Pt=pn)>>2]=en,i[Pt+4>>2]=l,en=0|U(0|(pn=0|i[(en=Pt=at+16|0)>>2]),0|(qt=0|i[en+4>>2]),0|un,0|Lt),i[(Jt=Ut)>>2]=en,i[Jt+4>>2]=l,en=0|U(0|(Ut=0|i[(en=Jt=at+24|0)>>2]),0|(yt=0|i[en+4>>2]),0|Ft,0|on),i[(vt=ln)>>2]=en,i[vt+4>>2]=l,en=0|U(0|(ln=0|i[(en=vt=at+32|0)>>2]),0|(Tt=0|i[en+4>>2]),0|Rt,0|xt),i[(Vt=jt)>>2]=en,i[Vt+4>>2]=l,en=0|U(0|(jt=0|i[(en=Vt=at+40|0)>>2]),0|($t=0|i[en+4>>2]),0|rn,0|an),i[(zt=sn)>>2]=en,i[zt+4>>2]=l,en=0|U(0|(sn=0|i[(en=zt=at+48|0)>>2]),0|(ft=0|i[en+4>>2]),0|kt,0|Dt),i[(gt=Gt)>>2]=en,i[gt+4>>2]=l,en=0|U(0|(Gt=0|i[(en=gt=at+56|0)>>2]),0|(_n=0|i[en+4>>2]),0|nn,0|Ct),i[(Wt=It)>>2]=en,i[Wt+4>>2]=l,en=0|U(0|(It=0|i[(en=Wt=at+64|0)>>2]),0|(St=0|i[en+4>>2]),0|Nt,0|Zt),i[(mt=tn)>>2]=en,i[mt+4>>2]=l,en=0|U(0|(tn=0|i[(en=mt=at+72|0)>>2]),0|(Yt=0|i[en+4>>2]),0|ht,0|bt),i[(Bt=wt)>>2]=en,i[Bt+4>>2]=l,Bt=0|k(0|cn,0|dn,0|Mt,0|Qt),i[(Qt=at)>>2]=Bt,i[Qt+4>>2]=l,Qt=0|k(0|Ht,0|Kt,0|Et,0|Ot),i[(Ot=Xt)>>2]=Qt,i[Ot+4>>2]=l,Ot=0|k(0|un,0|Lt,0|pn,0|qt),i[(qt=Pt)>>2]=Ot,i[qt+4>>2]=l,qt=0|k(0|Ft,0|on,0|Ut,0|yt),i[(yt=Jt)>>2]=qt,i[yt+4>>2]=l,yt=0|k(0|Rt,0|xt,0|ln,0|Tt),i[(Tt=vt)>>2]=yt,i[Tt+4>>2]=l,Tt=0|k(0|rn,0|an,0|jt,0|$t),i[($t=Vt)>>2]=Tt,i[$t+4>>2]=l,$t=0|k(0|kt,0|Dt,0|sn,0|ft),i[(ft=zt)>>2]=$t,i[ft+4>>2]=l,ft=0|k(0|nn,0|Ct,0|Gt,0|_n),i[(_n=gt)>>2]=ft,i[_n+4>>2]=l,_n=0|k(0|Nt,0|Zt,0|It,0|St),i[(St=Wt)>>2]=_n,i[St+4>>2]=l,St=0|k(0|ht,0|bt,0|tn,0|Yt),i[(Yt=mt)>>2]=St,i[Yt+4>>2]=l,O(Ie,rt,ut),O(Me,st,at),St=0|i[(Yt=$e)>>2],mt=0|i[Yt+4>>2],tn=0|i[(Yt=n)>>2],bt=0|i[Yt+4>>2],Yt=0|F(0|St,0|mt,18,0),ht=l,_n=0|U(0|tn,0|bt,0|St,0|mt),mt=0|U(0|_n,0|l,0|Yt,0|ht),i[(ht=n)>>2]=mt,i[ht+4>>2]=l,mt=0|i[(ht=Je)>>2],Yt=0|i[ht+4>>2],_n=0|i[(ht=qe)>>2],St=0|i[ht+4>>2],ht=0|F(0|mt,0|Yt,18,0),bt=l,tn=0|U(0|_n,0|St,0|mt,0|Yt),Yt=0|U(0|tn,0|l,0|ht,0|bt),i[(bt=qe)>>2]=Yt,i[bt+4>>2]=l,Yt=0|i[(bt=ze)>>2],ht=0|i[bt+4>>2],tn=0|i[(bt=Ve)>>2],mt=0|i[bt+4>>2],bt=0|F(0|Yt,0|ht,18,0),St=l,_n=0|U(0|tn,0|mt,0|Yt,0|ht),ht=0|U(0|_n,0|l,0|bt,0|St),i[(St=Ve)>>2]=ht,i[St+4>>2]=l,ht=0|i[(St=We)>>2],bt=0|i[St+4>>2],_n=0|i[(St=He)>>2],Yt=0|i[St+4>>2],St=0|F(0|ht,0|bt,18,0),mt=l,tn=0|U(0|_n,0|Yt,0|ht,0|bt),bt=0|U(0|tn,0|l,0|St,0|mt),i[(mt=He)>>2]=bt,i[mt+4>>2]=l,bt=0|i[(mt=p)>>2],St=0|i[mt+4>>2],tn=0|i[(mt=_)>>2],ht=0|i[mt+4>>2],mt=0|F(0|bt,0|St,18,0),Yt=l,_n=0|U(0|tn,0|ht,0|bt,0|St),St=0|U(0|_n,0|l,0|mt,0|Yt),i[(Yt=_)>>2]=St,i[Yt+4>>2]=l,St=0|i[(Yt=f)>>2],mt=0|i[Yt+4>>2],_n=0|i[(Yt=h)>>2],bt=0|i[Yt+4>>2],Yt=0|F(0|St,0|mt,18,0),ht=l,tn=0|U(0|_n,0|bt,0|St,0|mt),mt=0|U(0|tn,0|l,0|Yt,0|ht),i[(ht=h)>>2]=mt,i[ht+4>>2]=l,mt=0|i[(ht=g)>>2],Yt=0|i[ht+4>>2],tn=0|i[(ht=m)>>2],St=0|i[ht+4>>2],ht=0|F(0|mt,0|Yt,18,0),bt=l,_n=0|U(0|tn,0|St,0|mt,0|Yt),Yt=0|U(0|_n,0|l,0|ht,0|bt),i[(bt=m)>>2]=Yt,i[bt+4>>2]=l,Yt=0|i[(bt=y)>>2],ht=0|i[bt+4>>2],_n=0|i[(bt=E)>>2],mt=0|i[bt+4>>2],bt=0|F(0|Yt,0|ht,18,0),St=l,tn=0|U(0|_n,0|mt,0|Yt,0|ht),ht=0|U(0|tn,0|l,0|bt,0|St),i[(St=E)>>2]=ht,i[St+4>>2]=l,ht=0|i[(St=S)>>2],bt=0|i[St+4>>2],tn=0|i[(St=Ie)>>2],Yt=0|i[St+4>>2],St=0|F(0|ht,0|bt,18,0),mt=l,_n=0|U(0|tn,0|Yt,0|ht,0|bt),bt=0|U(0|_n,0|l,0|St,0|mt),mt=l,i[(St=Ie)>>2]=bt,i[St+4>>2]=mt,i[(St=S)>>2]=0,i[St+4>>2]=0,St=mt,mt=bt,bt=0;do{tn=0|k(0|mt,0|St,0|(Yt=0|B(0|(ht=0|D(0|(_n=0|U(St>>31>>>6|0,0,0|mt,0|St)),0|l,26)),0|(_n=l),26)),0|l),i[(Yt=Ie+(bt<<3)|0)>>2]=tn,i[Yt+4>>2]=l,Zt=0|k(0|(Wt=0|U(0|ht,0|_n,0|i[(tn=Yt=Ie+((1|bt)<<3)|0)>>2],0|i[tn+4>>2])),0|(tn=l),0|(It=0|B(0|(ht=0|D(0|(_n=0|U(tn>>31>>>7|0,0,0|Wt,0|tn)),0|l,25)),0|(_n=l),25)),0|l),i[(It=Yt)>>2]=Zt,i[It+4>>2]=l,mt=0|U(0|ht,0|_n,0|i[(Zt=It=Ie+((bt=bt+2|0)<<3)|0)>>2],0|i[Zt+4>>2]),St=l,i[(Zt=It)>>2]=mt,i[Zt+4>>2]=St}while(bt>>>0<10);St=0|i[(bt=S)>>2],mt=0|i[bt+4>>2],Zt=0|i[(bt=Ie)>>2],It=0|i[bt+4>>2],bt=0|F(0|St,0|mt,18,0),_n=l,ht=0|U(0|Zt,0|It,0|St,0|mt),mt=0|U(0|ht,0|l,0|bt,0|_n),_n=l,i[(bt=S)>>2]=0,i[bt+4>>2]=0,It=0|k(0|mt,0|_n,0|(St=0|B(0|(ht=0|D(0|(bt=0|U(_n>>31>>>6|0,0,0|mt,0|_n)),0|l,26)),0|(bt=l),26)),0|l),St=l,i[(_n=Ie)>>2]=It,i[_n+4>>2]=St,mt=0|U(0|ht,0|bt,0|i[(_n=E)>>2],0|i[_n+4>>2]),_n=l,i[(bt=E)>>2]=mt,i[bt+4>>2]=_n,ht=0|i[(bt=T)>>2],Zt=0|i[bt+4>>2],Yt=0|i[(bt=v)>>2],tn=0|i[bt+4>>2],bt=0|F(0|ht,0|Zt,18,0),Wt=l,Nt=0|U(0|Yt,0|tn,0|ht,0|Zt),Zt=0|U(0|Nt,0|l,0|bt,0|Wt),i[(Wt=v)>>2]=Zt,i[Wt+4>>2]=l,Zt=0|i[(Wt=A)>>2],bt=0|i[Wt+4>>2],Nt=0|i[(Wt=C)>>2],ht=0|i[Wt+4>>2],Wt=0|F(0|Zt,0|bt,18,0),tn=l,Yt=0|U(0|Nt,0|ht,0|Zt,0|bt),bt=0|U(0|Yt,0|l,0|Wt,0|tn),i[(tn=C)>>2]=bt,i[tn+4>>2]=l,bt=0|i[(tn=M)>>2],Wt=0|i[tn+4>>2],Yt=0|i[(tn=b)>>2],Zt=0|i[tn+4>>2],tn=0|F(0|bt,0|Wt,18,0),ht=l,Nt=0|U(0|Yt,0|Zt,0|bt,0|Wt),Wt=0|U(0|Nt,0|l,0|tn,0|ht),i[(ht=b)>>2]=Wt,i[ht+4>>2]=l,Wt=0|i[(ht=R)>>2],tn=0|i[ht+4>>2],Nt=0|i[(ht=N)>>2],bt=0|i[ht+4>>2],ht=0|F(0|Wt,0|tn,18,0),Zt=l,Yt=0|U(0|Nt,0|bt,0|Wt,0|tn),tn=0|U(0|Yt,0|l,0|ht,0|Zt),i[(Zt=N)>>2]=tn,i[Zt+4>>2]=l,tn=0|i[(Zt=w)>>2],ht=0|i[Zt+4>>2],Yt=0|i[(Zt=L)>>2],Wt=0|i[Zt+4>>2],Zt=0|F(0|tn,0|ht,18,0),bt=l,Nt=0|U(0|Yt,0|Wt,0|tn,0|ht),ht=0|U(0|Nt,0|l,0|Zt,0|bt),i[(bt=L)>>2]=ht,i[bt+4>>2]=l,ht=0|i[(bt=j)>>2],Zt=0|i[bt+4>>2],Nt=0|i[(bt=Y)>>2],tn=0|i[bt+4>>2],bt=0|F(0|ht,0|Zt,18,0),Wt=l,Yt=0|U(0|Nt,0|tn,0|ht,0|Zt),Zt=0|U(0|Yt,0|l,0|bt,0|Wt),i[(Wt=Y)>>2]=Zt,i[Wt+4>>2]=l,Zt=0|i[(Wt=K)>>2],bt=0|i[Wt+4>>2],Yt=0|i[(Wt=H)>>2],ht=0|i[Wt+4>>2],Wt=0|F(0|Zt,0|bt,18,0),tn=l,Nt=0|U(0|Yt,0|ht,0|Zt,0|bt),bt=0|U(0|Nt,0|l,0|Wt,0|tn),i[(tn=H)>>2]=bt,i[tn+4>>2]=l,bt=0|i[(tn=W)>>2],Wt=0|i[tn+4>>2],Nt=0|i[(tn=V)>>2],Zt=0|i[tn+4>>2],tn=0|F(0|bt,0|Wt,18,0),ht=l,Yt=0|U(0|Nt,0|Zt,0|bt,0|Wt),Wt=0|U(0|Yt,0|l,0|tn,0|ht),i[(ht=V)>>2]=Wt,i[ht+4>>2]=l,Wt=0|i[(ht=$)>>2],tn=0|i[ht+4>>2],Yt=0|i[(ht=Me)>>2],bt=0|i[ht+4>>2],ht=0|F(0|Wt,0|tn,18,0),Zt=l,Nt=0|U(0|Yt,0|bt,0|Wt,0|tn),tn=0|U(0|Nt,0|l,0|ht,0|Zt),Zt=l,i[(ht=Me)>>2]=tn,i[ht+4>>2]=Zt,i[(ht=$)>>2]=0,i[ht+4>>2]=0,ht=Zt,Zt=tn,tn=0;do{Yt=0|k(0|Zt,0|ht,0|(bt=0|B(0|(Wt=0|D(0|(Nt=0|U(ht>>31>>>6|0,0,0|Zt,0|ht)),0|l,26)),0|(Nt=l),26)),0|l),i[(bt=Me+(tn<<3)|0)>>2]=Yt,i[bt+4>>2]=l,Gt=0|k(0|(ft=0|U(0|Wt,0|Nt,0|i[(Yt=bt=Me+((1|tn)<<3)|0)>>2],0|i[Yt+4>>2])),0|(Yt=l),0|(gt=0|B(0|(Wt=0|D(0|(Nt=0|U(Yt>>31>>>7|0,0,0|ft,0|Yt)),0|l,25)),0|(Nt=l),25)),0|l),i[(gt=bt)>>2]=Gt,i[gt+4>>2]=l,Zt=0|U(0|Wt,0|Nt,0|i[(Gt=gt=Me+((tn=tn+2|0)<<3)|0)>>2],0|i[Gt+4>>2]),ht=l,i[(Gt=gt)>>2]=Zt,i[Gt+4>>2]=ht}while(tn>>>0<10);ht=0|i[(tn=$)>>2],Zt=0|i[tn+4>>2],Gt=0|i[(tn=Me)>>2],gt=0|i[tn+4>>2],tn=0|F(0|ht,0|Zt,18,0),Nt=l,Wt=0|U(0|Gt,0|gt,0|ht,0|Zt),Zt=0|U(0|Wt,0|l,0|tn,0|Nt),Nt=l,i[(tn=$)>>2]=0,i[tn+4>>2]=0,gt=0|k(0|Zt,0|Nt,0|(ht=0|B(0|(Wt=0|D(0|(tn=0|U(Nt>>31>>>6|0,0,0|Zt,0|Nt)),0|l,26)),0|(tn=l),26)),0|l),ht=l,Zt=0|U(0|Wt,0|tn,0|i[(Nt=V)>>2],0|i[Nt+4>>2]),Nt=l,Wt=0|i[(tn=m)>>2],Gt=0|i[tn+4>>2],bt=0|i[(tn=h)>>2],Yt=0|i[tn+4>>2],ft=0|i[(tn=_)>>2],Ct=0|i[tn+4>>2],nn=0|i[(tn=He)>>2],$t=0|i[tn+4>>2],zt=0|i[(tn=Ve)>>2],sn=0|i[tn+4>>2],Dt=0|i[(tn=qe)>>2],kt=0|i[tn+4>>2],Tt=0|i[(tn=n)>>2],Vt=0|i[tn+4>>2],jt=0|i[(tn=z)>>2],an=0|i[tn+4>>2],tn=0|U(0|gt,0|ht,0|It,0|St),i[(rn=Ie)>>2]=tn,i[rn+4>>2]=l,rn=0|U(0|Zt,0|Nt,0|mt,0|_n),i[(tn=E)>>2]=rn,i[tn+4>>2]=l,tn=0|U(0|(rn=0|i[(tn=H)>>2]),0|(yt=0|i[tn+4>>2]),0|Wt,0|Gt),i[(vt=m)>>2]=tn,i[vt+4>>2]=l,vt=0|U(0|(tn=0|i[(vt=Y)>>2]),0|(ln=0|i[vt+4>>2]),0|bt,0|Yt),i[(xt=h)>>2]=vt,i[xt+4>>2]=l,xt=0|U(0|(vt=0|i[(xt=L)>>2]),0|(Rt=0|i[xt+4>>2]),0|ft,0|Ct),i[(qt=_)>>2]=xt,i[qt+4>>2]=l,qt=0|U(0|(xt=0|i[(qt=N)>>2]),0|(Jt=0|i[qt+4>>2]),0|nn,0|$t),i[(Ut=He)>>2]=qt,i[Ut+4>>2]=l,Ut=0|U(0|(qt=0|i[(Ut=b)>>2]),0|(on=0|i[Ut+4>>2]),0|zt,0|sn),i[(Ft=Ve)>>2]=Ut,i[Ft+4>>2]=l,Ft=0|U(0|(Ut=0|i[(Ft=C)>>2]),0|(Ot=0|i[Ft+4>>2]),0|Dt,0|kt),i[(Pt=qe)>>2]=Ft,i[Pt+4>>2]=l,Pt=0|U(0|(Ft=0|i[(Pt=v)>>2]),0|(pn=0|i[Pt+4>>2]),0|Tt,0|Vt),i[(Lt=n)>>2]=Pt,i[Lt+4>>2]=l,Lt=0|U(0|(Pt=0|i[(Lt=q)>>2]),0|(un=0|i[Lt+4>>2]),0|jt,0|an),i[(Qt=z)>>2]=Lt,i[Qt+4>>2]=l,Qt=0|k(0|It,0|St,0|gt,0|ht),i[(ht=Me)>>2]=Qt,i[ht+4>>2]=l,ht=0|k(0|mt,0|_n,0|Zt,0|Nt),i[(Nt=V)>>2]=ht,i[Nt+4>>2]=l,Nt=0|k(0|Wt,0|Gt,0|rn,0|yt),i[(yt=H)>>2]=Nt,i[yt+4>>2]=l,yt=0|k(0|bt,0|Yt,0|tn,0|ln),i[(ln=Y)>>2]=yt,i[ln+4>>2]=l,ln=0|k(0|ft,0|Ct,0|vt,0|Rt),i[(Rt=L)>>2]=ln,i[Rt+4>>2]=l,Rt=0|k(0|nn,0|$t,0|xt,0|Jt),i[(Jt=N)>>2]=Rt,i[Jt+4>>2]=l,Jt=0|k(0|zt,0|sn,0|qt,0|on),i[(on=b)>>2]=Jt,i[on+4>>2]=l,on=0|k(0|Dt,0|kt,0|Ut,0|Ot),i[(Ot=C)>>2]=on,i[Ot+4>>2]=l,Ot=0|k(0|Tt,0|Vt,0|Ft,0|pn),i[(pn=v)>>2]=Ot,i[pn+4>>2]=l,pn=0|k(0|jt,0|an,0|Pt,0|un),i[(un=q)>>2]=pn,i[un+4>>2]=l,I(Re,Ie),I(be,Me),O(Me,be,c),pn=0|i[(un=T)>>2],Pt=0|i[un+4>>2],an=0|i[(un=v)>>2],jt=0|i[un+4>>2],un=0|F(0|pn,0|Pt,18,0),Ot=l,Ft=0|U(0|an,0|jt,0|pn,0|Pt),Pt=0|U(0|Ft,0|l,0|un,0|Ot),i[(Ot=v)>>2]=Pt,i[Ot+4>>2]=l,Pt=0|i[(Ot=A)>>2],un=0|i[Ot+4>>2],Ft=0|i[(Ot=C)>>2],pn=0|i[Ot+4>>2],Ot=0|F(0|Pt,0|un,18,0),jt=l,an=0|U(0|Ft,0|pn,0|Pt,0|un),un=0|U(0|an,0|l,0|Ot,0|jt),i[(jt=C)>>2]=un,i[jt+4>>2]=l,un=0|i[(jt=M)>>2],Ot=0|i[jt+4>>2],an=0|i[(jt=b)>>2],Pt=0|i[jt+4>>2],jt=0|F(0|un,0|Ot,18,0),pn=l,Ft=0|U(0|an,0|Pt,0|un,0|Ot),Ot=0|U(0|Ft,0|l,0|jt,0|pn),i[(pn=b)>>2]=Ot,i[pn+4>>2]=l,Ot=0|i[(pn=R)>>2],jt=0|i[pn+4>>2],Ft=0|i[(pn=N)>>2],un=0|i[pn+4>>2],pn=0|F(0|Ot,0|jt,18,0),Pt=l,an=0|U(0|Ft,0|un,0|Ot,0|jt),jt=0|U(0|an,0|l,0|pn,0|Pt),i[(Pt=N)>>2]=jt,i[Pt+4>>2]=l,jt=0|i[(Pt=w)>>2],pn=0|i[Pt+4>>2],an=0|i[(Pt=L)>>2],Ot=0|i[Pt+4>>2],Pt=0|F(0|jt,0|pn,18,0),un=l,Ft=0|U(0|an,0|Ot,0|jt,0|pn),pn=0|U(0|Ft,0|l,0|Pt,0|un),i[(un=L)>>2]=pn,i[un+4>>2]=l,pn=0|i[(un=j)>>2],Pt=0|i[un+4>>2],Ft=0|i[(un=Y)>>2],jt=0|i[un+4>>2],un=0|F(0|pn,0|Pt,18,0),Ot=l,an=0|U(0|Ft,0|jt,0|pn,0|Pt),Pt=0|U(0|an,0|l,0|un,0|Ot),i[(Ot=Y)>>2]=Pt,i[Ot+4>>2]=l,Pt=0|i[(Ot=K)>>2],un=0|i[Ot+4>>2],an=0|i[(Ot=H)>>2],pn=0|i[Ot+4>>2],Ot=0|F(0|Pt,0|un,18,0),jt=l,Ft=0|U(0|an,0|pn,0|Pt,0|un),un=0|U(0|Ft,0|l,0|Ot,0|jt),i[(jt=H)>>2]=un,i[jt+4>>2]=l,un=0|i[(jt=W)>>2],Ot=0|i[jt+4>>2],Ft=0|i[(jt=V)>>2],Pt=0|i[jt+4>>2],jt=0|F(0|un,0|Ot,18,0),pn=l,an=0|U(0|Ft,0|Pt,0|un,0|Ot),Ot=0|U(0|an,0|l,0|jt,0|pn),i[(pn=V)>>2]=Ot,i[pn+4>>2]=l,Ot=0|i[(pn=$)>>2],jt=0|i[pn+4>>2],an=0|i[(pn=Me)>>2],un=0|i[pn+4>>2],pn=0|F(0|Ot,0|jt,18,0),Pt=l,Ft=0|U(0|an,0|un,0|Ot,0|jt),jt=0|U(0|Ft,0|l,0|pn,0|Pt),Pt=l,i[(pn=Me)>>2]=jt,i[pn+4>>2]=Pt,i[(pn=$)>>2]=0,i[pn+4>>2]=0,pn=Pt,Pt=jt,jt=0;do{an=0|k(0|Pt,0|pn,0|(un=0|B(0|(Ot=0|D(0|(Ft=0|U(pn>>31>>>6|0,0,0|Pt,0|pn)),0|l,26)),0|(Ft=l),26)),0|l),i[(un=Me+(jt<<3)|0)>>2]=an,i[un+4>>2]=l,on=0|k(0|(Vt=0|U(0|Ot,0|Ft,0|i[(an=un=Me+((1|jt)<<3)|0)>>2],0|i[an+4>>2])),0|(an=l),0|(Tt=0|B(0|(Ot=0|D(0|(Ft=0|U(an>>31>>>7|0,0,0|Vt,0|an)),0|l,25)),0|(Ft=l),25)),0|l),i[(Tt=un)>>2]=on,i[Tt+4>>2]=l,Pt=0|U(0|Ot,0|Ft,0|i[(on=Tt=Me+((jt=jt+2|0)<<3)|0)>>2],0|i[on+4>>2]),pn=l,i[(on=Tt)>>2]=Pt,i[on+4>>2]=pn}while(jt>>>0<10);pn=0|i[(jt=$)>>2],Pt=0|i[jt+4>>2],_n=0|i[(jt=Me)>>2],mt=0|i[jt+4>>2],jt=0|F(0|pn,0|Pt,18,0),St=l,It=0|U(0|_n,0|mt,0|pn,0|Pt),Pt=0|U(0|It,0|l,0|jt,0|St),St=l,i[(jt=$)>>2]=0,i[jt+4>>2]=0,mt=0|k(0|Pt,0|St,0|(pn=0|B(0|(It=0|D(0|(jt=0|U(St>>31>>>6|0,0,0|Pt,0|St)),0|l,26)),0|(jt=l),26)),0|l),i[(pn=Me)>>2]=mt,i[pn+4>>2]=l,mt=0|U(0|It,0|jt,0|i[(pn=V)>>2],0|i[pn+4>>2]),i[(pn=V)>>2]=mt,i[pn+4>>2]=l,Ke=Re,t=(Ye=it)+80|0;do{i[Ye>>2]=i[Ke>>2],Ye=Ye+4|0,Ke=Ke+4|0}while((0|Ye)<(0|t));Ke=Me,t=(Ye=ot)+80|0;do{i[Ye>>2]=i[Ke>>2],Ye=Ye+4|0,Ke=Ke+4|0}while((0|Ye)<(0|t));I(Pe,st),I(Oe,ut),O(lt,Pe,Oe),mt=0|i[(pn=lt+144|0)>>2],jt=0|i[pn+4>>2],St=0|i[(It=pn=lt+64|0)>>2],Pt=0|i[It+4>>2],It=0|F(0|mt,0|jt,18,0),_n=l,on=0|U(0|St,0|Pt,0|mt,0|jt),jt=0|U(0|on,0|l,0|It,0|_n),i[(_n=pn)>>2]=jt,i[_n+4>>2]=l,jt=0|i[(_n=lt+136|0)>>2],pn=0|i[_n+4>>2],on=0|i[(It=_n=lt+56|0)>>2],mt=0|i[It+4>>2],It=0|F(0|jt,0|pn,18,0),Pt=l,St=0|U(0|on,0|mt,0|jt,0|pn),pn=0|U(0|St,0|l,0|It,0|Pt),i[(Pt=_n)>>2]=pn,i[Pt+4>>2]=l,pn=0|i[(Pt=lt+128|0)>>2],_n=0|i[Pt+4>>2],St=0|i[(It=Pt=lt+48|0)>>2],jt=0|i[It+4>>2],It=0|F(0|pn,0|_n,18,0),mt=l,on=0|U(0|St,0|jt,0|pn,0|_n),_n=0|U(0|on,0|l,0|It,0|mt),i[(mt=Pt)>>2]=_n,i[mt+4>>2]=l,_n=0|i[(mt=lt+120|0)>>2],Pt=0|i[mt+4>>2],on=0|i[(It=mt=lt+40|0)>>2],pn=0|i[It+4>>2],It=0|F(0|_n,0|Pt,18,0),jt=l,St=0|U(0|on,0|pn,0|_n,0|Pt),Pt=0|U(0|St,0|l,0|It,0|jt),i[(jt=mt)>>2]=Pt,i[jt+4>>2]=l,Pt=0|i[(jt=lt+112|0)>>2],mt=0|i[jt+4>>2],St=0|i[(It=jt=lt+32|0)>>2],_n=0|i[It+4>>2],It=0|F(0|Pt,0|mt,18,0),pn=l,on=0|U(0|St,0|_n,0|Pt,0|mt),mt=0|U(0|on,0|l,0|It,0|pn),i[(pn=jt)>>2]=mt,i[pn+4>>2]=l,mt=0|i[(pn=lt+104|0)>>2],jt=0|i[pn+4>>2],on=0|i[(It=pn=lt+24|0)>>2],Pt=0|i[It+4>>2],It=0|F(0|mt,0|jt,18,0),_n=l,St=0|U(0|on,0|Pt,0|mt,0|jt),jt=0|U(0|St,0|l,0|It,0|_n),i[(_n=pn)>>2]=jt,i[_n+4>>2]=l,jt=0|i[(_n=lt+96|0)>>2],pn=0|i[_n+4>>2],St=0|i[(It=_n=lt+16|0)>>2],mt=0|i[It+4>>2],It=0|F(0|jt,0|pn,18,0),Pt=l,on=0|U(0|St,0|mt,0|jt,0|pn),pn=0|U(0|on,0|l,0|It,0|Pt),i[(Pt=_n)>>2]=pn,i[Pt+4>>2]=l,pn=0|i[(Pt=lt+88|0)>>2],_n=0|i[Pt+4>>2],on=0|i[(It=Pt=lt+8|0)>>2],jt=0|i[It+4>>2],It=0|F(0|pn,0|_n,18,0),mt=l,St=0|U(0|on,0|jt,0|pn,0|_n),_n=0|U(0|St,0|l,0|It,0|mt),i[(mt=Pt)>>2]=_n,i[mt+4>>2]=l,It=0|i[(_n=mt=lt+80|0)>>2],St=0|i[_n+4>>2],pn=0|i[(_n=lt)>>2],jt=0|i[_n+4>>2],_n=0|F(0|It,0|St,18,0),on=l,Tt=0|U(0|pn,0|jt,0|It,0|St),St=0|U(0|Tt,0|l,0|_n,0|on),on=l,i[(_n=lt)>>2]=St,i[_n+4>>2]=on,i[(_n=mt)>>2]=0,i[_n+4>>2]=0,_n=on,on=St,St=0;do{pn=0|k(0|on,0|_n,0|(jt=0|B(0|(It=0|D(0|(Tt=0|U(_n>>31>>>6|0,0,0|on,0|_n)),0|l,26)),0|(Tt=l),26)),0|l),i[(jt=lt+(St<<3)|0)>>2]=pn,i[jt+4>>2]=l,un=0|k(0|(Ft=0|U(0|It,0|Tt,0|i[(pn=jt=lt+((1|St)<<3)|0)>>2],0|i[pn+4>>2])),0|(pn=l),0|(Ot=0|B(0|(It=0|D(0|(Tt=0|U(pn>>31>>>7|0,0,0|Ft,0|pn)),0|l,25)),0|(Tt=l),25)),0|l),i[(Ot=jt)>>2]=un,i[Ot+4>>2]=l,on=0|U(0|It,0|Tt,0|i[(un=Ot=lt+((St=St+2|0)<<3)|0)>>2],0|i[un+4>>2]),_n=l,i[(un=Ot)>>2]=on,i[un+4>>2]=_n}while(St>>>0<10);_n=0|i[(St=mt)>>2],on=0|i[St+4>>2],un=0|i[(St=lt)>>2],Ot=0|i[St+4>>2],St=0|F(0|_n,0|on,18,0),Tt=l,It=0|U(0|un,0|Ot,0|_n,0|on),on=0|U(0|It,0|l,0|St,0|Tt),Tt=l,i[(St=mt)>>2]=0,i[St+4>>2]=0,Ot=0|k(0|on,0|Tt,0|(_n=0|B(0|(It=0|D(0|(St=0|U(Tt>>31>>>6|0,0,0|on,0|Tt)),0|l,26)),0|(St=l),26)),0|l),i[(_n=lt)>>2]=Ot,i[_n+4>>2]=l,Ot=0|U(0|It,0|St,0|i[(_n=Pt)>>2],0|i[_n+4>>2]),i[(_n=Pt)>>2]=Ot,i[_n+4>>2]=l,It=0|k(0|(Ot=0|i[(_n=Pe)>>2]),0|(St=0|i[_n+4>>2]),0|i[(_n=Oe)>>2],0|i[_n+4>>2]),_n=l,i[(Tt=Oe)>>2]=It,i[Tt+4>>2]=_n,jt=0|k(0|(on=0|i[(Tt=J)>>2]),0|(un=0|i[Tt+4>>2]),0|i[(Tt=Q)>>2],0|i[Tt+4>>2]),Tt=l,i[(pn=Q)>>2]=jt,i[pn+4>>2]=Tt,Vt=0|k(0|(Ft=0|i[(pn=X)>>2]),0|(an=0|i[pn+4>>2]),0|i[(pn=Z)>>2],0|i[pn+4>>2]),pn=l,i[(Ut=Z)>>2]=Vt,i[Ut+4>>2]=pn,Jt=0|k(0|(kt=0|i[(Ut=ee)>>2]),0|(Dt=0|i[Ut+4>>2]),0|i[(Ut=te)>>2],0|i[Ut+4>>2]),Ut=l,i[(qt=te)>>2]=Jt,i[qt+4>>2]=Ut,Rt=0|k(0|(sn=0|i[(qt=ne)>>2]),0|(zt=0|i[qt+4>>2]),0|i[(qt=re)>>2],0|i[qt+4>>2]),qt=l,i[(xt=re)>>2]=Rt,i[xt+4>>2]=qt,ln=0|k(0|($t=0|i[(xt=ie)>>2]),0|(nn=0|i[xt+4>>2]),0|i[(xt=ae)>>2],0|i[xt+4>>2]),xt=l,i[(vt=ae)>>2]=ln,i[vt+4>>2]=xt,yt=0|k(0|(Ct=0|i[(vt=oe)>>2]),0|(ft=0|i[vt+4>>2]),0|i[(vt=se)>>2],0|i[vt+4>>2]),vt=l,i[(tn=se)>>2]=yt,i[tn+4>>2]=vt,Nt=0|k(0|(Yt=0|i[(tn=le)>>2]),0|(bt=0|i[tn+4>>2]),0|i[(tn=ue)>>2],0|i[tn+4>>2]),tn=l,i[(rn=ue)>>2]=Nt,i[rn+4>>2]=tn,ht=0|k(0|(Gt=0|i[(rn=ce)>>2]),0|(Wt=0|i[rn+4>>2]),0|i[(rn=de)>>2],0|i[rn+4>>2]),rn=l,i[(Zt=de)>>2]=ht,i[Zt+4>>2]=rn,Lt=0|k(0|(Qt=0|i[(Zt=pe)>>2]),0|(gt=0|i[Zt+4>>2]),0|i[(Zt=_e)>>2],0|i[Zt+4>>2]),Zt=l,i[(Xt=_e)>>2]=Lt,i[Xt+4>>2]=Zt,t=(Ye=fe)+72|0;do{i[Ye>>2]=0,Ye=Ye+4|0}while((0|Ye)<(0|t));Pt=0|F(0|It,0|_n,121665,0),mt=l,i[(Xt=Ce)>>2]=Pt,i[Xt+4>>2]=mt,Xt=0|F(0|jt,0|Tt,121665,0),i[(Et=he)>>2]=Xt,i[Et+4>>2]=l,Et=0|F(0|Vt,0|pn,121665,0),i[(Xt=ge)>>2]=Et,i[Xt+4>>2]=l,Xt=0|F(0|Jt,0|Ut,121665,0),i[(Et=me)>>2]=Xt,i[Et+4>>2]=l,Et=0|F(0|Rt,0|qt,121665,0),i[(Xt=ye)>>2]=Et,i[Xt+4>>2]=l,Xt=0|F(0|ln,0|xt,121665,0),i[(Et=Ee)>>2]=Xt,i[Et+4>>2]=l,Et=0|F(0|yt,0|vt,121665,0),i[(Xt=Se)>>2]=Et,i[Xt+4>>2]=l,Xt=0|F(0|Nt,0|tn,121665,0),i[(Et=Te)>>2]=Xt,i[Et+4>>2]=l,Et=0|F(0|ht,0|rn,121665,0),i[(Xt=ve)>>2]=Et,i[Xt+4>>2]=l,Xt=0|F(0|Lt,0|Zt,121665,0),i[(Et=Ae)>>2]=Xt,i[Et+4>>2]=l,i[(Et=fe)>>2]=0,i[Et+4>>2]=0,Et=mt,mt=Pt,Pt=0;do{Bt=0|k(0|mt,0|Et,0|(Ht=0|B(0|(Kt=0|D(0|(Xt=0|U(Et>>31>>>6|0,0,0|mt,0|Et)),0|l,26)),0|(Xt=l),26)),0|l),i[(Ht=Ce+(Pt<<3)|0)>>2]=Bt,i[Ht+4>>2]=l,cn=0|k(0|(Mt=0|U(0|Kt,0|Xt,0|i[(Bt=Ht=Ce+((1|Pt)<<3)|0)>>2],0|i[Bt+4>>2])),0|(Bt=l),0|(dn=0|B(0|(Kt=0|D(0|(Xt=0|U(Bt>>31>>>7|0,0,0|Mt,0|Bt)),0|l,25)),0|(Xt=l),25)),0|l),i[(dn=Ht)>>2]=cn,i[dn+4>>2]=l,mt=0|U(0|Kt,0|Xt,0|i[(cn=dn=Ce+((Pt=Pt+2|0)<<3)|0)>>2],0|i[cn+4>>2]),Et=l,i[(cn=dn)>>2]=mt,i[cn+4>>2]=Et}while(Pt>>>0<10);Et=0|i[(Pt=fe)>>2],mt=0|i[Pt+4>>2],Zt=0|i[(Pt=Ce)>>2],Lt=0|i[Pt+4>>2],Pt=0|F(0|Et,0|mt,18,0),rn=l,ht=0|U(0|Zt,0|Lt,0|Et,0|mt),mt=0|U(0|ht,0|l,0|Pt,0|rn),rn=l,i[(Pt=fe)>>2]=0,i[Pt+4>>2]=0,Et=0|B(0|(ht=0|D(0|(Pt=0|U(rn>>31>>>6|0,0,0|mt,0|rn)),0|l,26)),0|(Pt=l),26),Lt=l,tn=0|i[(Zt=he)>>2],Nt=0|i[Zt+4>>2],rn=0|k(0|(Zt=0|U(0|mt,0|rn,0|Ot,0|St)),0|l,0|Et,0|Lt),i[(Lt=Ce)>>2]=rn,i[Lt+4>>2]=l,Lt=0|U(0|tn,0|Nt,0|on,0|un),Nt=0|U(0|Lt,0|l,0|ht,0|Pt),i[(Pt=he)>>2]=Nt,i[Pt+4>>2]=l,Nt=0|U(0|i[(Pt=ge)>>2],0|i[Pt+4>>2],0|Ft,0|an),i[(Pt=ge)>>2]=Nt,i[Pt+4>>2]=l,Nt=0|U(0|i[(Pt=me)>>2],0|i[Pt+4>>2],0|kt,0|Dt),i[(Pt=me)>>2]=Nt,i[Pt+4>>2]=l,Nt=0|U(0|i[(Pt=ye)>>2],0|i[Pt+4>>2],0|sn,0|zt),i[(Pt=ye)>>2]=Nt,i[Pt+4>>2]=l,Nt=0|U(0|i[(Pt=Ee)>>2],0|i[Pt+4>>2],0|$t,0|nn),i[(Pt=Ee)>>2]=Nt,i[Pt+4>>2]=l,Nt=0|U(0|i[(Pt=Se)>>2],0|i[Pt+4>>2],0|Ct,0|ft),i[(Pt=Se)>>2]=Nt,i[Pt+4>>2]=l,Nt=0|U(0|i[(Pt=Te)>>2],0|i[Pt+4>>2],0|Yt,0|bt),i[(Pt=Te)>>2]=Nt,i[Pt+4>>2]=l,Nt=0|U(0|i[(Pt=ve)>>2],0|i[Pt+4>>2],0|Gt,0|Wt),i[(Pt=ve)>>2]=Nt,i[Pt+4>>2]=l,Nt=0|U(0|i[(Pt=Ae)>>2],0|i[Pt+4>>2],0|Qt,0|gt),i[(Pt=Ae)>>2]=Nt,i[Pt+4>>2]=l,O(ct,Oe,Ce),Nt=0|i[(Pt=ct+144|0)>>2],ht=0|i[Pt+4>>2],tn=0|i[(Lt=Pt=ct+64|0)>>2],rn=0|i[Lt+4>>2],Lt=0|F(0|Nt,0|ht,18,0),Et=l,Zt=0|U(0|tn,0|rn,0|Nt,0|ht),ht=0|U(0|Zt,0|l,0|Lt,0|Et),i[(Et=Pt)>>2]=ht,i[Et+4>>2]=l,ht=0|i[(Et=ct+136|0)>>2],Pt=0|i[Et+4>>2],Zt=0|i[(Lt=Et=ct+56|0)>>2],Nt=0|i[Lt+4>>2],Lt=0|F(0|ht,0|Pt,18,0),rn=l,tn=0|U(0|Zt,0|Nt,0|ht,0|Pt),Pt=0|U(0|tn,0|l,0|Lt,0|rn),i[(rn=Et)>>2]=Pt,i[rn+4>>2]=l,Pt=0|i[(rn=ct+128|0)>>2],Et=0|i[rn+4>>2],tn=0|i[(Lt=rn=ct+48|0)>>2],ht=0|i[Lt+4>>2],Lt=0|F(0|Pt,0|Et,18,0),Nt=l,Zt=0|U(0|tn,0|ht,0|Pt,0|Et),Et=0|U(0|Zt,0|l,0|Lt,0|Nt),i[(Nt=rn)>>2]=Et,i[Nt+4>>2]=l,Et=0|i[(Nt=ct+120|0)>>2],rn=0|i[Nt+4>>2],Zt=0|i[(Lt=Nt=ct+40|0)>>2],Pt=0|i[Lt+4>>2],Lt=0|F(0|Et,0|rn,18,0),ht=l,tn=0|U(0|Zt,0|Pt,0|Et,0|rn),rn=0|U(0|tn,0|l,0|Lt,0|ht),i[(ht=Nt)>>2]=rn,i[ht+4>>2]=l,rn=0|i[(ht=ct+112|0)>>2],Nt=0|i[ht+4>>2],tn=0|i[(Lt=ht=ct+32|0)>>2],Et=0|i[Lt+4>>2],Lt=0|F(0|rn,0|Nt,18,0),Pt=l,Zt=0|U(0|tn,0|Et,0|rn,0|Nt),Nt=0|U(0|Zt,0|l,0|Lt,0|Pt),i[(Pt=ht)>>2]=Nt,i[Pt+4>>2]=l,Nt=0|i[(Pt=ct+104|0)>>2],ht=0|i[Pt+4>>2],Zt=0|i[(Lt=Pt=ct+24|0)>>2],rn=0|i[Lt+4>>2],Lt=0|F(0|Nt,0|ht,18,0),Et=l,tn=0|U(0|Zt,0|rn,0|Nt,0|ht),ht=0|U(0|tn,0|l,0|Lt,0|Et),i[(Et=Pt)>>2]=ht,i[Et+4>>2]=l,ht=0|i[(Et=ct+96|0)>>2],Pt=0|i[Et+4>>2],tn=0|i[(Lt=Et=ct+16|0)>>2],Nt=0|i[Lt+4>>2],Lt=0|F(0|ht,0|Pt,18,0),rn=l,Zt=0|U(0|tn,0|Nt,0|ht,0|Pt),Pt=0|U(0|Zt,0|l,0|Lt,0|rn),i[(rn=Et)>>2]=Pt,i[rn+4>>2]=l,Pt=0|i[(rn=ct+88|0)>>2],Et=0|i[rn+4>>2],Zt=0|i[(Lt=rn=ct+8|0)>>2],ht=0|i[Lt+4>>2],Lt=0|F(0|Pt,0|Et,18,0),Nt=l,tn=0|U(0|Zt,0|ht,0|Pt,0|Et),Et=0|U(0|tn,0|l,0|Lt,0|Nt),i[(Nt=rn)>>2]=Et,i[Nt+4>>2]=l,Lt=0|i[(Et=Nt=ct+80|0)>>2],tn=0|i[Et+4>>2],Pt=0|i[(Et=ct)>>2],ht=0|i[Et+4>>2],Et=0|F(0|Lt,0|tn,18,0),Zt=l,mt=0|U(0|Pt,0|ht,0|Lt,0|tn),tn=0|U(0|mt,0|l,0|Et,0|Zt),Zt=l,i[(Et=ct)>>2]=tn,i[Et+4>>2]=Zt,i[(Et=Nt)>>2]=0,i[Et+4>>2]=0,Et=Zt,Zt=tn,tn=0;do{Pt=0|k(0|Zt,0|Et,0|(ht=0|B(0|(Lt=0|D(0|(mt=0|U(Et>>31>>>6|0,0,0|Zt,0|Et)),0|l,26)),0|(mt=l),26)),0|l),i[(ht=ct+(tn<<3)|0)>>2]=Pt,i[ht+4>>2]=l,xt=0|k(0|(vt=0|U(0|Lt,0|mt,0|i[(Pt=ht=ct+((1|tn)<<3)|0)>>2],0|i[Pt+4>>2])),0|(Pt=l),0|(yt=0|B(0|(Lt=0|D(0|(mt=0|U(Pt>>31>>>7|0,0,0|vt,0|Pt)),0|l,25)),0|(mt=l),25)),0|l),i[(yt=ht)>>2]=xt,i[yt+4>>2]=l,Zt=0|U(0|Lt,0|mt,0|i[(xt=yt=ct+((tn=tn+2|0)<<3)|0)>>2],0|i[xt+4>>2]),Et=l,i[(xt=yt)>>2]=Zt,i[xt+4>>2]=Et}while(tn>>>0<10);Et=0|i[(tn=Nt)>>2],Zt=0|i[tn+4>>2],gt=0|i[(tn=ct)>>2],Qt=0|i[tn+4>>2],tn=0|F(0|Et,0|Zt,18,0),Wt=l,Gt=0|U(0|gt,0|Qt,0|Et,0|Zt),Zt=0|U(0|Gt,0|l,0|tn,0|Wt),Wt=l,i[(tn=Nt)>>2]=0,i[tn+4>>2]=0,Qt=0|k(0|Zt,0|Wt,0|(Et=0|B(0|(Gt=0|D(0|(tn=0|U(Wt>>31>>>6|0,0,0|Zt,0|Wt)),0|l,26)),0|(tn=l),26)),0|l),i[(Et=ct)>>2]=Qt,i[Et+4>>2]=l,Qt=0|U(0|Gt,0|tn,0|i[(Et=rn)>>2],0|i[Et+4>>2]),i[(Et=rn)>>2]=Qt,i[Et+4>>2]=l,Et=0;do{Gt=0|i[(tn=Qt=lt+(Et<<3)|0)>>2],Wt=0|i[tn+4>>2],gt=0|i[(Zt=tn=it+(Et<<3)|0)>>2],Yt=((bt=0|i[Zt+4>>2])^Wt)&_t,Wt=0|D(0,(Zt=(gt^Gt)&pt)^Gt|0,32),i[(Gt=Qt)>>2]=Wt,i[Gt+4>>2]=l,Gt=0|D(0,Zt^gt|0,32),i[(gt=tn)>>2]=Gt,i[gt+4>>2]=l,Et=Et+1|0}while(10!=(0|Et));fn=0;do{Nt=0|i[(rn=Et=ct+(fn<<3)|0)>>2],gt=0|i[rn+4>>2],tn=0|i[(Gt=rn=ot+(fn<<3)|0)>>2],Wt=((Zt=0|i[Gt+4>>2])^gt)&_t,gt=0|D(0,(Gt=(tn^Nt)&pt)^Nt|0,32),i[(Nt=Et)>>2]=gt,i[Nt+4>>2]=l,Nt=0|D(0,Gt^tn|0,32),i[(tn=rn)>>2]=Nt,i[tn+4>>2]=l,fn=fn+1|0}while(10!=(0|fn));if(8==(0|(nt=nt+1|0))){hn=rt,gn=it,mn=at,yn=ot,En=st,Sn=lt,Tn=ut,vn=ct;break}_t=ct,pt=lt,tn=ot,Nt=it,xe=dt<<1&255,ct=ut,ut=_t,lt=st,st=pt,ot=at,at=tn,it=rt,rt=Nt}if(32==(0|(rt=Qe+1|0))){An=Sn,Cn=vn;break}Qe=rt,Xe=gn,Ze=hn,ke=yn,et=mn,Ue=Sn,tt=En,Ge=vn,De=Tn}Ke=An,t=(Ye=Be)+80|0;do{i[Ye>>2]=i[Ke>>2],Ye=Ye+4|0,Ke=Ke+4|0}while((0|Ye)<(0|t));Ke=Cn,t=(Ye=Fe)+80|0;do{i[Ye>>2]=i[Ke>>2],Ye=Ye+4|0,Ke=Ke+4|0}while((0|Ye)<(0|t));I(Ce,Fe),I(Le,Ce),I(we,Le),P(Pe,we,Fe),P(Oe,Pe,Ce),I(we,Oe),P(Ie,we,Pe),I(we,Ie),I(Le,we),I(we,Le),I(Le,we),I(we,Le),P(Me,we,Ie),I(we,Me),I(Le,we),I(we,Le),I(Le,we),I(we,Le),I(Le,we),I(we,Le),I(Le,we),I(we,Le),I(Le,we),P(be,Le,Me),I(we,be),I(Le,we),I(we,Le),I(Le,we),I(we,Le),I(Le,we),I(we,Le),I(Le,we),I(we,Le),I(Le,we),I(we,Le),I(Le,we),I(we,Le),I(Le,we),I(we,Le),I(Le,we),I(we,Le),I(Le,we),I(we,Le),I(Le,we),P(we,Le,be),I(Le,we),I(we,Le),I(Le,we),I(we,Le),I(Le,we),I(we,Le),I(Le,we),I(we,Le),I(Le,we),I(we,Le),P(Re,we,Me),I(we,Re),I(Le,we),Me=2;do{I(we,Le),I(Le,we),Me=Me+2|0}while((0|Me)<50);P(Ne,Le,Re),I(Le,Ne),I(we,Le),Me=2;do{I(Le,we),I(we,Le),Me=Me+2|0}while((0|Me)<100);P(Le,we,Ne),I(we,Le),I(Le,we),Ne=2;do{I(we,Le),I(Le,we),Ne=Ne+2|0}while((0|Ne)<50);for(P(we,Le,Re),I(Le,we),I(we,Le),I(Le,we),I(we,Le),I(Le,we),P(je,Le,Oe),P(Fe,Be,je),je=0|i[Fe>>2],i[Ce>>2]=je,i[(Be=Ce+4|0)>>2]=i[Fe+8>>2],i[(Oe=Ce+8|0)>>2]=i[Fe+16>>2],i[(Le=Ce+12|0)>>2]=i[Fe+24>>2],i[(we=Ce+16|0)>>2]=i[Fe+32>>2],i[(Re=Ce+20|0)>>2]=i[Fe+40>>2],i[(Ne=Ce+24|0)>>2]=i[Fe+48>>2],i[(Me=Ce+28|0)>>2]=i[Fe+56>>2],i[(be=Ce+32|0)>>2]=i[Fe+64>>2],i[(Ie=Ce+36|0)>>2]=i[Fe+72>>2],Fe=je,je=0;Pe=Ce+(je<<2)|0,Ke=Fe>>31&Fe,1&je?(t=Ke>>25,i[Pe>>2]=(0|u(t,-33554432))+Fe,An=(0|i[(Ke=Ce+((Pe=je+1|0)<<2)|0)>>2])+t|0,i[Ke>>2]=An,Pn=An,On=Pe):(Ye=Ke>>26,i[Pe>>2]=(0|u(Ye,-67108864))+Fe,An=(0|i[(Cn=Ce+((t=je+1|0)<<2)|0)>>2])+Ye|0,i[Cn>>2]=An,Pn=An,On=t),9!=(0|On);)Fe=Pn,je=On;for(je=((On=0|i[Ie>>2])>>31&On)>>25,i[Ie>>2]=(0|u(je,-33554432))+On,On=(19*je|0)+(0|i[Ce>>2])|0,i[Ce>>2]=On,je=On,On=0;Pn=Ce+(On<<2)|0,Fe=je>>31&je,1&On?(t=Fe>>25,i[Pn>>2]=(0|u(t,-33554432))+je,An=(0|i[(Fe=Ce+((Pn=On+1|0)<<2)|0)>>2])+t|0,i[Fe>>2]=An,In=Pn,Mn=An):(Pe=Fe>>26,i[Pn>>2]=(0|u(Pe,-67108864))+je,t=(0|i[(Ke=Ce+((An=On+1|0)<<2)|0)>>2])+Pe|0,i[Ke>>2]=t,In=An,Mn=t),9!=(0|In);)je=Mn,On=In;for(On=((In=0|i[Ie>>2])>>31&In)>>25,i[Ie>>2]=(0|u(On,-33554432))+In,In=(19*On|0)+(0|i[Ce>>2])|0,Mn=(0|u(On=(In>>31&In)>>26,-67108864))+In|0,i[Ce>>2]=Mn,i[Be>>2]=On+(0|i[Be>>2]),On=Mn,Mn=0;In=Ce+(Mn<<2)|0,1&Mn?(i[In>>2]=33554431&On,je=(0|i[(Pn=Ce+((In=Mn+1|0)<<2)|0)>>2])+(On>>25)|0,i[Pn>>2]=je,bn=In,Rn=je):(i[In>>2]=67108863&On,Pn=(0|i[(An=Ce+((je=Mn+1|0)<<2)|0)>>2])+(On>>26)|0,i[An>>2]=Pn,bn=je,Rn=Pn),9!=(0|bn);)On=Rn,Mn=bn;for(bn=0|i[Ie>>2],i[Ie>>2]=33554431&bn,Mn=(19*(bn>>25)|0)+(0|i[Ce>>2])|0,i[Ce>>2]=Mn,bn=Mn,Mn=0;Rn=Ce+(Mn<<2)|0,1&Mn?(i[Rn>>2]=33554431&bn,On=(0|i[(In=Ce+((Rn=Mn+1|0)<<2)|0)>>2])+(bn>>25)|0,i[In>>2]=On,Nn=Rn,wn=On):(i[Rn>>2]=67108863&bn,In=(0|i[(je=Ce+((On=Mn+1|0)<<2)|0)>>2])+(bn>>26)|0,i[je>>2]=In,Nn=On,wn=In),9!=(0|Nn);)bn=wn,Mn=Nn;for(Mn=33554431&(Nn=0|i[Ie>>2]),i[Ie>>2]=Mn,wn=(19*(Nn>>25)|0)+(0|i[Ce>>2])|0,i[Ce>>2]=wn,Nn=1,bn=~(wn+-67108845>>31);;){if(On=0|i[Ce+(Nn<<2)>>2],Ln=1&Nn?(On=(In=(On=(In=On<<16&(-33554432^On))<<8&In)<<4&On)<<2&In)<<1&On:(In=(Rn=(In=(Rn=On<<16&(-67108864^On))<<8&Rn)<<4&In)<<2&Rn)<<1&In,On=Ln>>31&bn,10==(0|(Nn=Nn+1|0))){Dn=On;break}bn=On}return bn=wn-(67108845&Dn)|0,i[Ce>>2]=bn,Ce=67108863&Dn,wn=33554431&Dn,Ln=(Nn=(0|i[Be>>2])-wn|0)<<2,In=(On=(0|i[Oe>>2])-Ce|0)<<3,je=(Rn=(0|i[Le>>2])-wn|0)<<5,Dn=(Pn=(0|i[we>>2])-Dn|0)<<6,An=(0|i[Re>>2])-wn|0,i[Re>>2]=An,Fe=(Re=(0|i[Ne>>2])-Ce|0)<<1,Ke=(t=(0|i[Me>>2])-wn|0)<<3,Pe=(0|i[be>>2])-Ce<<4,i[Be>>2]=Ln,i[Oe>>2]=In,i[Le>>2]=je,i[we>>2]=Dn,i[Ne>>2]=Fe,i[Me>>2]=Ke,i[be>>2]=Pe,i[Ie>>2]=Mn-wn<<6,r[e>>0]=bn,r[e+1>>0]=bn>>>8,r[e+2>>0]=bn>>>16,r[e+3>>0]=Ln|bn>>>24,r[e+4>>0]=Nn>>>6,r[e+5>>0]=Nn>>>14,r[e+6>>0]=In|Nn>>>22,r[e+7>>0]=On>>>5,r[e+8>>0]=On>>>13,r[e+9>>0]=je|On>>>21,r[e+10>>0]=Rn>>>3,r[e+11>>0]=Rn>>>11,r[e+12>>0]=Dn|Rn>>>19,r[e+13>>0]=Pn>>>2,r[e+14>>0]=Pn>>>10,r[e+15>>0]=Pn>>>18,r[e+16>>0]=An,r[e+17>>0]=An>>>8,r[e+18>>0]=An>>>16,r[e+19>>0]=An>>>24|Fe,r[e+20>>0]=Re>>>7,r[e+21>>0]=Re>>>15,r[e+22>>0]=Re>>>23|Ke,r[e+23>>0]=t>>>5,r[e+24>>0]=t>>>13,Ke=0|i[be>>2],r[e+25>>0]=t>>>21|Ke,r[e+26>>0]=Ke>>>8,r[e+27>>0]=Ke>>>16,t=0|i[Ie>>2],r[e+28>>0]=Ke>>>24|t,r[e+29>>0]=t>>>8,r[e+30>>0]=t>>>16,r[e+31>>0]=t>>>24,o=s,0},_free:function(e){var t,n,r=0,a=0,o=0,s=0,l=0,u=0,c=0,d=0,p=0,_=0,f=0,g=0,m=0,y=0,E=0,S=0,T=0,v=0,A=0,C=0,P=0,O=0,I=0,M=0,b=0,R=0,N=0,w=0,L=0,D=0,k=0,U=0,G=0,x=0;if(e|=0){(r=e+-8|0)>>>0<(a=0|i[47])>>>0&&h(),1==(0|(e=3&(t=0|i[e+-4>>2])))&&h(),n=r+(o=-8&t)|0;do{if(1&t)p=r,_=o;else{if(s=0|i[r>>2],!e)return;if(u=s+o|0,(l=r+(0-s)|0)>>>0<a>>>0&&h(),(0|l)==(0|i[48])){if(3!=(3&(d=0|i[(c=n+4|0)>>2])|0)){p=l,_=u;break}return i[45]=u,i[c>>2]=-2&d,i[l+4>>2]=1|u,void(i[l+u>>2]=u)}if(d=s>>>3,s>>>0<256){if(s=0|i[l+8>>2],c=0|i[l+12>>2],(0|s)!=(0|(f=212+(d<<1<<2)|0))&&(s>>>0<a>>>0&&h(),(0|i[s+12>>2])!=(0|l)&&h()),(0|c)==(0|s)){i[43]=i[43]&~(1<<d),p=l,_=u;break}(0|c)!=(0|f)?(c>>>0<a>>>0&&h(),(0|i[(f=c+8|0)>>2])==(0|l)?g=f:h()):g=c+8|0,i[s+12>>2]=c,i[g>>2]=s,p=l,_=u;break}s=0|i[l+24>>2],c=0|i[l+12>>2];do{if((0|c)==(0|l)){if(m=0|i[(d=(f=l+16|0)+4|0)>>2])S=m,T=d;else{if(!(y=0|i[f>>2])){E=0;break}S=y,T=f}for(;;)if(m=0|i[(d=S+20|0)>>2])S=m,T=d;else{if(!(m=0|i[(d=S+16|0)>>2])){v=S,A=T;break}S=m,T=d}if(!(A>>>0<a>>>0)){i[A>>2]=0,E=v;break}h()}else{if((d=0|i[l+8>>2])>>>0<a>>>0&&h(),(0|i[(m=d+12|0)>>2])!=(0|l)&&h(),(0|i[(f=c+8|0)>>2])==(0|l)){i[m>>2]=c,i[f>>2]=d,E=c;break}h()}}while(0);if(s){if(c=0|i[l+28>>2],(0|l)==(0|i[(d=476+(c<<2)|0)>>2])){if(i[d>>2]=E,!E){i[44]=i[44]&~(1<<c),p=l,_=u;break}}else if(s>>>0<(0|i[47])>>>0&&h(),(0|i[(c=s+16|0)>>2])==(0|l)?i[c>>2]=E:i[s+20>>2]=E,!E){p=l,_=u;break}E>>>0<(c=0|i[47])>>>0&&h(),i[E+24>>2]=s,f=0|i[(d=l+16|0)>>2];do{if(f){if(!(f>>>0<c>>>0)){i[E+16>>2]=f,i[f+24>>2]=E;break}h()}}while(0);if(f=0|i[d+4>>2]){if(!(f>>>0<(0|i[47])>>>0)){i[E+20>>2]=f,i[f+24>>2]=E,p=l,_=u;break}h()}else p=l,_=u}else p=l,_=u}}while(0);if(p>>>0>=n>>>0&&h(),1&(r=0|i[(o=n+4|0)>>2])||h(),2&r)i[o>>2]=-2&r,i[p+4>>2]=1|_,i[p+_>>2]=_,R=_;else{if((0|n)==(0|i[49])){if(E=(0|i[46])+_|0,i[46]=E,i[49]=p,i[p+4>>2]=1|E,(0|p)!=(0|i[48]))return;return i[48]=0,void(i[45]=0)}if((0|n)==(0|i[48]))return E=(0|i[45])+_|0,i[45]=E,i[48]=p,i[p+4>>2]=1|E,void(i[p+E>>2]=E);E=(-8&r)+_|0,a=r>>>3;do{if(r>>>0>=256){v=0|i[n+24>>2],A=0|i[n+12>>2];do{if((0|A)==(0|n)){if(g=0|i[(S=(T=n+16|0)+4|0)>>2])P=g,O=S;else{if(!(e=0|i[T>>2])){C=0;break}P=e,O=T}for(;;)if(g=0|i[(S=P+20|0)>>2])P=g,O=S;else{if(!(g=0|i[(S=P+16|0)>>2])){I=P,M=O;break}P=g,O=S}if(!(M>>>0<(0|i[47])>>>0)){i[M>>2]=0,C=I;break}h()}else{if((S=0|i[n+8>>2])>>>0<(0|i[47])>>>0&&h(),(0|i[(g=S+12|0)>>2])!=(0|n)&&h(),(0|i[(T=A+8|0)>>2])==(0|n)){i[g>>2]=A,i[T>>2]=S,C=A;break}h()}}while(0);if(v){if(A=0|i[n+28>>2],(0|n)==(0|i[(u=476+(A<<2)|0)>>2])){if(i[u>>2]=C,!C){i[44]=i[44]&~(1<<A);break}}else if(v>>>0<(0|i[47])>>>0&&h(),(0|i[(A=v+16|0)>>2])==(0|n)?i[A>>2]=C:i[v+20>>2]=C,!C)break;C>>>0<(A=0|i[47])>>>0&&h(),i[C+24>>2]=v,l=0|i[(u=n+16|0)>>2];do{if(l){if(!(l>>>0<A>>>0)){i[C+16>>2]=l,i[l+24>>2]=C;break}h()}}while(0);if(l=0|i[u+4>>2]){if(!(l>>>0<(0|i[47])>>>0)){i[C+20>>2]=l,i[l+24>>2]=C;break}h()}}}else{if(l=0|i[n+8>>2],A=0|i[n+12>>2],(0|l)!=(0|(v=212+(a<<1<<2)|0))&&(l>>>0<(0|i[47])>>>0&&h(),(0|i[l+12>>2])!=(0|n)&&h()),(0|A)==(0|l)){i[43]=i[43]&~(1<<a);break}(0|A)!=(0|v)?(A>>>0<(0|i[47])>>>0&&h(),(0|i[(v=A+8|0)>>2])==(0|n)?b=v:h()):b=A+8|0,i[l+12>>2]=A,i[b>>2]=l}}while(0);if(i[p+4>>2]=1|E,i[p+E>>2]=E,(0|p)==(0|i[48]))return void(i[45]=E);R=E}if(_=R>>>3,R>>>0<256)return r=212+(_<<1<<2)|0,(o=0|i[43])&(E=1<<_)?(b=0|i[(_=r+8|0)>>2])>>>0<(0|i[47])>>>0?h():(N=_,w=b):(i[43]=o|E,N=r+8|0,w=r),i[N>>2]=p,i[w+12>>2]=p,i[p+8>>2]=w,void(i[p+12>>2]=r);L=(r=R>>>8)?R>>>0>16777215?31:R>>>((o=14-((r=((N=r<<(w=(r+1048320|0)>>>16&8))+520192|0)>>>16&4)|w|(N=((E=N<<r)+245760|0)>>>16&2))+(E<<N>>>15)|0)+7|0)&1|o<<1:0,o=476+(L<<2)|0,i[p+28>>2]=L,i[p+20>>2]=0,i[p+16>>2]=0,N=0|i[44],E=1<<L;do{if(N&E){for(w=R<<(31==(0|L)?0:25-(L>>>1)|0),r=0|i[o>>2];;){if((-8&i[r+4>>2]|0)==(0|R)){D=r,k=130;break}if(!(_=0|i[(b=r+16+(w>>>31<<2)|0)>>2])){U=b,G=r,k=127;break}w<<=1,r=_}if(127==(0|k)){if(!(U>>>0<(0|i[47])>>>0)){i[U>>2]=p,i[p+24>>2]=G,i[p+12>>2]=p,i[p+8>>2]=p;break}h()}else if(130==(0|k)){if((w=0|i[(r=D+8|0)>>2])>>>0>=(u=0|i[47])>>>0&D>>>0>=u>>>0){i[w+12>>2]=p,i[r>>2]=p,i[p+8>>2]=w,i[p+12>>2]=D,i[p+24>>2]=0;break}h()}}else i[44]=N|E,i[o>>2]=p,i[p+24>>2]=o,i[p+12>>2]=p,i[p+8>>2]=p}while(0);if(p=(0|i[51])-1|0,i[51]=p,!p){for(x=628;p=0|i[x>>2];)x=p+8|0;i[51]=-1}}},_i64Add:U,_bitshift64Ashr:D,_i64Subtract:k,_memset:G,_malloc:function(e){e|=0;var t=0,n=0,r=0,a=0,o=0,s=0,l=0,u=0,c=0,d=0,p=0,_=0,f=0,y=0,E=0,S=0,T=0,v=0,C=0,P=0,O=0,I=0,b=0,R=0,N=0,w=0,L=0,D=0,k=0,U=0,G=0,x=0,B=0,F=0,j=0,Y=0,K=0,H=0,W=0,V=0,$=0,z=0,q=0,J=0,Q=0,X=0,Z=0,ee=0,te=0,ne=0,re=0,ie=0,ae=0,oe=0,se=0,le=0,ue=0,ce=0,de=0,pe=0,_e=0,fe=0,he=0,ge=0,me=0,ye=0,Ee=0,Se=0,Te=0,ve=0,Ae=0,Ce=0,Pe=0,Oe=0,Ie=0,Me=0,be=0,Re=0,Ne=0,we=0,Le=0,De=0,ke=0,Ue=0,Ge=0,xe=0,Be=0,Fe=0,je=0,Ye=0;do{if(e>>>0<245){if(n=(t=e>>>0<11?16:e+11&-8)>>>3,3&(a=(r=0|i[43])>>>n)){u=0|i[(l=(s=212+((o=(1&a^1)+n|0)<<1<<2)|0)+8|0)>>2],d=0|i[(c=u+8|0)>>2];do{if((0|s)!=(0|d)){if(d>>>0<(0|i[47])>>>0&&h(),(0|i[(p=d+12|0)>>2])==(0|u)){i[p>>2]=s,i[l>>2]=d;break}h()}else i[43]=r&~(1<<o)}while(0);return d=o<<3,i[u+4>>2]=3|d,i[(l=u+d+4|0)>>2]=1|i[l>>2],0|c}if(t>>>0>(l=0|i[45])>>>0){if(a){_=0|i[(y=(f=212+((E=((d=(p=(d=((s=a<<n&((d=2<<n)|0-d))&0-s)-1|0)>>>(s=d>>>12&16))>>>5&8)|s|(p=(_=p>>>d)>>>2&4)|(_=(f=_>>>p)>>>1&2)|(f=(y=f>>>_)>>>1&1))+(y>>>f)|0)<<1<<2)|0)+8|0)>>2],s=0|i[(p=_+8|0)>>2];do{if((0|f)!=(0|s)){if(s>>>0<(0|i[47])>>>0&&h(),(0|i[(d=s+12|0)>>2])==(0|_)){i[d>>2]=f,i[y>>2]=s,S=0|i[45];break}h()}else i[43]=r&~(1<<E),S=l}while(0);return l=(E<<3)-t|0,i[_+4>>2]=3|t,i[(r=_+t|0)+4>>2]=1|l,i[r+l>>2]=l,S&&(s=0|i[48],f=212+((y=S>>>3)<<1<<2)|0,(n=0|i[43])&(a=1<<y)?(c=0|i[(y=f+8|0)>>2])>>>0<(0|i[47])>>>0?h():(T=y,v=c):(i[43]=n|a,T=f+8|0,v=f),i[T>>2]=s,i[v+12>>2]=s,i[s+8>>2]=v,i[s+12>>2]=f),i[45]=l,i[48]=r,0|p}if(r=0|i[44]){for(c=0|i[476+(((l=(f=(l=(r&0-r)-1|0)>>>(r=l>>>12&16))>>>5&8)|r|(f=(s=f>>>l)>>>2&4)|(s=(a=s>>>f)>>>1&2)|(a=(n=a>>>s)>>>1&1))+(n>>>a)<<2)>>2],a=(-8&i[c+4>>2])-t|0,n=c,s=c;;){if(c=0|i[n+16>>2])O=c;else{if(!(f=0|i[n+20>>2])){C=a,P=s;break}O=f}a=(f=(c=(-8&i[O+4>>2])-t|0)>>>0<a>>>0)?c:a,n=O,s=f?O:s}P>>>0<(s=0|i[47])>>>0&&h(),P>>>0>=(n=P+t|0)>>>0&&h(),a=0|i[P+24>>2],p=0|i[P+12>>2];do{if((0|p)==(0|P)){if(E=0|i[(_=P+20|0)>>2])b=E,R=_;else{if(!(c=0|i[(f=P+16|0)>>2])){I=0;break}b=c,R=f}for(;;)if(E=0|i[(_=b+20|0)>>2])b=E,R=_;else{if(!(E=0|i[(_=b+16|0)>>2])){N=b,w=R;break}b=E,R=_}if(!(w>>>0<s>>>0)){i[w>>2]=0,I=N;break}h()}else{if((_=0|i[P+8>>2])>>>0<s>>>0&&h(),(0|i[(E=_+12|0)>>2])!=(0|P)&&h(),(0|i[(f=p+8|0)>>2])==(0|P)){i[E>>2]=p,i[f>>2]=_,I=p;break}h()}}while(0);do{if(a){if(p=0|i[P+28>>2],(0|P)==(0|i[(s=476+(p<<2)|0)>>2])){if(i[s>>2]=I,!I){i[44]=i[44]&~(1<<p);break}}else if(a>>>0<(0|i[47])>>>0&&h(),(0|i[(p=a+16|0)>>2])==(0|P)?i[p>>2]=I:i[a+20>>2]=I,!I)break;I>>>0<(p=0|i[47])>>>0&&h(),i[I+24>>2]=a,s=0|i[P+16>>2];do{if(s){if(!(s>>>0<p>>>0)){i[I+16>>2]=s,i[s+24>>2]=I;break}h()}}while(0);if(s=0|i[P+20>>2]){if(!(s>>>0<(0|i[47])>>>0)){i[I+20>>2]=s,i[s+24>>2]=I;break}h()}}}while(0);return C>>>0<16?(a=C+t|0,i[P+4>>2]=3|a,i[(s=P+a+4|0)>>2]=1|i[s>>2]):(i[P+4>>2]=3|t,i[n+4>>2]=1|C,i[n+C>>2]=C,(s=0|i[45])&&(a=0|i[48],s=212+((p=s>>>3)<<1<<2)|0,(_=0|i[43])&(f=1<<p)?(E=0|i[(p=s+8|0)>>2])>>>0<(0|i[47])>>>0?h():(L=p,D=E):(i[43]=_|f,L=s+8|0,D=s),i[L>>2]=a,i[D+12>>2]=a,i[a+8>>2]=D,i[a+12>>2]=s),i[45]=C,i[48]=n),0|(P+8|0)}k=t}else k=t}else if(e>>>0<=4294967231)if(a=-8&(s=e+11|0),f=0|i[44]){_=0-a|0,U=(E=s>>>8)?a>>>0>16777215?31:a>>>((r=14-((E=((p=E<<(s=(E+1048320|0)>>>16&8))+520192|0)>>>16&4)|s|(p=((c=p<<E)+245760|0)>>>16&2))+(c<<p>>>15)|0)+7|0)&1|r<<1:0,r=0|i[476+(U<<2)>>2];e:do{if(r)for(p=_,c=0,s=a<<(31==(0|U)?0:25-(U>>>1)|0),E=r,l=0;;){if((u=(y=-8&i[E+4>>2])-a|0)>>>0<p>>>0){if((0|y)==(0|a)){j=u,Y=E,K=E,F=90;break e}H=u,W=E}else H=p,W=l;if(y=0==(0|(u=0|i[E+20>>2]))|(0|u)==(0|(E=0|i[E+16+(s>>>31<<2)>>2]))?c:u,u=0==(0|E)){G=H,x=y,B=W,F=86;break}p=H,c=y,s<<=1&u^1,l=W}else G=_,x=0,B=0,F=86}while(0);if(86==(0|F)){if(0==(0|x)&0==(0|B)){if(!(_=f&((r=2<<U)|0-r))){k=a;break}V=0|i[476+(((r=(t=(r=(_&0-_)-1|0)>>>(_=r>>>12&16))>>>5&8)|_|(t=(n=t>>>r)>>>2&4)|(n=(l=n>>>t)>>>1&2)|(l=(s=l>>>n)>>>1&1))+(s>>>l)<<2)>>2]}else V=x;V?(j=G,Y=V,K=B,F=90):($=G,z=B)}if(90==(0|F))for(;;)if(F=0,n=(s=(l=(-8&i[Y+4>>2])-a|0)>>>0<j>>>0)?l:j,l=s?Y:K,s=0|i[Y+16>>2])j=n,Y=s,K=l,F=90;else{if(!(Y=0|i[Y+20>>2])){$=n,z=l;break}j=n,K=l,F=90}if(0!=(0|z)&&$>>>0<((0|i[45])-a|0)>>>0){z>>>0<(f=0|i[47])>>>0&&h(),z>>>0>=(l=z+a|0)>>>0&&h(),n=0|i[z+24>>2],s=0|i[z+12>>2];do{if((0|s)==(0|z)){if(_=0|i[(t=z+20|0)>>2])J=_,Q=t;else{if(!(c=0|i[(r=z+16|0)>>2])){q=0;break}J=c,Q=r}for(;;)if(_=0|i[(t=J+20|0)>>2])J=_,Q=t;else{if(!(_=0|i[(t=J+16|0)>>2])){X=J,Z=Q;break}J=_,Q=t}if(!(Z>>>0<f>>>0)){i[Z>>2]=0,q=X;break}h()}else{if((t=0|i[z+8>>2])>>>0<f>>>0&&h(),(0|i[(_=t+12|0)>>2])!=(0|z)&&h(),(0|i[(r=s+8|0)>>2])==(0|z)){i[_>>2]=s,i[r>>2]=t,q=s;break}h()}}while(0);do{if(n){if(s=0|i[z+28>>2],(0|z)==(0|i[(f=476+(s<<2)|0)>>2])){if(i[f>>2]=q,!q){i[44]=i[44]&~(1<<s);break}}else if(n>>>0<(0|i[47])>>>0&&h(),(0|i[(s=n+16|0)>>2])==(0|z)?i[s>>2]=q:i[n+20>>2]=q,!q)break;q>>>0<(s=0|i[47])>>>0&&h(),i[q+24>>2]=n,f=0|i[z+16>>2];do{if(f){if(!(f>>>0<s>>>0)){i[q+16>>2]=f,i[f+24>>2]=q;break}h()}}while(0);if(f=0|i[z+20>>2]){if(!(f>>>0<(0|i[47])>>>0)){i[q+20>>2]=f,i[f+24>>2]=q;break}h()}}}while(0);do{if($>>>0>=16){if(i[z+4>>2]=3|a,i[l+4>>2]=1|$,i[l+$>>2]=$,n=$>>>3,$>>>0<256){f=212+(n<<1<<2)|0,(s=0|i[43])&(t=1<<n)?(r=0|i[(n=f+8|0)>>2])>>>0<(0|i[47])>>>0?h():(ee=n,te=r):(i[43]=s|t,ee=f+8|0,te=f),i[ee>>2]=l,i[te+12>>2]=l,i[l+8>>2]=te,i[l+12>>2]=f;break}if(ne=(f=$>>>8)?$>>>0>16777215?31:$>>>((n=14-((f=((s=f<<(t=(f+1048320|0)>>>16&8))+520192|0)>>>16&4)|t|(s=((r=s<<f)+245760|0)>>>16&2))+(r<<s>>>15)|0)+7|0)&1|n<<1:0,n=476+(ne<<2)|0,i[l+28>>2]=ne,i[(s=l+16|0)+4>>2]=0,i[s>>2]=0,!((s=0|i[44])&(r=1<<ne))){i[44]=s|r,i[n>>2]=l,i[l+24>>2]=n,i[l+12>>2]=l,i[l+8>>2]=l;break}for(r=$<<(31==(0|ne)?0:25-(ne>>>1)|0),s=0|i[n>>2];;){if((-8&i[s+4>>2]|0)==(0|$)){re=s,F=148;break}if(!(t=0|i[(n=s+16+(r>>>31<<2)|0)>>2])){ie=n,ae=s,F=145;break}r<<=1,s=t}if(145==(0|F)){if(!(ie>>>0<(0|i[47])>>>0)){i[ie>>2]=l,i[l+24>>2]=ae,i[l+12>>2]=l,i[l+8>>2]=l;break}h()}else if(148==(0|F)){if((r=0|i[(s=re+8|0)>>2])>>>0>=(t=0|i[47])>>>0&re>>>0>=t>>>0){i[r+12>>2]=l,i[s>>2]=l,i[l+8>>2]=r,i[l+12>>2]=re,i[l+24>>2]=0;break}h()}}else r=$+a|0,i[z+4>>2]=3|r,i[(s=z+r+4|0)>>2]=1|i[s>>2]}while(0);return 0|(z+8|0)}k=a}else k=a;else k=-1}while(0);if((z=0|i[45])>>>0>=k>>>0)return $=z-k|0,re=0|i[48],$>>>0>15?(ae=re+k|0,i[48]=ae,i[45]=$,i[ae+4>>2]=1|$,i[ae+$>>2]=$,i[re+4>>2]=3|k):(i[45]=0,i[48]=0,i[re+4>>2]=3|z,i[($=re+z+4|0)>>2]=1|i[$>>2]),0|(re+8|0);if((re=0|i[46])>>>0>k>>>0)return $=re-k|0,i[46]=$,z=(re=0|i[49])+k|0,i[49]=z,i[z+4>>2]=1|$,i[re+4>>2]=3|k,0|(re+8|0);do{if(!(0|i[161])){if(!((re=0|A(30))+-1&re)){i[163]=re,i[162]=re,i[164]=-1,i[165]=-1,i[166]=0,i[154]=0,i[161]=-16&(0|m(0))^1431655768;break}h()}}while(0);if(re=k+48|0,($=(ae=($=0|i[163])+(z=k+47|0)|0)&(ie=0-$|0))>>>0<=k>>>0)return 0|0;if(0!=(0|(ne=0|i[153]))&&(ee=(te=0|i[151])+$|0)>>>0<=te>>>0|ee>>>0>ne>>>0)return 0|0;e:do{if(4&i[154])F=190;else{ne=0|i[49];t:do{if(ne){for(ee=620;;){if((te=0|i[ee>>2])>>>0<=ne>>>0&&(te+(0|i[(q=ee+4|0)>>2])|0)>>>0>ne>>>0){oe=ee,se=q;break}if(!(ee=0|i[ee+8>>2])){F=173;break t}}if((ee=ae-(0|i[46])&ie)>>>0<2147483647)if((0|(q=0|g(0|ee)))==((0|i[oe>>2])+(0|i[se>>2])|0)){if(-1!=(0|q)){le=q,ue=ee,F=193;break e}}else ce=q,de=ee,F=183}else F=173}while(0);do{if(173==(0|F)&&-1!=(0|(ne=0|g(0)))&&(a=ne,pe=(q=(ee=0|i[162])+-1|0)&a?$-a+(q+a&0-ee)|0:$,a=(ee=0|i[151])+pe|0,pe>>>0>k>>>0&pe>>>0<2147483647)){if(0!=(0|(q=0|i[153]))&&a>>>0<=ee>>>0|a>>>0>q>>>0)break;if((0|(q=0|g(0|pe)))==(0|ne)){le=ne,ue=pe,F=193;break e}ce=q,de=pe,F=183}}while(0);t:do{if(183==(0|F)){q=0-de|0;do{if(re>>>0>de>>>0&de>>>0<2147483647&-1!=(0|ce)&&(a=z-de+(ne=0|i[163])&0-ne)>>>0<2147483647){if(-1==(0|g(0|a))){g(0|q);break t}_e=a+de|0;break}_e=de}while(0);if(-1!=(0|ce)){le=ce,ue=_e,F=193;break e}}}while(0);i[154]=4|i[154],F=190}}while(0);if(190==(0|F)&&$>>>0<2147483647&&(_e=0|g(0|$))>>>0<($=0|g(0))>>>0&-1!=(0|_e)&-1!=(0|$)&&(ce=$-_e|0)>>>0>(k+40|0)>>>0&&(le=_e,ue=ce,F=193),193==(0|F)){ce=(0|i[151])+ue|0,i[151]=ce,ce>>>0>(0|i[152])>>>0&&(i[152]=ce),ce=0|i[49];do{if(ce){_e=620;do{if((0|le)==(($=0|i[_e>>2])+(z=0|i[(de=_e+4|0)>>2])|0)){fe=$,he=de,ge=z,me=_e,F=203;break}_e=0|i[_e+8>>2]}while(0!=(0|_e));if(203==(0|F)&&0==(8&i[me+12>>2]|0)&&ce>>>0<le>>>0&ce>>>0>=fe>>>0){i[he>>2]=ge+ue,_e=ce+(z=0==(7&(_e=ce+8|0)|0)?0:0-_e&7)|0,de=ue-z+(0|i[46])|0,i[49]=_e,i[46]=de,i[_e+4>>2]=1|de,i[_e+de+4>>2]=40,i[50]=i[165];break}for(le>>>0<(de=0|i[47])>>>0?(i[47]=le,ye=le):ye=de,de=le+ue|0,_e=620;;){if((0|i[_e>>2])==(0|de)){Ee=_e,Se=_e,F=211;break}if(!(_e=0|i[_e+8>>2])){Te=620;break}}if(211==(0|F)){if(!(8&i[Se+12>>2])){i[Ee>>2]=le,i[(_e=Se+4|0)>>2]=(0|i[_e>>2])+ue,z=le+(0==(7&(_e=le+8|0)|0)?0:0-_e&7)|0,$=de+(0==(7&(_e=de+8|0)|0)?0:0-_e&7)|0,_e=z+k|0,re=$-z-k|0,i[z+4>>2]=3|k;do{if((0|$)!=(0|ce)){if((0|$)==(0|i[48])){pe=(0|i[45])+re|0,i[45]=pe,i[48]=_e,i[_e+4>>2]=1|pe,i[_e+pe>>2]=pe;break}if(1==(3&(pe=0|i[$+4>>2])|0)){se=-8&pe,oe=pe>>>3;e:do{if(pe>>>0>=256){ie=0|i[$+24>>2],ae=0|i[$+12>>2];do{if((0|ae)==(0|$)){if(ne=0|i[(a=(q=$+16|0)+4|0)>>2])Ae=ne,Ce=a;else{if(!(ee=0|i[q>>2])){ve=0;break}Ae=ee,Ce=q}for(;;)if(ne=0|i[(a=Ae+20|0)>>2])Ae=ne,Ce=a;else{if(!(ne=0|i[(a=Ae+16|0)>>2])){Pe=Ae,Oe=Ce;break}Ae=ne,Ce=a}if(!(Oe>>>0<ye>>>0)){i[Oe>>2]=0,ve=Pe;break}h()}else{if((a=0|i[$+8>>2])>>>0<ye>>>0&&h(),(0|i[(ne=a+12|0)>>2])!=(0|$)&&h(),(0|i[(q=ae+8|0)>>2])==(0|$)){i[ne>>2]=ae,i[q>>2]=a,ve=ae;break}h()}}while(0);if(!ie)break;a=476+((ae=0|i[$+28>>2])<<2)|0;do{if((0|$)==(0|i[a>>2])){if(i[a>>2]=ve,ve)break;i[44]=i[44]&~(1<<ae);break e}if(ie>>>0<(0|i[47])>>>0&&h(),(0|i[(q=ie+16|0)>>2])==(0|$)?i[q>>2]=ve:i[ie+20>>2]=ve,!ve)break e}while(0);ve>>>0<(ae=0|i[47])>>>0&&h(),i[ve+24>>2]=ie,q=0|i[(a=$+16|0)>>2];do{if(q){if(!(q>>>0<ae>>>0)){i[ve+16>>2]=q,i[q+24>>2]=ve;break}h()}}while(0);if(!(q=0|i[a+4>>2]))break;if(!(q>>>0<(0|i[47])>>>0)){i[ve+20>>2]=q,i[q+24>>2]=ve;break}h()}else{q=0|i[$+8>>2],ae=0|i[$+12>>2],ie=212+(oe<<1<<2)|0;do{if((0|q)!=(0|ie)){if(q>>>0<ye>>>0&&h(),(0|i[q+12>>2])==(0|$))break;h()}}while(0);if((0|ae)==(0|q)){i[43]=i[43]&~(1<<oe);break}do{if((0|ae)==(0|ie))Ie=ae+8|0;else{if(ae>>>0<ye>>>0&&h(),(0|i[(a=ae+8|0)>>2])==(0|$)){Ie=a;break}h()}}while(0);i[q+12>>2]=ae,i[Ie>>2]=q}}while(0);Me=$+se|0,be=se+re|0}else Me=$,be=re;if(i[(oe=Me+4|0)>>2]=-2&i[oe>>2],i[_e+4>>2]=1|be,i[_e+be>>2]=be,oe=be>>>3,be>>>0<256){pe=212+(oe<<1<<2)|0,ie=0|i[43],a=1<<oe;do{if(ie&a){if((ne=0|i[(oe=pe+8|0)>>2])>>>0>=(0|i[47])>>>0){Re=oe,Ne=ne;break}h()}else i[43]=ie|a,Re=pe+8|0,Ne=pe}while(0);i[Re>>2]=_e,i[Ne+12>>2]=_e,i[_e+8>>2]=Ne,i[_e+12>>2]=pe;break}a=be>>>8;do{if(a){if(be>>>0>16777215){we=31;break}we=be>>>((ee=14-((ne=((se=a<<(ie=(a+1048320|0)>>>16&8))+520192|0)>>>16&4)|ie|(se=((oe=se<<ne)+245760|0)>>>16&2))+(oe<<se>>>15)|0)+7|0)&1|ee<<1}else we=0}while(0);if(a=476+(we<<2)|0,i[_e+28>>2]=we,i[(pe=_e+16|0)+4>>2]=0,i[pe>>2]=0,!((pe=0|i[44])&(ee=1<<we))){i[44]=pe|ee,i[a>>2]=_e,i[_e+24>>2]=a,i[_e+12>>2]=_e,i[_e+8>>2]=_e;break}for(ee=be<<(31==(0|we)?0:25-(we>>>1)|0),pe=0|i[a>>2];;){if((-8&i[pe+4>>2]|0)==(0|be)){Le=pe,F=281;break}if(!(se=0|i[(a=pe+16+(ee>>>31<<2)|0)>>2])){De=a,ke=pe,F=278;break}ee<<=1,pe=se}if(278==(0|F)){if(!(De>>>0<(0|i[47])>>>0)){i[De>>2]=_e,i[_e+24>>2]=ke,i[_e+12>>2]=_e,i[_e+8>>2]=_e;break}h()}else if(281==(0|F)){if((ee=0|i[(pe=Le+8|0)>>2])>>>0>=(se=0|i[47])>>>0&Le>>>0>=se>>>0){i[ee+12>>2]=_e,i[pe>>2]=_e,i[_e+8>>2]=ee,i[_e+12>>2]=Le,i[_e+24>>2]=0;break}h()}}else ee=(0|i[46])+re|0,i[46]=ee,i[49]=_e,i[_e+4>>2]=1|ee}while(0);return 0|(z+8|0)}Te=620}for(;;){if((_e=0|i[Te>>2])>>>0<=ce>>>0&&(re=_e+(0|i[Te+4>>2])|0)>>>0>ce>>>0){Ue=re;break}Te=0|i[Te+8>>2]}_e=(z=(_e=(z=Ue+-47|0)+(0==(7&(re=z+8|0)|0)?0:0-re&7)|0)>>>0<(re=ce+16|0)>>>0?ce:_e)+8|0,$=le+(de=0==(7&($=le+8|0)|0)?0:0-$&7)|0,ee=ue+-40-de|0,i[49]=$,i[46]=ee,i[$+4>>2]=1|ee,i[$+ee+4>>2]=40,i[50]=i[165],i[(ee=z+4|0)>>2]=27,i[_e>>2]=i[155],i[_e+4>>2]=i[156],i[_e+8>>2]=i[157],i[_e+12>>2]=i[158],i[155]=le,i[156]=ue,i[158]=0,i[157]=_e,_e=z+24|0;do{i[(_e=_e+4|0)>>2]=7}while((_e+4|0)>>>0<Ue>>>0);if((0|z)!=(0|ce)){if(_e=z-ce|0,i[ee>>2]=-2&i[ee>>2],i[ce+4>>2]=1|_e,i[z>>2]=_e,$=_e>>>3,_e>>>0<256){de=212+($<<1<<2)|0,(pe=0|i[43])&(se=1<<$)?(a=0|i[($=de+8|0)>>2])>>>0<(0|i[47])>>>0?h():(Ge=$,xe=a):(i[43]=pe|se,Ge=de+8|0,xe=de),i[Ge>>2]=ce,i[xe+12>>2]=ce,i[ce+8>>2]=xe,i[ce+12>>2]=de;break}if(Be=(de=_e>>>8)?_e>>>0>16777215?31:_e>>>(($=14-((de=((pe=de<<(se=(de+1048320|0)>>>16&8))+520192|0)>>>16&4)|se|(pe=((a=pe<<de)+245760|0)>>>16&2))+(a<<pe>>>15)|0)+7|0)&1|$<<1:0,$=476+(Be<<2)|0,i[ce+28>>2]=Be,i[ce+20>>2]=0,i[re>>2]=0,!((pe=0|i[44])&(a=1<<Be))){i[44]=pe|a,i[$>>2]=ce,i[ce+24>>2]=$,i[ce+12>>2]=ce,i[ce+8>>2]=ce;break}for(a=_e<<(31==(0|Be)?0:25-(Be>>>1)|0),pe=0|i[$>>2];;){if((-8&i[pe+4>>2]|0)==(0|_e)){Fe=pe,F=307;break}if(!(se=0|i[($=pe+16+(a>>>31<<2)|0)>>2])){je=$,Ye=pe,F=304;break}a<<=1,pe=se}if(304==(0|F)){if(!(je>>>0<(0|i[47])>>>0)){i[je>>2]=ce,i[ce+24>>2]=Ye,i[ce+12>>2]=ce,i[ce+8>>2]=ce;break}h()}else if(307==(0|F)){if((a=0|i[(pe=Fe+8|0)>>2])>>>0>=(_e=0|i[47])>>>0&Fe>>>0>=_e>>>0){i[a+12>>2]=ce,i[pe>>2]=ce,i[ce+8>>2]=a,i[ce+12>>2]=Fe,i[ce+24>>2]=0;break}h()}}}else{0==(0|(a=0|i[47]))|le>>>0<a>>>0&&(i[47]=le),i[155]=le,i[156]=ue,i[158]=0,i[52]=i[161],i[51]=-1,a=0;do{i[(pe=212+(a<<1<<2)|0)+12>>2]=pe,i[pe+8>>2]=pe,a=a+1|0}while(32!=(0|a));a=le+(pe=0==(7&(a=le+8|0)|0)?0:0-a&7)|0,_e=ue+-40-pe|0,i[49]=a,i[46]=_e,i[a+4>>2]=1|_e,i[a+_e+4>>2]=40,i[50]=i[165]}}while(0);if((ue=0|i[46])>>>0>k>>>0)return le=ue-k|0,i[46]=le,ce=(ue=0|i[49])+k|0,i[49]=ce,i[ce+4>>2]=1|le,i[ue+4>>2]=3|k,0|(ue+8|0)}return i[(0|M())>>2]=12,0|0},_memcpy:function(e,t,n){var a;if(e|=0,t|=0,(0|(n|=0))>=4096)return 0|y(0|e,0|t,0|n);if(a=0|e,(3&e)==(3&t)){for(;3&e;){if(!n)return 0|a;r[e>>0]=0|r[t>>0],e=e+1|0,t=t+1|0,n=n-1|0}for(;(0|n)>=4;)i[e>>2]=i[t>>2],e=e+4|0,t=t+4|0,n=n-4|0}for(;(0|n)>0;)r[e>>0]=0|r[t>>0],e=e+1|0,t=t+1|0,n=n-1|0;return 0|a},_bitshift64Lshr:x,_fflush:function e(t){t|=0;var n=0,r=0,a=0,o=0,s=0,l=0,u=0;do{if(t){if((0|i[t+76>>2])<=-1){n=0|L(t);break}r=0==(0|R()),a=0|L(t),r||N(),n=a}else{if(o=0|i[13]?0|e(0|i[13]):0,p(36),a=0|i[8])for(r=a,a=o;;){if(l=(0|i[r+76>>2])>-1?0|R():0,u=(0|i[r+20>>2])>>>0>(0|i[r+28>>2])>>>0?0|L(r)|a:a,l&&N(),!(r=0|i[r+56>>2])){s=u;break}a=u}else s=o;S(36),n=s}}while(0);return 0|n},___errno_location:M,_bitshift64Shl:B,runPostSets:function(){},stackAlloc:function(e){var t;return t=o,o=(o=o+(e|=0)|0)+15&-16,0|t},stackSave:function(){return 0|o},stackRestore:function(e){o=e|=0},establishStackSpace:function(e,t){o=e|=0,t|=0},setThrew:function(e,t){e|=0,t|=0,s||(s=e,t)},setTempRet0:function(e){l=e|=0},getTempRet0:function(){return 0|l},dynCall_ii:function(e,t){return t|=0,0|j[1&(e|=0)](0|t)},dynCall_iiii:function(e,t,n,r){return t|=0,n|=0,r|=0,0|Y[3&(e|=0)](0|t,0|n,0|r)},dynCall_vi:function(e,t){t|=0,K[1&(e|=0)](0|t)}}}(e.Na,e.Oa,buffer);e._curve25519_donna=Z._curve25519_donna;var Da=e._free=Z._free;e.runPostSets=Z.runPostSets;var cb=e._i64Add=Z._i64Add,ab=e._bitshift64Ashr=Z._bitshift64Ashr,bb=e._i64Subtract=Z._i64Subtract,db=e._memset=Z._memset,ua=e._malloc=Z._malloc,gc=e._memcpy=Z._memcpy,fb=e._bitshift64Lshr=Z._bitshift64Lshr;e._fflush=Z._fflush,e.___errno_location=Z.___errno_location;var gb=e._bitshift64Shl=Z._bitshift64Shl;function xc(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}e.dynCall_ii=Z.dynCall_ii,e.dynCall_iiii=Z.dynCall_iiii,e.dynCall_vi=Z.dynCall_vi,n.W=Z.stackAlloc,n.na=Z.stackSave,n.X=Z.stackRestore,n.md=Z.establishStackSpace,n.cb=Z.setTempRet0,n.Ua=Z.getTempRet0,xc.prototype=Error(),xc.prototype.constructor=xc;var Yc=null,Xa=function t(){e.calledRun||$c(),e.calledRun||(Xa=t)};function $c(t){function n(){if(!e.calledRun&&(e.calledRun=!0,!A)){if(xa||(xa=!0,Oa(Qa)),Oa(Ra),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e._main&&bd&&e.callMain(t),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)Ua(e.postRun.shift());Oa(Sa)}}if(t=t||e.arguments,null===Yc&&(Yc=Date.now()),!(0<L)){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)Ta(e.preRun.shift());Oa(Pa),0<L||e.calledRun||(e.setStatus?(e.setStatus("Running..."),setTimeout((function(){setTimeout((function(){e.setStatus("")}),1),n()}),1)):n())}}function ad(t,n){if(!n||!e.noExitRuntime)throw!e.noExitRuntime&&(A=!0,m=void 0,Oa(K),e.onExit)&&e.onExit(t),new xc(t)}e.callMain=e.jd=function(t){function n(){for(var e=0;3>e;e++)i.push(0)}assert(0==L,"cannot call main when async dependencies remain! (listen on __ATMAIN__)"),assert(0==Pa.length,"cannot call main when preRun functions remain to be called"),t=t||[],xa||(xa=!0,Oa(Qa));var r=t.length+1,i=[G(Va(e.thisProgram),"i8",0)];n();for(var a=0;a<r-1;a+=1)i.push(G(Va(t[a]),"i8",0)),n();i.push(0),i=G(i,"i32",0);try{ad(e._main(r,i,0),!0)}catch(t){if(!(t instanceof xc)){if("SimulateInfiniteLoop"!=t)throw t&&"object"==typeof t&&t.stack&&e.S("exception thrown: "+[t,t.stack]),t;e.noExitRuntime=!0}}},e.run=e.run=$c,e.exit=e.exit=ad;var cd=[];function z(t){void 0!==t?(e.print(t),e.S(t),t=JSON.stringify(t)):t="",A=!0;var n="abort("+t+") at "+Ea()+"\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.";throw cd&&cd.forEach((function(e){n=e(n,t)})),n}if(e.abort=e.abort=z,e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);0<e.preInit.length;)e.preInit.pop()();var bd=!0;e.noInitialRun&&(bd=!1),$c(),module.exports=e},694114:()=>{
/*! modernizr 3.11.8 (Custom Build) | MIT *
* https://modernizr.com/download/?-adownload-cssanimations-csstransitions-exiforientation-serviceworker-webp-domprefixes-hasevent-prefixed-prefixes-setclasses-testallprops-testprop !*/
!function(e,t,n,r){function i(e,t){return typeof e===t}function a(e){var t=T.className,n=E._config.classPrefix||"";if(v&&(t=t.baseVal),E._config.enableJSClass){var r=new RegExp("(^|\\s)"+n+"no-js(\\s|$)");t=t.replace(r,"$1"+n+"js$2")}E._config.enableClasses&&(e.length>0&&(t+=" "+n+e.join(" "+n)),v?T.className.baseVal=t:T.className=t)}function o(){return"function"!=typeof n.createElement?n.createElement(arguments[0]):v?n.createElementNS.call(n,"http://www.w3.org/2000/svg",arguments[0]):n.createElement.apply(n,arguments)}function s(e,t){return!!~(""+e).indexOf(t)}function l(e,t,r,i){var a,s,l,u,c="modernizr",d=o("div"),p=function(){var e=n.body;return e||((e=o(v?"svg":"body")).fake=!0),e}();if(parseInt(r,10))for(;r--;)(l=o("div")).id=i?i[r]:c+(r+1),d.appendChild(l);return(a=o("style")).type="text/css",a.id="s"+c,(p.fake?p:d).appendChild(a),p.appendChild(d),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(n.createTextNode(e)),d.id=c,p.fake&&(p.style.background="",p.style.overflow="hidden",u=T.style.overflow,T.style.overflow="hidden",T.appendChild(p)),s=t(d,e),p.fake&&p.parentNode?(p.parentNode.removeChild(p),T.style.overflow=u,T.offsetHeight):d.parentNode.removeChild(d),!!s}function u(e){return e.replace(/([A-Z])/g,(function(e,t){return"-"+t.toLowerCase()})).replace(/^ms-/,"-ms-")}function c(e,n){var i=e.length;if("CSS"in t&&"supports"in t.CSS){for(;i--;)if(t.CSS.supports(u(e[i]),n))return!0;return!1}if("CSSSupportsRule"in t){for(var a=[];i--;)a.push("("+u(e[i])+":"+n+")");return l("@supports ("+(a=a.join(" or "))+") { #modernizr { position: absolute; } }",(function(e){return"absolute"===function(e,n,r){var i;if("getComputedStyle"in t){i=getComputedStyle.call(t,e,n);var a=t.console;null!==i?r&&(i=i.getPropertyValue(r)):a&&a[a.error?"error":"log"].call(a,"getComputedStyle returning null, its possible modernizr test results are inaccurate")}else i=!n&&e.currentStyle&&e.currentStyle[r];return i}(e,null,"position")}))}return r}function d(e){return e.replace(/([a-z])-([a-z])/g,(function(e,t,n){return t+n.toUpperCase()})).replace(/^-/,"")}function p(e,t,n,a){function l(){p&&(delete b.style,delete b.modElem)}if(a=!i(a,"undefined")&&a,!i(n,"undefined")){var u=c(e,n);if(!i(u,"undefined"))return u}for(var p,_,f,h,g,m=["modernizr","tspan","samp"];!b.style&&m.length;)p=!0,b.modElem=o(m.shift()),b.style=b.modElem.style;for(f=e.length,_=0;_<f;_++)if(h=e[_],g=b.style[h],s(h,"-")&&(h=d(h)),b.style[h]!==r){if(a||i(n,"undefined"))return l(),"pfx"!==t||h;try{b.style[h]=n}catch(e){}if(b.style[h]!==g)return l(),"pfx"!==t||h}return l(),!1}function _(e,t){return function(){return e.apply(t,arguments)}}function f(e,t,n,r,a){var o=e.charAt(0).toUpperCase()+e.slice(1),s=(e+" "+I.join(o+" ")+o).split(" ");return i(t,"string")||i(t,"undefined")?p(s,t,r,a):function(e,t,n){var r;for(var a in e)if(e[a]in t)return!1===n?e[a]:i(r=t[e[a]],"function")?_(r,n||t):r;return!1}(s=(e+" "+C.join(o+" ")+o).split(" "),t,n)}function h(e,t,n){return f(e,r,r,t,n)}function g(e,t){if("object"==typeof e)for(var n in e)R(e,n)&&g(n,e[n]);else{var r=(e=e.toLowerCase()).split("."),i=E[r[0]];if(2===r.length&&(i=i[r[1]]),void 0!==i)return E;t="function"==typeof t?t():t,1===r.length?E[r[0]]=t:(!E[r[0]]||E[r[0]]instanceof Boolean||(E[r[0]]=new Boolean(E[r[0]])),E[r[0]][r[1]]=t),a([(t&&!1!==t?"":"no-")+r.join("-")]),E._trigger(e,t)}return E}var m=[],y={_version:"3.11.8",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout((function(){t(n[e])}),0)},addTest:function(e,t,n){m.push({name:e,fn:t,options:n})},addAsyncTest:function(e){m.push({name:null,fn:e})}},E=function(){};E.prototype=y,E=new E;var S=[],T=n.documentElement,v="svg"===T.nodeName.toLowerCase(),A="Moz O ms Webkit",C=y._config.usePrefixes?A.toLowerCase().split(" "):[];y._domPrefixes=C;var P=y._config.usePrefixes?" -webkit- -moz- -o- -ms- ".split(" "):["",""];y._prefixes=P;var O=function(){var e=!("onblur"in T);return function(t,n){var i;return!!t&&(n&&"string"!=typeof n||(n=o(n||"div")),!(i=(t="on"+t)in n)&&e&&(n.setAttribute||(n=o("div")),n.setAttribute(t,""),i="function"==typeof n[t],n[t]!==r&&(n[t]=r),n.removeAttribute(t)),i)}}();y.hasEvent=O;var I=y._config.usePrefixes?A.split(" "):[];y._cssomPrefixes=I;var M={elem:o("modernizr")};E._q.push((function(){delete M.elem}));var b={style:M.elem.style};E._q.unshift((function(){delete b.style})),y.testAllProps=f;var R,N=function(e){var n,i=P.length,a=t.CSSRule;if(void 0===a)return r;if(!e)return!1;if((n=(e=e.replace(/^@/,"")).replace(/-/g,"_").toUpperCase()+"_RULE")in a)return"@"+e;for(var o=0;o<i;o++){var s=P[o];if(s.toUpperCase()+"_"+n in a)return"@-"+s.toLowerCase()+"-"+e}return!1};y.atRule=N,y.prefixed=function(e,t,n){return 0===e.indexOf("@")?N(e):(-1!==e.indexOf("-")&&(e=d(e)),t?f(e,t,n):f(e,"pfx"))},y.testAllProps=h,y.testProp=function(e,t,n){return p([e],r,t,n)},function(){var e={}.hasOwnProperty;R=i(e,"undefined")||i(e.call,"undefined")?function(e,t){return t in e&&i(e.constructor.prototype[t],"undefined")}:function(t,n){return e.call(t,n)}}(),y._l={},y.on=function(e,t){this._l[e]||(this._l[e]=[]),this._l[e].push(t),E.hasOwnProperty(e)&&setTimeout((function(){E._trigger(e,E[e])}),0)},y._trigger=function(e,t){if(this._l[e]){var n=this._l[e];setTimeout((function(){var e;for(e=0;e<n.length;e++)(0,n[e])(t)}),0),delete this._l[e]}},E._q.push((function(){y.addTest=g})),E.addAsyncTest((function(){function e(e,t,n){function r(t){var r=!(!t||"load"!==t.type)&&1===i.width;g(e,"webp"===e&&r?new Boolean(r):r),n&&n(t)}var i=new Image;i.onerror=r,i.onload=r,i.src=t}var t=[{uri:"data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA=",name:"webp"},{uri:"data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA==",name:"webp.alpha"},{uri:"data:image/webp;base64,UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA",name:"webp.animation"},{uri:"data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=",name:"webp.lossless"}],n=t.shift();e(n.name,n.uri,(function(n){if(n&&"load"===n.type)for(var r=0;r<t.length;r++)e(t[r].name,t[r].uri)}))})),E.addTest("serviceworker","serviceWorker"in navigator),E.addAsyncTest((function(){var e=new Image;e.onerror=function(){g("exiforientation",!1)},e.onload=function(){g("exiforientation",2!==e.width)},e.src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/4QAiRXhpZgAASUkqAAgAAAABABIBAwABAAAABgASAAAAAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wAARCAABAAIDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD+/iiiigD/2Q=="})),E.addTest("adownload",!t.externalHost&&"download"in o("a")),E.addTest("cssanimations",h("animationName","a",!0)),E.addTest("csstransitions",h("transition","all",!0)),function(){var e,t,n,r,a,o;for(var s in m)if(m.hasOwnProperty(s)){if(e=[],(t=m[s]).name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;n<t.options.aliases.length;n++)e.push(t.options.aliases[n].toLowerCase());for(r=i(t.fn,"function")?t.fn():t.fn,a=0;a<e.length;a++)1===(o=e[a].split(".")).length?E[o[0]]=r:(E[o[0]]&&(!E[o[0]]||E[o[0]]instanceof Boolean)||(E[o[0]]=new Boolean(E[o[0]])),E[o[0]][o[1]]=r),S.push((r?"":"no-")+o.join("-"))}}(),a(S),delete y.addTest,delete y.addAsyncTest;for(var w=0;w<E._q.length;w++)E._q[w]();e.Modernizr=E}(window,window,document)},637360:e=>{var t;!function(){function e(e){if(this.mode=r.MODE_8BIT_BYTE,this.data=e,this.parsedData=[],e instanceof ArrayBuffer)this.parsedData=new Int8Array(e);else{for(var t=0,n=this.data.length;t<n;t++){var i=[],a=this.data.charCodeAt(t);a>65536?(i[0]=240|(1835008&a)>>>18,i[1]=128|(258048&a)>>>12,i[2]=128|(4032&a)>>>6,i[3]=128|63&a):a>2048?(i[0]=224|(61440&a)>>>12,i[1]=128|(4032&a)>>>6,i[2]=128|63&a):a>128?(i[0]=192|(1984&a)>>>6,i[1]=128|63&a):i[0]=a,this.parsedData.push(i)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}}function n(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}e.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,n=this.parsedData.length;t<n;t++)e.put(this.parsedData[t],8)}},n.prototype={addData:function(t){var n=new e(t);this.dataList.push(n),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var i=0;i<this.moduleCount;i++)this.modules[r][i]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=n.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var n=-1;n<=7;n++)if(!(e+n<=-1||this.moduleCount<=e+n))for(var r=-1;r<=7;r++)t+r<=-1||this.moduleCount<=t+r||(this.modules[e+n][t+r]=0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4)},getBestMaskPattern:function(){for(var e=0,t=0,n=0;n<8;n++){this.makeImpl(!0,n);var r=_.getLostPoint(this);(0==n||e>r)&&(e=r,t=n)}return t},createMovieClip:function(e,t,n){var r=e.createEmptyMovieClip(t,n);this.make();for(var i=0;i<this.modules.length;i++)for(var a=1*i,o=0;o<this.modules[i].length;o++){var s=1*o;this.modules[i][o]&&(r.beginFill(0,100),r.moveTo(s,a),r.lineTo(s+1,a),r.lineTo(s+1,a+1),r.lineTo(s,a+1),r.endFill())}return r},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)null==this.modules[e][6]&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)null==this.modules[6][t]&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=_.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var n=0;n<e.length;n++){var r=e[t],i=e[n];if(null==this.modules[r][i])for(var a=-2;a<=2;a++)for(var o=-2;o<=2;o++)this.modules[r+a][i+o]=-2==a||2==a||-2==o||2==o||0==a&&0==o}},setupTypeNumber:function(e){for(var t=_.getBCHTypeNumber(this.typeNumber),n=0;n<18;n++){var r=!e&&1==(t>>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(n=0;n<18;n++){r=!e&&1==(t>>n&1);this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}},setupTypeInfo:function(e,t){for(var n=this.errorCorrectLevel<<3|t,r=_.getBCHTypeInfo(n),i=0;i<15;i++){var a=!e&&1==(r>>i&1);i<6?this.modules[i][8]=a:i<8?this.modules[i+1][8]=a:this.modules[this.moduleCount-15+i][8]=a}for(i=0;i<15;i++){a=!e&&1==(r>>i&1);i<8?this.modules[8][this.moduleCount-i-1]=a:i<9?this.modules[8][15-i-1+1]=a:this.modules[8][15-i-1]=a}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var n=-1,r=this.moduleCount-1,i=7,a=0,o=this.moduleCount-1;o>0;o-=2)for(6==o&&o--;;){for(var s=0;s<2;s++)if(null==this.modules[r][o-s]){var l=!1;a<e.length&&(l=1==(e[a]>>>i&1)),_.getMask(t,r,o-s)&&(l=!l),this.modules[r][o-s]=l,-1==--i&&(a++,i=7)}if((r+=n)<0||this.moduleCount<=r){r-=n,n=-n;break}}}},n.PAD0=236,n.PAD1=17,n.createData=function(e,t,r){for(var i=m.getRSBlocks(e,t),a=new y,o=0;o<r.length;o++){var s=r[o];a.put(s.mode,4),a.put(s.getLength(),_.getLengthInBits(s.mode,e)),s.write(a)}var l=0;for(o=0;o<i.length;o++)l+=i[o].dataCount;if(a.getLengthInBits()>8*l)throw new Error("code length overflow. ("+a.getLengthInBits()+">"+8*l+")");for(a.getLengthInBits()+4<=8*l&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(!1);for(;!(a.getLengthInBits()>=8*l||(a.put(n.PAD0,8),a.getLengthInBits()>=8*l));)a.put(n.PAD1,8);return n.createBytes(a,i)},n.createBytes=function(e,t){for(var n=0,r=0,i=0,a=new Array(t.length),o=new Array(t.length),s=0;s<t.length;s++){var l=t[s].dataCount,u=t[s].totalCount-l;r=Math.max(r,l),i=Math.max(i,u),a[s]=new Array(l);for(var c=0;c<a[s].length;c++)a[s][c]=255&e.buffer[c+n];n+=l;var d=_.getErrorCorrectPolynomial(u),p=new g(a[s],d.getLength()-1).mod(d);o[s]=new Array(d.getLength()-1);for(c=0;c<o[s].length;c++){var f=c+p.getLength()-o[s].length;o[s][c]=f>=0?p.get(f):0}}var h=0;for(c=0;c<t.length;c++)h+=t[c].totalCount;var m=new Array(h),y=0;for(c=0;c<r;c++)for(s=0;s<t.length;s++)c<a[s].length&&(m[y++]=a[s][c]);for(c=0;c<i;c++)for(s=0;s<t.length;s++)c<o[s].length&&(m[y++]=o[s][c]);return m};for(var r={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},i={L:1,M:0,Q:3,H:2},a=0,o=1,s=2,l=3,u=4,c=5,d=6,p=7,_={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;_.getBCHDigit(t)-_.getBCHDigit(_.G15)>=0;)t^=_.G15<<_.getBCHDigit(t)-_.getBCHDigit(_.G15);return(e<<10|t)^_.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;_.getBCHDigit(t)-_.getBCHDigit(_.G18)>=0;)t^=_.G18<<_.getBCHDigit(t)-_.getBCHDigit(_.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;0!=e;)t++,e>>>=1;return t},getPatternPosition:function(e){return _.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,n){switch(e){case a:return(t+n)%2==0;case o:return t%2==0;case s:return n%3==0;case l:return(t+n)%3==0;case u:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case c:return t*n%2+t*n%3==0;case d:return(t*n%2+t*n%3)%2==0;case p:return(t*n%3+(t+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new g([1],0),n=0;n<e;n++)t=t.multiply(new g([1,f.gexp(n)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case r.MODE_NUMBER:return 10;case r.MODE_ALPHA_NUM:return 9;case r.MODE_8BIT_BYTE:case r.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case r.MODE_NUMBER:return 12;case r.MODE_ALPHA_NUM:return 11;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else{if(!(t<41))throw new Error("type:"+t);switch(e){case r.MODE_NUMBER:return 14;case r.MODE_ALPHA_NUM:return 13;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}}},getLostPoint:function(e){for(var t=e.getModuleCount(),n=0,r=0;r<t;r++)for(var i=0;i<t;i++){for(var a=0,o=e.isDark(r,i),s=-1;s<=1;s++)if(!(r+s<0||t<=r+s))for(var l=-1;l<=1;l++)i+l<0||t<=i+l||0==s&&0==l||o==e.isDark(r+s,i+l)&&a++;a>5&&(n+=3+a-5)}for(r=0;r<t-1;r++)for(i=0;i<t-1;i++){var u=0;e.isDark(r,i)&&u++,e.isDark(r+1,i)&&u++,e.isDark(r,i+1)&&u++,e.isDark(r+1,i+1)&&u++,0!=u&&4!=u||(n+=3)}for(r=0;r<t;r++)for(i=0;i<t-6;i++)e.isDark(r,i)&&!e.isDark(r,i+1)&&e.isDark(r,i+2)&&e.isDark(r,i+3)&&e.isDark(r,i+4)&&!e.isDark(r,i+5)&&e.isDark(r,i+6)&&(n+=40);for(i=0;i<t;i++)for(r=0;r<t-6;r++)e.isDark(r,i)&&!e.isDark(r+1,i)&&e.isDark(r+2,i)&&e.isDark(r+3,i)&&e.isDark(r+4,i)&&!e.isDark(r+5,i)&&e.isDark(r+6,i)&&(n+=40);var c=0;for(i=0;i<t;i++)for(r=0;r<t;r++)e.isDark(r,i)&&c++;return n+=10*(Math.abs(100*c/t/t-50)/5)}},f={glog:function(e){if(e<1)throw new Error("glog("+e+")");return f.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return f.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},h=0;h<8;h++)f.EXP_TABLE[h]=1<<h;for(h=8;h<256;h++)f.EXP_TABLE[h]=f.EXP_TABLE[h-4]^f.EXP_TABLE[h-5]^f.EXP_TABLE[h-6]^f.EXP_TABLE[h-8];for(h=0;h<255;h++)f.LOG_TABLE[f.EXP_TABLE[h]]=h;function g(e,t){if(null==e.length)throw new Error(e.length+"/"+t);for(var n=0;n<e.length&&0==e[n];)n++;this.num=new Array(e.length-n+t);for(var r=0;r<e.length-n;r++)this.num[r]=e[r+n]}function m(e,t){this.totalCount=e,this.dataCount=t}function y(){this.buffer=[],this.length=0}g.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),n=0;n<this.getLength();n++)for(var r=0;r<e.getLength();r++)t[n+r]^=f.gexp(f.glog(this.get(n))+f.glog(e.get(r)));return new g(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=f.glog(this.get(0))-f.glog(e.get(0)),n=new Array(this.getLength()),r=0;r<this.getLength();r++)n[r]=this.get(r);for(r=0;r<e.getLength();r++)n[r]^=f.gexp(f.glog(e.get(r))+t);return new g(n,0).mod(e)}},m.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],m.getRSBlocks=function(e,t){var n=m.getRsBlockTable(e,t);if(null==n)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var r=n.length/3,i=[],a=0;a<r;a++)for(var o=n[3*a+0],s=n[3*a+1],l=n[3*a+2],u=0;u<o;u++)i.push(new m(s,l));return i},m.getRsBlockTable=function(e,t){switch(t){case i.L:return m.RS_BLOCK_TABLE[4*(e-1)+0];case i.M:return m.RS_BLOCK_TABLE[4*(e-1)+1];case i.Q:return m.RS_BLOCK_TABLE[4*(e-1)+2];case i.H:return m.RS_BLOCK_TABLE[4*(e-1)+3];default:return}},y.prototype={get:function(e){var t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(var n=0;n<t;n++)this.putBit(1==(e>>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var E=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],S=function(e,t){this._bIsPainted=!1,this._htOption=t,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=t.width,this._elCanvas.height=t.height,this._elCanvas.setAttribute("aria-label","Scan me!"),this._elCanvas.setAttribute("role","img"),e.appendChild(this._elCanvas),this._el=e,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._bSupportDataURI=null};function T(e,t){for(var n=1,r=e instanceof ArrayBuffer?e.byteLength:function(e){var t=encodeURI(e).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return t.length+(t.length!=e.length?3:0)}(e),a=0,o=E.length;a<=o;a++){var s=0;switch(t){case i.L:s=E[a][0];break;case i.M:s=E[a][1];break;case i.Q:s=E[a][2];break;case i.H:s=E[a][3]}if(r<=s)break;n++}if(n>E.length)throw new Error("Too long data");return n}S.prototype.draw=function(e){var t=this._oContext,n=this._htOption,r=e.getModuleCount(),i=n.width/r,a=n.height/r,o=Math.round(i),s=Math.round(a);this.clear();for(var l=0;l<r;l++)for(var u=0;u<r;u++){var c=e.isDark(l,u),d=u*i,p=l*a;t.strokeStyle=c?n.colorDark:n.colorLight,t.lineWidth=1,t.fillStyle=c?n.colorDark:n.colorLight,t.fillRect(d,p,i,a),t.strokeRect(Math.floor(d)+.5,Math.floor(p)+.5,o,s),t.strokeRect(Math.ceil(d)-.5,Math.ceil(p)-.5,o,s)}this._bIsPainted=!0},S.prototype.isPainted=function(){return this._bIsPainted},S.prototype.clear=function(){this._oContext.clearRect(0,0,this._elCanvas.width,this._elCanvas.height),this._bIsPainted=!1},S.prototype.round=function(e){return e?Math.floor(1e3*e)/1e3:e},(t=function(e,t){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:i.H},"string"==typeof t&&(t={text:t}),t)for(var n in t)this._htOption[n]=t[n];"string"==typeof e&&(e=document.getElementById(e)),this._el=e,this._oQRCode=null,this._oDrawing=new S(this._el,this._htOption),this._htOption.text&&this.makeCode(this._htOption.text)}).prototype.makeCode=function(e){this._oQRCode=new n(T(e,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(e),this._oQRCode.make(),this._el.title=e,this._oDrawing.draw(this._oQRCode)},t.prototype.clear=function(){this._oDrawing.clear()},t.CorrectLevel=i}(),e.exports=t},6906:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.styleSheet=t.StyleXSheet=void 0;var r,i=(r=n(441143))&&r.__esModule?r:{default:r};function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const o="__fb-light-mode",s="__fb-dark-mode";function l(e,t){const n=[];n.push("".concat(e," {"));for(const e in t){const r=t[e];n.push(" --".concat(e,": ").concat(r,";"))}return n.push("}"),n.join("\n")}const u=/var\(--(.*?)\)/g;class c{constructor(e){var t;a(this,"rootTheme",void 0),a(this,"rootDarkTheme",void 0),a(this,"supportsVariables",void 0),a(this,"rules",void 0),a(this,"injected",void 0),a(this,"tag",void 0),a(this,"ruleForPriority",void 0),this.tag=null,this.injected=!1,this.ruleForPriority=new Map,this.rules=[],this.rootTheme=e.rootTheme,this.rootDarkTheme=e.rootDarkTheme,this.supportsVariables=null!==(t=e.supportsVariables)&&void 0!==t?t:null!=n.g.CSS&&null!=n.g.CSS.supports&&n.g.CSS.supports("--fake-var:0")}getVariableMatch(){return u}isHeadless(){var e,t;return null==this.tag||null==(null===(e=n.g)||void 0===e||null===(t=e.document)||void 0===t?void 0:t.body)}getTag(){const{tag:e}=this;return(0,i.default)(null!=e,"expected tag"),e}getCSS(){return this.rules.join("\n")}getRulePosition(e){return this.rules.indexOf(e)}getRuleCount(){return this.rules.length}inject(){var e;this.injected||(this.injected=!0,null!=(null===(e=n.g.document)||void 0===e?void 0:e.body)?(this.tag=function(){const e=document.createElement("style");return e.setAttribute("type","text/css"),e.setAttribute("data-styled","true"),(document.head||document.getElementsByTagName("head")[0]).appendChild(e),e}(),this.injectTheme()):this.injectTheme())}injectTheme(){null!=this.rootTheme&&this.insert(l(":root, .".concat(o),this.rootTheme),0),null!=this.rootDarkTheme&&this.insert(l(".".concat(s,":root, .").concat(s),this.rootDarkTheme),0)}__injectCustomThemeForTesting(e,t){null!=t&&this.insert(l(e,t),0)}delete(e){const t=this.rules.indexOf(e);if((0,i.default)(t>=0,"Couldn't find the index for rule %s",e),this.rules.splice(t,1),this.isHeadless())return;const n=this.getTag().sheet;(0,i.default)(n,"expected sheet"),n.deleteRule(t)}normalizeRule(e){const{rootTheme:t}=this;return this.supportsVariables||null==t?e:e.replace(u,((e,n)=>t[n]))}getInsertPositionForPriority(e){const t=this.ruleForPriority.get(e);if(null!=t)return this.rules.indexOf(t)+1;const n=Array.from(this.ruleForPriority.keys()).sort(((e,t)=>t-e)).filter((t=>t>e?1:0));if(0===n.length)return this.getRuleCount();const r=n.pop();return this.rules.indexOf(this.ruleForPriority.get(r))}insert(e,t,n){if(!1===this.injected&&this.inject(),null!=n)return this.insert(d(e,"html:not([dir='rtl'])"),t),void this.insert(d(n,"html[dir='rtl']"),t);const r=e;if(this.rules.includes(r))return;const i=this.normalizeRule(r),a=this.getInsertPositionForPriority(t);if(this.rules.splice(a,0,i),this.ruleForPriority.set(t,i),this.isHeadless())return;const o=this.getTag().sheet;if(null!=o)try{o.insertRule(i,a)}catch(e){}}}function d(e,t){if(!e.startsWith("@"))return"".concat(t," ").concat(e);const n=e.indexOf("{"),r=e.slice(0,n+1),i=e.slice(n+1);return"".concat(r).concat(t," ").concat(i)}t.StyleXSheet=c,a(c,"LIGHT_MODE_CLASS_NAME",o),a(c,"DARK_MODE_CLASS_NAME",s);const p=new c({supportsVariables:!0,rootTheme:{},rootDarkTheme:{}});t.styleSheet=p},156720:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(6906);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){for(var t=e.reverse(),n={};t.length;){var r=t.pop();if(Array.isArray(r))for(var i=r.length-1;i>=0;i--)t.push(r[i]);else{var a=r;if(null!=a&&"object"==typeof a)for(var o in a){var s=a[o];if("string"==typeof s)n[o]=s;else if("object"==typeof s){var l;n[o]=null!==(l=n[o])&&void 0!==l?l:{},Object.assign(n[o],s)}}}}return n}function l(...e){var t=s(e),n="";for(var r in t)if(Boolean(t[r]))if("string"==typeof t[r])n+=n?" "+t[r]:t[r];else if("object"==typeof t[r]){var i=t[r];for(var a in i){var o=i[a];n+=n?" "+o:o}}return n}l.compose=function(...e){return s(e)},l.create=function(e){throw new Error("stylex.create should never be called. It should be compiled away.")},l.keyframes=e=>{throw new Error("stylex.keyframes should never be called")},l.inject=(e,t,n=null)=>{r.styleSheet.insert(e,t,n)},l.dedupe=(...e)=>l(...e),l.absoluteFill={bottom:0,boxSizing:"border-box",end:0,position:"absolute",start:0,top:0},l.absoluteCenter={boxSizing:"border-box",left:"50%",position:"absolute",top:"50%",transform:"translate(-50%, -50%)"},l.blockBase={borderStyle:"solid",borderWidth:0,boxSizing:"border-box",display:"block",flexGrow:1,flexShrink:1,margin:0,padding:0,position:"relative",zIndex:0},l.inlineBase=a(a({},l.blockBase),{},{display:"inline"}),l.buttonBase={appearance:"none",backgroundColor:"transparent",borderStyle:"solid",borderWidth:0,boxSizing:"border-box",margin:0,padding:0,position:"relative",textAlign:"inherit",zIndex:0},l.flexBase={alignItems:"stretch",borderStyle:"solid",borderWidth:0,boxSizing:"border-box",display:"flex",flexDirection:"column",flexGrow:1,flexShrink:1,justifyContent:"space-between",margin:0,minHeight:0,minWidth:0,padding:0,position:"relative",zIndex:0},l.flexInlineBase=a(a({},l.flexBase),{},{display:"inline-flex"}),l.linkBase={backgroundColor:"transparent",backgroundImage:"none",boxSizing:"border-box",color:"inherit",cursor:"pointer",position:"relative",textDecoration:"none",zIndex:0},l.listBase={boxSizing:"border-box",listStyle:"none",marginBottom:0,marginTop:0,paddingStart:0},l.visuallyHidden={clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:1,overflow:"hidden",position:"absolute",width:1};var u=l;t.default=u},329127:(e,t,n)=>{var r={"./af.json":[788789,8288],"./ar.json":[758854,8801],"./az.json":[248758,1967],"./bg.json":[60624,1234],"./bn.json":[393511,677],"./ca.json":[498922,4451],"./cs.json":[740097,3539],"./da.json":[536117,9626],"./de.json":[203313,88],"./el.json":[824689,3004],"./en.json":[790084,7494],"./es.json":[996598,4739],"./et.json":[857633,9599],"./fa.json":[341076,4853],"./fi.json":[551701,9789],"./fil.json":[146387,3565],"./fr.json":[512785,7334],"./gu.json":[450387,1244],"./he.json":[190626,2422],"./hi.json":[727605,8606],"./hr.json":[454047,3853],"./hu.json":[792922,1389],"./id.json":[975608,4132],"./it.json":[554800,5881],"./ja.json":[366189,5608],"./kk.json":[247681,4260],"./kn.json":[678930,6700],"./ko.json":[728076,7020],"./lt.json":[337885,4169],"./lv.json":[622798,7938],"./mk.json":[579265,1592],"./ml.json":[607208,4794],"./mr.json":[830163,2771],"./ms.json":[13390,9911],"./nb.json":[549057,4046],"./nl.json":[223129,7055],"./pa.json":[466384,6032],"./pl.json":[775495,9566],"./pt.json":[508897,1992],"./ro.json":[864267,8945],"./ru.json":[534813,887],"./sk.json":[575785,7163],"./sl.json":[665608,7626],"./sq.json":[455915,6098],"./sr.json":[895742,2967],"./sv.json":[281244,4768],"./sw.json":[178923,6606],"./ta.json":[217574,3721],"./te.json":[896564,4771],"./th.json":[338728,5955],"./tr.json":[938704,8962],"./uk.json":[495304,5282],"./ur.json":[727814,2619],"./uz.json":[518192,7654],"./vi.json":[822521,5315],"./zh-CN.json":[859978,4680],"./zh-HK.json":[217133,7920],"./zh-TW.json":[937439,3421]};function i(e){if(!n.o(r,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],i=t[0];return n.e(t[1]).then((()=>n.t(i,3)))}i.keys=()=>Object.keys(r),i.id=329127,e.exports=i},826299:(e,t,n)=>{var r={"./af":[715673,6365],"./af.js":[715673,6365],"./ar":[839679,8054],"./ar-XB":[924076,9995],"./ar-XB.js":[924076,9995],"./ar.js":[839679,8054],"./az":[32929,7072],"./az.js":[32929,7072],"./bg":[218260,7102],"./bg.js":[218260,7102],"./bn":[164303,8700],"./bn.js":[164303,8700],"./ca":[339850,5632],"./ca.js":[339850,5632],"./cs":[152023,165],"./cs.js":[152023,165],"./da":[691813,1628],"./da.js":[691813,1628],"./de":[687674,7216],"./de.js":[687674,7216],"./el":[363515,1204],"./el.js":[363515,1204],"./en":[80610,6933],"./en.js":[80610,6933],"./es":[148976,673],"./es.js":[148976,673],"./et":[487318,792],"./et.js":[487318,792],"./fa":[629822,9999],"./fa.js":[629822,9999],"./fi":[798270,9613],"./fi.js":[798270,9613],"./fil":[517100,907],"./fil.js":[517100,907],"./fr":[414950,6293],"./fr.js":[414950,6293],"./gu":[383171,6038],"./gu.js":[383171,6038],"./he":[194238,5729],"./he.js":[194238,5729],"./hi":[296103,3722],"./hi.js":[296103,3722],"./hr":[851752,5708],"./hr.js":[851752,5708],"./hu":[927703,2556],"./hu.js":[927703,2556],"./id":[801271,5128],"./id.js":[801271,5128],"./it":[711310,2830],"./it.js":[711310,2830],"./ja":[839235,5182],"./ja.js":[839235,5182],"./kk":[917387,9719],"./kk.js":[917387,9719],"./kn":[112764,155],"./kn.js":[112764,155],"./ko":[975205,820],"./ko.js":[975205,820],"./lt":[817066,1529],"./lt.js":[817066,1529],"./lv":[793610,4708],"./lv.js":[793610,4708],"./mk":[683889,6651],"./mk.js":[683889,6651],"./ml":[440538,6655],"./ml.js":[440538,6655],"./mr":[156163,1248],"./mr.js":[156163,1248],"./ms":[674218,5443],"./ms.js":[674218,5443],"./nb":[821038,7749],"./nb.js":[821038,7749],"./nl":[288447,9750],"./nl.js":[288447,9750],"./pa":[803413,9815],"./pa.js":[803413,9815],"./pl":[863846,8628],"./pl.js":[863846,8628],"./pt":[868500,6953],"./pt-BR":[371531,2091],"./pt-BR.js":[371531,2091],"./pt.js":[868500,6953],"./ro":[882640,7162],"./ro.js":[882640,7162],"./ru":[656863,8292],"./ru.js":[656863,8292],"./sk":[133020,1770],"./sk.js":[133020,1770],"./sl":[648299,4259],"./sl.js":[648299,4259],"./sq":[931977,9737],"./sq.js":[931977,9737],"./sr":[214844,6331],"./sr.js":[214844,6331],"./sv":[718768,2944],"./sv.js":[718768,2944],"./sw":[877957,3998],"./sw.js":[877957,3998],"./ta":[100986,2739],"./ta.js":[100986,2739],"./te":[650741,5650],"./te.js":[650741,5650],"./th":[301253,2135],"./th.js":[301253,2135],"./tr":[593993,248],"./tr.js":[593993,248],"./uk":[737518,906],"./uk.js":[737518,906],"./ur":[457867,4361],"./ur.js":[457867,4361],"./uz":[707161,4873],"./uz.js":[707161,4873],"./vi":[797682,8598],"./vi.js":[797682,8598],"./zh-CN":[708008,6483],"./zh-CN.js":[708008,6483],"./zh-HK":[720393,1081],"./zh-HK.js":[720393,1081],"./zh-TW":[662148,7542],"./zh-TW.js":[662148,7542]};function i(e){if(!n.o(r,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],i=t[0];return n.e(t[1]).then((()=>n(i)))}i.keys=()=>Object.keys(r),i.id=826299,e.exports=i},519922:(e,t,n)=>{var r={"./af":[18635,3748],"./af.js":[18635,3748],"./ar":[240119,1473],"./ar-DZ":[81333,6884],"./ar-DZ.js":[81333,6884],"./ar-KW":[387309,6282],"./ar-KW.js":[387309,6282],"./ar-LY":[216965,5671],"./ar-LY.js":[216965,5671],"./ar-MA":[884240,2966],"./ar-MA.js":[884240,2966],"./ar-SA":[369147,9646],"./ar-SA.js":[369147,9646],"./ar-TN":[789911,9289],"./ar-TN.js":[789911,9289],"./ar-XB":[260858,3934],"./ar-XB.js":[260858,3934],"./ar.js":[240119,1473],"./az":[579549,5740],"./az.js":[579549,5740],"./bn":[1178,7728],"./bn.js":[1178,7728],"./ca":[68168,9817],"./ca.js":[68168,9817],"./cs":[531608,2023],"./cs.js":[531608,2023],"./da":[39386,7315],"./da.js":[39386,7315],"./de":[841160,5862],"./de.js":[841160,5862],"./el":[580371,1055],"./el.js":[580371,1055],"./en-AU":[642890,8678],"./en-AU.js":[642890,8678],"./en-CA":[994488,4616],"./en-CA.js":[994488,4616],"./en-GB":[477371,9227],"./en-GB.js":[477371,9227],"./en-IE":[660882,2979],"./en-IE.js":[660882,2979],"./en-NZ":[972906,3892],"./en-NZ.js":[972906,3892],"./es":[163327,1791],"./es-DO":[860667,2394],"./es-DO.js":[860667,2394],"./es.js":[163327,1791],"./et":[611141,4473],"./et.js":[611141,4473],"./fa":[46661,7662],"./fa.js":[46661,7662],"./fi":[718933,7386],"./fi.js":[718933,7386],"./fr":[212178,2445],"./fr-CA":[207720,9765],"./fr-CA.js":[207720,9765],"./fr-CH":[621708,8799],"./fr-CH.js":[621708,8799],"./fr.js":[212178,2445],"./gu":[703652,4468],"./gu.js":[703652,4468],"./he":[874852,5027],"./he.js":[874852,5027],"./hi":[353873,6709],"./hi.js":[353873,6709],"./hr":[486675,1381],"./hr.js":[486675,1381],"./hu":[945630,4339],"./hu.js":[945630,4339],"./id":[870834,6511],"./id.js":[870834,6511],"./it":[744238,5247],"./it.js":[744238,5247],"./kk":[614351,7074],"./kk.js":[614351,7074],"./kn":[865657,6568],"./kn.js":[865657,6568],"./ko":[468763,4818],"./ko.js":[468763,4818],"./lt":[424805,6920],"./lt.js":[424805,6920],"./mk":[123901,9545],"./mk.js":[123901,9545],"./ml":[173830,3113],"./ml.js":[173830,3113],"./mr":[378249,3422],"./mr.js":[378249,3422],"./ms":[311883,7739],"./ms-MY":[476991,1520],"./ms-MY.js":[476991,1520],"./ms.js":[311883,7739],"./nb":[762262,5959],"./nb.js":[762262,5959],"./nl":[428910,319],"./nl.js":[428910,319],"./pa-IN":[126451,8132],"./pa-IN.js":[126451,8132],"./pl":[949209,4980],"./pl.js":[949209,4980],"./pt":[163435,9116],"./pt-BR":[926019,6547],"./pt-BR.js":[926019,6547],"./pt.js":[163435,9116],"./ro":[871381,3569],"./ro.js":[871381,3569],"./ru":[835304,2957],"./ru.js":[835304,2957],"./sk":[318185,5965],"./sk.js":[318185,5965],"./sl":[175431,3501],"./sl.js":[175431,3501],"./sq":[416054,6496],"./sq.js":[416054,6496],"./sr":[211617,5170],"./sr-CYRL":[626139,5790],"./sr-CYRL.js":[626139,5790],"./sr.js":[211617,5170],"./sv":[877077,1069],"./sv.js":[877077,1069],"./sw":[19408,2017],"./sw.js":[19408,2017],"./ta":[185897,8634],"./ta.js":[185897,8634],"./te":[284463,3370],"./te.js":[284463,3370],"./th":[207193,951],"./th.js":[207193,951],"./tr":[854275,9313],"./tr.js":[854275,9313],"./uk":[344531,9682],"./uk.js":[344531,9682],"./ur":[914377,6163],"./ur.js":[914377,6163],"./uz":[296255,3017],"./uz-LATN":[45249,8117],"./uz-LATN.js":[45249,8117],"./uz.js":[296255,3017],"./zh-CN":[488862,3047],"./zh-CN.js":[488862,3047],"./zh-TW":[881567,5125],"./zh-TW.js":[881567,5125]};function i(e){if(!n.o(r,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],i=t[0];return n.e(t[1]).then((()=>n(i)))}i.keys=()=>Object.keys(r),i.id=519922,e.exports=i},138097:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r=[["","Open the product context menu","Turn off send as sticker","Turn on send as sticker","__count__ @ message","Changing __count__ label","The label could not be updated","__count__ label changed","Couldn't block __participant__","__participant__ blocked","Blocking __participant__","Couldn't delete broadcast list.","Broadcast list deleted","Deleting broadcast list","Couldn't archive chat.","Chat archived","Archiving chat","Couldn't clear chat.","Chat cleared","Clearing chat","Couldn't delete chat.","Chat deleted","Deleting chat","Couldn't mark chat as read.","Couldn't mark chat as unread.","Marked as read","Marked as unread","Marking as read","Marking as unread","Couldn't mute chat.","Chat muted","Muting chat","Couldn't pin chat","You can only pin up to 3 chats.","Chat pinned","Pinning chat","Couldn't unarchive chat.","Chat unarchived","Unarchiving chat","Unmute","Couldn't unmute chat.","Chat unmuted","Unmuting chat","Couldn't unpin chat","Chat unpinned","Unpinning chat","Couldn't create group.","Please enter a shorter subject.","Can't add more than __max__ participants","Created group","Creating group","Couldn't delete group.","Group deleted","Deleting group","Couldn't exit group.","Exited group","Exiting group","Couldn't remove group icon.","Group icon removed","Removing group icon","Group icon set","Couldn't set group icon.","Setting group icon","Couldn't mute group.","Group muted","Muting group","Couldn't rename group.","Group renamed to __subject__","Renaming group","Group subject can't be empty","Couldn't unmute group.","Group unmuted","Unmuting group","Marking as not spam","Couldn't mark as not spam","Marked as not spam","Couldn't delete message because the message may have expired","Couldn't delete message","__count__ message deleted","Deleting message","Couldn't star message because the message may have expired","Couldn't star message","__count__ message starred","Starring message","Couldn't unstar all messages","Couldn't unstar message because the message may have expired","Couldn't unstar message","__count__ message unstarred","All messages unstarred","Unstarring message","Unstarring all messages","Couldn't add __participantNames__.","You added __participantNames__.","Adding __participantNames__.","Removing __participantNames__ as an admin failed.","__participantNames__ is no longer a group admin.","Removing __participantNames__ as a group admin.","They are no longer in this group.","You can't add this participant because they left the group recently.","Couldn't make __participantNames__ an admin.","__participantNames__ is now a group admin.","Making __participantNames__ a group admin.","Couldn't remove __participantNames__.","You removed __participantNames__.","Removing __participantNames__.","Couldn't remove profile photo.","Profile photo removed","Removing profile photo","Profile photo set","Couldn't set profile photo.","Setting profile photo","Your name can't be empty","Your name changed","Couldn't change your name.","Changing your name","Reporting spam","Couldn't report spam","Reported spam","About can't be empty","About changed","Couldn't change About.","Changing About…","Try again.","Couldn't unblock __participant__","__participant__ unblocked","Unblocking __participant__","Undo","Add a caption…","Blocked contacts will no longer be able to call you or send you messages","Add blocked contact","Add to a group","Add group icon","Add profile photo","Drag the image to adjust","Archive chat","No archived chats","Archived chats","Document","__count__ Page","Contact","__number__ audio file you tried adding has no content.","Your browser doesnt support audio playback.","__number__ audio you tried adding is larger than the __maxSize__ limit.","__businessName__ used other companies to store and manage this message.","__businessName__ used Facebook and other companies to store and manage this message.","This message was delivered directly from __businessName__.","This message was delivered directly to __businessName__.","__businessName__ used Facebook to store and manage this message.","List of contacts that you have blocked","No blocked contacts yet","Blocked contacts","Broadcast list deleted","Browser not supported","End Time","Start Time","This verified business is not in your contact list.","Confirmed as __businessName__","End Time","This name will be visible to your WhatsApp customers and can be edited from the app on your mobile device.","Something went wrong","An error occurred while saving. Please try again.","__verified__ as __businessName__","Use Here","__count__ message couldn't be forwarded because __contact__ is on a version of WhatsApp that doesn't support it.","No messages could be forwarded because __contact__ is on a version of WhatsApp that doesn't support them.","__count__ message couldn't be forwarded because the file is missing.","__count__ message couldn't be forwarded because the file is missing or __contact__ is on a version of WhatsApp that doesn't support it.","Can't Load WhatsApp","Qty __quantity__","Received cart","__updated__ Item Updated","View all","Change group icon","Change profile photo","Charge your phone to keep using WhatsApp","Archived","You are not an admin","No Internet connection","Clear messages","click here for group info","click here for contact info","Update WhatsApp","Click to reload QR code","Click to save, ESC to cancel","Click to update WhatsApp","Close chat","__count__ item","We reviewed this collection again and confirmed its name violates __collections_rejected_policy_unauthorized_media__.","We reviewed this collection again and confirmed its name violates __collections_rejected_policy_weapons__.","","","Add __participant__ to “__subject__” group?","Add __participants__ to “__subject__” group?","You are closing WhatsApp.","Some messages cant be forwarded, do you want to forward rest of the messages?","Can't forward all messages","Forward to __chat__?","Log out?","Make __participant__ an admin for “__subject__” group?","Remove __participant__ from “__subject__” group?","Send __count__ contact to “__chat__”?","Send __count__ contact to “__chat__”?","Send __count__ contact to “__chat__”?","Unblock __chat__ and forward messages?","Unblock __contact__","Unmute this chat?","Unmute this group?","Connecting…","Connecting to WhatsApp","Connecting","","About and phone number","Loading About…","View contact","__number__ contact that you tried to add has no content.","The contact that you tried to add is larger than the __maxSize__ limit.","Older messages may be available","Use WhatsApp on your phone to search messages from before __date__.","Use WhatsApp on your phone to see the complete chat history.","Search for messages with __chatName__.","WhatsApp message","Default","Delete chat","Deleting a label removes it from all messages, contacts, and from the list of labels. Are you sure you want to delete this label?","Delete message","Delete message?","Tell us about your issue","Please Update WhatsApp","New version available","Desktop Settings","Update","To continue using WhatsApp, click Update and install the latest version.","Couldn't Update Automatically","Downloading an update to WhatsApp. This may take several minutes. WhatsApp will automatically update and restart when the download finishes.","Updating WhatsApp","__name__ uses a default timer for disappearing messages in new chats. All new messages will disappear from this chat __number__ day after theyre sent. Click to learn more.","__name__ uses a default timer for disappearing messages in new chats. All new messages will disappear from this chat __number__ hour after theyre sent. Click to learn more.","__name__ uses a default timer for disappearing messages in new chats. All new messages will disappear from this chat __number__ minute after theyre sent. Click to learn more.","__name__ uses a default timer for disappearing messages in new chats. All new messages will disappear from this chat __number__ second after theyre sent. Click to learn more.","You use a default timer for disappearing messages in new chats. All new messages will disappear from this chat __number__ day after theyre sent. Click to learn more.","You use a default timer for disappearing messages in new chats. All new messages will disappear from this chat __number__ hour after theyre sent. Click to learn more.","You use a default timer for disappearing messages in new chats. All new messages will disappear from this chat __number__ minute after theyre sent. Click to learn more.","You use a default timer for disappearing messages in new chats. All new messages will disappear from this chat __number__ second after theyre sent. Click to learn more.","Dismiss","Docs","__count__ Doc","“__name__” downloaded.","__number__ document you tried adding has no content.","__number__ document you tried adding is larger than the __maxSize__ limit.","End-to-end encrypted","Add text to your image…","Turn on desktop notifications","& "," • ",", ","Disappearing messages were turned on. All new messages will disappear from this chat __number__ day after they're sent.","Disappearing messages were turned on. All new messages will disappear from this chat __number__ hour after they're sent.","Disappearing messages were turned on. All new messages will disappear from this chat __number__ minute after they're sent.","Disappearing messages were turned on. All new messages will disappear from this chat __number__ second after they're sent.","You turned on disappearing messages. All new messages will disappear from this chat __number__ day after they're sent.","You turned on disappearing messages. All new messages will disappear from this chat __number__ hour after they're sent.","You turned on disappearing messages. All new messages will disappear from this chat __number__ minute after they're sent.","You turned on disappearing messages. All new messages will disappear from this chat __number__ second after they're sent.","__name__ turned off disappearing messages.","__name__ turned on disappearing messages. All new messages will disappear from this chat __number__ day after they're sent.","__name__ turned on disappearing messages. All new messages will disappear from this chat __number__ hour after they're sent.","__name__ turned on disappearing messages. All new messages will disappear from this chat __number__ minute after they're sent.","__name__ turned on disappearing messages. All new messages will disappear from this chat __number__ second after they're sent.","Disappearing messages were turned on. All new messages will disappear from this chat __number__ day after they're sent. Click to change.","Disappearing messages were turned on. All new messages will disappear from this chat __number__ hour after they're sent. Click to change.","Disappearing messages were turned on. All new messages will disappear from this chat __number__ minute after they're sent. Click to change.","Disappearing messages were turned on. All new messages will disappear from this chat __number__ second after they're sent. Click to change.","You turned on disappearing messages. All new messages will disappear from this chat __number__ day after they're sent. Click to change.","You turned on disappearing messages. All new messages will disappear from this chat __number__ hour after they're sent. Click to change.","You turned on disappearing messages. All new messages will disappear from this chat __number__ minute after they're sent. Click to change.","You turned on disappearing messages. All new messages will disappear from this chat __number__ second after they're sent. Click to change.","__name__ turned off disappearing messages. Click to change.","__name__ turned on disappearing messages. All new messages will disappear from this chat __number__ day after they're sent. Click to change.","__name__ turned on disappearing messages. All new messages will disappear from this chat __number__ hour after they're sent. Click to change.","__name__ turned on disappearing messages. All new messages will disappear from this chat __number__ minute after they're sent. Click to change.","__name__ turned on disappearing messages. All new messages will disappear from this chat __number__ second after they're sent. Click to change.","Turning on this setting will make new messages disappear from this chat after 7 days. Recipients can still save these messages elsewhere.","Turning on this setting will make new messages disappear from this chat after a selected amount of time. Recipients can still save these messages elsewhere.","All new messages will disappear from this chat __number__ day after they're sent.","All new messages will disappear from this chat __number__ hour after they're sent.","All new messages will disappear from this chat __number__ minute after they're sent.","All new messages will disappear from this chat __number__ second after they're sent.","Anyone in this chat can change this setting.","Group admins control who can change this setting.","This message will disappear from this chat __number__ day after it's sent.","This message will disappear from this chat __number__ hour after it's sent.","This message will disappear from this chat __number__ minute after it's sent.","This message will disappear from this chat __number__ second after it's sent.","Off","On","__number__ day","__number__ hour","__number__ minute","__number__ second","Wait until the message finishes sending and displays a checkmark before forwarding.","Wait until this message is fully delivered before forwarding.","Unable to forward unsent message.","Cant Forward","__number__ file you tried adding has no content.","__count__ file failed to be downloaded because it's no longer on your phone.","__number__ file could not be added.","__number__ file you tried adding is not supported.","__number__ file you tried adding is larger than the __maxSize__ limit.","B","GB","kB","MB","Forward","You can only share with up to __count__ chat","Forwarded many times. You can only share with up to __count__ chat.","Forward message","Forward message to","Forwarded __count__ time","Found a contact card for this number. View contact card?","Older results may be available","Microsoft Edge","Google Chrome","Mozilla Firefox","Opera","Safari (macOS 11+ Only)","Custom GIF animations are currently not supported. Please use provided GIF selection feature.","Incoming calls off. Click to restore.","Alerts and sounds off. Click to restore.","Notifications enabled","You were added by someone who's not in your contacts","Group deleted","Cancel","Checking invite link","__count__ contact","Join group","Anyone with WhatsApp can follow this link to join this group. Only share it with people you trust.","__count__ participant","You can't view this group's invite link because you're not an admin.","This invite link doesn't match any WhatsApp groups.","Are you sure you want to reset the invite link for __groupName__? If you reset the link, no one will be able to use it to join this group.","Resetting the invite link for __groupName__.","Send link to","Joining group invites from Desktop is not yet available on the multi-device beta. Use your phone instead.","Joining group invites from Web is not yet available on the multi-device beta. Use your phone instead.","Can't join group","Viewing and revoking group invites from Desktop is not yet available on the multi-device beta. Use your phone instead.","Viewing and revoking group invites from Web is not yet available on the multi-device beta. Use your phone instead.","Can't view group invite details",'"__A__"','__A__"__B__" & "__C__"','"__A__," __B__','"__A__" & "__B__"',"Group muted","Type contact name","__count__ other","View all (__more__)","__count__ more","Group Subject","__number__ invited","Couldn't add __participant__. You can invite them privately to join this group.","Reset invite for __participant__? If you reset the invite, __participant__ won't be able to use it to join this group.","You cant take a photo because it looks like your computer doesnt have a camera. Try connecting one or if you have one connected, try restarting your browser.","Camera Not Found","Allow camera","You cant record a Voice Message because it looks like your computer doesnt have a microphone. Try connecting one or if you have one connected, try restarting your browser.","Microphone Not Found","Allow microphone","Help","Message from __author__","__unreadCount__ New Message","You'll be logged out after several minutes of inactivity","__number__ image you tried adding has no content.","__number__ image you tried adding is larger than the __maxSize__ limit.","Check your phone to answer","WhatsApp group video call from __name__","WhatsApp group voice call from __name__","WhatsApp video call from __name__","WhatsApp voice call from __name__","WhatsApp connects to your phone to sync messages. To reduce data usage, connect your phone to Wi-Fi.","With this update, your phone wont need to stay online to use WhatsApp on web, desktop or other devices. Up to 4 linked devices and 1 phone can be used at the same time. __learn_more__","With this update, your phone wont need to stay online to use WhatsApp Business on web, desktop or other devices. Up to 4 linked devices and 1 phone can be used at the same time. __learn_more__","This version expires in __num_days__ day. With the update, your phone wont need to stay online to use WhatsApp on other devices. Up to 4 linked devices and 1 phone can be used at the same time. __learn_more__","This version expires in __num_days__ day. With the update, your phone wont need to stay online to use WhatsApp Business on other devices. Up to 4 linked devices and 1 phone can be used at the same time. __learn_more__","This version will expire today at __time__. With the update, your phone wont need to stay online to use WhatsApp on other devices. Up to 4 linked devices and 1 phone can be used at the same time. __learn_more__","This version will expire today at __time__. With the update, your phone wont need to stay online to use WhatsApp Business on other devices. Up to 4 linked devices and 1 phone can be used at the same time. __learn_more__","WhatsApp is available for Mac. __get_it_here__.","Make calls from desktop with WhatsApp for Mac. __get_it_here__.","WhatsApp is available for Windows. __get_it_here__.","Make calls from desktop with WhatsApp for Windows. __get_it_here__.","Keep your phone connected","Expires at __time__","Expires in __number__ day","__count__ item","Search in __labelName__...","Learn more","Links","__count__ Link","Accurate to __accuracy__ M","__count__ people","Last updated __date__ at __time__","Last updated today at __time__","Last updated __date__ at __time__","Last updated yesterday at __time__","Live until __time__","__hours__h left","__hours__h __minutes__m left","__minutes__m left","__sharers__ is sharing live location","__name__ is sharing live location","__count__ person is sharing live location","You are sharing live location","You and __name__ are sharing live location","You and __count__ other person are sharing live location","__name__ stopped sharing","Updated __hours__h ago","Updated __hours__h __minutes__m ago","Updated __minutes__m ago","load earlier messages…","load recent messages…","Loading…","loading messages…","Log in","Menu __android_menu_icon__","Need help to get started?","Settings __iphone_settings_icon__","Tap __android_menu__ or __iphone_settings__ and select __whatsapp_web_menu_item__","Tap on __login_step_3_md_link_device__","WhatsApp Web","More than 1GB storage usage detected. Please be aware that remaining storage is low.","Low storage warning","Make sure your computer has an active Internet connection.","Manage","Mark as read","Mark as unread","Downloading messages: __progress__%","This version will expire today at __time__. Update to use WhatsApp Web without keeping your phone online.","This version will expire today at __time__. Update to use WhatsApp Desktop without keeping your phone online.","Media","Add a caption","This file was changed from original.","Blocked","Help","Keep me signed in","Log out","Make group admin","Notifications","Profile","Profile","Remove","Settings","Attach","Menu","This audio is too large. You can send audio up to __maxSize__.","This document is too large. You can send documents up to __maxSize__.","This file is too large. You can send files up to __maxSize__.","This image is too large. You can send images up to __maxSize__.","Message info","Delivered","Delivered to","Played","Played by","Read","Read by","__count__ remaining","Couldn't find message","The message youre pasting is too long. Try shortening it or sending it in multiple parts.","Message Too Long","This video is too large. You can send videos up to __maxSize__.","Cant play this Voice Message because it's no longer on your phone.","Voice Message Unavailable","Cant download this document because it's no longer on your phone.","Document Unavailable","Cant view this GIF because it's no longer on your phone.","GIF Unavailable","Media Message Unavailable","Cant view this photo because it's no longer on your phone.","Photo Unavailable","Cant play this video because it's no longer on your phone.","Video Unavailable","Phone number shared via url is invalid.","Send message to","__contactName__ and __count__ other contact","__count__ contact","You can only send up to __count__ contact","Mute “__name__” for…","__A__, __B__","__A__, and __B__","__A__, __B__","__A__ and __B__","Archive Chat","WhatsApp needed to restart because of a problem.","Problem Detected","Delete Chat","Delete Group","Exit Group","Log Out","Mark as Read","Mark as Unread","Chat","Help","Terms and Privacy Policy","Next Chat","Previous Chat","Window","Bring All to Front","Minimize","Zoom","Mute","New Chat","New Group","Profile and About","Unarchive Chat","Cancel Mute","This video is unavailable. Please try again.","New chat","New group","Next","No contacts","No Docs","No groups","No Links","No Media","No result found for '__labelName__'","No starred messages","Not spam","Notifications","__number__ of __totalNumber__","+__number__","OK, got it","Start WhatsApp at Login","Order Detail","Your Order","__subtotal__ (estimated)","Qty __quantity__","__total__ (estimated total)","Already blocked","Order #__order__","Update now to use WhatsApp Web on other devices without keeping your phone online.","WhatsApp is open on another computer or browser. Click “Use Here” to use WhatsApp in this window.","Pin chat","Waiting for this message. This may take a while.","Previous","__count__ contact excluded","__count__ Product","This photo is too small. Please select a photo with height and width of at least __size__ pixel.","Couldn't send this Voice Message.","…","This is not your username or pin. This name will be visible to your WhatsApp contacts.","Group • __groupName__","All","__count__ reactions weren't sent","Reconnect","Remove","Remove this group's icon?",'Remove label "__labelName__" from __count__ item',"Remove photo","Remove your profile photo?","Report spam","Click to resend","Retry Now","Retrying…","Retrying in __duration__…","Retrying in __number__ second…","Save","Scan Database Usage","Search…","Search contacts","Search Emoji","Search GIFs via __service__","Search groups","Search Messages","No chats, contacts or messages found","No contacts found","No groups found","No messages found","No results found for '__keyword__'","Search or start new chat","Looking for chats, contacts or messages…","Looking for messages…","Learn which chats are end to end encrypted","Show security notifications","See __count__ archived chat","__count__ selected","Photo set to send as sticker","Send contact","Send contacts","send","Feedback/Question about WhatsApp","Email address","Confirm email address","Please enter a valid email address","The email addresses do not match","Subject","Feedback sent","Please enter a subject.","Contact us","__count__ Screenshot Maximum","Please add more to your description","To verify, send a message to __name__ and try again.","The sender is not in your contact list","Settings","__days__d","__hours__h","__minutes__m","__seconds__s","Some of your messages are still sending.","Star message","No starred messages","Starred messages","Created by __name__","Subject","This group is no longer available. Please contact __support__ for help.","__count__ suspicious link","Take photo","You'll be able to use WhatsApp again in __duration__","You're temporarily banned from WhatsApp because you sent too many messages to people who dont have __phone__ in their address books.","You're temporarily banned from WhatsApp because you created too many groups with people who dont have __phone__ in their address books.","__time__ left","Maximum number of files uploaded. __number__ file has been ignored.","Trying to reach phone","Turn off all desktop notifications for:","Unarchive chat","Unblock Contact","Unpin chat","__count__ @ message not synced","__count__ unread message","Unstar","Unstar all messages?","Unstar message","Until __date__ at __time__","Until today at __time__","Until tomorrow at __time__","Until __day__ at __time__","Untitled","Download Microsoft Edge","Update Google Chrome","Update Mozilla Firefox","Update Safari","Update Samsung Internet","WhatsApp is out of date. Updating now…","Updating","Your phone will no longer need to stay online to use WhatsApp on web, desktop or other devices. __learn_more__","Your phone will no longer need to stay online to use WhatsApp Business on web, desktop or other devices. __learn_more__","Upload photo","__participants__ joined using your invite","You invited __participants__","Version __version__","__number__ video you tried adding has no content.","Your browser doesnt support video playback.","__number__ video you tried adding is larger than the __maxSize__ limit.","View Contact Card","This view once photo has expired. Please ask __name__ to re-send it.","This view once video has expired. Please ask __name__ to re-send it.","View photo","Viewed by __count__","Stop screen sharing","Start screen sharing","You can turn on your camera after __callee__ answers","Your call will end in a few seconds because your microphone and sound output device were disconnected.","Your call will end in a few seconds because your microphone was disconnected.","__name__'s camera and mic are off","__name__'s camera is off","__name__'s mic is muted","__name__ is requesting to switch to a video call","Your call will end in a few seconds because your sound output device was disconnected.","You can turn off your camera after __callee__ answers","Please contact us with the make and model of your camera. ","Call cannot be placed for more than __count__ participant","You can only call up to __count__ contact","__callee__ couldn't be added to the call, because they are using an old version of WhatsApp or an incompatible device.","__count__ others","__callee__ is in a country where WhatsApp Calling is unavailable","Couldn't place call: __callee__ is unable to receive WhatsApp calls.","Couldn't place call: __callee__ is unable to receive WhatsApp calls at this time.","Couldn't place call: __callee__ is unable to receive WhatsApp calls.","Couldn't place call: __callee__ is not registered on WhatsApp","Couldn't place call: __callee__ is unable to receive WhatsApp video calls at this time.","WhatsApp will use your computer's camera for video calls and taking photos. You can always change this later in your computer's settings.","WhatsApp will use your computer's microphone for calls and voice messages. You can always change this later in your computer's settings.","__contactName__ - WhatsApp voice call","__contactName__ - WhatsApp video call","Chat wallpaper set","Set Chat Wallpaper","Your security code with __contactName__ changed because they registered WhatsApp on their phone again.","Your security code with __contactName__ changed because you logged into a new device.","Your security code with __contactName__ changed because there was a login on a new device of yours.","Your security code with __contactName__ changed because there was a login on this device.",'WhatsApp has verified that this is the official business account of "__businessName__".',"WhatsApp has verified that this is the official business account of __businessName__. This account is saved with a different name in your contacts.","Your security code could not be verified with __contactName__. Click to learn more.","Verify your security code with __contactName__ because there was an error with their list of linked devices.","You can't send messages to this group because you're no longer a participant.","Can't send a message to blocked contact __contact__.","Your security code with __contactName__ changed because there was a login or logout from one or more of their devices.","Your security code with __contactName__ changed because there was a login or logout from one or more of your devices.","Muted","Messages to this chat are secured with end-to-end encryption. __businessName__ may use another company to store, read and respond to your messages. Click to learn more.","online","last seen __date__ at __time__","last seen today at __time__","last seen __date__ at __time__","last seen yesterday at __time__","__participant__ is typing…","__participant__ is recording audio…","Audio","Contact","__count__ page","Document","Photo","Location","Video","Voice message","Delete group","Delete broadcast list","Download “__name__”","Exit","Frequently Contacted","__name__ changed this group's settings to allow all participants to send messages to this group.","__name__ changed this group's settings to allow only admins to send messages to this group.","__name__ created group “__subject__”","__name__ created this group","An admin created group “__subject__”","You created group “__subject__”","You created this group","Created __date__ at __time__","Created __date__ at __time__","Group created by __name__, on __date__ at __time__","Group created by you, on __date__ at __time__","Created today at __time__","Created today at __time__","Group created by __name__, today at __time__","Group created by you, today at __time__","Created __day__ at __time__","Created __day__ at __time__","Created yesterday at __time__","Created yesterday at __time__","Group created by __name__, yesterday at __time__","Group created by you, yesterday at __time__","__name__ changed the group description. Click to view.","__name__ changed the group description.","__name__ reset this group's invite link. Click to view the new invite link.","__name__ changed this group's settings to allow messages that have been forwarded many times.","__name__ changed this group's settings to not allow messages that have been forwarded many times.","__name__ was added","__name__ changed their phone number to a new number.","__name__ changed to __new_number__","__participants__ is no longer an admin","__name__ joined via an invite link","You joined via an invite link","__name__ left","__participants__ is now an admin","__name__ was removed","__name__ added __participants__","__name__ added you","__name__ removed __participants__","__name__ removed you","A participant added __participants__","A participant removed __participants__","You added __participants__","You removed __participants__","__name__ changed this group's settings to allow all participants to edit this group's info.","__name__ changed this group's settings to allow only admins to edit this group's info.","__name__ changed the subject to “__subject__”","A participant changed the subject to “__subject__”","You changed the subject to “__subject__”","__num__ invite sent","Groups","Groups in common","Messages to this chat and calls are secured with end-to-end encryption, which means that WhatsApp and third parties cant read or listen to them. __businessName__ may use a service to store, read and respond to your messages and calls. Contact __businessName__ for information on their privacy practices.","__name__ added to the list","__name__ removed from the list","__name__ and possibly other group participants are using an old version of WhatsApp that cannot receive messages sent from web/desktop using the multi-device beta. Use your phone to message this group.","__name__ is using an old version of WhatsApp that cannot receive messages sent from web/desktop using the multi-device beta. Use your phone to message them.","This happened likely because __contactName__ or you recently changed which devices you use WhatsApp on. Please verify the security code again.","Your security code with __contactName__ changed","To verify that messages and calls with __contactName__ are end-to-end encrypted, open this screen on your phone, and follow the instructions.","To verify that messages and calls with __contactName__ are end-to-end encrypted, scan or upload this code on their device. You can also compare the number above instead.","About","Messages","Missed group video call at __time__","Missed group voice call at __time__","Missed video call","Missed video call at __time__","Missed voice call","Missed voice call at __time__","The business account for __businessName__ has registered as a standard user account and may no longer belong to the business.","Other contacts","__count__ participant","To receive a payment from __senderName__, set up your payment account on your phone.","__contactName__ canceled their payment request for __currencyAndAmount__","You canceled your payment request to __contactName__ for __currencyAndAmount__","__contactName__ declined your payment request for __currencyAndAmount__.","You declined __contactName__'s payment request for __currencyAndAmount__.","__senderName__'s payment request for __currencyAndAmount__ to you expired.","Your payment request to __receiverName__ for __currencyAndAmount__ expired.","You notified __receiverName__ that you are trying to send a payment.","You can now send __receiverName__ a payment.","__invitee__ has set up payments","You invited __otherUser__ to use payments","__otherUser__ invited you to use payments","Requested from __receiverName__","Requested __amount__ from You","__senderName__ requested __amount__ from You","__senderName__ requested __amount__ from __receiverName__","Sent __amount__ to You","__senderName__ sent __amount__ to You","__senderName__ sent __amount__ to __receiverName__","Sent to __receiverName__","Pending (expires __timeSpan__)","__senderName__ sent you __currencyAndAmount__. Use WhatsApp on your phone to accept this transaction.","__senderName__'s payment __relativeTime__ is complete.","Your payment to __receiverName__ __relativeTime__ couldn't complete.","Your payment to __receiverName__ __relativeTime__ couldn't complete.","Your payment to __receiverName__ was refunded __relativeTime__.","on __date__","__name__ changed this group's icon","You changed this group's icon","__name__ deleted this group's icon","You deleted this group's icon","Preview","OFFICIAL ANNOUNCEMENTS","Recent chats","__count__ recipient","Your security code with __contactName__ changed because there was a logout from one of their devices.","Your security code with __contactName__ changed because there was a logout from one of your devices.","Your security code with __contactName__ changed. Click to learn more.","Your security code with __name__ changed because they registered WhatsApp on their phone again.","Your security code with __name__ changed because there was a registration on a new device of yours.","Select messages",'WhatsApp has verified that this is the official business account of "__businessName__". This business uses WhatsApp Business, which allows them to add their opening hours, address, website and catalog of products or services.','This chat is with the verified business account for "__businessName__". Click for more info.','This chat is with the business account for "__businessName__". Click for more info.',"__businessName__ may be a business account, but WhatsApp hasnt verified their name yet.",'The business account youre chatting with is now verified as "__businessName__". Click for more info.','The business account youre chatting with is no longer verified as "__businessName__". Click for more info.','WhatsApp is no longer able to verify that this is the account for "__businessName__".','The business account youre chatting with is no longer verified as "__businessName__". Click for more info.','WhatsApp is no longer able to verify that this is the account for "__businessName__".','The business account youre chatting with is no longer confirmed as "__businessName__". Click for more info.','WhatsApp is no longer able to confirm that this is the account for "__businessName__".','This account has registered as a business account and WhatsApp has confirmed that this is the account for "__businessName__".',"__businessName__ registered as a business account, but WhatsApp hasnt verified their name yet.",'The business account you\'re chatting with belongs to "__businessName__".',"To chat with __contact__, review and accept WhatsApps updated terms and privacy policy on your phone.","__date__ at __time__","today at __time__","The business account you're chatting with may belong to __businessName__. WhatsApp hasn't verified their name yet.","To help you connect with businesses, we have verified that the business account you're chatting with belongs to __businessName__.","The business account you're chatting with may belong to __businessName__. WhatsApp hasn't verified their name yet.","To help you connect with businesses, we have verified that the business account you're chatting with belongs to __businessName__.",'You opened "Verify security code" for the wrong phone number. Open it for the correct number to verify __contact__.','__contact__ opened "Verify security code" for the wrong phone number. Ask __contact__ to open it for your phone number.',"yesterday at __time__","You","You created a broadcast list with __count__ recipient","To use WhatsApp, update __chrome_update__ or use __firefox_homepage__, __safari_homepage__, __edge_homepage__ or __opera_homepage__.","WhatsApp works with Google Chrome __min_version_chrome__+","To use WhatsApp, update __edge_homepage__ or use __chrome_homepage__, __firefox_homepage__ or __opera_homepage__.","WhatsApp works with Microsoft Edge __min_version_edge__+","To use WhatsApp, update __firefox_update__ or use __chrome_homepage__, __safari_homepage__, __edge_homepage__ or __opera_homepage__.","WhatsApp works with Mozilla Firefox __min_version_firefox__+","WhatsApp group invite","WhatsApp","To use WhatsApp, update __safari_update__ or use __chrome_homepage__, __firefox_homepage__ or __opera_homepage__.","To use all of WhatsApp's features like photo capturing and Voice Message recording, we recommend using __chrome_homepage__, __firefox_homepage__ or __opera_homepage__.","Using Safari","WhatsApp works with Safari __min_version_safari__+","To use WhatsApp, update __samsung_update__ or use __chrome_homepage__, __firefox_homepage__ or __opera_homepage__.","WhatsApp works with Samsung Internet __min_version_samsung__+","WhatsApp","Send and receive WhatsApp messages right from your computer.","WhatsApp is open in another window. Click “Use Here” to use WhatsApp in this window.","Quickly send and receive WhatsApp messages right from your computer.","We recommend using WhatsApp with one of the following browsers:","WhatsApp also supports:","You can't add more than __count__ labels","Go to Commerce Manager to update your shop."],{4:"__count__ @ messages",5:"Changing __count__ labels",6:"Some labels could not be updated",7:"__count__ labels changed",76:"Couldn't delete __count__ messages because the messages may have expired",77:"Couldn't delete messages",78:"__count__ messages deleted",79:"Deleting messages",80:"Couldn't star messages because the messages may have expired",81:"Couldn't star messages",82:"__count__ messages starred",83:"Starring messages",85:"Couldn't unstar messages because the messages may have expired",86:"Couldn't unstar messages",87:"__count__ messages unstarred",89:"Unstarring messages",91:"Couldn't add __participantNames__.",92:"You added __participantNames__.",93:"Adding __participantNames__.",94:"Removing __participantNames__ as admins failed.",95:"__participantNames__ are no longer group admins.",96:"Removing __participantNames__ as group admins.",97:"They are no longer in this group.",98:"You can't add these participants because they left the group recently.",99:"Couldn't make __participantNames__ admins.",100:"__participantNames__ are now group admins.",101:"Making __participantNames__ group admins.",102:"Couldn't remove __participantNames__.",103:"You removed __participantNames__.",104:"Removing __participantNames__.",138:"__count__ Pages",140:"__number__ audio files you tried adding have no content.",142:"__number__ audio files you tried adding are larger than the __maxSize__ limit.",163:"__count__ messages couldn't be forwarded because __contact__ is on a version of WhatsApp that doesn't support them.",165:"__count__ messages couldn't be forwarded because the file is missing.",166:"__count__ messages couldn't be forwarded because the file is missing or __contact__ is on a version of WhatsApp that doesn't support them.",170:"__updated__ Items Updated",186:"__count__ items",200:"Send __count__ contacts to “__chat__”?",201:"Send __count__ contacts to “__chat__”?",202:"Send __count__ contacts to “__chat__”?",210:"__number__ groups in common",214:"__number__ contacts that you tried to add have no content.",215:"The contacts that you tried to add are larger than the __maxSize__ limit.",223:"Deleting a label removes it from all messages, contacts, and from the list of labels. Are you sure you want to delete these labels?",224:"Delete messages",225:"Delete messages?",235:"__name__ uses a default timer for disappearing messages in new chats. All new messages will disappear from this chat __number__ days after theyre sent. Click to learn more.",236:"__name__ uses a default timer for disappearing messages in new chats. All new messages will disappear from this chat __number__ hours after theyre sent. Click to learn more.",237:"__name__ uses a default timer for disappearing messages in new chats. All new messages will disappear from this chat __number__ minutes after theyre sent. Click to learn more.",238:"__name__ uses a default timer for disappearing messages in new chats. All new messages will disappear from this chat __number__ seconds after theyre sent. Click to learn more.",239:"You use a default timer for disappearing messages in new chats. All new messages will disappear from this chat __number__ days after theyre sent. Click to learn more.",240:"You use a default timer for disappearing messages in new chats. All new messages will disappear from this chat __number__ hours after theyre sent. Click to learn more.",241:"You use a default timer for disappearing messages in new chats. All new messages will disappear from this chat __number__ minutes after theyre sent. Click to learn more.",242:"You use a default timer for disappearing messages in new chats. All new messages will disappear from this chat __number__ seconds after theyre sent. Click to learn more.",245:"__count__ Docs",247:"__number__ documents you tried adding have no content.",248:"__number__ documents you tried adding are larger than the __maxSize__ limit.",255:"Disappearing messages were turned on. All new messages will disappear from this chat __number__ days after they're sent.",256:"Disappearing messages were turned on. All new messages will disappear from this chat __number__ hours after they're sent.",257:"Disappearing messages were turned on. All new messages will disappear from this chat __number__ minutes after they're sent.",258:"Disappearing messages were turned on. All new messages will disappear from this chat __number__ seconds after they're sent.",259:"You turned on disappearing messages. All new messages will disappear from this chat __number__ days after they're sent.",260:"You turned on disappearing messages. All new messages will disappear from this chat __number__ hours after they're sent.",261:"You turned on disappearing messages. All new messages will disappear from this chat __number__ minutes after they're sent.",262:"You turned on disappearing messages. All new messages will disappear from this chat __number__ seconds after they're sent.",264:"__name__ turned on disappearing messages. All new messages will disappear from this chat __number__ days after they're sent.",265:"__name__ turned on disappearing messages. All new messages will disappear from this chat __number__ hours after they're sent.",266:"__name__ turned on disappearing messages. All new messages will disappear from this chat __number__ minutes after they're sent.",267:"__name__ turned on disappearing messages. All new messages will disappear from this chat __number__ seconds after they're sent.",268:"Disappearing messages were turned on. All new messages will disappear from this chat __number__ days after they're sent. Click to change.",269:"Disappearing messages were turned on. All new messages will disappear from this chat __number__ hours after they're sent. Click to change.",270:"Disappearing messages were turned on. All new messages will disappear from this chat __number__ minutes after they're sent. Click to change.",271:"Disappearing messages were turned on. All new messages will disappear from this chat __number__ seconds after they're sent. Click to change.",272:"You turned on disappearing messages. All new messages will disappear from this chat __number__ days after they're sent. Click to change.",273:"You turned on disappearing messages. All new messages will disappear from this chat __number__ hours after they're sent. Click to change.",274:"You turned on disappearing messages. All new messages will disappear from this chat __number__ minutes after they're sent. Click to change.",275:"You turned on disappearing messages. All new messages will disappear from this chat __number__ seconds after they're sent. Click to change.",277:"__name__ turned on disappearing messages. All new messages will disappear from this chat __number__ days after they're sent. Click to change.",278:"__name__ turned on disappearing messages. All new messages will disappear from this chat __number__ hours after they're sent. Click to change.",279:"__name__ turned on disappearing messages. All new messages will disappear from this chat __number__ minutes after they're sent. Click to change.",280:"__name__ turned on disappearing messages. All new messages will disappear from this chat __number__ seconds after they're sent. Click to change.",283:"All new messages will disappear from this chat __number__ days after they're sent.",284:"All new messages will disappear from this chat __number__ hours after they're sent.",285:"All new messages will disappear from this chat __number__ minutes after they're sent.",286:"All new messages will disappear from this chat __number__ seconds after they're sent.",289:"This message will disappear from this chat __number__ days after it's sent.",290:"This message will disappear from this chat __number__ hours after it's sent.",291:"This message will disappear from this chat __number__ minutes after it's sent.",292:"This message will disappear from this chat __number__ seconds after it's sent.",295:"__number__ days",296:"__number__ hours",297:"__number__ minutes",298:"__number__ seconds",299:"Wait until the messages finish sending and displays a checkmark before forwarding.",303:"__number__ files you tried adding have no content.",304:"__count__ files failed to be downloaded because they are no longer on your phone.",305:"__number__ files could not be added.",306:"__number__ files you tried adding are not supported.",307:"__number__ files you tried adding are larger than the __maxSize__ limit.",313:"You can only share with up to __count__ chats",314:"Forwarded many times. You can only share with up to __count__ chats.",315:"Forward messages",316:"Forward messages to",317:"Forwarded __count__ times",318:"Found contact cards for this number. View contact cards?",333:"__count__ contacts",336:"__count__ participants",354:"__count__ others",356:"__count__ more",359:"Couldn't add __participant__. You can invite them privately to join this group.",369:"__unreadCount__ New Messages",371:"__number__ images you tried adding have no content.",372:"__number__ images you tried adding are larger than the __maxSize__ limit.",381:"This version expires in __num_days__ days. With the update, your phone wont need to stay online to use WhatsApp on other devices. Up to 4 linked devices and 1 phone can be used at the same time. __learn_more__",382:"This version expires in __num_days__ days. With the update, your phone wont need to stay online to use WhatsApp Business on other devices. Up to 4 linked devices and 1 phone can be used at the same time. __learn_more__",391:"Expires in __number__ days",392:"__count__ items",396:"__count__ Links",397:"Accurate to __accuracy__ M",398:"__count__ people",403:"Live until __time__",404:"__hours__h left",406:"__minutes__m left",407:"__sharers__ are sharing live location",409:"__count__ people are sharing live location",412:"You and __count__ others are sharing live location",414:"Updated __hours__h ago",416:"Updated __minutes__m ago",463:"__count__ remaining",481:"__contactName__ and __count__ other contacts",482:"__count__ contacts",483:"You can only send up to __count__ contacts",542:"__count__ contacts excluded",543:"__count__ Products",544:"This photo is too small. Please select a photo with height and width of at least __size__ pixels.",549:"All",550:"__count__ reactions weren't sent",554:'Remove label "__labelName__" from __count__ items',562:"Retrying in __number__ seconds…",581:"See __count__ archived chats",582:"__count__ selected",596:"__count__ Screenshots Maximum",601:"__days__d",602:"__hours__h",603:"__minutes__m",604:"__seconds__s",606:"Star messages",612:"__count__ suspicious links",617:"__time__ left",618:"Maximum number of files uploaded. __number__ files have been ignored.",624:"__count__ @ messages not synced",625:"__count__ unread messages",628:"Unstar messages",644:"__participants__ joined using your invite",645:"You invited __participants__",647:"__number__ videos you tried adding have no content.",649:"__number__ videos you tried adding are larger than the __maxSize__ limit.",650:"View Contact Cards",667:"Call cannot be placed for more than __count__ participants",668:"You can only call up to __count__ contacts",669:"__callee__ couldn't be added to the call, because they are using an old version of WhatsApp or an incompatible device.",670:"__count__ others",706:"__count__ pages",746:"__participants__ are no longer admins",750:"__participants__ are now admins",765:"__num__ invites sent",769:"__name__ were added to the list",770:"__name__ were removed from the list",779:"Missed group video call at __time__",780:"Missed group voice call at __time__",782:"Missed video call at __time__",784:"Missed voice call at __time__",787:"__count__ participants",789:"__contactName__ canceled their payment request for __currencyAndAmount__",790:"You canceled your payment request to __contactName__ for __currencyAndAmount__",791:"__contactName__ declined your payment request for __currencyAndAmount__.",792:"You declined __contactName__'s payment request for __currencyAndAmount__.",793:"__senderName__'s payment request for __currencyAndAmount__ to you expired.",794:"Your payment request to __receiverName__ for __currencyAndAmount__ expired.",801:"Requested __amount__ from You",802:"__senderName__ requested __amount__ from You",803:"__senderName__ requested __amount__ from __receiverName__",804:"Sent __amount__ to You",805:"__senderName__ sent __amount__ to You",806:"__senderName__ sent __amount__ to __receiverName__",809:"__senderName__ sent you __currencyAndAmount__. Use WhatsApp on your phone to accept this transaction.",822:"__count__ recipients",854:"You created a broadcast list with __count__ recipients"}]},376344:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ACK=void 0;t.ACK={SENDER_BACKFILL_SENT:-7,INACTIVE_RECEIVED:-6,CONTENT_UNUPLOADABLE:-5,CONTENT_TOO_BIG:-4,CONTENT_GONE:-3,EXPIRED:-2,FAILED:-1,CLOCK:0,SENT:1,RECEIVED:2,READ:3,PLAYED:4}},618445:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Offline=t.Disconnected=t.BufferTooLargeError=void 0;var r=n(643930);const i=(0,r.customError)("BufferTooLarge",!1);t.BufferTooLargeError=i;const a=(0,r.customError)("Disconnected",!1);t.Disconnected=a;const o=(0,r.customError)("Offline",!1,a);t.Offline=o},869996:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AckParser=void 0,t.ackMatchesTemplate=function(e,t){return e.id===t.id&&(void 0===t.class||e.class===t.class)&&(void 0===t.type||e.type===t.type)&&(void 0===t.from||a(e.from,t.from))&&(void 0===t.participant||e.participant===t.participant)&&(void 0===t.ts||e.ts===t.ts)},t.fromJidsAreEqual=a;var r=n(616310);const i=new(n(769707).WapParser)("ack",(e=>(e.assertTag("ack"),{id:e.attrString("id"),ts:e.maybeAttrString("t"),class:e.attrString("class"),type:e.maybeAttrString("type"),from:e.attrJidWithType(),participant:e.hasAttr("participant")?e.attrDeviceJid("participant"):null})));function a(e,t){if((0,r.extractFromJid)(e)===t)return!0;if(null!=e.userJid)return(0,r.defaultDeviceJidForUser)(e.userJid)===t;if(null!=e.deviceJid){const{deviceJid:n}=e;return 0===(0,r.extractDeviceId)(n)&&(0,r.extractUserJid)(n)===t}return!1}t.AckParser=i},911794:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.cancelDeadSocketTimer=function(){S&&S.deadSocketTimer.cancel()},t.castSmaxStanza=M,t.closeSocket=function(){const e=R("closeSocket").socket;e&&(__LOG__(2)`closeSocket called`,e.close())},t.closeSocketAndPreventRetry=function(){const e=R("closeSocketAndPreventRetry");e.socketLoop.endWithValue(),e.socket&&(__LOG__(2)`closeSocketAndPreventRetry called`,e.socket.close())},t.deprecatedCastStanza=function(e){M(e)},t.deprecatedSendIq=function(e,t){return b(e,!1).then((e=>(0,c.parseIqResponse)(e,t)))},t.deprecatedSendIqErrorParser=function(e,t,n){return b(e,!1).then((e=>(0,c.parseIqResponse)(e,t,n)))},t.deprecatedSendIqIfConnectedWithin=function(e,t,n){return b(e,!1,n).then((e=>(0,c.parseIqResponse)(e,t)))},t.deprecatedSendIqWithoutRetry=function(e,t){return b(e,!0).then((e=>(0,c.parseIqResponse)(e,t)))},t.deprecatedSendStanzaAndReturnAck=I,t.deprecatedSendStanzaAndWaitForAck=function(e,t){return I(e,t).then((()=>{}))},t.forceResetSocketLoop=function(){R("forceResetSocketLoop").socketLoop.reset()},t.getComms=function(){return S},t.isActiveSocket=function(e){return R("castStanza").socketId===e},t.isSocketConnected=P,t.maybeResetSocketLoop=function(){P()||R("maybeResetSocketLoop").socketLoop.reset()},t.onStreamErrorReceived=function(){R("onStreamErrorReceived").socketLoop.cancelReset()},t.openSocketLoop=C,t.resetStateForTests=function(){S=null,T=new p.Resolvable,v=1},t.sendPing=function(){return R("sendPing").sendPing()},t.sendSmaxStanza=function(e,t){var n,r;const i=null!==(n=null==t?void 0:t.withoutRetry)&&void 0!==n&&n,a=null!==(r=null==t?void 0:t.timeoutSeconds)&&void 0!==r?r:0;return b(e,i,a,"smax")},t.singletonOrThrowIfUninitialized=R,t.socketLoopIteration=O,t.startComms=function(e,t,n){if(S)return;S=new A(e,t,n),setTimeout(C,0)},t.startHandlingRequests=function(){return R("startHandlingRequests").startHandlingRequests()},t.stopComms=function(){const e=R("stopComms");e.socketLoop.endWithValue(),e.socket&&e.socket.close();S=null},t.waitForConnection=function(){R("waitForConnection").sendPing(),T||(T=new p.Resolvable);return T.promise};var i=r(n(73982)),a=r(n(311504)),o=n(869996),s=n(125161),l=n(618445),u=n(981369),c=n(442046),d=n(583433),p=n(827653),_=n(452813),f=n(201063),h=n(905552),g=n(948035),m=n(593695),y=n(990445),E=n(738102);n(769707);let S=null,T=null,v=1;class A{constructor(e,t,n){var r,i;this.nextSocketId=1,this.pendingIqs=new Map,this.ackHandlers=[],this.pendingSmaxStanzas=new Map,this._recvBlocker=new p.Resolvable,this.activePing=null,this._pending=new Set,this.socketId=0,this.socket=null,this.softCloseSocket=null,this.handleStanza=(e,t,n)=>{const r=(0,m.attrString)(e,"id");if(r.success){const t=r.value,n=this.pendingSmaxStanzas.get(t);if(n)return this.pendingSmaxStanzas.delete(t),n.resolve(e),this.maybeScheduleHealthCheck(),"NO_ACK"}const i=N(e);if(null!=i){const t=this.pendingIqs.get(i);t?(this.pendingIqs.delete(i),t.resolve(e),this.maybeScheduleHealthCheck()):(__LOG__(3)`handleIq no handler for iq with id ${i}`,__LOG__(4,void 0,new Error)`handleIq no handler for iq`)}else{if("ack"!==e.tag)return"failure"===e.tag&&this.config.shouldBlockReceivingUntilSuccess?this._handleStanza(e,t,n):this._recvBlocker.promise.then((()=>this._handleStanza(e,t,n)));this.handleAck(e)}return"NO_ACK"},this.healthCheckTimer=new f.ShiftTimer((()=>{this.socketId&&this.sendPing()})),this.deadSocketTimer=new f.ShiftTimer((e=>{__LOG__(2)`Comms: Socket ${e} expired`,e===this.socketId&&this.softCloseSocket&&this.softCloseSocket()})),this.sendPing=(0,a.default)((function*(){const e=R("sendPing");if(!e.socketId)return __LOG__(2)`sendPing when socket dead`,Promise.resolve();if(e.activePing&&e.activePing.socketId===e.socketId)return __LOG__(2)`sendPing ping still pending`,Promise.resolve();e.activePing&&e.activePing.handler.resolve();const t=(0,g.makeClientRequest)(),n=t.attrs.id;if("string"!=typeof n)return __LOG__(4,void 0,new Error)`No stanzaId in ping request stanza`,Promise.resolve();const r=new p.Resolvable;e.activePing={socketId:e.socketId,stanzaId:n,handler:r},e.callStanza(t);const i=yield r.promise;if(i){const n=(0,h.parseClientResponseServerResponse)(i,t);if(n.success){var a,o;const t=(0,y.castToUnixTime)(n.value.t),r=Math.round(Date.now()/1e3-t);null===(a=(o=e.config.handlers).onClockSkewUpdate)||void 0===a||a.call(o,r)}}})),this._handleStanza=e,this.onConnectionChange=(0,u.notifyConnectionChangeFactory)(null!==(r=t.handlers.onConnectionChange)&&void 0!==r?r:()=>{},null!==(i=t.handlers.onOptimisticConnectionChange)&&void 0!==i?i:()=>{}),this.gzipInflate=n,this.config=t,this.socketLoop=new d.PromiseRetryLoop({name:"MainSocketLoop",code:O,timer:{jitter:.1,max:t.maxSocketLoopWaitTime,algo:{type:"fibonacci",first:1e4,second:1e4},relativeDelay:!0},resetDelay:3e4})}filterPending(e){const t=[];function n(n){e(n)&&t.push(n)}return this.pendingIqs.forEach(n),this.ackHandlers.forEach(n),this.pendingSmaxStanzas.forEach(n),t}sendPendingStanza(e){const{timeoutId:t}=e;null!=t&&(clearTimeout(t),e.timeoutId=void 0),this.callStanza(e.stanza)}maybeSendPendingStanza(e){this.socket?this.sendPendingStanza(e):__LOG__(2)`Comms has no open socket, will resend stanza when socket opens`}callStanzaAsync(e){var t=this;return(0,a.default)((function*(){return yield t.callStanza(e)}))()}callStanza(e){const t=this.castStanza(e);return this.deadSocketTimer.onOrBefore(this.config.deadSocketTime,this.socketId),this.healthCheckTimer.cancel(),t}castStanzaAsync(e){var t=this;return(0,a.default)((function*(){return yield t.castStanza(e)}))()}castStanza(e){try{var t,n;const r=null===(t=(n=this.config.handlers).onBeforeCastStanzaForE2E)||void 0===t?void 0:t.call(n,e);if(null!=r)return this.handleStanza(r,this.socketId,0),__LOG__(4,void 0,new Error)`Dropping stanza since onBeforeCastStanza matched. (This is not expected in a non-E2E build!)`,Promise.resolve()}catch(e){}const r=this.socketOrThrow("castStanza");try{return r.sendFrame((0,E.encodeStanza)(e)).then((()=>{var t,n;null===(t=(n=this.config.handlers).onCastStanza)||void 0===t||t.call(n,e)})).catch((e=>{if(__LOG__(4,void 0,new Error)`castStanza async error ${e}`,e instanceof l.BufferTooLargeError)return Promise.reject(e)}))}catch(e){__LOG__(4,void 0,new Error)`castStanza error ${e}`}return Promise.resolve()}socketOrThrow(e){const t=this.socket;if(t)return t;throw new Error(`Comms.${e} called while no socket`)}startHandlingRequests(){return __LOG__(2)`Comms.startHandlingRequests`,this._recvBlocker.resolve(),this._recvBlocker.promise.then((()=>{}))}parseAndHandleStanza(e,t){e===this.socketId&&(this.deadSocketTimer.cancel(),T&&(T.resolve(),T=null));const n=(0,E.decodeStanza)(t,this.gzipInflate).catch((e=>{throw __LOG__(4,void 0,new Error)`Failure parsing stanza!`,e})).then((n=>{var r,i;null===(r=(i=this.config.handlers).onHandleStanza)||void 0===r||r.call(i,n,e,t.byteLength);const a=this.activePing;return a&&a.socketId===e&&a.stanzaId===N(n)?(this.activePing=null,a.handler.resolve(n),this.maybeScheduleHealthCheck(),"NO_ACK"):this.handleStanza(n,e,t.byteLength)})).then((t=>{if(e===this.socketId){if("CLOSE_SOCKET"===t){__LOG__(2)`Comms: job response is CLOSE_SOCKET`;const e=this.socket;e&&e.close()}else"NO_ACK"===t||this.castStanza(t);return"NO_ACK"}}));this._pending.add(n),n.finally((()=>{this._pending.delete(n)}))}handleAck(e){const t=this.ackHandlers;let n=-1,r=null;for(;!r&&++n<t.length;)r=t[n].parseAndTest(e);if(r){var i,a;const o=t[n];(0,s.removeIndexWithoutPreservingOrder)(t,n),null===(i=(a=this.config.handlers).onHandleAck)||void 0===i||i.call(a,e),o.resolve(r),this.maybeScheduleHealthCheck()}else __LOG__(3)`handleAck: unrecognized ${e}`}removeHandler(e){if("iq"===e.type||"smax"===e.type){const t=e.stanza.attrs.id;if(!t||"string"!=typeof t)return;if("iq"===e.type&&!this.pendingIqs.delete(t)||"smax"===e.type&&!this.pendingSmaxStanzas.delete(t))return}else{e.type;const t=this.ackHandlers.indexOf(e);if(-1===t)return;(0,s.removeIndexWithoutPreservingOrder)(this.ackHandlers,t)}e.resolve(Promise.reject(new l.Disconnected))}maybeScheduleHealthCheck(){if(this.healthCheckTimer.isScheduled())return;if(this.activePing||this.ackHandlers.length||this.pendingIqs.size||this.pendingSmaxStanzas.size)return;const e=this.config.healthCheckInterval,t=Math.ceil(1e3*e*(1+Math.random()));this.healthCheckTimer.onOrBefore(t)}}function C(){R("openSocketLoop").socketLoop.start()}function P(){var e;return!!(null===(e=S)||void 0===e?void 0:e.socket)}function O(){var e,t;const n=R("socketLoopIteration"),r=n.nextSocketId++;return __LOG__(2)`Comms: Socket ${r} opening`,null===(e=(t=n.config.handlers).onSocketLoopIteration)||void 0===e||e.call(t),n.config.openChatSocket((()=>{n.onConnectionChange("in_handshake")})).then((0,_.onResult)((e=>{var t,i,a,o;null===(t=(i=n.config.handlers).onSocketOpen)||void 0===t||t.call(i);const s=new p.Resolvable;return __LOG__(2)`Comms: Socket ${r} opened`,n.socketId=r,n.socket=e,n.softCloseSocket=()=>{n.softCloseSocket=null,n.socket&&n.config.shouldCloseStaleSocket&&(n.socket.close(),n.socket=null),s.resolve()},n.socketLoop.resetTimeoutAfter(1e4),n.deadSocketTimer.cancel(),n.maybeScheduleHealthCheck(),e.setOnFrame((e=>n.parseAndHandleStanza(r,e))),e.setOnClose((()=>{var e,t;__LOG__(2)`Comms: Socket ${r} closed`,n.activePing&&r===n.activePing.socketId&&(n.activePing.handler.resolve(),n.activePing=null),n.filterPending((e=>e.attachedToSocketId===r)).forEach((e=>{n.removeHandler(e)})),r===n.socketId&&(n.socketId=0,n.socket=null,n.onConnectionChange("disconnected"),null===(e=(t=n.config.handlers).onDisconnect)||void 0===e||e.call(t),s.resolve())})),n.onConnectionChange("connected"),null===(a=(o=n.config.handlers).onConnect)||void 0===a||a.call(o),n.filterPending((e=>!e.attachedToSocketId)).sort(((e,t)=>e.orderedId-t.orderedId)).forEach((e=>{switch(e.type){case"smax":case"iq":n.sendPendingStanza(e);break;case"ack":n.callStanza(e.stanza);break;default:e.type}})),s.promise}))).then((0,_.catchError)((e=>{switch(e){case"max-hunters":__LOG__(3)`socketLoopIteration socket closed while in noise handshake using treasureHunt strategy`;break;case"disconnected":__LOG__(3)`socketLoopIteration socket disconnected while in noise handshake`}}))).catch((e=>{e instanceof l.Disconnected?__LOG__(2)`socketLoopIteration socket closed while in noise handshake`:__LOG__(4,void 0,new Error)`socketLoopIteration failed ${e}`}))}function I(e,t){return new Promise((n=>{const r=R("deprecatedSendStanzaAndWaitForAck"),i={type:"ack",parseAndTest:e=>{const n=o.AckParser.parse(e);return!n.error&&(0,o.ackMatchesTemplate)(n.success,t)?e:null},resolve:n,stanza:e,attachedToSocketId:0,orderedId:v++};r.ackHandlers.push(i),r.socket?r.callStanza(e).catch((e=>{const t=r.ackHandlers.indexOf(i);-1!==t&&((0,s.removeIndexWithoutPreservingOrder)(r.ackHandlers,t),i.resolve(Promise.reject(e)))})):__LOG__(2)`Comms has no open socket, will send stanza when socket opens`}))}function M(e){const t=R("castStanza");t.socket?t.castStanza(e):__LOG__(2)`Comms has no open socket`}function b(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"iq";return new Promise((a=>{const o=R("sendIq"),s=e.attrs.id;if(!s||"string"!=typeof s)throw new Error(`Comms:sendIq given iq without id: ${String(e)}`);const u=o.socketId;if(t&&!u)return void a(Promise.reject(new l.Offline));let c;n>0&&(c=setTimeout((()=>{const e="iq"===r?o.pendingIqs.get(s):o.pendingSmaxStanzas.get(s);e?o.removeHandler(e):a(Promise.reject(new Error(`Comms:_sendIq unexisting stanza to be cancelled: ${s}`)))}),1e3*n));const d={resolve:a,stanza:e,attachedToSocketId:t?u:0,orderedId:v++,timeoutId:c};if("iq"===r){var p,_;const t=(0,i.default)({type:r},d);o.pendingIqs.set(s,t),null===(p=(_=o.config.handlers).onSendIq)||void 0===p||p.call(_,e),o.maybeSendPendingStanza(t)}else{const e=(0,i.default)({type:r},d);o.pendingSmaxStanzas.set(s,e),o.maybeSendPendingStanza(e)}}))}function R(e){if(S)return S;throw new Error(`Comms::${e} called before startComms`)}function N(e){if("iq"===e.tag){const t=e.attrs.type;if("result"===t||"error"===t)return(0,E.decodeAsString)(e.attrs.id)||null}return null}},981369:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notifyConnectionChangeFactory=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:15e3;const r={timeoutID:null,connectionStatus:"disconnected",optimismLevel:"optimist"},i=()=>{const{optimismLevel:e,connectionStatus:i}=r;"optimist"===e?r.timeoutID=setTimeout((()=>{r.optimismLevel="realist",t(i)}),n):t(i)};return n=>{r.connectionStatus=n,"disconnected"===n||"in_handshake"===n?i():(null!=r.timeoutID&&(clearTimeout(r.timeoutID),r.timeoutID=null),t(n)),e(n)}}},968826:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XmppParsingFailure=t.ParsableWapNode=void 0;var r=n(551168),i=n(616310),a=n(478337),o=n(802792),s=n(979320),l=n(990445),u=n(738102),c=n(638134);class d extends Error{constructor(e,t){super(`XmppParsingFailure: ${e}: ${t}`),this.name="XmppParsingFailure",this.parser=e,this.reason=t}}t.XmppParsingFailure=d;class p extends o.ParsableXmlNode{constructor(e,t){super(e,t)}assertFromServer(){const e=this.attrString("from");e!==i.WA_SERVER_JID_SUFFIX&&this.throw(`to have "from"="s.whatsapp.net", but instead has "${e}"`)}attrUserJid(e){const t=this.attrString(e),n=(0,i.interpretAndValidateJid)(t);return null==n.userJid?this.throw(`to have "${e}"={UserJid}, but instead has "${t}"`):n.userJid}attrPhoneUserJid(e){const t=this.attrString(e),n=(0,i.interpretAndValidateJid)(t);return"phoneUser"===n.jidType?n.userJid:this.throw(`to have "${e}"={PhoneUserJid}, but instead has "${t}"`)}attrLidUserJid(e){const t=this.attrString(e),n=(0,i.interpretAndValidateJid)(t);return"lidUser"===n.jidType?n.userJid:this.throw(`to have "${e}"={LidUserJid}, but instead has "${t}"`)}maybeAttrUserJid(e){return this.hasAttr(e)?this.attrUserJid(e):null}maybeAttrPhoneUserJid(e){return this.hasAttr(e)?this.attrPhoneUserJid(e):null}maybeAttrLidUserJid(e){return this.hasAttr(e)?this.attrLidUserJid(e):null}attrGroupJid(e){const t=this.attrString(e),n=(0,i.interpretAndValidateJid)(t);return null==n.groupJid?this.throw(`to have "${e}"={GroupJid}, but instead has "${t}"`):n.groupJid}maybeAttrGroupJid(e){return this.hasAttr(e)?this.attrGroupJid(e):null}attrChatJid(e){const t=this.attrString(e),n=(0,i.interpretAndValidateJid)(t);return null!=n.userJid?n.userJid:null!=n.groupJid?n.groupJid:this.throw(`to have "${e}"={ChatJid}, but instead has "${t}"`)}attrPhoneChatJid(e){const t=this.attrString(e),n=(0,i.interpretAndValidateJid)(t);return"phoneUser"===n.jidType?n.userJid:"group"===n.jidType?n.groupJid:this.throw(`to have "${e}"={ChatJid}, but instead has "${t}"`)}attrDeviceJid(e){const t=this.attrString(e),n=(0,i.interpretAndValidateJid)(t);return null!=n.deviceJid?n.deviceJid:null!=n.userJid?(0,i.defaultDeviceJidForUser)(n.userJid):this.throw(`to have "${e}"={DeviceJid}, but instead has "${t}"`)}attrPhoneDeviceJid(e){const t=this.attrString(e),n=(0,i.interpretAndValidateJid)(t);return"phoneDevice"===n.jidType?n.deviceJid:"phoneUser"===n.jidType?(0,i.defaultPhoneDeviceJidForUser)(n.userJid):this.throw(`to have "${e}"={DeviceJid}, but instead has "${t}"`)}attrDeviceId(e){const t=this.attrInt(e);return(0,i.interpretAsDeviceId)(t)}attrFromJidChat(){const e=this.attrJidWithType();switch(e.jidType){case"msgrUser":{const t=e.userJid,n=(0,i.defaultDeviceJidForUser)(t);return{type:"device",chat:t,deviceJid:n,author:n}}case"phoneUser":{const t=e.userJid,n=(0,i.defaultDeviceJidForUser)(t);return{type:"device",chat:t,deviceJid:n,author:n}}case"lidUser":{const t=e.userJid,n=(0,i.defaultLidDeviceJidForLidUserJid)(t);return{type:"device",chat:t,deviceJid:n,author:n}}case"phoneDevice":{const t=e.deviceJid;return{type:"device",chat:(0,i.extractUserJid)(t),deviceJid:t,author:t}}case"msgrDevice":{const t=e.deviceJid;return{type:"device",chat:(0,i.extractUserJid)(t),deviceJid:t,author:t}}case"lidDevice":{const t=e.deviceJid;return{type:"device",chat:(0,i.extractUserJid)(t),deviceJid:t,author:t}}case"group":{const t=this.hasAttr("participant")?this.attrDeviceJid("participant"):null;return null==t?this.throw("expected to have participant JID for group"):{type:"group",chat:e.groupJid,groupJid:e.groupJid,author:t}}case"broadcast":{const t=this.hasAttr("participant")?this.attrDeviceJid("participant"):null;return null==t?this.throw("expected to have participant JID for group"):{type:"broadcast",broadcastJid:e.broadcastJid,chat:(0,i.extractUserJid)(t),author:t}}case"call":throw __LOG__(4,void 0,new Error)`ParsableWapNode: attrFromJid() is called with ${e.callJid}`,new Error("ParsableWapNode: attrFromJid() does not support CallJid");default:return e.jidType,this.throw("attrFromJidChat should not be used with a status jid")}}attrFromJidPhoneChat(){const e=this.attrJidWithType();switch(e.jidType){case"phoneUser":{const t=e.userJid,n=(0,i.defaultPhoneDeviceJidForUser)(t);return{type:"device",chat:t,deviceJid:n,author:n}}case"phoneDevice":{const t=e.deviceJid;return{type:"device",chat:(0,i.extractPhoneUserJid)(t),deviceJid:t,author:t}}case"group":{const t=this.hasAttr("participant")?this.attrPhoneDeviceJid("participant"):null;return null==t?this.throw("expected to have participant JID for group"):{type:"group",chat:e.groupJid,groupJid:e.groupJid,author:t}}case"broadcast":{const t=this.hasAttr("participant")?this.attrPhoneDeviceJid("participant"):null;return null==t?this.throw("expected to have participant JID for group"):{type:"broadcast",broadcastJid:e.broadcastJid,chat:(0,i.extractPhoneUserJid)(t),author:t}}case"call":throw __LOG__(4,void 0,new Error)`ParsableWapNode: attrFromJid() is called with ${e.callJid}`,new Error("ParsableWapNode: attrFromJid() does not support CallJid");default:return e.jidType,this.throw(`attrFromJidChat should not be used with jid of type ${e.jidType}`)}}attrFromPhoneJid(){if("status"===this.attrJidWithType().jidType){const e=this.hasAttr("participant")?this.attrPhoneDeviceJid("participant"):null;return null==e?this.throw("to have participant for status msg"):{type:"status",author:e}}return this.attrFromJidPhoneChat()}attrFromJid(){if("status"===this.attrJidWithType().jidType){const e=this.hasAttr("participant")?this.attrPhoneDeviceJid("participant"):null;return null==e?this.throw("to have participant for status msg"):{type:"status",author:e}}return this.attrFromJidChat()}attrJidWithType(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"from";const t=this.attrString(e),n=(0,i.interpretAndValidateJid)(t);return"unknown"===n.jidType?this.throw(`to have "${e}"={Jid}, but instead has "${t}"`):n}attrWapJid(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"from";const t=this.attrString(e),n=(0,i.interpretAndValidateJid)(t);return"unknown"===n.jidType?c.WapJid.create(null,t):(0,u.JID)((0,i.extractFromJid)(n))}attrLongInt(e){const t=this.attrString(e);return(0,a.decimalStringToLongInt)(t)}attrTime(e){return(0,l.castToUnixTime)(this.attrInt(e))}attrFutureTime(e){const t=this.attrInt(e);return(0,l.futureUnixTime)(t)}contentString(){if(this.hasChildren())return this.throw("to have string content, but has children instead");if(this.hasContent()){const e=new r.Binary(this.contentBytes());return e.readString(e.size())}return this.throw("to have content")}decodeAsString(e){return(0,u.decodeAsString)(e)}contentSerializedPubKey(){return this.hasContent()?(0,s.serializeIdentity)(this.contentBytes()):this.throw("to have content")}createParseError(e){return new d(this.name(),`expected <${this.tag()}> ${e}`)}throw(e){throw this.createParseError(e)}}t.ParsableWapNode=p},442046:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIqResponse=function(e,t,n){const a=e.content;if(a&&Array.isArray(a)&&a[0]){const t=a[0];if("error"===t.tag){const a=t.attrs||{};let o;n&&(o="function"==typeof n?n(e):n.parseOrThrow(t));const s=o;return{success:!1,errorCode:parseInt(a.code,10),errorText:(0,r.decodeAsString)(a.text)||"",errorType:(0,r.decodeAsString)(a.type)||"",errorBackoff:parseInt(a.backoff,10),toString:i,customError:s}}}return"function"==typeof t?{success:!0,result:t(e)}:{success:!0,result:t.parseOrThrow(e)}};var r=n(738102);n(769707);function i(){return`IqError ${this.errorCode}: ${this.errorText}`}},738102:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.BIG_ENDIAN_CONTENT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,n=e;const r=new Uint8Array(t);for(let e=t-1;e>=0;e--)r[e]=255&n,n>>>=8;return r},t.BROADCAST_JID=function(e){return $(e)},t.CALL_JID=function(e){return $(e)},t.CUSTOM_STRING=function(e){return e},t.DEVICE_JID=function(e){return $(e)},t.DOMAIN_JID=z,t.DROP_ATTR=void 0,t.GROUP_JID=function(e){return $(e)},t.G_US=void 0,t.INT=function(e){return e.toString()},t.JID=$,t.LONG_INT=function(e){return(0,s.longIntToDecimalString)(e)},t.MAYBE_CUSTOM_STRING=function(e){if(null==e)return v;return e},t.PARTICIPANT_JID=function(e){return"status"===e.type||"group"===e.type||"broadcast"===e.type?$(e.author):v},t.STANZA_ID=function(e){return e},t.S_WHATSAPP_NET=t.STATUS_BROADCAST=void 0,t.TO_JID=function(e){return $(V(e))},t.TO_WAP_JID=function(e){return"phoneDevice"===e.jidType||"msgrDevice"===e.jidType||"lidDevice"===e.jidType?$(e.deviceJid):"phoneUser"===e.jidType||"msgrUser"===e.jidType||"lidUser"===e.jidType?$(e.userJid):"group"===e.jidType?$(e.groupJid):"status"===e.jidType?$(e.statusJid):"call"===e.jidType?$(e.callJid):(e.jidType,$(e.broadcastJid))},t.USER_JID=function(e){return $(e)},t.WapNode=void 0,t.decodeAsString=function(e){if(e instanceof u.WapJid)return e.toString();return e},t.decodeStanza=function(e,t){const n=new a.Binary(e);if(2&n.readUint8())return __LOG__(2)`Decoding compressed stanza`,t(n.readByteArray()).then((e=>Y(new a.Binary(e))));return Promise.resolve(Y(n))},t.enableXMLFormat=function(){I=!0},t.encodeStanza=function(e){const t=e instanceof M?e:N(e),n=new a.Binary;w(t,n);const r=n.readByteArray(),i=new Uint8Array(1+r.length);return i[0]=0,i.set(r,1),i},t.extractParticipantJid=function(e){switch(e.type){case"group":case"status":case"broadcast":return e.author;default:return e.type,null}},t.extractToJid=V,t.generateId=function(){if(!S){const e=new Uint16Array(2);self.crypto.getRandomValues(e),S=`${String(e[0])}.${String(e[1])}-`}return`${S}${T++}`},t.makeStanza=N,t.makeWapNode=b,t.wap=void 0;var i=r(n(246203)),a=n(551168),o=n(616310),s=n(478337),l=n(969726),u=n(638134),c=r(n(301506)),d=n(838448);const p=o.MSGR_USER_DOMAIN.replace("@",""),_=o.WA_USER_DOMAIN.replace("@",""),f=o.LID_DOMAIN.replace("@",""),h=[236,237,238,239],g=248,m=249,y=["0","1","2","3","4","5","6","7","8","9","-",".","<22>","<22>","<22>","<22>"],E=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];let S="",T=1;const v={sentinel:"DROP_ATTR"};t.DROP_ATTR=v;const A=u.WapJid.create(null,"g.us");t.G_US=A;const C=u.WapJid.create(null,o.WA_SERVER_JID_SUFFIX);t.S_WHATSAPP_NET=C;const P=u.WapJid.create("status","broadcast");t.STATUS_BROADCAST=P;const O={};let I=!1;class M{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:O,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.tag=e,this.attrs=t,this.content=n}toString(){let e="<"+this.tag;e+=(0,d.attrsToString)(this.attrs);const t=this.content;return Array.isArray(t)?e+=`>${t.map(String).join("")}</${this.tag}>`:e+=t?`>${(0,d.uint8ArrayToDebugString)(t)}</${this.tag}>`:" />",I&&(e=(0,c.default)(e)),e}}function b(e,t,n){let r=null;if(t&&null!=t.children)throw new Error('Children should not be passed via props (see eslint check "react/no-children-props")');if(Array.isArray(n))r=n.filter(Boolean);else if("string"==typeof n)r=a.Binary.build(n).readByteArray();else if(n instanceof ArrayBuffer)r=new Uint8Array(n);else if(n instanceof Uint8Array)r=n;else{const e=[];for(let t=2;t<arguments.length;t++){const n=arguments[t];n&&e.push(n)}r=e}Array.isArray(r)&&0===r.length&&(r=null);const i={};if(t){const n=t;Object.keys(n).forEach((t=>{const r=n[t];if(null==r)throw new Error(`Attr ${t} in <${e}> is null`);r!==v&&(i[t]=r)}))}return new M(e,i,r)}t.WapNode=M;const R=b;function N(e){let t=e.content;return Array.isArray(t)?t=t.map(N):"string"==typeof t&&(t=a.Binary.build(t).readByteArray()),new M(e.tag,e.attrs||O,t)}function w(e,t){if(null==e)t.writeUint8(0);else if(e instanceof M)L(e,t);else if(e instanceof u.WapJid)!function(e,t){const n=e.getInnerJid();if(n.type===u.WAP_JID_SUBTYPE.JID_U){const{user:e,device:r,domainType:i}=n;t.writeUint8(247),t.writeUint8(i),t.writeUint8(r),w(e,t)}else if(n.type===u.WAP_JID_SUBTYPE.JID_FB){const{user:e,device:r}=n;t.writeUint8(246),w(e,t),t.writeUint16(r),w(_,t)}else{const{user:e,server:r}=n;t.writeUint8(250),null!=e?w(e,t):t.writeUint8(0),w(r,t)}}(e,t);else if("string"==typeof e)G(e,t);else{if(!(e instanceof Uint8Array))throw new Error("Invalid payload type "+typeof e);!function(e,t){B(e.length,t),t.writeByteArray(e)}(e,t)}}function L(e,t){if(void 0===e.tag)return t.writeUint8(g),void t.writeUint8(0);let n=1;e.attrs&&(n+=2*Object.keys(e.attrs).length),e.content&&n++,n<256?(t.writeUint8(g),t.writeUint8(n)):n<65536&&(t.writeUint8(m),t.writeUint16(n)),w(e.tag,t),e.attrs&&Object.keys(e.attrs).forEach((n=>{G(n,t),w(e.attrs[n],t)}));const r=e.content;if(Array.isArray(r)){r.length<256?(t.writeUint8(g),t.writeUint8(r.length)):r.length<65536&&(t.writeUint8(m),t.writeUint16(r.length));for(let e=0;e<r.length;e++)L(r[e],t)}else r&&w(r,t)}let D,k;function U(e){const t=new Map;for(let n=0;n<e.length;n++)t.set(e[n],n);return t}function G(e,t){if(""===e)return t.writeUint8(252),void t.writeUint8(0);null==D&&(D=U(l.SINGLE_BYTE_TOKEN));const n=D.get(e);if(null!=n)return void t.writeUint8(n+1);if(null==k){k=[];for(let e=0;e<l.DICTIONARIES.length;++e)k.push(U(l.DICTIONARIES[e]))}for(let n=0;n<k.length;++n){const r=k[n].get(e);if(null!=r)return t.writeUint8(h[n]),void t.writeUint8(r)}const r=(0,a.numUtf8Bytes)(e);if(r<128){if(!/[^0-9.-]+?/.exec(e))return void x(e,255,t);if(!/[^0-9A-F]+?/.exec(e))return void x(e,251,t)}B(r,t),t.writeString(e)}function x(e,t,n){const r=e.length%2==1;n.writeUint8(t);let i=Math.ceil(e.length/2);r&&(i|=128),n.writeUint8(i);let a=0;for(let r=0;r<e.length;r++){const i=e.charCodeAt(r);let o=null;if(48<=i&&i<=57?o=i-48:255===t?45===i?o=10:46===i&&(o=11):251===t&&65<=i&&i<=70&&(o=i-55),null==o)throw new Error(`Cannot nibble encode ${i}`);r%2==0?(a=o<<4,r===e.length-1&&(a|=15,n.writeUint8(a))):(a|=o,n.writeUint8(a))}}function B(e,t){if(e<256)t.writeUint8(252),t.writeUint8(e);else if(e<1048576)t.writeUint8(253),t.writeUint8(e>>>16&255),t.writeUint8(e>>>8&255),t.writeUint8(255&e);else{if(!(e<4294967296))throw new Error(`Binary with length ${e} is too big for WAP protocol`);t.writeUint8(254),t.writeUint32(e)}}function F(e,t){const n=e.readUint8();if(0===n)return null;if(n===g)return j(e,e.readUint8());if(n===m)return j(e,e.readUint16());if(252===n){const n=e.readUint8();return H(e,n,t)}if(253===n){const n=e.readUint8(),r=e.readUint8(),i=e.readUint8();return H(e,((15&n)<<16)+(r<<8)+i,t)}if(254===n){const n=e.readUint32();return H(e,n,t)}if(250===n)return function(e){const t=function(e){const t=F(e,!0);if(null!=t&&"string"!=typeof t)throw new Error("WAWap:decodeNullableString got invalid value, string expected");return t}(e),n=K(e);return u.WapJid.create(t,n)}(e);if(246===n)return function(e){const t=K(e),n=e.readUint16();return K(e),u.WapJid.createFbJid(t,n)}(e);if(247===n)return function(e){let t=null;const n=e.readUint8();if(0===n)t=u.DOMAIN_TYPE.WHATSAPP;else{if(1!==n)throw new Error(`decodeJidU - Invalid domain type encoding ${n}`);t=u.DOMAIN_TYPE.LID}const r=e.readUint8(),i=K(e);return u.WapJid.createJidU(i,t,r)}(e);if(255===n){const t=e.readUint8();return W(e,y,t>>>7,127&t)}if(251===n){const t=e.readUint8();return W(e,E,t>>>7,127&t)}if(n<=0||n>=240)throw new Error("Unable to decode WAP buffer");if(n>=236&&n<=239){const t=n-236,r=l.DICTIONARIES[t];if(void 0===r)throw new Error(`Missing WAP dictionary ${t}`);const i=e.readUint8(),a=r[i];if(void 0===a)throw new Error(`Invalid value index ${i} in dict ${t}`);return a}const r=l.SINGLE_BYTE_TOKEN[n-1];if(void 0===r)throw new Error(`Undefined token with index ${n}`);return r}function j(e,t){const n=[];for(let r=0;r<t;r++)n.push(Y(e));return n}function Y(e){const t=e.readUint8();let n,r;if(t===g)n=e.readUint8();else{if(t!==m)throw new Error(`Failed to decode node since type byte ${String(t)} is invalid`);n=e.readUint16()}let i=null;if(0===n)throw new Error("Failed to decode node, list cannot be empty");const a=K(e);for(n-=1;n>1;){r||(r={});const t=K(e),i=F(e,!0);r[t]=i,n-=2}return 1===n&&(i=F(e,!1),i instanceof u.WapJid&&(i=String(i))),new M(a,r,i)}function K(e){const t=F(e,!0);if("string"!=typeof t)throw new Error("WAWap:decodeString got invalid value, string expected");return t}function H(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return n?e.readString(t):e.readByteArray(t)}function W(e,t,n,r){const i=new Array(2*r-n);for(let n=0;n<i.length-1;n+=2){const r=e.readUint8();i[n]=t[r>>>4],i[n+1]=t[15&r]}if(n){const n=e.readUint8();i[i.length-1]=t[n>>>4]}return i.join("")}function V(e){switch(e.type){case"group":return e.groupJid;case"status":return o.STATUS_JID;case"device":return e.deviceJid;default:return e.type,e.broadcastJid}}function $(e){const t=(0,o.validateDomainJid)(e);if(null!=t)return z(t);let[n,r]=e.split("@"),i=null,a=null;if(r!==_&&r!==p&&r!==f||-1!==n.indexOf(":")&&([n,i]=n.split(":"),a=parseInt(i,10)),r===p)return u.WapJid.createFbJid(n,a);const s=r===f?u.DOMAIN_TYPE.LID:u.DOMAIN_TYPE.WHATSAPP;return null!=a&&0!==a?u.WapJid.createJidU(n,s,a):u.WapJid.create(n,r)}function z(e){return"s.whatsapp.net"===e?C:"g.us"===e?A:(0,i.default)(e)}t.wap=R},969726:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SINGLE_BYTE_TOKEN=t.DICT_VERSION=t.DICTIONARY_3_TOKEN=t.DICTIONARY_2_TOKEN=t.DICTIONARY_1_TOKEN=t.DICTIONARY_0_TOKEN=t.DICTIONARIES=void 0;t.DICT_VERSION=2;t.SINGLE_BYTE_TOKEN=["xmlstreamstart","xmlstreamend","s.whatsapp.net","type","participant","from","receipt","id","broadcast","status","message","notification","notify","to","jid","user","class","offline","g.us","result","mediatype","enc","skmsg","off_cnt","xmlns","presence","participants","ack","t","iq","device_hash","read","value","media","picture","chatstate","unavailable","text","urn:xmpp:whatsapp:push","devices","verified_name","contact","composing","edge_routing","routing_info","item","image","verified_level","get","fallback_hostname","2","media_conn","1","v","handshake","fallback_class","count","config","offline_preview","download_buckets","w:profile:picture","set","creation","location","fallback_ip4","msg","urn:xmpp:ping","fallback_ip6","call-creator","relaylatency","success","subscribe","video","business_hours_config","platform","hostname","version","unknown","0","ping","hash","edit","subject","max_buckets","download","delivery","props","sticker","name","last","contacts","business","primary","preview","w:p","pkmsg","call-id","retry","prop","call","auth_ttl","available","relay_id","last_id","day_of_week","w","host","seen","bits","list","atn","upload","is_new","w:stats","key","paused","specific_hours","multicast","stream:error","mmg.whatsapp.net","code","deny","played","profile","fna","device-list","close_time","latency","gcm","pop","audio","26","w:web","open_time","error","auth","ip4","update","profile_options","config_value","category","catalog_not_created","00","config_code","mode","catalog_status","ip6","blocklist","registration","7","web","fail","w:m","cart_enabled","ttl","gif","300","device_orientation","identity","query","401","media-gig2-1.cdn.whatsapp.net","in","3","te2","add","fallback","categories","ptt","encrypt","notice","thumbnail-document","item-not-found","12","thumbnail-image","stage","thumbnail-link","usync","out","thumbnail-video","8","01","context","sidelist","thumbnail-gif","terminate","not-authorized","orientation","dhash","capability","side_list","md-app-state","description","serial","readreceipts","te","business_hours","md-msg-hist","tag","attribute_padding","document","open_24h","delete","expiration","active","prev_v_id","true","passive","index","4","conflict","remove","w:gp2","config_expo_key","screen_height","replaced","02","screen_width","uploadfieldstat","2:47DEQpj8","media-bog1-1.cdn.whatsapp.net","encopt","url","catalog_exists","keygen","rate","offer","opus","media-mia3-1.cdn.whatsapp.net","privacy","media-mia3-2.cdn.whatsapp.net","signature","preaccept","token_id","media-eze1-1.cdn.whatsapp.net"];const n=["media-for1-1.cdn.whatsapp.net","relay","media-gru2-2.cdn.whatsapp.net","uncompressed","medium","voip_settings","device","reason","media-lim1-1.cdn.whatsapp.net","media-qro1-2.cdn.whatsapp.net","media-gru1-2.cdn.whatsapp.net","action","features","media-gru2-1.cdn.whatsapp.net","media-gru1-1.cdn.whatsapp.net","media-otp1-1.cdn.whatsapp.net","kyc-id","priority","phash","mute","token","100","media-qro1-1.cdn.whatsapp.net","none","media-mrs2-2.cdn.whatsapp.net","sign_credential","03","media-mrs2-1.cdn.whatsapp.net","protocol","timezone","transport","eph_setting","1080","original_dimensions","media-frx5-1.cdn.whatsapp.net","background","disable","original_image_url","5","transaction-id","direct_path","103","appointment_only","request_image_url","peer_pid","address","105","104","102","media-cdt1-1.cdn.whatsapp.net","101","109","110","106","background_location","v_id","sync","status-old","111","107","ppic","media-scl2-1.cdn.whatsapp.net","business_profile","108","invite","04","audio_duration","media-mct1-1.cdn.whatsapp.net","media-cdg2-1.cdn.whatsapp.net","media-los2-1.cdn.whatsapp.net","invis","net","voip_payload_type","status-revoke-delay","404","state","use_correct_order_for_hmac_sha1","ver","media-mad1-1.cdn.whatsapp.net","order","540","skey","blinded_credential","android","contact_remove","enable_downlink_relay_latency_only","duration","enable_vid_one_way_codec_nego","6","media-sof1-1.cdn.whatsapp.net","accept","all","signed_credential","media-atl3-1.cdn.whatsapp.net","media-lhr8-1.cdn.whatsapp.net","website","05","latitude","media-dfw5-1.cdn.whatsapp.net","forbidden","enable_audio_piggyback_network_mtu_fix","media-dfw5-2.cdn.whatsapp.net","note.m4r","media-atl3-2.cdn.whatsapp.net","jb_nack_discard_count_fix","longitude","Opening.m4r","media-arn2-1.cdn.whatsapp.net","email","timestamp","admin","media-pmo1-1.cdn.whatsapp.net","America/Sao_Paulo","contact_add","media-sin6-1.cdn.whatsapp.net","interactive","8000","acs_public_key","sigquit_anr_detector_release_rollover_percent","media.fmed1-2.fna.whatsapp.net","groupadd","enabled_for_video_upgrade","latency_update_threshold","media-frt3-2.cdn.whatsapp.net","calls_row_constraint_layout","media.fgbb2-1.fna.whatsapp.net","mms4_media_retry_notification_encryption_enabled","timeout","media-sin6-3.cdn.whatsapp.net","audio_nack_jitter_multiplier","jb_discard_count_adjust_pct_rc","audio_reserve_bps","delta","account_sync","default","media.fjed4-6.fna.whatsapp.net","06","lock_video_orientation","media-frt3-1.cdn.whatsapp.net","w:g2","media-sin6-2.cdn.whatsapp.net","audio_nack_algo_mask","media.fgbb2-2.fna.whatsapp.net","media.fmed1-1.fna.whatsapp.net","cond_range_target_bitrate","mms4_server_error_receipt_encryption_enabled","vid_rc_dyn","fri","cart_v1_1_order_message_changes_enabled","reg_push","jb_hist_deposit_value","privatestats","media.fist7-2.fna.whatsapp.net","thu","jb_discard_count_adjust_pct","mon","group_call_video_maximization_enabled","mms_cat_v1_forward_hot_override_enabled","audio_nack_new_rtt","media.fsub2-3.fna.whatsapp.net","media_upload_aggressive_retry_exponential_backoff_enabled","tue","wed","media.fruh4-2.fna.whatsapp.net","audio_nack_max_seq_req","max_rtp_audio_packet_resends","jb_hist_max_cdf_value","07","audio_nack_max_jb_delay","mms_forward_partially_downloaded_video","media-lcy1-1.cdn.whatsapp.net","resume","jb_inband_fec_aware","new_commerce_entry_point_enabled","480","payments_upi_generate_qr_amount_limit","sigquit_anr_detector_rollover_percent","media.fsdu2-1.fna.whatsapp.net","fbns","aud_pkt_reorder_pct","dec","stop_probing_before_accept_send","media_upload_max_aggressive_retries","edit_business_profile_new_mode_enabled","media.fhex4-1.fna.whatsapp.net","media.fjed4-3.fna.whatsapp.net","sigquit_anr_detector_64bit_rollover_percent","cond_range_ema_jb_last_delay","watls_enable_early_data_http_get","media.fsdu2-2.fna.whatsapp.net","message_qr_disambiguation_enabled","media-mxp1-1.cdn.whatsapp.net","sat","vertical","media.fruh4-5.fna.whatsapp.net","200","media-sof1-2.cdn.whatsapp.net","-1","height","product_catalog_hide_show_items_enabled","deep_copy_frm_last","tsoffline","vp8/h.264","media.fgye5-3.fna.whatsapp.net","media.ftuc1-2.fna.whatsapp.net","smb_upsell_chat_banner_enabled","canonical","08","9",".","media.fgyd4-4.fna.whatsapp.net","media.fsti4-1.fna.whatsapp.net","mms_vcache_aggregation_enabled","mms_hot_content_timespan_in_seconds","nse_ver","rte","third_party_sticker_web_sync","cond_range_target_total_bitrate","media_upload_aggressive_retry_enabled","instrument_spam_report_enabled","disable_reconnect_tone","move_media_folder_from_sister_app","one_tap_calling_in_group_chat_size","10","storage_mgmt_banner_threshold_mb","enable_backup_passive_mode","sharechat_inline_player_enabled","media.fcnq2-1.fna.whatsapp.net","media.fhex4-2.fna.whatsapp.net","media.fist6-3.fna.whatsapp.net","ephemeral_drop_column_stage","reconnecting_after_network_change_threshold_ms","media-lhr8-2.cdn.whatsapp.net","cond_jb_last_delay_ema_alpha","entry_point_block_logging_enabled","critical_event_upload_log_config","respect_initial_bitrate_estimate","smaller_image_thumbs_status_enabled","media.fbtz1-4.fna.whatsapp.net","media.fjed4-1.fna.whatsapp.net","width","720","enable_frame_dropper","enable_one_side_mode","urn:xmpp:whatsapp:dirty","new_sticker_animation_behavior_v2","media.flim3-2.fna.whatsapp.net","media.fuio6-2.fna.whatsapp.net","skip_forced_signaling","dleq_proof","status_video_max_bitrate","lazy_send_probing_req","enhanced_storage_management","android_privatestats_endpoint_dit_enabled","media.fscl13-2.fna.whatsapp.net","video_duration"];t.DICTIONARY_0_TOKEN=n;const r=["group_call_discoverability_enabled","media.faep9-2.fna.whatsapp.net","msgr","bloks_loggedin_access_app_id","db_status_migration_step","watls_prefer_ip6","jabber:iq:privacy","68","media.fsaw1-11.fna.whatsapp.net","mms4_media_conn_persist_enabled","animated_stickers_thread_clean_up","media.fcgk3-2.fna.whatsapp.net","media.fcgk4-6.fna.whatsapp.net","media.fgye5-2.fna.whatsapp.net","media.flpb1-1.fna.whatsapp.net","media.fsub2-1.fna.whatsapp.net","media.fuio6-3.fna.whatsapp.net","not-allowed","partial_pjpeg_bw_threshold","cap_estimated_bitrate","mms_chatd_resume_check_over_thrift","smb_upsell_business_profile_enabled","product_catalog_webclient","groups","sigquit_anr_detector_release_updated_rollout","syncd_key_rotation_enabled","media.fdmm2-1.fna.whatsapp.net","media-hou1-1.cdn.whatsapp.net","remove_old_chat_notifications","smb_biztools_deeplink_enabled","use_downloadable_filters_int","group_qr_codes_enabled","max_receipt_processing_time","optimistic_image_processing_enabled","smaller_video_thumbs_status_enabled","watls_early_data","reconnecting_before_relay_failover_threshold_ms","cond_range_packet_loss_pct","groups_privacy_blacklist","status-revoke-drop","stickers_animated_thumbnail_download","dedupe_transcode_shared_images","dedupe_transcode_shared_videos","media.fcnq2-2.fna.whatsapp.net","media.fgyd4-1.fna.whatsapp.net","media.fist7-1.fna.whatsapp.net","media.flim3-3.fna.whatsapp.net","add_contact_by_qr_enabled","https://faq.whatsapp.com/payments","multicast_limit_global","sticker_notification_preview","smb_better_catalog_list_adapters_enabled","bloks_use_minscript_android","pen_smoothing_enabled","media.fcgk4-5.fna.whatsapp.net","media.fevn1-3.fna.whatsapp.net","media.fpoj7-1.fna.whatsapp.net","media-arn2-2.cdn.whatsapp.net","reconnecting_before_network_change_threshold_ms","android_media_use_fresco_for_gifs","cond_in_congestion","status_image_max_edge","sticker_search_enabled","starred_stickers_web_sync","db_blank_me_jid_migration_step","media.fist6-2.fna.whatsapp.net","media.ftuc1-1.fna.whatsapp.net","09","anr_fast_logs_upload_rollout","camera_core_integration_enabled","11","third_party_sticker_caching","thread_dump_contact_support","wam_privatestats_enabled","vcard_as_document_size_kb","maxfpp","fbip","ephemeral_allow_group_members","media-bom1-2.cdn.whatsapp.net","media-xsp1-1.cdn.whatsapp.net","disable_prewarm","frequently_forwarded_max","media.fbtz1-5.fna.whatsapp.net","media.fevn7-1.fna.whatsapp.net","media.fgyd4-2.fna.whatsapp.net","sticker_tray_animation_fully_visible_items","green_alert_banner_duration","reconnecting_after_p2p_failover_threshold_ms","connected","share_biz_vcard_enabled","stickers_animation","0a","1200","WhatsApp","group_description_length","p_v_id","payments_upi_intent_transaction_limit","frequently_forwarded_messages","media-xsp1-2.cdn.whatsapp.net","media.faep8-1.fna.whatsapp.net","media.faep8-2.fna.whatsapp.net","media.faep9-1.fna.whatsapp.net","media.fdmm2-2.fna.whatsapp.net","media.fgzt3-1.fna.whatsapp.net","media.flim4-2.fna.whatsapp.net","media.frao1-1.fna.whatsapp.net","media.fscl9-2.fna.whatsapp.net","media.fsub2-2.fna.whatsapp.net","superadmin","media.fbog10-1.fna.whatsapp.net","media.fcgh28-1.fna.whatsapp.net","media.fjdo10-1.fna.whatsapp.net","third_party_animated_sticker_import","delay_fec","attachment_picker_refresh","android_linked_devices_re_auth_enabled","rc_dyn","green_alert_block_jitter","add_contact_logging_enabled","biz_message_logging_enabled","conversation_media_preview_v2","media-jnb1-1.cdn.whatsapp.net","ab_key","media.fcgk4-2.fna.whatsapp.net","media.fevn1-1.fna.whatsapp.net","media.fist6-1.fna.whatsapp.net","media.fruh4-4.fna.whatsapp.net","media.fsti4-2.fna.whatsapp.net","mms_vcard_autodownload_size_kb","watls_enabled","notif_ch_override_off","media.fsaw1-14.fna.whatsapp.net","media.fscl13-1.fna.whatsapp.net","db_group_participant_migration_step","1020","cond_range_sterm_rtt","invites_logging_enabled","triggered_block_enabled","group_call_max_participants","media-iad3-1.cdn.whatsapp.net","product_catalog_open_deeplink","shops_required_tos_version","image_max_kbytes","cond_low_quality_vid_mode","db_receipt_migration_step","jb_early_prob_hist_shrink","media.fdmm2-3.fna.whatsapp.net","media.fdmm2-4.fna.whatsapp.net","media.fruh4-1.fna.whatsapp.net","media.fsaw2-2.fna.whatsapp.net","remove_geolocation_videos","new_animation_behavior","fieldstats_beacon_chance","403","authkey_reset_on_ban","continuous_ptt_playback","reconnecting_after_relay_failover_threshold_ms","false","group","sun","conversation_swipe_to_reply","ephemeral_messages_setting","smaller_video_thumbs_enabled","md_device_sync_enabled","bloks_shops_pdp_url_regex","lasso_integration_enabled","media-bom1-1.cdn.whatsapp.net","new_backup_format_enabled","256","media.faep6-1.fna.whatsapp.net","media.fasr1-1.fna.whatsapp.net","media.fbtz1-7.fna.whatsapp.net","media.fesb4-1.fna.whatsapp.net","media.fjdo1-2.fna.whatsapp.net","media.frba2-1.fna.whatsapp.net","watls_no_dns","600","db_broadcast_me_jid_migration_step","new_wam_runtime_enabled","group_update","enhanced_block_enabled","sync_wifi_threshold_kb","mms_download_nc_cat","bloks_minification_enabled","ephemeral_messages_enabled","reject","voip_outgoing_xml_signaling","creator","dl_bw","payments_request_messages","target_bitrate","bloks_rendercore_enabled","media-hbe1-1.cdn.whatsapp.net","media-hel3-1.cdn.whatsapp.net","media-kut2-2.cdn.whatsapp.net","media-lax3-1.cdn.whatsapp.net","media-lax3-2.cdn.whatsapp.net","sticker_pack_deeplink_enabled","hq_image_bw_threshold","status_info","voip","dedupe_transcode_videos","grp_uii_cleanup","linked_device_max_count","media.flim1-1.fna.whatsapp.net","media.fsaw2-1.fna.whatsapp.net","reconnecting_after_call_active_threshold_ms","1140","catalog_pdp_new_design","media.fbtz1-10.fna.whatsapp.net","media.fsaw1-15.fna.whatsapp.net","0b","consumer_rc_provider","mms_async_fast_forward_ttl","jb_eff_size_fix","voip_incoming_xml_signaling","media_provider_share_by_uuid","suspicious_links","dedupe_transcode_images","green_alert_modal_start","media-cgk1-1.cdn.whatsapp.net","media-lga3-1.cdn.whatsapp.net","template_doc_mime_types","important_messages","user_add","vcard_max_size_kb","media.fada2-1.fna.whatsapp.net","media.fbog2-5.fna.whatsapp.net","media.fbtz1-3.fna.whatsapp.net","media.fcgk3-1.fna.whatsapp.net","media.fcgk7-1.fna.whatsapp.net","media.flim1-3.fna.whatsapp.net","media.fscl9-1.fna.whatsapp.net","ctwa_context_enterprise_enabled","media.fsaw1-13.fna.whatsapp.net","media.fuio11-2.fna.whatsapp.net","status_collapse_muted","db_migration_level_force","recent_stickers_web_sync","bloks_session_state","bloks_shops_enabled","green_alert_setting_deep_links_enabled","restrict_groups","battery","green_alert_block_start","refresh","ctwa_context_enabled","md_messaging_enabled","status_image_quality","md_blocklist_v2_server","media-del1-1.cdn.whatsapp.net","13","userrate","a_v_id","cond_rtt_ema_alpha","invalid"];t.DICTIONARY_1_TOKEN=r;const i=["media.fada1-1.fna.whatsapp.net","media.fadb3-2.fna.whatsapp.net","media.fbhz2-1.fna.whatsapp.net","media.fcor2-1.fna.whatsapp.net","media.fjed4-2.fna.whatsapp.net","media.flhe4-1.fna.whatsapp.net","media.frak1-2.fna.whatsapp.net","media.fsub6-3.fna.whatsapp.net","media.fsub6-7.fna.whatsapp.net","media.fvvi1-1.fna.whatsapp.net","search_v5_eligible","wam_real_time_enabled","report_disk_event","max_tx_rott_based_bitrate","product","media.fjdo10-2.fna.whatsapp.net","video_frame_crc_sample_interval","media_max_autodownload","15","h.264","wam_privatestats_buffer_count","md_phash_v2_enabled","account_transfer_enabled","business_product_catalog","enable_non_dyn_codec_param_fix","is_user_under_epd_jurisdiction","media.fbog2-4.fna.whatsapp.net","media.fbtz1-2.fna.whatsapp.net","media.fcfc1-1.fna.whatsapp.net","media.fjed4-5.fna.whatsapp.net","media.flhe4-2.fna.whatsapp.net","media.flim1-2.fna.whatsapp.net","media.flos5-1.fna.whatsapp.net","android_key_store_auth_ver","010","anr_process_monitor","delete_old_auth_key","media.fcor10-3.fna.whatsapp.net","storage_usage_enabled","android_camera2_support_level","dirty","consumer_content_provider","status_video_max_duration","0c","bloks_cache_enabled","media.fadb2-2.fna.whatsapp.net","media.fbko1-1.fna.whatsapp.net","media.fbtz1-9.fna.whatsapp.net","media.fcgk4-4.fna.whatsapp.net","media.fesb4-2.fna.whatsapp.net","media.fevn1-2.fna.whatsapp.net","media.fist2-4.fna.whatsapp.net","media.fjdo1-1.fna.whatsapp.net","media.fruh4-6.fna.whatsapp.net","media.fsrg5-1.fna.whatsapp.net","media.fsub6-6.fna.whatsapp.net","minfpp","5000","locales","video_max_bitrate","use_new_auth_key","bloks_http_enabled","heartbeat_interval","media.fbog11-1.fna.whatsapp.net","ephemeral_group_query_ts","fec_nack","search_in_storage_usage","c","media-amt2-1.cdn.whatsapp.net","linked_devices_ui_enabled","14","async_data_load_on_startup","voip_incoming_xml_ack","16","db_migration_step","init_bwe","max_participants","wam_buffer_count","media.fada2-2.fna.whatsapp.net","media.fadb3-1.fna.whatsapp.net","media.fcor2-2.fna.whatsapp.net","media.fdiy1-2.fna.whatsapp.net","media.frba3-2.fna.whatsapp.net","media.fsaw2-3.fna.whatsapp.net","1280","status_grid_enabled","w:biz","product_catalog_deeplink","media.fgye10-2.fna.whatsapp.net","media.fuio11-1.fna.whatsapp.net","optimistic_upload","work_manager_init","lc","catalog_message","cond_net_medium","enable_periodical_aud_rr_processing","cond_range_ema_rtt","media-tir2-1.cdn.whatsapp.net","frame_ms","group_invite_sending","payments_web_enabled","wallpapers_v2","0d","browser","hq_image_max_edge","image_edit_zoom","linked_devices_re_auth_enabled","media.faly3-2.fna.whatsapp.net","media.fdoh5-3.fna.whatsapp.net","media.fesb3-1.fna.whatsapp.net","media.fknu1-1.fna.whatsapp.net","media.fmex3-1.fna.whatsapp.net","media.fruh4-3.fna.whatsapp.net","255","web_upgrade_to_md_modal","audio_piggyback_timeout_msec","enable_audio_oob_fec_feature","from_ip","image_max_edge","message_qr_enabled","powersave","receipt_pre_acking","video_max_edge","full","011","012","enable_audio_oob_fec_for_sender","md_voip_enabled","enable_privatestats","max_fec_ratio","payments_cs_faq_url","media-xsp1-3.cdn.whatsapp.net","hq_image_quality","media.fasr1-2.fna.whatsapp.net","media.fbog3-1.fna.whatsapp.net","media.ffjr1-6.fna.whatsapp.net","media.fist2-3.fna.whatsapp.net","media.flim4-3.fna.whatsapp.net","media.fpbc2-4.fna.whatsapp.net","media.fpku1-1.fna.whatsapp.net","media.frba1-1.fna.whatsapp.net","media.fudi1-1.fna.whatsapp.net","media.fvvi1-2.fna.whatsapp.net","gcm_fg_service","enable_dec_ltr_size_check","clear","lg","media.fgru11-1.fna.whatsapp.net","18","media-lga3-2.cdn.whatsapp.net","pkey","0e","max_subject","cond_range_lterm_rtt","announcement_groups","biz_profile_options","s_t","media.fabv2-1.fna.whatsapp.net","media.fcai3-1.fna.whatsapp.net","media.fcgh1-1.fna.whatsapp.net","media.fctg1-4.fna.whatsapp.net","media.fdiy1-1.fna.whatsapp.net","media.fisb4-1.fna.whatsapp.net","media.fpku1-2.fna.whatsapp.net","media.fros9-1.fna.whatsapp.net","status_v3_text","usync_sidelist","17","announcement","...","md_group_notification","0f","animated_pack_in_store","013","America/Mexico_City","1260","media-ams4-1.cdn.whatsapp.net","media-cgk1-2.cdn.whatsapp.net","media-cpt1-1.cdn.whatsapp.net","media-maa2-1.cdn.whatsapp.net","media.fgye10-1.fna.whatsapp.net","e","catalog_cart","hfm_string_changes","init_bitrate","packless_hsm","group_info","America/Belem","50","960","cond_range_bwe","decode","encode","media.fada1-8.fna.whatsapp.net","media.fadb1-2.fna.whatsapp.net","media.fasu6-1.fna.whatsapp.net","media.fbog4-1.fna.whatsapp.net","media.fcgk9-2.fna.whatsapp.net","media.fdoh5-2.fna.whatsapp.net","media.ffjr1-2.fna.whatsapp.net","media.fgua1-1.fna.whatsapp.net","media.fgye1-1.fna.whatsapp.net","media.fist1-4.fna.whatsapp.net","media.fpbc2-2.fna.whatsapp.net","media.fres2-1.fna.whatsapp.net","media.fsdq1-2.fna.whatsapp.net","media.fsub6-5.fna.whatsapp.net","profilo_enabled","template_hsm","use_disorder_prefetching_timer","video_codec_priority","vpx_max_qp","ptt_reduce_recording_delay","25","iphone","Windows","s_o","Africa/Lagos","abt","media-kut2-1.cdn.whatsapp.net","media-mba1-1.cdn.whatsapp.net","media-mxp1-2.cdn.whatsapp.net","md_blocklist_v2","url_text","enable_short_offset","group_join_permissions","enable_audio_piggyback_feature","image_quality","media.fcgk7-2.fna.whatsapp.net","media.fcgk8-2.fna.whatsapp.net","media.fclo7-1.fna.whatsapp.net","media.fcmn1-1.fna.whatsapp.net","media.feoh1-1.fna.whatsapp.net","media.fgyd4-3.fna.whatsapp.net","media.fjed4-4.fna.whatsapp.net","media.flim1-4.fna.whatsapp.net","media.flim2-4.fna.whatsapp.net","media.fplu6-1.fna.whatsapp.net","media.frak1-1.fna.whatsapp.net","media.fsdq1-1.fna.whatsapp.net","to_ip","015","vp8","19","21","1320","auth_key_ver","message_processing_dedup","server-error","wap4_enabled","420","014","cond_range_rtt","ptt_fast_lock_enabled","media-ort2-1.cdn.whatsapp.net","fwd_ui_start_ts"];t.DICTIONARY_2_TOKEN=i;const a=["contact_blacklist","Asia/Jakarta","media.fepa10-1.fna.whatsapp.net","media.fmex10-3.fna.whatsapp.net","disorder_prefetching_start_when_empty","America/Bogota","use_local_probing_rx_bitrate","America/Argentina/Buenos_Aires","cross_post","media.fabb1-1.fna.whatsapp.net","media.fbog4-2.fna.whatsapp.net","media.fcgk9-1.fna.whatsapp.net","media.fcmn2-1.fna.whatsapp.net","media.fdel3-1.fna.whatsapp.net","media.ffjr1-1.fna.whatsapp.net","media.fgdl5-1.fna.whatsapp.net","media.flpb1-2.fna.whatsapp.net","media.fmex2-1.fna.whatsapp.net","media.frba2-2.fna.whatsapp.net","media.fros2-2.fna.whatsapp.net","media.fruh2-1.fna.whatsapp.net","media.fybz2-2.fna.whatsapp.net","options","20","a","017","018","mute_always","user_notice","Asia/Kolkata","gif_provider","locked","media-gua1-1.cdn.whatsapp.net","piggyback_exclude_force_flush","24","media.frec39-1.fna.whatsapp.net","user_remove","file_max_size","cond_packet_loss_pct_ema_alpha","media.facc1-1.fna.whatsapp.net","media.fadb2-1.fna.whatsapp.net","media.faly3-1.fna.whatsapp.net","media.fbdo6-2.fna.whatsapp.net","media.fcmn2-2.fna.whatsapp.net","media.fctg1-3.fna.whatsapp.net","media.ffez1-2.fna.whatsapp.net","media.fist1-3.fna.whatsapp.net","media.fist2-2.fna.whatsapp.net","media.flim2-2.fna.whatsapp.net","media.fmct2-3.fna.whatsapp.net","media.fpei3-1.fna.whatsapp.net","media.frba3-1.fna.whatsapp.net","media.fsdu8-2.fna.whatsapp.net","media.fstu2-1.fna.whatsapp.net","media_type","receipt_agg","016","enable_pli_for_crc_mismatch","live","enc_rekey","frskmsg","d","media.fdel11-2.fna.whatsapp.net","proto","2250","audio_piggyback_enable_cache","skip_nack_if_ltrp_sent","mark_dtx_jb_frames","web_service_delay","7282","catalog_send_all","outgoing","360","30","LIMITED","019","audio_picker","bpv2_phase","media.fada1-7.fna.whatsapp.net","media.faep7-1.fna.whatsapp.net","media.fbko1-2.fna.whatsapp.net","media.fbni1-2.fna.whatsapp.net","media.fbtz1-1.fna.whatsapp.net","media.fbtz1-8.fna.whatsapp.net","media.fcjs3-1.fna.whatsapp.net","media.fesb3-2.fna.whatsapp.net","media.fgdl5-4.fna.whatsapp.net","media.fist2-1.fna.whatsapp.net","media.flhe2-2.fna.whatsapp.net","media.flim2-1.fna.whatsapp.net","media.fmex1-1.fna.whatsapp.net","media.fpat3-2.fna.whatsapp.net","media.fpat3-3.fna.whatsapp.net","media.fros2-1.fna.whatsapp.net","media.fsdu8-1.fna.whatsapp.net","media.fsub3-2.fna.whatsapp.net","payments_chat_plugin","cond_congestion_no_rtcp_thr","green_alert","not-a-biz","..","shops_pdp_urls_config","source","media-dus1-1.cdn.whatsapp.net","mute_video","01b","currency","max_keys","resume_check","contact_array","qr_scanning","23","b","media.fbfh15-1.fna.whatsapp.net","media.flim22-1.fna.whatsapp.net","media.fsdu11-1.fna.whatsapp.net","media.fsdu15-1.fna.whatsapp.net","Chrome","fts_version","60","media.fada1-6.fna.whatsapp.net","media.faep4-2.fna.whatsapp.net","media.fbaq5-1.fna.whatsapp.net","media.fbni1-1.fna.whatsapp.net","media.fcai3-2.fna.whatsapp.net","media.fdel3-2.fna.whatsapp.net","media.fdmm3-2.fna.whatsapp.net","media.fhex3-1.fna.whatsapp.net","media.fisb4-2.fna.whatsapp.net","media.fkhi5-2.fna.whatsapp.net","media.flos2-1.fna.whatsapp.net","media.fmct2-1.fna.whatsapp.net","media.fntr7-1.fna.whatsapp.net","media.frak3-1.fna.whatsapp.net","media.fruh5-2.fna.whatsapp.net","media.fsub6-1.fna.whatsapp.net","media.fuab1-2.fna.whatsapp.net","media.fuio1-1.fna.whatsapp.net","media.fver1-1.fna.whatsapp.net","media.fymy1-1.fna.whatsapp.net","product_catalog","1380","audio_oob_fec_max_pkts","22","254","media-ort2-2.cdn.whatsapp.net","media-sjc3-1.cdn.whatsapp.net","1600","01a","01c","405","key_frame_interval","body","media.fcgh20-1.fna.whatsapp.net","media.fesb10-2.fna.whatsapp.net","125","2000","media.fbsb1-1.fna.whatsapp.net","media.fcmn3-2.fna.whatsapp.net","media.fcpq1-1.fna.whatsapp.net","media.fdel1-2.fna.whatsapp.net","media.ffor2-1.fna.whatsapp.net","media.fgdl1-4.fna.whatsapp.net","media.fhex2-1.fna.whatsapp.net","media.fist1-2.fna.whatsapp.net","media.fjed5-2.fna.whatsapp.net","media.flim6-4.fna.whatsapp.net","media.flos2-2.fna.whatsapp.net","media.fntr6-2.fna.whatsapp.net","media.fpku3-2.fna.whatsapp.net","media.fros8-1.fna.whatsapp.net","media.fymy1-2.fna.whatsapp.net","ul_bw","ltrp_qp_offset","request","nack","dtx_delay_state_reset","timeoffline","28","01f","32","enable_ltr_pool","wa_msys_crypto","01d","58","dtx_freeze_hg_update","nack_if_rpsi_throttled","253","840","media.famd15-1.fna.whatsapp.net","media.fbog17-2.fna.whatsapp.net","media.fcai19-2.fna.whatsapp.net","media.fcai21-4.fna.whatsapp.net","media.fesb10-4.fna.whatsapp.net","media.fesb10-5.fna.whatsapp.net","media.fmaa12-1.fna.whatsapp.net","media.fmex11-3.fna.whatsapp.net","media.fpoa33-1.fna.whatsapp.net","1050","021","clean","cond_range_ema_packet_loss_pct","media.fadb6-5.fna.whatsapp.net","media.faqp4-1.fna.whatsapp.net","media.fbaq3-1.fna.whatsapp.net","media.fbel2-1.fna.whatsapp.net","media.fblr4-2.fna.whatsapp.net","media.fclo8-1.fna.whatsapp.net","media.fcoo1-2.fna.whatsapp.net","media.ffjr1-4.fna.whatsapp.net","media.ffor9-1.fna.whatsapp.net","media.fisb3-1.fna.whatsapp.net","media.fkhi2-2.fna.whatsapp.net","media.fkhi4-1.fna.whatsapp.net","media.fpbc1-2.fna.whatsapp.net","media.fruh2-2.fna.whatsapp.net","media.fruh5-1.fna.whatsapp.net","media.fsub3-1.fna.whatsapp.net","payments_transaction_limit","252","27","29","tintagel","01e","237","780","callee_updated_payload","020","257","price","025","239","payments_cs_phone_number","mediaretry","w:auth:backup:token","Glass.caf","max_bitrate","240","251","660","media.fbog16-1.fna.whatsapp.net","media.fcgh21-1.fna.whatsapp.net","media.fkul19-2.fna.whatsapp.net","media.flim21-2.fna.whatsapp.net","media.fmex10-4.fna.whatsapp.net","64","33","34","35","interruption","media.fabv3-1.fna.whatsapp.net","media.fadb6-1.fna.whatsapp.net","media.fagr1-1.fna.whatsapp.net","media.famd1-1.fna.whatsapp.net","media.famm6-1.fna.whatsapp.net","media.faqp2-3.fna.whatsapp.net"];t.DICTIONARY_3_TOKEN=a;const o=[n,r,i,a];t.DICTIONARIES=o},638134:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WapJid=t.WAP_JID_SUBTYPE=t.DOMAIN_TYPE=void 0;var r=n(616310);const i={JID:0,JID_U:1,JID_AD:1,JID_FB:3};t.WAP_JID_SUBTYPE=i;const a=n(654302)({WHATSAPP:0,LID:1});t.DOMAIN_TYPE=a;class o{constructor(e){this._jid=e}static createAD(e,t,n){return new o({type:i.JID_AD,user:e,device:null==n?0:n,agent:null==t?0:t,domainType:a.WHATSAPP})}static createJidU(e,t,n){return new o({type:i.JID_U,user:e,device:null==n?0:n,domainType:null==t?a.WHATSAPP:t})}static createFbJid(e,t){return new o({type:i.JID_FB,user:e,device:null==t?0:t})}static create(e,t){return new o({type:i.JID,user:e,server:t})}toString(){if(this._jid.type===i.JID_AD||this._jid.type===i.JID_U){const{user:e,device:t,domainType:n}=this._jid,i=n===a.WHATSAPP?r.WA_USER_JID_SUFFIX:r.LID_SUFFIX;return 0===t?`${e}@${i}`:`${e}:${t}@${i}`}if(this._jid.type===i.JID_FB){const{user:e,device:t}=this._jid;return`${e}:${t}@${r.MSGR_USER_JID_SUFFIX}`}{this._jid.type;const{user:e,server:t}=this._jid;return null!=e?`${e}@${t}`:t}}getInnerJid(){return this._jid}}t.WapJid=o},769707:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WapParser=void 0;var r=n(968826);t.WapParser=class{constructor(e,t){this._name=e,this._parser=t}parse(e){const t=new r.ParsableWapNode(this._name,e);try{return{success:this._parser(t)}}catch(e){if(e instanceof r.XmppParsingFailure)return{error:e};throw e}}parseOrThrow(e){const t=this.parse(e);if(t.error)throw new Error(String(t.error));return t.success}}},889441:(e,t)=>{"use strict";function n(e){return 16*parseInt((e+15)/16,10)}Object.defineProperty(t,"__esModule",{value:!0}),t.alignChunkLengthsToMultipleOfAesBlockSize=function(e,t){const r=[];let i=0,a=0,o=0;for(let s=0;s<e.length;++s){if(i+=e[s],s===e.length-1&&null!=t){i>a?r.push(t-a):(r.pop(),r.push(t-o));break}if(i>a){const e=n(i-a);o=a,r.push(e),a+=e}}return r},t.alignChunkSizeToMultipleAesBlockSize=n},502010:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateFilehash=function(e){return(0,r.sha256Base64)(e)},t.getRandomFilehash=function(){const{buffer:e}=self.crypto.getRandomValues(new Uint8Array(20));return(0,r.sha256Base64)(e)};var r=n(638778)},866028:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MMS_MEDIA_KEY_TTL=void 0,t.isMediaKeyReusable=function(e){const t=Math.floor(Math.random()*i);return null!=e&&(0,r.happenedWithin)(e,a+t)};var r=n(990445);const i=r.DAY_SECONDS,a=2*r.DAY_SECONDS;t.MMS_MEDIA_KEY_TTL=a},66722:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mediaConnParser=void 0;var r=n(357840);const i=new(n(769707).WapParser)("mediaConnParser",(e=>{var t,n;const r=e.child("media_conn");return{hosts:r.mapChildrenWithTag("host",o),authToken:r.attrString("auth"),authTTL:r.hasAttr("auth_ttl")?r.attrFutureTime("auth_ttl"):null,authExpires:r.attrFutureTime("ttl"),maxBuckets:r.hasAttr("max_buckets")?r.attrInt("max_buckets"):null,maxManualRetry:null!==(t=r.maybeAttrInt("max_manual_retry",0,4))&&void 0!==t?t:3,maxAutoDownloadRetry:null!==(n=r.maybeAttrInt("max_auto_download_retry",0,4))&&void 0!==n?n:3}}));function a(e){var t,n;if(e.hasAttr("fallback_hostname"))return{domain:e.attrString("fallback_hostname"),class:e.maybeAttrString("fallback_class"),ip4:null!==(t=e.maybeAttrString("fallback_ip4"))&&void 0!==t?t:void 0,ip6:null!==(n=e.maybeAttrString("fallback_ip6"))&&void 0!==n?n:void 0}}function o(e){var t,n,r,i;return{domain:e.attrString("hostname"),fallback:a(e),uploadable:s(e,"upload"),downloadable:s(e,"download"),isFallback:"fallback"===e.maybeAttrString("type"),downloadBuckets:null!==(t=null===(n=e.maybeChild("download_buckets"))||void 0===n?void 0:n.mapChildren((e=>parseInt(e.tag(),10))))&&void 0!==t?t:[],class:e.maybeAttrString("class"),ip4:null!==(r=e.maybeAttrString("ip4"))&&void 0!==r?r:void 0,ip6:null!==(i=e.maybeAttrString("ip6"))&&void 0!==i?i:void 0}}function s(e,t){return e.hasChild(t)?e.child(t).mapChildren((e=>{const t=e.tag();return(0,r.castToServerMediaType)(t)})).filter(Boolean):r.SERVER_MEDIA}t.mediaConnParser=i},357840:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SERVER_MEDIA=void 0,t.castToServerMediaType=function(e){switch(e){case"image":case"sticker":case"ptt":case"audio":case"document":case"video":case"gif":case"ppic":case"md-app-state":case"md-msg-hist":case"kyc-id":case"thumbnail-image":case"thumbnail-video":case"thumbnail-gif":case"thumbnail-document":case"thumbnail-link":case"payment-bg-image":case"novi-video":case"novi-image":case"template":case"product":case"product-catalog-image":case"xma-image":case"biz-cover-photo":case"preview":return e;default:return null}};t.SERVER_MEDIA=["image","sticker","ptt","audio","document","video","gif","ppic","md-app-state","md-msg-hist","kyc-id","template","thumbnail-image","thumbnail-video","thumbnail-gif","thumbnail-document","thumbnail-link","payment-bg-image","novi-video","novi-image","product","product-catalog-image","xma-image","biz-cover-photo","preview"]},603211:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SocketClosed=t.FrameSocket=void 0;var r=n(551168),i=n(618445);class a extends Error{constructor(e){const t="SocketClosed";super(null!=e?e:t),this.name=t}}t.SocketClosed=a;function o(e){if(e.size()<3)return!1;return s(e)<=e.size()}function s(e){return e.readUint8()<<16|e.readUint16()}t.FrameSocket=class{constructor(e,t){this._incoming=new r.Binary,this.closed=!1,this._draining=!1,this.onFrame=null,this.onClose=null,this._handleData=e=>{this._incoming.writeByteArray(e),this.convertBufferedToFrames()},this._handleClose=()=>{if(this._incoming.peek(o))return __LOG__(2)`FrameSocket closed, waiting for pending processing`,void(this._draining=!0);this._doClose()},this._doClose=()=>{if(this.closed)return;__LOG__(2)`FrameSocket closed`,this._draining=!1,this.closed=!0;const e=this.onClose;e&&e()},this._handleError=()=>{},this._introToSend=t,this._socket=e,e.onData=this._handleData,e.onClose=this._handleClose,e.onError=this._handleError}sendFrame(e){if(this._draining)return;this.throwIfClosed();const t=this._introToSend,n=e.byteLength,r=this._socket.dataToSend;t?(this._introToSend=null,r.ensureAdditionalCapacity(t.length+3+n),r.writeByteArray(t)):r.ensureAdditionalCapacity(3+n),r.writeUint8(n>>16),r.writeUint16(65535&n),r.write(e),this._assertMaxPayloadSize(),this._socket.requestSend()}_assertMaxPayloadSize(){const e=this._socket.dataToSend.size();if(e>=1<<24)throw this._socket.dataToSend.readBuffer(),__LOG__(3)`Buffer to send: ${e}`,new i.BufferTooLargeError(`Buffer too large: ${e}`)}convertBufferedToFrames(){const e=this._incoming;let t=this.onFrame;for(;t&&e.peek(o);){const n=s(e);t(e.readByteArray(n)),t=this.onFrame}this._draining&&!e.peek(o)&&this._doClose(),t&&e.size()&&__LOG__(2)`FrameSocket: queueing partial frame of ${e.size()} bytes`}throwIfClosed(){if(this.closed)throw new a}close(){this._socket.close()}}},642499:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoiseHandshake=void 0;var r=n(551168),i=n(684659),a=n(638778),o=n(618445),s=n(764774),l=n(827653);const u=Promise.reject("UNINITIALIZED HANDSHAKE"),c=new Uint8Array(0);u.catch((()=>{}));function d(e){const t=new ArrayBuffer(12);return new DataView(t).setUint32(8,e),new Uint8Array(t)}function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["encrypt","decrypt"];return self.crypto.subtle.importKey("raw",new Uint8Array(e),"AES-GCM",!1,t)}function _(e,t){return(0,i.extractWithSaltAndExpand)(t,new Uint8Array(e),"",64).then((e=>[e.slice(0,32),e.slice(32)]))}function f(e){e.catch((()=>{}))}t.NoiseHandshake=class{constructor(e){this._hash=u,this._salt=u,this._cryptoKey=u,this._counter=0,this._socket=e,this._rejectOnClose=new l.Resolvable,e.onClose=()=>{this._rejectOnClose.reject(new o.Disconnected("NoiseHandshake: SocketClosed"))},f(this._rejectOnClose.promise)}start(e,t){const n=r.Binary.build(e).readBuffer(),i=32===n.byteLength?Promise.resolve(n):(0,a.sha256)(n);this._hash=i,this._salt=i,this._cryptoKey=i.then(p),this.authenticate(t)}sendAndReceive(e){const t=this._socket,n=new Promise((n=>{t.onFrame=e=>{t.onFrame=null,n(e)},t.sendFrame(e)}));return this._orRejectOnClose(n)}send(e){this._socket.sendFrame(e)}authenticate(e){this._hash=Promise.all([this._hash,e]).then((e=>{let[t,n]=e;const i=r.Binary.build(t,n).readByteArray();return(0,a.sha256)(i)}))}encrypt(e){const t=this._counter++,n=Promise.all([this._cryptoKey,this._hash,e]).then((e=>{let[n,r,i]=e;return function(e,t,n,r){return self.crypto.subtle.encrypt({name:"AES-GCM",iv:d(t),additionalData:n?new Uint8Array(n):c},e,r)}(n,t,r,i)}));return this.authenticate(n),this._orRejectOnClose(n)}decrypt(e){const t=this._counter++,n=Promise.all([this._cryptoKey,this._hash]).then((n=>{let[r,i]=n;return function(e,t,n,r){return self.crypto.subtle.decrypt({name:"AES-GCM",iv:d(t),additionalData:n?new Uint8Array(n):c},e,r)}(r,t,i,e)}));return this.authenticate(e),this._orRejectOnClose(n)}finish(){const e=this._salt.then((e=>_(e,new Uint8Array(0)))).then((e=>{let[t,n]=e;return Promise.all([p(t,["encrypt"]),p(n,["decrypt"])])})).then((e=>{let[t,n]=e;return new s.NoiseSocket(this._socket,t,n)}));return this._orRejectOnClose(e)}mixIntoKey(e){this._counter=0;const t=Promise.all([this._salt,e]).then((e=>{let[t,n]=e;return _(t,new Uint8Array(n))}));this._salt=t.then((e=>e[0])),this._cryptoKey=t.then((e=>p(e[1]))),f(this._salt),f(this._cryptoKey)}_orRejectOnClose(e){return Promise.race([e,this._rejectOnClose.promise]).then((e=>this._rejectOnClose.resolveWasCalled()?this._rejectOnClose.promise:e))}}},764774:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.NoiseSocket=void 0;var i=r(n(311504)),a=n(316860);const o=Promise.reject("UNINITIALIZED HANDSHAKE"),s=new Uint8Array(0);o.catch((()=>{}));function l(e){const t=new ArrayBuffer(12);return new DataView(t).setUint32(8,e),new Uint8Array(t)}t.NoiseSocket=class{constructor(e,t,n){this._incoming=[],this._readQueue=new a.PromiseQueue,this._sendQueue=new a.PromiseQueue,this._readCounter=0,this._writeCounter=0,this._draining=!1,this._sendCiphertextFrame=e=>{this._socket.closed?__LOG__(2)`NoiseSocket socket closed while encrypting frame`:this._socket.sendFrame(e)},this._handleCiphertext=e=>{const t=this._readCounter++;this._readQueue.enqueueHandlers(function(e,t,n,r){return self.crypto.subtle.decrypt({name:"AES-GCM",iv:l(t),additionalData:n?new Uint8Array(n):s},e,r)}(this._readKey,t,void 0,e),this._handlePlaintext)},this._handleOnClose=()=>{this._draining=!0,this._readQueue.wait().then((()=>{this._draining=!1;const e=this._onClose;e&&e()}))},this._handlePlaintext=e=>{this._onFrame?this._onFrame(e):this._incoming.push(e)},this._socket=e,this._writeKey=t,this._readKey=n,e.onFrame=this._handleCiphertext,this._socket.onClose=this._handleOnClose,e.convertBufferedToFrames()}sendFrameAsync(e){var t=this;return(0,i.default)((function*(){return yield t.sendFrame(e)}))()}sendFrame(e){if(this._draining)return Promise.resolve();this._socket.throwIfClosed();const t=this._writeCounter++;return this._sendQueue.enqueueHandlers((n=this._writeKey,r=t,i=void 0,a=e,self.crypto.subtle.encrypt({name:"AES-GCM",iv:l(r),additionalData:i?new Uint8Array(i):s},n,a)),this._sendCiphertextFrame);var n,r,i,a}setOnFrame(e){this._onFrame=e}setOnClose(e){this._onClose=e}close(){this._socket.close()}}},693586:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.backendErrorParser=void 0,t.handleError=function(e){return a.parse(e),Promise.resolve("NO_ACK")};var r=n(769707);const i=479,a=new r.WapParser("errorParser",(e=>{e.assertTag("error");const t=e.attrInt("code");switch(t){case i:return __LOG__(4,void 0,new Error,!0)`Invalid stanza sent (smax-invalid)`,void SEND_LOGS("smax-invalid");default:return function(e){__LOG__(4,void 0,new Error,!0)`Unknown error code: ${e}`,SEND_LOGS("unknown-error-code")}(t)}}));t.backendErrorParser=a},839810:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toStanzaId=function(e){return e}},313815:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.MessageKeySpec=void 0;var i=r(n(73982)),a=n(739660);const o=(0,i.default)({},null);t.MessageKeySpec=o,o.internalSpec={remoteJid:[1,a.TYPES.STRING],fromMe:[2,a.TYPES.BOOL],id:[3,a.TYPES.STRING],participant:[4,a.TYPES.STRING]}},715739:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.SyncdVersionSpec=t.SyncdValueSpec=t.SyncdSnapshotSpec=t.SyncdRecordSpec=t.SyncdPatchSpec=t.SyncdMutationsSpec=t.SyncdMutationSpec=t.SyncdMutation$SyncdOperation=t.SyncdIndexSpec=t.KeyIdSpec=t.ExternalBlobReferenceSpec=t.ExitCodeSpec=void 0;var i=r(n(73982)),a=n(739660);const o=n(654302)({SET:0,REMOVE:1});t.SyncdMutation$SyncdOperation=o;const s=(0,i.default)({},null);t.SyncdVersionSpec=s;const l=(0,i.default)({},null);t.ExitCodeSpec=l;const u=(0,i.default)({},null);t.SyncdIndexSpec=u;const c=(0,i.default)({},null);t.SyncdValueSpec=c;const d=(0,i.default)({},null);t.KeyIdSpec=d;const p=(0,i.default)({},null);t.SyncdRecordSpec=p;const _=(0,i.default)({},null);t.ExternalBlobReferenceSpec=_;const f=(0,i.default)({},null);t.SyncdSnapshotSpec=f;const h=(0,i.default)({},null);t.SyncdMutationsSpec=h;const g=(0,i.default)({},null);t.SyncdMutationSpec=g;const m=(0,i.default)({},null);t.SyncdPatchSpec=m,s.internalSpec={version:[1,a.TYPES.UINT64]},l.internalSpec={code:[1,a.TYPES.UINT64],text:[2,a.TYPES.STRING]},u.internalSpec={blob:[1,a.TYPES.BYTES]},c.internalSpec={blob:[1,a.TYPES.BYTES]},d.internalSpec={id:[1,a.TYPES.BYTES]},p.internalSpec={index:[1,a.TYPES.MESSAGE,u],value:[2,a.TYPES.MESSAGE,c],keyId:[3,a.TYPES.MESSAGE,d]},_.internalSpec={mediaKey:[1,a.TYPES.BYTES],directPath:[2,a.TYPES.STRING],handle:[3,a.TYPES.STRING],fileSizeBytes:[4,a.TYPES.UINT64],fileSha256:[5,a.TYPES.BYTES],fileEncSha256:[6,a.TYPES.BYTES]},f.internalSpec={version:[1,a.TYPES.MESSAGE,s],records:[2,a.FLAGS.REPEATED|a.TYPES.MESSAGE,p],mac:[3,a.TYPES.BYTES],keyId:[4,a.TYPES.MESSAGE,d]},h.internalSpec={mutations:[1,a.FLAGS.REPEATED|a.TYPES.MESSAGE,g]},g.internalSpec={operation:[1,a.TYPES.ENUM,o],record:[2,a.TYPES.MESSAGE,p]},m.internalSpec={version:[1,a.TYPES.MESSAGE,s],mutations:[2,a.FLAGS.REPEATED|a.TYPES.MESSAGE,g],externalMutations:[3,a.TYPES.MESSAGE,_],snapshotMac:[4,a.TYPES.BYTES],patchMac:[5,a.TYPES.BYTES],keyId:[6,a.TYPES.MESSAGE,d],exitCode:[7,a.TYPES.MESSAGE,l],deviceIndex:[8,a.TYPES.UINT32]}},370625:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.SyncActionValueSpec=t.SyncActionValue$UserStatusMuteActionSpec=t.SyncActionValue$UnarchiveChatsSettingSpec=t.SyncActionValue$TimeFormatActionSpec=t.SyncActionValue$SyncActionMessageSpec=t.SyncActionValue$SyncActionMessageRangeSpec=t.SyncActionValue$SubscriptionActionSpec=t.SyncActionValue$StickerActionSpec=t.SyncActionValue$StarActionSpec=t.SyncActionValue$SecurityNotificationSettingSpec=t.SyncActionValue$RemoveRecentStickerActionSpec=t.SyncActionValue$RecentEmojiWeightsActionSpec=t.SyncActionValue$QuickReplyActionSpec=t.SyncActionValue$PushNameSettingSpec=t.SyncActionValue$PrimaryVersionActionSpec=t.SyncActionValue$PrimaryFeatureSpec=t.SyncActionValue$PinActionSpec=t.SyncActionValue$NuxActionSpec=t.SyncActionValue$MuteActionSpec=t.SyncActionValue$MarkChatAsReadActionSpec=t.SyncActionValue$LocaleSettingSpec=t.SyncActionValue$LabelEditActionSpec=t.SyncActionValue$LabelAssociationActionSpec=t.SyncActionValue$KeyExpirationSpec=t.SyncActionValue$DeleteMessageForMeActionSpec=t.SyncActionValue$DeleteChatActionSpec=t.SyncActionValue$ContactActionSpec=t.SyncActionValue$ClearChatActionSpec=t.SyncActionValue$ChatAssignmentOpenedStatusActionSpec=t.SyncActionValue$ChatAssignmentActionSpec=t.SyncActionValue$ArchiveChatActionSpec=t.SyncActionValue$AndroidUnsupportedActionsSpec=t.SyncActionValue$AgentActionSpec=t.SyncActionDataSpec=t.RecentEmojiWeightSpec=void 0;var i=r(n(73982)),a=n(739660),o=n(313815);const s=(0,i.default)({},null);t.RecentEmojiWeightSpec=s;const l=(0,i.default)({},null);t.SyncActionValueSpec=l;const u=(0,i.default)({},null);t.SyncActionValue$ChatAssignmentOpenedStatusActionSpec=u;const c=(0,i.default)({},null);t.SyncActionValue$ChatAssignmentActionSpec=c;const d=(0,i.default)({},null);t.SyncActionValue$StickerActionSpec=d;const p=(0,i.default)({},null);t.SyncActionValue$RemoveRecentStickerActionSpec=p;const _=(0,i.default)({},null);t.SyncActionValue$PrimaryVersionActionSpec=_;const f=(0,i.default)({},null);t.SyncActionValue$NuxActionSpec=f;const h=(0,i.default)({},null);t.SyncActionValue$TimeFormatActionSpec=h;const g=(0,i.default)({},null);t.SyncActionValue$UserStatusMuteActionSpec=g;const m=(0,i.default)({},null);t.SyncActionValue$SubscriptionActionSpec=m;const y=(0,i.default)({},null);t.SyncActionValue$AgentActionSpec=y;const E=(0,i.default)({},null);t.SyncActionValue$AndroidUnsupportedActionsSpec=E;const S=(0,i.default)({},null);t.SyncActionValue$PrimaryFeatureSpec=S;const T=(0,i.default)({},null);t.SyncActionValue$KeyExpirationSpec=T;const v=(0,i.default)({},null);t.SyncActionValue$SyncActionMessageSpec=v;const A=(0,i.default)({},null);t.SyncActionValue$SyncActionMessageRangeSpec=A;const C=(0,i.default)({},null);t.SyncActionValue$UnarchiveChatsSettingSpec=C;const P=(0,i.default)({},null);t.SyncActionValue$DeleteChatActionSpec=P;const O=(0,i.default)({},null);t.SyncActionValue$ClearChatActionSpec=O;const I=(0,i.default)({},null);t.SyncActionValue$MarkChatAsReadActionSpec=I;const M=(0,i.default)({},null);t.SyncActionValue$DeleteMessageForMeActionSpec=M;const b=(0,i.default)({},null);t.SyncActionValue$ArchiveChatActionSpec=b;const R=(0,i.default)({},null);t.SyncActionValue$RecentEmojiWeightsActionSpec=R;const N=(0,i.default)({},null);t.SyncActionValue$LabelEditActionSpec=N;const w=(0,i.default)({},null);t.SyncActionValue$LabelAssociationActionSpec=w;const L=(0,i.default)({},null);t.SyncActionValue$QuickReplyActionSpec=L;const D=(0,i.default)({},null);t.SyncActionValue$LocaleSettingSpec=D;const k=(0,i.default)({},null);t.SyncActionValue$PushNameSettingSpec=k;const U=(0,i.default)({},null);t.SyncActionValue$SecurityNotificationSettingSpec=U;const G=(0,i.default)({},null);t.SyncActionValue$PinActionSpec=G;const x=(0,i.default)({},null);t.SyncActionValue$MuteActionSpec=x;const B=(0,i.default)({},null);t.SyncActionValue$ContactActionSpec=B;const F=(0,i.default)({},null);t.SyncActionValue$StarActionSpec=F;const j=(0,i.default)({},null);t.SyncActionDataSpec=j,s.internalSpec={emoji:[1,a.TYPES.STRING],weight:[2,a.TYPES.FLOAT]},l.internalSpec={timestamp:[1,a.TYPES.INT64],starAction:[2,a.TYPES.MESSAGE,F],contactAction:[3,a.TYPES.MESSAGE,B],muteAction:[4,a.TYPES.MESSAGE,x],pinAction:[5,a.TYPES.MESSAGE,G],securityNotificationSetting:[6,a.TYPES.MESSAGE,U],pushNameSetting:[7,a.TYPES.MESSAGE,k],quickReplyAction:[8,a.TYPES.MESSAGE,L],recentEmojiWeightsAction:[11,a.TYPES.MESSAGE,R],labelEditAction:[14,a.TYPES.MESSAGE,N],labelAssociationAction:[15,a.TYPES.MESSAGE,w],localeSetting:[16,a.TYPES.MESSAGE,D],archiveChatAction:[17,a.TYPES.MESSAGE,b],deleteMessageForMeAction:[18,a.TYPES.MESSAGE,M],keyExpiration:[19,a.TYPES.MESSAGE,T],markChatAsReadAction:[20,a.TYPES.MESSAGE,I],clearChatAction:[21,a.TYPES.MESSAGE,O],deleteChatAction:[22,a.TYPES.MESSAGE,P],unarchiveChatsSetting:[23,a.TYPES.MESSAGE,C],primaryFeature:[24,a.TYPES.MESSAGE,S],androidUnsupportedActions:[26,a.TYPES.MESSAGE,E],agentAction:[27,a.TYPES.MESSAGE,y],subscriptionAction:[28,a.TYPES.MESSAGE,m],userStatusMuteAction:[29,a.TYPES.MESSAGE,g],timeFormatAction:[30,a.TYPES.MESSAGE,h],nuxAction:[31,a.TYPES.MESSAGE,f],primaryVersionAction:[32,a.TYPES.MESSAGE,_],stickerAction:[33,a.TYPES.MESSAGE,d],removeRecentStickerAction:[34,a.TYPES.MESSAGE,p],chatAssignment:[35,a.TYPES.MESSAGE,c],chatAssignmentOpenedStatus:[36,a.TYPES.MESSAGE,u]},u.internalSpec={chatOpened:[1,a.TYPES.BOOL]},c.internalSpec={deviceAgentID:[1,a.TYPES.STRING]},d.internalSpec={url:[1,a.TYPES.STRING],fileEncSha256:[2,a.TYPES.BYTES],mediaKey:[3,a.TYPES.BYTES],mimetype:[4,a.TYPES.STRING],height:[5,a.TYPES.UINT32],width:[6,a.TYPES.UINT32],directPath:[7,a.TYPES.STRING],fileLength:[8,a.TYPES.UINT64],isFavorite:[9,a.TYPES.BOOL],deviceIdHint:[10,a.TYPES.UINT32]},p.internalSpec={lastStickerSentTs:[1,a.TYPES.INT64]},_.internalSpec={version:[1,a.TYPES.STRING]},f.internalSpec={acknowledged:[1,a.TYPES.BOOL]},h.internalSpec={isTwentyFourHourFormatEnabled:[1,a.TYPES.BOOL]},g.internalSpec={muted:[1,a.TYPES.BOOL]},m.internalSpec={isDeactivated:[1,a.TYPES.BOOL],isAutoRenewing:[2,a.TYPES.BOOL],expirationDate:[3,a.TYPES.INT64]},y.internalSpec={name:[1,a.TYPES.STRING],deviceID:[2,a.TYPES.INT32],isDeleted:[3,a.TYPES.BOOL]},E.internalSpec={allowed:[1,a.TYPES.BOOL]},S.internalSpec={flags:[1,a.FLAGS.REPEATED|a.TYPES.STRING]},T.internalSpec={expiredKeyEpoch:[1,a.TYPES.INT32]},v.internalSpec={key:[1,a.TYPES.MESSAGE,o.MessageKeySpec],timestamp:[2,a.TYPES.INT64]},A.internalSpec={lastMessageTimestamp:[1,a.TYPES.INT64],lastSystemMessageTimestamp:[2,a.TYPES.INT64],messages:[3,a.FLAGS.REPEATED|a.TYPES.MESSAGE,v]},C.internalSpec={unarchiveChats:[1,a.TYPES.BOOL]},P.internalSpec={messageRange:[1,a.TYPES.MESSAGE,A]},O.internalSpec={messageRange:[1,a.TYPES.MESSAGE,A]},I.internalSpec={read:[1,a.TYPES.BOOL],messageRange:[2,a.TYPES.MESSAGE,A]},M.internalSpec={deleteMedia:[1,a.TYPES.BOOL],messageTimestamp:[2,a.TYPES.INT64]},b.internalSpec={archived:[1,a.TYPES.BOOL],messageRange:[2,a.TYPES.MESSAGE,A]},R.internalSpec={weights:[1,a.FLAGS.REPEATED|a.TYPES.MESSAGE,s]},N.internalSpec={name:[1,a.TYPES.STRING],color:[2,a.TYPES.INT32],predefinedId:[3,a.TYPES.INT32],deleted:[4,a.TYPES.BOOL]},w.internalSpec={labeled:[1,a.TYPES.BOOL]},L.internalSpec={shortcut:[1,a.TYPES.STRING],message:[2,a.TYPES.STRING],keywords:[3,a.FLAGS.REPEATED|a.TYPES.STRING],count:[4,a.TYPES.INT32],deleted:[5,a.TYPES.BOOL]},D.internalSpec={locale:[1,a.TYPES.STRING]},k.internalSpec={name:[1,a.TYPES.STRING]},U.internalSpec={showNotification:[1,a.TYPES.BOOL]},G.internalSpec={pinned:[1,a.TYPES.BOOL]},x.internalSpec={muted:[1,a.TYPES.BOOL],muteEndTimestamp:[2,a.TYPES.INT64],autoMuted:[3,a.TYPES.BOOL]},B.internalSpec={fullName:[1,a.TYPES.STRING],firstName:[2,a.TYPES.STRING],lidJid:[3,a.TYPES.STRING]},F.internalSpec={starred:[1,a.TYPES.BOOL]},j.internalSpec={index:[1,a.TYPES.BYTES],value:[2,a.TYPES.MESSAGE,l],padding:[3,a.TYPES.BYTES],version:[4,a.TYPES.INT32]}},476178:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.getAbPropsProtocol=function(){return s.apply(this,arguments)};var i=r(n(311504)),a=n(452813),o=n(236082);function s(){return(s=(0,i.default)((function*(e){const t=yield(0,o.sendGetExperimentConfigRPC)({propsHash:e});if("GetExperimentConfigResponseSuccess"===t.name){const{propsAbKey:e,propsHash:n,propsRefresh:r,propsRefreshId:i,propsProp:o}=t.value;return(0,a.makeResult)({abKey:e,hash:n,refresh:r,refreshId:i,props:l(o)})}return __LOG__(3)`getAbPropsProtocol failed ${t.value}`,(0,a.makeError)()}))).apply(this,arguments)}function l(e){const t=[];return e.forEach((e=>{let{experimentOrSamplingConfigMixinGroup:n}=e;var r;"ExperimentConfig"===n.name&&t.push({configCode:n.value.configCode,configValue:n.value.configValue,configExpoKey:null===(r=n.value.configExpoKey)||void 0===r?void 0:r.toString()})})),t}},121494:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.sendPassiveModeIq=function(){return s.apply(this,arguments)};var i=r(n(311504)),a=n(912810),o=n(381469);function s(){return(s=(0,i.default)((function*(e){"active"===e?yield(0,a.sendActiveIQRPC)():yield(0,o.sendPassiveIQRPC)(),__LOG__(2)`sendPassiveModeIq: passive mode set to '${e}'`}))).apply(this,arguments)}},795917:(e,t,n)=>{"use strict";var r=n(307914);t.Z=function(){return u.apply(this,arguments)};var i=r(n(311504)),a=n(171537),o=r(n(345410)),s=n(279385),l=n(155172);function u(){return(u=(0,i.default)((function*(){const e=yield o.default.getSentinelMutations();return yield(0,a.bulkCreateSyncPendingMutationsInTransaction)(e),(0,s.markCollectionsForSync)(Array.from(l.CollectionName.members()))}))).apply(this,arguments)}},279385:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.clearSyncdData=function(){return(0,a.runInTransaction)(["SyncActionStore","CollectionVersionStore","PendingMutationStore","MissingKeyStore","SyncKeyStore"],(e=>{let{SyncActionStore:t,CollectionVersionStore:n,PendingMutationStore:r,MissingKeyStore:i,SyncKeyStore:a}=e;return Promise.all([t.clear(),n.clear(),r.clear(),i.clear(),a.clear()]).then((()=>{c.default.clean(),(0,_.clearSyncKeysCache)()}))}))},t.initializeStateMachine=function(){return c.default.loadStatesFromDb().then((()=>U()))},t.logKeysInfoInIntern=function(){return w.apply(this,arguments)},t.markCollectionsForSync=I,t.processOnAppResume=function(){return F.apply(this,arguments)},t.reportWam=function(){return N.apply(this,arguments)},t.syncBlockedCollections=function(){const e=c.default.getCollectionsInStateBlocked();return __LOG__(2)`syncd: sync blocked collections: ${e}`,c.default.moveCollectionsToDirty(e),A=new Set([...Array.from(A),...Array.from(v)]),__LOG__(2)`syncd: syncBlockedCollections:
\tmoving blocked collections to dirty: [${e}]
\tadding inflight collections to pending: [${Array.from(v)}]`,L()};var i=r(n(311504)),a=n(819416),o=n(759998),s=n(773244),l=n(171537),u=n(787252),c=(n(865254),r(n(157926))),d=n(155172),p=(n(284642),n(28900)),_=n(3923),f=n(43959),h=n(493635),g=n(61314),m=n(823240),y=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=E(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(573166));function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(E=function(e){return e?n:t})(e)}const S=36e5;let T,v=new Set,A=new Set,C=!1,P=0,O=0;function I(){return M.apply(this,arguments)}function M(){return(M=(0,i.default)((function*(e,t){const n=null!=t?yield b(e,t):e;return __LOG__(2)`syncd: marking for sync: ${n}`,n.forEach((e=>{const t=c.default.getCollectionState(e);__LOG__(2)`syncd: ${e} state before sync: ${t}`,t===d.CollectionSyncState.UpToDate?c.default.moveCollectionsToDirty([e]):t===d.CollectionSyncState.Dirty&&(A=new Set([...Array.from(A),e]))})),yield c.default.persistToDb(),L()}))).apply(this,arguments)}function b(){return R.apply(this,arguments)}function R(){return(R=(0,i.default)((function*(e,t){__LOG__(2)`syncd: start filter collections: ${e}`;const n=yield(0,o.bulkGetCollectionVersionsInTransaction)(e),r=new Map(e.map(((e,t)=>{var r;return[e,null===(r=n[t])||void 0===r?void 0:r.version]})));return e.filter((e=>{const n=r.get(e);if(null==n)return __LOG__(2)`syncd: local version for ${e} missing; will mark for sync.`,!0;const i=t.get(e);return null==i?(__LOG__(2)`syncd: server version for ${e} missing; will mark for sync.`,!0):n<i?(__LOG__(2)`syncd: local version (${n}) for ${e} less than server version (${i}); will mark for sync.`,!0):(__LOG__(2)`syncd: local version (${n})for ${e} >= server version (${i}); will not mark for sync.`,!1)}))}))).apply(this,arguments)}function N(){return(N=(0,i.default)((function*(){const e=yield(0,u.countSyncActionsInTransaction)();y.setStoredMutationCount(e);const t=yield(0,u.getSyncActionsByActionStatesInTransaction)([d.SyncActionState.Malformed]);y.setInvalidActionCount(t.length);const n=yield(0,u.getSyncActionsByActionStatesInTransaction)([d.SyncActionState.Unsupported]);y.setUnsupportedActionCount(n.length);const r=yield(0,s.getMissingKeyCountTransaction)();y.setMissingKeyCount(r)}))).apply(this,arguments)}function w(){return(w=(0,i.default)((function*(){}))).apply(this,arguments)}function L(){return D.apply(this,arguments)}function D(){return(D=(0,i.default)((function*(){if((0,p.isSyncdDisabled)())return Promise.resolve();const e=c.default.getCollectionsInStateDirty();__LOG__(2)`syncd: dirty collections: ${e}`;const t=new Set(e.filter((e=>!v.has(e))));if(0===t.size)return __LOG__(2)`syncd: no collections to sync`,Promise.resolve();let n=[];try{v=new Set([...Array.from(v),...Array.from(t)]),__LOG__(2)`syncd: initiate server sync`,n=yield(0,m.serverSync)(Array.from(t)),__LOG__(2)`syncd: server sync successful`;const e=n.filter((e=>e.state===d.CollectionState.ErrorRetry));e.length>0&&(O=e[0].serverBackoff||0,P=0),G(n)}catch(e){__LOG__(2)`syncd: exception during sync(): ${e}`,c.default.moveCollectionsToFiniteRetry(Array.from(t))}finally{__LOG__(2)`syncd: cleanup after sync()`,c.default.persistToDb(),v=new Set(Array.from(v).filter((e=>!t.has(e)))),U(),yield(0,a.getDbImpls)().handleSyncCompleted(n)}}))).apply(this,arguments)}function k(){if((0,p.isSyncdDisabled)())return;const e=new Set(c.default.getCollectionsInStateRetry());var t,n;0!==e.size&&(T=setTimeout((0,i.default)((function*(){try{C=!0,P+=1,__LOG__(2)`syncd: initiate server sync retry`;const t=yield(0,m.serverSync)(Array.from(e));__LOG__(2)`syncd: server sync retry successful`,G(t)}catch(t){__LOG__(2)`syncd: exception during handleRetry(): ${t}`,c.default.moveCollectionsToFiniteRetry(Array.from(e))}finally{__LOG__(2)`syncd: cleanup after handleRetry()`,function(){const e=c.default.getExpiredCollections();e.length>0&&(c.default.moveCollectionsToFatal(e),__LOG__(4,void 0,new Error,!0)`syncd: fatal error: expired collections`,SEND_LOGS("syncd: fatal error: expired collections"),(0,h.reportSyncdFatalError)(h.SyncdFatalErrorType.TOO_MANY_INTERNAL_SERVER_ERRORS_IN_7D))}(),c.default.persistToDb(),C=!1,U()}})),(t=P,n=O,Math.min(Math.max(2**t*1e3,n),S))))}function U(){__LOG__(2)`syncd: state machine tick`,c.default.getCollectionsInStateDirty().length>0&&(A=new Set(Array.from(A).filter((e=>v.has(e)))),L());const e=c.default.getCollectionsInStateRetry();if(e.length>0){if(C)return void __LOG__(2)`syncd: retry is in flight`;null!=T&&clearTimeout(T),A=new Set(Array.from(A).filter((t=>!e.includes(t)))),k()}c.default.getCollectionsInStateFatal().length>0&&(0,a.getDbImpls)().handleSyncdFatal({collections:c.default.getCollectionsInStateFatal()})}function G(e){return e.forEach((e=>e.state!==d.CollectionState.Success||A.has(e.name)?e.state===d.CollectionState.ErrorRetry?((0,f.reportSyncdCriticalBootstrapStage)(f.SyncdCriticalBootstrapStageType.ENTERED_RETRY_MODE),c.default.moveCollectionsToFiniteRetry([e.name])):e.state===d.CollectionState.ErrorFatal?c.default.moveCollectionsToFatal([e.name]):e.state!==d.CollectionState.Blocked||A.has(e.name)?void 0:c.default.moveCollectionsToBlocked([e.name]):c.default.moveCollectionsToUpToDate([e.name])))}function x(){return B.apply(this,arguments)}function B(){return(B=(0,i.default)((function*(){__LOG__(2)`syncd: syncPendingMutationsAndBlockedCollections`;const e=yield(0,l.getAllSyncPendingMutationsInTransaction)(),t=c.default.getCollectionsInStateBlocked();c.default.moveCollectionsToDirty(t);const n=e.map((e=>e.collection)).concat(t);n.length>0&&(__LOG__(2)`syncd: syncPendingMutationsAndBlockedCollections: [${n}]`,I(n))}))).apply(this,arguments)}function F(){return(F=(0,i.default)((function*(){yield(0,g.applyAllOrphansAndUnsupported)(),__LOG__(2)`syncd: syncing pending mutations and blocked collections due to app resume`,yield x()}))).apply(this,arguments)}},778005:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.checkLtHash=function(){return L.apply(this,arguments)},t.computeLtHash=N,t.computeLtHashAndValidatePatch=function(){return A.apply(this,arguments)},t.computeLtHashAndValidateSnapshot=function(){return v.apply(this,arguments)},t.computeOutgoingSnapshotAndPatchMacs=function(){return R.apply(this,arguments)},t.logMacsInSnapshot=G;var i=r(n(311504)),a=n(819416),o=n(192920),s=n(703177),l=n(759998),u=n(787252),c=n(476809),d=n(715739),p=n(155172),_=n(997835),f=n(284642),h=n(958177),g=n(3923),m=n(682661),y=n(493635),E=n(637463);function S(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r="string"==typeof e?e:(0,f.arrayBufferToHexPadded)(e),i="string"==typeof t?t:(0,f.arrayBufferToHexPadded)(t),a=n?-16:0;return`${r.slice(a)}:${i.slice(a)}`}const T=new TextDecoder;function v(){return(v=(0,i.default)((function*(e,t){const{mac:n,version:r,keyId:i,records:a}=t,s=yield(0,g.getKeyData)(i.id);if(!s)throw new h.SyncdMissingKeyError;const l=new Map(a.map((e=>[(0,f.arrayBufferToHexPadded)(e.index.blob),(0,_.valueMacFromIndexAndValueCipherText)(e.value.blob)])));__LOG__(2)`syncd:
${e} snapshot macsToAdd:
${Array.from(l.entries()).map((e=>{let[t,n]=e;return S(t,n)})).join("\n\t")}`;const u=yield o.LT_HASH_ANTI_TAMPERING.add(o.EMPTY_LT_HASH,Array.from(l.values())),{snapshotMacKey:c}=yield(0,_.generateEncryptionKeys)(s),d=(0,f.to64BitNetworkOrder)(r.version),p=(0,f.toUtf8)(e).buffer;return __LOG__(2)`syncd: validating snapshot mac for ${e} snapshot v${r.version}:
ltHash: ${(0,f.arrayBufferToHexPadded)(u)}
encoded version: ${(0,f.arrayBufferToHexPadded)(d)}
encoded collection: ${(0,f.arrayBufferToHexPadded)(p)}
expected snapshotMAC: ${(0,f.arrayBufferToHexPadded)(n)}`,yield O(e,n,c,u,d,p,!0,a.length,t.version.version),u}))).apply(this,arguments)}function A(){return(A=(0,i.default)((function*(e,t,n){const{version:r,mutations:a,snapshotMac:o,patchMac:s,keyId:l}=t,u=l.id,c=yield(0,g.getKeyData)(u);if(!c)throw new h.SyncdMissingKeyError;const{snapshotMacKey:p,patchMacKey:y}=yield(0,_.generateEncryptionKeys)(c),E=a.map((e=>({operation:e.operation,indexMac:e.record.index.blob,valueMac:(0,_.valueMacFromIndexAndValueCipherText)(e.record.value.blob)}))),T=yield N(e,E,n),v=(0,f.to64BitNetworkOrder)(r.version),A=(0,f.toUtf8)(e).buffer;__LOG__(2)`syncd: validating snapshot and patch mac for ${e} v${r.version}:
expected snapshotMAC: ${(0,f.arrayBufferToHexPadded)(o)}
expected patchMAC: ${(0,f.arrayBufferToHexPadded)(s)}
encoded version: ${(0,f.arrayBufferToHexPadded)(v)}
encoded collection: ${(0,f.arrayBufferToHexPadded)(A)}
key ID: ${(0,f.arrayBufferToHexPadded)((0,m.fromSyncKeyId)(u))}`;try{yield M(e,s,y,o,E.map((e=>e.valueMac)),v,A,a.length,r.version),yield O(e,o,p,T,v,A,!1,a.length,r.version)}catch(e){throw yield function(){return C.apply(this,arguments)}(),e}return T;function C(){return(C=(0,i.default)((function*(){const t=yield G(e,!1),n=new Map(t.map((e=>{let{indexMac:t,valueMac:n}=e;return[(0,f.arrayBufferToHexPadded)(t),(0,f.arrayBufferToHexPadded)(n)]})));__LOG__(2)`syncd: error on incoming records:
\t${E.map((e=>{let{operation:t,indexMac:r,valueMac:i}=e;return`${t===d.SyncdMutation$SyncdOperation.SET?"set":"remove"} | ${S(r,i,!1)} | ${n.has((0,f.arrayBufferToHexPadded)(r))?"found":"did not find"} indexMAC in the above logged macs`})).join("\n\t")}`}))).apply(this,arguments)}}))).apply(this,arguments)}function C(){return P.apply(this,arguments)}function P(){return(P=(0,i.default)((function*(e,t){const n=yield(0,l.getCollectionVersionInTransaction)(e).then((e=>{var t;return null!==(t=null==e?void 0:e.version)&&void 0!==t?t:0}));if(n!==t-1){const r=n>t-1?"greater-than-expected":"less-than-expected";throw __LOG__(3,void 0,void 0,!0)`syncd: ${e} received patch v${t} !== latest local version (v${n}) + 1`,SEND_LOGS(`syncd-version-check-error-local-version-${r}`),new h.SyncdRetryableError(`syncd-version-check-error-local-version-${r}`)}const r=yield(0,l.getCollectionVersionLtHashInTransaction)(e);if((0,s.arrayBuffersEqual)(r,o.EMPTY_LT_HASH)&&1!==t)throw __LOG__(3,void 0,void 0,!0)`syncd: empty local lthash found when processing ${e} patch v${t}`,SEND_LOGS("syncd-empty-lthash-on-mac-mismatch"),new h.SyncdRetryableError("empty lthash")}))).apply(this,arguments)}function O(){return I.apply(this,arguments)}function I(){return(I=(0,i.default)((function*(e,t,n,r,i,o,u,c,d){var p;const f=(0,a.getConfig)().syncdShouldNotFatalOnSnapshotMacMismatchInPatches()&&!u,g=null!==(p=yield(0,l.getIsCollectionInMacMismatchFatalInTransaction)(e))&&void 0!==p&&p;if(f&&g)return void __LOG__(2)`syncd: collection ${e} is already in snapshot mac mismatch so not checking again`;const m=yield(0,_.generateSnapshotMac)(n,r,i,o);if(!(0,s.arrayBuffersEqual)(m,t)){__LOG__(3,void 0,void 0,!0)`syncd: unable to validate snapshot mac.`,SEND_LOGS("syncd: unable to validate snapshot mac."),u||(yield C(e,d));const t=u?y.SyncdFatalErrorType.SNAPSHOT_MAC_MISMATCH_IN_SNAPSHOT:y.SyncdFatalErrorType.SNAPSHOT_MAC_MISMATCH_IN_PATCH;if((0,y.reportSyncdFatalError)(t,e,c,d,!f),f)return yield(0,l.updateIsCollectionInMacMismatchFatalInTransaction)(e),void __LOG__(2)`syncd: skip fatal after snapshot mac mismatch for collection ${e}`;throw new h.SyncdFatalError("unable to validate snapshot mac")}}))).apply(this,arguments)}function M(){return b.apply(this,arguments)}function b(){return(b=(0,i.default)((function*(e,t,n,r,i,a,o,l,u){const c=yield(0,_.generatePatchMac)(n,r,i,a,o);if(!(0,s.arrayBuffersEqual)(c,t))throw yield C(e,u),(0,y.reportSyncdFatalError)(y.SyncdFatalErrorType.MAC_MISMATCH_PATCH,e,l,u),__LOG__(3,void 0,void 0,!0)`syncd: unable to validate patch mac.`,SEND_LOGS("syncd: unable to validate patch mac."),new h.SyncdFatalError("unable to validate patch mac")}))).apply(this,arguments)}function R(){return(R=(0,i.default)((function*(e,t,n,r){const i=(yield(0,l.getCollectionVersionInTransaction)(e).then((e=>{var t;return null!==(t=null==e?void 0:e.version)&&void 0!==t?t:p.DEFAULT_COLLECTION_VERSION})))+1,{patchMacKey:a,snapshotMacKey:o}=yield(0,_.generateEncryptionKeys)(r),s=(0,f.to64BitNetworkOrder)(i),u=(0,f.toUtf8)(e).buffer,c=yield(0,_.generateSnapshotMac)(o,t,s,u),d=yield(0,_.generatePatchMac)(a,c,n.map((e=>e.valueMac)),s,u);return __LOG__(2)`syncd: computing snapshot and patch macs for outgoing patch ${e} v${i}:
encoded version: ${(0,f.arrayBufferToHexPadded)(s)}
encoded collection: ${(0,f.arrayBufferToHexPadded)(u)}
snapshotMAC: ${(0,f.arrayBufferToHexPadded)(c)}
patchMAC: ${(0,f.arrayBufferToHexPadded)(d)}`,{snapshotMac:c,patchMac:d}}))).apply(this,arguments)}function N(){return w.apply(this,arguments)}function w(){return(w=(0,i.default)((function*(e,t,n){const r=yield(0,l.getCollectionVersionLtHashInTransaction)(e),s=yield k(t.map((e=>e.indexMac))),u=new Map,p=new Map,_=new Map;yield(0,c.promiseEach)(t,function(){var t=(0,i.default)((function*(t){const{indexMac:r,valueMac:i,operation:o}=t,l=T.decode(r),c=s.get(l);if(c)o===d.SyncdMutation$SyncdOperation.REMOVE?p.set((0,f.arrayBufferToHexPadded)(r),c):_.set((0,f.arrayBufferToHexPadded)(r),c);else if(o===d.SyncdMutation$SyncdOperation.REMOVE){const t=yield function(e){if(null==n)return Promise.resolve(null);return n(e)}(r);var h,g;if(null!=t)p.set((0,f.arrayBufferToHexPadded)(r),t),__LOG__(3,void 0,void 0,!0,["non-sad"])`syncd: had to use fallbackQueryForValueMac in collection ${e} for platform ${null!==(h=(0,a.getConfig)().primaryPlatform())&&void 0!==h?h:"[empty]"}: ${(0,f.arrayBufferToHexPadded)(r).slice(-16)}
}`,SEND_LOGS("syncd: fallback query");else(0,E.reportSyncdCriticalEvent)(E.SyncdCriticalEventType.MISSING_MUTATION_TO_REMOVE,e),__LOG__(3)`syncd: missing indexMAC in sync-actions table for REMOVE mutation in collection ${e} for platform ${null!==(g=(0,a.getConfig)().primaryPlatform())&&void 0!==g?g:"[empty]"}:
${(0,f.arrayBufferToHexPadded)(r).slice(-16)}`}o===d.SyncdMutation$SyncdOperation.SET&&u.set((0,f.arrayBufferToHexPadded)(r),i)}));return function(){return t.apply(this,arguments)}}());const h=yield o.LT_HASH_ANTI_TAMPERING.subtractThenAdd(r,Array.from(u.values()),Array.from(p.values()).concat(Array.from(_.values())));return __LOG__(2)`syncd: computing ltHash for ${e}:
currentLtHash: ${(0,f.arrayBufferToHexPadded)(r)}
macsToAdd:
${Array.from(u.entries()).map((e=>{let[t,n]=e;return S(t,n)})).join("\n\t")}
macsToRemove:
${Array.from(p.entries()).map((e=>{let[t,n]=e;return S(t,n)})).join("\n\t")}
macsToOverwrite (also remove):
${Array.from(_.entries()).map((e=>{let[t,n]=e;return S(t,n)})).join("\n\t")}
newLtHash: ${(0,f.arrayBufferToHexPadded)(h)}`,h}))).apply(this,arguments)}function L(){return(L=(0,i.default)((function*(){const e=yield(0,a.runInTransaction)(["SyncActionStore","CollectionVersionStore"],function(){var e=(0,i.default)((function*(e){let{SyncActionStore:t,CollectionVersionStore:n}=e;const r=yield n.getAll();return Promise.all(r.map(function(){var e=(0,i.default)((function*(e){let{collection:n,ltHash:r}=e;return{collection:n,ltHash:r,mutations:yield t.getByCollections([n])}}));return function(){return e.apply(this,arguments)}}()))}));return function(){return e.apply(this,arguments)}}());yield Promise.all(e.map(function(){var e=(0,i.default)((function*(e){let{collection:t,ltHash:n,mutations:r}=e;const i=yield D(r);(0,s.arrayBuffersEqual)(n,i)||(__LOG__(4,!0,new Error,!0)`syncd: failed LtHash check for ${t}`,SEND_LOGS("LtHash check failed"))}));return function(){return e.apply(this,arguments)}}()))}))).apply(this,arguments)}function D(e){const t=new Map(e.map((e=>[(0,f.arrayBufferToHexPadded)(e.indexMac),e.valueMac])));return o.LT_HASH_ANTI_TAMPERING.add(o.EMPTY_LT_HASH,Array.from(t.values()))}function k(){return U.apply(this,arguments)}function U(){return(U=(0,i.default)((function*(e){const t=yield(0,u.getSyncActionsByIndexMacsInTransaction)(e);return new Map(t.map((e=>[T.decode(e.indexMac),e.valueMac])))}))).apply(this,arguments)}function G(){return x.apply(this,arguments)}function x(){return(x=(0,i.default)((function*(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=t?20:1;__LOG__(2)`syncd: logMacs: ${e}: prepare`;const[r,i]=yield(0,a.runInTransaction)(["SyncActionStore","CollectionVersionStore"],(t=>{let{SyncActionStore:n,CollectionVersionStore:r}=t;return Promise.all([r.get(e).then((e=>null==e?void 0:e.version)),n.getByCollections([e])])}));if(__LOG__(2)`syncd: current snapshot ${e} v${r} with ${i.length} mutations:`,t&&i.length>100)return i;const o=i.reduce(((e,r,i)=>(i%n==0&&e.push(""),e[e.length-1]+=S(r.indexMac,r.valueMac,t)+" | ",e)),[]);return o.forEach((e=>__LOG__(2)`|${e}`)),i}))).apply(this,arguments)}},155172:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SyncModelType=t.SyncDataType=t.SyncActionState=t.MIN_PATCH_SIZE=t.MIN_INLINE_MUTATIONS=t.MAX_PATCH_SIZE=t.MAX_INLINE_MUTATIONS=t.LABEL_ASSOCIATION_SYNC_VERSION=t.FINITE_FAILURE_EXPIRY_DURATION=t.DEFAULT_COLLECTION_VERSION=t.ConflictResolutionState=t.CollectionSyncState=t.CollectionState=t.CollectionName=t.CHAT_ASSIGNMENT_SYNC_VERSION=t.BACKOFF_MIN_TIMEOUT=t.BACKOFF_MAX_TIMEOUT=t.BACKOFF_BASE=t.Actions=void 0;var r=n(990445);t.BACKOFF_MIN_TIMEOUT=1e3;t.BACKOFF_MAX_TIMEOUT=36e5;t.BACKOFF_BASE=2;const i=2*r.DAY_MILLISECONDS;t.FINITE_FAILURE_EXPIRY_DURATION=i;t.MIN_INLINE_MUTATIONS=100;t.MAX_INLINE_MUTATIONS=2e3;t.MIN_PATCH_SIZE=10;t.MAX_PATCH_SIZE=100;t.DEFAULT_COLLECTION_VERSION=0;t.LABEL_ASSOCIATION_SYNC_VERSION=3;t.CHAT_ASSIGNMENT_SYNC_VERSION=7;const a=n(654302)({Star:"star",Contact:"contact",Mute:"mute",PinDEPRECATED:"pin",Pin:"pin_v1",SettingPushName:"setting_pushName",LabelEdit:"label_edit",LabelMessage:"label_message",LabelJid:"label_jid",QuickReply:"quick_reply",LocaleSetting:"setting_locale",Archive:"archive",MarkChatAsRead:"markChatAsRead",ClearChat:"clearChat",DeleteMessageForMe:"deleteMessageForMe",Sentinel:"sentinel",UnarchiveChatsSetting:"setting_unarchiveChats",DeleteChat:"deleteChat",AndroidUnsupportedActions:"android_unsupported_actions",PrimaryFeature:"primary_feature",Subscription:"subscription",Nux:"nux",Agent:"deviceAgent",TimeFormat:"time_format",UserStatusMute:"userStatusMute",PrimaryVersion:"primary_version",RemoveRecentSticker:"removeRecentSticker",ChatAssignment:"agentChatAssignment",ChatAssignmentOpenedStatus:"agentChatAssignmentOpenedStatus",FavoriteSticker:"favoriteSticker"});t.Actions=a;const o=n(654302)({Regular:"regular",RegularLow:"regular_low",RegularHigh:"regular_high",CriticalBlock:"critical_block",CriticalUnblockLow:"critical_unblock_low"});t.CollectionName=o;const s=n(654302).Mirrored(["Success","SuccessHasMore","Conflict","ConflictHasMore","ErrorRetry","ErrorFatal","Blocked"]);t.CollectionState=s;const l=n(654302).Mirrored(["UpToDate","Dirty","FailingFiniteRetry","Fatal","Blocked"]);t.CollectionSyncState=l;const u=n(654302).Mirrored(["Success","Malformed","Orphan","Unsupported","Skipped","Failed"]);t.SyncActionState=u;const c=n(654302)({Msg:"Msg",Chat:"Chat",Agent:"Agent",ChatAssignment:"ChatAssignment",UserStatusMute:"UserStatusMute"});t.SyncModelType=c;const d=n(654302).Mirrored(["ApplyRemoteAndDropLocal","SkipRemote","SkipRemoteAndDropLocal"]);t.ConflictResolutionState=d;const p=n(654302).Mirrored(["Patch","Snapshot","Local"]);t.SyncDataType=p},28900:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSyncdDisabled=function(){return(0,r.getConfig)().syncdDisabled()};var r=n(819416)},958177:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SyncdRetryableError=t.SyncdMissingKeyError=t.SyncdFatalError=void 0;class n extends Error{constructor(){super(...arguments),this.name="SyncdMissingKeyError"}}t.SyncdMissingKeyError=n;class r extends Error{constructor(e,t){super(e),this.name="SyncdRetryableError",this.backoff=t,this.message=e}}t.SyncdRetryableError=r;class i extends Error{constructor(e){super(e),this.name="SyncdFatalError",this.message=e}}t.SyncdFatalError=i},61314:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.applyAllOrphansAndUnsupported=function(){return g.apply(this,arguments)},t.checkOrphanAgents=function(){return m.apply(this,arguments)},t.checkOrphanChatAssignments=function(){return y.apply(this,arguments)},t.checkOrphanChats=p,t.checkOrphanMessages=c,t.checkOrphanMutations=function(){return u.apply(this,arguments)},t.checkOrphanUserStatusMutes=function(){return E.apply(this,arguments)};var i=r(n(311504)),a=n(787252),o=n(411613),s=n(155172),l=n(28900);function u(){return(u=(0,i.default)((function*(e,t){if((0,l.isSyncdDisabled)())return Promise.resolve();yield Promise.all([c(e),p(t)])}))).apply(this,arguments)}function c(){return d.apply(this,arguments)}function d(){return(d=(0,i.default)((function*(e){yield f(e,s.SyncModelType.Msg)}))).apply(this,arguments)}function p(){return _.apply(this,arguments)}function _(){return(_=(0,i.default)((function*(e){yield f(e,s.SyncModelType.Chat)}))).apply(this,arguments)}function f(){return h.apply(this,arguments)}function h(){return(h=(0,i.default)((function*(e,t){if((0,l.isSyncdDisabled)())return Promise.resolve();const n=yield(0,a.getSyncActionsByModelInfosInTransaction)(e.map((e=>[e,t,s.SyncActionState.Orphan])));yield(0,o.applyIndividualMutations)(n)}))).apply(this,arguments)}function g(){return(g=(0,i.default)((function*(){if((0,l.isSyncdDisabled)())return Promise.resolve();__LOG__(2)`syncd: start applyAllOrphansAndUnsupported`;const e=yield(0,a.getSyncActionsByActionStatesInTransaction)([s.SyncActionState.Orphan,s.SyncActionState.Unsupported]);yield(0,o.applyIndividualMutations)(e),__LOG__(2)`syncd: end applyAllOrphansAndUnsupported`}))).apply(this,arguments)}function m(){return(m=(0,i.default)((function*(e){yield f(e,s.SyncModelType.Agent)}))).apply(this,arguments)}function y(){return(y=(0,i.default)((function*(e){yield f(e,s.SyncModelType.ChatAssignment)}))).apply(this,arguments)}function E(){return(E=(0,i.default)((function*(e){yield f(e,s.SyncModelType.UserStatusMute)}))).apply(this,arguments)}},221999:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.syncResponseParser=void 0;var i=r(n(73982)),a=n(155172),o=n(372896),s=n(958177),l=n(493635);const u=new(n(769707).WapParser)("syncResponseParser",(e=>{__LOG__(2)`syncd: start parsing syncd collections`;const t=[];return e.child("sync").mapChildrenWithTag("collection",(e=>{const n=(0,i.default)({},null),r=a.CollectionName.cast(e.attrString("name"));if(!r)throw new s.SyncdFatalError("invalid collection name");n.name=r,n.state=function(e,t){if(!e.hasAttr("type")||"error"!==e.attrString("type"))return e.hasAttr("has_more_patches")?(__LOG__(2)`syncd: collection ${t} got server code has_more_patches`,a.CollectionState.SuccessHasMore):(__LOG__(2)`syncd: collection ${t} did not get server error`,a.CollectionState.Success);{const n=e.child("error"),r=n.attrString("code"),i=n.attrString("text");switch(__LOG__(2)`syncd: collection ${t} got server error: ${r}`,r){case"409":return e.hasAttr("has_more_patches")?a.CollectionState.ConflictHasMore:a.CollectionState.Conflict;case"400":return(0,l.reportSyncdFatalError)(l.SyncdFatalErrorType.XMPP_BAD_REQUEST_FOR_COLLECTION),__LOG__(4,void 0,new Error,!0)`syncd: fatal error: collection ${String(t)} throws ${i}`,SEND_LOGS(`syncd: fatal error 400: collection ${String(t)}`),a.CollectionState.ErrorFatal;case"404":return(0,l.reportSyncdFatalError)(l.SyncdFatalErrorType.XMPP_NOT_FOUND_FOR_COLLECTION),__LOG__(4,void 0,new Error,!0)`syncd: fatal error 404: collection ${String(t)} throws ${i}`,SEND_LOGS(`syncd: fatal error: collection ${String(t)}`),a.CollectionState.ErrorFatal;default:return __LOG__(3,void 0,void 0,!0)`syncd: retryable error: collection ${String(t)} throws ${i}`,SEND_LOGS(`syncd: retryable error: collection ${String(t)}`),a.CollectionState.ErrorRetry}}}(e,n.name),e.hasAttr("version")&&(n.version=parseInt(e.attrString("version"),10)),e.hasChild("patches")&&(n.patches=e.child("patches").mapChildrenWithTag("patch",(e=>(0,o.decodeSyncdPatch)(r,e.contentBytes())))),e.hasChild("snapshot")&&(n.snapshot=(0,o.decodeExternalBlobReference)(r,e.child("snapshot").contentBytes())),t.push(n),null==n.version&&null==n.patches&&null==n.snapshot&&__LOG__(2)`syncd: collection ${r} has no version, patches or snapshot`,__LOG__(2)`syncd: successfully parsed collection ${r}`})),t}));t.syncResponseParser=u},823240:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.serverSync=function(){return m.apply(this,arguments)};var i=r(n(311504)),a=n(911794),o=n(171537),s=n(411613),l=n(155172),u=n(958177),c=n(43959),d=n(493635),p=n(637463),_=r(n(426445)),f=n(221999),h=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=g(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(573166));function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(g=function(e){return e?n:t})(e)}function m(){return(m=(0,i.default)((function*(e){let t=[],n=[...e],r=0;for(;(r<5||n.length>0&&r<500)&&0!==n.length;){const{doneCollections:e,refetchCollections:i}=yield y(n);n=i,t=t.concat(e),r++}return n.length>0&&(__LOG__(4,void 0,new Error,!0,["syncd"])`syncd: reached max iterations for collections: ${n}`,SEND_LOGS("syncd: max iteration"),t=t.concat(n.map((e=>({state:l.CollectionState.ErrorRetry,name:e}))))),t}))).apply(this,arguments)}function y(){return E.apply(this,arguments)}function E(){return(E=(0,i.default)((function*(e){if(0===e.length)return{doneCollections:[],refetchCollections:[]};try{const{collectionDetails:t,localCollectionVersions:n,collectionsToUpload:r}=yield S(e);r.length>0&&__LOG__(2)`syncd: deferred local mutation upload for ${r}`,__LOG__(2)`syncd: local collection versions:`,n.forEach(((e,t)=>{__LOG__(2)`\n\t${t} v${null!=e?e:"(undefined)}"}`}));const a=[],u=[];t.forEach((e=>{switch(e.state){case l.CollectionState.ErrorRetry:case l.CollectionState.ErrorFatal:case l.CollectionState.Blocked:return void u.push(e);default:a.push(e)}e.state!==l.CollectionState.Conflict&&e.state!==l.CollectionState.ConflictHasMore||h.incConflict()})),__LOG__(2)`syncd: start apply collections: ${a.map((e=>e.name))}`;const c=new p.SyncdEventFlow,d=yield Promise.all(a.map((e=>(0,s.applyAppStateSyncResponse)(e,n.get(e.name),c))));c.end(),__LOG__(2)`syncd: end apply collections: ${a.map((e=>e.name))}`;const _=[];return yield Promise.all(d.map(function(){var e=(0,i.default)((function*(e){if(e.state===l.CollectionState.Conflict){(yield(0,o.getSyncPendingMutationsByCollectionInTransaction)(e.name)).length>0?_.push(e.name):(e.state=l.CollectionState.Success,u.push(e))}else e.state===l.CollectionState.ConflictHasMore||e.state===l.CollectionState.SuccessHasMore||e.state===l.CollectionState.Success&&r.some((t=>t===e.name))?_.push(e.name):u.push(e)}));return function(){return e.apply(this,arguments)}}())),{doneCollections:u,refetchCollections:_}}catch(t){if(t instanceof u.SyncdFatalError){__LOG__(4,void 0,new Error,!0)`syncd: fatal error: syncd global throws ${t.message}`,SEND_LOGS(`syncd: fatal error: syncd global throws ${t.message}`);return{doneCollections:e.map((e=>({state:l.CollectionState.ErrorFatal,name:e}))),refetchCollections:[]}}__LOG__(3,void 0,void 0,!0)`syncd: retryable error: syncd global throws ${t.message}`,SEND_LOGS(`syncd: retryable error: syncd global throws ${t.message}`);return{doneCollections:e.map((e=>({state:l.CollectionState.ErrorRetry,name:e,serverBackoff:t.errorBackoff}))),refetchCollections:[]}}}))).apply(this,arguments)}function S(){return T.apply(this,arguments)}function T(){return(T=(0,i.default)((function*(e){const{syncIqNode:t,collectionWithPendingMutationsIds:n,collectionWithEncryptedMutations:r,localCollectionVersions:i,collectionsToSkip:o}=yield(0,_.default)(e);(0,c.reportSyncdCriticalBootstrapStage)(c.SyncdCriticalBootstrapStageType.REQUEST_BUILT),__LOG__(2)`syncd: sending sync request for collections: ${e.map((e=>{var t,r,a;return`\n\t${e} v${null!==(t=i.get(e))&&void 0!==t?t:"(undefined)"} ${(null!==(r=null===(a=n.get(e))||void 0===a?void 0:a.length)&&void 0!==r?r:0)>0&&null!=i.get(e)?" with local changes":""}`}))}`;const s=yield(0,a.deprecatedSendIq)(t,f.syncResponseParser);if(__LOG__(2)`syncd: completed network operation for collections: ${e}`,(0,c.reportSyncdCriticalBootstrapStage)(c.SyncdCriticalBootstrapStageType.RESPONSE_RECEIVED),s.success){(0,c.reportSyncdCriticalBootstrapStage)(c.SyncdCriticalBootstrapStageType.RESPONSE_PARSED_VALID);const e=s.result;return __LOG__(2)`syncd: received sync response for collections: ${e.map((e=>{let t=`\n${e.name}`;return null!=e.version&&(t+=`\n\tupdated to version ${e.version}`),null!=e.snapshot&&(t+="\n\tcontains snapshot"),null!=e.patches&&(t+=`\n\tcontains ${e.patches.length} patches`),t}))}`,e.forEach((e=>{const t=n.get(e.name);t&&(e.syncedPendingMutationsId=t);const i=r.get(e.name);i&&(e.syncedEncryptedMutations=i)})),{collectionDetails:e,localCollectionVersions:i,collectionsToUpload:o}}const{errorCode:l,errorText:u,errorBackoff:d}=s;throw v(l,u,d)}))).apply(this,arguments)}function v(e,t,n){switch(e){case 400:return(0,d.reportSyncdFatalError)(d.SyncdFatalErrorType.XMPP_BAD_REQUEST_GLOBAL_ERROR),new u.SyncdFatalError(t);case 404:return(0,d.reportSyncdFatalError)(d.SyncdFatalErrorType.XMPP_NOT_FOUND_GLOBAL_ERROR),new u.SyncdFatalError(t);case 405:return(0,d.reportSyncdFatalError)(d.SyncdFatalErrorType.XMPP_BAD_METHOD_GLOBAL_ERROR),new u.SyncdFatalError(t);case 406:return(0,d.reportSyncdFatalError)(d.SyncdFatalErrorType.XMPP_NOT_ACCEPTABLE_GLOBAL_ERROR),new u.SyncdFatalError(t);default:return new u.SyncdRetryableError(t,n)}}},297227:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeleteChatSyncBase=void 0;var r=n(715739),i=n(94439),a=n(797666),o=n(155172);class s extends i.SyncActionBase{constructor(){super(...arguments),this.version=6,this.action=o.Actions.DeleteChat}buildDeleteChatMutation(e){let{timestamp:t,chatId:n,mergedRange:i,deleteMediaFiles:s}=e;return(0,a.buildPendingMutation)({collection:o.CollectionName.RegularHigh,indexArgs:this.buildDeleteChatIndexArgs(n,s),value:{deleteChatAction:{messageRange:i}},version:this.version,operation:r.SyncdMutation$SyncdOperation.SET,timestamp:t,action:this.action})}buildDeleteChatIndexArgs(e,t){return[e,t?"1":"0"]}}t.DeleteChatSyncBase=s},545493:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.DeleteMessageForMeSyncBase=void 0;var i=r(n(222666)),a=n(715739),o=n(94439),s=n(797666),l=n(155172);const u=["timestamp","deleteMedia","messageTimestamp"];class c extends o.SyncActionBase{constructor(){super(...arguments),this.version=3,this.action=l.Actions.DeleteMessageForMe}buildDeleteForMeMutation(e){let{timestamp:t,deleteMedia:n,messageTimestamp:r}=e,o=(0,i.default)(e,u);return(0,s.buildPendingMutation)({collection:l.CollectionName.RegularHigh,indexArgs:(0,s.buildMessageKey)(o),value:{deleteMessageForMeAction:{deleteMedia:n,messageTimestamp:r}},version:this.version,operation:a.SyncdMutation$SyncdOperation.SET,timestamp:t,action:this.action})}}t.DeleteMessageForMeSyncBase=c},345410:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(311504)),a=n(865254),o=n(715739),s=n(94439),l=n(797666),u=n(155172),c=n(534202),d=n(990445);class p extends s.SyncActionBase{constructor(){super(...arguments),this.version=3,this.action=u.Actions.Sentinel}applyMutations(e){return Promise.all(e.map(function(){var e=(0,i.default)((function*(e){try{if("set"===e.operation){var t;const n=null===(t=e.value.keyExpiration)||void 0===t?void 0:t.expiredKeyEpoch;return null==n?(__LOG__(4,void 0,new Error)`sentinel mutation sync: malformed mutation`,{actionState:u.SyncActionState.Malformed}):(yield(0,a.expireSyncKeyInTransaction)(n),{actionState:u.SyncActionState.Success})}return __LOG__(3)`sentinel mutation sync: operation not supported`,{actionState:u.SyncActionState.Unsupported}}catch(e){return{actionState:u.SyncActionState.Failed}}}));return function(){return e.apply(this,arguments)}}()))}getSentinelMutations(){var e=this;return(0,i.default)((function*(){const t=(0,d.unixTimeMs)(),n=Array.from(u.CollectionName.members()),r=yield(0,c.getNewestKeyPair)();if(null==r)return __LOG__(4,void 0,new Error)`sentinel mutation sync: no key pairs`,[];const i={keyExpiration:{expiredKeyEpoch:r.keyEpoch}};return n.map((n=>(0,l.buildPendingMutation)({collection:n,indexArgs:[n],operation:o.SyncdMutation$SyncdOperation.SET,version:e.version,value:i,timestamp:t,action:e.action})))}))()}}const _=new p;Object.freeze(_);var f=_;t.default=f},94439:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SyncActionBase=void 0;var r=n(155172);t.SyncActionBase=class{getChatJidAndMessageKey(){}resolveConflicts(e,t){return t.timestamp>=e.timestamp?Promise.resolve(r.ConflictResolutionState.ApplyRemoteAndDropLocal):Promise.resolve(r.ConflictResolutionState.SkipRemote)}dropMutationDueToCrossIndexConflict(){return Promise.resolve(!1)}}},797666:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.buildIndex=s,t.buildMessageKey=function(e){let{remoteJid:t,id:n,fromMe:r,participant:i}=e;return[t,n,r?"1":"0",null==i||r?"0":i]},t.buildPendingMutation=function(e){let{action:t,indexArgs:n,collection:r,value:l,version:u,operation:c,timestamp:d}=e;return{collection:r,index:s(t,n),binarySyncAction:(0,o.encodeProtobuf)(a.SyncActionValueSpec,(0,i.default)((0,i.default)({},l),{},{timestamp:d})).readBuffer(),version:u,operation:c,timestamp:d,action:t}};var i=r(n(73982)),a=n(370625),o=n(653313);function s(e,t){return JSON.stringify([e,...t])}},70704:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getActionHandler=function(e){null==i&&(i=new Map((0,r.getConfig)().syncdActionHandlers().map((e=>[e.action,e]))));return i.get(e)},t.maxSupportedVersion=function(){null==a&&(a=Math.max(...(0,r.getConfig)().syncdActionHandlers().map((e=>e.version))));return a};var r=n(819416);let i=null,a=null},411613:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.applyAppStateSyncResponse=function(){return U.apply(this,arguments)},t.applyIndividualMutations=function(){return k.apply(this,arguments)};var i=r(n(73982)),a=r(n(311504)),o=n(819416),s=n(703177),l=n(759998),u=n(773244),c=n(787252),d=n(478337),p=r(n(132375)),_=n(715739),f=n(370625),h=n(778005),g=n(813757),m=n(729208),y=n(155172),E=n(807091),S=n(958177),T=n(70704),v=n(558608),A=n(43959),C=n(493635),P=n(637463),O=n(439734),I=n(529904),M=n(412922),b=r(n(499189)),R=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=L(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(573166)),N=n(990445),w=n(309512);function L(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(L=function(e){return e?n:t})(e)}const D=new ArrayBuffer(128);function k(){return(k=(0,a.default)((function*(e){if(0===e.length)return Promise.resolve();const t=e.sort(((e,t)=>e.timestamp-t.timestamp));__LOG__(2)`syncd: start applyIndividualMutations`;const n=(0,g.syncActionsToDecryptedMutation)(t).reduce(((e,t)=>{var n;const r=null!==(n=e.get(t.collection))&&void 0!==n?n:[];return r.push(t),e.set(t.collection,r),e}),new Map),r=Array.from(n.keys()).map(function(){var e=(0,a.default)((function*(e){__LOG__(2)`syncd: apply individual mutations for collection ${e}`;const t=n.get(e);if(void 0===t)return;const{setMutationsToPersist:r,pendingMutationsToDrop:i}=yield Q(e,t,y.SyncDataType.Local,null),s=r.map((e=>({action:e.action,actionState:e.actionState,binarySyncData:e.binarySyncData,collection:e.collection,index:e.index,keyId:e.keyId,modelId:e.modelId,modelType:e.modelType,timestamp:e.timestamp,version:e.version})));__LOG__(2)`syncd: end apply individual mutations for collection ${e}`,yield(0,o.runInTransaction)(["SyncActionStore","PendingMutationStore"],function(){var e=(0,a.default)((function*(e){let{SyncActionStore:t,PendingMutationStore:n}=e;yield t.bulkUpdate(s),yield n.bulkRemove(i)}));return function(){return e.apply(this,arguments)}}()),__LOG__(2)`syncd: end update db after apply individual mutations for collection ${e}`}));return function(){return e.apply(this,arguments)}}());yield Promise.all(r),__LOG__(2)`syncd: end applyIndividualMutations`}))).apply(this,arguments)}function U(){return(U=(0,a.default)((function*(e,t,n){const{name:r,version:i,patches:a,snapshot:s,syncedPendingMutationsId:c,syncedEncryptedMutations:d}=e;__LOG__(2)`syncd: start applying collection ${r}`;try{var p,_;null==n||n.mark("external_mutations_download_start",{patchCount:null===(p=e.patches)||void 0===p?void 0:p.length,snapshotSizeBytes:null===(_=e.snapshot)||void 0===_?void 0:_.fileSizeBytes});const[f,g]=yield B(r,a,s,t);null==n||n.mark("external_mutations_download_end",{patchesWithMutationsCount:null==g?void 0:g.length,snapshotRecordsCount:null==f?void 0:f.records.length});const y=performance.now();if(null!=f)yield K(r,f,g,n),__LOG__(2)`syncd: ${r} snapshot and patches applied successfully`;else if(null!=g){const e=Math.min.apply(Math,g.map((e=>e.version.version)));if(null!=t&&e>t+1&&g.length>0){const n=yield(0,u.getAllMissingKeysInTransaction)();if(__LOG__(2)`syncd: missing keys: [${n.map((e=>e.keyHex+":"+e.timestamp))}]`,__LOG__(2)`syncd: has missing patches. collection: ${r}, localVersion: ${t},
minPatch: ${e}`,__LOG__(4,void 0,new Error,!0)`syncd: has missing patches`,SEND_LOGS("syncd: has missing patches"),(0,o.getConfig)().syncdShouldFatalOnMissingPatch())throw(0,C.reportSyncdFatalError)(C.SyncdFatalErrorType.SERVER_DID_NOT_SEND_ALL_PATCHES,r,void 0,null!=t?t:0),new S.SyncdFatalError("syncd: has missing patches")}yield $(r,g,n),__LOG__(2)`syncd: ${r} patches applied successfully`}else null!=i?(yield G(r,i,c,d),__LOG__(2)`syncd: ${r} v${i} uploaded successfully`):((0,m.isBootstrap)(t)&&(yield(0,l.updateCollectionVersionAndLtHashInTransaction)(r,0,D)),__LOG__(2)`syncd: sync ${r} but there are no updates`);const E=Math.floor(performance.now()-y);return __LOG__(2)`syncd: applyAppStateSyncResponse: finished applying ${r} in ${E}ms`,(g||f)&&(0,m.isBootstrap)(t)&&!(0,m.isCriticalCollection)(r)&&(0,P.reportSyncdBootstrapDataApplied)(r,null!=f?P.SyncdBootstrapDataAppliedSnapshotUsed.SNAPSHOT_USED:P.SyncdBootstrapDataAppliedSnapshotUsed.SNAPSHOT_NOT_USED,E),yield(0,h.logMacsInSnapshot)(e.name),e}catch(e){const t=e.message;return e instanceof S.SyncdMissingKeyError?(__LOG__(3)`syncd: key error: ${r} missing keys`,{name:r,state:y.CollectionState.Blocked}):e instanceof S.SyncdFatalError?(__LOG__(4,void 0,new Error,!0)`syncd: fatal error: ${r} throws ${t}`,SEND_LOGS(`syncd: fatal error: ${String(r)} throws ${t}`),{name:r,state:y.CollectionState.ErrorFatal}):(__LOG__(3,void 0,void 0,!0)`syncd: retryable error: ${r} throws ${t}`,SEND_LOGS(`syncd: retryable error: ${String(r)} throws ${t}`),{name:r,state:y.CollectionState.ErrorRetry})}}))).apply(this,arguments)}function G(){return x.apply(this,arguments)}function x(){return(x=(0,a.default)((function*(e,t,n,r){var i;yield(0,h.logMacsInSnapshot)(e);const s=r.map((e=>({indexMac:e.indexMac,valueMac:e.valueMac,operation:e.operation}))),u=yield(0,h.computeLtHash)(e,s),c=(0,g.encryptedUploadMutationsToSyncActions)(r.filter((e=>e.operation===_.SyncdMutation$SyncdOperation.SET)),y.SyncActionState.Success),d=null!==(i=yield(0,l.getCollectionVersionInTransaction)(e).then((e=>null==e?void 0:e.version)))&&void 0!==i?i:0;t!==d+1&&(__LOG__(4,void 0,new Error,!0)`syncd: _uploadSuccessful: unexpected server version (${t}) after patch upload, expected ${d+1}`,SEND_LOGS("syncd: unexpected server version after patch upload")),__LOG__(2)`syncd: _uploadSuccessful: write to db for ${e}`,yield(0,o.runInTransaction)(["SyncActionStore","PendingMutationStore","CollectionVersionStore"],function(){var r=(0,a.default)((function*(r){let{SyncActionStore:i,PendingMutationStore:a,CollectionVersionStore:o}=r;yield i.bulkSet(c),yield a.bulkRemove(n),yield o.update(e,{version:t,ltHash:u})}));return function(){return r.apply(this,arguments)}}()),__LOG__(2)`syncd: end _uploadSuccessful for ${e}`}))).apply(this,arguments)}function B(){return F.apply(this,arguments)}function F(){return(F=(0,a.default)((function*(e,t,n,r){let i=Promise.resolve(),o=0;const s=(0,N.unixTimeMs)();if(null!=n){var l;const t=b.default.validateExternalBlobReference(e,n);o+=(0,d.numberOrThrowIfTooLarge)(null!==(l=t.fileSizeBytes)&&void 0!==l?l:0),__LOG__(2)`syncd: download snapshot for ${e}`,i=(0,O.downloadSnapshot)(e,t)}let u,c,p=Promise.resolve();if(null!=t&&t.length>0){const n=t.map((t=>b.default.validatePatchProtobuf(e,t)));p=Promise.all(n.map(function(){var t=(0,a.default)((function*(t){let n=t.mutations||[];const r=t.externalMutations;var i;r&&(__LOG__(2)`syncd: download patch for ${e}`,n=yield(0,O.downloadExternalPatch)(e,r),__LOG__(2)`syncd: ${e}'s external patch downloaded`,o+=(0,d.numberOrThrowIfTooLarge)(null!==(i=r.fileSizeBytes)&&void 0!==i?i:0));return{mutations:n,version:t.version,snapshotMac:t.snapshotMac,patchMac:t.patchMac,keyId:t.keyId,exitCode:t.exitCode,deviceIndex:t.deviceIndex}}));return function(){return t.apply(this,arguments)}}()))}try{[u,c]=yield Promise.all([i,p]),(0,m.isBootstrap)(r)&&(0,P.reportSyncdBootstrapAppStateDownloadMetric)({collection:e,downloadStartTs:s,downloadSize:o,isSuccess:"success"})}catch(t){throw(0,m.isBootstrap)(r)&&(0,P.reportSyncdBootstrapAppStateDownloadMetric)({collection:e,downloadStartTs:s,downloadSize:o,isSuccess:"failure"}),t}return[u,c]}))).apply(this,arguments)}function j(e){return{measuredComputeLtHashAndValidateSnapshot:function(){var t=(0,a.default)((function*(t,n){null==e||e.mark("anti_tampering_start",{source:y.SyncDataType.Snapshot});const r=yield(0,h.computeLtHashAndValidateSnapshot)(t,n);return null==e||e.mark("anti_tampering_end",{source:y.SyncDataType.Snapshot}),r}));return function(){return t.apply(this,arguments)}}(),measuredTryDecryptSnapshot:function(){var t=(0,a.default)((function*(t,n){null==e||e.mark("decryption_start",{source:y.SyncDataType.Snapshot});const r=yield(0,E.tryDecryptSnapshot)(t,n);return null==e||e.mark("decryption_end",{source:y.SyncDataType.Snapshot}),r}));return function(){return t.apply(this,arguments)}}()}}function Y(e){return{measuredComputeLtHashAndValidatePatch:function(){var t=(0,a.default)((function*(t,n,r){null==e||e.mark("anti_tampering_start",{source:y.SyncDataType.Patch});const i=yield(0,h.computeLtHashAndValidatePatch)(t,n,r);return null==e||e.mark("anti_tampering_end",{source:y.SyncDataType.Patch}),i}));return function(){return t.apply(this,arguments)}}(),measuredTryDecryptPatch:function(){var t=(0,a.default)((function*(t,n){null==e||e.mark("decryption_start",{source:y.SyncDataType.Patch});const r=yield(0,E.tryDecryptPatch)(t,n);return null==e||e.mark("decryption_end",{source:y.SyncDataType.Patch}),r}));return function(){return t.apply(this,arguments)}}()}}function K(){return H.apply(this,arguments)}function H(){return(H=(0,a.default)((function*(e,t,n,r){yield(0,h.logMacsInSnapshot)(e);try{const{measuredComputeLtHashAndValidateSnapshot:n,measuredTryDecryptSnapshot:i}=j(r);null==r||r.mark("apply_start",{source:y.SyncDataType.Snapshot,snapshotRecordsCount:t.records.length}),__LOG__(2)`syncd: start validate ${e}'s snapshot`;const s=yield n(e,t);__LOG__(2)`syncd: collection ${e}'s snapshot validated`;const l=yield i(e,t);__LOG__(2)`syncd: collection ${e}'s snapshot decrypted`,R.addMutationCount(t.records.length),(0,A.reportSyncdDecryptedMutations)(A.SyncdDecryptMutationsType.SNAPSHOT_MUTATIONS,l),(0,M.validateNoSameIndexForMultipleMutations)(e,l,y.SyncDataType.Snapshot);const u=t.version.version,{setMutationsToPersist:c,pendingMutationsToDrop:d}=yield Q(e,l,y.SyncDataType.Snapshot,r);__LOG__(2)`syncd: processed ${l.length} mutations in snapshot of collection ${e} v${u}`,__LOG__(2)`syncd: collection ${e}'s snapshot v${u} applied`,null==r||r.mark("update_DB_start",{source:y.SyncDataType.Snapshot,setMutationsToPersistCount:c.length,pendingMutationsToDropCount:d.length}),yield(0,o.runInTransaction)(["SyncActionStore","PendingMutationStore","CollectionVersionStore"],function(){var t=(0,a.default)((function*(t){let{SyncActionStore:n,PendingMutationStore:r,CollectionVersionStore:i}=t;yield n.bulkSet(c),yield r.bulkRemove(d),yield i.update(e,{version:u,ltHash:s})}));return function(){return t.apply(this,arguments)}}()),null==r||r.mark("update_DB_end",{source:y.SyncDataType.Snapshot}),__LOG__(2)`syncd: completed applying snapshot for ${e}`,null==r||r.mark("apply_end",{source:y.SyncDataType.Snapshot,decryptedMutationsCount:l.length})}catch(n){throw n instanceof S.SyncdMissingKeyError&&(yield(0,v.handleMissingKeysInSnapshot)(e,t)),n}n&&(null==r||r.mark("apply_start",{source:y.SyncDataType.Patch,patchCount:n.length}),yield $(e,n,r),null==r||r.mark("apply_end",{source:y.SyncDataType.Patch,patchCount:n.length}))}))).apply(this,arguments)}function W(){return V.apply(this,arguments)}function V(){return(V=(0,a.default)((function*(e){if(e>(0,o.getConfig)().syncdMaxMutationsToProcessDuringResume()){const t=Date.now();__LOG__(2)`syncd: patches have ${e} mutations, wait for UI unblock`,yield(0,o.getDbImpls)().handleSyncDelayApplyingPatchUntilUIUnblocks(),__LOG__(2)`syncd: UI is unblocked, waited for ${Date.now()-t}ms`}}))).apply(this,arguments)}function $(){return z.apply(this,arguments)}function z(){return(z=(0,a.default)((function*(e,t,n){if(0===t.length)return __LOG__(2)`syncd: no patches for collection ${e}`,Promise.resolve();(0,M.validateNoDuplicatePatchVersionInCollection)(e,t),t.sort(((e,t)=>e.version.version>t.version.version?1:-1));try{const r=t.reduce(((e,t)=>e+t.mutations.length),0);yield W(r);for(let r=0;r<t.length;r++)yield q(e,t[r],n)}catch(n){throw n instanceof S.SyncdMissingKeyError&&(yield(0,v.handleMissingKeysInPatches)(e,t)),n}}))).apply(this,arguments)}function q(){return J.apply(this,arguments)}function J(){return(J=(0,a.default)((function*(e,t,n){if(yield(0,h.logMacsInSnapshot)(e),t.exitCode){var r;const n=t.exitCode.code;switch(n){case 100:(0,C.reportSyncdFatalError)(C.SyncdFatalErrorType.TERMINAL_PATCH_MISSING_DATA,e);break;case 101:(0,C.reportSyncdFatalError)(C.SyncdFatalErrorType.TERMINAL_PATCH_DESERIALIZATION_ERROR,e);break;default:(0,C.reportSyncdFatalError)(C.SyncdFatalErrorType.TERMINAL_PATCH_UNKNOWN,e)}throw new S.SyncdFatalError(`received terminal patch with exit code: ${String(n)} text: ${String(null===(r=t.exitCode)||void 0===r?void 0:r.text)} `)}yield(0,o.getDbImpls)().handleSyncBeforeApplyPatch(t);const i=t.mutations.filter((e=>e.operation===_.SyncdMutation$SyncdOperation.SET)).length,l=t.mutations.length-i;__LOG__(2)`syncd: applying patch ${e} v${t.version.version} from device ${t.deviceIndex}
SET count: ${i}
REMOVE count: ${l}`,0===i&&0===l&&(__LOG__(3,void 0,void 0,!0)`syncd: ${e}: empty patch found`,SEND_LOGS(`syncd: ${e}: empty patch found`));const{measuredComputeLtHashAndValidatePatch:u,measuredTryDecryptPatch:d}=Y(n),p=yield u(e,t,(function(){return O.apply(this,arguments)}));__LOG__(2)`syncd: completed computeLtHashAndValidatePatch for ${e} v${t.version.version}`;const f=yield d(e,t);(0,A.reportSyncdDecryptedMutations)(A.SyncdDecryptMutationsType.PATCH_MUTATIONS,f),R.addMutationCount(f.length),(0,M.validateNoSameIndexForMultipleMutations)(e,f,y.SyncDataType.Patch);const g=ne(f),m=g.filter((e=>e.operation===_.SyncdMutation$SyncdOperation.REMOVE));yield Z(e,m),__LOG__(2)`syncd: completed _applyRemoveMutations for ${e} v${t.version.version}`;const E=g.filter((e=>e.operation===_.SyncdMutation$SyncdOperation.SET)),{setMutationsToPersist:T,pendingMutationsToDrop:v}=yield Q(e,E,y.SyncDataType.Patch,n);__LOG__(2)`syncd: processed ${f.length} mutations in patch version ${t.version.version} of collection ${e}`,null==n||n.mark("update_DB_start",{source:y.SyncDataType.Patch,setMutationsToPersistCount:T.length,pendingMutationsToDropCount:v.length});const P=t.version.version;function O(){return(O=(0,a.default)((function*(t){var n;return null===(n=(yield(0,c.getSyncActionsByCollectionsInTransaction)([e])).filter((e=>(0,s.arrayBuffersEqual)(t,e.indexMac))).pop())||void 0===n?void 0:n.valueMac}))).apply(this,arguments)}yield(0,o.runInTransaction)(["SyncActionStore","PendingMutationStore","CollectionVersionStore"],function(){var t=(0,a.default)((function*(t){let{SyncActionStore:n,PendingMutationStore:r,CollectionVersionStore:i}=t;yield n.bulkRemove(m.map((e=>e.index))),yield n.bulkSet(T),yield r.bulkRemove(v),yield i.update(e,{version:P,ltHash:p})}));return function(){return t.apply(this,arguments)}}()),null==n||n.mark("update_DB_end",{source:y.SyncDataType.Patch}),__LOG__(2)`syncd: completed final transaction in _applyPatch for ${e} v${t.version.version}`}))).apply(this,arguments)}function Q(){return X.apply(this,arguments)}function X(){return(X=(0,a.default)((function*(e,t,n,r){(0,A.reportSyncdCriticalBootstrapStage)(A.SyncdCriticalBootstrapStageType.ABOUT_TO_APPLY_MUTATIONS);const a=n===y.SyncDataType.Local?" (individual mutations)":"",o=[],s=(0,M.validateAndTypeSetMutations)(e,t),{supportedMutations:l,unsupportedMutations:u}=re(e,s);u.forEach((e=>o.push((0,g.setMutationToSyncAction)(e,y.SyncActionState.Unsupported)))),null==r||r.mark("conflict_resolution_start",{source:n,collectionName:e,count:l.length});const{remoteMutationsToApply:c,pendingMutationsToDrop:d}=yield(0,I.resolveConflict)(e,l),_=l.filter((e=>!c.includes(e)));null==r||r.mark("conflict_resolution_end",{source:n,collectionName:e,apply:c.length,drop:_.length}),_.forEach((e=>o.push((0,g.setMutationToSyncAction)(e,y.SyncActionState.Skipped,e.actionName)))),null==r||r.mark("apply_set_mutations_start",{source:n,collectionName:e,count:c.length});const h=ie(c);for(let t=0;t<h.length;t++){const n=h[t][0].actionHandler,r=h[t].map((e=>{let t;return t=e.binarySyncData?(0,p.default)((0,w.decodeProtobuf)(f.SyncActionDataSpec,e.binarySyncData).value,"decodeProtobuf(SyncActionDataSpec, m.binarySyncData).value"):(0,w.decodeProtobuf)(f.SyncActionValueSpec,e.binarySyncAction),{operation:"set",indexParts:e.indexArr,value:t,timestamp:e.timestamp}}));let i=[],s=!1;try{__LOG__(2)`syncd: before apply mutation batch for ${e}. mutations count: ${r.length} ${a}`,i=yield n.applyMutations(r,{setMutationsPendingToPersist:o,allSupportedSetMutations:c})}catch(t){if(t instanceof S.SyncdFatalError||e===y.CollectionName.CriticalBlock)throw t;s=!0,__LOG__(3)`synd: catching error during _applySetMutations: ${t}`}__LOG__(2)`syncd: after apply mutation batch for ${e} ${a}`;for(let e=0;e<h[t].length;e++){var m,E;const n=s?y.SyncActionState.Failed:i[e].actionState;o.push((0,g.setMutationToSyncAction)(h[t][e],n,h[t][e].actionName,s||null===(m=i[e].orphanModel)||void 0===m?void 0:m.modelId,s||null===(E=i[e].orphanModel)||void 0===E?void 0:E.modelType))}}const T=o.reduce(((e,t)=>{const n=t.actionState;return null==e[n]&&(e[n]=0),e[n]++,e}),{});return null==r||r.mark("apply_set_mutations_end",(0,i.default)({source:n,collectionName:e,count:c.length},T)),(0,A.reportSyncdCriticalBootstrapStage)(A.SyncdCriticalBootstrapStageType.APPLIED_MUTATIONS),__LOG__(2)`syncd: completed apply set mutations for ${e} ${a}`,{setMutationsToPersist:o,pendingMutationsToDrop:d}}))).apply(this,arguments)}function Z(){return ee.apply(this,arguments)}function ee(){return(ee=(0,a.default)((function*(e,t){const{supportedMutations:n}=te(t),r=ie(n);__LOG__(2)`syncd: before apply remove mutations for ${e}`;for(let t=0;t<r.length;t++){const n=r[t][0].actionHandler;yield n.applyMutations(r[t].map((t=>({operation:"remove",indexParts:ae(e,t.index)}))),{setMutationsPendingToPersist:[],allSupportedSetMutations:[]})}__LOG__(2)`syncd: after apply remove mutations for ${e}`}))).apply(this,arguments)}function te(e){const t=e.map((e=>{if(e.version>(0,T.maxSupportedVersion)())return{unsupported:e};const t=ae(e.collection,e.index),n=y.Actions.cast(t[0]);if(!n)return __LOG__(3)`syncd: invalid action ${t[0]}`,{unsupported:e};const r=(0,T.getActionHandler)(n);if(!r)return __LOG__(3)`syncd: no handler for action ${n}`,{unsupported:e};return{supported:{collection:e.collection,index:e.index,indexMac:e.indexMac,keyId:e.keyId,binarySyncData:e.binarySyncData,valueMac:e.valueMac,version:e.version,indexArr:t,actionName:n,actionHandler:r}}})),n=[],r=[];return t.map((e=>{let{supported:t,unsupported:i}=e;null!=t?n.push(t):null!=i&&r.push(i)})),{supportedMutations:n,unsupportedMutations:r}}function ne(e){const t=e.filter((e=>e.operation===_.SyncdMutation$SyncdOperation.SET)),n=new Set(t.map((e=>e.index)));return e.filter((e=>e.operation===_.SyncdMutation$SyncdOperation.REMOVE)).forEach((e=>{n.has(e.index)||t.push(e)})),t}function re(e,t){const n=t.map((t=>{if(t.version>(0,T.maxSupportedVersion)())return{unsupported:t};const n=ae(e,t.index),r=y.Actions.cast(n[0]);if(!r)return __LOG__(3)`syncd: invalid action ${n[0]}`,{unsupported:t};const i=(0,T.getActionHandler)(r);return i?{supported:{collection:t.collection,index:t.index,indexMac:t.indexMac,keyId:t.keyId,timestamp:t.timestamp,binarySyncData:t.binarySyncData,valueMac:t.valueMac,version:t.version,indexArr:n,actionName:r,actionHandler:i}}:(__LOG__(3)`syncd: no handler for action ${r}`,{unsupported:t})})),r=[],i=[];return n.map((e=>{let{supported:t,unsupported:n}=e;null!=t?r.push(t):null!=n&&i.push(n)})),{supportedMutations:r,unsupportedMutations:i}}function ie(e){return e.reduce(((e,t)=>(0!==e.length&&t.actionName===e[e.length-1][0].actionName?e[e.length-1].push(t):e.push([t]),e)),[])}function ae(e,t){try{const e=JSON.parse(t);if(e.length<1)throw new Error;return e}catch(t){throw(0,C.reportSyncdFatalError)(C.SyncdFatalErrorType.INVALID_ACTION_INDEX,e),new S.SyncdFatalError("invalid action index")}}},813757:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encryptedUploadMutationsToSyncActions=function(e,t){return e.map((e=>{const n=s(e.binarySyncAction);return{index:e.index,action:e.action,binarySyncData:n,actionState:t,version:e.version,keyId:e.keyId,indexMac:e.indexMac,valueMac:e.valueMac,collection:e.collection,timestamp:e.timestamp}}))},t.setMutationToSyncAction=function(e,t,n,r,i){return{index:e.index,binarySyncData:e.binarySyncData,version:e.version,keyId:e.keyId,indexMac:e.indexMac,valueMac:e.valueMac,collection:e.collection,timestamp:e.timestamp,action:n,actionState:t,modelId:r,modelType:null!=i?i:void 0}},t.syncActionToSyncData=s,t.syncActionsToDecryptedMutation=function(e){return e.map((e=>({collection:e.collection,index:e.index,action:e.action,indexMac:e.indexMac,keyId:e.keyId,operation:r.SyncdMutation$SyncdOperation.SET,binarySyncData:e.binarySyncData,valueMac:e.valueMac,version:e.version})))};var r=n(715739),i=n(370625),a=n(309512),o=n(653313);function s(e){const t=(0,a.decodeProtobuf)(i.SyncActionValueSpec,e);return(0,o.encodeProtobuf)(i.SyncActionDataSpec,{value:t}).readBuffer()}},157926:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(311504)),a=n(759998),o=n(155172),s=n(990445);class l{static loadStatesFromDb(){var e=this;return(0,i.default)((function*(){(yield(0,a.getAllCollectionVersionsInTransaction)()).forEach((t=>e.collectionStates.set(t.collection,{collection:t.collection,state:t.state,finiteFailureStartTime:t.finiteFailureStartTime})))}))()}static persistToDb(){const e=[];return this.collectionStates.forEach((t=>e.push(t))),__LOG__(2)`syncd: state machine persistToDb. states:`,e.forEach((e=>{const t=null==e.finiteFailureStartTime?"":`(failure start: ${e.finiteFailureStartTime})`;__LOG__(2)`syncd: ${e.collection}: ${e.state} ${t}`})),(0,a.bulkUpdateCollectionVersionInTransaction)(e)}static clean(){this.collectionStates=new Map}static getCollectionState(e){const t=this.collectionStates.get(e);return t?t.state:(this.moveCollectionsToUpToDate([e]),o.CollectionSyncState.UpToDate)}static getCollectionsInStateDirty(){const e=[];return this.collectionStates.forEach((t=>{t.state===o.CollectionSyncState.Dirty&&e.push(t.collection)})),e}static getCollectionsInStateRetry(){const e=[];return this.collectionStates.forEach((t=>{t.state===o.CollectionSyncState.FailingFiniteRetry&&e.push(t.collection)})),e}static getCollectionsInStateFatal(){const e=[];return this.collectionStates.forEach((t=>{t.state===o.CollectionSyncState.Fatal&&e.push(t.collection)})),e}static getCollectionsInStateBlocked(){const e=[];return this.collectionStates.forEach((t=>{t.state===o.CollectionSyncState.Blocked&&e.push(t.collection)})),e}static moveCollectionsToUpToDate(e){e.forEach((e=>this.collectionStates.set(e,{collection:e,state:o.CollectionSyncState.UpToDate,finiteFailureStartTime:void 0})))}static moveCollectionsToDirty(e){e.forEach((e=>{var t;return this.collectionStates.set(e,{collection:e,state:o.CollectionSyncState.Dirty,finiteFailureStartTime:null===(t=this.collectionStates.get(e))||void 0===t?void 0:t.finiteFailureStartTime})}))}static moveCollectionsToFiniteRetry(e){e.forEach((e=>{var t,n;return this.collectionStates.set(e,{collection:e,state:o.CollectionSyncState.FailingFiniteRetry,finiteFailureStartTime:null!==(t=null===(n=this.collectionStates.get(e))||void 0===n?void 0:n.finiteFailureStartTime)&&void 0!==t?t:(0,s.unixTimeMs)()})}))}static moveCollectionsToFatal(e){e.forEach((e=>this.collectionStates.set(e,{collection:e,state:o.CollectionSyncState.Fatal})))}static moveCollectionsToBlocked(e){e.forEach((e=>{var t;return this.collectionStates.set(e,{collection:e,state:o.CollectionSyncState.Blocked,finiteFailureStartTime:null===(t=this.collectionStates.get(e))||void 0===t?void 0:t.finiteFailureStartTime})}))}static getExpiredCollections(){const e=[];return this.collectionStates.forEach((t=>{if(t.state===o.CollectionSyncState.FailingFiniteRetry){let n;null==t.finiteFailureStartTime?(n=1/0,__LOG__(3)`Collection ${t.collection} is in finite retry state with no failure start time`):n=t.finiteFailureStartTime;n+o.FINITE_FAILURE_EXPIRY_DURATION<(0,s.unixTimeMs)()&&e.push(t.collection)}})),e}static getCollectionMinFailureTime(){const e=Array.from(this.collectionStates.values()).filter((e=>e.state===o.CollectionSyncState.FailingFiniteRetry)).map((e=>e.finiteFailureStartTime)).filter(Boolean);return 0===e.length?null:Math.min(...e)}}t.default=l,l.collectionStates=new Map},372896:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeExternalBlobReference=function(e,t){try{return(0,s.decodeProtobuf)(r.ExternalBlobReferenceSpec,t)}catch(t){throw(0,o.reportSyncdFatalError)(o.SyncdFatalErrorType.EXTERNAL_BLOB_REFERENCE_PROTOBUF_DESERIALIZATION_FAILED,e),new a.SyncdFatalError("external blob reference protobuf deserialization failed")}},t.decodeSyncActionData=function(e,t){try{return(0,s.decodeProtobuf)(i.SyncActionDataSpec,t)}catch(t){throw(0,o.reportSyncdFatalError)(o.SyncdFatalErrorType.ACTION_DATA_PROTOBUF_DESERIALIZATION_FAILED,e),new a.SyncdFatalError("action data protobuf deserialization failed")}},t.decodeSyncdMutations=function(e,t){try{return(0,s.decodeProtobuf)(r.SyncdMutationsSpec,t)}catch(t){throw(0,o.reportSyncdFatalError)(o.SyncdFatalErrorType.MUTATIONS_PROTOBUF_DESERIALIZATION_FAILED,e),new a.SyncdFatalError("mutations protobuf deserialization failed")}},t.decodeSyncdPatch=function(e,t){try{return(0,s.decodeProtobuf)(r.SyncdPatchSpec,t)}catch(t){throw(0,o.reportSyncdFatalError)(o.SyncdFatalErrorType.PATCH_PROTOBUF_DESERIALIZATION_FAILED,e),new a.SyncdFatalError("patch protobuf deserialization failed")}},t.decodeSyncdSnapshot=function(e,t){try{return(0,s.decodeProtobuf)(r.SyncdSnapshotSpec,t)}catch(t){throw(0,o.reportSyncdFatalError)(o.SyncdFatalErrorType.SNAPSHOT_PROTOBUF_DESERIALIZATION_FAILED,e),new a.SyncdFatalError("snapshot protobuf deserialization failed")}};var r=n(715739),i=n(370625),a=n(958177),o=n(493635),s=n(309512)},807091:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.tryDecryptPatch=function(){return m.apply(this,arguments)},t.tryDecryptSnapshot=function(){return g.apply(this,arguments)};var i=r(n(311504)),a=n(703177),o=n(715739),s=n(997835),l=n(301241),u=n(284642),c=n(372896),d=n(958177),p=n(3923),_=n(493635),f=r(n(277307));const h=new TextDecoder;function g(){return(g=(0,i.default)((function*(e,t){return yield Promise.all(t.records.map((t=>y(e,o.SyncdMutation$SyncdOperation.SET,t))))}))).apply(this,arguments)}function m(){return(m=(0,i.default)((function*(e,t){return yield Promise.all(t.mutations.map((t=>y(e,t.operation,t.record))))}))).apply(this,arguments)}function y(){return E.apply(this,arguments)}function E(){return(E=(0,i.default)((function*(e,t,n){const r=n.keyId.id,i=yield(0,p.getKeyData)(r);if(!i){if(t===o.SyncdMutation$SyncdOperation.REMOVE)throw new d.SyncdFatalError("no key data for remove mutations");throw new d.SyncdMissingKeyError}const{syncAction:a,indexMac:s,valueMac:l,indexValueBinary:u}=yield S(e,r,i,t,n),{index:c,version:_}=a;return{index:h.decode(c),action:null,version:_,keyId:r,operation:t,indexMac:s,valueMac:l,collection:e,binarySyncData:u}}))).apply(this,arguments)}function S(){return T.apply(this,arguments)}function T(){return(T=(0,i.default)((function*(e,t,n,r,i){const o=i.index.blob,p=i.value.blob,h=(0,s.valueMacFromIndexAndValueCipherText)(p),g=(0,u.split)(p,l.IV_LENGTH,p.byteLength-l.MAC_LENGTH-l.IV_LENGTH),m=g[0],y=g[1],E=g[2],S=yield(0,s.generateEncryptionKeys)(n),{indexKey:T,valueEncryptionKey:v,valueMacKey:A}=S,C=(0,u.combine)([m,y]),P=(0,s.generateAssociatedData)(r,t),O=yield(0,s.generateMac)(P,C,A);if(!(0,a.arrayBuffersEqual)(E,O))throw(0,_.reportSyncdFatalError)(_.SyncdFatalErrorType.DECRYPTION_FAILED,e),new d.SyncdFatalError("decryption failure: valueMAC mismatch");const I=yield(0,s.decryptCipherText)(new Uint8Array(m),v,y),M=(0,c.decodeSyncActionData)(e,I),b=f.default.validateSyncActionDataProtobuf(e,M),R=yield(0,s.generateIndexMac)(T,b.index);if(!(0,a.arrayBuffersEqual)(o,R))throw(0,_.reportSyncdFatalError)(_.SyncdFatalErrorType.DECRYPTION_FAILED,e),new d.SyncdFatalError("decryption failure: indexMAC mismatch");return{syncAction:b,indexMac:o,valueMac:h,indexValueBinary:I}}))).apply(this,arguments)}},439734:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.downloadExternalPatch=function(){return u.apply(this,arguments)},t.downloadSnapshot=function(){return l.apply(this,arguments)};var i=r(n(311504)),a=n(819416),o=n(372896),s=r(n(499189));function l(){return(l=(0,i.default)((function*(e,t){const n=yield(0,a.getDbImpls)().downloadSyncBlob(t,"snapshot",e),r=(0,o.decodeSyncdSnapshot)(e,n);return s.default.validateSnapshotProtobuf(e,r)}))).apply(this,arguments)}function u(){return(u=(0,i.default)((function*(e,t){const n=yield(0,a.getDbImpls)().downloadSyncBlob(t,"patch",e);return(0,o.decodeSyncdMutations)(e,n).mutations.map((t=>s.default.validateMutationProtobuf(e,t)))}))).apply(this,arguments)}},529904:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.resolveConflict=function(){return c.apply(this,arguments)};var i=r(n(311504)),a=n(171537),o=n(155172),s=n(161093);function l(){return u.apply(this,arguments)}function u(){return(u=(0,i.default)((function*(e,t){const n=yield Promise.all(e.map(function(){var e=(0,i.default)((function*(e){const n=t.get(e.index);if(n){const t=e.actionHandler;return{remoteMutationIndex:e.index,conflictResolutionState:yield t.resolveConflicts(n,e)}}}));return function(){return e.apply(this,arguments)}}())),r=new Map;return n.forEach((e=>{e&&r.set(e.remoteMutationIndex,e.conflictResolutionState)})),r}))).apply(this,arguments)}function c(){return(c=(0,i.default)((function*(e,t){const n=[];let r=[];const i=yield(0,a.getSyncPendingMutationsByCollectionInTransaction)(e),u=new Map(i.map((e=>[e.index,e]))),c=yield l(t,u);t.forEach((e=>{const t=c.get(e.index);if(t)switch(t){case o.ConflictResolutionState.SkipRemote:break;case o.ConflictResolutionState.ApplyRemoteAndDropLocal:n.push(e),r=r.concat(i.filter((t=>t.index===e.index)));break;case o.ConflictResolutionState.SkipRemoteAndDropLocal:r=r.concat(i.filter((t=>t.index===e.index)))}else n.push(e)}));const d=(0,s.sort)(n),p=[];for(let e=0;e<d.length;e++){const t=d[e].actionHandler;(yield t.dropMutationDueToCrossIndexConflict(d[e],u))||p.push(d[e])}return{remoteMutationsToApply:p,pendingMutationsToDrop:r.map((e=>e.id)).filter(Boolean)}}))).apply(this,arguments)}},161093:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t._setDependency=function(e,t){s.set(e,t)},t.sort=function(e){const t=[],n=[];try{return e.forEach((r=>{t.push(r);const i=s.get(r.actionName);null!=i&&e.forEach((e=>{e!==r&&i.includes(e.actionName)&&function(e,t){const n=e.actionHandler.getChatJidAndMessageKey(e),r=t.actionHandler.getChatJidAndMessageKey(t);if(n&&r)return n.chatJid===r.chatJid&&(null==n.messageKey||null==r.messageKey||n.messageKey===r.messageKey);return!1}(e,r)&&(e.timestamp<r.timestamp?n.push([e,r]):n.push([r,e]))}))})),o.default.array(t,n)}catch(e){throw(0,a.reportSyncdFatalError)(a.SyncdFatalErrorType.CYCLIC_MUTATION_DEPENDENCY_IN_PATCH),new i.SyncdFatalError("cyclic mutation dependency in patch")}};n(155172);var i=n(958177),a=n(493635),o=r(n(150944));const s=new Map},412922:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAndTypeSetMutations=function(e,t){return t.map((t=>{const n=(0,u.decodeProtobuf)(a.SyncActionDataSpec,t.binarySyncData).value;if(!n)throw(0,l.reportSyncdFatalError)(l.SyncdFatalErrorType.MISSING_ACTION_VALUE,e),new s.SyncdFatalError("missing action value");const i=(0,r.maybeNumberOrThrowIfTooLarge)(n.timestamp);if(null==i)throw(0,l.reportSyncdFatalError)(l.SyncdFatalErrorType.MISSING_ACTION_TIMESTAMP,e),new s.SyncdFatalError("missing action timestamp");return{index:t.index,version:t.version,keyId:t.keyId,indexMac:t.indexMac,valueMac:t.valueMac,collection:t.collection,binarySyncData:t.binarySyncData,timestamp:i}}))},t.validateNoDuplicatePatchVersionInCollection=function(e,t){const n=new Set;t.forEach((t=>{const r=t.version.version;if(n.has(r))throw(0,l.reportSyncdFatalError)(l.SyncdFatalErrorType.DUPLICATE_PATCH_VERSION_IN_COLLECTION,e),new s.SyncdFatalError("duplicate patch version in collection");n.add(r)}))},t.validateNoSameIndexForMultipleMutations=function(e,t,n){const r=new Set,a=new Set;t.forEach((t=>{let u=!1;if(t.operation===i.SyncdMutation$SyncdOperation.SET&&(r.has(t.index)?u=!0:r.add(t.index)),t.operation===i.SyncdMutation$SyncdOperation.REMOVE&&(a.has(t.index)?u=!0:a.add(t.index)),u)switch(n){case o.SyncDataType.Patch:throw(0,l.reportSyncdFatalError)(l.SyncdFatalErrorType.SAME_INDEX_FOR_MULTIPLE_MUTATIONS_IN_PATCH,e),new s.SyncdFatalError("same index for multiple mutations in patch");case o.SyncDataType.Snapshot:throw(0,l.reportSyncdFatalError)(l.SyncdFatalErrorType.SAME_INDEX_FOR_MULTIPLE_MUTATIONS_IN_SNAPSHOT,e),new s.SyncdFatalError("same index for multiple mutations in snapshot");case o.SyncDataType.Local:__LOG__(3)`validation not required for local mutations`}}))};var r=n(478337),i=n(715739),a=n(370625),o=n(155172),s=n(958177),l=n(493635),u=n(309512)},499189:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(478337),i=n(958177),a=n(682661),o=n(493635);class s{static validateSnapshotProtobuf(e,t){const{version:n,records:a,mac:l,keyId:u}=t,c=null==n?void 0:n.version;if(!n||null==c)throw(0,o.reportSyncdFatalError)(o.SyncdFatalErrorType.MISSING_SNAPSHOT_VERSION,e),new i.SyncdFatalError("missing snapshot version");const d=a.map((t=>s.validateRecordProtobuf(e,t)));if(!l)throw(0,o.reportSyncdFatalError)(o.SyncdFatalErrorType.MISSING_SNAPSHOT_MAC,e),new i.SyncdFatalError("missing snapshot mac");const p=s.validateKeyIdProtobuf(e,u,o.SyncdFatalErrorType.MISSING_SNAPSHOT_KEY_ID);return{version:{version:(0,r.numberOrThrowIfTooLarge)(c)},records:d,mac:l,keyId:p}}static validatePatchProtobuf(e,t){const{version:n,mutations:a,externalMutations:l,snapshotMac:u,patchMac:c,keyId:d,exitCode:p,deviceIndex:_}=t,f=null==n?void 0:n.version;if(!n||null==f)throw(0,o.reportSyncdFatalError)(o.SyncdFatalErrorType.MISSING_PATCH_VERSION,e),new i.SyncdFatalError("missing patch version");if(a&&a.length>0&&l)throw(0,o.reportSyncdFatalError)(o.SyncdFatalErrorType.PATCH_WITH_BOTH_INLINE_AND_EXTERNAL_MUTATIONS,e),new i.SyncdFatalError("patch with both inline and external mutations");if(!u)throw(0,o.reportSyncdFatalError)(o.SyncdFatalErrorType.MISSING_PATCH_SNAPSHOT_MAC,e),new i.SyncdFatalError("missing patch snapshot mac");if(!c)throw(0,o.reportSyncdFatalError)(o.SyncdFatalErrorType.MISSING_PATCH_MAC,e),new i.SyncdFatalError("missing patch mac");const h=s.validateKeyIdProtobuf(e,d,o.SyncdFatalErrorType.MISSING_PATCH_KEY_ID);if(l){const t=s.validateExternalBlobReference(e,l);return{version:{version:(0,r.numberOrThrowIfTooLarge)(f)},mutations:void 0,externalMutations:t,snapshotMac:u,patchMac:c,keyId:h,deviceIndex:_}}const g=a.map((t=>s.validateMutationProtobuf(e,t)));return{version:{version:(0,r.numberOrThrowIfTooLarge)(f)},mutations:g,externalMutations:void 0,exitCode:p,snapshotMac:u,patchMac:c,keyId:h,deviceIndex:_}}static validateExternalBlobReference(e,t){const{mediaKey:n,directPath:r,handle:a,fileSizeBytes:s,fileSha256:l,fileEncSha256:u}=t;if(!n)throw(0,o.reportSyncdFatalError)(o.SyncdFatalErrorType.MISSING_EXTERNAL_BLOB_REFERENCE_MEDIA_KEY,e),new i.SyncdFatalError("missing external blob reference media key");if(null==r)throw(0,o.reportSyncdFatalError)(o.SyncdFatalErrorType.MISSING_EXTERNAL_BLOB_REFERENCE_DIRECT_PATH,e),new i.SyncdFatalError("missing external blob reference direct path");if(!l)throw(0,o.reportSyncdFatalError)(o.SyncdFatalErrorType.MISSING_EXTERNAL_BLOB_REFERENCE_FILE_SHA256,e),new i.SyncdFatalError("missing external blob reference file SHA256");if(!u)throw(0,o.reportSyncdFatalError)(o.SyncdFatalErrorType.MISSING_EXTERNAL_BLOB_REFERENCE_FILE_ENC_SHA256,e),new i.SyncdFatalError("missing external blob reference file enc SHA256");return{mediaKey:n,directPath:r,handle:a,fileSizeBytes:s,fileSha256:l,fileEncSha256:u}}static validateMutationProtobuf(e,t){const{operation:n,record:r}=t;if(null==n)throw(0,o.reportSyncdFatalError)(o.SyncdFatalErrorType.MISSING_MUTATION_OPERATION,e),new i.SyncdFatalError("missing mutation operation");if(!r)throw(0,o.reportSyncdFatalError)(o.SyncdFatalErrorType.MISSING_MUTATION_RECORD,e),new i.SyncdFatalError("missing mutation record");return{operation:n,record:s.validateRecordProtobuf(e,r)}}static validateRecordProtobuf(e,t){const{index:n,value:r,keyId:a}=t,l=null==n?void 0:n.blob,u=null==r?void 0:r.blob;if(!n||!l)throw(0,o.reportSyncdFatalError)(o.SyncdFatalErrorType.MISSING_MUTATION_INDEX,e),new i.SyncdFatalError("missing mutation index");if(!r||!u)throw(0,o.reportSyncdFatalError)(o.SyncdFatalErrorType.MISSING_MUTATION_VALUE,e),new i.SyncdFatalError("missing mutation value");return{index:{blob:l},value:{blob:u},keyId:s.validateKeyIdProtobuf(e,a,o.SyncdFatalErrorType.MISSING_MUTATION_KEY_ID)}}static validateKeyIdProtobuf(e,t,n){const r=null==t?void 0:t.id;if(!t||!r)throw(0,o.reportSyncdFatalError)(n,e),new i.SyncdFatalError("missing mutation key id");return{id:(0,a.toSyncKeyId)(r)}}}t.default=s},277307:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(958177),i=n(493635);t.default=class{static validateSyncActionDataProtobuf(e,t){const{index:n,value:a,padding:o,version:s}=t;if(!n)throw(0,i.reportSyncdFatalError)(i.SyncdFatalErrorType.MISSING_ACTION_INDEX,e),new r.SyncdFatalError("missing action index");if(null==s)throw(0,i.reportSyncdFatalError)(i.SyncdFatalErrorType.MISSING_ACTION_VERSION,e),new r.SyncdFatalError("missing action version");return{index:n,value:a,padding:o,version:s}}}},997835:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decryptCipherText=function(e,t,n){return(0,i.aesCbcDecrypt)(t,e,n)},t.generateAssociatedData=function(e,t){const n=(0,d.fromSyncKeyId)(t);let r;switch(e){case s.SyncdMutation$SyncdOperation.SET:r=l.OPERATION_SET_HEX;break;case s.SyncdMutation$SyncdOperation.REMOVE:r=l.OPERATION_REMOVE_HEX}if(r){const e=new Uint8Array([parseInt(r,16)]).buffer,t=new Uint8Array(e.byteLength+n.byteLength);return t.set(new Uint8Array(e)),t.set(new Uint8Array(n),e.byteLength),t.buffer}throw new Error("invalid mutation operation value")},t.generateCipherText=function(e,t,n){return(0,i.aesCbcEncrypt)(t,n,e)},t.generateEncryptionKeys=void 0,t.generateIndexMac=function(e,t){return(0,a.hmacSha256)(new Uint8Array(e),new Uint8Array(t))},t.generateMac=function(e,t,n){const r=new Uint8Array(l.OCTET_LENGTH);r.set([e.byteLength],r.byteLength-1);const i=(0,c.combine)([e,t,r.buffer]);return(0,a.hmacSha512)(n,i,l.MAC_LENGTH)},t.generatePadding=function(e,t){const n=Math.max(0,l.MAX_OF_MIN_DATA_LENGTH-e-t),r=new Uint8Array(n);return self.crypto.getRandomValues(r),r.buffer},t.generatePatchMac=function(e,t,n,r,i){return(0,a.hmacSha256)(e,(0,c.combine)([t,...n,r,i]))},t.generateSnapshotMac=function(e,t,n,r){return(0,a.hmacSha256)(e,(0,c.combine)([t,n,r]))},t.valueMacFromIndexAndValueCipherText=function(e){const t=e.byteLength;return new Uint8Array(e).slice(t-l.MAC_LENGTH).buffer};var r=n(417405),i=n(826507),a=n(128326),o=n(406949),s=n(715739),l=n(301241),u=n(952031),c=n(284642),d=n(682661);const p=(0,o.memoizeWithArgs)(u.generateEncryptionKeysUnmemoized,(e=>(0,r.encodeB64)((0,d.fromSyncKeyData)(e))));t.generateEncryptionKeys=p},301241:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VALUE_MAC_KEY_LENGTH=t.VALUE_MAC_KEY_END=t.VALUE_ENCRYPTION_KEY_LENGTH=t.VALUE_ENCRYPTION_KEY_END=t.SNAPSHOT_MAC_KEY_LENGTH=t.SNAPSHOT_MAC_KEY_END=t.PATCH_MAC_KEY_LENGTH=t.PATCH_MAC_KEY_END=t.OPERATION_SET_HEX=t.OPERATION_REMOVE_HEX=t.OCTET_LENGTH=t.MAX_OF_MIN_DATA_LENGTH=t.MAC_LENGTH=t.IV_LENGTH=t.INDEX_KEY_LENGTH=t.INDEX_KEY_END=t.HKDF_INFO=t.EMPTY_MUTATION_MAC=t.DERIVED_KEY_LENGTH=void 0;t.HKDF_INFO="WhatsApp Mutation Keys";t.DERIVED_KEY_LENGTH=160;t.INDEX_KEY_LENGTH=32;t.VALUE_ENCRYPTION_KEY_LENGTH=32;t.VALUE_MAC_KEY_LENGTH=32;t.SNAPSHOT_MAC_KEY_LENGTH=32;t.PATCH_MAC_KEY_LENGTH=32;t.INDEX_KEY_END=32;t.VALUE_ENCRYPTION_KEY_END=64;t.VALUE_MAC_KEY_END=96;t.SNAPSHOT_MAC_KEY_END=128;t.PATCH_MAC_KEY_END=160;t.OPERATION_SET_HEX="0x01";t.OPERATION_REMOVE_HEX="0x02";t.MAX_OF_MIN_DATA_LENGTH=0;t.MAC_LENGTH=32;t.OCTET_LENGTH=8;t.IV_LENGTH=16;const n=new ArrayBuffer(32);t.EMPTY_MUTATION_MAC=n},952031:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.generateEncryptionKeysUnmemoized=function(){return l.apply(this,arguments)};var i=r(n(311504)),a=n(684659),o=n(301241),s=n(682661);function l(){return(l=(0,i.default)((function*(e){const t=yield u(e);return{indexKey:t.slice(0,o.INDEX_KEY_END),valueEncryptionKey:t.slice(o.INDEX_KEY_END,o.VALUE_ENCRYPTION_KEY_END),valueMacKey:t.slice(o.VALUE_ENCRYPTION_KEY_END,o.VALUE_MAC_KEY_END),snapshotMacKey:t.slice(o.VALUE_MAC_KEY_END,o.SNAPSHOT_MAC_KEY_END),patchMacKey:t.slice(o.SNAPSHOT_MAC_KEY_END,o.PATCH_MAC_KEY_END)}}))).apply(this,arguments)}function u(e){return(0,a.extractAndExpand)((0,s.fromSyncKeyData)(e),o.HKDF_INFO,o.DERIVED_KEY_LENGTH)}},284642:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayBufferToHexPadded=function(e){return Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join("")},t.combine=function(e){if(0===e.length)throw new Error("buffers length is zero");if(1===e.length)return e[0];const t=e.map((e=>e.byteLength)).reduce(((e,t)=>e+t)),n=new Uint8Array(t);let r,i=0;for(r=0;r<e.length;r++)n.set(new Uint8Array(e[r]),i),i+=e[r].byteLength;return n.buffer},t.hexToUint8Array=function(e){return Uint8Array.from(e.split(" ").map((e=>parseInt(e,16))))},t.split=function(e,t,n){if(t<0||n<0)throw new Error("buffers length is zero");const r=new Array(3),i=new Uint8Array(e);return r[0]=i.slice(0,t).buffer,r[1]=i.slice(t,t+n).buffer,r[2]=i.slice(t+n).buffer,r},t.syncKeyIdToHex=function(e){return Array.from(new Uint8Array((0,i.fromSyncKeyId)(e))).map((e=>e.toString(16))).toString().replace(/,/g," ")},t.syncKeyIdsEqual=function(e,t){return(0,r.arrayBuffersEqual)((0,i.fromSyncKeyId)(e),(0,i.fromSyncKeyId)(t))},t.to64BitNetworkOrder=function(e){const t=new ArrayBuffer(8);return new DataView(t).setUint32(4,e,!1),t},t.toUtf8=function(e){return a.encode(e)};var r=n(703177),i=n(682661);const a=new TextEncoder},531478:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.getKeysForKeyRequest=function(){return o.apply(this,arguments)};var i=r(n(311504)),a=n(865254);function o(){return(o=(0,i.default)((function*(e){const t=[],n=[];return yield Promise.all(e.map(function(){var e=(0,i.default)((function*(e){const r=yield(0,a.getSyncKeyInTransaction_DO_NOT_USE)(e);r?t.push(r):n.push(e)}));return function(){return e.apply(this,arguments)}}())),{keys:t,orphanKeys:n}}))).apply(this,arguments)}},371303:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.handleKeyShare=function(){return u.apply(this,arguments)};var i=r(n(311504)),a=n(865254),o=n(279385),s=n(284642),l=n(525178);function u(){return(u=(0,i.default)((function*(e,t){return t.some((e=>null!=e.fullKey))||__LOG__(2)`syncd: key share from device ${e} has no keys with keydata.`,yield Promise.all(t.map(function(){var t=(0,i.default)((function*(t){let{keyId:n,fullKey:r}=t;if(null==r)return;(yield(0,a.getSyncKeyInTransaction_DO_NOT_USE)(n))||(yield(0,a.setSyncKeyInTransaction)(r),__LOG__(2)`syncd: stored key share key id ${(0,s.syncKeyIdToHex)(n)} from device ${e}`)}));return function(){return t.apply(this,arguments)}}())),yield(0,l.updateMissingKeys)(t.map((e=>{let{keyId:t,fullKey:n}=e;return{keyId:t,keyData:null==n?void 0:n.keyData}})),e),(0,o.syncBlockedCollections)()}))).apply(this,arguments)}},558608:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.handleMissingKeysInPatches=function(){return f.apply(this,arguments)},t.handleMissingKeysInSnapshot=function(){return _.apply(this,arguments)},t.requestAllMissingKeys=function(){return m.apply(this,arguments)};var i=r(n(311504)),a=n(819416),o=n(773244),s=n(865254),l=(n(155172),n(284642)),u=n(958177),c=n(682661),d=n(525178);const p=(0,c.toSyncKeyId)(new ArrayBuffer(0));function _(){return(_=(0,i.default)((function*(e,t){const n=new Set,r=(yield(0,s.getAllSyncKeysInTransaction)()).map((e=>(0,l.syncKeyIdToHex)(e.keyId)));t.records.forEach((e=>{const t=e.keyId.id;if((0,l.syncKeyIdsEqual)(t,p))throw new u.SyncdFatalError("snapshot has empty key");const i=(0,l.syncKeyIdToHex)(t);r.includes(i)||n.add(i)})),__LOG__(2)`syncd: collection ${e}'s snapshot has missing keys ${Array.from(n)}`,yield h(n)}))).apply(this,arguments)}function f(){return(f=(0,i.default)((function*(e,t){const n=new Set,r=(yield(0,s.getAllSyncKeysInTransaction)()).map((e=>(0,l.syncKeyIdToHex)(e.keyId)));t.forEach((e=>{const t=e.keyId.id;if((0,l.syncKeyIdsEqual)(t,p))throw new u.SyncdFatalError("syncd: patch has empty key. patch device id: ${p.deviceIndex}");const i=(0,l.syncKeyIdToHex)(t);r.includes(i)||(__LOG__(2)`syncd: handleMissingKeysInPatches: missing key: keyId: ${i}, patch version: ${e.version.version}, patch device id: ${e.deviceIndex}`,n.add(i))})),__LOG__(2)`syncd: collection ${e}'s patches has missing keys ${Array.from(n)}`,yield h(n)}))).apply(this,arguments)}function h(){return g.apply(this,arguments)}function g(){return(g=(0,i.default)((function*(e){if("idle"!==(0,a.getConfig)().offlineProcessingState())return void __LOG__(2)`syncd: _handleMissingKeys: skipping due to resume from restart in progress`;const t=Array.from(e);__LOG__(2)`syncd: _handleMissingKeys: missing keys [${t}]`;const n=new Set((yield(0,o.bulkGetMissingKeysInTransaction)(t)).filter(Boolean).map((e=>e.keyHex))),r=t.filter((e=>!n.has(e)));if(__LOG__(2)`syncd: _handleMissingKeys: missing keys after filter: [${r}]`,0===r.length)return Promise.resolve();const i=r.map((e=>(0,c.toSyncKeyId)((0,l.hexToUint8Array)(e).buffer))),s=yield(0,a.getDbImpls)().sendSyncdKeyRequest(i);yield(0,d.addMissingKeys)(i,s)}))).apply(this,arguments)}function m(){return(m=(0,i.default)((function*(){const e=yield(0,o.getAllMissingKeysInTransaction)();__LOG__(2)`syncd: requestAllMissingKeys: missing keys: [${e.map((e=>e.keyHex))}]`,0!==e.length&&(yield(0,a.getDbImpls)().sendSyncdKeyRequest(e.map((e=>e.keyId))))}))).apply(this,arguments)}},3923:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.clearSyncKeysCache=function(){l=new Map},t.getKeyData=function(){return u.apply(this,arguments)};var i=r(n(311504)),a=n(417405),o=n(865254),s=n(682661);let l=new Map;function u(){return(u=(0,i.default)((function*(e){var t;const n=(0,a.encodeB64)((0,s.fromSyncKeyId)(e));let r=l.get(n);return r?r.keyData:(r=yield(0,o.getSyncKeyInTransaction_DO_NOT_USE)(e),r&&l.set(n,r),null===(t=r)||void 0===t?void 0:t.keyData)}))).apply(this,arguments)}},534202:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.getActiveKey=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return p.enqueue((()=>_(e)))},t.getNewestKeyPair=h;var i=r(n(311504)),a=n(819416),o=n(865254),s=n(316860),l=n(284642),u=n(577392),c=n(637463),d=n(517554);const p=new s.PromiseQueue;function _(){return f.apply(this,arguments)}function f(){return(f=(0,i.default)((function*(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=yield h(),n=yield(0,a.getDbImpls)().getDeviceFingerprint();let r=!1,i=!1;if(null!=t){if(r=(0,d.hasKeyExpired)(t),i=(0,d.hasADeviceBeenRemoved)(t,n),!e||!r&&!i)return{keyId:t.keyId,keyData:t.keyData}}else if(!e||(0,a.getConfig)().isCompanion())throw Error("syncd: No sync key available");const s=(0,d.rotateKey)(n,t);return __LOG__(2)`syncd: stored key rotation key id ${(0,l.syncKeyIdToHex)(s.keyId)}`,yield(0,o.setSyncKeyInTransaction)(s),yield(0,a.getDbImpls)().sendSyncdKeyRotation([s]),r&&(__LOG__(2)`syncd: key rotation due to key expiry`,(0,c.reportSyncdKeyRotationEvent)(c.SyncdKeyRotationEventType.APP_STATE_SYNC_KEY_EXPIRY)),i&&(__LOG__(2)`syncd: key rotation due to device removal`,(0,c.reportSyncdKeyRotationEvent)(c.SyncdKeyRotationEventType.DEVICE_DEREGISTERATION)),null==t&&(__LOG__(2)`syncd: key rotation due to no key present`,(0,c.reportSyncdKeyRotationEvent)(c.SyncdKeyRotationEventType.NO_KEYS)),_(e)}))).apply(this,arguments)}function h(){return g.apply(this,arguments)}function g(){return(g=(0,i.default)((function*(){const e=yield(0,o.getAllSyncKeysInTransaction)();if(0===e.length)return null;const t=e.map((e=>(0,u.getKeyEpoch)(e.keyId))),n=Math.max(...t),r=e.filter((e=>(0,u.getKeyEpoch)(e.keyId)===n)),i=r.map((e=>(0,u.getKeyDeviceId)(e.keyId))),a=Math.min(...i);return r[i.indexOf(a)]}))).apply(this,arguments)}},577392:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateNewKeyEpoch=function(e){return i(e)+1},t.getKeyDeviceId=function(e){return new DataView((0,r.fromSyncKeyId)(e)).getUint16(0)},t.getKeyEpoch=i;var r=n(682661);function i(e){return new DataView((0,r.fromSyncKeyId)(e)).getUint32(2)}},682661:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromSyncKeyData=function(e){return e},t.fromSyncKeyId=function(e){return e},t.toSyncKeyData=function(e){return e},t.toSyncKeyId=function(e){return e}},517554:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.hasADeviceBeenRemoved=function(e,t){const n=e.fingerprint,{rawId:r,currentIndex:i,deviceIndexes:a}=t,o=new Set(n.deviceIndexes);for(let e=n.currentIndex+1;e<=i;e++)o.add(e);return n.rawId!==r||!(0,d.default)(o,new Set(a))},t.hasKeyExpired=function(e){const t=e.timestamp,n=Math.min(90,Math.max(1,(0,a.getConfig)().syncdKeyMaxUseDays()));return(0,c.unixTimeMs)()-t>n*c.DAY_MILLISECONDS},t.rotateKey=function(e,t){const{keyId:n,keyEpoch:r}=function(e){let t;if(null==e){const e=new Uint8Array(16);self.crypto.getRandomValues(e),t=(0,l.generateNewKeyEpoch)((0,u.toSyncKeyId)(e.buffer))}else t=(0,l.generateNewKeyEpoch)(e.keyId);const n=(0,s.interpretAsNumber)((0,s.extractDeviceId)((0,a.getMyDeviceJid)()));return{keyId:(0,u.toSyncKeyId)(new Uint8Array((0,i.concatArrayBuffers)((0,o.intToBytes)(2,n).buffer,(0,o.intToBytes)(4,t).buffer)).buffer),keyEpoch:t}}(t),d=(0,u.toSyncKeyData)(self.crypto.getRandomValues(new Uint8Array(32)).buffer),p=(0,c.unixTimeMs)();return{keyId:n,keyEpoch:r,keyData:d,fingerprint:e,timestamp:p}};var i=n(145335),a=n(819416),o=n(215373),s=n(616310),l=n(577392),u=n(682661),c=n(990445),d=r(n(900628))},525178:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.addMissingKeys=function(){return A.apply(this,arguments)},t.hasExpiredKeys=E,t.setMissingKeyTimeoutInTransaction=f,t.updateMissingKeyDevices=function(){return _.apply(this,arguments)},t.updateMissingKeys=function(e,t){const n=[],r=[];return e.forEach((e=>{const t=e.keyData,i=(0,u.syncKeyIdToHex)(e.keyId);t?n.push(i):r.push(i)})),__LOG__(2)`syncd: updateMissingKeys from device ${t}
\tkeys with keyData: ${n}
\tkeys without keyData: ${r}`,(0,o.runInTransaction)(["MissingKeyStore"],function(){var e=(0,i.default)((function*(e){let{MissingKeyStore:i}=e;if(n.length>0&&(yield i.bulkRemove(n),yield h({MissingKeyStore:i})),r.length>0){const e=(yield i.bulkGet(r)).filter(Boolean);e.forEach((e=>e.deviceResponses.set(t,!1))),__LOG__(2)`syncd: updateMissingKeys: begin updating missing keys from device ${t}
\tmissingKeys: [${r}]`,yield i.bulkUpdate(e),__LOG__(2)`syncd: updateMissingKeys: finish updating missing keys from device ${t}`,yield T({MissingKeyStore:i})}}));return function(){return e.apply(this,arguments)}}())};var i=r(n(311504)),a=n(583159),o=n(819416),s=n(773244),l=n(865254),u=n(284642),c=n(493635),d=n(990445);let p;function _(){return(_=(0,i.default)((function*(){const e=(yield(0,o.getDbImpls)().getDeviceFingerprint()).deviceIndexes;return(0,o.runInTransaction)(["MissingKeyStore"],function(){var t=(0,i.default)((function*(t){let{MissingKeyStore:n}=t;const r=yield n.getAll();if(0===r.length)return Promise.resolve();r.forEach((t=>{t.deviceResponses.forEach(((n,r)=>{e.includes(r)||t.deviceResponses.delete(r)}))})),yield n.bulkUpdate(r),yield T({MissingKeyStore:n})}));return function(){return t.apply(this,arguments)}}())}))).apply(this,arguments)}function f(){return(0,o.runInTransaction)(["MissingKeyStore"],(e=>{let{MissingKeyStore:t}=e;return h({MissingKeyStore:t})}))}function h(){return g.apply(this,arguments)}function g(){return(g=(0,i.default)((function*(e){let{MissingKeyStore:t}=e;clearTimeout(p),p=null;const n=yield t.getAll();if(0===n.length)return;__LOG__(2)`syncd: _setMissingKeyTimeout: missing keys: ${n.map((e=>(0,u.syncKeyIdToHex)(e.keyId)))}`;const r=n.reduce(((e,t)=>e.timestamp<t.timestamp?e:t)),i=(0,o.getConfig)().syncdWaitForKeyTimeoutDays()*d.DAY_MILLISECONDS-(-r.timestamp+(0,d.unixTimeMs)());__LOG__(2)`syncd: earliest missing key: ${(0,u.syncKeyIdToHex)(r.keyId)}, timestamp=${r.timestamp}, timeoutMs=${i}`,p=setTimeout(m,i)}))).apply(this,arguments)}function m(){return y.apply(this,arguments)}function y(){return(y=(0,i.default)((function*(){__LOG__(2)`syncd: _timeoutWhileWaitingForMissingKey`,(yield E())?((0,c.reportSyncdFatalError)(c.SyncdFatalErrorType.TIMEOUT_WHILE_WAITING_FOR_MISSING_KEY),__LOG__(4,void 0,new Error,!0)`syncd: fatal error: timeout while waiting for missing key`,SEND_LOGS("syncd fatal error: timeout while waiting for missing key"),(0,o.getDbImpls)().handleSyncdFatal()):__LOG__(2)`syncd: _timeoutWhileWaitingForMissingKey: no expired keys`}))).apply(this,arguments)}function E(){return S.apply(this,arguments)}function S(){return(S=(0,i.default)((function*(){__LOG__(2)`syncd: check if has expired keys`;const e=(yield(0,l.getAllSyncKeysInTransaction)()).map((e=>(0,u.syncKeyIdToHex)(e.keyId)));__LOG__(2)`syncd: all keys: ${e}`;const t=yield(0,s.getAllMissingKeysInTransaction)();__LOG__(2)`syncd: missing keys: ${t.map((e=>(0,u.syncKeyIdToHex)(e.keyId)))}`;const n=t.filter((t=>!e.includes(t.keyHex)));__LOG__(2)`syncd: actually missing keys: ${t.map((e=>(0,u.syncKeyIdToHex)(e.keyId)))}`;const r=n.filter((e=>(0,o.getConfig)().syncdWaitForKeyTimeoutDays()*d.DAY_MILLISECONDS<(0,d.unixTimeMs)()-e.timestamp));return __LOG__(2)`syncd: expired keys: ${r.map((e=>(0,u.syncKeyIdToHex)(e.keyId)))}`,r.length>0}))).apply(this,arguments)}function T(){return v.apply(this,arguments)}function v(){return(v=(0,i.default)((function*(e){let{MissingKeyStore:t}=e;const n=yield t.getAll();for(const e of n){let t=!0;for(const n of e.deviceResponses.values())if(null==n){t=!1;break}if(t)return __LOG__(4,void 0,new Error,!0)`syncd: fatal error: missing key on all clients`,SEND_LOGS("syncd: fatal error: missing key on all clients"),(0,c.reportSyncdFatalError)(c.SyncdFatalErrorType.MISSING_KEY_ON_ALL_CLIENTS),yield(0,a.asyncSleep)(5e3),void(0,o.getDbImpls)().handleSyncdFatal()}}))).apply(this,arguments)}function A(){return(A=(0,i.default)((function*(e,t){const n=()=>{const e=new Map;return t.forEach((t=>e.set(t,null))),e},r=e.map((e=>({keyHex:(0,u.syncKeyIdToHex)(e),keyId:e,timestamp:(0,d.unixTimeMs)(),deviceResponses:n()})));yield(0,s.bulkUpdateMissingKeysInTransaction)(r),yield f()}))).apply(this,arguments)}},43959:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SyncdDecryptMutationsType=t.SyncdCriticalBootstrapStageType=void 0,t.convertSyncdCriticalBootstrapStageFromAnnotations=function(e){var t;const n=null==e||null===(t=e.string)||void 0===t?void 0:t.criticalBootstrapStage;if(null==n)return __LOG__(4,void 0,new Error)`syncd: missing bootstrap stage for critical bootstrap stage`,null;const r=s.cast(n);if(null==r)return __LOG__(4,void 0,new Error)`syncd: unknown bootstrap stage: ${n} for critical bootstrap stage`,null;return{type:r}},t.convertSyncdDecryptMutationsMetricsFromAnnotations=function(e){var t,n,r,i;const a=null==e||null===(t=e.string)||void 0===t?void 0:t.mutationType,o=null==e||null===(n=e.int)||void 0===n?void 0:n.count,s=null==e||null===(r=e.int)||void 0===r?void 0:r.totalAdditionalMessagesCount,u=null==e||null===(i=e.int_array)||void 0===i?void 0:i.messageRangeLengths;if(null==a)return __LOG__(4,void 0,new Error)`syncd: missing type for DecryptMutations`,null;if(null==o)return __LOG__(4,void 0,new Error)`syncd: missing count for DecryptMutations`,null;if(null==s)return __LOG__(4,void 0,new Error)`syncd: missing totalAdditionalMessagesCount for DecryptMutations`,null;if(null==u)return __LOG__(4,void 0,new Error)`syncd: missing decryptedMutationMessageRangeCountArray for DecryptMutations`,null;const c=l.cast(a);if(null==c)return __LOG__(4,void 0,new Error)`syncd: unknown SyncdDecryptMutationsType for DecryptMutations`,null;return{type:c,count:o,totalAdditionalMessagesCount:s,decryptedMutationMessageRangeCountArray:u}},t.reportSyncdCriticalBootstrapStage=u,t.reportSyncdDecryptedMutations=function(e,t){u(s.MUTATIONS_DECRYPTED),(0,i.startMetric)(r.PRE_METRIC.SYNCD_DECRYPT_MUTATIONS).endSuccess(function(e){const{type:t,mutations:n}=e;let r,i=0;const s=[];return n.forEach((e=>{const{binarySyncData:t}=e,n=(0,o.decodeProtobuf)(a.SyncActionDataSpec,t).value;null!=n&&(n.archiveChatAction?r=n.archiveChatAction.messageRange:n.markChatAsReadAction?r=n.markChatAsReadAction.messageRange:n.clearChatAction?r=n.clearChatAction.messageRange:n.deleteChatAction&&(r=n.deleteChatAction.messageRange),null!=r&&(i+=r.messages.length,s.push(r.messages.length)))})),{string:{mutationType:t},int:{count:n.length,totalAdditionalMessagesCount:i},int_array:{messageRangeLengths:s}}}({type:e,mutations:t}))};var r=n(755907),i=n(865979),a=n(370625),o=n(309512);const s=n(654302)({ABOUT_TO_APPLY_MUTATIONS:"ABOUT_TO_APPLY_MUTATIONS",APPLIED_MUTATIONS:"APPLIED_MUTATIONS",MUTATIONS_DECRYPTED:"MUTATIONS_DECRYPTED",REQUEST_BUILT:"REQUEST_BUILT",RESPONSE_RECEIVED:"RESPONSE_RECEIVED",RESPONSE_PARSED_VALID:"RESPONSE_PARSED_VALID",ENTERED_RETRY_MODE:"ENTERED_RETRY_MODE",MISSING_KEYS_RECEIVED:"MISSING_KEYS_RECEIVED"});t.SyncdCriticalBootstrapStageType=s;const l=n(654302)({PATCH_MUTATIONS:"PATCH_MUTATIONS",SNAPSHOT_MUTATIONS:"SNAPSHOT_MUTATIONS"});function u(e){(0,i.startMetric)(r.PRE_METRIC.SYNCD_CRITICAL_BOOTSTRAP_STAGE).endSuccess({string:{criticalBootstrapStage:{type:e}.type}})}t.SyncdDecryptMutationsType=l},493635:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SyncdFatalErrorType=void 0,t.convertSyncdFatalErrorFromAnnotations=function(e){var t,n,r,i,s;const l=null==e||null===(t=e.string)||void 0===t?void 0:t.errorCode;if(null==l)return __LOG__(4,void 0,new Error)`syncd: missing error code for syncd fatal error`,null;const u=o.cast(l);if(null==u)return __LOG__(4,void 0,new Error)`syncd: unknown error code: ${l} for syncd fatal error`,null;return{type:u,collection:a.CollectionName.cast(null==e||null===(n=e.string)||void 0===n?void 0:n.collection),patchSnapshotMutationCount:null==e||null===(r=e.int)||void 0===r?void 0:r.patchSnapshotMutationCount,patchVersion:null==e||null===(i=e.int)||void 0===i?void 0:i.patchVersion,isFatal:null==e||null===(s=e.bool)||void 0===s?void 0:s.isFatal}},t.reportSyncdFatalError=function(e,t,n,a,o){(0,i.startMetric)(r.PRE_METRIC.SYNCD_FATAL_ERROR).endFail("syncd fatal error: "+e,function(e){const{type:t,collection:n,patchSnapshotMutationCount:r,patchVersion:i,isFatal:a}=e;return{string:{errorCode:t,collection:null==n?null:n},int:{patchSnapshotMutationCount:r,patchVersion:i},bool:{isFatal:a}}}({type:e,collection:t,patchSnapshotMutationCount:n,patchVersion:a,isFatal:o}))};var r=n(755907),i=n(865979),a=n(155172);const o=n(654302)({PATCH_PROTOBUF_SERIALIZATION_FAILED:"PATCH_PROTOBUF_SERIALIZATION_FAILED",MUTATIONS_PROTOBUF_SERIALIZATION_FAILED:"MUTATIONS_PROTOBUF_SERIALIZATION_FAILED",ACTION_DATA_PROTOBUF_SERIALIZATION_FAILED:"ACTION_DATA_PROTOBUF_SERIALIZATION_FAILED",ENCRYPTION_FAILED:"ENCRYPTION_FAILED",MISSING_SNAPSHOT_VERSION:"MISSING_SNAPSHOT_VERSION",MISSING_SNAPSHOT_MAC:"MISSING_SNAPSHOT_MAC",MISSING_SNAPSHOT_KEY_ID:"MISSING_SNAPSHOT_KEY_ID",MISSING_PATCH_VERSION:"MISSING_PATCH_VERSION",PATCH_WITH_BOTH_INLINE_AND_EXTERNAL_MUTATIONS:"PATCH_WITH_BOTH_INLINE_AND_EXTERNAL_MUTATIONS",MISSING_PATCH_SNAPSHOT_MAC:"MISSING_PATCH_SNAPSHOT_MAC",MISSING_PATCH_MAC:"MISSING_PATCH_MAC",MISSING_PATCH_KEY_ID:"MISSING_PATCH_KEY_ID",MISSING_EXTERNAL_BLOB_REFERENCE_MEDIA_KEY:"MISSING_EXTERNAL_BLOB_REFERENCE_MEDIA_KEY",MISSING_EXTERNAL_BLOB_REFERENCE_DIRECT_PATH:"MISSING_EXTERNAL_BLOB_REFERENCE_DIRECT_PATH",MISSING_EXTERNAL_BLOB_REFERENCE_FILE_SHA256:"MISSING_EXTERNAL_BLOB_REFERENCE_FILE_SHA256",MISSING_EXTERNAL_BLOB_REFERENCE_FILE_ENC_SHA256:"MISSING_EXTERNAL_BLOB_REFERENCE_FILE_ENC_SHA256",MISSING_MUTATION_OPERATION:"MISSING_MUTATION_OPERATION",MISSING_MUTATION_RECORD:"MISSING_MUTATION_RECORD",MISSING_MUTATION_INDEX:"MISSING_MUTATION_INDEX",MISSING_MUTATION_VALUE:"MISSING_MUTATION_VALUE",MISSING_MUTATION_KEY_ID:"MISSING_MUTATION_KEY_ID",EXTERNAL_BLOB_REFERENCE_PROTOBUF_DESERIALIZATION_FAILED:"EXTERNAL_BLOB_REFERENCE_PROTOBUF_DESERIALIZATION_FAILED",SNAPSHOT_PROTOBUF_DESERIALIZATION_FAILED:"SNAPSHOT_PROTOBUF_DESERIALIZATION_FAILED",PATCH_PROTOBUF_DESERIALIZATION_FAILED:"PATCH_PROTOBUF_DESERIALIZATION_FAILED",MUTATIONS_PROTOBUF_DESERIALIZATION_FAILED:"MUTATIONS_PROTOBUF_DESERIALIZATION_FAILED",ACTION_DATA_PROTOBUF_DESERIALIZATION_FAILED:"ACTION_DATA_PROTOBUF_DESERIALIZATION_FAILED",MISSING_ACTION_INDEX:"MISSING_ACTION_INDEX",MISSING_ACTION_VERSION:"MISSING_ACTION_VERSION",SNAPSHOT_MAC_MISMATCH_IN_SNAPSHOT:"SNAPSHOT_MAC_MISMATCH_IN_SNAPSHOT",SNAPSHOT_MAC_MISMATCH_IN_PATCH:"SNAPSHOT_MAC_MISMATCH_IN_PATCH",MAC_MISMATCH_PATCH:"MAC_MISMATCH_PATCH",DECRYPTION_FAILED:"DECRYPTION_FAILED",DUPLICATE_PATCH_VERSION_IN_COLLECTION:"DUPLICATE_PATCH_VERSION_IN_COLLECTION",SAME_INDEX_FOR_MULTIPLE_MUTATIONS_IN_PATCH:"SAME_INDEX_FOR_MULTIPLE_MUTATIONS_IN_PATCH",SAME_INDEX_FOR_MULTIPLE_MUTATIONS_IN_SNAPSHOT:"SAME_INDEX_FOR_MULTIPLE_MUTATIONS_IN_SNAPSHOT",MISSING_ACTION_VALUE:"MISSING_ACTION_VALUE",MISSING_ACTION_TIMESTAMP:"MISSING_ACTION_TIMESTAMP",XMPP_BAD_REQUEST_FOR_COLLECTION:"XMPP_BAD_REQUEST_FOR_COLLECTION",XMPP_NOT_FOUND_FOR_COLLECTION:"XMPP_NOT_FOUND_FOR_COLLECTION",CYCLIC_MUTATION_DEPENDENCY_IN_PATCH:"CYCLIC_MUTATION_DEPENDENCY_IN_PATCH",SERVER_DID_NOT_SEND_ALL_PATCHES:"SERVER_DID_NOT_SEND_ALL_PATCHES",TERMINAL_PATCH_MISSING_DATA:"TERMINAL_PATCH_MISSING_DATA",TERMINAL_PATCH_DESERIALIZATION_ERROR:"TERMINAL_PATCH_DESERIALIZATION_ERROR",TERMINAL_PATCH_UNKNOWN:"TERMINAL_PATCH_UNKNOWN",INVALID_ACTION_INDEX:"INVALID_ACTION_INDEX",XMPP_BAD_REQUEST_GLOBAL_ERROR:"XMPP_BAD_REQUEST_GLOBAL_ERROR",XMPP_NOT_FOUND_GLOBAL_ERROR:"XMPP_NOT_FOUND_GLOBAL_ERROR",XMPP_BAD_METHOD_GLOBAL_ERROR:"XMPP_BAD_METHOD_GLOBAL_ERROR",XMPP_NOT_ACCEPTABLE_GLOBAL_ERROR:"XMPP_NOT_ACCEPTABLE_GLOBAL_ERROR",TOO_MANY_INTERNAL_SERVER_ERRORS_IN_7D:"TOO_MANY_INTERNAL_SERVER_ERRORS_IN_7D",TIMEOUT_WHILE_WAITING_FOR_MISSING_KEY:"TIMEOUT_WHILE_WAITING_FOR_MISSING_KEY",MISSING_KEY_ON_ALL_CLIENTS:"MISSING_KEY_ON_ALL_CLIENTS"});t.SyncdFatalErrorType=o},637463:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SyncdKeyRotationEventType=t.SyncdEventFlow=t.SyncdCriticalEventType=t.SyncdBootstrapDataAppliedSnapshotUsed=void 0,t.constructAnnotationsFromContext=c,t.convertSyncdBootstrapAppStateDownloadFromAnnotations=function(e){var t,n,r,i;const o=null==e||null===(t=e.string)||void 0===t?void 0:t.collection,s=null==e||null===(n=e.int)||void 0===n?void 0:n.downloadSize,l=null==e||null===(r=e.int)||void 0===r?void 0:r.downloadStartTs,u=null==e||null===(i=e.bool)||void 0===i?void 0:i.isSuccess;if(null==o)return __LOG__(4,void 0,new Error)`syncd: missing collection for bootstrap app state download metric`,null;if(null==l)return __LOG__(4,void 0,new Error)`syncd: missing downloadStartTs for bootstrap app state download metric`,null;if(null==u)return __LOG__(4,void 0,new Error)`syncd: missing isSuccess for bootstrap app state download metric`,null;const c=a.CollectionName.cast(o);if(null==c)return __LOG__(4,void 0,new Error)`syncd: unknown collection ${o} for bootstrap app state download metric`,null;return{collection:c,downloadStartTs:l,downloadSize:s,isSuccess:u?"success":"failure"}},t.convertSyncdBootstrapDataAppliedFromAnnotations=function(e){var t,n,r;const i=null==e||null===(t=e.string)||void 0===t?void 0:t.collection,o=null==e||null===(n=e.bool)||void 0===n?void 0:n.snapshot,l=null==e||null===(r=e.int)||void 0===r?void 0:r.durationMs;if(null==i)return __LOG__(4,void 0,new Error)`syncd: missing collection for bootstrap data applied event`,null;if(null==o)return __LOG__(4,void 0,new Error)`syncd: missing snapshotUsed for bootstrap data applied event`,null;if(null==l)return __LOG__(4,void 0,new Error)`syncd: missing durationMs for bootstrap data applied event`,null;const u=a.CollectionName.cast(i);if(null==u)return __LOG__(4,void 0,new Error)`syncd: unknown collection ${i} for bootstrap data applied event`,null;const c=o?s.SNAPSHOT_USED:s.SNAPSHOT_NOT_USED;return{collection:u,snapshotUsed:c,durationMs:l}},t.convertSyncdCriticalEventFromAnnotations=function(e){var t,n;const r=null==e||null===(t=e.string)||void 0===t?void 0:t.criticalEventCode;if(null==r)return __LOG__(4,void 0,new Error)`syncd: missing error code for critical event`,null;const i=o.cast(r);if(null==i)return __LOG__(4,void 0,new Error)`syncd: unknown error code: ${r} for critical event`,null;return{type:i,collection:a.CollectionName.cast(null==e||null===(n=e.string)||void 0===n?void 0:n.collection)}},t.convertSyncdKeyRotationEventFromAnnotations=function(e){var t;const n=null==e||null===(t=e.string)||void 0===t?void 0:t.keyRotationEventCode;if(null==n)return __LOG__(4,void 0,new Error)`syncd: missing error code for key rotation event`,null;const r=l.cast(n);if(null==r)return __LOG__(4,void 0,new Error)`syncd: unknown error code: ${n} for key rotation event`,null;return{type:r}},t.reportSyncdBootstrapAppStateDownloadMetric=function(e){const t=(0,i.startMetric)(r.PRE_METRIC.SYNCD_BOOTSTRAP_APP_STATE_DOWNLOAD);"success"!==e.isSuccess?t.endFail("syncd error: Error downloading snapshot or patches",u(e)):t.endSuccess(u(e))},t.reportSyncdBootstrapDataApplied=function(e,t,n){(0,i.startMetric)(r.PRE_METRIC.SYNCD_BOOTSTRAP_DATA_APPLIED).endSuccess((a={collection:e,snapshotUsed:t,durationMs:n},{string:{collection:a.collection},bool:{snapshot:a.snapshotUsed===s.SNAPSHOT_USED},int:{durationMs:a.durationMs}}));var a},t.reportSyncdCriticalEvent=function(e,t){(0,i.startMetric)(r.PRE_METRIC.SYNCD_CRITICAL_EVENT).endFail("syncd critical event: "+e,(n={type:e,collection:t},{string:{criticalEventCode:n.type,collection:null==n.collection?null:n.collection}}));var n},t.reportSyncdKeyRotationEvent=function(e){(0,i.startMetric)(r.PRE_METRIC.SYNCD_KEY_ROTATION).endSuccess((t={type:e},{string:{keyRotationEventCode:t.type}}));var t};var r=n(755907),i=n(865979),a=n(155172);const o=n(654302)({MISSING_MUTATION_TO_REMOVE:"MISSING_MUTATION_TO_REMOVE"});t.SyncdCriticalEventType=o;const s=n(654302)({SNAPSHOT_USED:"SNAPSHOT_USED",SNAPSHOT_NOT_USED:"SNAPSHOT_NOT_USED"});t.SyncdBootstrapDataAppliedSnapshotUsed=s;const l=n(654302)({APP_STATE_SYNC_KEY_EXPIRY:"APP_STATE_SYNC_KEY_EXPIRY",DEVICE_DEREGISTERATION:"DEVICE_DEREGISTERATION",NO_KEYS:"NO_KEYS"});function u(e){const{collection:t,downloadSize:n,downloadStartTs:r,isSuccess:i}=e;return{string:{collection:t},int:{downloadSize:n,downloadStartTs:r},bool:{isSuccess:"success"===i}}}function c(e){const t={};return Object.keys(e).forEach((n=>{"number"==typeof e[n]?(null==t.int&&(t.int={}),t.int[n]=e[n]):"string"==typeof e[n]&&(null==t.string&&(t.string={}),t.string[n]=e[n])})),Object.keys(t).length>0?t:void 0}t.SyncdKeyRotationEventType=l;t.SyncdEventFlow=class{constructor(){this.event=(0,i.startMetric)(r.PRE_METRIC.SYNCD)}end(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]?this.event.endFail("syncd failed"):this.event.endSuccess()}mark(e,t){this.event.addPoint(e,c(t))}}},573166:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.addKeyRotationRemoveCount=function(e){if(0===e)return;l.keyRotationRemoveCount+=e,d()},t.addMutationCount=function(e){if(0===e)return;l.mutationCount+=e,d()},t.addUnsetActionCount=function(e){if(0===e)return;l.unsetActionCount+=e,d()},t.clear=c,t.convertAppStateSyncDailyFromAnnotations=function(e){var t,n,r,i,a,o,s,l;return{mutationCount:(null==e||null===(t=e.int)||void 0===t?void 0:t.mutationCount)||0,invalidActionCount:(null==e||null===(n=e.int)||void 0===n?void 0:n.invalidActionCount)||0,unsupportedActionCount:(null==e||null===(r=e.int)||void 0===r?void 0:r.unsupportedActionCount)||0,keyRotationRemoveCount:(null==e||null===(i=e.int)||void 0===i?void 0:i.keyRotationRemoveCount)||0,storedMutationCount:(null==e||null===(a=e.int)||void 0===a?void 0:a.storedMutationCount)||0,uploadConflictCount:(null==e||null===(o=e.int)||void 0===o?void 0:o.uploadConflictCount)||0,unsetActionCount:(null==e||null===(s=e.int)||void 0===s?void 0:s.unsetActionCount)||0,missingKeyCount:(null==e||null===(l=e.int)||void 0===l?void 0:l.missingKeyCount)||0}},t.forceCommitAppState=function(){u.isScheduled()&&u.forceRunNow()},t.incConflict=function(){l.uploadConflictCount++,d()},t.setInvalidActionCount=function(e){l.invalidActionCount=e,d()},t.setMissingKeyCount=function(e){l.missingKeyCount=e,d()},t.setStoredMutationCount=function(e){l.storedMutationCount=e,d()},t.setUnsupportedActionCount=function(e){l.unsupportedActionCount=e,d()};var i=r(n(73982)),a=n(755907),o=n(865979),s=n(201063);let l={mutationCount:0,invalidActionCount:0,unsupportedActionCount:0,keyRotationRemoveCount:0,storedMutationCount:0,uploadConflictCount:0,unsetActionCount:0,missingKeyCount:0};const u=new s.ShiftTimer((function(){const e=(t=l,{int:(0,i.default)({},t)});var t;c(),(0,o.startMetric)(a.PRE_METRIC.APP_STATE_SYNC_DAILY).endSuccess(e)}));function c(){l={mutationCount:0,invalidActionCount:0,unsupportedActionCount:0,keyRotationRemoveCount:0,storedMutationCount:0,uploadConflictCount:0,unsetActionCount:0,missingKeyCount:0}}function d(){u.onOrBefore(3e5)}},839770:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.encryptMutation=function(){return y.apply(this,arguments)};var i=r(n(73982)),a=r(n(311504)),o=n(81758),s=n(787252),l=n(715739),u=n(370625),c=n(997835),d=n(301241),p=n(284642),_=n(958177),f=n(3923),h=n(493635),g=n(311966),m=n(309512);function y(){return(y=(0,a.default)((function*(e,t){const{index:n,operation:r}=e;let a=t.keyId,o=t.keyData;switch(r){case l.SyncdMutation$SyncdOperation.SET:break;case l.SyncdMutation$SyncdOperation.REMOVE:{const e=yield(0,s.getSyncActionInTransaction)(n);if(!e)throw new _.SyncdFatalError("no corresponding set mutation");const t=e.keyId,r=yield(0,f.getKeyData)(t);if(null==r)throw new _.SyncdFatalError("no key data for corresponding mutation");a=t,o=r}}const{indexMac:u,indexAndValueCipherText:d}=yield E(e,a,o),p=(0,c.valueMacFromIndexAndValueCipherText)(d);return(0,i.default)((0,i.default)({},e),{},{keyId:a,keyData:o,indexMac:u,indexAndValueCipherText:d,valueMac:p})}))).apply(this,arguments)}function E(){return S.apply(this,arguments)}function S(){return(S=(0,a.default)((function*(e,t,n){try{const{index:r,binarySyncAction:i,operation:a,version:s}=e,l=(0,o.stringToArrayBuffer)(r),u=yield(0,c.generateEncryptionKeys)(n),{indexKey:_,valueEncryptionKey:f,valueMacKey:h}=u,g=yield self.crypto.getRandomValues(new Uint8Array(d.IV_LENGTH)),m=T(l,i,(0,c.generatePadding)(l.byteLength,i.byteLength),s),y=yield(0,c.generateCipherText)(g,f,m),E=(0,c.generateAssociatedData)(a,t),S=yield(0,c.generateMac)(E,y,h),v=(0,p.combine)([y,S]);return{indexMac:yield(0,c.generateIndexMac)(_,l),indexAndValueCipherText:v}}catch(e){throw(0,h.reportSyncdFatalError)(h.SyncdFatalErrorType.ENCRYPTION_FAILED),new _.SyncdFatalError("encryption failure")}}))).apply(this,arguments)}function T(e,t,n,r){return(0,g.encodeSyncActionData)({index:e,value:(0,m.decodeProtobuf)(u.SyncActionValueSpec,t),padding:n,version:r})}},965903:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exceedInlineMutationCount=function(e){const t=Math.min(2e3,Math.max((0,r.getConfig)().syncdInlineMutationsMaxCount(),100));return e.length>t},t.exceedPatchProtobufSize=function(e){const t=1e3*Math.min(100,Math.max((0,r.getConfig)().syncdPatchProtobufMaxSize(),10));return e.byteLength>t};var r=n(819416)},426445:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return l.apply(this,arguments)};var i=r(n(311504)),a=n(171537),o=n(681950),s=n(854213);function l(){return(l=(0,i.default)((function*(e){const t=new Map,n=new Map;yield Promise.all(e.map(function(){var e=(0,i.default)((function*(e){const r=yield(0,a.getSyncPendingMutationsByCollectionInTransaction)(e),i=r.map((e=>e.id)).filter(Boolean);n.set(e,i);const o=(0,s.compactPatch)(r);t.set(e,o)}));return function(){return e.apply(this,arguments)}}()));const r=yield(0,o.buildSyncIqNode)(t);return{syncIqNode:r.syncIqNode,collectionWithPendingMutationsIds:n,collectionWithEncryptedMutations:r.collectionWithEncryptedMutations,localCollectionVersions:r.localCollectionVersions,collectionsToSkip:r.collectionsToSkip}}))).apply(this,arguments)}},681950:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t._generateMutationsToUpload=B,t.buildDeleteAllIqNode=function(){return I((0,A.wap)("delete_all_data",null))},t.buildSyncIqNode=function(){return O.apply(this,arguments)};var i=r(n(311504)),a=n(417405),o=n(819416),s=n(759998),l=n(787252),u=n(616310),c=n(502010),d=n(715739),p=n(778005),_=n(155172),f=n(284642),h=n(839770),g=n(534202),m=n(577392),y=n(682661),E=n(965903),S=n(385798),T=n(311966),v=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=P(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(573166)),A=n(738102),C=r(n(765305));function P(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(P=function(e){return e?n:t})(e)}function O(){return(O=(0,i.default)((function*(e){const{collectionNodes:t,collectionWithEncryptedMutations:n,localCollectionVersions:r,collectionsToSkip:i}=yield M(e);return{syncIqNode:I((0,A.wap)("sync",null,t)),collectionWithEncryptedMutations:n,localCollectionVersions:r,collectionsToSkip:i}}))).apply(this,arguments)}function I(e){return(0,A.wap)("iq",{to:A.S_WHATSAPP_NET,xmlns:"w:sync:app:state",type:"set",id:(0,A.generateId)()},e)}function M(){return b.apply(this,arguments)}function b(){return(b=(0,i.default)((function*(e){__LOG__(2)`syncd: start _buildCollectionNodes`;const t=[],n=function(){var e=(0,i.default)((function*(e,n){const r=yield(0,s.getCollectionVersionInTransaction)(e).then((e=>null==e?void 0:e.version));let i,a;if(null!=n&&n.length>0)if(null==r)__LOG__(2)`syncd: skipping ${e} in sync iq patch because initial full sync
is incomplete`,t.push(e);else{const{patchNode:t,encryptedMutations:r}=yield R(e,n);i=t,a=r}return{collection:e,version:r,patchNode:i,encryptedMutations:a}}));return function(){return e.apply(this,arguments)}}(),r=new Map,a=new Map,o=[];e.forEach(((e,t)=>o.push(n(t,e))));const l=(yield Promise.all(o)).map((e=>{const{collection:t,version:n,patchNode:i,encryptedMutations:o}=e;return o&&a.set(t,o),r.set(t,n),(0,A.wap)("collection",{name:(0,A.CUSTOM_STRING)(t),version:(0,A.INT)(null!=n?n:_.DEFAULT_COLLECTION_VERSION),return_snapshot:void 0===n?"true":"false"},i)}));return __LOG__(2)`syncd: end _buildCollectionNodes`,{collectionNodes:l,collectionWithEncryptedMutations:a,localCollectionVersions:r,collectionsToSkip:t}}))).apply(this,arguments)}function R(){return N.apply(this,arguments)}function N(){return(N=(0,i.default)((function*(e,t){const n=yield(0,g.getActiveKey)(!w(t)),r=(yield B(e,t,n)).map((e=>(0,h.encryptMutation)(e,n))),a=yield Promise.all(r),s=a.map((e=>({indexMac:e.indexMac,valueMac:e.valueMac,operation:e.operation}))),l=yield(0,p.computeLtHash)(e,s),{snapshotMac:u,patchMac:c}=yield(0,p.computeOutgoingSnapshotAndPatchMacs)(e,l,a,n.keyData),d=a.map((e=>x(e.keyId,e.operation,e.indexMac,e.indexAndValueCipherText))),_=G(d),f=function(){var e=(0,i.default)((function*(){const e=yield(0,o.getDbImpls)().uploadSyncExternalPatch(_);return k(yield L(e,_),n.keyId,u,c)}));return function(){return e.apply(this,arguments)}}();let m;(0,E.exceedInlineMutationCount)(d)?m=yield f():(m=U(d,n.keyId,u,c),(0,E.exceedPatchProtobufSize)(m)&&(m=yield f()));return{patchNode:(0,A.wap)("patch",null,m),encryptedMutations:a}}))).apply(this,arguments)}function w(e){return(0,o.getConfig)().logoutInProgress()&&e.some((e=>JSON.parse(e.index)[0]===_.Actions.Sentinel))}function L(){return D.apply(this,arguments)}function D(){return(D=(0,i.default)((function*(e,t){const{mediaKey:n,directPath:r,encFilehash:i,handle:o}=e,s=yield(0,c.calculateFilehash)(t);return{mediaKey:n,directPath:r,handle:o,fileSizeBytes:t.byteLength,fileSha256:(0,a.decodeB64)(s),fileEncSha256:i}}))).apply(this,arguments)}function k(e,t,n,r){const i=(0,o.getConfig)().syncdPatchDeviceIndexIncluded()?(0,u.extractDeviceId)((0,o.getMyDeviceJid)()):void 0;return(0,T.encodeSyncdPatch)({keyId:{id:(0,y.fromSyncKeyId)(t)},externalMutations:e,snapshotMac:n,patchMac:r,deviceIndex:i})}function U(e,t,n,r){const i=(0,o.getConfig)().syncdPatchDeviceIndexIncluded()?(0,u.extractDeviceId)((0,o.getMyDeviceJid)()):void 0;return(0,T.encodeSyncdPatch)({keyId:{id:(0,y.fromSyncKeyId)(t)},mutations:e,snapshotMac:n,patchMac:r,deviceIndex:i})}function G(e){return(0,T.encodeSyncdMutations)({mutations:e})}function x(e,t,n,r){return{operation:t,record:{keyId:{id:(0,y.fromSyncKeyId)(e)},index:{blob:n},value:{blob:r}}}}function B(){return F.apply(this,arguments)}function F(){return(F=(0,i.default)((function*(e,t,n){const r=yield(0,l.getSyncActionsByCollectionsInTransaction)([e]);let i=t;const a=j(r,t,n.keyId);i=i.concat(a);const o=Y(r,i,n.keyId);return v.addKeyRotationRemoveCount(o.length),i=i.concat(o),i}))).apply(this,arguments)}function j(e,t,n){let r=e.filter((e=>!t.map((e=>e.index)).includes(e.index)&&!(0,f.syncKeyIdsEqual)(e.keyId,n)));r=(0,C.default)(r,(e=>(0,m.getKeyEpoch)(e.keyId)));const i=Math.min(5,(0,o.getConfig)().syncdAdditionalMutations());return r=r.slice(0,i),(0,S.syncActionsToPendingMutations)(r,d.SyncdMutation$SyncdOperation.SET)}function Y(e,t,n){const r=t.map((e=>e.index)),i=e.filter((e=>r.includes(e.index))).filter((e=>!(0,f.syncKeyIdsEqual)(e.keyId,n)));return(0,S.syncActionsToPendingMutations)(i,d.SyncdMutation$SyncdOperation.REMOVE)}},385798:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.syncActionsToPendingMutations=function(e,t){return e.map((e=>{const n=(0,i.decodeProtobuf)(r.SyncActionDataSpec,e.binarySyncData).value,o=(0,a.encodeProtobuf)(r.SyncActionValueSpec,n).readBuffer();return{collection:e.collection,index:e.index,binarySyncAction:o,operation:t,version:e.version,timestamp:e.timestamp,action:e.action}}))};var r=n(370625),i=n(309512),a=n(653313)},854213:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compactPatch=function(e){return function(e,t){const n=new Set;return e.filter((e=>{const r=t(e);return!n.has(r)&&(n.add(r),!0)}))}(e.reverse(),(e=>e.index)).reverse()}},311966:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodeSyncActionData=function(e){try{return(0,s.encodeProtobuf)(i.SyncActionDataSpec,e).readBuffer()}catch(e){throw(0,o.reportSyncdFatalError)(o.SyncdFatalErrorType.ACTION_DATA_PROTOBUF_SERIALIZATION_FAILED),new a.SyncdFatalError("action data protobuf serialization failed")}},t.encodeSyncdMutations=function(e){try{return(0,s.encodeProtobuf)(r.SyncdMutationsSpec,e).readBuffer()}catch(e){throw(0,o.reportSyncdFatalError)(o.SyncdFatalErrorType.MUTATIONS_PROTOBUF_SERIALIZATION_FAILED),new a.SyncdFatalError("mutations protobuf serialization failed")}},t.encodeSyncdPatch=function(e){try{return(0,s.encodeProtobuf)(r.SyncdPatchSpec,e).readBuffer()}catch(e){throw(0,o.reportSyncdFatalError)(o.SyncdFatalErrorType.PATCH_PROTOBUF_SERIALIZATION_FAILED),new a.SyncdFatalError("patch protobuf serialization failed")}};var r=n(715739),i=n(370625),a=n(958177),o=n(493635),s=n(653313)},759998:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bulkGetCollectionVersionsInTransaction=function(e){return(0,r.runInTransaction)(["CollectionVersionStore"],(t=>{let{CollectionVersionStore:n}=t;return n.bulkGet(e)}))},t.bulkUpdateCollectionVersionInTransaction=function(e){return(0,r.runInTransaction)(["CollectionVersionStore"],(t=>{let{CollectionVersionStore:n}=t;return n.bulkUpdate(e)}))},t.getAllCollectionVersionsInTransaction=function(){return(0,r.runInTransaction)(["CollectionVersionStore"],(e=>{let{CollectionVersionStore:t}=e;return t.getAll()}))},t.getCollectionVersionInTransaction=function(e){return(0,r.runInTransaction)(["CollectionVersionStore"],(t=>{let{CollectionVersionStore:n}=t;return n.get(e)}))},t.getCollectionVersionLtHash=a,t.getCollectionVersionLtHashInTransaction=function(e){return(0,r.runInTransaction)(["CollectionVersionStore"],(t=>{let{CollectionVersionStore:n}=t;return a({CollectionVersionStore:n},e)}))},t.getIsCollectionInMacMismatchFatalInTransaction=function(e){return(0,r.runInTransaction)(["CollectionVersionStore"],(t=>{let{CollectionVersionStore:n}=t;return n.get(e).then((e=>null==e?void 0:e.isCollectionInMacMismatchFatal))}))},t.updateCollectionVersionAndLtHashInTransaction=function(e,t,n){return(0,r.runInTransaction)(["CollectionVersionStore"],(r=>{let{CollectionVersionStore:i}=r;return i.update(e,{version:t,ltHash:n})}))},t.updateIsCollectionInMacMismatchFatalInTransaction=function(e){return(0,r.runInTransaction)(["CollectionVersionStore"],(t=>{let{CollectionVersionStore:n}=t;return n.update(e,{isCollectionInMacMismatchFatal:!0})}))};var r=n(819416),i=n(192920);function a(e,t){let{CollectionVersionStore:n}=e;return n.get(t).then((e=>{var t;return null!==(t=null==e?void 0:e.ltHash)&&void 0!==t?t:new ArrayBuffer(i.KEY_LENGTH_BYTES)}))}},773244:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bulkGetMissingKeysInTransaction=function(e){return(0,r.runInTransaction)(["MissingKeyStore"],(t=>{let{MissingKeyStore:n}=t;return n.bulkGet(e)}))},t.bulkUpdateMissingKeysInTransaction=function(e){return(0,r.runInTransaction)(["MissingKeyStore"],(t=>{let{MissingKeyStore:n}=t;return n.bulkUpdate(e)}))},t.getAllMissingKeysInTransaction=function(){return(0,r.runInTransaction)(["MissingKeyStore"],(e=>{let{MissingKeyStore:t}=e;return t.getAll()}))},t.getMissingKeyCountTransaction=function(){return(0,r.runInTransaction)(["MissingKeyStore"],(e=>{let{MissingKeyStore:t}=e;return t.count()}))};var r=n(819416)},171537:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bulkCreateSyncPendingMutationsInTransaction=function(e){return(0,r.runInTransaction)(["PendingMutationStore"],(t=>{let{PendingMutationStore:n}=t;return n.bulkCreate(e)}))},t.getAllSyncPendingMutationsInTransaction=function(){return(0,r.runInTransaction)(["PendingMutationStore"],(e=>{let{PendingMutationStore:t}=e;return t.getAll()}))},t.getSyncPendingMutationsByCollectionInTransaction=function(e){return(0,r.runInTransaction)(["PendingMutationStore"],(t=>{let{PendingMutationStore:n}=t;return n.getByCollection(e)}))};var r=n(819416)},787252:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bulkUpdateSyncActionsInTransaction=function(e){return(0,r.runInTransaction)(["SyncActionStore"],(t=>{let{SyncActionStore:n}=t;return n.bulkUpdate(e)}))},t.countSyncActionsInTransaction=function(){return(0,r.runInTransaction)(["SyncActionStore"],(e=>{let{SyncActionStore:t}=e;return t.count()}))},t.getAllSyncActions=function(){return(0,r.runInTransaction)(["SyncActionStore"],(e=>{let{SyncActionStore:t}=e;return t.getAll()}))},t.getSyncActionInTransaction=function(e){return(0,r.runInTransaction)(["SyncActionStore"],(t=>{let{SyncActionStore:n}=t;return n.get(e)}))},t.getSyncActionsByActionStatesInTransaction=function(e){return(0,r.runInTransaction)(["SyncActionStore"],(t=>{let{SyncActionStore:n}=t;return n.getByActionStates(e)}))},t.getSyncActionsByCollectionsInTransaction=function(e){return(0,r.runInTransaction)(["SyncActionStore"],(t=>{let{SyncActionStore:n}=t;return n.getByCollections(e)}))},t.getSyncActionsByIndexMacsInTransaction=function(e){return(0,r.runInTransaction)(["SyncActionStore"],(t=>{let{SyncActionStore:n}=t;return n.getByIndexMacs(e)}))},t.getSyncActionsByModelInfosInTransaction=function(e){return(0,r.runInTransaction)(["SyncActionStore"],(t=>{let{SyncActionStore:n}=t;return n.getByModelInfos(e)}))};var r=n(819416)},865254:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expireSyncKeyInTransaction=function(e){return(0,r.runInTransaction)(["SyncKeyStore"],(t=>{let{SyncKeyStore:n}=t;return n.expire(e)}))},t.getAllSyncKeysInTransaction=function(){return(0,r.runInTransaction)(["SyncKeyStore"],(e=>{let{SyncKeyStore:t}=e;return t.getAll()}))},t.getSyncKeyInTransaction_DO_NOT_USE=function(e){return(0,r.runInTransaction)(["SyncKeyStore"],(t=>{let{SyncKeyStore:n}=t;return n.get(e)}))},t.setSyncKeyInTransaction=function(e){return(0,r.runInTransaction)(["SyncKeyStore"],(t=>{let{SyncKeyStore:n}=t;return n.set(e)}))};var r=n(819416)},729208:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isBootstrap=function(e){return null==e},t.isCriticalCollection=function(e){switch(e){case r.CollectionName.CriticalBlock:case r.CollectionName.CriticalUnblockLow:return!0;case r.CollectionName.Regular:case r.CollectionName.RegularHigh:case r.CollectionName.RegularLow:return!1}};var r=n(155172)},246961:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.getToken=function(e){return(0,p.redeemPrivateStatsToken)().then((t=>t?{result:t}:g(e).then((e=>{const t=(0,i.default)({},e),{result:n}=e;return n?(0,p.savePrivateStatsToken)(n).then((()=>t)):t}))))},t.issuePrivateStatsToken=g;var i=r(n(73982)),a=n(551168),o=n(911794),s=n(903190),l=n(618445),u=n(583433),c=n(990445),d=n(20447),p=n(738304),_=n(738102),f=n(769707);const h=new f.WapParser("issuePrivateStatsToken",(e=>{const t=e.child("sign_credential");return{signedCredential:t.child("signed_credential").contentBytes(),acsPublicKey:t.child("acs_public_key").contentBytes()}}));function g(e){const t=(0,c.monotonicTime)(),n={overallStartTime:t,retryStartTime:t,retryAttemptsLeft:3},r=new Uint8Array(32);self.crypto.getRandomValues(r);const p=new Uint8Array(32);self.crypto.getRandomValues(p);const f=(0,d.blindToken)(r,p),g=new u.PromiseRetryLoop({name:"issuePrivateStatsToken",timer:{algo:{type:"exponential",first:250},max:1e3},code:t=>{n.retryAttemptsLeft<3&&(n.retryStartTime=(0,c.monotonicTime)());const u=(0,_.wap)("iq",{xmlns:"privatestats",id:(0,_.generateId)(),type:"get",to:_.S_WHATSAPP_NET},(0,_.wap)("sign_credential",{version:"1"},(0,_.wap)("blinded_credential",null,f)));return(e||o.deprecatedSendIqWithoutRetry)(u,h).then((e=>{if(!e.success){const r=function(e){switch(e.errorCode){case 400:return"bad-request";case 500:return"internal-server-error";case 501:return"feature-not-implemented";case 503:return"service-unavailable";default:return"unknown"}}(e);return __LOG__(3)`issuePrivateStatsToken: failed ${r}`,void("internal-server-error"!==r||n.retryAttemptsLeft<=0?t({result:null,metric:(0,i.default)((0,i.default)({},n),{},{result:r})}):n.retryAttemptsLeft--)}const{signedCredential:o,acsPublicKey:l}=e.result,u=(0,d.unblindToken)(o,p,l);if(null==u)return __LOG__(3)`issuePrivateStatsToken: failed to unblind the signed token`,void t({result:null,metric:(0,i.default)((0,i.default)({},n),{},{result:"decryption-error"})});const c=a.Binary.build(r,u),_=(0,s.hash)(c.readByteArray());t({result:{token:r,sharedSecret:_},metric:(0,i.default)((0,i.default)({},n),{},{result:"success"})})})).catch((e=>{if(!(e instanceof l.Disconnected))return Promise.reject(e);__LOG__(3)`issuePrivateStatsToken: Disconnected`,n.retryAttemptsLeft<=0?t({result:null,metric:(0,i.default)((0,i.default)({},n),{},{result:"disconnected"})}):n.retryAttemptsLeft--}))}});return g.start(),g.promise()}},515856:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.uploadFinishedPrivateStatsBuffers=function(e){return(0,u.getFinishedStreamBuffers)("private").then((t=>T(t,e)))},t.upload_UNSAFE_INTERNAL_DO_NOT_USE=T;var i=r(n(311504)),a=n(417405),o=n(128326),s=n(583433),l=n(990445),u=n(738304);const c="https://dit.whatsapp.net/deidentified_telemetry",d="245118376424571|3e7d275052f1522bf3200afcf53841a7",p="WAMEventBuffer.dat",_=111e3,f=3067002,h=3067003,g=3067004;function m(e){return{result:e.result,httpResponseCode:e.httpResponseCode,uploadTime:(0,l.monotonicTimeSince)(e.uploadStartTime)}}function y(){return(y=(0,i.default)((function*(e,t,n,r){if((yield(0,u.privateStatsKillSwitchGetBlockedToken)())===d)return __LOG__(2)`Removing private stats buffer without submitting it (kill switch)`,(0,u.removeBufferByKey)(n.key).then((()=>{e()}));const i=(0,l.monotonicTime)(),s=yield r();if(null==s)return __LOG__(4,void 0,new Error)`Couldn't get token to submit a private stats buffer`,void e();const _=new FormData;_.append("access_token",d);const f=yield(0,o.hmacSha256)(s.sharedSecret,n.content),h=(0,a.encodeB64UrlSafe)(s.token,!0),g=(0,a.encodeB64UrlSafe)(f,!0);let m;_.append("credential",`${h}+${g}`),_.append("message",new Blob([n.content],{type:"application/octet-stream"}),p),_.append("meta_data",JSON.stringify({t:(0,l.unixTime)(),p:0}));try{m=yield fetch(c,{method:"POST",body:_,"Content-Type":"multipart/form-data"})}catch(e){return __LOG__(3)`Upload of a private stats buffer failed: ${e}`,void t({uploadStartTime:i,result:"error-other"})}const y=m.status,S=t=>{e({uploadStartTime:i,httpResponseCode:y,result:t})},T=e=>{t({uploadStartTime:i,httpResponseCode:y,result:e})};switch(y){case 200:return(0,u.removeBufferByKey)(n.key).then((()=>{S("success")}));case 429:return void S("error-server-other");case 401:return Promise.all([(0,u.privateStatsKillSwitchSet)(d),(0,u.removeBufferByKey)(n.key)]).then((()=>{S("error-access-token")}));case 400:{const{result:n,shouldRetry:r}=yield E(m),a={uploadStartTime:i,httpResponseCode:y,result:n};return void("retry"===r?t(a):e(a))}case 500:return void T("error-server-other")}__LOG__(3)`Unsupported response status code from PrivateStats upload request: ${y}`,T("error-other")}))).apply(this,arguments)}function E(){return S.apply(this,arguments)}function S(){return(S=(0,i.default)((function*(e){const t=yield e.json().catch((()=>{}));if("object"!=typeof t)return __LOG__(3)`Unable to parse error response 400 from PrivateStats upload request or parsed response is not an object`,{result:"error-other",shouldRetry:"retry"};const{error:n}=t;if("object"!=typeof n)return __LOG__(3)`Incorrect or missing error entry in the error response 400 from PrivateStats upload request`,{result:"error-other",shouldRetry:"retry"};const{code:r,error_subcode:i}=n;if("number"!=typeof r||"number"!=typeof i)return __LOG__(3)`Incorrect code or subcode in the error response 400 from PrivateStats upload request`,{result:"error-other",shouldRetry:"retry"};switch(r){case 9:return{result:"error-server-other",shouldRetry:"no-retry"};case _:switch(i){case f:return{result:"error-parsing",shouldRetry:"retry"};case h:return{result:"error-decoding",shouldRetry:"retry"};case g:return{result:"error-credential",shouldRetry:"retry"};default:return __LOG__(3)`Unsupported subcode value in the error response 400 from PrivateStats upload request: ${i}`,{result:"error-other",shouldRetry:"retry"}}default:return __LOG__(3)`Unsupported code value in the error response 400 from PrivateStats upload request: ${r}`,{result:"error-other",shouldRetry:"retry"}}}))).apply(this,arguments)}function T(e,t){const n=e.map((e=>{let n=3;const r=[],i=new s.PromiseRetryLoop({name:"uploadPrivateStatsBuffer",timer:{algo:{type:"exponential",first:250},max:1e3},code:i=>function(){return y.apply(this,arguments)}(i,(e=>{const t=m(e);r.push(t),n<=0?i():n--}),e,t)});return i.start(),i.promise().then((t=>{if(null!=t){const e=m(t);r.push(e)}return{uploadedBufferKey:"success"===(null==t?void 0:t.result)?e.key:null,metrics:r}}))}));return Promise.all(n).then((e=>{const t=e.reduce(((e,t)=>(e.push(...t.metrics),e)),[]);return{uploadedBufferKeys:e.reduce(((e,t)=>(null!=t.uploadedBufferKey&&e.push(t.uploadedBufferKey),e)),[]),metrics:t}}))}},869213:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NOT_HANDLED=t.DynamicRouter=void 0;const n={sentinel:"RESPONSE_NAMESPACE"},r={sentinel:"NOT_HANDLED"};t.NOT_HANDLED=r;function i(e,t){const r=t.namespace;return r===n?a:e.get(r)}function a(e,t,n){n(t)}function o(e){if(null!=e&&("object"==typeof e||"function"==typeof e)){const t=e.then;return"function"==typeof t?t:null}return null}t.DynamicRouter=class{constructor(){var e=this;this._basePromise=Promise.resolve(),this._handlers=new Map,this._handlerChangeCount=0,this._firstRoute=null,this._nextRoute=null,this._lastRoute=null,this.fireAndForget=function(t,n,r){var i;let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];null===(i=e._onRouteCalled)||void 0===i||i.call(e,t,n,r),e._schedule(t,n,r,null,a)},this.sendAndReceive=function(t,r,i){var a;let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return null===(a=e._onRouteCalled)||void 0===a||a.call(e,t,r,i),new Promise(((a,l)=>{e._schedule(t,r,i,(t=>{try{const r=o(t);r?r.call(t,(t=>{e._schedule(n,"",t,a,s)}),(t=>{e._schedule(n,"",t,l,!1)})):e._schedule(n,"",t,a,s)}catch(t){e._schedule(n,"",t,l,!1)}}),s)}))},this._run=()=>{let e=this._nextRoute;if(!e)return;const t=this._handlers;let n;for(;e&&!(n=i(t,e));)this._nextRoute=e=e.nextRoute;if(!e||!n)return;const a=this._runHandler(n,e);let o=!0;if(a!==r){const t=e.prevRoute,n=e.nextRoute;this._nextRoute===e&&(this._nextRoute=n),t?t.nextRoute=n:this._firstRoute=n,n?n.prevRoute=t:(o=!1,this._lastRoute=t)}return o&&this._basePromise.then(this._run),a}}hasHandlerForNamespace(e){return this._handlers.has(e)}getHandledNamespaces(){return Array.from(this._handlers.keys())}setOnRouteCalled(e){this._onRouteCalled=e}setNamespaceHandler(e,t){const n=this._handlers,r=n.get(e);if(r!==t&&(++this._handlerChangeCount,n.set(e,t),!r)){const e=this._firstRoute;e&&(this._nextRoute||this._basePromise.then(this._run),this._nextRoute=e)}}setHandlers(e,t){this.setNamespaceHandler(e,(function(e,n,r){const i=t[e](n);r&&r(i)}))}_schedule(e,t,n,r,a){const o=this._lastRoute,s={namespace:e,route:t,arg:n,resolver:r,prevRoute:o,nextRoute:null,silentLog:a};this._lastRoute=s;let l=!0;o?(o.nextRoute=s,l=!this._nextRoute):this._firstRoute=s,l&&i(this._handlers,s)&&(this._nextRoute=s,this._basePromise.then(this._run))}_runHandler(e,t){const{route:n,arg:i,resolver:a,silentLog:o}=t,s=this._handlerChangeCount;let l=null,u=null;try{l=e(n,i,a,o)}catch(e){u=Promise.reject(e)}if(l===r){if(s!==this._handlerChangeCount)return r;u=Promise.reject(new Error("DynamicRouter: NOT_HANDLED can only be used when updating handlers"))}if(!a)return u;u&&a(u)}}},755907:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PRE_METRIC=void 0;const r=n(654302)({DECRYPT_MESSAGE_FINAL:"decrypt_message_final",FRANKING_VALIDATION:"franking_validation",GET_DEVICES:"get_devices",MEDIA_DOWNLOAD:"media_download",MEDIA_UPLOAD:"media_upload",DELETE_THREAD:"delete_thread",DOWNLOAD_AND_DECRYPT:"download_and_decrypt",MESSAGE_DECRYPTION:"message_decryption",MESSAGE_ENCRYPTION:"message_encryption",OFFLINE_QUEUE:"offline_queue",OFFLINE_RETRY:"offline_retry",ICDC_ERROR:"icdc_error",QUERY_GROUP:"query_group",QUERY_GROUPS:"query_groups",RETRY_RECEIPTS_SENT:"retry_receipts_sent",SAVE_SESSION_RETRIES:"save_session_retries",SAVE_SIGNAL_SESSION_RETRIES:"save_signal_session_retries",SYNCD_FATAL_ERROR:"syncd_fatal_error",SYNCD_CRITICAL_EVENT:"syncd_critical_event",SYNCD_CRITICAL_BOOTSTRAP_STAGE:"syncd_critical_bootstrap_stage",SYNCD_BOOTSTRAP_APP_STATE_DOWNLOAD:"syncd_bootstrap_app_state_download",SYNCD_DECRYPT_MUTATIONS:"syncd_decrypt_mutations",SYNCD_BOOTSTRAP_DATA_APPLIED:"syncd_bootstrap_data_applied",APP_STATE_SYNC_DAILY:"app_state_sync_daily",SYNCD:"syncd",SEND_MESSAGE:"send_message",RECEIVE_MESSAGE:"receive_message",TEST_RECEIVE_MESSAGE:"test_receive_message",SYNCD_KEY_ROTATION:"syncd_key_rotation",WA_FAILURE_STANZA:"wa_failure_stanza",REMOVE_PARTICIPANTS:"remove_participants",CREATE_GROUP:"create_group",WA_JOBS_ORCHESTRATOR:"wa_jobs_orchestrator",WA_DISCONNECT:"wa_disconnect",TEST_MAW_ENCRYPT_MESSAGE:"test_maw_encrypt_message",TEST_MAW_WA_SEND_MESSAGE:"test_maw_wa_send_message",WA_JOB_MANAGER:"wa_job_manager"});t.PRE_METRIC=r},865979:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clear=void 0,t.startMetric=function(e,t,n,i){null==n&&r++;const o=null!=n?n:r;a(null==n?{name:e,stage:"START",instanceKey:o,annotations:t,nonTrackableAnnotations:i}:{name:e,stage:"RESUME",instanceKey:o,annotations:t});return{addPoint(t,n){a({name:e,stage:"POINT",reason:t,instanceKey:o,annotations:n})},endSuccess(t){a({name:e,stage:"SUCCESS",instanceKey:o,annotations:t})},endFail(t,n){a({name:e,stage:"FAIL",reason:t,instanceKey:o,annotations:n})}}},t.subscribe=void 0;n(755907);let r=0;const i=function(){const e=[];return{subscribe:function(t){e.push(t)},notify:function(t){0===e.length&&__LOG__(4,void 0,new Error)`[PRE] There are no subscribers to PRE events`,e.forEach((e=>{e(t)}))},clear:function(){__LOG__(3)`Removing all listeners from PRE_METRICS`,e.length=0}}}(),a=i.notify,o=i.clear;t.clear=o;const s=i.subscribe;t.subscribe=s},855034:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QplSampleMethod=void 0;const r=n(654302)({EVENT_BASED_SAMPLING:1,USER_BASED_SAMPLING:3});t.QplSampleMethod=r},954273:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.markerEnded=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=`${e}|${t}`;n.delete(i),r.delete(i)},t.validateAnnotations=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const a=`${e}|${t}`,o=n.get(a)||0;let s=0;function l(n,r){return s+=r,!(s+o>1e3)||(null==i||i.annotationSizeLimitExceeded(e,t,n),!1)}function u(n){for(let r=0;r<n.length;r++)return!(n[r].length>50)||(null==i||i.annotationKeyTooLong(e,t,n[r]),!1)}if(null==r?void 0:r.bool){const e=Object.keys(r.bool);if(!l("bool",e.length)||!u(e))return!1}if(null==r?void 0:r.int){const e=Object.keys(r.int);if(!l("int",e.length)||!u(e))return!1}if(null==r?void 0:r.double){const e=Object.keys(r.double);if(!l("double",e.length)||!u(e))return!1}if(null==r?void 0:r.bool_array){const e=r.bool_array,t=Object.keys(e);for(let n=0;n<t.length;n++){const r=e[t[n]];if(r&&!l(t[n],r.length))return!1}if(!u(t))return!1}if(null==r?void 0:r.int_array){const e=r.int_array,t=Object.keys(e);for(let n=0;n<t.length;n++){const r=e[t[n]];if(r&&!l(t[n],r.length))return!1}if(!u(t))return!1}if(null==r?void 0:r.double_array){const e=r.double_array,t=Object.keys(e);for(let n=0;n<t.length&&r.double_array;n++){const r=e[t[n]];if(r&&!l(t[n],r.length))return!1}if(!u(t))return!1}if(null==r?void 0:r.string){const e=r.string,t=Object.keys(e);for(let n=0;n<t.length&&r.string;n++){const r=e[t[n]];if(null!=r&&!l(t[n],r.length))return!1}if(!u(t))return!1}if(null==r?void 0:r.string_array){const e=r.string_array,t=Object.keys(e);for(let n=0;n<t.length&&r.string_array;n++){const r=e[t[n]];if(r)for(let e=0;e<r.length;e++)if(!l(t[n],r[e].length))return!1}if(!u(t))return!1}return n.set(a,o+s),!0},t.validatePoints=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;if(n.length>50)return null==i||i.pointNameTooLong(e,t,n),!1;const a=`${e}|${t}`,o=r.get(a)||0;if(o+1>1e3)return null==i||i.maxPointCountExceeded(e,t),!1;return r.set(a,o+1),!0};const n=new Map,r=new Map},40999:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.QplNetwork=void 0,t.createPayload=l,t.defaultQplNetwork=function(e){c?e&&__LOG__(3)`Default Network already init`:c=new u(e);return c};var i=r(n(311504)),a=n(819416),o=n(15842),s=n(990445);function l(e,t){return JSON.stringify(e)+"\n"+t.map((function(e){return delete e.app_version,delete e.app_build_number,void 0===e.wa_ab_key2&&(e.wa_ab_key2="abkey"),JSON.stringify(e)})).join("\n")}class u{constructor(e){var t,n,r,o,s,l,u,c,d,p,_,f;this._qplEndpoint=null!==(t=null!==(n=null==e?void 0:e.qplEndpoint)&&void 0!==n?n:null===(r=(0,a.getQplConfig)())||void 0===r?void 0:r.endpoint)&&void 0!==t?t:"",this._qplAccessToken=null!==(o=null!==(s=null==e?void 0:e.qplAccessToken)&&void 0!==s?s:null===(l=(0,a.getQplConfig)())||void 0===l?void 0:l.accessToken)&&void 0!==o?o:"",this._qplAppId=null!==(u=null!==(c=null==e?void 0:e.qplAppId)&&void 0!==c?c:null===(d=(0,a.getQplConfig)())||void 0===d?void 0:d.appId)&&void 0!==u?u:"",this._instrumentForJestE2E=null!==(p=null==e?void 0:e.instrumentForJestE2E)&&void 0!==p&&p,this._isDev=null!==(_=null==e?void 0:e.isDev)&&void 0!==_&&_,this._restInterface=null!==(f=null==e?void 0:e.restInterface)&&void 0!==f?f:{post:(e,t)=>fetch(e,{method:"POST",body:t}).then(function(){var e=(0,i.default)((function*(e){const t=yield e.text();return{status:e.status,responseText:t}}));return function(){return e.apply(this,arguments)}}())}}sendEventsOverNetwork(e){var t=this;return(0,i.default)((function*(){if(t._instrumentForJestE2E){const t=window.__je2e_recordQPLMarker;null!=t&&"function"==typeof t&&e.forEach(t)}const n=t._isDev?{is_employee:"true"}:{},r=t._qplEndpoint,i=new FormData;i.append("access_token",t._qplAccessToken),i.append("app_id",t._qplAppId),void 0===t._fakeUserId&&(t._fakeUserId=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString()),i.append("user_id",t._fakeUserId),i.append("upload_time",(0,s.unixTime)().toString()),i.append("batch_info",JSON.stringify(n));const a={};if(e.forEach((e=>{void 0!==e.app_version&&(a[e.app_version]?a[e.app_version].push(e):a[e.app_version]=[e])})),0===Object.keys(a).length)return;Object.keys(a).map((e=>a[e])).forEach((e=>{const t={app_version:e[0].app_version,app_build_number:e[0].app_build_number};i.append("batches[]",function(e,t,n){const r=new Blob(e,n||{});return r.name=t,r}([l(t,e)],"qpldata.txt"))}));const u=yield t._restInterface.post(r,i);if(__LOG__(2,void 0,void 0,void 0,["qpl"])`qpl_networkSendEventsOverNetwork, completed Request`,200!==u.status)throw new o.QplServerStatusCodeError(u.status,`Failed call to QPL endpoint: ${t._qplEndpoint}, response: ${u.responseText}`)}))()}}let c;t.QplNetwork=u},766924:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inplaceTruncateEventPrecision=function(e,t){const n=1e6*t;e.duration_ns=Math.round(e.duration_ns/n)*n,e.points&&e.points.map((e=>{e.timeSinceStart=Math.round(e.timeSinceStart/t)*t}))}},15842:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuickLogMarkerType=t.QuickLogActionType=t.QplServerStatusCodeError=t.QplInstanceKeyOptions=t.QPLDataEventLevel=void 0;const r=n(654302)({SUCCESS:2,FAIL:3,CANCEL:4,ABORTED:105});t.QuickLogActionType=r;const i=n(654302)({REGULAR:1,USER_FLOW:2});t.QuickLogMarkerType=i;const a=n(654302).Mirrored(["AUTO_INCREMENT","MANUAL_INCREMENT","REUSE_INSTANCE"]);t.QplInstanceKeyOptions=a;const o=n(654302)({FATAL:1,ERROR:3,CRITICAL:4,WARN:5,INFO:7,DEBUG:9});t.QPLDataEventLevel=o;class s extends Error{constructor(e,t){super(t),this.name="QplServerStatusCodeError",this.name="QplServerStatusCodeError",this.status=e,this.statusCode=e}}t.QplServerStatusCodeError=s},990439:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.forceQplUpload=function(){A()},t.start=function(){return E.apply(this,arguments)};var i=r(n(311504)),a=n(36530),o=n(583433),s=n(15842);const l=1e3,u=1e4,c="exponential",d=100,p=4,_=6e4,f=9e5;let h,g,m,y;function E(){return(E=(0,i.default)((function*(e,t){var n,r,i,o,s,l;g=null!==(n=t.instrumentForJestE2E)&&void 0!==n&&n,h=t.healthLogger,m=t.storageApi,y||(y={sendEvents:e.sendEvents,isQplEnabled:e.isQplEnabled,startDelayInMs:1e3*(null!==(r=e.startDelayInSeconds)&&void 0!==r?r:300),intervalInMs:1e3*(null!==(i=e.intervalInSeconds)&&void 0!==i?i:86400),minRetryDelayInMs:1e3*(null!==(o=e.minRetryDelayInSeconds)&&void 0!==o?o:_),maxRetryDelayInMs:1e3*(null!==(s=e.maxRetryDelayInSeconds)&&void 0!==s?s:f),maxRetryAttemptsCount:null!==(l=e.maxRetryAttemptsCount)&&void 0!==l?l:p},g&&(y={sendEvents:e.sendEvents,isQplEnabled:()=>!0,intervalInMs:50,maxRetryAttemptsCount:5,maxRetryDelayInMs:100,minRetryDelayInMs:50,startDelayInMs:50}),yield(0,a.delayMs)(y.startDelayInMs),yield A(),S())}))).apply(this,arguments)}function S(){setTimeout((0,i.default)((function*(){yield A(),S()})),y.intervalInMs)}function T(){return v.apply(this,arguments)}function v(){return(v=(0,i.default)((function*(){const e=y.minRetryDelayInMs+Math.floor(Math.random()*(y.maxRetryDelayInMs-y.minRetryDelayInMs));yield(0,a.delayMs)(e)}))).apply(this,arguments)}function A(){return C.apply(this,arguments)}function C(){return(C=(0,i.default)((function*(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(y.isQplEnabled())try{const e=yield m.getRowCount();let t=0;for(;t<e;){const e=yield m.getFromBottom(d);yield P(e);const n=e[0].id||0,r=e[e.length-1].id||0;yield m.deleteRange(n,r),t+=e.length}}catch(n){var t;if(e<y.maxRetryAttemptsCount)yield T(),A(e+1);else __LOG__(4,!0,new Error,!0)`QPL Uploader, error during upload session, error: ${n}`,SEND_LOGS("QPL Uploader upload session failed"),null===(t=h)||void 0===t||t.errorUploadingChunk(n)}}))).apply(this,arguments)}function P(){return O.apply(this,arguments)}function O(){return(O=(0,i.default)((function*(e){const t=new o.PromiseRetryLoop({name:"QplUploadChunk",timer:{algo:{type:c,first:l},max:u},code:t=>(e[0].id,e[e.length-1].id,y.sendEvents(e).then((()=>{t()})).catch((e=>{if(e instanceof s.QplServerStatusCodeError)switch(e.statusCode){case 500:__LOG__(3)`QPL Uploader uploadChunk, retriable error: ${e.message}`;break;default:t()}throw e})))});t.start(),yield t.promise()}))).apply(this,arguments)}},264325:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.QPL=void 0;var i=n(855034),a=r(n(492533)),o=n(954273),s=n(766924),l=n(15842);let u;class c{static setAllowListDevVerboseLogging(e){this.allowListDevVerboseLogging=e}static setStartupAllowListEventFilter(e){this._startupAllowListEventFilter=e}static setQplReducePrecisionMapMs(e){this._qplReducePrecisionMapMs=e}static resetQplSettings(){this._qplSettings=this._SETTINGS_ON_STARTUP}static setIsDev(e){this.isDev=e}static setEnumConversion(e){this._enumConversion=e}static setStorageApi(e){this._storageApi=e}static setHealthLogger(e){this._healthLogger=e}static init(e,t,n){this._qplSettings={sendEvent:e,isQplEnabled:n,getEventDetails:t}}static getInstance(){return u||(u=new a.default(this._qplSettingsDecorator)),u}static setInstance(e){u=e}static clearInstance(){u=null,Object.assign(this._qplSettings,this._SETTINGS_ON_STARTUP),c.markerInstanceHelper.clear()}static getNextMarkerInstanceValue(e){c.markerInstanceHelper.get(e)||c.markerInstanceHelper.set(e,this._instanceKeyGenerator());const t=c.markerInstanceHelper.get(e),n=void 0!==t?t.next().value:0;return void 0!==n?n:0}static*_instanceKeyGenerator(){let e=0;for(;;)yield e++}static throwKillswitch(e){this._qplSettings.isQplEnabled=()=>!e,this.isDev}static clearStorage(){this._storageApi.clear()}static logActiveQplMarkers(){const e=c.getInstance().getActiveMarkerIDs({type:l.QuickLogMarkerType.REGULAR});e.length&&e.forEach((e=>{var t,n;const r=null===(t=(n=this._enumConversion).getName)||void 0===t?void 0:t.call(n,e);__LOG__(3)`QPL [${r}] There are ${this._numberOfMarkersOpen(e)} active markers remaining. You need to call markerEnd`}))}static markerStart(e,t){var n,r,i,a;this.isDev&&this.allowListDevVerboseLogging.includes(e)&&(null===(n=(r=this._enumConversion).getName)||void 0===n||n.call(r,e),this._qplSettings.isQplEnabled()||__LOG__(3)`QPL [${null===(i=(a=this._enumConversion).getName)||void 0===i?void 0:i.call(a,e)}] markerStart called but killSwitch is ON, this call will be ignored, no marker will be instantiated`);let s;if(s=(null==t?void 0:t.instanceKeyOption)===l.QplInstanceKeyOptions.AUTO_INCREMENT?c.getNextMarkerInstanceValue(e):void 0!==(null==t?void 0:t.instanceKey)?t.instanceKey:0,null==t?void 0:t.closePreviousInstanceWithAction){const n=[l.QplInstanceKeyOptions.AUTO_INCREMENT,l.QplInstanceKeyOptions.MANUAL_INCREMENT].includes(t.instanceKeyOption)?s-1:s;if(this._markerInstanceExists(e,n)){const r=t.closePreviousInstanceWithAction||l.QuickLogActionType.ABORTED;var u,d;if(this.isDev&&this.allowListDevVerboseLogging.includes(e))null===(u=(d=this._enumConversion).getName)||void 0===u||u.call(d,e);c.markerEnd(e,r,{instanceKey:n})}}if(this._markerExists(e)){const t=this._numberOfMarkersOpen(e);var p,_,f,h,g,m;if(t<this._SOFT_MAX_CONCURRENT_OPEN_MARKERS){if(this.isDev&&this.allowListDevVerboseLogging.includes(e))__LOG__(3,void 0,void 0,void 0,["qpl"])`QPL [${null===(p=(_=this._enumConversion).getName)||void 0===p?void 0:p.call(_,e)}] is already opened ${t} time(s), attempting ${t+1}, not a problem if intended`}else __LOG__(3,void 0,void 0,!0,["qpl"])`QPL [${null===(f=(h=this._enumConversion).getName)||void 0===f?void 0:f.call(h,e)}] already has ${t} open markers`,SEND_LOGS(`QPL [${(null===(g=(m=this._enumConversion).getName)||void 0===g?void 0:g.call(m,e))||"unknown"}] has ${this._SOFT_MAX_CONCURRENT_OPEN_MARKERS} or more open markers`)}if(c.getInstance().markerStart(e,s),(null==t?void 0:t.annotations)&&(0,o.validateAnnotations)(e,s,t.annotations,this._healthLogger)){const n=t.annotations;c.getInstance().markerAnnotate(e,n,{instanceKey:s})}return{instanceKey:s,annotate:t=>{c.markerAnnotate(e,t,{instanceKey:s})},addPoint:(t,n)=>{c.markerPoint(e,t,{data:null==n?void 0:n.data,instanceKey:s})},end:t=>{c.markerEnd(e,t,{instanceKey:s})},drop:()=>{c.markerDrop(e,{instanceKey:s})}}}static markerAnnotate(e,t,n){var r,i;this.isDev&&this.allowListDevVerboseLogging.includes(e)&&(null===(r=(i=this._enumConversion).getName)||void 0===r||r.call(i,e),this._warnIfMarkerDoesntExist(e,n?n.instanceKey:0,"markerAnnotate"));(0,o.validateAnnotations)(e,null==n?void 0:n.instanceKey,t,this._healthLogger)&&c.getInstance().markerAnnotate(e,t,{instanceKey:null==n?void 0:n.instanceKey})}static markerPoint(e,t,n){var r,i;this.isDev&&this.allowListDevVerboseLogging.includes(e)&&(null===(r=(i=this._enumConversion).getName)||void 0===r||r.call(i,e),n&&JSON.stringify(n),this._warnIfMarkerDoesntExist(e,n?n.instanceKey:0,"markerPoint"));(null==n?void 0:n.data)&&(0,o.validateAnnotations)(e,n.instanceKey,n.data,this._healthLogger),(0,o.validatePoints)(e,(null==n?void 0:n.instanceKey)||0,t,this._healthLogger)&&c.getInstance().markerPoint(e,t,n)}static markerEnd(e,t,n){var r,i;this.isDev&&this.allowListDevVerboseLogging.includes(e)&&(null===(r=(i=this._enumConversion).getName)||void 0===r||r.call(i,e),l.QuickLogActionType.getName(t),this._warnIfMarkerDoesntExist(e,null==n?void 0:n.instanceKey,"markerEnd"));c.getInstance().markerEnd(e,t,null==n?void 0:n.instanceKey),(0,o.markerEnded)(e,null==n?void 0:n.instanceKey)}static markerDrop(e,t){var n,r;this.isDev&&this.allowListDevVerboseLogging.includes(e)&&(null===(n=(r=this._enumConversion).getName)||void 0===n||n.call(r,e),this._warnIfMarkerDoesntExist(e,null==t?void 0:t.instanceKey,"markerDrop"));c.getInstance().markerDrop(e,null==t?void 0:t.instanceKey),(0,o.markerEnded)(e,null==t?void 0:t.instanceKey)}static getActiveMarkerIDs(e){return c.getInstance().getActiveMarkerIDs({type:e.type})}static getMarker(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return c.getInstance().getMarker(e,t)}static getMarkerInstances(e){return c.getInstance().getMarkerInstances(e)}static _markerExists(e){const t=c.getMarkerInstances(e);return!!t&&0!==t.size}static _markerInstanceExists(e,t){const n=c.getMarkerInstances(e);return!!n&&void 0!==n.get(t)}static _numberOfMarkersOpen(e){const t=c.getMarkerInstances(e);return t?t.size:0}static _warnIfMarkerDoesntExist(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;var r,i;this._markerInstanceExists(e,t)||__LOG__(3)`QPL [${null===(r=(i=this._enumConversion).getName)||void 0===r?void 0:r.call(i,e)}] calling ${n} without a corresponding open marker for instance: ${t}`}}t.QPL=c,c._defaultSettings={sendEvent:e=>{if(c.isDev){var t,n;const r=null===(t=(n=c._enumConversion).cast)||void 0===t?void 0:t.call(n,e.marker_id);null!=r&&c.allowListDevVerboseLogging.includes(r)}return c._storageApi.add([e]),Promise.resolve()},getEventDetails:e=>({sampleRate:c._startupAllowListEventFilter.includes(e)?1:0,samplingMethod:i.QplSampleMethod.EVENT_BASED_SAMPLING}),isQplEnabled:()=>!0},c._SETTINGS_ON_STARTUP={sendEvent:e=>{if(c.isDev){var t,n;const r=null===(t=(n=c._enumConversion).cast)||void 0===t?void 0:t.call(n,e.marker_id);null!=r&&c.allowListDevVerboseLogging.includes(r)}return c._storageApi.add([e]),Promise.resolve()},getEventDetails:e=>({sampleRate:c._startupAllowListEventFilter.includes(e)?1:0,samplingMethod:i.QplSampleMethod.EVENT_BASED_SAMPLING}),isQplEnabled:()=>!1},c._qplSettingsDecorator={performanceNow:()=>performance.now(),moduleLoadTimestamp:performance.now(),logger:{debug:()=>{},warn:()=>{}},sendEvent:(e,t)=>{const n=c._qplReducePrecisionMapMs.get(e.marker_id);return null!=n&&0!==n&&(0,s.inplaceTruncateEventPrecision)(e,n),c._qplSettings.sendEvent(e,t)},quickLogConfigHelper:{getEventDetails:e=>c._qplSettings.getEventDetails(e),isKillswitchOn:()=>!c._qplSettings.isQplEnabled()}},c.markerInstanceHelper=new Map,c._SOFT_MAX_CONCURRENT_OPEN_MARKERS=100,c._startupAllowListEventFilter=[],c.allowListDevVerboseLogging=[],c.isDev=!1,c._qplReducePrecisionMapMs=new Map,c.resetQplSettings()},492533:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(73982)),a=r(n(836953));const o=Object.freeze({TRUST_CLIENT_REPORTED_SAMPLE_RATE:1}),s=Object.freeze({API_CALL:27787270,CRASH_RESILIENCE:27787276,LOCKLESS_IS_MARKER_ON_ACCURACY:27787269,LOCKLESS_MARKER_START:27787266,LOCKLESS_QUEUE_SIZE:27787265,LOCKLESS_STARTED_MARKERS_MAP_COLLISIONS:27787273,LOSS_TRACKING_MARKER_RECEIVED:27787272,LOSS_TRACKING_MARKER_STARTED:27787271,QPL_CONFIG_LOAD:27799150,QPL_CONFIG_SAVE:27791744,QPL_HEARTBEAT_HARDCODED_CONFIG:27792138,QPL_HEARTBEAT_SEVER_CONFIG:27803336,USAGE:27791726,ZERO_SAMPLE_RATE_DUE_MISSING_CONFIG:27787268,ZERO_SAMPLE_RATE_DUE_MISSING_EVENT_IN_CONFIG:27787267}),l=Object.freeze({REGULAR:1,USER_FLOW:2});function u(e,t){const n=t-e;if(0===n)return"0";const[r,i]=n.toFixed(6).split(".",2);return"0"===r?i.replace(/^0+/,""):r+i}function c(e,t,n,r){const a=t[e];if(!a||0===Object.entries(a).length)return null;const o={};return Object.keys(a).forEach((e=>{const t=a[e];null==t||0===t.length?delete a[e]:o[e]=r?r(t):t})),{[e]:(0,i.default)((0,i.default)({},null==n?void 0:n[e]),o)}}function d(e,t){if(null==e)return t;const n=(0,i.default)((0,i.default)((0,i.default)((0,i.default)((0,i.default)((0,i.default)((0,i.default)((0,i.default)((0,i.default)({},t),c("string",e,t)),c("int",e,t,Math.trunc)),c("double",e,t)),c("bool",e,t)),c("string_array",e,t)),c("int_array",e,t,(e=>e.map(Math.trunc)))),c("double_array",e,t)),c("bool_array",e,t));return Object.keys(n).forEach((e=>{const t=n[e];null!=t&&0!==Object.entries(t).length||delete n[e]})),0!==Object.entries(n).length?n:null}function p(e,t){if(!t)return e;const n={};return t.string&&(n.annotations=t.string),t.int&&(n.annotations_int=t.int),t.double&&(n.annotations_double=t.double),t.bool&&(n.annotations_bool=t.bool),t.string_array&&(n.annotations_string_array=t.string_array),t.int_array&&(n.annotations_int_array=t.int_array),t.double_array&&(n.annotations_double_array=t.double_array),t.bool_array&&(n.annotations_bool_array=t.bool_array),(0,i.default)((0,i.default)({},e),n)}const _=new Map([[1,"random_sampling"],[3,"per_user"]]);function f(e,t){return 0!==e&&(e<=1||("string"==typeof t?0==(n=t,((0,a.default)(n)>>>0)%e):Math.random()*e<=1));var n}t.default=class{constructor(e){let t;this._nextListenerId=1,this._defaultSampleRate=100,this._listeners=new Map,this._listenersWithMarker=new Map,this._debuggingId=null,this._markerSampleRate={},this.activeMarkers=new Map,this._settings=e,this._logger=e.logger,this._listenersWithMarker=null!==(t=e.listenersWithMarker)&&void 0!==t?t:new Map}getMarker(e,t){const n=this._getMarkerInstances(e);if(!n)return null;const r=n.get(t);return r||null}getMarkerInstances(e){return this._getMarkerInstances(e)}_getMarkerInstances(e){let t;return(null===(t=this._settings.quickLogConfigHelper)||void 0===t?void 0:t.isKillswitchOn())?null:this.activeMarkers.get(e)}addMarker(e,t,n){let r=this.activeMarkers.get(e);r||(r=new Map,this.activeMarkers.set(e,r)),r.set(t,n)}deleteMarker(e,t){let n;null===(n=this.activeMarkers.get(e))||void 0===n||n.delete(t)}markerStart(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.currentTimestamp(),{cancelOnUnload:i=!1,trackedForLoss:a=!1,type:o=l.REGULAR,samplingBasis:u=null}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(null===(t=this._settings.quickLogConfigHelper)||void 0===t?void 0:t.isKillswitchOn())return;this.getMarker(e,n)&&this._logger.warn(`Duplicate QPL markerId: ${e} & instanceKey: ${n}`);const[c,d,p]=this._getSamplingPolicy(e,u),_={passesSampling:c,timestamp:r,sampleRate:d,samplingMethod:p,points:[],cancelOnUnload:i,trackedForLoss:a,type:o};this._listeners.forEach((t=>{t.onMarkerStart(e,n,r)})),this._listenersWithMarker.forEach((t=>{t.onMarkerStartWithMarker(e,n,r,_)})),c&&this.addMarker(e,n,_),c&&!0===a&&this._uploadEvent({marker_id:s.LOSS_TRACKING_MARKER_STARTED,action_id:0,sample_rate:1,annotations_int:{tracked_marker_id:e},marker_type:l.REGULAR})}markerAnnotate(e,t){let{instanceKey:n=0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._listeners.forEach((r=>{Object.keys(t).forEach((i=>{const a=t[i];a&&Object.keys(a).forEach((t=>{r.onAnnotation(e,n,t,a[t])}))}))}));const r=this.getMarker(e,n);r&&(r.annotations=d(t,r.annotations))}markerPoint(e,t){let{instanceKey:n=0,data:r,timestamp:i=this.currentTimestamp()}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._listeners.forEach((a=>{let o;return a.onMarkerPoint(e,n,t,null==r||null===(o=r.string)||void 0===o?void 0:o.__key,i)}));const a=this.getMarker(e,n);if(!a)return;const o={name:t,timeSinceStart:Math.trunc(i-a.timestamp)},s=d(r);s&&(o.data=s),a.points.push(o)}markerEnd(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.currentTimestamp();this._listeners.forEach((i=>i.onMarkerEnd(t,e,n,r)));const a=this.getMarker(e,n);if(a){if(a.passesSampling){if(!0!==a.timestampIsApproximate){const s=a.type===l.USER_FLOW?a.points:function(e){return Array.from(new Set(e.map((e=>e.name)))).map((t=>e.find((e=>e.name===t)))).filter(Boolean)}(a.points),c=function(e,t){return!0===t?(0,i.default)((0,i.default)({},e),{},{tracked_for_loss:!0}):e}(p({marker_id:e,action_id:t,instance_id:n,sample_rate:a.sampleRate,method:_.get(a.samplingMethod),duration_ns:u(a.timestamp,r),points:s,metadata:{application_analytics:{time_since_qpl_module_init:r-this._settings.moduleLoadTimestamp}},marker_type:a.type,flags:o.TRUST_CLIENT_REPORTED_SAMPLE_RATE},a.annotations),a.trackedForLoss);this._uploadEvent(c)}this._debuggingId===e&&this._settings.onDebuggingIdEnded&&this._settings.onDebuggingIdEnded()}this.deleteMarker(e,n)}}markerDrop(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.deleteMarker(e,t);const n=this.currentTimestamp();this._listeners.forEach((r=>{r.onMarkerDrop&&r.onMarkerDrop(e,t,n)}))}markEvent(e,t,n){let r,{timestamp:i=this.currentTimestamp(),annotations:a}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(null===(r=this._settings.quickLogConfigHelper)||void 0===r?void 0:r.isKillswitchOn())return;const[s,u,c]=this._getSamplingPolicy(e);if(!s)return;const f=d("function"==typeof a?a():a),h={marker_id:e,action_id:0,instance_id:0,sample_rate:u,method:_.get(c),da_type:t,da_level:n,metadata:{application_analytics:{time_since_qpl_module_init:i-this._settings.moduleLoadTimestamp}},marker_type:l.REGULAR,flags:o.TRUST_CLIENT_REPORTED_SAMPLE_RATE};this._uploadEvent(p(h,f))}dropAllMarkers(){this.activeMarkers.clear()}setAlwaysOnSampleRate(e,t){this._markerSampleRate[e]=t}currentTimestamp(){return this._settings.performanceNow()}enableDebug(e){this._debuggingId=parseInt(e,10)}disableDebug(){this._debuggingId=null}addListener(e){const t=this._nextListenerId++;return this._listeners.set(t,e),{dispose:()=>{this._listeners.delete(t)}}}_getSamplingPolicy(e,t){let n,r,i,a,o;if(this._settings.unsampleAllEvents&&this._settings.unsampleAllEvents()||this._debuggingId===e)return[!0,1,1];const s=null!==(n=null===(r=this._settings.quickLogConfigHelper)||void 0===r?void 0:r.getEventDetails(e))&&void 0!==n?n:{sampleRate:0,samplingMethod:1};if(null==this._markerSampleRate[e]&&0!==s.sampleRate&&3===s.samplingMethod){let e;return[!0,null!==(e=s.sampleRate)&&void 0!==e?e:1,3]}const l=null!==(i=null!==(a=this._markerSampleRate[e])&&void 0!==a?a:s.sampleRate)&&void 0!==i?i:this._defaultSampleRate,u=null!==(o=s.samplingMethod)&&void 0!==o?o:1;return[f(l,t),l,u]}_uploadEvent(e){const t=this._settings.decorateEventBeforeUpload?this._settings.decorateEventBeforeUpload(e):e;this._settings.sendEvent(e,t)}getActiveMarkerIDs(e){let{type:t}=e;const n=new Set;return this.activeMarkers.forEach(((e,r)=>{e.forEach((e=>{e.type===t&&n.add(r)}))})),Array.from(n)}forEachMarkerInstance(e,t){const n=this._getMarkerInstances(e);if(n)for(const e of n.keys())t(e)}}},836953:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let t=-1;for(let r=0,i=e.length;r<i;r++)t=t>>>8^n[255&(t^e.charCodeAt(r))];return~t};let n=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];Int32Array&&(n=new Int32Array(n))},156854:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.addMessageIds=function(e,t){if(null!=t){const n=new Set;[e.ids,t].forEach((e=>e.forEach((e=>{n.has(e)||n.add(e)})))),e.ids=Array.from(n.values())}},t.buildEntry=function(e,t){if(!e||0===e.length)throw new Error("FtsIndexEntry: Expected non-empty blindIndices in constructor");return{ids:(0,i.default)(t,"ids"),prefixes:e,token:e[e.length-1]}};var i=r(n(132375))},369269:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildEntry=function(e,t,n,r){return{id:e,chatId:t,token:n,timestamp:r}}},344171:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildDBEntry=function(e,t,n,r,i){return{ftsRowId:e,id:t,chatId:n,timestamp:r,prefixes:i}},t.buildEntry=function(e,t,n,r){return{id:e,chatId:t,timestamp:n,prefixes:r}}},480925:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=new Error(e);if(void 0===t.stack)try{throw t}catch(e){}return t}},145498:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnsatisfiableJobRequirement=t.JobRequirement=void 0,t.joinRequirements=function(e,t){const n=e.filter((e=>!e.isSatisfiable()));if(n.length>0){const e=n.map((e=>e.name));return r=>(null==t||t("unsatisfiable",e,r),n[0].waitUntilSatisfied())}let r=e.map((()=>Promise.resolve())),i=Promise.resolve(),a=null;const o=()=>{if(r.every(((t,n)=>t===e[n].waitUntilSatisfied())))return void(a=null);const t=[],n=e.map((e=>{const n=e.waitUntilSatisfied();return e.isSatisfied()||(t.push(e.name),n.then((()=>{const n=t.indexOf(e.name);t.splice(n,1)}))),n}));return r=n,a=t,Promise.all(n).then(o)};return e=>{if(null==a){const e=o();null!=e&&(i=i.then((()=>e)))}return null==t||t(null==a?"satisfied":"unsatisfied",a,e),i}};class n{constructor(e){this._waitingOn=Promise.resolve(),this._satisfied=!0,this._newBlockers=null,this._blockersFinished=()=>{const e=this._newBlockers;if(null!=e)return this._newBlockers=null,Promise.all(e).then(this._blockersFinished);this._satisfied=!0},this.name=e}addBlocker(e){const t=e.catch((e=>{__LOG__(4,void 0,new Error,!0)`JobRequirement[${this.name}] blocker errored ${e}`,SEND_LOGS("job-blocker-rejected")}));if(this._satisfied)this._satisfied=!1,this._waitingOn=Promise.all([this._waitingOn,t]).then(this._blockersFinished);else{const e=this._newBlockers;null!=e?e.push(t):this._newBlockers=[t]}}waitUntilSatisfied(){return this._waitingOn}isSatisfied(){return this._satisfied}isSatisfiable(){return!0}}t.JobRequirement=n;t.UnsatisfiableJobRequirement=class extends n{constructor(e){super(e),super.addBlocker(new Promise((()=>{})))}addBlocker(){}isSatisfiable(){return!1}}},814271:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.UNSTARTED_JOB=t.RetryOnBackoff=t.RequiresPage=t.PersistedJobManager=t.InterruptJob=t.FINISHED_JOB=void 0;var i=r(n(311504)),a=n(145498),o=n(663166),s=n(990445);class l{constructor(e){this.feature=e}toString(){return`RequiresPage: ${this.feature}`}}t.RequiresPage=l;class u{constructor(e){this.backoffOptions=e}toString(){return"RetryOnBackoff"}}t.RetryOnBackoff=u;class c{constructor(e){this.result=e}}t.InterruptJob=c;const d="$unstarted";t.UNSTARTED_JOB=d;const p="$finished";t.FINISHED_JOB=p;function _(e){return`Job[${e.jobId}] (${e.type})`}function f(e){return`Job[${e.jobId}] (${e.type}.${e.step})`}function h(e,t,n){"unsatisfiable"===e?__LOG__(2)`${f(n)} halting because of ${t}`:"unsatisfied"===e&&__LOG__(2)`${f(n)} waiting on ${t}`}function g(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{jobStartTime:e.startTime,afterCrash:t,interruptJob:m}}function m(e){return new c(e)}t.PersistedJobManager=class{constructor(e){const{isRestartAfterCrash:t,accessors:n,unfinishedJobEntries:r}=e,i=new Map,a=r.then((e=>{const r=[],a=[];return e.forEach((e=>{e.stepHardStartCountAfterTimeout>=5?r.push(e):a.push(e)})),Promise.all(r.map((e=>{var t;return __LOG__(4,void 0,new Error,!0)`${t=e,`[Job ${t.type}] `}: stuck on the step ${e.step}, aborting the job`,SEND_LOGS(`job-stuck-${e.type}`),n.deletePersistedJob(e.jobId)}))).then((()=>{a.forEach((e=>{i.has(e.jobId)||(__LOG__(2)`${_(e)}: restarting`,i.set(e.jobId,this._runJob(e,t)))}))}))}));this.implementationLoaders=new Map,this.implementations=new Map,this.stepBlockers=new WeakMap,this.accessors=n,this.activeJobs=i,this.initialJobsPromise=a,this.listeners=e.listeners,this.deprecatedJobs=e.deprecatedJobs}loadAndRunJobFromId(e){const t=this.activeJobs.get(e);if(null!=t)return t;const n=this._loadAndRunJobFromId(e);return this.activeJobs.set(e,n),n}_loadAndRunJobFromId(e){var t=this;return(0,i.default)((function*(){const{initialJobsPromise:n,accessors:r}=t;yield n;const i=yield r.readPersistedJob(e);return i?t._runJob(i,!1):(__LOG__(3)`Persisted job missing for given ID`,null)}))()}_getJobImplementation(e){const{implementations:t,implementationLoaders:n}=this,r=t.get(e);if(r)return r;const i=n.get(e);if(!i)return null;const a=i();return t.set(e,a),a}_waitForBlockers(e,t){if(null==t||0===t.length)return Promise.resolve();const{stepBlockers:n}=this;let r=n.get(t);return null==r&&(r=(0,a.joinRequirements)(t.map((e=>e())),h),n.set(t,r)),r(e)}_runRemainingSteps(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;const{step:i}=e,a=t.findIndex((e=>e.stepName===i)),{requirements:o,code:l}=t[a].info(e.current,e.original,g(e,n));let u=this._waitForBlockers(e,o);return r&&(u=u.then(r)),u.then((()=>(__LOG__(2)`${f(e)}: running step`,l(e.current,e.original,g(e,n))))).then((r=>{if(r instanceof c)return __LOG__(2)`${f(e)}: InterruptJob`,r.result;const i=a+1;if(i>=t.length)return r;const o=t[i];return e.step=o.stepName,e.current=r,e.stepHardStartCountAfterTimeout=0,e.stepFirstStartTime=(0,s.unixTime)(),e.stepUnexpectedErrorCount=0,e.waitUntil=null,e.backedOffCount=0,this.accessors.updatePersistedJob(e).then((()=>this._runRemainingSteps(e,t,n)))}))}_runJob(e,t){var n=this;return(0,i.default)((function*(){var r;const{accessors:a,activeJobs:c,deprecatedJobs:h,listeners:{onJobFinished:m,onJobStarted:y}}=n;let E=yield n._getJobImplementation(e.type);const S=h[e.type];if(!E){if(!S)return __LOG__(4,void 0,new Error,!0)`No implementation for ${e.type}. Maybe it should have been put to the deprecated list?`,SEND_LOGS("missing-job-implementation"),yield a.deletePersistedJob(e.jobId),null;if("NOOP"===S)return __LOG__(3)`No implementation for deprecated ${e.type}, job deleted`,yield a.deletePersistedJob(e.jobId),null;E=yield S()}const T=E;S&&__LOG__(2)`Running deprecated job ${e.type}`;const v=null!==(r=e.stepFirstStartTime)&&void 0!==r?r:(0,s.unixTime)();if(e.stepFirstStartTime=v,e.stepUnexpectedErrorCount=e.stepUnexpectedErrorCount||0,e.backedOffCount=e.backedOffCount||0,e.step===p){let t=e.waitUntil;const r=(0,s.secondsUntil)(v);return null!=t&&(0,s.isInFuture)(t)&&r>0&&(__LOG__(2)`${_(e)}: skew detected, adjusting accordingly`,t=(0,s.castToUnixTime)(t-r),(0,s.isInFuture)(t)&&(e.stepFirstStartTime=(0,s.castToUnixTime)(v-r),e.waitUntil=t,yield n.accessors.updatePersistedJob(e))),null!=t&&(0,s.isInFuture)(t)||(__LOG__(2)`${_(e)}: removing completed, expired job from db`,yield a.deletePersistedJob(e.jobId)),c.delete(e.jobId),e.current}const A=e.step!==d?E.find((t=>t.stepName===e.step)):E[0];if(!A)return __LOG__(4,void 0,new Error,!0)`No implementation for ${e.type}.${e.step}`,SEND_LOGS("missing-job-step"),yield a.deletePersistedJob(e.jobId),null;e.step=A.stepName;const C=()=>{const r=e.waitUntil;let i=Promise.resolve();if(null!=r){const t=(0,s.futureUnixTime)(s.DAY_SECONDS);r>t?(__LOG__(2)`${f(e)}: trim wait from ${r} to ${t}`,e.waitUntil=t,i=n.accessors.updatePersistedJob(e).then((()=>(0,s.delayUntil)(t)))):(__LOG__(2)`${f(e)}: delaying until ${r}`,i=(0,s.delayUntil)(r))}return i.then((()=>n._runRemainingSteps(e,T,t,(()=>(e.waitUntil=null,(0,s.happenedWithin)(v,s.DAY_SECONDS)||e.stepHardStartCountAfterTimeout++,n.accessors.updatePersistedJob(e)))).catch((t=>{if(t instanceof l)return __LOG__(2)`${f(e)}: requires page`,e.stepHardStartCountAfterTimeout>0&&(--e.stepHardStartCountAfterTimeout,n.accessors.updatePersistedJob(e)),new Promise((()=>{}));if(t instanceof u){__LOG__(2)`${f(e)}: RetryOnBackoff`;const r=(0,o.getDelay)(++e.backedOffCount,t.backoffOptions);return e.waitUntil=(0,s.futureUnixTime)(Math.ceil(r/1e3)),e.stepHardStartCountAfterTimeout>0&&--e.stepHardStartCountAfterTimeout,n.accessors.updatePersistedJob(e).then(C)}if(e.stepUnexpectedErrorCount<1)return __LOG__(3)`${f(e)}: Unhandled exception. Tried ${e.stepUnexpectedErrorCount} times`,e.stepUnexpectedErrorCount++,n.accessors.updatePersistedJob(e).then(C);throw t}))))},P=C(),O=P.then(function(){var t=(0,i.default)((function*(t){__LOG__(2)`${f(e)}: finished job`;let r=null;try{r=m(e.jobId,e.type,e.original,t)}catch(t){__LOG__(4,void 0,new Error,!0)`onJobFinished for ${e.type} threw exception ${t}`,SEND_LOGS("onJobFinished-threw")}null!=r&&r>0?(e.waitUntil=(0,s.futureUnixTime)(Math.ceil(r/1e3)),e.step=p,e.current=t,e.stepFirstStartTime=(0,s.unixTime)(),yield n.accessors.updatePersistedJob(e)):(yield a.deletePersistedJob(e.jobId),c.delete(e.jobId))}));return function(){return t.apply(this,arguments)}}(),function(){var n=(0,i.default)((function*(n){__LOG__(4,void 0,new Error,!0)`${e.type} failed with error ${n}`,SEND_LOGS(`job-threw-exception-${e.type}`);const r=T.find((t=>t.stepName===e.step));if(r){const n=r.info(e.current,e.original,g(e,t));null!=n.stopRetryIf&&(yield n.stopRetryIf.onStopRetry(e.current,e.original,g(e,t)))}else __LOG__(4,void 0,new Error)`${e.type}: ${e.step} step not found`;yield a.deletePersistedJob(e.jobId),c.delete(e.jobId)}));return function(){return n.apply(this,arguments)}}());try{y(e.jobId,e.type,e.original)}catch(t){__LOG__(4,void 0,new Error,!0)`onJobStarted for ${e.type} threw exception ${t}`,SEND_LOGS("onJobStarted-threw")}return O.then((()=>P))}))()}addPersistedJobImplementation(e,t){const{implementationLoaders:n,deprecatedJobs:r}=this;if(n.has(e))return __LOG__(4,void 0,new Error,!0)`addPersistedJobImplementation called twice for ${e}`,void SEND_LOGS("repeat-job-loader");r&&r[e],n.set(e,t)}fireAndForget(e){this.accessors.maybeCreateJob(e).then((e=>{let{id:t}=e;return this.loadAndRunJobFromId(t)}))}waitUntilPersisted(e){return this.accessors.maybeCreateJob(e).then((e=>{let{id:t}=e;this.loadAndRunJobFromId(t)}))}waitUntilCompleted(e){return this.accessors.maybeCreateJob(e).then((e=>{let{id:t}=e;return this.loadAndRunJobFromId(t)}))}fireAndForgetNonPersisted(){__LOG__(2)`fireAndForgetNonPersisted not implemented in PersistedJobManager`}waitUntilCompletedNonPersisted(){return Promise.resolve((()=>__LOG__(2)`waitUntilCompletedNonPersisted not implemented in PersistedJobManager`))}}},431012:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JOB_PRIORITY=t.DEFAULT_JOB_TIMEOUT_MS=t.DEFAULT_JOB_PRIORITY=t.DEFAULT_CONCURRENCY=void 0;const r=n(654302)({SKIP:"SKIP_PRIORITIZATION",UI_ACTION:"UI_ACTION",LOW:"LOW",HIGH:"HIGH",BEST_EFFORT:"BEST_EFFORT"});t.JOB_PRIORITY=r;t.DEFAULT_CONCURRENCY=1;const i=r.LOW;t.DEFAULT_JOB_PRIORITY=i;t.DEFAULT_JOB_TIMEOUT_MS=1e4},855214:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.WAConcurrentBucketJobQueue=void 0;var i=r(n(311504)),a=r(n(73982)),o=n(643930),s=n(710038),l=n(431012),u=n(130676),c=r(n(132375)),d=n(975175);const p=new Map([[l.JOB_PRIORITY.HIGH,5],[l.JOB_PRIORITY.LOW,1]]);t.WAConcurrentBucketJobQueue=class{constructor(){this._isInitialized=!1}init(e,t){var n,r,i,a;if(this._isInitialized)throw new Error("WAConcurrentBucketJobQueue has already initialized");this._bestEffortBucketWaitTimeoutSec=null!==(n=null==e?void 0:e.bestEffortWaitTimeoutSec)&&void 0!==n?n:30,this._maxThreadsCount=e.maxConcurrency,this._availableThreadsCount=e.maxConcurrency,this._jobLogger=t,this._jobQuotaConfig=this._getMergedQuotaConfig(null==e?void 0:e.jobPrioritiesQuota),this._remainingJobCountMap=new Map(this._jobQuotaConfig),this._jobBucketsMap=new Map,this._initTimestampMs=Date.now();const o=new u.BaseJobBucket({jobMaxConcurrencyMap:null!==(r=e.maxConcurrencyPerJob)&&void 0!==r?r:{}}),s=new u.LowJobBucket({jobMaxConcurrencyMap:null!==(i=e.maxConcurrencyPerJob)&&void 0!==i?i:{}}),c=new u.LowJobBucket({jobMaxConcurrencyMap:null!==(a=e.maxConcurrencyPerJob)&&void 0!==a?a:{}});this._jobBucketsMap.set(l.JOB_PRIORITY.UI_ACTION,o),this._jobBucketsMap.set(l.JOB_PRIORITY.HIGH,o),this._jobBucketsMap.set(l.JOB_PRIORITY.LOW,s),this._jobBucketsMap.set(l.JOB_PRIORITY.BEST_EFFORT,c),this._isInitialized=!0}updateConfig(e){this._availableThreadsCount+=e.maxConcurrency-this._maxThreadsCount,this._maxThreadsCount=e.maxConcurrency,this._jobBucketsMap.forEach((t=>{var n;return t.updateConfig({jobMaxConcurrencyMap:null!==(n=e.maxConcurrencyPerJob)&&void 0!==n?n:{}})})),this._jobQuotaConfig=this._getMergedQuotaConfig(null==e?void 0:e.jobPrioritiesQuota),__LOG__(2)`[job-orchestator]: updated WAConcurrentBucketJobQueue config`}isInitialized(){return this._isInitialized}clearQueue(){if(!this._isInitialized)throw new Error("WAConcurrentBucketJobQueue not initialized");this._jobBucketsMap.forEach((e=>e.clear()))}enqueue(e,t,n){var r,u=this;if(!this._isInitialized)return Promise.reject(new Error("WAConcurrentBucketJobQueue not initialized"));let c,d;const p=new Promise(((e,t)=>{c=e,d=t})),_=(0,a.default)({priority:l.DEFAULT_JOB_PRIORITY},n),f=this._getJobBucketByType(_.priority);if(!f)return Promise.reject(new Error(`WAConcurrentBucketJobQueue no bucket for job with name ${e} was found.`));const h=`${_.priority}-${null!==(r=null==n?void 0:n.jobId)&&void 0!==r?r:(0,s.randomHex)(8).substr(0,64)}`,g=f.add(e,_,h,(0,i.default)((function*(){try{u._jobLogger.logJobStarted(h);const e=yield u._promiseTimeoutWrapper(t(),null==n?void 0:n.maxTimeoutMs);u._jobLogger.logJobCompleted(h),c(e)}catch(e){e instanceof o.TimeoutError?u._jobLogger.logJobTimeout(h):u._jobLogger.logJobError(h),d(e)}})));return this._jobLogger.logJobCreated({jobId:h,jobName:e,jobPriority:_.priority,pendingJobsCount:f.count()}),n&&n.priority===l.JOB_PRIORITY.UI_ACTION&&this._runJobTask(g),this._runJobTasks(),p}_getMergedQuotaConfig(e){let t;return t=e?new Map(e):new Map(p),t.set(l.JOB_PRIORITY.BEST_EFFORT,0),t}_getJobBucketByType(e){return this._jobBucketsMap.get(e)}_getJobsRemainingQuota(e){var t;return null!==(t=this._remainingJobCountMap.get(e))&&void 0!==t?t:0}_refreshJobsRemainingQuota(){this._remainingJobCountMap=new Map(this._jobQuotaConfig)}_getNextJobBucket(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=0,n=null,r=0;this._jobBucketsMap.forEach(((e,i)=>{t+=null==e?void 0:e.count(),r+=this._getJobsRemainingQuota(i),null==n&&e.count()>0&&this._getJobsRemainingQuota(i)>0&&(n=e)}));const i=null==n||0===r;return i&&this._refreshJobsRemainingQuota(),this._shouldRunBestEffortBucket(t,i)?this._getJobBucketByType(l.JOB_PRIORITY.BEST_EFFORT):null==n&&e?this._getNextJobBucket(!1):n}_shouldRunBestEffortBucket(e,t){var n;function r(e,t){const n=Date.now();return!(e>n)&&n-e<1e3*t}const i=this._getJobBucketByType(l.JOB_PRIORITY.BEST_EFFORT),a=e-(null!==(n=null==i?void 0:i.count())&&void 0!==n?n:0),o=null==i?void 0:i.getLastJobStartedTimestamp();if(0===(null==i?void 0:i.count()))return!1;if(null==o&&r(this._initTimestampMs,this._bestEffortBucketWaitTimeoutSec)){if(null==this._bestEffortScheduledRun){const e=function(e,t){const n=Math.ceil(e-Date.now())+1e3*t;return n>0?n:0}(this._initTimestampMs,this._bestEffortBucketWaitTimeoutSec);this._bestEffortScheduledRun=setTimeout((()=>{this._runJobTasks(),this._bestEffortScheduledRun=null}),e)}return!1}return!(a>0&&null!=o&&r(o,this._bestEffortBucketWaitTimeoutSec))&&t}_getJobBucketByJobId(e){const t=this._getJobBucketTypeByJobId(e);return(0,c.default)(this._jobBucketsMap.get(t),"this._jobBucketsMap.get((type: JOB_PRIORITY))")}_getJobBucketTypeByJobId(e){const t=e.split("-")[0],n=l.JOB_PRIORITY.cast(t);if(!n)throw new Error(`ConcurrentBucketQueue cannot extract known job priority type from id: ${e}`);return n}_decrementJobsQuota(e){const t=this._getJobBucketTypeByJobId(e);this._getJobsRemainingQuota(t)>0?this._remainingJobCountMap.set(t,this._getJobsRemainingQuota(t)-1):this._remainingJobCountMap.set(t,0)}_runJobTasks(){for(;this._availableThreadsCount>0;){const e=this._getNextJobBucket(),t=null==e?void 0:e.next();if(null==t)break;t.forEach((e=>{this._decrementJobsQuota(e.jobId),this._runJobTask(e)}))}}_promiseTimeoutWrapper(e,t){return void 0!==t?(0,d.promiseTimeout)(e,t):e}_runJobTask(e){var t=this;return(0,i.default)((function*(){const n=t._getJobBucketByJobId(e.jobId);t._availableThreadsCount--,n.markJobTaskPending(e);const{run:r,jobId:i,jobName:a}=e;try{var s;yield t._promiseTimeoutWrapper(r(),void 0===(null===(s=e.jobInfo)||void 0===s?void 0:s.maxTimeoutMs)?l.DEFAULT_JOB_TIMEOUT_MS:void 0)}catch(e){if(!(e instanceof o.TimeoutError))throw e;t._jobLogger.logJobTimeout(i),__LOG__(2)`[job-orchestator]: ${a} exceeding the timeout, release the thread.`}finally{t._availableThreadsCount++,n.markJobTaskDone(i),setTimeout((()=>t._runJobTasks()),0)}}))()}}},755627:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.WAConcurrentPreemptiveJobQueue=void 0;var i=r(n(311504)),a=r(n(73982)),o=n(643930),s=n(710038),l=n(431012),u=n(975175);t.WAConcurrentPreemptiveJobQueue=class{constructor(){this._isInitialized=!1,this._tasks=[],this._pendingTasks=[]}init(e,t){var n;if(this._isInitialized)throw new Error("ConcurrentPreemptiveJobQueue has already initialized");this._maxThreadsCount=e.maxConcurrency,this._availableThreadsCount=e.maxConcurrency,this._jobMaxConcurrency=null!==(n=e.maxConcurrencyPerJob)&&void 0!==n?n:{},this._jobLogger=t,this._isInitialized=!0}updateConfig(e){var t;this._availableThreadsCount+=e.maxConcurrency-this._maxThreadsCount,this._maxThreadsCount=e.maxConcurrency,this._jobMaxConcurrency=null!==(t=e.maxConcurrencyPerJob)&&void 0!==t?t:{},__LOG__(2)`[job-orchestator]: updated ConcurrentPreemptiveJobQueue config`}isInitialized(){return this._isInitialized}clearQueue(){if(!this._isInitialized)throw new Error("ConcurrentPreemptiveJobQueue not initialized");this._tasks=[],this._pendingTasks=[]}enqueue(e,t,n){var r,u=this;if(!this._isInitialized)return Promise.reject(new Error("ConcurrentPreemptiveJobQueue not initialized"));let c,d;const p=new Promise(((e,t)=>{c=e,d=t})),_=(0,a.default)({priority:l.DEFAULT_JOB_PRIORITY},n),f=null!==(r=null==n?void 0:n.jobId)&&void 0!==r?r:(0,s.randomHex)(8).substr(0,64),h=this._addJobTask(e,_,f,(0,i.default)((function*(){try{u._jobLogger.logJobStarted(f);const e=yield u._promiseTimeoutWrapper(t(),null==n?void 0:n.maxTimeoutMs);u._jobLogger.logJobCompleted(f),c(e)}catch(e){e instanceof o.TimeoutError?u._jobLogger.logJobTimeout(f):u._jobLogger.logJobError(f),d(e)}})));return n&&n.priority===l.JOB_PRIORITY.UI_ACTION&&this._runJobTask(h),this._runJobTasks(),p}_runJobTasks(){for(;this._availableThreadsCount>0;){const e=this._getNextJobTask();if(null==e)break;this._runJobTask(e)}}_promiseTimeoutWrapper(e,t){return void 0!==t?(0,u.promiseTimeout)(e,t):e}_runJobTask(e){var t=this;return(0,i.default)((function*(){t._availableThreadsCount--,t._markJobTaskPending(e);const{run:n,jobId:r,jobName:i}=e;try{var a;yield t._promiseTimeoutWrapper(n(),void 0===(null===(a=e.jobInfo)||void 0===a?void 0:a.maxTimeoutMs)?l.DEFAULT_JOB_TIMEOUT_MS:void 0)}catch(e){if(!(e instanceof o.TimeoutError))throw e;t._jobLogger.logJobTimeout(r),__LOG__(2)`[job-orchestator]: ${i} exceeding the timeout, release the thread.`}finally{t._availableThreadsCount++,t._markJobTaskDone(r),setTimeout((()=>t._runJobTasks()),0)}}))()}_addJobTask(e,t,n,r){const i={jobId:n,jobInfo:t,jobName:e,run:r};return this._jobLogger.logJobCreated({jobId:n,jobName:e,jobPriority:t.priority,pendingJobsCount:this._tasks.length}),this._tasks.push(i),i}_markJobTaskPending(e){this._pendingTasks.includes((t=>t.jobId===e.jobId))&&(__LOG__(4,void 0,new Error,!0)`Assertion failed::markJobTaskPending found jobId: ${e.jobId} in pending tasks`,SEND_LOGS("JobOrchestrator::markJobTaskPending")),this._pendingTasks.push(e),this._tasks=this._tasks.filter((t=>t.jobId!==e.jobId))}_markJobTaskDone(e){this._pendingTasks=this._pendingTasks.filter((t=>t.jobId!==e)),this._tasks.includes((t=>t.jobId===e))&&(__LOG__(4,void 0,new Error,!0)`Assertion failed::markJobTaskDone found jobId: ${e} in scheduled tasks`,SEND_LOGS("JobOrchestrator::markJobTaskDone"))}_getNextJobTask(){if(0===this._tasks.length)return null;const e=this._pendingTasks.reduce(((e,t)=>{var n;const r=null!==(n=e.get(t.jobName))&&void 0!==n?n:0;return e.set(t.jobName,r+1),e}),new Map);return this._tasks.filter((t=>{var n,r;return(null!==(n=e.get(t.jobName))&&void 0!==n?n:0)<(null!==(r=this._jobMaxConcurrency[t.jobName])&&void 0!==r?r:1)}))[0]}}},155722:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.WADefaultJobNoQueue=void 0;var i=r(n(311504)),a=n(710038),o=n(431012);t.WADefaultJobNoQueue=class{constructor(){this._isInitialized=!1}init(e,t){if(this._isInitialized)throw new Error("DefaultNoQueue has already initialized");this._jobLogger=t,this._isInitialized=!0}updateConfig(){}isInitialized(){return this._isInitialized}clearQueue(){}enqueue(e,t,n){var r=this;return(0,i.default)((function*(){var i,s;const l=null!==(i=null==n?void 0:n.jobId)&&void 0!==i?i:(0,a.randomHex)(8).substr(0,64);r._jobLogger.logJobCreated({jobId:l,jobName:e,jobPriority:null!==(s=null==n?void 0:n.priority)&&void 0!==s?s:o.JOB_PRIORITY.LOW,pendingJobsCount:0});try{r._jobLogger.logJobStarted(l);const e=yield t();return r._jobLogger.logJobCompleted(l),e}catch(e){throw r._jobLogger.logJobError(l),e}}))()}}},130676:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LowJobBucket=t.BaseJobBucket=void 0;var r=n(431012);class i{constructor(e){var t;this.tasks=[],this.pendingTasks=[],this.jobMaxConcurrency=null!==(t=e.jobMaxConcurrencyMap)&&void 0!==t?t:{}}updateConfig(e){var t;this.jobMaxConcurrency=null!==(t=e.jobMaxConcurrencyMap)&&void 0!==t?t:{}}next(){if(0===this.tasks.length)return null;const e=this.pendingTasks.reduce(((e,t)=>{var n;const r=null!==(n=e.get(t.jobName))&&void 0!==n?n:0;return e.set(t.jobName,r+1),e}),new Map),t=this.tasks.filter((t=>{var n,i;return(null!==(n=e.get(t.jobName))&&void 0!==n?n:0)<(null!==(i=this.jobMaxConcurrency[t.jobName])&&void 0!==i?i:r.DEFAULT_CONCURRENCY)}));return t.length>0?[t[0]]:null}add(e,t,n,r){const i={jobId:n,jobInfo:t,jobName:e,run:r};return this.tasks.push(i),i}markJobTaskPending(e){this.pendingTasks.includes((t=>t.jobId===e.jobId))&&(__LOG__(4,void 0,new Error,!0)`Assertion failed::markJobTaskPending found jobId: ${e.jobId} in pending tasks`,SEND_LOGS("JobOrchestrator::markJobTaskPending")),this.lastJobStartedTimestampMs=Date.now(),this.pendingTasks.push(e),this.tasks=this.tasks.filter((t=>t.jobId!==e.jobId))}markJobTaskDone(e){this.pendingTasks=this.pendingTasks.filter((t=>t.jobId!==e)),this.tasks.includes((t=>t.jobId===e))&&(__LOG__(4,void 0,new Error,!0)`Assertion failed::markJobTaskDone found jobId: ${e} in scheduled tasks`,SEND_LOGS("JobOrchestrator::markJobTaskDone"))}count(){return this.tasks.length}pendingCount(){return this.pendingTasks.length}clear(){this.tasks=[],this.pendingTasks=[]}getLastJobStartedTimestamp(){return this.lastJobStartedTimestampMs}}t.BaseJobBucket=i;t.LowJobBucket=class extends i{next(){var e,t;if(0===this.tasks.length)return null;const n=this.pendingTasks.reduce(((e,t)=>{var n;const r=null!==(n=e.get(t.jobName))&&void 0!==n?n:0;return e.set(t.jobName,r+1),e}),new Map),r=this.tasks.filter((e=>{var t,r;return(null!==(t=n.get(e.jobName))&&void 0!==t?t:0)<(null!==(r=this.jobMaxConcurrency[e.jobName])&&void 0!==r?r:1)}));if(0===r.length)return null;const i=null!==(e=this.jobMaxConcurrency[r[0].jobName])&&void 0!==e?e:1,a=null!==(t=n.get(r[0].jobName))&&void 0!==t?t:0;if(i>1&&a<i){const e=r.filter((e=>e.jobName===r[0].jobName)),t=Math.min(e.length,i-a);return e.slice(0,t)}return[r[0]]}}},88237:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbortError=t.ABORT_ERROR=void 0,t.catchAbort=function(e){return t=>{if(t.name===a)return e(t);throw t}};var r=n(643930);class i extends((0,r.customError)("AbortError")){}t.AbortError=i;const a="AbortError";t.ABORT_ERROR=a},431584:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){return(0,o.default)(e,function(){var r=(0,i.default)((function*(r){if(r.signal.aborted)throw new a.AbortError;const i=e(r),o=yield t.get(i,r);if(r.signal.aborted)throw new a.AbortError;if(null!=o)return o;const s=yield n(r);if(r.signal.aborted)throw new a.AbortError;return yield t.set(i,s,r),s}));return function(){return r.apply(this,arguments)}}())};var i=r(n(311504)),a=n(88237),o=r(n(947077))},583159:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.asyncSleep=o,t.asyncSleepAfterGivenLoopIteration=function(){return a.apply(this,arguments)};var i=r(n(311504));function a(){return(a=(0,i.default)((function*(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200;e>0&&e%t==0&&(yield o(n))}))).apply(this,arguments)}function o(e){return new Promise((t=>setTimeout(t,e)))}},674709:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.backoff=function(e,t){const{signal:n,timeoutIterator:r,timeoutIncludesTaskDuration:l}=(0,i.default)((0,i.default)({},s),e);return(0,o.default)((e=>{let{retry:n,failCount:i}=e;return new Promise(((e,o)=>{const s=Date.now();try{t((function(e){return Promise.reject(new a.default(e))}),i).then(e).catch(u)}catch(e){return void u(e)}function u(e){if(!(e instanceof a.default))return void o(e);const t=r.next();if(t.done)return void o(e.source);const i=Date.now()-s,u=l?Math.max(t.value-i,0):t.value;n(u)}}))}),n)},t.defaults=void 0;var i=r(n(73982)),a=r(n(870580)),o=r(n(755344));const s=Object.freeze({timeoutIncludesTaskDuration:!0});t.defaults=s},360336:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.backoff=function(){return u.apply(this,arguments)};var i=r(n(73982)),a=r(n(311504)),o=n(36530),s=r(n(870580));const l={retries:1/0};function u(){return(u=(0,a.default)((function*(e,t){const{delay:n,signal:r,retries:a}=(0,i.default)((0,i.default)({},l),e);let u=0,c=Date.now(),d=null;const p=e=>Promise.reject(new s.default(e));try{return c=Date.now(),yield t(p,u,r)}catch(_){if(u++,!(_ instanceof s.default))throw _;d=_}for(;u<=a;){const e=n({iterationCount:u,taskDuration:Date.now()-c});yield(0,o.delayMs)(e,r);try{return c=Date.now(),yield t(p,u,r)}catch(_){if(u++,!(_ instanceof s.default))throw _;d=_}}if(!d)throw new Error("assert: backoff completed without error or result");const _=undefined;throw d.source}))).apply(this,arguments)}},282302:(e,t)=>{"use strict";function n(e,t){let{delayMs:n,maxSize:r}=e,i=null;function a(e){return i&&i.args===e&&(i=null),t(e)}const o=()=>{if(null==i)return Promise.resolve();const e=i;return i=null,clearTimeout(e.timer),e.run(),e.batchPromise};return{accept:e=>{if(i)i.args.push(e);else{let t;const r=[e],o=new Promise((e=>{t=()=>{e(r)}})).then(a);i={args:r,batchPromise:o,run:t,timer:setTimeout(t,n)}}if(null==i)throw new Error("activeBatch should not be null here");const{args:t,batchPromise:s}=i,l=t.length-1;return null!=r&&t.length>=r&&o(),s.then((e=>e[l]))},runActiveBatch:o}}Object.defineProperty(t,"__esModule",{value:!0}),t.batch=function(e,t){const r=n(e,t);return e=>r.accept(e)},t.createSimpleBatcher=n},624877:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(311504)),a=r(n(73982)),o=r(n(132375)),s=r(n(287802));t.default=class{constructor(e,t){this._concurrency=e,this._groupLimits=t,this._runningTasksByGroup=new Map,this._enqueuedTasksByGroup=new Map}clearQueue(){this._enqueuedTasksByGroup.clear(),this._runningTasksByGroup.clear()}enqueue(e,t){let n,r;const o=new Promise(((e,t)=>{n=e,r=t}));var s;return this._doEnqueue((0,a.default)((0,a.default)({},t),{},{run:(s=(0,i.default)((function*(){try{const t=yield e();n(t)}catch(e){r(e)}})),function(){return s.apply(this,arguments)})})),this._runTasks(),o}_doEnqueue(e){this._getOrCreatePriorityQueueForGroup(e.group).push(e)}_doDequeue(){return this._getHighestPriorityAmongGroups()}_runTasks(){for(;this._getRunningTasksCount()<this._concurrency;){const e=this._doDequeue();if(null==e)break;this._runTask(e)}}_runTask(e){var t=this;return(0,i.default)((function*(){const{run:n,signal:r,group:i}=e,a=t._getRunningTasksForGroup(i);if(null==r?void 0:r.aborted)setTimeout((()=>t._runTasks()),0);else{a.add(e);try{yield n()}finally{a.delete(e),setTimeout((()=>t._runTasks()),0)}}}))()}_getHighestPriorityAmongGroups(){for(const e of this._enqueuedTasksByGroup.values()){const t=e.peek();if(t&&!this._isFullOfGroup(t.group))return e.pull()}return null}_getRunningTasksCount(){let e=0;for(const t of this._runningTasksByGroup.values())e+=t.size;return e}getEnqueuedTasksCount(){let e=0;for(const t of this._enqueuedTasksByGroup.values())e+=t.size();return e}_getRunningTasksForGroup(e){if(!this._runningTasksByGroup.has(e)){const t=new Set;return this._runningTasksByGroup.set(e,t),t}return(0,o.default)(this._runningTasksByGroup.get(e),"this._runningTasksByGroup.get(group)")}_isFullOfGroup(e){const t=this._runningTasksByGroup.get(e);return null!=t&&t.size>=this._getLimitForGroup(e)}_getOrCreatePriorityQueueForGroup(e){if(!this._enqueuedTasksByGroup.has(e)){const t=new s.default((e=>e.priority));this._enqueuedTasksByGroup.set(e,t)}return(0,o.default)(this._enqueuedTasksByGroup.get(e),"this._enqueuedTasksByGroup.get(group)")}_getLimitForGroup(e){const t=this._groupLimits[e];return null==t?1/0:t}}},209733:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.exponentialBackoff=function(e,t){const n=(0,a.default)((0,a.default)({},u),e),{signal:r,timeoutIncludesTaskDuration:c}=n,d=(0,i.default)(n,l),p=(0,s.exponentialBackoffIterator)(d);return(0,o.backoff)({signal:r,timeoutIterator:p,timeoutIncludesTaskDuration:c},t)};var i=r(n(222666)),a=r(n(73982)),o=n(674709),s=n(10647);const l=["signal","timeoutIncludesTaskDuration"],u=(0,a.default)((0,a.default)({},s.defaults),o.defaults)},924583:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filteredCatch=function(e,t){return n=>{if(Array.isArray(e)?e.some((e=>n instanceof e)):n instanceof e)return t(n);throw n}}},424646:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(88237),o=i(n(589970));t.default=class{constructor(){this._lastPromise=Promise.resolve(),this._controller=new r,this._pending=[]}enqueue(e){e.catch((()=>{}));const t=()=>e,n=this._controller.signal;this._lastPromise=this._lastPromise.then(t,t);const r=(0,o.default)(this._lastPromise,n).catch((0,a.catchAbort)((e=>{var t;throw null!==(t=this._cancellationError)&&void 0!==t?t:e})));return this._pending.push(r),r.finally((()=>{this._pending.length>0&&this._pending[0]===r&&this._pending.shift()}))}cancelAll(e){this._cancellationError=e,this._pending=[],this._controller.abort(),this._controller=new r}}},947077:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const n=new Map;return function(i){if(i.signal.aborted)return Promise.reject(new o.AbortError);const u=e.call(this,i);let c=n.get(u);if(null==c||c.aggregator.signal.aborted){const e=new l.default,r=(0,a.default)((0,a.default)({},i),{},{signal:e.signal});c={aggregator:e,promise:t.call(this,r).finally((()=>{e.dispose(),n.delete(u)}))},n.set(u,c)}const d=i.signal||(new r).signal;return c.aggregator.add(d),(0,s.default)(c.promise,d)}};var a=i(n(73982)),o=n(88237),s=i(n(589970)),l=i(n(878952))},987058:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.promiseAny=function(e){if(0===e.length)return Promise.reject(new r.AggregateError([]));return Promise.all(e.map(i)).then((e=>{throw new r.AggregateError(e)}),(e=>e))};var r=n(643930);function i(e){return new Promise(((t,n)=>Promise.resolve(e).then(n,t)))}},663166:(e,t)=>{"use strict";function n(e){const{relativeDelay:t=!1}=e;let n=null;const a=i(e.algo);return function(){const i=n;if(null==i)return n=t?Date.now():0,0;let o=r(e,a());if(t){const e=Date.now(),t=e-i;t>0&&(o=Math.max(0,o-t)),n=e}return o}}function r(e,t){let{max:n,min:r,jitter:i=.1}=e,a=t;return null!=n&&a>n&&(a=n),null!=r&&a<r&&(a=r),0!==i&&(a=Math.ceil(a*(1+i*Math.random()))),a}function i(e){switch(e.type){case"fibonacci":return function(e){let t=e.second-e.first,n=e.first-t;return function(){const e=t+n;return n=t,t=e,e}}(e);case"exponential":return function(e){const{base:t=2}=e;let n=e.first;return function(){const e=n;return n*=t,e}}(e);case"constant":return function(e){const t=e.delay;return function(){return t}}(e);case"adjust":return function(e){const{toMs:t,backoff:n}=e,r=i(n);return function(){return t(r())}}(e);default:throw new Error(`makeTimeFunc unrecognized backoff ${e.type}`)}}Object.defineProperty(t,"__esModule",{value:!0}),t.createPromiseTimer=function(e){const t=n(e);return function(e){return new Promise((n=>{const r=t();r>0?setTimeout(n,r,e):n(e)}))}},t.createTimer=n,t.getDelay=function(e,t){if(0===e)return 0;const n=i(t.algo);for(let t=1;t<e;t++)n();return r(t,n())}},667397:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;class n{constructor(e){this.promise=e,this.lastUsedTime=this.createdTime=+Date.now()}}t.default=class{constructor(e,t){let{maxCached:n=10,maxAge:r=1/0,shouldCache:i}=t;this._cache={},this._maxCached=n,this._maxAge=r,this._createPromiseFunc=e,this._shouldCacheFunc=i}getOrRun(e){const t=this._cache;if(this._maxAge!==1/0){const e=Date.now()-this._maxAge,n=Object.keys(t);for(let r=0;r<n.length;r++){const i=n[r];t[i].createdTime<e&&delete t[i]}}const r=t[e];if(r)return r.lastUsedTime=+Date.now(),r.promise;const i=Object.keys(t);if(i.length>=this._maxCached){let e,n;for(let r=0;r<i.length;r++){const a=i[r],o=t[a];(null==n||o.lastUsedTime<n)&&(n=o.lastUsedTime,e=a)}null!=e&&delete t[e]}for(var a=arguments.length,o=new Array(a>1?a-1:0),s=1;s<a;s++)o[s-1]=arguments[s];const l=this._createPromiseFunc.apply(void 0,[e,...o]);return t[e]=new n(l),l.then((t=>{const n=this._shouldCacheFunc;n&&this._cache[e]===l&&!n(t)&&delete this._cache[e]})).catch((()=>{this._cache[e]===l&&delete this._cache[e]})),l}isCached(e){const t=this._cache[e];if(t){let e=!0;if(this._maxAge!==1/0){const n=Date.now()-this._maxAge;e=t.createdTime>=n}return e&&Boolean(t)}return!1}}},293594:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.promiseCallSync=function(e,t){try{for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return Promise.resolve(e.apply(t,r))}catch(e){return Promise.reject(e)}}},36530:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delayMs=function(e,t){return new Promise(((n,i)=>{if(null==t?void 0:t.aborted)throw new r.AbortError;const a=setTimeout((function(){null==t||t.removeEventListener("abort",o),n()}),e);function o(){null==t||t.removeEventListener("abort",o),clearTimeout(a),i(new r.AbortError)}null==t||t.addEventListener("abort",o)}))},t.withTimeout=function(e,t,n){return new Promise(((r,i)=>{const a=setTimeout((()=>{try{r(n())}catch(e){i(e)}}),t);e.then((e=>{clearTimeout(a),r(e)}),(e=>{clearTimeout(a),i(e)}))}))};var r=n(88237)},476809:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.promiseEach=void 0;var i=r(n(311504));const a=function(){var e=(0,i.default)((function*(e,t){const n=[];for(let r=0;r<e.length;r++)n.push(yield t(e[r]));return n}));return function(){return e.apply(this,arguments)}}();t.promiseEach=a},962833:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.promiseLoop=function(){return a.apply(this,arguments)};var i=r(n(311504));function a(){return(a=(0,i.default)((function*(e,t){let n,r=!1;const i=e=>{r=!0,n=e};let a=0,o=t;for(;!r;)o=yield e(i,o,a),a++;return n}))).apply(this,arguments)}},917140:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.promiseMap=function(e,t){return Promise.resolve(e).then((e=>Promise.all(e.map(((e,n)=>t(e,n))))))}},204597:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.promiseProps=function(e){const t=Object.keys(e);return Promise.all(t.map((t=>e[t]))).then((function(e){const n={};for(let r=0;r<e.length;r++)n[t[r]]=e[r];return n}))}},316860:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PromiseQueueMap=t.PromiseQueue=void 0;t.PromiseQueue=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;this._promise=Promise.resolve(),this._maxDelay=e}wait(){return this._promise}enqueueHandlers(e,t,r){const i=this._promise.then((()=>e)).then(t,r),a=i.then();return this._promise=n(i,this._maxDelay),a}enqueue(e){const t=this._promise.then(e),r=t.then();return this._promise=n(t,this._maxDelay),r}};function n(e,t){return t>=0?new Promise((n=>{const r=()=>{n()};e.then(r,r),setTimeout(r,t)})):e.then(r,r)}function r(){}t.PromiseQueueMap=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;this._map=new Map,this._maxDelay=e}waitIfPending(e){return this._map.get(e)}wait(e){return this._map.get(e)||Promise.resolve()}enqueueHandlers(e,t,n,r){const i=this.wait(e).then((()=>t)).then(n,r);return this._addToMap(e,i)}enqueue(e,t){const n=this.wait(e).then(t);return this._addToMap(e,n)}_addToMap(e,t){const r=t.then();let i;const a=()=>{this._map.get(e)===i&&this._map.delete(e)};return i=n(t,this._maxDelay).then(a,a),this._map.set(e,i),r}}},589970:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(null==t)return e;let n;const i=t.aborted?Promise.reject(new r.AbortError):new Promise(((e,i)=>{const a=()=>{i(new r.AbortError)};t.addEventListener("abort",a),n=()=>{t.removeEventListener("abort",a)}}));return Promise.race([i,e]).finally((()=>{var e;null===(e=n)||void 0===e||e(),n=null}))};var r=n(88237)},652568:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.promiseReduce=void 0;var i=r(n(311504));const a=function(){var e=(0,i.default)((function*(e,t,n){let r=n;const i=e.length;for(let n=0;n<i;n++)r=yield t(r,e[n],n);return r}));return function(){return e.apply(this,arguments)}}();t.promiseReduce=a},583433:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PromiseRetryLoop=void 0;var r=n(663166),i=n(36530),a=n(827653);t.PromiseRetryLoop=class{constructor(e){this._resolvable=new a.Resolvable,this._promise=null,this._resetTime=null,this._currentLoopIdentificator=0,this.endWithValue=e=>{this._currentLoopIdentificator++,this._resolvable.resolve(e)},this._options=e}resetTimeoutAfter(e){this._resetTime=Date.now()+e}cancelReset(){this._resetTime=null}reset(){this._resolvable.resolveWasCalled()||(__LOG__(2)`PromiseRetryLoop: resetting ${this._options.name}`,this._currentLoopIdentificator++,this._runLoop())}start(){this._resolvable.resolveWasCalled()||(__LOG__(2)`PromiseRetryLoop: starting ${this._options.name}`,0!==this._currentLoopIdentificator&&__LOG__(4,void 0,new Error)`PromiseRetryLoop was called several times. You may have race conditions`,this._currentLoopIdentificator++,this._runLoop())}_runLoop(){const e=this._options,t=this._currentLoopIdentificator;let n=(0,r.createTimer)(this._options.timer);n();const a=()=>{if(this._resolvable.resolveWasCalled())return;if(t!==this._currentLoopIdentificator)return;const o=Date.now();return this._promise=(0,e.code)(this.endWithValue).then((()=>{if(this._resolvable.resolveWasCalled())return;const{resetDelay:t}=e;(void 0!==t&&Date.now()>=o+t||null!=this._resetTime&&this._resetTime<=Date.now())&&(__LOG__(2)`PromiseRetryLoop: resetting ${e.name}`,n=(0,r.createTimer)(this._options.timer)),this._resetTime=null;const s=n();return __LOG__(2)`PromiseRetryLoop: retrying ${e.name} in ${s}ms`,(0,i.delayMs)(s).then(a)})),this._promise};this._promise=Promise.resolve().then(a)}promise(){return this._resolvable.resolveWasCalled()?this._resolvable.promise:this._promise?Promise.race([this._resolvable.promise,this._promise.then((()=>this._resolvable.promise))]):Promise.reject(new Error(`PromiseRetryLoop ${this._options.name} had promise() called before start()`))}}},975175:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.promiseTimeout=void 0;var r=n(643930);t.promiseTimeout=(e,t,n)=>{let i=null,a=null;const o=new Promise(((e,o)=>{a=o,i=setTimeout((()=>{o(new r.TimeoutError(n)),clearTimeout(i)}),t)}));return Promise.race([e,o]).finally((()=>{a&&a(new Error),clearTimeout(i)}))}},99842:(e,t,n)=>{"use strict";var r=n(170315).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){let n;const i=new r;if(e.some((e=>e.aborted)))i.abort();else{n=()=>{for(const n of e)n.removeEventListener("abort",t);n=null};const t=()=>{var e;null===(e=n)||void 0===e||e(),i.abort()};for(const n of e)n.addEventListener("abort",t)}return t(i.signal).finally((()=>{var e;null===(e=n)||void 0===e||e()}))}},827653:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Resolvable=void 0;t.Resolvable=class{constructor(){this._isResolved=!1,this.promise=new Promise((e=>{this._resolve=e}))}resolve(e){this._isResolved=!0,this._resolve(e)}reject(e){this.resolve(Promise.reject(e))}resolveWasCalled(){return this._isResolved}}},755344:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return new Promise(((n,i)=>{let a,o=0,s=!1;if(t){const e=()=>{t.removeEventListener("abort",e),s=!0,null!=a&&clearTimeout(a),i(new r.AbortError)};if(t.aborted)return void e();t.addEventListener("abort",e)}!function t(){let r=!1,l=!1;a=null;try{const u=e({retry:e=>{if(!s&&!l){if(r=!0,o++,null==e)return t();a=setTimeout(t,e)}},failCount:o});if(!(u instanceof Promise))throw new TypeError("task must return a promise");u.then((e=>{s||r||(l=!0,n(e))})).catch((e=>{s||r||(l=!0,i(e))}))}catch(e){if(s||r)return;i(e)}}()}))};var r=n(88237)},870580:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(643930);class i extends((0,r.customError)("RetryableError")){constructor(e){super("see error at this.source"),this.source=e}}t.default=i},432921:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Semaphore=void 0;t.Semaphore=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this._count=0,this._queue=[],this._size=e}acquire(){return new Promise(((e,t)=>{this._performAcquisition(e,t)}))}availablePermits(){return this._size-this._count}_performRelease(){this._count--,this._dequeue()}_performAcquisition(e,t){if(this._count<this._size){this._count++;let t=!1;e({release:()=>{if(t)throw new Error("Permit has already been released");t=!0,this._performRelease()}})}else this._enqueue(e,t)}_enqueue(e,t){this._queue.push([e,t])}_dequeue(){if(0===this._queue.length)return;const[e,t]=this._queue.shift();this._performAcquisition(e,t)}}},878952:(e,t,n)=>{"use strict";var r=n(170315).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=class{constructor(){this._disposed=!1,this._controller=new r,this._signals=new Set,this.signal=this._controller.signal,this._handleAbort=e=>{this.delete(e.currentTarget),this._checkAborted()}}add(){this._throwIfDisposed();for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(const e of t)e.aborted||(e.addEventListener("abort",this._handleAbort),this._signals.add(e));this._checkAborted()}_checkAborted(){if(this._disposed)return;Array.from(this._signals).every((e=>e.aborted))&&(this.dispose(),this._controller.abort())}delete(){this._throwIfDisposed(),this._delete(...arguments)}_delete(){let e=!1;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(const t of n)this._signals.delete(t)&&(e=!0,t.removeEventListener("abort",this._handleAbort));e&&this._checkAborted()}_throwIfDisposed(){if(this._disposed)throw new Error("Attempt to modify disposed SignalAggregator")}dispose(){if(!this._disposed){this._disposed=!0;for(const e of this._signals)this._delete(e)}}}},225605:(e,t)=>{"use strict";t.Z=y;const n="undefined"!=typeof Promise?Promise:null,r="function"==typeof setImmediate?setImmediate:null;let i=0;const a=[],o=[],s=[],l={sentinel:"CONTINUE_AS_IF_NO_HANDLER"},u={sentinel:"RETRY_ASYNCHRONOUSLY"},c={sentinel:"TO_STRING"},d={sentinel:"DID_ERROR"};let p=null;const _=[],f=64,h=128,g=512,m="undefined"==typeof self?void 0:self;function y(e,t){this._flags=0,this._value=void 0,this._onFulfilled=void 0,this._onRejected=void 0,this._context=void 0,this._resolveLevel=0,this._control=void 0,this.x=void 0,this._thenableParent=null,this._parent=void 0,this._child=void 0,this._children=void 0,this.control=void 0,t&&(this._context=t.this),"function"==typeof e&&(this._onFulfilled=e,this._flags|=4,this._flags|=256,Y(e,this._context,(e=>N(this,0,!0,!1,e)),(e=>N(this,0,!1,!1,e))))}let E,S;function T(e){if(void 0===e)return E;if(b(e))return e;{const t=new y;return N(t,0,!0,!1,e),W(t,g),t}}function v(e){const t=new y;return t._value=e,W(t,514),_.push(t),t}function A(e){let t="";if(e._flags&h){t=(e._onFulfilled||e._onRejected).call(e._context,c)}else if(e._control)t=`.addRawControl(${e._control.name}, ${e._control.foo})`;else if(16&e._flags)t=`.endWithControls(${Object.keys(e.control)})`;else if(e._flags&g)t=1&e._flags?`Promise.resolve(${void 0===e._value?"":e._value})`:`Promise.reject(${void 0===e._value?"":e._value})`;else if(256&e._flags)switch(3&e._flags){case 2:case 0:case 1:t=`new Promise(${e._onFulfilled})`}else e._onFulfilled&&e._onRejected?t=`.then(${e._onFulfilled}, ${e._onRejected})`:e._onFulfilled?t=`.then(${e._onFulfilled})`:e._onRejected&&(t=`.catch(${e._onRejected})`);return t}function C(e){this.message=e,this.stack=new Error(e||this.name).stack}function P(){0===i&&(o.length||_.length)&&(i=1,S||(S=function(){let e,t,i=0;return"undefined"==typeof MutationObserver||m&&m.navigator&&m.navigator.standalone?n?function(){n.resolve().then(B)}:"function"==typeof r?function(){r(B)}:function(){setTimeout(B,0)}:(e=document.createTextNode(""),t=new MutationObserver(B),t.observe(e,{characterData:!0}),function(){e.data=i=1-i})}()),S())}function O(e,t){W(e,8),t._parent=e,e._children?e._children.push(t):e._child?(e._children=[e._child,t],e._child=void 0):e._child=t}function I(e){if(e&&("object"==typeof e||"function"==typeof e)){let t;try{t=e.then}catch(e){return p=e,d}if("function"==typeof t)return t}}function M(e){if(!e||b(e))return e;const t=I(e);if(t===d)return v(p);if(t){const n=new y((function(n,r){t.call(e,n,r)}));return n._thenableParent=e,n}return e}function b(e){return e instanceof y}function R(e,t,n){const r=b(e=M(e));let i,a,o,s,c=!1;if(r){if(!(3&e._flags))return W(e.then(t,n),32);W(e,8),c=!!(e._flags&f),o=e._context,i=1&e._flags?t:n,a=e._value}else i=t,a=e;if(!i)return T(e).then();if(a=H(i,o,a,!0),a===d)s=v(p);else{if(a===u)return T(e).then(t,n);if(a===l)return r?e.then():T(e);s=T(a)}return c&&(s=s.cancellable()),void 0!==o&&(s=s.then(),s._context=o),s}function N(e,t,n,r,i){if(t!==e._resolveLevel)return;const a=++e._resolveLevel;if(W(e,4),e._thenableParent=null,n)if(i===e)e._parent=void 0,U(e,!1,r,new TypeError("promise resolved to itself"));else if(b(i)){const t=3&i._flags;0===t?O(i,e):(e._parent=i,W(e,1024),W(i,8),U(e,1===t,r,i._value))}else{const t=I(i);t===d?(e._parent=void 0,U(e,!1,r,p)):t?(e._parent=void 0,e._thenableParent=i,Y(t,i,(t=>N(e,a,!0,!1,t)),(t=>N(e,a,!1,!1,t)))):U(e,!0,r,i)}else U(e,!1,r,i)}function w(e,t,n,r,i){t===e._resolveLevel&&(L(e),N(e,t,n,r,i))}function L(e){if(e._parent){const t=e._parent;if(e._parent=void 0,t._child===e)t._child=void 0;else if(t._children){const n=t._children;for(let t=0;t<n.length;t++)if(n[t]===e){n.splice(t,1);break}0===n.length&&(t._children=void 0)}}}function D(e){if(null==e)throw new Error(`Invalid .catch guard ${e}`);if("function"==typeof e)return e;if("object"==typeof e)throw new Error("Object guards in .catch are currently unsupported");return function(t){return t===e}}function k(e,t){return function(n,r){return n===c?`.catch(..., ${t})`:e&&!function(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(r===Error||r.prototype instanceof Error){if(t instanceof r)return!0}else if(r(t))return!0}return!1}(e,n)?l:r?u:t.call(this,n)}}function U(e,t,n,r){if(W(e,4|(t?1:2)),e._value=r,e._child)G(e._child,t,n,r),e._child=void 0;else if(e._children){const i=e._children;e._children=void 0;for(let e=0;e<i.length;e++)G(i[e],t,n,r)}else t||8&e._flags||_.push(e)}function G(e,t,n,r){e._resolveLevel++;const i=K(e,t);if(i&&32&e._flags){W(e,4);const a=H(i,e._context,r,!0);if(a!==u)return void(a===d?(e._parent=void 0,U(e,!1,n,p)):a===l?U(e,t,n,r):(e._parent=void 0,N(e,e._resolveLevel,!0,n,a)));e._flags&=-5}i?((n?s:o).push(e),P()):U(e,t,n,r)}function x(e,t){for(;0!==e.length;)t.push(e.pop())}function B(){for(;0!==a.length||0!==o.length;){0===a.length&&x(o,a);const e=a.pop(),t=e._parent;let n=!!(t&&1&t._flags),r=t&&t._value;const i=K(e,n);if(W(e,4),i){let t;do{t=H(i,e._context,r,!1)}while(t===u);t===d?(r=p,n=!1,e._parent=void 0):t!==l&&(r=t,n=!0,e._parent=void 0)}3&e._flags||(N(e,e._resolveLevel,n,!0,r),x(s,a))}for(i--;0!==_.length;){const e=_.pop();8&e._flags||j(e,e._value)}}y.resolve=T,y.reject=v,y.prototype.then=function(e,t){"function"!=typeof e&&(e=void 0),"function"!=typeof t&&(t=void 0);const n=new y;n._onFulfilled=e,n._onRejected=t,n._context=this._context,this._flags&f&&W(n,f);const r=3&this._flags;return 0===r?O(this,n):(W(this,8),(1===r?e:t)?(n._parent=this,o.push(n),P()):(n._parent=this,W(n,r),n._value=this._value,2===r&&_.push(n))),n},y.prototype.catch=function(e){const t=arguments.length-1;if(0===t)return this.then(void 0,e);const n=new Array(t);for(let e=0;e<t;e++)n[e]=D(arguments[e]);const r=k(n,arguments[t]),i=R(this,void 0,r);return i._onRejected&&W(i,h),i},y.all=function(e){return new y((function(t,n){let r=e.length;if(0===r)return void t([]);const i=new Array(e.length);function a(e){if(0==--r){const n=[];for(let t=0;t<i.length;t++){const r=i[t];n.push(r&&3&r._flags?r._value:e)}t(n)}return e}for(let t=0;t<e.length;t++)i[t]=R(e[t],a,n)}))},y.allSettled=function(e){return new y((function(t){const n=Array.from(e);let r=n.length;if(0===r)return void t([]);const i=new Array(n.length);function a(e){return function(n){const a=e?{status:"rejected",reason:n}:{status:"fulfilled",value:n};if(0==--r){const e=[];for(let t=0;t<i.length;t++){const n=i[t];e.push(n&&3&n._flags?n._value:a)}t(e)}return a}}const o=a(!1),s=a(!0);for(let e=0;e<n.length;e++)i[e]=R(n[e],o,s)}))},y.race=function(e){const t=M(e);if(b(t)){const e=t.then((e=>y.race(e)));return e._context=void 0,e._flags&=-65,e}return new y((function(e,n){for(let r=0;r<t.length;r++){const i=M(t[r]);if(!b(i)||3&i._flags)for(e(i),r++;r<t.length;r++){const e=t[r];b(e)&&W(e,8)}else i.then(e,n)}}))},y.prototype.toString=function(){const e=[];let t;for(let n=this,r=!1;n;n=n._parent){t=n,!r&&3&n._flags&&(r=!0,n._flags&g||(1&n._flags?e.push(`[resolved value: ${n._value}]`):e.push(`[rejected reason: ${n._value}]`)));let i=A(n);1024&n._flags&&(i=`~${i}`),e.push(i)}return e.reverse(),768&t._flags||(e[0]=`[Promise]${e[0]}`),e.join("\n")},y.prototype.finally=function(e){function t(t){return t===c?`.finally(${e})`:(e.call(this),l)}return W(this.then(t,t),h)},C.prototype=Object.create(Error.prototype,{name:{value:"AbortError"}}),y.CancellationError=C,y.prototype.cancellable=function(){return W(this.then(),f)},y.prototype.cancel=function(e){let t;for(let e=this;e&&!(3&e._flags);e=e._parent)e._flags&f&&(t=e);if(t)if(void 0===e&&(e=new C),K(t,!1)){const n=new y;L(t),O(n,t),w(n,0,!1,!1,e)}else w(t,t._resolveLevel,!1,!1,e)};const F=null==(null==m?void 0:m.dispatchEvent)?null:class extends Event{constructor(e,t){super(e,{cancelable:!0}),Object.defineProperties(this,{promise:{value:t.promise,enumerable:!0},reason:{value:t.reason,enumerable:!0}})}};function j(e,t){if(null!=(null==m?void 0:m.dispatchEvent)){const n=new F("unhandledrejection",{promise:e,reason:t});if(m.dispatchEvent(n),!m.PromiseRejectionEvent&&m.onunhandledrejection)try{m.onunhandledrejection(n)}catch(e){}}else"undefined"!=typeof process&&null!=process.emit?process.emit("unhandledRejection",t,e):console.error(`StackPromise did not catch ${t}`,e,t)}function Y(e,t,n,r){try{e.call(t,n,r)}catch(e){r(e)}}function K(e,t){if(!(4&e._flags))return t?e._onFulfilled:e._onRejected}function H(e,t,n,r){try{return r?e.call(t,n,!0):e.call(t,n)}catch(e){return p=e,d}}function W(e,t){return e._flags|=t,e}E=new y,N(E,0,!0,!1,void 0)},752751:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadStackPromisePolyfill=function(){function e(e){this.message=e,this.stack=new Error(e||this.name).stack}Promise.prototype.cancellable=function(){return console.info("StackPromise.cancellable noop"),this},Promise.prototype.cancel=function(){return console.info("StackPromise.cancel noop"),this},e.prototype=Object.create(Error.prototype,{name:{value:"AbortError"}}),Promise.CancellationError=e}},609398:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getProtoInternalSpec=function(e){if(null==e.internalSpec)throw new Error("Protobuf spec does not have internalSpec.");return e.internalSpec}},478337:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decimalStringToLongInt=function(e){if(!/^-?\d+$/.test(e))throw __LOG__(2)`"${e}" is not a valid decimal string`,new Error("decimalStringToLongInt is given an invalid decimal string");const t="-"===e[0],n=e.replace(/^-?0*/,""),i=n.length;if(i<16||16===i&&n<="9007199254740991")return t?-Number(n):Number(n);if(i>20||20===i&&n>"18446744073709551615"||t&&(i>19||19===i&&n>"9223372036854775807"))throw __LOG__(2)`"${e}" is over 64 bits`,new Error("decimalStringToHexLong is given value over 64 bits");let a=0,o=0;for(let e=0;e<i;e++)a=10*a+Number(n[e]),o=10*o+Math.floor(a/4294967296),a%=4294967296;return(0,r.createHexLongFrom32Bits)(o,a,t)},t.isBiggerLongInt=function(e,t){if("number"==typeof e&&"number"==typeof t)return e>t;const n="number"==typeof e?(0,r.hexLongFromNumber)(e):e,i="number"==typeof t?(0,r.hexLongFromNumber)(t):t;return(0,r.isBiggerHexLong)(n,i)},t.longIntToDecimalString=function(e){if("number"==typeof e)return e.toString(10);const t=(0,r.hexLongToHex)(e),n=[0];let i=0;for(let e=0;e<t.length;e++){i=(0,r.hexAt)(t,e);for(let e=0;e<n.length;e++)n[e]=16*n[e]+i,i=n[e]/10|0,n[e]%=10;for(;i>0;)n.push(i%10),i=i/10|0}const a=n.reverse().join("");return(0,r.hexLongIsNegative)(e)?"-"+a:a},t.maybeNumberOrThrowIfTooLarge=void 0,t.numberOrThrowIfTooLarge=i;var r=n(710038);function i(e){if("number"!=typeof e)throw __LOG__(2)`${e} is not a safe integer`,new Error("numberOrThrowIfTooLarge is given a non-safe integer");return e}t.maybeNumberOrThrowIfTooLarge=e=>null==e?e:i(e)},390672:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Spec=void 0,t.compileSpec=function(e){if(e.internalCompiledSpec)return e.internalCompiledSpec;const t=e.internalSpec;if(!t)throw new Error(`Message Class ${String(e)} does not have internalSpec`);const n=e.internalDefaults||{},o=Object.keys(t).filter((e=>e!==r.KEYS.ONEOF)),s=new Array(o.length),l=[],u=[],c=new Array(o.length),d=t[r.KEYS.ONEOF]||{};o.sort(((e,n)=>{const r=a(t,e),i=a(t,n);return r[0]-i[0]}));for(let e=0;e<o.length;e++){const i=o[e],d=a(t,i);c[e]=n[i];const p=d[1],_=d[0];if(l.push(_),u.push(p),(p&r.TYPE_MASK)===r.TYPES.MESSAGE)s[e]=d[2];else if((p&r.TYPE_MASK)===r.TYPES.ENUM){const t=d[2];if("function"==typeof t.cast)s[e]=t;else{let n,r=!0,i=0;for(const e in t)r&&e!==i++&&(r=!1);if(r){n=[];for(let e=0;e<i;e++)n.push(!0)}else{n={};for(const e in t)n[t[e]]=!0}s[e]=n}}else s[e]=null}const p={};for(const e in d)d[e].forEach((t=>{p[t]||(p[t]=[]),p[t].push(e)}));const _=t[r.KEYS.RESERVED]&&t[r.KEYS.RESERVED][r.KEYS.RESERVED_TAGS],f=t[r.KEYS.RESERVED]&&t[r.KEYS.RESERVED][r.KEYS.RESERVED_FIELDS],h=new i(o,l,u,c,s,d,p,_,f);return e.internalCompiledSpec=h,h};var r=n(739660);class i{constructor(e,t,n,r,i,a,o,s,l){this.names=e,this.fields=t,this.types=n,this.defaults=r,this.meta=i,this.oneofToFields=a,this.fieldToOneof=o,this.reservedTags=s?s.reduce(((e,t)=>(e[t]=!0,e)),{}):{},this.reservedFields=l?l.reduce(((e,t)=>(e[t]=!0,e)),{}):{}}}function a(e,t){const n=e[t];if(null==n)throw new Error(`fieldData of ${t} is missing`);return n}t.Spec=i},739660:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TYPE_MASK=t.TYPES=t.KEYS=t.FLAGS=t.ENC=void 0;t.FLAGS={REPEATED:64,PACKED:128,REQUIRED:256};t.TYPE_MASK=31;t.TYPES={INT32:1,INT64:2,UINT32:3,UINT64:4,SINT32:5,SINT64:6,BOOL:7,ENUM:8,FIXED64:9,SFIXED64:10,DOUBLE:11,STRING:12,BYTES:13,MESSAGE:14,FIXED32:15,SFIXED32:16,FLOAT:17};t.ENC={VARINT:0,BIT64:1,BINARY:2,BIT32:5};t.KEYS={ONEOF:"__oneofs__",RESERVED:"__reserved__",RESERVED_TAGS:"tags",RESERVED_FIELDS:"fields"}},767485:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typeToEncType=function(e){if(e&a.PACKED)return l.BINARY;const t=e&s;return t<=o.ENUM?l.VARINT:t<=o.DOUBLE?l.BIT64:t<=o.MESSAGE?l.BINARY:l.BIT32};var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=i(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=a?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(739660));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(i=function(e){return e?n:t})(e)}const{FLAGS:a,TYPES:o,TYPE_MASK:s,ENC:l}=r},382731:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.checkRequirements=l,t.checkValid=function(e,t){l(e,t);const n=h(t,e);if(n)throw n.path.reverse(),new TypeError(`Invalid value at ${n.path.join(".")}: ${n.error}`)};var i=r(n(836821)),a=n(390672),o=n(739660);const s=Number.MAX_SAFE_INTEGER;function l(e,t){const n=u(e,t);if(n)throw n.reverse(),new TypeError(`Message missing required value ${n.join(".")}`)}function u(e,t){const{names:n,types:r,meta:s}=(0,a.compileSpec)(e);let l;for(let e=0;e<r.length&&!l;e++){const a=r[e],c=n[e],d=(0,i.default)(t,c)?t[c]:void 0;if(a&o.FLAGS.REQUIRED&&null==d)l=[c];else if((a&o.TYPE_MASK)===o.TYPES.MESSAGE&&a&o.FLAGS.REPEATED&&null!=d){const t=s[e];let n;for(n=0;n<d.length&&!l;n++)l=u(t,d[n]);l&&l.push(`${c}[${n}]`)}else(a&o.TYPE_MASK)===o.TYPES.MESSAGE&&null!=d&&(l=u(s[e],d),l&&l.push(c))}return l}function c(e,t,n){return"string"==typeof e?!/^-?0x[0-9a-f]{16}$/i.test(e)&&(__LOG__(2)`"${_(e)}" is not a valid long`,{path:[],error:"value must be a hex string of the form '0x123...' or '-0x123...' where the tail is always 16 characters long"}):d(e,t,n)}function d(e,t,n){return"number"!=typeof e||e!=e||Math.floor(e)!==e?(__LOG__(2)`"${_(e)}" is not a valid int`,{path:[],error:"value must be an int"}):(e<t||e>=n)&&(__LOG__(2)`"${_(e)}" is out of range`,{path:[],error:"value is out of range"})}function p(e,t,n){return e?void 0:(__LOG__(2)`"${_(n)}" is not ${t}`,{path:[],error:"value is invalid"})}function _(e){return"string"==typeof e?`"${e}"`:Array.isArray(e)?`[${e.join(", ")}]`:`${e}`}const f=[void 0,e=>d(e,-2147483648,2147483648),e=>c(e,-s,s+1),e=>d(e,0,4294967296),e=>c(e,0,s+1),e=>d(e,-2147483648,2147483648),e=>c(e,-s,s+1),e=>p("boolean"==typeof e,"boolean",e),(e,t)=>p("number"==typeof e&&(t[e]||void 0!==t.cast(e)),"in enum",e),e=>c(e,0,s+1),e=>c(e,-s,s+1),e=>p("number"==typeof e,"number",e),e=>p("string"==typeof e,"string",e),e=>p(e instanceof ArrayBuffer||e instanceof Uint8Array,"ArrayBuffer or Uint8Array",e),h,e=>d(e,0,4294967296),e=>d(e,-2147483648,2147483648),e=>p("number"==typeof e,"number",e)];function h(e,t){const{names:n,fields:r,types:i,meta:s,oneofToFields:l,fieldToOneof:u,reservedTags:c,reservedFields:d}=(0,a.compileSpec)(t);let p;for(let t=0;t<n.length&&!p;t++){const a=n[t],h=i[t],g=e[a],m=h&o.TYPE_MASK,y=f[m];if(void 0===y)throw new Error(`Can not find the validator for type ${m}`);if(h&(o.FLAGS.PACKED|o.FLAGS.REPEATED)&&null!=g)if(Array.isArray(g)){const e=s[t];for(let t=0;t<g.length&&!p;t++)p=y(g[t],e),p&&p.path.push(`${a}[${t}]`)}else __LOG__(2)`"${_(g)}" is not an array`,p={path:[a],error:"repeated field must be array"};else if(null!=g){p=y(g,s[t]),p&&p.path.push(a);const n=u[a];n&&n.forEach((t=>{l[t].filter((e=>e!==a)).forEach((n=>{void 0!==e[n]&&(p={path:[t],error:`oneof has fields '${a}' and '${n}' set`})}))})),c[r[t]]&&(p={path:[a],error:`tag ${r[t]} is reserved`}),d[a]&&(p={path:[a],error:"field name is reserved"})}}return p}},309512:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.decodeProtobuf=function(e,t){const n=new a.Binary(t),r=y(e,n,void 0,!1);return(0,d.checkRequirements)(e,r),r},t.decodeProtobufWithUnknowns=function(e,t){const n=new a.Binary(t),r=y(e,n,void 0,!0);return(0,d.checkRequirements)(e,r),r},t.getUnknownFields=function(e){return(0,o.default)(e,"$$unsafeUnknownFields")?e.$$unsafeUnknownFields:null};var i=r(n(73982)),a=n(551168),o=r(n(836821)),s=n(710038),l=n(390672),u=n(739660),c=n(767485),d=n(382731);function p(e,t,n){if(e!==(0,c.typeToEncType)(t))throw new Error(`FormatError: ${n} encoded with wire type ${e}`)}function _(e,t,n){switch(t){case u.TYPES.INT32:return f(n,-2147483648,2147483648,e,a.parseInt64OrThrow);case u.TYPES.INT64:return n.readVarInt(h);case u.TYPES.UINT32:return f(n,0,4294967296,e,a.parseUint64OrThrow);case u.TYPES.UINT64:return n.readVarInt(g);case u.TYPES.SINT32:{const t=f(n,0,4294967296,e,a.parseInt64OrThrow);return 1&t?~(t>>>1):t>>>1}case u.TYPES.SINT64:return n.readVarInt(m);case u.TYPES.BOOL:return!!f(n,0,2,e,a.parseUint64OrThrow);case u.TYPES.ENUM:return n.readVarInt(a.parseInt64OrThrow);case u.TYPES.FIXED64:return n.readLong(g,!0);case u.TYPES.SFIXED64:return n.readLong(h,!0);case u.TYPES.DOUBLE:return n.readFloat64(!0);case u.TYPES.STRING:return n.readString(n.readVarInt(a.parseUint64OrThrow));case u.TYPES.BYTES:return n.readBuffer(n.readVarInt(a.parseUint64OrThrow));case u.TYPES.FIXED32:return n.readUint32(!0);case u.TYPES.SFIXED32:return n.readInt32(!0);case u.TYPES.FLOAT:return n.readFloat32(!0)}}function f(e,t,n,r,i){const a=e.readVarInt(i);if(a<t||a>=n)throw new Error(`FormatError: ${r} encoded with out-of-range value ${a}`);return a}function h(e,t){if((0,a.longFitsInDouble)(!0,e,t)){return 4294967296*e+E(t)}{const n=e<0;let r;r=n?0===t?-e:~e:e;const i=n?-t:t;return(0,s.createHexLongFrom32Bits)(r,i,n)}}function g(e,t){if((0,a.longFitsInDouble)(!1,e,t)){return 4294967296*E(e)+E(t)}return(0,s.createHexLongFrom32Bits)(e,t)}function m(e,t){let n=e>>>1,r=e<<31|t>>>1;return 1&t&&(n=~n,r=~r),h(n,r)}function y(e,t,n,r){var o;const{names:s,fields:c,types:d,meta:h,oneofToFields:g,fieldToOneof:m,reservedTags:E,reservedFields:S}=(0,l.compileSpec)(e),{internalDefaults:T}=e,v=n||(0,i.default)({},T)||{};v.$$unknownFieldCount=null!==(o=null==n?void 0:n.$$unknownFieldCount)&&void 0!==o?o:0;for(let e=0;e<s.length;e++)d[e]&u.FLAGS.REPEATED&&(v[s[e]]=[]);let A=0;const C=c.length>0;let P=c[0];for(;t.size();){const e=f(t,0,4294967296,"field and enc type",a.parseInt64OrThrow),n=7&e,i=e>>>3;if(C&&i!==P){const e=A;do{++A===c.length&&(A=0),P=c[A]}while(i!==P&&A!==e)}if(C&&i===P){const e=s[A],o=d[A];p(n,o,e);const l=o&u.TYPE_MASK,c=h[A];if(o&u.FLAGS.PACKED){const n=t.readVarInt(a.parseUint64OrThrow),r=t.readBinary(n);for(;r.size();){var O;const t=_(e,l,r);(l!==u.TYPES.ENUM||c[t]||void 0!==(null===(O=c.cast)||void 0===O?void 0:O.call(c,t)))&&v[e].push(t)}}else if(l===u.TYPES.MESSAGE){const n=t.readVarInt(a.parseUint64OrThrow),i=t.readBinary(n);if(o&u.FLAGS.REPEATED)v[e].push(y(c,i,void 0,r));else{const t=v[e];v[e]=y(c,i,t,r)}}else{var I;const n=_(e,l,t);(l!==u.TYPES.ENUM||c[n]||void 0!==(null===(I=c.cast)||void 0===I?void 0:I.call(c,n)))&&(o&u.FLAGS.REPEATED?v[e].push(n):v[e]=n)}const f=m[e];f&&void 0!==v[e]&&f.forEach((t=>{g[t].filter((t=>t!==e)).forEach((e=>{delete v[e]}))})),(E[i]||S[e])&&delete v[e]}else if(v.$$unknownFieldCount++,r){let e;switch(v.$$unsafeUnknownFields||(v.$$unsafeUnknownFields={}),n){case u.ENC.VARINT:e=t.readVarInt(a.parseInt64OrThrow);break;case u.ENC.BIT64:e=t.readBinary(8);break;case u.ENC.BINARY:e=t.readBinary(t.readVarInt(a.parseUint64OrThrow));break;case u.ENC.BIT32:e=t.readBinary(4)}v.$$unsafeUnknownFields[i]=e}else n===u.ENC.VARINT?t.readVarInt(a.parseInt64OrThrow):n===u.ENC.BIT64?t.advance(8):n===u.ENC.BINARY?t.advance(t.readVarInt(a.parseUint64OrThrow)):n===u.ENC.BIT32&&t.advance(4)}return v}function E(e){return e>=0?e:4294967296+e}},653313:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodeErrorInfo=function(){return void 0!==u?`Last encoded value for ${u}`:"No information known"},t.encodeProtobuf=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new r.Binary;return(0,l.checkValid)(e,t),h(n,t,e),u=void 0,n};var r=n(551168),i=n(710038),a=n(390672),o=n(739660),s=n(767485),l=n(382731);let u;function c(e,t){e.writeVarInt(t)}function d(e,t){if("number"==typeof t&&t<4503599627370496&&t>=-4503599627370496)e.writeVarInt(t>=0?2*t:2*-t-1);else{const n=new r.Binary;let a;"number"==typeof t?(a=t<0,n.writeVarInt(a?-t:t)):(a=(0,i.hexLongIsNegative)(t),n.writeVarIntFromHexLong(a?(0,i.negateHexLong)(t):t));const o=n.peek((()=>n.readByteArray())),s=o.byteLength;if(a){let e,t=0;do{e=o[t],o[t]=128&e|(127&e)-1&127,t++}while(255===o[t-1])}let l=a?1:0;for(let e=0;e<s;e++){const t=o[e],n=128&t|(63&t)<<1|l;l=(64&t)>>6,o[e]=n}1===l&&(o[s-1]|=128,n.writeInt8(1)),e.writeBinary(n)}}function p(e,t){"number"==typeof t?e.writeVarInt(t):e.writeVarIntFromHexLong(t)}const _=[void 0,c,p,c,p,d,d,(e,t)=>{e.writeVarInt(t?1:0)},c,(e,t)=>{"number"==typeof t?e.writeUint64(t,!0):e.writeHexLong(t,!0)},(e,t)=>{"number"==typeof t?e.writeInt64(t,!0):e.writeHexLong(t,!0)},(e,t)=>{e.writeFloat64(t,!0)},function(e,t){e.writeVarInt((0,r.numUtf8Bytes)(t)),e.writeString(t)},function(e,t){e.writeVarInt(t.byteLength),e.writeBuffer(t)},function(e,t,n){e.writeWithVarIntLength(((e,t)=>h(e,t,n)),t)},(e,t)=>{e.writeUint32(t,!0)},(e,t)=>{e.writeInt32(t,!0)},(e,t)=>{e.writeFloat32(t,!0)}],f=_.map((e=>{if(null!=e)return(e,n)=>{e.writeWithVarIntLength(t,n)};function t(t,n){for(let r=0;r<n.length;r++)e(t,n[r])}}));function h(e,t,n){const{names:r,fields:i,types:l,meta:c}=(0,a.compileSpec)(n),{internalDefaults:d}=n;for(let n=0;n<r.length;n++){const a=r[n];let p=t[a];if(null==p&&d&&(p=d[a]),null!=p){u=a;const t=i[n],r=l[n],d=r&o.TYPE_MASK,h=c[n],g=8*t|(0,s.typeToEncType)(r);if(r&o.FLAGS.PACKED){if(p.length>0){e.writeVarInt(g);(0,f[d])(e,p,h)}}else if(r&o.FLAGS.REPEATED)for(let t=0;t<p.length;t++){e.writeVarInt(g);(0,_[d])(e,p[t],h)}else{e.writeVarInt(g);(0,_[d])(e,p,h)}}}}},979320:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KEY_TYPE=void 0,t.castToPreKeyId=_,t.castToSerializedPubKey=f,t.deserializePreKey=function(e){try{const{id:t,publicKey:n,privateKey:r}=(0,o.decodeProtobuf)(i.PreKeyRecordStructureSpec,e);return null==t||null==n||null==r?null:{id:_(t),keyPair:c((0,a.toBytes)(r,32),f(new Uint8Array(n)))}}catch(e){return null}},t.ecdh=function(e,t){return(0,r.scalarMult)(e,t.subarray(1)).buffer},t.makeKeyPair=u,t.makeKeyPairFrom=function(e){const{publicKey:t,secretKey:n}=(0,r.keypairFromSecretKey)(e);return l((0,a.ensureSize)(t,32),(0,a.ensureSize)(n,32))},t.makeKeyPairFromArrayBuffers=function(e,t){return{publicKey:(0,a.toBytes)(e,32),privateKey:(0,a.toBytes)(t,32)}},t.makeKeyPairFromSerialized=c,t.makePreKeys=function(e,t){let n=(e-1)%s;n<=0&&(n+=s);const r=[];for(let e=0;e<t;e++){const e=n===s?1:n+1,t=u(),o=(0,a.encodeSignalProto)(i.PreKeyRecordStructureSpec,{id:e,publicKey:p(t),privateKey:t.privateKey});r.push({plainObject:{id:e,keyPair:t},record:o}),n=e}return r},t.makeRawSenderKey=function(){const e=(0,a.makeBytes)(32);return self.crypto.getRandomValues(e),e},t.makeSerializedKeyPair=function(){const e=u();return d(e.privateKey,p(e))},t.makeSerializedKeyPairFrom=d,t.serializeIdentity=function(e){const t=(0,a.makeBytes)(33);return t[0]=5,t.set((0,a.ensureSize)(e,32),1),t},t.serializePubKey=p,t.toSerializedKeyPair=function(e){return d(e.privateKey,p(e))};var r=n(903190),i=n(524750),a=n(350856),o=n(309512);t.KEY_TYPE=5;const s=16777215;function l(e,t){return{publicKey:e,privateKey:t}}function u(){const{publicKey:e,secretKey:t}=(0,r.keyPair)();return t[0]&=248,t[31]=64|63&t[31],l((0,a.ensureSize)(e,32),(0,a.ensureSize)(t,32))}function c(e,t){return l((0,a.sliceBytes)(t,1,32),e)}function d(e,t){return{serializedPubKey:t,privateKey:e}}function p(e){const t=(0,a.makeBytes)(33);return t[0]=5,t.set(e.publicKey,1),t}function _(e){return(0,a.ensureIntInRange)(e,1,s)}function f(e){if(0===e.length||5!==e[0])throw new Error("Unrecognized public key type");return(0,a.ensureSize)(e,33)}},350856:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HMAC_SHA256=t.AES_CBC=void 0,t.areSessionHashesEqual=function(e,t){return(0,i.arrayBuffersEqual)(e,t)},t.castRegistrationId=function(e){return c(e)},t.castSenderKeyId=function(e){return c(e)},t.castToByteEncoded=function(e){return e},t.castToSessionHash=function(e){return e},t.decodeSignalProto=function(e,t,n){return n((0,a.decodeProtobuf)(e,t))},t.encodeSignalProto=function(e,t){return(0,o.encodeProtobuf)(e,t).readByteArray()},t.ensureIntInRange=c,t.ensureSize=u,t.hkdf=function(e,t,n,i){return(0,r.extractWithSaltAndExpand)(e,t,n,i).then((e=>new Uint8Array(e)))},t.makeBytes=function(e){return new Uint8Array(e)},t.makeCryptoKey=function(e,t){let n,r;"hmac-sha256"===t?(n=l,r=["sign"]):(n=s,r=["encrypt","decrypt"]);return self.crypto.subtle.importKey("raw",e,n,!1,r)},t.makeRegistrationId=function(e){const t="extendedRange"===e?2147483646:16380;return(0,i.randomNumberLessThan)(t)+1},t.makeSenderKeyId=function(){return(0,i.randomNumberLessThan)(-1>>>1)+1},t.readBytes=function(e,t){return e.readByteArray(t)},t.sliceBytes=function(e,t,n){if(e.length-t<n)throw new Error(`Can not split off ${n} bytes from index ${t} of ${e.length} bytes`);return e.slice(t,t+n)},t.toBuffer=function(e){const t=e.buffer,n=e.byteOffset,r=e.length;return 0===n&&r===t.byteLength?t:t.slice(n,n+r)},t.toBytes=function(e,t){return u(new Uint8Array(e),t)};var r=n(684659),i=n(703177),a=n(309512),o=n(653313);const s={name:"AES-CBC"};t.AES_CBC=s;const l={name:"HMAC",hash:"SHA-256"};function u(e,t){if(e.length!==t)throw new Error(`Signal expected ${t} bytes, given ${e.length}`);return e}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4294967296;if("number"==typeof e&&t<=e&&e<n&&Math.floor(e)===e)return e;throw new Error(`Expected integer in range [${t}, ${n}), given ${String(e)}`)}t.HMAC_SHA256=l},524750:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignedPreKeyRecordStructureSpec=t.SessionStructureSpec=t.SenderSigningKeySpec=t.SenderMessageKeySpec=t.SenderKeyStateStructureSpec=t.SenderKeyRecordStructureSpec=t.SenderChainKeySpec=t.RecordStructureSpec=t.PreKeyRecordStructureSpec=t.PendingPreKeySpec=t.PendingKeyExchangeSpec=t.MessageKeySpec=t.IdentityKeyPairStructureSpec=t.ChainSpec=t.ChainKeySpec=void 0;var r=n(739660);const i={};t.SessionStructureSpec=i;const a={};t.PendingPreKeySpec=a;const o={};t.PendingKeyExchangeSpec=o;const s={};t.ChainSpec=s;const l={};t.MessageKeySpec=l;const u={};t.ChainKeySpec=u;const c={};t.RecordStructureSpec=c;const d={};t.PreKeyRecordStructureSpec=d;const p={};t.SignedPreKeyRecordStructureSpec=p;const _={};t.IdentityKeyPairStructureSpec=_;const f={};t.SenderKeyStateStructureSpec=f;const h={};t.SenderSigningKeySpec=h;const g={};t.SenderMessageKeySpec=g;const m={};t.SenderChainKeySpec=m;const y={};t.SenderKeyRecordStructureSpec=y,i.internalSpec={sessionVersion:[1,r.TYPES.UINT32],localIdentityPublic:[2,r.TYPES.BYTES],remoteIdentityPublic:[3,r.TYPES.BYTES],rootKey:[4,r.TYPES.BYTES],previousCounter:[5,r.TYPES.UINT32],senderChain:[6,r.TYPES.MESSAGE,s],receiverChains:[7,r.FLAGS.REPEATED|r.TYPES.MESSAGE,s],pendingKeyExchange:[8,r.TYPES.MESSAGE,o],pendingPreKey:[9,r.TYPES.MESSAGE,a],remoteRegistrationId:[10,r.TYPES.UINT32],localRegistrationId:[11,r.TYPES.UINT32],needsRefresh:[12,r.TYPES.BOOL],aliceBaseKey:[13,r.TYPES.BYTES]},a.internalSpec={preKeyId:[1,r.TYPES.UINT32],signedPreKeyId:[3,r.TYPES.INT32],baseKey:[2,r.TYPES.BYTES]},o.internalSpec={sequence:[1,r.TYPES.UINT32],localBaseKey:[2,r.TYPES.BYTES],localBaseKeyPrivate:[3,r.TYPES.BYTES],localRatchetKey:[4,r.TYPES.BYTES],localRatchetKeyPrivate:[5,r.TYPES.BYTES],localIdentityKey:[7,r.TYPES.BYTES],localIdentityKeyPrivate:[8,r.TYPES.BYTES]},s.internalSpec={senderRatchetKey:[1,r.TYPES.BYTES],senderRatchetKeyPrivate:[2,r.TYPES.BYTES],chainKey:[3,r.TYPES.MESSAGE,u],messageKeys:[4,r.FLAGS.REPEATED|r.TYPES.MESSAGE,l]},l.internalSpec={index:[1,r.TYPES.UINT32],cipherKey:[2,r.TYPES.BYTES],macKey:[3,r.TYPES.BYTES],iv:[4,r.TYPES.BYTES]},u.internalSpec={index:[1,r.TYPES.UINT32],key:[2,r.TYPES.BYTES]},c.internalSpec={currentSession:[1,r.TYPES.MESSAGE,i],previousSessions:[2,r.FLAGS.REPEATED|r.TYPES.MESSAGE,i]},d.internalSpec={id:[1,r.TYPES.UINT32],publicKey:[2,r.TYPES.BYTES],privateKey:[3,r.TYPES.BYTES]},p.internalSpec={id:[1,r.TYPES.UINT32],publicKey:[2,r.TYPES.BYTES],privateKey:[3,r.TYPES.BYTES],signature:[4,r.TYPES.BYTES],timestamp:[5,r.TYPES.FIXED64]},_.internalSpec={publicKey:[1,r.TYPES.BYTES],privateKey:[2,r.TYPES.BYTES]},f.internalSpec={senderKeyId:[1,r.TYPES.UINT32],senderChainKey:[2,r.TYPES.MESSAGE,m],senderSigningKey:[3,r.TYPES.MESSAGE,h],senderMessageKeys:[4,r.FLAGS.REPEATED|r.TYPES.MESSAGE,g]},h.internalSpec={public:[1,r.TYPES.BYTES],private:[2,r.TYPES.BYTES]},g.internalSpec={iteration:[1,r.TYPES.UINT32],seed:[2,r.TYPES.BYTES]},m.internalSpec={iteration:[1,r.TYPES.UINT32],seed:[2,r.TYPES.BYTES]},y.internalSpec={senderKeyStates:[1,r.FLAGS.REPEATED|r.TYPES.MESSAGE,f]}},236082:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.sendGetExperimentConfigRPC=function(){return p.apply(this,arguments)};var i=r(n(311504)),a=n(911794),o=n(133630),s=n(509132),l=n(881225),u=n(584139),c=n(96652),d=n(496995);function p(){return(p=(0,i.default)((function*(e,t){const n=(0,u.makeGetExperimentConfigRequest)(e),r=yield(0,a.sendSmaxStanza)(n,t),i=(0,l.parseGetExperimentConfigResponseSuccess)(r,n);if(i.success)return{name:"GetExperimentConfigResponseSuccess",value:i.value};const p=(0,o.parseGetExperimentConfigResponseErrorNoRetry)(r,n);if(p.success)return{name:"GetExperimentConfigResponseErrorNoRetry",value:p.value};const _=(0,s.parseGetExperimentConfigResponseErrorRetry)(r,n);if(_.success)return{name:"GetExperimentConfigResponseErrorRetry",value:_.value};throw new c.SmaxParsingFailure((0,d.errorMessageRpcParsing)("GetExperimentConfig",{Success:i,ErrorNoRetry:p,ErrorRetry:_}))}))).apply(this,arguments)}},279697:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseExperimentConfigMixin=function(e){const t=(0,i.assertTag)(e,"prop");if(!t.success)return t;const n=(0,i.attrIntRange)(e,"config_code",1,void 0);if(!n.success)return n;const a=(0,i.attrString)(e,"config_value");if(!a.success)return a;const o=(0,i.optional)(i.attrIntRange,e,"config_expo_key",0,void 0);if(!o.success)return o;return(0,r.makeResult)({configCode:n.value,configValue:a.value,configExpoKey:o.value})};var r=n(452813),i=n(593695)},908505:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseExperimentOrSamplingConfigMixinGroup=function(e){const t=(0,i.parseExperimentConfigMixin)(e);if(t.success)return(0,r.makeResult)({name:"ExperimentConfig",value:t.value});const n=(0,a.parseSamplingConfigMixin)(e);if(n.success)return(0,r.makeResult)({name:"SamplingConfig",value:n.value});return(0,o.errorMixinDisjunction)(e,["ExperimentConfig","SamplingConfig"],[t,n])};var r=n(452813),i=n(279697),a=n(607756),o=n(593695)},133630:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.parseGetExperimentConfigResponseErrorNoRetry=function(e,t){const n=(0,l.assertTag)(e,"iq");if(!n.success)return n;const r=(0,l.flattenedChildWithTag)(e,"error");if(!r.success)return r;const u=(0,s.parseIQErrorResponseMixin)(e,t);if(!u.success)return u;const c=(0,o.parseIQErrorBadRequestOrFeatureNotImplementedMixinGroup)(r.value);if(!c.success)return c;return(0,a.makeResult)((0,i.default)((0,i.default)({},u.value),{},{errorIQErrorBadRequestOrFeatureNotImplementedMixinGroup:c.value}))};var i=r(n(73982)),a=n(452813),o=n(357229),s=n(598076),l=n(593695)},509132:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.parseGetExperimentConfigResponseErrorRetry=function(e,t){const n=(0,l.assertTag)(e,"iq");if(!n.success)return n;const r=(0,l.flattenedChildWithTag)(e,"error");if(!r.success)return r;const u=(0,o.parseIQErrorInternalServerErrorMixin)(r.value);if(!u.success)return u;const c=(0,s.parseIQErrorResponseMixin)(e,t);if(!c.success)return c;return(0,a.makeResult)((0,i.default)({errorIQErrorInternalServerErrorMixin:u.value},c.value))};var i=r(n(73982)),a=n(452813),o=n(316886),s=n(598076),l=n(593695)},881225:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.parseGetExperimentConfigResponseSuccess=function(e,t){const n=(0,l.assertTag)(e,"iq");if(!n.success)return n;const r=(0,l.flattenedChildWithTag)(e,"props");if(!r.success)return r;const o=(0,l.literal)(l.attrString,r.value,"protocol","1");if(!o.success)return o;const c=(0,l.optional)(l.attrString,r.value,"ab_key");if(!c.success)return c;const d=(0,l.optional)(l.attrString,r.value,"hash");if(!d.success)return d;const p=(0,l.optional)(l.attrIntRange,r.value,"refresh",0,void 0);if(!p.success)return p;const _=(0,l.optional)(l.attrIntRange,r.value,"refresh_id",0,void 0);if(!_.success)return _;const f=(0,s.parseIQResultResponseMixin)(e,t);if(!f.success)return f;const h=(0,l.mapChildrenWithTag)(r.value,"prop",0,1/0,u);if(!h.success)return h;return(0,a.makeResult)((0,i.default)((0,i.default)({propsProtocol:o.value,propsAbKey:c.value,propsHash:d.value,propsRefresh:p.value,propsRefreshId:_.value},f.value),{},{propsProp:h.value}))},t.parseGetExperimentConfigResponseSuccessPropsProp=u;var i=r(n(73982)),a=n(452813),o=n(908505),s=n(224038),l=n(593695);function u(e){const t=(0,l.assertTag)(e,"prop");if(!t.success)return t;const n=(0,o.parseExperimentOrSamplingConfigMixinGroup)(e);return n.success?(0,a.makeResult)({experimentOrSamplingConfigMixinGroup:n.value}):n}},421996:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorBadRequestMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"text","bad-request");if(!n.success)return n;const a=(0,i.literal)(i.attrString,e,"code","400");if(!a.success)return a;return(0,r.makeResult)({text:n.value,code:a.value})};var r=n(452813),i=n(593695)},357229:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorBadRequestOrFeatureNotImplementedMixinGroup=function(e){const t=(0,i.parseIQErrorBadRequestMixin)(e);if(t.success)return(0,r.makeResult)({name:"IQErrorBadRequest",value:t.value});const n=(0,a.parseIQErrorFeatureNotImplementedMixin)(e);if(n.success)return(0,r.makeResult)({name:"IQErrorFeatureNotImplemented",value:n.value});return(0,o.errorMixinDisjunction)(e,["IQErrorBadRequest","IQErrorFeatureNotImplemented"],[t,n])};var r=n(452813),i=n(421996),a=n(549908),o=n(593695)},549908:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorFeatureNotImplementedMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"text","feature-not-implemented");if(!n.success)return n;const a=(0,i.literal)(i.attrString,e,"code","501");if(!a.success)return a;return(0,r.makeResult)({text:n.value,code:a.value})};var r=n(452813),i=n(593695)},316886:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorInternalServerErrorMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"text","internal-server-error");if(!n.success)return n;const a=(0,i.literal)(i.attrString,e,"code","500");if(!a.success)return a;return(0,r.makeResult)({text:n.value,code:a.value})};var r=n(452813),i=n(593695)},598076:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorResponseMixin=function(e,t){const n=(0,a.assertTag)(e,"iq");if(!n.success)return n;const o=(0,i.attrStringFromReference)(t,["id"]);if(!o.success)return o;const s=(0,a.literal)(a.attrString,e,"id",o.value);if(!s.success)return s;const l=(0,i.attrStringFromReference)(t,["to"]);if(!l.success)return l;const u=(0,a.literal)(a.attrString,e,"from",l.value);if(!u.success)return u;const c=(0,a.literal)(a.attrString,e,"type","error");if(!c.success)return c;return(0,r.makeResult)({type:c.value})};var r=n(452813),i=n(638167),a=n(593695)},224038:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQResultResponseMixin=function(e,t){const n=(0,a.assertTag)(e,"iq");if(!n.success)return n;const o=(0,i.attrStringFromReference)(t,["id"]);if(!o.success)return o;const s=(0,a.literal)(a.attrString,e,"id",o.value);if(!s.success)return s;const l=(0,i.attrStringFromReference)(t,["to"]);if(!l.success)return l;const u=(0,a.literal)(a.attrString,e,"from",l.value);if(!u.success)return u;const c=(0,a.literal)(a.attrString,e,"type","result");if(!c.success)return c;return(0,r.makeResult)({type:c.value})};var r=n(452813),i=n(638167),a=n(593695)},607756:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseSamplingConfigMixin=function(e){const t=(0,i.assertTag)(e,"prop");if(!t.success)return t;const n=(0,i.attrIntRange)(e,"event_code",1,void 0);if(!n.success)return n;const a=(0,i.attrIntRange)(e,"sampling_weight",-1e4,1e4);if(!a.success)return a;return(0,r.makeResult)({eventCode:n.value,samplingWeight:a.value})};var r=n(452813),i=n(593695)},711485:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeBaseIQGetRequestMixin=function(e){const t=(0,r.smax)("iq",{id:(0,a.generateId)(),type:"get"});return(0,i.mergeStanzas)(e,t)};var r=n(898165),i=n(519603),a=n(738102)},584139:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeGetExperimentConfigRequest=function(e){const{propsHash:t}=e;return(0,a.mergeBaseIQGetRequestMixin)((0,i.smax)("iq",{xmlns:"abt",to:o.S_WHATSAPP_NET},(0,i.smax)("props",{protocol:"1",hash:(0,r.OPTIONAL)(o.CUSTOM_STRING,t)})))};var r=n(72011),i=n(898165),a=n(711485),o=n(738102)},171654:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.sendGetGroupProfilePicturesRPC=function(){return p.apply(this,arguments)};var i=r(n(311504)),a=n(911794),o=n(622141),s=n(610285),l=n(376988),u=n(899476),c=n(96652),d=n(496995);function p(){return(p=(0,i.default)((function*(e,t){const n=(0,u.makeGetGroupProfilePicturesRequest)(e),r=yield(0,a.sendSmaxStanza)(n,t),i=(0,l.parseGetGroupProfilePicturesResponseSuccessGroupPictures)(r,n);if(i.success)return{name:"GetGroupProfilePicturesResponseSuccessGroupPictures",value:i.value};const p=(0,o.parseGetGroupProfilePicturesResponseClientError)(r,n);if(p.success)return{name:"GetGroupProfilePicturesResponseClientError",value:p.value};const _=(0,s.parseGetGroupProfilePicturesResponseServerError)(r,n);if(_.success)return{name:"GetGroupProfilePicturesResponseServerError",value:_.value};throw new c.SmaxParsingFailure((0,d.errorMessageRpcParsing)("GetGroupProfilePictures",{SuccessGroupPictures:i,ClientError:p,ServerError:_}))}))).apply(this,arguments)}},456201:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.sendGetMembershipApprovalRequestsRPC=function(){return p.apply(this,arguments)};var i=r(n(311504)),a=n(911794),o=n(689879),s=n(173840),l=n(949989),u=n(147283),c=n(96652),d=n(496995);function p(){return(p=(0,i.default)((function*(e,t){const n=(0,u.makeGetMembershipApprovalRequestsRequest)(e),r=yield(0,a.sendSmaxStanza)(n,t),i=(0,l.parseGetMembershipApprovalRequestsResponseSuccess)(r,n);if(i.success)return{name:"GetMembershipApprovalRequestsResponseSuccess",value:i.value};const p=(0,o.parseGetMembershipApprovalRequestsResponseClientError)(r,n);if(p.success)return{name:"GetMembershipApprovalRequestsResponseClientError",value:p.value};const _=(0,s.parseGetMembershipApprovalRequestsResponseServerError)(r,n);if(_.success)return{name:"GetMembershipApprovalRequestsResponseServerError",value:_.value};throw new c.SmaxParsingFailure((0,d.errorMessageRpcParsing)("GetMembershipApprovalRequests",{Success:i,ClientError:p,ServerError:_}))}))).apply(this,arguments)}},337245:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.sendMembershipRequestsActionRPC=function(){return p.apply(this,arguments)};var i=r(n(311504)),a=n(911794),o=n(531679),s=n(885248),l=n(578162),u=n(662440),c=n(96652),d=n(496995);function p(){return(p=(0,i.default)((function*(e,t){const n=(0,u.makeMembershipRequestsActionRequest)(e),r=yield(0,a.sendSmaxStanza)(n,t),i=(0,l.parseMembershipRequestsActionResponseSuccess)(r,n);if(i.success)return{name:"MembershipRequestsActionResponseSuccess",value:i.value};const p=(0,o.parseMembershipRequestsActionResponseClientError)(r,n);if(p.success)return{name:"MembershipRequestsActionResponseClientError",value:p.value};const _=(0,s.parseMembershipRequestsActionResponseServerError)(r,n);if(_.success)return{name:"MembershipRequestsActionResponseServerError",value:_.value};throw new c.SmaxParsingFailure((0,d.errorMessageRpcParsing)("MembershipRequestsAction",{Success:i,ClientError:p,ServerError:_}))}))).apply(this,arguments)}},897045:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseBadLinkedGroupProfilePictureErrorMixin=function(e){const t=(0,i.assertTag)(e,"picture");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"status","405");if(!n.success)return n;return(0,r.makeResult)({status:n.value})};var r=n(452813),i=n(593695)},833426:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseBadServerProfilePictureErrorMixin=function(e){const t=(0,i.assertTag)(e,"picture");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"status","500");if(!n.success)return n;return(0,r.makeResult)({status:n.value})};var r=n(452813),i=n(593695)},107910:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.parseBaseServerErrorMixin=function(e,t){const n=(0,l.assertTag)(e,"iq");if(!n.success)return n;const r=(0,l.flattenedChildWithTag)(e,"error");if(!r.success)return r;const u=(0,o.parseIQErrorResponseMixin)(e,t);if(!u.success)return u;const c=(0,s.parseServerErrors)(r.value);if(!c.success)return c;return(0,a.makeResult)((0,i.default)((0,i.default)({},u.value),{},{errorServerErrors:c.value}))};var i=r(n(73982)),a=n(452813),o=n(521998),s=n(488452),l=n(593695)},10004:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ENUM_PARENTGROUP_SIBLINGGROUP_SUBGROUP=t.ENUM_INVITELINK_LINKEDGROUPJOIN=t.ENUM_IMAGE_PREVIEW=t.ENUM_E2EEMIGRATION_REGULAR_RTC=t.ENUM_DELETEPARENT_INTEGRITYDELETEPARENT_UNLINKGROUP=t.ENUM_DELETEPARENT_INTEGRITYDELETEPARENT=t.ENUM_ADMIN_SUPERADMIN=t.ENUM_ACCEPT_DEFAULTSUBGROUPPROMOTE_INVITE_INVITEAUTOADD_LINKEDGROUPJOIN=t.ENUM_ACCEPT_AUTOADD_DEFAULTSUBGROUPADMINADD_INVITE_INVITEAUTOADD_LINKEDGROUPJOIN=t.ENUM_406_500=t.ENUM_404_419=t.ENUM_404_406=t.ENUM_403_404_406_419=void 0;t.ENUM_403_404_406_419={403:"403",404:"404",406:"406",419:"419"};t.ENUM_404_406={404:"404",406:"406"};t.ENUM_404_419={404:"404",419:"419"};t.ENUM_406_500={406:"406",500:"500"};t.ENUM_ACCEPT_AUTOADD_DEFAULTSUBGROUPADMINADD_INVITE_INVITEAUTOADD_LINKEDGROUPJOIN={accept:"accept",auto_add:"auto_add",default_sub_group_admin_add:"default_sub_group_admin_add",invite:"invite",invite_auto_add:"invite_auto_add",linked_group_join:"linked_group_join"};t.ENUM_ACCEPT_DEFAULTSUBGROUPPROMOTE_INVITE_INVITEAUTOADD_LINKEDGROUPJOIN={accept:"accept",default_sub_group_promote:"default_sub_group_promote",invite:"invite",invite_auto_add:"invite_auto_add",linked_group_join:"linked_group_join"};t.ENUM_ADMIN_SUPERADMIN={admin:"admin",superadmin:"superadmin"};t.ENUM_DELETEPARENT_INTEGRITYDELETEPARENT={delete_parent:"delete_parent",integrity_delete_parent:"integrity_delete_parent"};t.ENUM_DELETEPARENT_INTEGRITYDELETEPARENT_UNLINKGROUP={delete_parent:"delete_parent",integrity_delete_parent:"integrity_delete_parent",unlink_group:"unlink_group"};t.ENUM_E2EEMIGRATION_REGULAR_RTC={e2ee_migration:"e2ee_migration",regular:"regular",rtc:"rtc"};t.ENUM_IMAGE_PREVIEW={image:"image",preview:"preview"};t.ENUM_INVITELINK_LINKEDGROUPJOIN={invite_link:"invite_link",linked_group_join:"linked_group_join"};t.ENUM_PARENTGROUP_SIBLINGGROUP_SUBGROUP={parent_group:"parent_group",sibling_group:"sibling_group",sub_group:"sub_group"}},918065:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseFallbackClientMixin=function(e){const t=(0,i.assertTag)(e,"iq");if(!t.success)return t;const n=(0,i.flattenedChildWithTag)(e,"error");if(!n.success)return n;const a=(0,r.parseIQErrorFallbackClientMixin)(n.value);if(!a.success)return a;return a};var r=n(897122),i=n(593695)},413425:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseGetGroupProfilePictureClientErrors=function(e){const t=(0,a.parseGroupDoesNotExistMixin)(e);if(t.success)return(0,r.makeResult)({name:"GroupDoesNotExist",value:t.value});const n=(0,s.parseItemDoesNotExistMixin)(e);if(n.success)return(0,r.makeResult)({name:"ItemDoesNotExist",value:n.value});const d=(0,u.parseUserIsNotAParticipantMixin)(e);if(d.success)return(0,r.makeResult)({name:"UserIsNotAParticipant",value:d.value});const p=(0,o.parseInvalidGroupLinkMixin)(e);if(p.success)return(0,r.makeResult)({name:"InvalidGroupLink",value:p.value});const _=(0,l.parseMalformedStanzaMixin)(e);if(_.success)return(0,r.makeResult)({name:"MalformedStanza",value:_.value});const f=(0,i.parseFallbackClientMixin)(e);if(f.success)return(0,r.makeResult)({name:"FallbackClient",value:f.value});return(0,c.errorMixinDisjunction)(e,["GroupDoesNotExist","ItemDoesNotExist","UserIsNotAParticipant","InvalidGroupLink","MalformedStanza","FallbackClient"],[t,n,d,p,_,f])};var r=n(452813),i=n(918065),a=n(304318),o=n(783802),s=n(132697),l=n(879524),u=n(535438),c=n(593695)},377415:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseGetGroupProfilePicturesPartialProfilePictureResponseMixin=function(e){const t=(0,a.assertTag)(e,"picture");if(!t.success)return t;const n=(0,i.parsePictureNotFoundOrBadServerProfilePictureErrorOrBadLinkedGroupProfilePictureErrorMixinGroup)(e);return(0,r.makeResult)({pictureNotFoundOrBadServerProfilePictureErrorOrBadLinkedGroupProfilePictureErrorMixinGroup:n.success?n.value:null})};var r=n(452813),i=n(496706),a=n(593695)},950775:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseGetGroupProfilePicturesProfilePicturesResponseMixin=function(e){const t=(0,o.flattenedChildWithTag)(e,"pictures");if(!t.success)return t;const n=(0,o.mapChildrenWithTag)(t.value,"picture",1,1e3,s);if(!n.success)return n;return(0,r.makeResult)({picturesPicture:n.value})},t.parseGetGroupProfilePicturesProfilePicturesResponsePicturesPicture=s;var r=n(452813),i=n(711668),a=n(943819),o=n(593695);function s(e){const t=(0,o.assertTag)(e,"picture");if(!t.success)return t;const n=(0,a.parseParentOrSubGroupMixinGroup)(e);if(!n.success)return n;const s=(0,i.parseGetGroupProfilePicturesSuccessOrGetGroupProfilePicturesPartialProfilePictureResponseMixinGroup)(e);return s.success?(0,r.makeResult)({parentOrSubGroupMixinGroup:n.value,getGroupProfilePicturesSuccessOrGetGroupProfilePicturesPartialProfilePictureResponseMixinGroup:s.value}):s}},622141:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.parseGetGroupProfilePicturesResponseClientError=function(e,t){const n=(0,l.assertTag)(e,"iq");if(!n.success)return n;const r=(0,s.parseIQErrorResponseMixin)(e,t);if(!r.success)return r;const u=(0,o.parseGetGroupProfilePictureClientErrors)(e);if(!u.success)return u;return(0,a.makeResult)((0,i.default)((0,i.default)({},r.value),{},{getGroupProfilePictureClientErrors:u.value}))};var i=r(n(73982)),a=n(452813),o=n(413425),s=n(521998),l=n(593695)},610285:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseGetGroupProfilePicturesResponseServerError=function(e,t){const n=(0,i.assertTag)(e,"iq");if(!n.success)return n;const a=(0,r.parseBaseServerErrorMixin)(e,t);if(!a.success)return a;return a};var r=n(107910),i=n(593695)},376988:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.parseGetGroupProfilePicturesResponseSuccessGroupPictures=function(e,t){const n=(0,l.assertTag)(e,"iq");if(!n.success)return n;const r=(0,s.parseIQResultResponseMixin)(e,t);if(!r.success)return r;const u=(0,o.parseGetGroupProfilePicturesProfilePicturesResponseMixin)(e);if(!u.success)return u;return(0,a.makeResult)((0,i.default)((0,i.default)({},r.value),u.value))};var i=r(n(73982)),a=n(452813),o=n(950775),s=n(786545),l=n(593695)},711668:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseGetGroupProfilePicturesSuccessOrGetGroupProfilePicturesPartialProfilePictureResponseMixinGroup=function(e){const t=(0,a.parseGetGroupProfilePicturesSuccessProfilePictureResponseMixin)(e);if(t.success)return(0,r.makeResult)({name:"GetGroupProfilePicturesSuccessProfilePictureResponse",value:t.value});const n=(0,i.parseGetGroupProfilePicturesPartialProfilePictureResponseMixin)(e);if(n.success)return(0,r.makeResult)({name:"GetGroupProfilePicturesPartialProfilePictureResponse",value:n.value});return(0,o.errorMixinDisjunction)(e,["SuccessProfilePictureResponse","PartialProfilePictureResponse"],[t,n])};var r=n(452813),i=n(377415),a=n(829625),o=n(593695)},829625:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.parseGetGroupProfilePicturesSuccessProfilePictureResponseMixin=function(e){const t=(0,u.assertTag)(e,"picture");if(!t.success)return t;const n=(0,o.parseProfilePictureIdMixin)(e);if(!n.success)return n;const r=(0,s.parseProfilePictureTypeMixin)(e);if(!r.success)return r;const c=(0,l.parseProfilePictureUrlResponseOrProfilePictureBlobResponseOrPictureDidNotChangeMixinGroup)(e);return(0,a.makeResult)((0,i.default)((0,i.default)((0,i.default)({},n.value),r.value),{},{profilePictureUrlResponseOrProfilePictureBlobResponseOrPictureDidNotChangeMixinGroup:c.success?c.value:null}))};var i=r(n(73982)),a=n(452813),o=n(587202),s=n(444288),l=n(432471),u=n(593695)},943266:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseGetMembershipApprovalRequestsClientErrors=function(e){const t=(0,u.parseUnsupportedOperationMixin)(e);if(t.success)return(0,r.makeResult)({name:"UnsupportedOperation",value:t.value});const n=(0,s.parseMalformedStanzaMixin)(e);if(n.success)return(0,r.makeResult)({name:"MalformedStanza",value:n.value});const p=(0,a.parseGroupDoesNotExistMixin)(e);if(p.success)return(0,r.makeResult)({name:"GroupDoesNotExist",value:p.value});const _=(0,c.parseUserDoesNotHaveAdminPermissionMixin)(e);if(_.success)return(0,r.makeResult)({name:"UserDoesNotHaveAdminPermission",value:_.value});const f=(0,l.parseRateLimitedMixin)(e);if(f.success)return(0,r.makeResult)({name:"RateLimited",value:f.value});const h=(0,o.parseGroupIsSuspendedMixin)(e);if(h.success)return(0,r.makeResult)({name:"GroupIsSuspended",value:h.value});const g=(0,i.parseFallbackClientMixin)(e);if(g.success)return(0,r.makeResult)({name:"FallbackClient",value:g.value});return(0,d.errorMixinDisjunction)(e,["UnsupportedOperation","MalformedStanza","GroupDoesNotExist","UserDoesNotHaveAdminPermission","RateLimited","GroupIsSuspended","FallbackClient"],[t,n,p,_,f,h,g])};var r=n(452813),i=n(918065),a=n(304318),o=n(267900),s=n(879524),l=n(777343),u=n(196295),c=n(537521),d=n(593695)},82171:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.parseGetMembershipApprovalRequestsMembershipApprovalRequestMixin=function(e){const t=(0,l.assertTag)(e,"membership_approval_request");if(!t.success)return t;const n=(0,s.attrUserJid)(e,"jid");if(!n.success)return n;const r=(0,l.attrIntRange)(e,"request_time",0,void 0);if(!r.success)return r;const u=(0,o.parseMembershipApprovalRequestMethodMixin)(e);if(!u.success)return u;return(0,a.makeResult)((0,i.default)({jid:n.value,requestTime:r.value},u.value))};var i=r(n(73982)),a=n(452813),o=n(573545),s=n(885720),l=n(593695)},689879:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.parseGetMembershipApprovalRequestsResponseClientError=function(e,t){const n=(0,l.assertTag)(e,"iq");if(!n.success)return n;const r=(0,s.parseIQErrorResponseMixin)(e,t);if(!r.success)return r;const u=(0,o.parseGetMembershipApprovalRequestsClientErrors)(e);if(!u.success)return u;return(0,a.makeResult)((0,i.default)((0,i.default)({},r.value),{},{getMembershipApprovalRequestsClientErrors:u.value}))};var i=r(n(73982)),a=n(452813),o=n(943266),s=n(521998),l=n(593695)},173840:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseGetMembershipApprovalRequestsResponseServerError=function(e,t){const n=(0,i.assertTag)(e,"iq");if(!n.success)return n;const a=(0,r.parseBaseServerErrorMixin)(e,t);if(!a.success)return a;return a};var r=n(107910),i=n(593695)},949989:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.parseGetMembershipApprovalRequestsResponseSuccess=function(e,t){const n=(0,l.assertTag)(e,"iq");if(!n.success)return n;const r=(0,l.flattenedChildWithTag)(e,"membership_approval_requests");if(!r.success)return r;const o=(0,s.parseIQResultResponseMixin)(e,t);if(!o.success)return o;const c=(0,l.mapChildrenWithTag)(r.value,"membership_approval_request",0,19999,u);if(!c.success)return c;return(0,a.makeResult)((0,i.default)((0,i.default)({},o.value),{},{membershipApprovalRequestsMembershipApprovalRequest:c.value}))},t.parseGetMembershipApprovalRequestsResponseSuccessMembershipApprovalRequestsMembershipApprovalRequest=u;var i=r(n(73982)),a=n(452813),o=n(82171),s=n(786545),l=n(593695);function u(e){const t=(0,l.assertTag)(e,"membership_approval_request");if(!t.success)return t;const n=(0,o.parseGetMembershipApprovalRequestsMembershipApprovalRequestMixin)(e);return n.success,n}},304318:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseGroupDoesNotExistMixin=function(e){const t=(0,i.assertTag)(e,"iq");if(!t.success)return t;const n=(0,i.flattenedChildWithTag)(e,"error");if(!n.success)return n;const a=(0,r.parseIQErrorItemNotFoundMixin)(n.value);if(!a.success)return a;return a};var r=n(150924),i=n(593695)},267900:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseGroupIsSuspendedMixin=function(e){const t=(0,i.assertTag)(e,"iq");if(!t.success)return t;const n=(0,i.flattenedChildWithTag)(e,"error");if(!n.success)return n;const a=(0,r.parseIQErrorLockedMixin)(n.value);if(!a.success)return a;return a};var r=n(902250),i=n(593695)},848519:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorBadRequestMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"text","bad-request");if(!n.success)return n;const a=(0,i.literal)(i.attrString,e,"code","400");if(!a.success)return a;return(0,r.makeResult)({text:n.value,code:a.value})};var r=n(452813),i=n(593695)},897122:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorFallbackClientMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.attrString)(e,"text");if(!n.success)return n;const a=(0,i.attrIntRange)(e,"code",400,499);if(!a.success)return a;return(0,r.makeResult)({text:n.value,code:a.value})};var r=n(452813),i=n(593695)},647760:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorFallbackServerMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.attrString)(e,"text");if(!n.success)return n;const a=(0,i.attrIntRange)(e,"code",500,599);if(!a.success)return a;return(0,r.makeResult)({text:n.value,code:a.value})};var r=n(452813),i=n(593695)},373494:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorForbiddenMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"text","forbidden");if(!n.success)return n;const a=(0,i.literal)(i.attrString,e,"code","403");if(!a.success)return a;return(0,r.makeResult)({text:n.value,code:a.value})};var r=n(452813),i=n(593695)},695068:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorInternalServerErrorMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"text","internal-server-error");if(!n.success)return n;const a=(0,i.literal)(i.attrString,e,"code","500");if(!a.success)return a;return(0,r.makeResult)({text:n.value,code:a.value})};var r=n(452813),i=n(593695)},150924:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorItemNotFoundMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"text","item-not-found");if(!n.success)return n;const a=(0,i.literal)(i.attrString,e,"code","404");if(!a.success)return a;return(0,r.makeResult)({text:n.value,code:a.value})};var r=n(452813),i=n(593695)},902250:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorLockedMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"text","locked");if(!n.success)return n;const a=(0,i.literal)(i.attrString,e,"code","423");if(!a.success)return a;return(0,r.makeResult)({text:n.value,code:a.value})};var r=n(452813),i=n(593695)},556585:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorNotAllowedMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"text","not-allowed");if(!n.success)return n;const a=(0,i.literal)(i.attrString,e,"code","405");if(!a.success)return a;return(0,r.makeResult)({text:n.value,code:a.value})};var r=n(452813),i=n(593695)},16050:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorNotAuthorizedMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"text","not-authorized");if(!n.success)return n;const a=(0,i.literal)(i.attrString,e,"code","401");if(!a.success)return a;return(0,r.makeResult)({text:n.value,code:a.value})};var r=n(452813),i=n(593695)},212277:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorPartialServerErrorMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"text","partial-server-error");if(!n.success)return n;const a=(0,i.literal)(i.attrString,e,"code","530");if(!a.success)return a;return(0,r.makeResult)({text:n.value,code:a.value})};var r=n(452813),i=n(593695)},230364:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorRateOverlimitMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"text","rate-overlimit");if(!n.success)return n;const a=(0,i.literal)(i.attrString,e,"code","429");if(!a.success)return a;return(0,r.makeResult)({text:n.value,code:a.value})};var r=n(452813),i=n(593695)},521998:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorResponseMixin=function(e,t){const n=(0,a.assertTag)(e,"iq");if(!n.success)return n;const o=(0,i.attrStringFromReference)(t,["id"]);if(!o.success)return o;const s=(0,a.literal)(a.attrString,e,"id",o.value);if(!s.success)return s;const l=(0,i.attrStringFromReference)(t,["to"]);if(!l.success)return l;const u=(0,a.literal)(a.attrString,e,"from",l.value);if(!u.success)return u;const c=(0,a.literal)(a.attrString,e,"type","error");if(!c.success)return c;return(0,r.makeResult)({type:c.value})};var r=n(452813),i=n(638167),a=n(593695)},690545:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorServiceUnavailableMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"text","service-unavailable");if(!n.success)return n;const a=(0,i.literal)(i.attrString,e,"code","503");if(!a.success)return a;return(0,r.makeResult)({text:n.value,code:a.value})};var r=n(452813),i=n(593695)},786545:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQResultResponseMixin=function(e,t){const n=(0,a.assertTag)(e,"iq");if(!n.success)return n;const o=(0,i.attrStringFromReference)(t,["id"]);if(!o.success)return o;const s=(0,a.literal)(a.attrString,e,"id",o.value);if(!s.success)return s;const l=(0,i.attrStringFromReference)(t,["to"]);if(!l.success)return l;const u=(0,a.literal)(a.attrString,e,"from",l.value);if(!u.success)return u;const c=(0,a.literal)(a.attrString,e,"type","result");if(!c.success)return c;return(0,r.makeResult)({type:c.value})};var r=n(452813),i=n(638167),a=n(593695)},783802:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseInvalidGroupLinkMixin=function(e){const t=(0,i.assertTag)(e,"iq");if(!t.success)return t;const n=(0,i.flattenedChildWithTag)(e,"error");if(!n.success)return n;const a=(0,r.parseIQErrorNotAllowedMixin)(n.value);if(!a.success)return a;return a};var r=n(556585),i=n(593695)},939938:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseInvalidParticipantJIDMixin=function(e){const t=(0,i.assertTag)(e,"iq");if(!t.success)return t;const n=(0,i.flattenedChildWithTag)(e,"error");if(!n.success)return n;const a=(0,r.parseIQErrorBadRequestMixin)(n.value);if(!a.success)return a;return a};var r=n(848519),i=n(593695)},132697:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseItemDoesNotExistMixin=function(e){const t=(0,i.assertTag)(e,"iq");if(!t.success)return t;const n=(0,i.flattenedChildWithTag)(e,"error");if(!n.success)return n;const a=(0,r.parseIQErrorItemNotFoundMixin)(n.value);if(!a.success)return a;return a};var r=n(150924),i=n(593695)},879524:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseMalformedStanzaMixin=function(e){const t=(0,i.assertTag)(e,"iq");if(!t.success)return t;const n=(0,i.flattenedChildWithTag)(e,"error");if(!n.success)return n;const a=(0,r.parseIQErrorBadRequestMixin)(n.value);if(!a.success)return a;return a};var r=n(848519),i=n(593695)},573545:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseMembershipApprovalRequestMethodMixin=function(e){const t=(0,a.assertTag)(e,"membership_approval_request");if(!t.success)return t;const n=(0,a.attrStringEnum)(e,"request_method",i.ENUM_INVITELINK_LINKEDGROUPJOIN);if(!n.success)return n;return(0,r.makeResult)({requestMethod:n.value})};var r=n(452813),i=n(10004),a=n(593695)},590440:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseMembershipRequestsActionAcceptParticipantMixins=function(e){const t=(0,o.parseParticipantNotFoundMixin)(e);if(t.success)return(0,r.makeResult)({name:"ParticipantNotFound",value:t.value});const n=(0,i.parseMembershipRequestsActionParticipantRequestNotFoundMixin)(e);if(n.success)return(0,r.makeResult)({name:"MembershipRequestsActionParticipantRequestNotFound",value:n.value});const u=(0,a.parseParticipantConflictMixin)(e);if(u.success)return(0,r.makeResult)({name:"ParticipantConflict",value:u.value});const c=(0,s.parseParticipantResourceConstraintMixin)(e);if(c.success)return(0,r.makeResult)({name:"ParticipantResourceConstraint",value:c.value});return(0,l.errorMixinDisjunction)(e,["ParticipantNotFound","ParticipantRequestNotFound","ParticipantConflict","ParticipantResourceConstraint"],[t,n,u,c])};var r=n(452813),i=n(389355),a=n(596026),o=n(224937),s=n(30901),l=n(593695)},803772:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseMembershipRequestsActionClientErrors=function(e){const t=(0,c.parseUnsupportedOperationMixin)(e);if(t.success)return(0,r.makeResult)({name:"UnsupportedOperation",value:t.value});const n=(0,l.parseMalformedStanzaMixin)(e);if(n.success)return(0,r.makeResult)({name:"MalformedStanza",value:n.value});const _=(0,a.parseGroupDoesNotExistMixin)(e);if(_.success)return(0,r.makeResult)({name:"GroupDoesNotExist",value:_.value});const f=(0,d.parseUserDoesNotHaveAdminPermissionMixin)(e);if(f.success)return(0,r.makeResult)({name:"UserDoesNotHaveAdminPermission",value:f.value});const h=(0,s.parseInvalidParticipantJIDMixin)(e);if(h.success)return(0,r.makeResult)({name:"InvalidParticipantJID",value:h.value});const g=(0,u.parseRateLimitedMixin)(e);if(g.success)return(0,r.makeResult)({name:"RateLimited",value:g.value});const m=(0,o.parseGroupIsSuspendedMixin)(e);if(m.success)return(0,r.makeResult)({name:"GroupIsSuspended",value:m.value});const y=(0,i.parseFallbackClientMixin)(e);if(y.success)return(0,r.makeResult)({name:"FallbackClient",value:y.value});return(0,p.errorMixinDisjunction)(e,["UnsupportedOperation","MalformedStanza","GroupDoesNotExist","UserDoesNotHaveAdminPermission","InvalidParticipantJID","RateLimited","GroupIsSuspended","FallbackClient"],[t,n,_,f,h,g,m,y])};var r=n(452813),i=n(918065),a=n(304318),o=n(267900),s=n(939938),l=n(879524),u=n(777343),c=n(196295),d=n(537521),p=n(593695)},389355:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseMembershipRequestsActionParticipantRequestNotFoundMixin=function(e){const t=(0,i.assertTag)(e,"participant");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"error","404");if(!n.success)return n;return(0,r.makeResult)({error:n.value})};var r=n(452813),i=n(593695)},21735:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseMembershipRequestsActionRejectParticipantMixins=function(e){const t=(0,i.parseMembershipRequestsActionParticipantRequestNotFoundMixin)(e);if(t.success)return(0,r.makeResult)({name:"MembershipRequestsActionParticipantRequestNotFound",value:t.value});const n=(0,a.parseParticipantConflictMixin)(e);if(n.success)return(0,r.makeResult)({name:"ParticipantConflict",value:n.value});return(0,o.errorMixinDisjunction)(e,["ParticipantRequestNotFound","ParticipantConflict"],[t,n])};var r=n(452813),i=n(389355),a=n(596026),o=n(593695)},531679:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.parseMembershipRequestsActionResponseClientError=function(e,t){const n=(0,l.assertTag)(e,"iq");if(!n.success)return n;const r=(0,o.parseIQErrorResponseMixin)(e,t);if(!r.success)return r;const u=(0,s.parseMembershipRequestsActionClientErrors)(e);if(!u.success)return u;return(0,a.makeResult)((0,i.default)((0,i.default)({},r.value),{},{membershipRequestsActionClientErrors:u.value}))};var i=r(n(73982)),a=n(452813),o=n(521998),s=n(803772),l=n(593695)},885248:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseMembershipRequestsActionResponseServerError=function(e,t){const n=(0,i.assertTag)(e,"iq");if(!n.success)return n;const a=(0,r.parseBaseServerErrorMixin)(e,t);if(!a.success)return a;return a};var r=n(107910),i=n(593695)},578162:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseMembershipRequestsActionResponseSuccess=function(e,t){const n=(0,l.assertTag)(e,"iq");if(!n.success)return n;const i=(0,l.flattenedChildWithTag)(e,"membership_requests_action");if(!i.success)return i;const a=(0,l.optionalChildWithTag)(i.value,"approve",c);if(!a.success)return a;const o=(0,l.optionalChildWithTag)(i.value,"reject",p);if(!o.success)return o;const u=(0,s.attrStringFromReference)(t,["to"]);if(!u.success)return u;const d=(0,l.literal)(l.attrString,e,"from",u.value);if(!d.success)return d;const _=(0,l.literal)(l.attrString,e,"type","result");if(!_.success)return _;const f=(0,s.attrStringFromReference)(t,["id"]);if(!f.success)return f;const h=(0,l.literal)(l.attrString,e,"id",f.value);if(!h.success)return h;return(0,r.makeResult)({type:_.value,membershipRequestsActionApprove:a.value,membershipRequestsActionReject:o.value})},t.parseMembershipRequestsActionResponseSuccessMembershipRequestsActionApprove=c,t.parseMembershipRequestsActionResponseSuccessMembershipRequestsActionApproveParticipant=u,t.parseMembershipRequestsActionResponseSuccessMembershipRequestsActionReject=p,t.parseMembershipRequestsActionResponseSuccessMembershipRequestsActionRejectParticipant=d;var r=n(452813),i=n(590440),a=n(21735),o=n(885720),s=n(638167),l=n(593695);function u(e){const t=(0,l.assertTag)(e,"participant");if(!t.success)return t;const n=(0,o.attrUserJid)(e,"jid");if(!n.success)return n;const a=(0,i.parseMembershipRequestsActionAcceptParticipantMixins)(e);return(0,r.makeResult)({jid:n.value,membershipRequestsActionAcceptParticipantMixins:a.success?a.value:null})}function c(e){const t=(0,l.assertTag)(e,"approve");if(!t.success)return t;const n=(0,l.mapChildrenWithTag)(e,"participant",1,19999,u);return n.success?(0,r.makeResult)({participant:n.value}):n}function d(e){const t=(0,l.assertTag)(e,"participant");if(!t.success)return t;const n=(0,o.attrUserJid)(e,"jid");if(!n.success)return n;const i=(0,a.parseMembershipRequestsActionRejectParticipantMixins)(e);return(0,r.makeResult)({jid:n.value,membershipRequestsActionRejectParticipantMixins:i.success?i.value:null})}function p(e){const t=(0,l.assertTag)(e,"reject");if(!t.success)return t;const n=(0,l.mapChildrenWithTag)(e,"participant",1,19999,d);return n.success?(0,r.makeResult)({participant:n.value}):n}},794178:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseParentGroupMixin=function(e){const t=(0,i.attrGroupJid)(e,"parent_group_jid");if(!t.success)return t;return(0,r.makeResult)({parentGroupJid:t.value})};var r=n(452813),i=n(885720)},943819:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseParentOrSubGroupMixinGroup=function(e){const t=(0,i.parseParentGroupMixin)(e);if(t.success)return(0,r.makeResult)({name:"ParentGroup",value:t.value});const n=(0,a.parseSubGroupMixin)(e);if(n.success)return(0,r.makeResult)({name:"SubGroup",value:n.value});return(0,o.errorMixinDisjunction)(e,["ParentGroup","SubGroup"],[t,n])};var r=n(452813),i=n(794178),a=n(418789),o=n(593695)},596026:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseParticipantConflictMixin=function(e){const t=(0,i.assertTag)(e,"participant");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"error","409");if(!n.success)return n;return(0,r.makeResult)({error:n.value})};var r=n(452813),i=n(593695)},224937:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseParticipantNotFoundMixin=function(e){const t=(0,i.assertTag)(e,"participant");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"error","400");if(!n.success)return n;return(0,r.makeResult)({error:n.value})};var r=n(452813),i=n(593695)},30901:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseParticipantResourceConstraintMixin=function(e){const t=(0,i.assertTag)(e,"participant");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"error","500");if(!n.success)return n;return(0,r.makeResult)({error:n.value})};var r=n(452813),i=n(593695)},731185:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parsePictureDidNotChangeMixin=function(e){const t=(0,i.assertTag)(e,"picture");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"status","304");if(!n.success)return n;return(0,r.makeResult)({status:n.value})};var r=n(452813),i=n(593695)},995495:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parsePictureNotFoundMixin=function(e){const t=(0,i.assertTag)(e,"picture");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"status","204");if(!n.success)return n;return(0,r.makeResult)({status:n.value})};var r=n(452813),i=n(593695)},496706:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parsePictureNotFoundOrBadServerProfilePictureErrorOrBadLinkedGroupProfilePictureErrorMixinGroup=function(e){const t=(0,o.parsePictureNotFoundMixin)(e);if(t.success)return(0,r.makeResult)({name:"PictureNotFound",value:t.value});const n=(0,a.parseBadServerProfilePictureErrorMixin)(e);if(n.success)return(0,r.makeResult)({name:"BadServerProfilePictureError",value:n.value});const l=(0,i.parseBadLinkedGroupProfilePictureErrorMixin)(e);if(l.success)return(0,r.makeResult)({name:"BadLinkedGroupProfilePictureError",value:l.value});return(0,s.errorMixinDisjunction)(e,["PictureNotFound","BadServerProfilePictureError","BadLinkedGroupProfilePictureError"],[t,n,l])};var r=n(452813),i=n(897045),a=n(833426),o=n(995495),s=n(593695)},523110:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseProfilePictureBlobResponseMixin=function(e){const t=(0,i.assertTag)(e,"picture");if(!t.success)return t;const n=(0,i.contentBytesRange)(e,1,void 0);if(!n.success)return n;return(0,r.makeResult)({elementValue:n.value})};var r=n(452813),i=n(593695)},587202:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseProfilePictureIdMixin=function(e){const t=(0,i.assertTag)(e,"picture");if(!t.success)return t;const n=(0,i.attrString)(e,"id");if(!n.success)return n;return(0,r.makeResult)({id:n.value})};var r=n(452813),i=n(593695)},444288:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseProfilePictureTypeMixin=function(e){const t=(0,a.assertTag)(e,"picture");if(!t.success)return t;const n=(0,a.attrStringEnum)(e,"type",i.ENUM_IMAGE_PREVIEW);if(!n.success)return n;return(0,r.makeResult)({type:n.value})};var r=n(452813),i=n(10004),a=n(593695)},822677:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseProfilePictureUrlResponseMixin=function(e){const t=(0,i.assertTag)(e,"picture");if(!t.success)return t;const n=(0,i.attrString)(e,"url");if(!n.success)return n;const a=(0,i.attrString)(e,"direct_path");if(!a.success)return a;return(0,r.makeResult)({url:n.value,directPath:a.value})};var r=n(452813),i=n(593695)},432471:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseProfilePictureUrlResponseOrProfilePictureBlobResponseOrPictureDidNotChangeMixinGroup=function(e){const t=(0,o.parseProfilePictureUrlResponseMixin)(e);if(t.success)return(0,r.makeResult)({name:"ProfilePictureUrlResponse",value:t.value});const n=(0,a.parseProfilePictureBlobResponseMixin)(e);if(n.success)return(0,r.makeResult)({name:"ProfilePictureBlobResponse",value:n.value});const l=(0,i.parsePictureDidNotChangeMixin)(e);if(l.success)return(0,r.makeResult)({name:"PictureDidNotChange",value:l.value});return(0,s.errorMixinDisjunction)(e,["ProfilePictureUrlResponse","ProfilePictureBlobResponse","PictureDidNotChange"],[t,n,l])};var r=n(452813),i=n(731185),a=n(523110),o=n(822677),s=n(593695)},777343:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseRateLimitedMixin=function(e){const t=(0,i.assertTag)(e,"iq");if(!t.success)return t;const n=(0,i.flattenedChildWithTag)(e,"error");if(!n.success)return n;const a=(0,r.parseIQErrorRateOverlimitMixin)(n.value);if(!a.success)return a;return a};var r=n(230364),i=n(593695)},488452:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseServerErrors=function(e){const t=(0,a.parseIQErrorInternalServerErrorMixin)(e);if(t.success)return(0,r.makeResult)({name:"IQErrorInternalServerError",value:t.value});const n=(0,s.parseIQErrorServiceUnavailableMixin)(e);if(n.success)return(0,r.makeResult)({name:"IQErrorServiceUnavailable",value:n.value});const u=(0,o.parseIQErrorPartialServerErrorMixin)(e);if(u.success)return(0,r.makeResult)({name:"IQErrorPartialServerError",value:u.value});const c=(0,i.parseIQErrorFallbackServerMixin)(e);if(c.success)return(0,r.makeResult)({name:"IQErrorFallbackServer",value:c.value});return(0,l.errorMixinDisjunction)(e,["IQErrorInternalServerError","IQErrorServiceUnavailable","IQErrorPartialServerError","IQErrorFallbackServer"],[t,n,u,c])};var r=n(452813),i=n(647760),a=n(695068),o=n(212277),s=n(690545),l=n(593695)},418789:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseSubGroupMixin=function(e){const t=(0,i.attrGroupJid)(e,"sub_group_jid");if(!t.success)return t;return(0,r.makeResult)({subGroupJid:t.value})};var r=n(452813),i=n(885720)},196295:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseUnsupportedOperationMixin=function(e){const t=(0,i.assertTag)(e,"iq");if(!t.success)return t;const n=(0,i.flattenedChildWithTag)(e,"error");if(!n.success)return n;const a=(0,r.parseIQErrorBadRequestMixin)(n.value);if(!a.success)return a;return a};var r=n(848519),i=n(593695)},537521:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseUserDoesNotHaveAdminPermissionMixin=function(e){const t=(0,i.assertTag)(e,"iq");if(!t.success)return t;const n=(0,i.flattenedChildWithTag)(e,"error");if(!n.success)return n;const a=(0,r.parseIQErrorNotAuthorizedMixin)(n.value);if(!a.success)return a;return a};var r=n(16050),i=n(593695)},535438:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseUserIsNotAParticipantMixin=function(e){const t=(0,i.assertTag)(e,"iq");if(!t.success)return t;const n=(0,i.flattenedChildWithTag)(e,"error");if(!n.success)return n;const a=(0,r.parseIQErrorForbiddenMixin)(n.value);if(!a.success)return a;return a};var r=n(373494),i=n(593695)},897803:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeBaseGetGroupMixin=function(e,t){const n=function(e){const{iqTo:t}=e;return(0,a.mergeBaseIQGetRequestMixin)((0,r.smax)("iq",{to:(0,o.GROUP_JID)(t),xmlns:"w:g2"}))}(t);return(0,i.mergeStanzas)(e,n)};var r=n(898165),i=n(519603),a=n(346470),o=n(738102)},835052:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeBaseGetGroupOrServerMixinGroup=function(e,t){if(t.baseGetGroup)return(0,i.mergeBaseGetGroupMixin)(e,t.baseGetGroup);if(t.isBaseGetServer)return(0,a.mergeBaseGetServerMixin)(e);throw new r.SmaxMixinGroupExhaustiveError};var r=n(737392),i=n(897803),a=n(650875)},650875:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeBaseGetServerMixin=function(e){const t=(0,a.mergeBaseIQGetRequestMixin)((0,r.smax)("iq",{to:o.G_US,xmlns:"w:g2"}));return(0,i.mergeStanzas)(e,t)};var r=n(898165),i=n(519603),a=n(346470),o=n(738102)},346470:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeBaseIQGetRequestMixin=function(e){const t=(0,r.smax)("iq",{id:(0,a.generateId)(),type:"get"});return(0,i.mergeStanzas)(e,t)};var r=n(898165),i=n(519603),a=n(738102)},918155:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeBaseIQSetRequestMixin=function(e){const t=(0,r.smax)("iq",{id:(0,a.generateId)(),type:"set"});return(0,i.mergeStanzas)(e,t)};var r=n(898165),i=n(519603),a=n(738102)},281792:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeBaseSetGroupMixin=function(e,t){const n=function(e){const{iqTo:t}=e;return(0,a.mergeBaseIQSetRequestMixin)((0,r.smax)("iq",{to:(0,o.GROUP_JID)(t),xmlns:"w:g2"}))}(t);return(0,i.mergeStanzas)(e,n)};var r=n(898165),i=n(519603),a=n(918155),o=n(738102)},142194:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeGetGroupProfilePicturesProfilePicturesRequestPicturesPicture=d,t.mergeGetGroupProfilePicturesProfilePicturesRequestMixin=function(e,t){const n=function(e){const{pictureArgs:t,subGroupHintMixinArgs:n}=e;return(0,i.smax)("smax$any",null,(0,a.optionalMerge)(c.mergeSubGroupHintMixin,(0,i.smax)("pictures",null,(0,r.REPEATED_CHILD)(d,t,1,1e3)),n))}(t);return(0,a.mergeStanzas)(e,n)};var r=n(953719),i=n(898165),a=n(519603),o=n(707816),s=n(645658),l=n(231498),u=n(187013),c=n(387003);function d(e){const{profilePictureIdMixinArgs:t,profilePictureTypeMixinArgs:n,profilePictureQueryMixinArgs:r,parentOrSubGroupMixinGroupArgs:c}=e;return(0,o.mergeParentOrSubGroupMixinGroup)((0,a.optionalMerge)(l.mergeProfilePictureQueryMixin,(0,a.optionalMerge)(u.mergeProfilePictureTypeMixin,(0,a.optionalMerge)(s.mergeProfilePictureIdMixin,(0,i.smax)("picture",null),t),n),r),c)}},899476:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeGetGroupProfilePicturesRequest=function(e){const{baseGetGroupOrServerMixinGroupArgs:t}=e;return(0,i.mergeBaseGetGroupOrServerMixinGroup)((0,a.mergeGetGroupProfilePicturesProfilePicturesRequestMixin)((0,r.smax)("iq",null),e),t)};var r=n(898165),i=n(835052),a=n(142194)},147283:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeGetMembershipApprovalRequestsRequest=function(e){return(0,i.mergeBaseGetGroupMixin)((0,r.smax)("iq",null,(0,r.smax)("membership_approval_requests",null)),e)};var r=n(898165),i=n(897803)},662440:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeMembershipRequestsActionRequest=function(e){const{approveArgs:t,rejectArgs:n}=e;return(0,a.mergeBaseSetGroupMixin)((0,i.smax)("iq",null,(0,i.smax)("membership_requests_action",null,(0,r.OPTIONAL_CHILD)(l,t),(0,r.OPTIONAL_CHILD)(c,n))),e)},t.makeMembershipRequestsActionRequestMembershipRequestsActionApprove=l,t.makeMembershipRequestsActionRequestMembershipRequestsActionApproveParticipant=s,t.makeMembershipRequestsActionRequestMembershipRequestsActionReject=c,t.makeMembershipRequestsActionRequestMembershipRequestsActionRejectParticipant=u;var r=n(953719),i=n(898165),a=n(281792),o=n(738102);function s(e){const{participantJid:t}=e;return(0,i.smax)("participant",{jid:(0,o.USER_JID)(t)})}function l(e){const{participantArgs:t}=e;return(0,i.smax)("approve",null,(0,r.REPEATED_CHILD)(s,t,1,19999))}function u(e){const{participantJid:t}=e;return(0,i.smax)("participant",{jid:(0,o.USER_JID)(t)})}function c(e){const{participantArgs:t}=e;return(0,i.smax)("reject",null,(0,r.REPEATED_CHILD)(u,t,1,19999))}},428618:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeParentGroupMixin=function(e,t){const n=function(e){const{anyParentGroupJid:t}=e;return(0,r.smax)("smax$any",{parent_group_jid:(0,a.GROUP_JID)(t)})}(t);return(0,i.mergeStanzas)(e,n)};var r=n(898165),i=n(519603),a=n(738102)},707816:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeParentOrSubGroupMixinGroup=function(e,t){if(t.parentGroup)return(0,i.mergeParentGroupMixin)(e,t.parentGroup);if(t.subGroup)return(0,a.mergeSubGroupMixin)(e,t.subGroup);throw new r.SmaxMixinGroupExhaustiveError};var r=n(737392),i=n(428618),a=n(319874)},645658:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeProfilePictureIdMixin=function(e,t){const n=function(e){const{pictureId:t}=e;return(0,r.smax)("picture",{id:(0,a.CUSTOM_STRING)(t)})}(t);return(0,i.mergeStanzas)(e,n)};var r=n(898165),i=n(519603),a=n(738102)},231498:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeProfilePictureQueryMixin=function(e,t){const n=function(e){const{pictureQuery:t}=e;return(0,r.smax)("picture",{query:(0,a.CUSTOM_STRING)(t)})}(t);return(0,i.mergeStanzas)(e,n)};var r=n(898165),i=n(519603),a=n(738102)},187013:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeProfilePictureTypeMixin=function(e,t){const n=function(e){const{pictureType:t}=e;return(0,r.smax)("picture",{type:(0,a.CUSTOM_STRING)(t)})}(t);return(0,i.mergeStanzas)(e,n)};var r=n(898165),i=n(519603),a=n(738102)},387003:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeSubGroupHintMixin=function(e,t){const n=function(e){const{anyLinkedGroupsMembershipHint:t}=e;return(0,r.smax)("smax$any",{linked_groups_membership_hint:(0,a.GROUP_JID)(t)})}(t);return(0,i.mergeStanzas)(e,n)};var r=n(898165),i=n(519603),a=n(738102)},319874:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeSubGroupMixin=function(e,t){const n=function(e){const{anySubGroupJid:t}=e;return(0,r.smax)("smax$any",{sub_group_jid:(0,a.GROUP_JID)(t)})}(t);return(0,i.mergeStanzas)(e,n)};var r=n(898165),i=n(519603),a=n(738102)},912810:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.sendActiveIQRPC=function(){return c.apply(this,arguments)};var i=r(n(311504)),a=n(911794),o=n(652325),s=n(159718),l=n(96652),u=n(496995);function c(){return(c=(0,i.default)((function*(e){const t=(0,s.makeActiveIQRequest)(),n=yield(0,a.sendSmaxStanza)(t,e),r=(0,o.parseActiveIQResponseSuccess)(n,t);if(r.success)return{name:"ActiveIQResponseSuccess",value:r.value};throw new l.SmaxParsingFailure((0,u.errorMessageRpcParsing)("ActiveIQ",{Success:r}))}))).apply(this,arguments)}},381469:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.sendPassiveIQRPC=function(){return c.apply(this,arguments)};var i=r(n(311504)),a=n(911794),o=n(769776),s=n(896181),l=n(96652),u=n(496995);function c(){return(c=(0,i.default)((function*(e){const t=(0,s.makePassiveIQRequest)(),n=yield(0,a.sendSmaxStanza)(t,e),r=(0,o.parsePassiveIQResponseSuccess)(n,t);if(r.success)return{name:"PassiveIQResponseSuccess",value:r.value};throw new l.SmaxParsingFailure((0,u.errorMessageRpcParsing)("PassiveIQ",{Success:r}))}))).apply(this,arguments)}},652325:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseActiveIQResponseSuccess=function(e,t){const n=(0,o.assertTag)(e,"iq");if(!n.success)return n;const s=(0,o.flattenedChildWithTag)(e,"active");if(!s.success)return s;const l=(0,a.attrStringFromReference)(t,["id"]);if(!l.success)return l;const u=(0,o.literal)(o.attrString,e,"id",l.value);if(!u.success)return u;const c=(0,o.literal)(o.attrString,e,"type","result");if(!c.success)return c;const d=(0,i.literalJid)(i.attrDomainJid,e,"from","s.whatsapp.net");if(!d.success)return d;return(0,r.makeResult)({type:c.value,from:d.value})};var r=n(452813),i=n(885720),a=n(638167),o=n(593695)},769776:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parsePassiveIQResponseSuccess=function(e,t){const n=(0,o.assertTag)(e,"iq");if(!n.success)return n;const s=(0,o.flattenedChildWithTag)(e,"passive");if(!s.success)return s;const l=(0,a.attrStringFromReference)(t,["id"]);if(!l.success)return l;const u=(0,o.literal)(o.attrString,e,"id",l.value);if(!u.success)return u;const c=(0,o.literal)(o.attrString,e,"type","result");if(!c.success)return c;const d=(0,i.literalJid)(i.attrDomainJid,e,"from","s.whatsapp.net");if(!d.success)return d;return(0,r.makeResult)({type:c.value,from:d.value})};var r=n(452813),i=n(885720),a=n(638167),o=n(593695)},159718:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeActiveIQRequest=function(){return(0,r.smax)("iq",{id:(0,i.generateId)(),type:"set",xmlns:"passive",to:i.S_WHATSAPP_NET},(0,r.smax)("active",null))};var r=n(898165),i=n(738102)},896181:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makePassiveIQRequest=function(){return(0,r.smax)("iq",{id:(0,i.generateId)(),type:"set",xmlns:"passive",to:i.S_WHATSAPP_NET},(0,r.smax)("passive",null))};var r=n(898165),i=n(738102)},905552:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseClientResponseServerResponse=function(e,t){const n=(0,s.assertTag)(e,"iq");if(!n.success)return n;const l=(0,a.attrJidEnum)(e,"from",i.DOMAINJID_USERJID);if(!l.success)return l;const u=(0,s.literal)(s.attrString,e,"type","result");if(!u.success)return u;const c=(0,o.attrStringFromReference)(t,["id"]);if(!c.success)return c;const d=(0,s.literal)(s.attrString,e,"id",c.value);if(!d.success)return d;const p=(0,s.attrInt)(e,"t");if(!p.success)return p;return(0,r.makeResult)({from:l.value,type:u.value,t:p.value})};var r=n(452813),i=n(909842),a=n(885720),o=n(638167),s=n(593695)},909842:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DOMAINJID_USERJID=void 0;var r=n(616310);const i={validators:[r.validateDomainJid,r.validateUserJid],typeName:"DomainJid|UserJid"};t.DOMAINJID_USERJID=i},948035:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeClientRequest=function(){return(0,i.mergeClientWellFormedToMixin)((0,r.smax)("iq",{id:(0,a.generateId)(),type:"get",xmlns:"w:p"}))};var r=n(898165),i=n(171586),a=n(738102)},171586:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeClientWellFormedToMixin=function(e){const t=(0,r.smax)("iq",{to:a.S_WHATSAPP_NET});return(0,i.mergeStanzas)(e,t)};var r=n(898165),i=n(519603),a=n(738102)},854030:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.sendFetchMissingPreKeysRPC=function(){return p.apply(this,arguments)};var i=r(n(311504)),a=n(911794),o=n(335221),s=n(580395),l=n(195383),u=n(574759),c=n(96652),d=n(496995);function p(){return(p=(0,i.default)((function*(e,t){const n=(0,u.makeFetchMissingPreKeysRequest)(e),r=yield(0,a.sendSmaxStanza)(n,t),i=(0,l.parseFetchMissingPreKeysResponseSuccess)(r,n);if(i.success)return{name:"FetchMissingPreKeysResponseSuccess",value:i.value};const p=(0,o.parseFetchMissingPreKeysResponseRequestError)(r,n);if(p.success)return{name:"FetchMissingPreKeysResponseRequestError",value:p.value};const _=(0,s.parseFetchMissingPreKeysResponseServerError)(r,n);if(_.success)return{name:"FetchMissingPreKeysResponseServerError",value:_.value};throw new c.SmaxParsingFailure((0,d.errorMessageRpcParsing)("FetchMissingPreKeys",{Success:i,RequestError:p,ServerError:_}))}))).apply(this,arguments)}},873079:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseDeviceIdentityMixin=function(e){const t=(0,i.flattenedChildWithTag)(e,"device-identity");if(!t.success)return t;const n=(0,i.contentBytes)(t.value);if(!n.success)return n;return(0,r.makeResult)({deviceIdentityElementValue:n.value})};var r=n(452813),i=n(593695)},335221:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.parseFetchMissingPreKeysResponseRequestError=function(e,t){const n=(0,l.assertTag)(e,"iq");if(!n.success)return n;const r=(0,l.flattenedChildWithTag)(e,"error");if(!r.success)return r;const u=(0,o.parseIQErrorResponseMixin)(e,t);if(!u.success)return u;const c=(0,s.parseRequestErrorsFetch)(r.value);if(!c.success)return c;return(0,a.makeResult)((0,i.default)((0,i.default)({},u.value),{},{errorRequestErrorsFetch:c.value}))};var i=r(n(73982)),a=n(452813),o=n(380929),s=n(895740),l=n(593695)},580395:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.parseFetchMissingPreKeysResponseServerError=function(e,t){const n=(0,l.assertTag)(e,"iq");if(!n.success)return n;const r=(0,l.flattenedChildWithTag)(e,"error");if(!r.success)return r;const u=(0,o.parseIQErrorResponseMixin)(e,t);if(!u.success)return u;const c=(0,s.parseServerErrors)(r.value);if(!c.success)return c;return(0,a.makeResult)((0,i.default)((0,i.default)({},u.value),{},{errorServerErrors:c.value}))};var i=r(n(73982)),a=n(452813),o=n(380929),s=n(348438),l=n(593695)},195383:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.parseFetchMissingPreKeysResponseSuccess=function(e,t){const n=(0,u.assertTag)(e,"iq");if(!n.success)return n;const r=(0,u.flattenedChildWithTag)(e,"list");if(!r.success)return r;const s=(0,o.parseIQResultResponseMixin)(e,t);if(!s.success)return s;const l=(0,u.mapChildrenWithTag)(r.value,"user",0,1e5,c);if(!l.success)return l;return(0,a.makeResult)((0,i.default)((0,i.default)({},s.value),{},{listUser:l.value}))},t.parseFetchMissingPreKeysResponseSuccessListUser=c;var i=r(n(73982)),a=n(452813),o=n(46767),s=n(90830),l=n(885720),u=n(593695);function c(e){const t=(0,u.assertTag)(e,"user");if(!t.success)return t;const n=(0,l.attrUserJid)(e,"jid");if(!n.success)return n;const r=(0,s.parseUserFetchMissingPreKeysSuccessOrFetchMissingPreKeysErrorOrFetchMissingPreKeysErrorFallbackMixinGroup)(e);return r.success?(0,a.makeResult)({jid:n.value,userFetchMissingPreKeysSuccessOrFetchMissingPreKeysErrorOrFetchMissingPreKeysErrorFallbackMixinGroup:r.value}):r}},327673:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseFetchMissingPreKeysUserErrorFallbackMixin=function(e){const t=(0,i.assertTag)(e,"user");if(!t.success)return t;const n=(0,i.flattenedChildWithTag)(e,"error");if(!n.success)return n;const a=(0,i.attrString)(n.value,"text");if(!a.success)return a;const o=(0,i.attrIntRange)(n.value,"code",500,599);if(!o.success)return o;return(0,r.makeResult)({errorText:a.value,errorCode:o.value})};var r=n(452813),i=n(593695)},650832:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseFetchMissingPreKeysUserErrorMixin=function(e){const t=(0,i.assertTag)(e,"user");if(!t.success)return t;const n=(0,i.flattenedChildWithTag)(e,"error");if(!n.success)return n;const a=(0,i.attrString)(n.value,"text");if(!a.success)return a;const o=(0,i.literal)(i.attrString,n.value,"code","500");if(!o.success)return o;return(0,r.makeResult)({errorText:a.value,errorCode:o.value})};var r=n(452813),i=n(593695)},288277:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.parseFetchMissingPreKeysUserSuccessDevice=f,t.parseFetchMissingPreKeysUserSuccessMixin=function(e){const t=(0,_.assertTag)(e,"user");if(!t.success)return t;const n=(0,p.attrUserJid)(e,"jid");if(!n.success)return n;const r=(0,_.mapChildrenWithTag)(e,"device",1,100,f);if(!r.success)return r;return(0,a.makeResult)({jid:n.value,device:r.value})};var i=r(n(73982)),a=n(452813),o=n(873079),s=n(822148),l=n(742757),u=n(253),c=n(469748),d=n(174710),p=n(885720),_=n(593695);function f(e){const t=(0,_.assertTag)(e,"device");if(!t.success)return t;const n=(0,_.attrIntRange)(e,"id",0,99);if(!n.success)return n;const r=(0,_.optional)(_.attrIntRange,e,"t",0,void 0);if(!r.success)return r;const p=(0,c.parseRegistrationIDMixin)(e);if(!p.success)return p;const f=(0,l.parseKeyTypeMixin)(e),h=(0,s.parseIdentityKeyMixin)(e);if(!h.success)return h;const g=(0,u.parsePreKeyMixin)(e),m=(0,d.parseSignedPreKeyMixin)(e);if(!m.success)return m;const y=(0,o.parseDeviceIdentityMixin)(e);return(0,a.makeResult)((0,i.default)((0,i.default)((0,i.default)((0,i.default)({id:n.value,t:r.value},p.value),{},{keyTypeMixin:f.success?f.value:null},h.value),{},{preKeyMixin:g.success?g.value:null},m.value),{},{deviceIdentityMixin:y.success?y.value:null}))}},904366:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorBadRequestMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"text","bad-request");if(!n.success)return n;const a=(0,i.literal)(i.attrString,e,"code","400");if(!a.success)return a;return(0,r.makeResult)({text:n.value,code:a.value})};var r=n(452813),i=n(593695)},541998:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorFallbackClientMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.attrString)(e,"text");if(!n.success)return n;const a=(0,i.attrIntRange)(e,"code",400,499);if(!a.success)return a;return(0,r.makeResult)({text:n.value,code:a.value})};var r=n(452813),i=n(593695)},553925:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorFallbackServerMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.attrString)(e,"text");if(!n.success)return n;const a=(0,i.attrIntRange)(e,"code",500,599);if(!a.success)return a;return(0,r.makeResult)({text:n.value,code:a.value})};var r=n(452813),i=n(593695)},918253:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorNoValidJIDMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"text","not-acceptable");if(!n.success)return n;const a=(0,i.literal)(i.attrInt,e,"code",406);if(!a.success)return a;return(0,r.makeResult)({text:n.value,code:a.value})};var r=n(452813),i=n(593695)},380929:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorResponseMixin=function(e,t){const n=(0,a.assertTag)(e,"iq");if(!n.success)return n;const o=(0,i.attrStringFromReference)(t,["id"]);if(!o.success)return o;const s=(0,a.literal)(a.attrString,e,"id",o.value);if(!s.success)return s;const l=(0,i.attrStringFromReference)(t,["to"]);if(!l.success)return l;const u=(0,a.literal)(a.attrString,e,"from",l.value);if(!u.success)return u;const c=(0,a.literal)(a.attrString,e,"type","error");if(!c.success)return c;return(0,r.makeResult)({type:c.value})};var r=n(452813),i=n(638167),a=n(593695)},476899:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorServiceUnavailableMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"text","service-unavailable");if(!n.success)return n;const a=(0,i.literal)(i.attrString,e,"code","503");if(!a.success)return a;return(0,r.makeResult)({text:n.value,code:a.value})};var r=n(452813),i=n(593695)},46767:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQResultResponseMixin=function(e,t){const n=(0,a.assertTag)(e,"iq");if(!n.success)return n;const o=(0,i.attrStringFromReference)(t,["id"]);if(!o.success)return o;const s=(0,a.literal)(a.attrString,e,"id",o.value);if(!s.success)return s;const l=(0,i.attrStringFromReference)(t,["to"]);if(!l.success)return l;const u=(0,a.literal)(a.attrString,e,"from",l.value);if(!u.success)return u;const c=(0,a.literal)(a.attrString,e,"type","result");if(!c.success)return c;return(0,r.makeResult)({type:c.value})};var r=n(452813),i=n(638167),a=n(593695)},822148:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIdentityKeyMixin=function(e){const t=(0,i.flattenedChildWithTag)(e,"identity");if(!t.success)return t;const n=(0,r.parseKeyDataMixin)(t.value);if(!n.success)return n;return n};var r=n(946561),i=n(593695)},946561:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseKeyDataMixin=function(e){const t=(0,i.contentBytesRange)(e,32,32);if(!t.success)return t;return(0,r.makeResult)({elementValue:t.value})};var r=n(452813),i=n(593695)},324820:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseKeyIDMixin=function(e){const t=(0,i.assertTag)(e,"id");if(!t.success)return t;const n=(0,i.contentBytesRange)(e,3,3);if(!n.success)return n;return(0,r.makeResult)({elementValue:n.value})};var r=n(452813),i=n(593695)},742757:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseKeyTypeMixin=function(e){const t=(0,i.flattenedChildWithTag)(e,"type");if(!t.success)return t;const n=(0,i.contentLiteralBytes)(t.value,new Uint8Array([5]));if(!n.success)return n;return(0,r.makeResult)({typeElementValue:n.value})};var r=n(452813),i=n(593695)},253:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parsePreKeyMixin=function(e){const t=(0,o.flattenedChildWithTag)(e,"key");if(!t.success)return t;const n=(0,o.flattenedChildWithTag)(t.value,"id");if(!n.success)return n;const s=(0,o.flattenedChildWithTag)(t.value,"value");if(!s.success)return s;const l=(0,a.parseKeyIDMixin)(n.value);if(!l.success)return l;const u=(0,i.parseKeyDataMixin)(s.value);if(!u.success)return u;return(0,r.makeResult)({keyIdKeyIDMixin:l.value,keyValueKeyDataMixin:u.value})};var r=n(452813),i=n(946561),a=n(324820),o=n(593695)},469748:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseRegistrationIDMixin=function(e){const t=(0,i.flattenedChildWithTag)(e,"registration");if(!t.success)return t;const n=(0,i.contentBytesRange)(t.value,4,4);if(!n.success)return n;return(0,r.makeResult)({registrationElementValue:n.value})};var r=n(452813),i=n(593695)},895740:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseRequestErrorsFetch=function(e){const t=(0,i.parseIQErrorBadRequestMixin)(e);if(t.success)return(0,r.makeResult)({name:"IQErrorBadRequest",value:t.value});const n=(0,o.parseIQErrorNoValidJIDMixin)(e);if(n.success)return(0,r.makeResult)({name:"IQErrorNoValidJID",value:n.value});const l=(0,a.parseIQErrorFallbackClientMixin)(e);if(l.success)return(0,r.makeResult)({name:"IQErrorFallbackClient",value:l.value});return(0,s.errorMixinDisjunction)(e,["IQErrorBadRequest","IQErrorNoValidJID","IQErrorFallbackClient"],[t,n,l])};var r=n(452813),i=n(904366),a=n(541998),o=n(918253),s=n(593695)},348438:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseServerErrors=function(e){const t=(0,a.parseIQErrorServiceUnavailableMixin)(e);if(t.success)return(0,r.makeResult)({name:"IQErrorServiceUnavailable",value:t.value});const n=(0,i.parseIQErrorFallbackServerMixin)(e);if(n.success)return(0,r.makeResult)({name:"IQErrorFallbackServer",value:n.value});return(0,o.errorMixinDisjunction)(e,["IQErrorServiceUnavailable","IQErrorFallbackServer"],[t,n])};var r=n(452813),i=n(553925),a=n(476899),o=n(593695)},174710:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseSignedPreKeyMixin=function(e){const t=(0,o.flattenedChildWithTag)(e,"skey");if(!t.success)return t;const n=(0,o.flattenedChildWithTag)(t.value,"id");if(!n.success)return n;const s=(0,o.flattenedChildWithTag)(t.value,"value");if(!s.success)return s;const l=(0,o.flattenedChildWithTag)(t.value,"signature");if(!l.success)return l;const u=(0,o.contentBytesRange)(l.value,64,64);if(!u.success)return u;const c=(0,a.parseKeyIDMixin)(n.value);if(!c.success)return c;const d=(0,i.parseKeyDataMixin)(s.value);if(!d.success)return d;return(0,r.makeResult)({skeySignatureElementValue:u.value,skeyIdKeyIDMixin:c.value,skeyValueKeyDataMixin:d.value})};var r=n(452813),i=n(946561),a=n(324820),o=n(593695)},90830:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseUserFetchMissingPreKeysSuccessOrFetchMissingPreKeysErrorOrFetchMissingPreKeysErrorFallbackMixinGroup=function(e){const t=(0,o.parseFetchMissingPreKeysUserSuccessMixin)(e);if(t.success)return(0,r.makeResult)({name:"FetchMissingPreKeysUserSuccess",value:t.value});const n=(0,a.parseFetchMissingPreKeysUserErrorMixin)(e);if(n.success)return(0,r.makeResult)({name:"FetchMissingPreKeysUserError",value:n.value});const l=(0,i.parseFetchMissingPreKeysUserErrorFallbackMixin)(e);if(l.success)return(0,r.makeResult)({name:"FetchMissingPreKeysUserErrorFallback",value:l.value});return(0,s.errorMixinDisjunction)(e,["UserSuccess","UserError","UserErrorFallback"],[t,n,l])};var r=n(452813),i=n(327673),a=n(650832),o=n(288277),s=n(593695)},297907:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeClientRequestMixin=function(e){const t=(0,r.smax)("iq",{id:(0,a.generateId)(),xmlns:"encrypt",to:a.S_WHATSAPP_NET});return(0,i.mergeStanzas)(e,t)};var r=n(898165),i=n(519603),a=n(738102)},574759:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeFetchMissingPreKeysRequest=function(e){const{userArgs:t}=e;return(0,o.mergeClientRequestMixin)((0,a.smax)("iq",{type:"get"},(0,a.smax)("key_fetch",null,(0,i.REPEATED_CHILD)(c,t,1,1e5))))},t.makeFetchMissingPreKeysRequestKeyFetchUser=c,t.makeFetchMissingPreKeysRequestKeyFetchUserDevice=u;var r=n(72011),i=n(953719),a=n(898165),o=n(297907),s=n(794706),l=n(738102);function u(e){const{deviceId:t}=e;return(0,s.mergeRegistrationIDMixin)((0,a.smax)("device",{id:(0,l.INT)(t)}),e)}function c(e){const{deviceArgs:t,userJid:n,hasUserReasonIdentity:o}=e;return(0,a.smax)("user",{jid:(0,l.USER_JID)(n),reason:(0,r.OPTIONAL_LITERAL)("identity",o)},(0,i.REPEATED_CHILD)(u,t,0,100))}},794706:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeRegistrationIDMixin=function(e,t){const n=function(e){const{registrationElementValue:t}=e;return(0,r.smax)("smax$any",null,(0,r.smax)("registration",null,t))}(t);return(0,i.mergeStanzas)(e,n)};var r=n(898165),i=n(519603)},508878:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeBaseIQGetRequestMixin=function(e){const t=(0,r.smax)("iq",{id:(0,a.generateId)(),type:"get"});return(0,i.mergeStanzas)(e,t)};var r=n(898165),i=n(519603),a=n(738102)},468308:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeGetV1Request=function(){return(0,i.mergeBaseIQGetRequestMixin)((0,r.smax)("iq",{to:a.S_WHATSAPP_NET,xmlns:"w"},(0,r.smax)("props",null)))};var r=n(898165),i=n(508878),a=n(738102)},733517:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.sendSendBufferRPC=function(){return p.apply(this,arguments)};var i=r(n(311504)),a=n(911794),o=n(195035),s=n(696738),l=n(60625),u=n(403945),c=n(96652),d=n(496995);function p(){return(p=(0,i.default)((function*(e,t){const n=(0,u.makeSendBufferRequest)(e),r=yield(0,a.sendSmaxStanza)(n,t),i=(0,l.parseSendBufferResponseSuccess)(r,n);if(i.success)return{name:"SendBufferResponseSuccess",value:i.value};const p=(0,o.parseSendBufferResponseErrorNoRetry)(r,n);if(p.success)return{name:"SendBufferResponseErrorNoRetry",value:p.value};const _=(0,s.parseSendBufferResponseErrorRetry)(r,n);if(_.success)return{name:"SendBufferResponseErrorRetry",value:_.value};throw new c.SmaxParsingFailure((0,d.errorMessageRpcParsing)("SendBuffer",{Success:i,ErrorNoRetry:p,ErrorRetry:_}))}))).apply(this,arguments)}},106070:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorBadRequestMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"text","bad-request");if(!n.success)return n;const a=(0,i.literal)(i.attrString,e,"code","400");if(!a.success)return a;return(0,r.makeResult)({text:n.value,code:a.value})};var r=n(452813),i=n(593695)},89247:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorBadRequestOrNotAcceptableOrFeatureNotImplementedMixinGroup=function(e){const t=(0,i.parseIQErrorBadRequestMixin)(e);if(t.success)return(0,r.makeResult)({name:"IQErrorBadRequest",value:t.value});const n=(0,o.parseIQErrorNotAcceptableMixin)(e);if(n.success)return(0,r.makeResult)({name:"IQErrorNotAcceptable",value:n.value});const l=(0,a.parseIQErrorFeatureNotImplementedMixin)(e);if(l.success)return(0,r.makeResult)({name:"IQErrorFeatureNotImplemented",value:l.value});return(0,s.errorMixinDisjunction)(e,["IQErrorBadRequest","IQErrorNotAcceptable","IQErrorFeatureNotImplemented"],[t,n,l])};var r=n(452813),i=n(106070),a=n(235904),o=n(256568),s=n(593695)},235904:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorFeatureNotImplementedMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"text","feature-not-implemented");if(!n.success)return n;const a=(0,i.literal)(i.attrString,e,"code","501");if(!a.success)return a;return(0,r.makeResult)({text:n.value,code:a.value})};var r=n(452813),i=n(593695)},256568:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorNotAcceptableField=a,t.parseIQErrorNotAcceptableMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.optionalChildWithTag)(e,"field",a);if(!n.success)return n;const o=(0,i.literal)(i.attrString,e,"text","not-acceptable");if(!o.success)return o;const s=(0,i.literal)(i.attrString,e,"code","406");if(!s.success)return s;return(0,r.makeResult)({text:o.value,code:s.value,field:n.value})};var r=n(452813),i=n(593695);function a(e){const t=(0,i.assertTag)(e,"field");if(!t.success)return t;const n=(0,i.attrString)(e,"name");if(!n.success)return n;const a=(0,i.attrString)(e,"reason");return a.success?(0,r.makeResult)({name:n.value,reason:a.value}):a}},253960:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorResponseMixin=function(e,t){const n=(0,a.assertTag)(e,"iq");if(!n.success)return n;const o=(0,i.attrStringFromReference)(t,["id"]);if(!o.success)return o;const s=(0,a.literal)(a.attrString,e,"id",o.value);if(!s.success)return s;const l=(0,i.attrStringFromReference)(t,["to"]);if(!l.success)return l;const u=(0,a.literal)(a.attrString,e,"from",l.value);if(!u.success)return u;const c=(0,a.literal)(a.attrString,e,"type","error");if(!c.success)return c;return(0,r.makeResult)({type:c.value})};var r=n(452813),i=n(638167),a=n(593695)},483431:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQErrorServiceUnavailableMixin=function(e){const t=(0,i.assertTag)(e,"error");if(!t.success)return t;const n=(0,i.literal)(i.attrString,e,"text","service-unavailable");if(!n.success)return n;const a=(0,i.literal)(i.attrString,e,"code","503");if(!a.success)return a;return(0,r.makeResult)({text:n.value,code:a.value})};var r=n(452813),i=n(593695)},686027:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseIQResultResponseMixin=function(e,t){const n=(0,a.assertTag)(e,"iq");if(!n.success)return n;const o=(0,i.attrStringFromReference)(t,["id"]);if(!o.success)return o;const s=(0,a.literal)(a.attrString,e,"id",o.value);if(!s.success)return s;const l=(0,i.attrStringFromReference)(t,["to"]);if(!l.success)return l;const u=(0,a.literal)(a.attrString,e,"from",l.value);if(!u.success)return u;const c=(0,a.literal)(a.attrString,e,"type","result");if(!c.success)return c;return(0,r.makeResult)({type:c.value})};var r=n(452813),i=n(638167),a=n(593695)},195035:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.parseSendBufferResponseErrorNoRetry=function(e,t){const n=(0,l.assertTag)(e,"iq");if(!n.success)return n;const r=(0,l.flattenedChildWithTag)(e,"error");if(!r.success)return r;const u=(0,s.parseIQErrorResponseMixin)(e,t);if(!u.success)return u;const c=(0,o.parseIQErrorBadRequestOrNotAcceptableOrFeatureNotImplementedMixinGroup)(r.value);if(!c.success)return c;return(0,a.makeResult)((0,i.default)((0,i.default)({},u.value),{},{errorIQErrorBadRequestOrNotAcceptableOrFeatureNotImplementedMixinGroup:c.value}))};var i=r(n(73982)),a=n(452813),o=n(89247),s=n(253960),l=n(593695)},696738:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.parseSendBufferResponseErrorRetry=function(e,t){const n=(0,l.assertTag)(e,"iq");if(!n.success)return n;const r=(0,l.flattenedChildWithTag)(e,"error");if(!r.success)return r;const u=(0,s.parseIQErrorServiceUnavailableMixin)(r.value);if(!u.success)return u;const c=(0,o.parseIQErrorResponseMixin)(e,t);if(!c.success)return c;return(0,a.makeResult)((0,i.default)({errorIQErrorServiceUnavailableMixin:u.value},c.value))};var i=r(n(73982)),a=n(452813),o=n(253960),s=n(483431),l=n(593695)},60625:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseSendBufferResponseSuccess=function(e,t){const n=(0,i.assertTag)(e,"iq");if(!n.success)return n;const a=(0,r.parseIQResultResponseMixin)(e,t);if(!a.success)return a;return a};var r=n(686027),i=n(593695)},568434:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeBaseIQSetRequestMixin=function(e){const t=(0,r.smax)("iq",{id:(0,a.generateId)(),type:"set"});return(0,i.mergeStanzas)(e,t)};var r=n(898165),i=n(519603),a=n(738102)},294987:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeBufferMixin=function(e,t){const n=function(e){const{addElementValue:t}=e;return(0,r.smax)("add",null,t)}(t);return(0,i.mergeStanzas)(e,n)};var r=n(898165),i=n(519603)},403945:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeSendBufferRequest=function(e){const{addT:t,bufferMixinArgs:n}=e;return(0,i.mergeBaseIQSetRequestMixin)((0,r.smax)("iq",{xmlns:"w:stats",to:o.S_WHATSAPP_NET},(0,a.mergeBufferMixin)((0,r.smax)("add",{t:(0,o.INT)(t)}),n)))};var r=n(898165),i=n(568434),a=n(294987),o=n(738102)},885720:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.attrBroadcastJid=function(e,t){return(0,a.attrValidate)(e,t,r.validateBroadcastJid,"BroadcastJid")},t.attrCallJid=function(e,t){return(0,a.attrValidate)(e,t,r.validateCallJid,"CallJid")},t.attrDeviceJid=function(e,t){return(0,a.attrValidate)(e,t,r.validateDeviceJid,"DeviceJid")},t.attrDomainJid=function(e,t){return(0,a.attrValidate)(e,t,r.validateDomainJid,"DomainJid")},t.attrGroupJid=function(e,t){return(0,a.attrValidate)(e,t,r.validateGroupJid,"GroupJid")},t.attrJidEnum=function(e,t,n){const r=(0,a.attrString)(e,t);if(!r.success)return r;const{validators:o,typeName:s}=n;for(let e=0;e<o.length;e++){const t=o[e](r.value);if(null!=t)return(0,i.makeResult)(t)}return(0,a.errorMessage)(e,`to have "${t}"={${s}}, but instead has "${r.value}"`)},t.attrStatusJid=function(e,t){return(0,a.attrValidate)(e,t,r.validateStatusJid,"StatusJid")},t.attrUserJid=function(e,t){return(0,a.attrValidate)(e,t,r.validateUserJid,"UserJid")},t.literalJid=function(e,t,n,r){const i=e(t,n);if(!i.success)return i;if(i.value===r)return i;return(0,a.errorMessage)(t,`to have "${n}"={${r}}, but instead has "${i.value}"`)},t.optionalLiteralJid=function(e,t,n,r){const i=(0,a.optional)(e,t,n);if(!i.success)return i;if(null==i.value||i.value===r)return i;return(0,a.errorMessage)(t,`to have "${n}"={${r}}, but instead has "${i.value}"`)};var r=n(616310),i=n(452813),a=n(593695)},638167:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.attrFromReference=s,t.attrStringFromReference=l,t.contentStringFromReference=function(e,t){const n=u(e,t);if(!n.success)return d(n);const r=(0,o.contentString)(n.value);if(!r.success)return d(r);return r},t.optionalAttrFromReference=function(e,t,n,r,i){return c(t,n)?s(e,t,n,r,i):o.voidSuccess},t.optionalAttrStringFromReference=function(e,t){return c(e,t)?l(e,t):o.voidSuccess};var i=r(n(836821)),a=n(452813),o=n(593695);function s(e,t,n,r,i){const a=u(t,n);if(!a.success)return d(a);const o=e(a.value,n[n.length-1],r,i);return o.success?o:d(o)}function l(e,t){return s(o.attrString,e,t)}function u(e,t){const n=t.length;let r=e;for(let e=0;e<n-1;e++){const n=t[e],i=(0,o.flattenedChildWithTag)(r,n);if(!i.success)return i;r=i.value}return(0,a.makeResult)(r)}function c(e,t){const n=u(e,t);return n.success&&(0,i.default)(n.value.attrs,t[t.length-1])}function d(e){return(0,a.makeError)(`in the reference, ${e.error}`)}},593695:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.assertAttr=function(e,t,n){const r=_(e,t);if(!r.success)return r;if(r.value!==n)return P(e,`to have "${t}"="${n}", but instead has "${r.value}"`);return p},t.assertTag=function(e,t){if(e.tag!==t)return P(e,`to be <${t}>`);return p},t.attrInt=g,t.attrIntRange=function(e,t,n,r){const i=g(e,t);if(!i.success)return i;const a=i.value;if(void 0!==n&&a<n)return P(e,`to have "${t}"={at least ${n}} but has value ${a}`);if(void 0!==r&&a>r)return P(e,`to have "${t}"={at most ${r}} but has value ${a}`);return(0,u.makeResult)(a)},t.attrStanzaId=function(e,t){return f(e,t,c.toStanzaId,"stanzaID")},t.attrString=_,t.attrStringEnum=function(e,t,n){const r=_(e,t);if(!r.success)return r;const i=n[r.value];if(null!=i)return(0,u.makeResult)(i);const a=Object.values(n).join("|");return P(e,`to have "${t}"={${a}}, but instead has "${r.value}"`)},t.attrValidate=f,t.childWithTag=function(e,t,n){const r=E(e,t,n);if(!r.success)return r;const i=r.value;if(null==i)return P(e,`to have 1 child <${t}>, but found 0`);return(0,u.makeResult)(i)},t.contentBytes=C,t.contentBytesRange=function(e,t,n){const r=C(e);if(!r.success)return r;const i=r.value.length;if(void 0!==t&&i<t)return P(e,`to have binary content at least ${t} bytes but has ${i} bytes`);if(void 0!==n&&i>n)return P(e,`to have binary content at most ${n} bytes but has ${i} bytes`);return(0,u.makeResult)(r.value)},t.contentInt=function(e){return h(e,I,"integer")},t.contentLiteralBytes=function(e,t){const n=C(e);if(!n.success)return n;if((0,o.uint8ArraysEqual)(n.value,t))return(0,u.makeResult)(t);return P(e,`to have content ":binary:${(0,i.encodeB64)(t)}", but instead has ":binary:${(0,i.encodeB64)(n.value)}"`)},t.contentString=A,t.contentStringEnum=function(e,t){const n=A(e);if(!n.success)return n;const r=t[n.value];if(null!=r)return(0,u.makeResult)(r);const i=Object.values(t).join("|");return P(e,`to have content "${i}", but instead has "${n.value}"`)},t.contentValidate=h,t.countChildrenWithTag=function(e,t,n,r,i){const a=M(e,t,n,r);if(!a.success)return a;const o=a.value.length;for(let e=0;e<o;e++){const t=i(a.value[e]);if(!t.success)return t}return(0,u.makeResult)(o)},t.countHomogeneousChildrenWithTag=function(e,t,n){const r=T(e,t,n);if(!r.success)return r;return(0,u.makeResult)(r.value.length)},t.emptyObject=void 0,t.errorMessage=P,t.errorMixinDisjunction=function(e,t,n){const r=t.map(((e,t)=>`${e}: ${n[t].error}`));return P(e,[`to match any of following mixins: ${t.join(", ")}, but all mixins failed.`,...r].join(" "))},t.flattenedChildWithTag=function(e,t){const n=y(e,t);if(!n.success)return n;if(null==n.value)return P(e,`to have 1 child <${t}>, but found 0`);return(0,u.makeResult)(n.value)},t.identity=function(e){return e},t.literal=function(e,t,n,r){const i=e(t,n);if(!i.success)return i;if(i.value===r)return(0,u.makeResult)(r);return P(t,`to have "${n}"={${r}}, but instead has "${i.value}"`)},t.literalContent=function(e,t,n){const r=e(t);if(!r.success)return r;if(r.value===n)return(0,u.makeResult)(n);return P(t,`to have content "${n}", but instead has "${r.value}"`)},t.mapChildrenWithTag=S,t.mapHomogeneousChildrenWithTag=T,t.maybeChildren=m,t.optional=v,t.optionalChild=y,t.optionalChildWithTag=E,t.optionalLiteral=function(e,t,n,r){if(null==r)return p;const i=v(e,t,n);if(!i.success)return i;if(i.value===r)return(0,u.makeResult)(r);if(null==i.value)return p;return P(t,`to have "${n}"={${r}}, but instead has "${i.value}"`)},t.voidSuccess=void 0;var i=n(417405),a=n(551168),o=n(703177),s=n(399144),l=r(n(836821)),u=n(452813),c=n(839810),d=n(638134);const p=(0,u.makeResult)();function _(e,t){return O(e,t)?function(e,t){if(t instanceof d.WapJid)return(0,u.makeResult)(t.toString());if("string"==typeof t)return(0,u.makeResult)(t);return P(e,`decodeAsString: attribute is ${typeof t} not a string: ${String(t)}`)}(e,e.attrs[t]):P(e,`to have attribute "${t}"`)}function f(e,t,n,r){const i=_(e,t);if(!i.success)return i;const a=n(i.value);return null!=a?(0,u.makeResult)(a):P(e,`to have "${t}"={${r}}, but instead has "${i.value}"`)}function h(e,t,n){const r=A(e);if(!r.success)return r;const i=t(r.value);return null!=i?(0,u.makeResult)(i):P(e,`to have ${n} content, but instead has "${r.value}"`)}function g(e,t){return f(e,t,I,"integer")}function m(e){const t=e.content;return t instanceof Uint8Array?P(e,"to have children"):(0,u.makeResult)(t)}function y(e,t){const n=m(e);if(!n.success)return n;const r=n.value;if(null==r)return p;let i=null;for(let n=0;n<r.length;n++){const a=r[n];if(a.tag===t){if(null!=i)return P(e,`to have 1 child <${t}>, but found more than 1`);i=a}}return(0,u.makeResult)(i)}function E(e,t,n){const r=y(e,t);return r.success?null==r.value?p:n(r.value):r}function S(e,t,n,r,i){const a=M(e,t,n,r);if(!a.success)return a;const o=[];for(let e=0;e<a.value.length;e++){const t=i(a.value[e]);if(!t.success)return t;o.push(t.value)}return(0,u.makeResult)(o)}function T(e,t,n){const r=S(e,t,0,1/0,n);if(!r.success)return r;for(let t=0;t<r.value.length;t++)if(!(0,s.deepEqual)(r.value[0],r.value[t]))return P(e,"to have homogeneous children, but found two children that are not equal");return r}function v(e,t,n,r,i){return O(t,n)?e(t,n,r,i):p}function A(e){const t=C(e);if(!t.success)return t;try{const e=new a.Binary(t.value),n=e.readString(e.size());return(0,u.makeResult)(n)}catch(t){return P(e,`to have string content, but run into decoding error: ${t.message}`)}}function C(e){const{content:t}=e;return null==t?P(e,"to have content"):Array.isArray(t)?P(e,"to have content, but has children instead"):(0,u.makeResult)(t)}function P(e,t){return(0,u.makeError)(`expected <${e.tag}>: ${t}`)}function O(e,t){return(0,l.default)(e.attrs,t)}function I(e){const t=parseInt(e,10);return Number.isNaN(t)?null:t}function M(e,t,n,r){const i=m(e);if(!i.success)return i;const a=i.value;if(null==a)return 0!==n?P(e,`to have at least ${n} <${t}> children, but found 0`):(0,u.makeResult)([]);const o=[];for(let e=0;e<a.length;e++){const n=a[e];n.tag===t&&o.push(n)}const s=o.length;return s<n?P(e,`to have at least ${n} <${t}> children, but found ${s}`):s>r?P(e,`to have at most ${r} <${t}> children, but found ${s}`):(0,u.makeResult)(o)}t.voidSuccess=p;t.emptyObject={}},72011:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OPTIONAL=function(e,t){return null==t?r.DROP_ATTR:e(t)},t.OPTIONAL_LITERAL=function(e,t){return t?e:r.DROP_ATTR};var r=n(738102)},953719:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HAS_OPTIONAL_CHILD=function(e,t){if(null==t)return null;if(t)return e()},t.HOMOGENEOUS_CHILD=function(e,t){if(t)for(let e=1;e<t.length;e++)if(!(0,r.deepEqual)(t[e],t[0]))throw new Error("expected all homogeneous children to be equal, but they were not");return i(e,t,0,1/0)},t.HOMOGENEOUS_CHILD_COUNT=function(e,t){return a(e,t,0,1/0)},t.OPTIONAL_CHILD=function(e,t){return null==t?null:e(t)},t.REPEATED_CHILD=i,t.REPEATED_CHILD_COUNT=a;var r=n(399144);function i(e,t,n,r){if(null==t){if(n>0)throw new Error(`expected at least ${n} children, but none provided`);return[]}const i=t.length;if(i<n)throw new Error(`expected at least ${n} children, but found ${i}`);if(i>r)throw new Error(`expected at most ${r} children, but found ${i}`);return t.map((t=>e(t)))}function a(e,t,n,r){if(0===t){if(n>0)throw new Error(`expected at least ${n} children, but none provided`);return[]}if(t<n)throw new Error(`expected at least ${n} children, but found ${t}`);if(t>r)throw new Error(`expected at most ${r} children, but found ${t}`);const i=[];for(let n=0;n<t;n++)i.push(e());return i}},898165:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.smax=void 0;const r=n(738102).wap;t.smax=r},737392:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmaxMixinGroupExhaustiveError=void 0;class n extends Error{constructor(){super(...arguments),this.name="SmaxMixinGroupExhaustiveError"}}t.SmaxMixinGroupExhaustiveError=n},519603:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeStanzas=o,t.optionalMerge=function(e,t,n,r){if(null!=n)return e(t,n,r);return t};var r=n(81758),i=n(638134);const a="smax$any";function o(e,t){return function(e,t){const n=e.tag,r=t.tag;if(r===a)return;if(n!==r)throw new Error(`tag mismatch: ${n} != ${r}`)}(e,t),function(e,t){const n=e.attrs,r=t.attrs;Object.keys(r).forEach((e=>{const t=r[e],a=n[e];if(null!=t&&null!=a){if(function(e,t){if("string"==typeof e&&"string"==typeof t)return e===t;if(e instanceof i.WapJid&&t instanceof i.WapJid)return e.toString()===t.toString();return!1}(t,a))return;throw new Error(`conflict for key: ${e}`)}n[e]=t}))}(e,t),t.content instanceof Uint8Array?function(e,t){const n=e.content;if(n instanceof Uint8Array){if(!(0,r.uint8ArraysEqualUNSAFE)(n,t))throw new Error("elementValue mismatch: bytes dose not equal");return}if(null!=n)throw new Error("elementValue mismatch: destination has children");e.content=t}(e,t.content):null!=t.content&&function(e,t){const n=e.content;if(n instanceof Uint8Array)throw new Error("children mismatch: destination has element value");if(null==n||0===n.length)return void(e.content=t);if(!function(e,t){const n=s(t),r=s(e),i=Object.keys(n);for(let e=0;e<i.length;e++){const t=i[e],a=n[t],o=r[t];if(null!=a&&null!=o&&a!==o)return!1}return!0}(n,t))throw new Error("children mismatch: child counts are not compatible");const r=[],i=Array.from(n);t.forEach((e=>{const t=i.findIndex((t=>t.tag===e.tag));if(-1===t)r.push(e);else{const n=o(i.splice(t,1)[0],e);r.push(n)}})),i.forEach((e=>r.push(e))),e.content=r}(e,t.content),e}function s(e){return e.reduce(((e,t)=>{const n=t.tag,r=e[n];return e[n]=null==r?1:r+1,e}),{})}},96652:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SmaxParsingFailure=void 0;class n extends Error{constructor(){super(...arguments),this.name="SmaxParsingFailure"}}t.SmaxParsingFailure=n},496995:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorMessageRpcParsing=function(e,t){const n=Object.keys(t).map((e=>`Tried <response name="${e}">, but failed with ${t[e].error}.`)).join(" ");return`Failed to parse the response of <rpc name="${e}">. ${n}`}},81758:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayBufferMod=function(e,t){const n=new Uint8Array(e);if(t>8388607)throw new Error("Divisor is too big");let r=0;for(let e=0;e<n.length;++e)r=((r<<8)+n[e])%t;return r},t.arrayBufferToString=function(e){return String.fromCharCode.apply(null,new Uint8Array(e))},t.arrayBuffersEqualUNSAFE=function(e,t){const r=new Uint8Array(e),i=new Uint8Array(t);return n(r,i)},t.concatBuffers=function(e){const t=e.map((e=>new Uint8Array(e))),n=t.reduce(((e,t)=>e+t.byteLength),0),r=new Uint8Array(n);return t.reduce(((e,t)=>(r.set(t,e),e+t.byteLength)),0),r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength)},t.largeStringToArrayBuffer=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e5;return new Promise((n=>{const r=e.length,i=new ArrayBuffer(r),a=new Uint8Array(i);let o=0;requestAnimationFrame((function s(){const l=Math.min(o+t,r);for(;o<l;)a[o]=e.charCodeAt(o),o++;if(o===r)return void n(i);requestAnimationFrame(s)}))}))},t.stringToArrayBuffer=function(e){const t=new ArrayBuffer(e.length),n=new Uint8Array(t);let r,i;for(r=0,i=e.length;r<i;r++)n[r]=e.charCodeAt(r);return n.buffer},t.uint8ArraysEqualUNSAFE=n;function n(e,t){if(e.byteLength!==t.byteLength)return!1;for(let n=0;n!==e.byteLength;n++)if(e[n]!==t[n])return!1;return!0}},246203:e=>{e.exports=function(e){throw new Error(`Impossible value, the default statement should never be reached for value: ${e}`)}},989211:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.expBackoff=i,t.expDelaySec=function(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.1;return(0,r.delayMs)(Math.floor(1e3*i(e,t,n,a)))};var r=n(36530);function i(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.1;return r=0===e?n||0:2**e,Number.isFinite(t)&&r>t&&(r=t),"number"==typeof n&&Number.isFinite(n)&&r<n&&(r=n),i&&(r*=1+i*Math.random()),r}},551168:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Binary=void 0,t.longFitsInDouble=d,t.numUtf8Bytes=c,t.parseInt64OrThrow=K,t.parseUint64OrThrow=H;var r=n(710038);const i=65533,a=new Uint8Array(10),o=new Uint8Array(0);class s{constructor(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.write=function(){for(let t=0;t<arguments.length;t++){const n=t<0||arguments.length<=t?void 0:arguments[t];"string"==typeof n?e.writeString(n):"number"==typeof n?e.writeUint8(n):n instanceof s?e.writeBinary(n):n instanceof ArrayBuffer?e.writeBuffer(n):n instanceof Uint8Array&&e.writeByteArray(n)}},t instanceof ArrayBuffer?(this._buffer=new Uint8Array(t),this._readEndIndex=this._writeIndex=t.byteLength):t instanceof Uint8Array&&(this._buffer=t,this._readEndIndex=this._writeIndex=t.length),this._bytesTrashed=0,this._earliestIndex=this._readIndex=0,this._view=null,this._littleEndian=n,this._hiddenReads=0,this._hiddenWrites=0}size(){return this._readEndIndex-this._readIndex}peek(e,t){this._hiddenReads++;const n=this._readIndex,r=this._bytesTrashed;try{return e(this,t)}finally{this._hiddenReads--,this._readIndex=n-(this._bytesTrashed-r)}}advance(e){this._shiftReadOrThrow(e)}readWithViewParser(e,t,n,r){return t(this._getView(),this._shiftReadOrThrow(e),e,n,r)}readWithBytesParser(e,t,n,r){return t(this._buffer,this._shiftReadOrThrow(e),e,n,r)}readUint8(){return p(this,1,f,!1)}readInt8(){return p(this,1,f,!0)}readUint16(){return p(this,2,h,arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._littleEndian)}readInt32(){return p(this,4,g,arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._littleEndian)}readUint32(){return p(this,4,m,arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._littleEndian)}readInt64(){return p(this,8,y,K,arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._littleEndian)}readUint64(){return p(this,8,y,H,arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._littleEndian)}readLong(e){return p(this,8,y,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._littleEndian)}readFloat32(){return p(this,4,E,arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._littleEndian)}readFloat64(){return p(this,8,S,arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._littleEndian)}readVarInt(e){const t=_(this,0,T,this.size());return _(this,t,v,e)}readBuffer(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.size();return 0===e?new ArrayBuffer(0):_(this,e,A)}readByteArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.size();return 0===e?new Uint8Array(0):_(this,e,C)}readBinary(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.size(),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._littleEndian;if(0===e)return new s(void 0,t);const n=_(this,e,C);return new s(n,t)}indexOf(e){if(0===e.length)return 0;const t=this._buffer,n=this._readEndIndex,r=this._readIndex;let i=0,a=r;for(let o=r;o<n;o++)if(t[o]===e[i]){if(0===i&&(a=o),i++,i===e.byteLength)return o-r-e.byteLength+1}else i>0&&(i=0,o=a);return-1}readString(e){return _(this,e,P)}ensureCapacity(e){this._maybeReallocate(this._readIndex+e)}ensureAdditionalCapacity(e){this._maybeReallocate(this._writeIndex+e)}writeToView(e,t,n,r){const i=this._shiftWriteMaybeReallocate(e);return t(this._getView(),i,e,n,r)}writeToBytes(e,t,n,r){const i=this._shiftWriteMaybeReallocate(e);return t(this._buffer,i,e,n,r)}writeUint8(e){j(e,0,256,"uint8"),I(this,1,M,e,!1)}writeInt8(e){j(e,-128,128,"signed int8"),I(this,1,M,e,!0)}writeUint16(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._littleEndian;j(e,0,65536,"uint16"),O(this,2,b,e,t)}writeInt16(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._littleEndian;j(e,-32768,32768,"signed int16"),O(this,2,R,e,t)}writeUint32(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._littleEndian;j(e,0,4294967296,"uint32"),O(this,4,N,e,t)}writeInt32(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._littleEndian;j(e,-2147483648,2147483648,"signed int32"),O(this,4,w,e,t)}writeUint64(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._littleEndian;j(e,0,0x10000000000000000,"uint64"),O(this,8,L,e,t)}writeInt64(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._littleEndian;j(e,-0x8000000000000000,0x8000000000000000,"signed int64"),O(this,8,L,e,t)}writeFloat32(e){O(this,4,D,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._littleEndian)}writeFloat64(e){O(this,8,k,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._littleEndian)}writeVarInt(e){j(e,-0x8000000000000000,0x8000000000000000,"varint (signed int64)");const t=e<0,n=t?-e:e;let r=Math.floor(n/4294967296),i=n-4294967296*r;t&&(r=~r,0===i?r++:i=-i);I(this,F(r,i),U,r,i)}writeVarIntFromHexLong(e){const t=(0,r.hexLongIsNegative)(e),n=t?(0,r.negateHexLong)(e):e,i=(0,r.hexLongToHex)(n);let a=0,o=0;for(let e=0;e<r.NUM_HEX_IN_LONG;e++)a=a<<4|o>>>28,o=o<<4|(0,r.hexAt)(i,e);t&&(a=~a,0===o?a++:o=-o);I(this,F(a,o),U,a,o)}writeBinary(e){const t=e.peek((e=>e.readByteArray()));if(t.length){const e=this._shiftWriteMaybeReallocate(t.length);this._buffer.set(t,e)}}writeBuffer(e){this.writeByteArray(new Uint8Array(e))}writeByteArray(e){const t=this._shiftWriteMaybeReallocate(e.length);this._buffer.set(e,t)}writeBufferView(e){this.writeByteArray(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}writeString(e){I(this,c(e),G,e)}writeHexLong(e){O(this,8,x,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._littleEndian)}writeBytes(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(let e=0;e<t.length;e++)j(t[e],0,256,"byte");I(this,t.length,B,t)}writeAtomically(e,t){this._hiddenWrites++;let n=this._writeIndex,r=this._bytesTrashed;try{const i=e(this,t);return n=this._writeIndex,r=this._bytesTrashed,i}finally{this._hiddenWrites--,this._writeIndex=n-(this._bytesTrashed-r)}}writeWithVarIntLength(e,t){const n=this._writeIndex,r=this.writeAtomically(e,t),i=this._writeIndex;this.writeVarInt(i-n);const o=this._writeIndex-i,s=this._buffer;for(let e=0;e<o;e++)a[e]=s[i+e];for(let e=i-1;e>=n;e--)s[e+o]=s[e];for(let e=0;e<o;e++)s[n+e]=a[e];return r}static build(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];let r=0;for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n?r+=c(n):"number"==typeof n?r++:n instanceof s?r+=n.size():n instanceof ArrayBuffer?r+=n.byteLength:n instanceof Uint8Array&&(r+=n.length)}const i=new s;return i.ensureCapacity(r),i.write.apply(i,arguments),i}_getView(){return this._view||(this._view=new DataView(this._buffer.buffer,this._buffer.byteOffset))}_shiftReadOrThrow(e){if(e<0)throw new Error("ReadError: given negative number of bytes to read");const t=this._readIndex,n=t+e;if(n>this._readEndIndex)throw new Error(t===this._readEndIndex?"ReadError: tried to read from depleted binary":"ReadError: tried to read beyond end of binary");return this._readIndex=n,this._hiddenReads||(this._earliestIndex=n),t}_maybeReallocate(e){const t=this._buffer;if(e<=t.length)return e;{const n=this._earliestIndex,r=e-n,i=Math.max(r,2*(t.length-n),64),a=new Uint8Array(i);return n?(a.set(t.subarray(n)),this._bytesTrashed+=n,this._readIndex-=n,this._readEndIndex-=n,this._writeIndex-=n,this._earliestIndex=0):a.set(t),this._buffer=a,this._view=null,r}}_shiftWriteMaybeReallocate(e){const t=this._maybeReallocate(this._writeIndex+e),n=this._writeIndex;return this._writeIndex=t,this._hiddenWrites||(this._readEndIndex=t),n}}t.Binary=s;let l="",u=0;function c(e){if(e===l)return u;const t=e.length;let n=0;for(let r=0;r<t;r++){const i=e.charCodeAt(r);if(i<128)n++;else if(i<2048)n+=2;else if(i<55296||57344<=i&&i<=65535)n+=3;else if(55296<=i&&i<56320&&r+1!==t){const t=e.charCodeAt(r+1);56320<=t&&t<57344?(r++,n+=4):n+=3}else n+=3}return l=e,u=n}function d(e,t,n){const r=t>>21;if(e){const e=Boolean(2097151&t||n);return 0===r||-1===r&&e}return 0===r}function p(e,t,n,r,i){return e.readWithViewParser(t,n,r,i)}function _(e,t,n,r,i){return e.readWithBytesParser(t,n,r,i)}function f(e,t,n,r){return r?e.getInt8(t):e.getUint8(t)}function h(e,t,n,r){return e.getUint16(t,r)}function g(e,t,n,r){return e.getInt32(t,r)}function m(e,t,n,r){return e.getUint32(t,r)}function y(e,t,n,r,i){return r(e.getInt32(i?t+4:t,i),e.getInt32(i?t:t+4,i))}function E(e,t,n,r){return e.getFloat32(t,r)}function S(e,t,n,r){return e.getFloat64(t,r)}function T(e,t,n,r){const i=Math.min(r,10);let a=0,o=128;for(;a<i&&128&o;)o=e[t+a++];if(10===a&&o>1)throw new Error("ParseError: varint exceeds 64 bits");return 128&o?a+1:a}function v(e,t,n,r){let i=0,a=0,o=n;10===n&&(o--,a=1&e[t+o]);for(let n=o-1;n>=0;n--)i=i<<7|a>>>25,a=a<<7|127&e[t+n];return r(i,a)}function A(e,t,n){const r=t+e.byteOffset,i=e.buffer;return 0===r&&n===i.byteLength?i:i.slice(r,r+n)}function C(e,t,n){return e.subarray(t,t+n)}function P(e,t,n){const r=t+n;let a=[],o=null;for(let n=t;n<r;n++){a.length>5e3&&(o||(o=[]),o.push(String.fromCharCode.apply(String,a)),a=[]);const t=0|e[n];if(0==(128&t))a.push(t);else if(192==(224&t)){const o=W(e,n+1,r);if(o){n++;const e=(31&t)<<6|63&o;e>=128?a.push(e):a.push(i)}else a.push(i)}else if(224==(240&t)){const o=W(e,n+1,r),s=W(e,n+2,r);if(o&&s){n+=2;const e=(15&t)<<12|(63&o)<<6|63&s;e>=2048&&!(55296<=e&&e<57344)?a.push(e):a.push(i)}else o?(n++,a.push(i)):a.push(i)}else if(240==(248&t)){const o=W(e,n+1,r),s=W(e,n+2,r),l=W(e,n+3,r);if(o&&s&&l){n+=3;const e=(7&t)<<18|(63&o)<<12|(63&s)<<6|63&l;if(e>=65536&&e<=1114111){const t=e-65536;a.push(55296|t>>10,56320|1023&t)}else a.push(i)}else o&&s?(n+=2,a.push(i)):o?(n++,a.push(i)):a.push(i)}else a.push(i)}const s=String.fromCharCode.apply(String,a);return o?(o.push(s),o.join("")):s}function O(e,t,n,r,i){return e.writeToView(t,n,r,i)}function I(e,t,n,r,i){return e.writeToBytes(t,n,r,i)}function M(e,t,n,r){e[t]=r}function b(e,t,n,r,i){e.setUint16(t,r,i)}function R(e,t,n,r,i){e.setInt16(t,r,i)}function N(e,t,n,r,i){e.setUint32(t,r,i)}function w(e,t,n,r,i){e.setInt32(t,r,i)}function L(e,t,n,r,i){const a=r<0,o=a?-r:r;let s=Math.floor(o/4294967296),l=o-4294967296*s;a&&(s=~s,0===l?s++:l=-l),e.setUint32(i?t+4:t,s,i),e.setUint32(i?t:t+4,l,i)}function D(e,t,n,r,i){e.setFloat32(t,r,i)}function k(e,t,n,r,i){e.setFloat64(t,r,i)}function U(e,t,n,r,i){let a=r,o=i;const s=t+n-1;for(let n=t;n<s;n++)e[n]=128|127&o,o=a<<25|o>>>7,a>>>=7;e[s]=o}function G(e,t,n,r){let i=t;const a=r.length;for(let t=0;t<a;t++){const n=r.charCodeAt(t);if(n<128)e[i++]=n;else if(n<2048)e[i++]=192|n>>6,e[i++]=128|63&n;else if(n<55296||57344<=n)e[i++]=224|n>>12,e[i++]=128|n>>6&63,e[i++]=128|63&n;else if(55296<=n&&n<56320&&t+1!==a){const a=r.charCodeAt(t+1);if(56320<=a&&a<57344){t++;const r=65536+((1023&n)<<10|1023&a);e[i++]=240|r>>18,e[i++]=128|r>>12&63,e[i++]=128|r>>6&63,e[i++]=128|63&r}else e[i++]=239,e[i++]=191,e[i++]=189}else e[i++]=239,e[i++]=191,e[i++]=189}}function x(e,t,n,i,a){const o=(0,r.hexLongIsNegative)(i),s=(0,r.hexLongToHex)(i);let l=0,u=0;for(let e=0;e<16;e++)l=l<<4|u>>>28,u=u<<4|(0,r.hexAt)(s,e);o&&(l=~l,0===u?l++:u=-u),e.setUint32(a?t+4:t,l,a),e.setUint32(a?t:t+4,u,a)}function B(e,t,n,r){for(let i=0;i<n;i++)e[t+i]=r[i]}function F(e,t){let n,r;for(e?(n=5,r=e>>>3):(n=1,r=t>>>7);r;)n++,r>>>=7;return n}function j(e,t,n,r){if("number"!=typeof e||e!=e||Math.floor(e)!==e||e<t||e>=n)throw new TypeError("string"==typeof e?`WriteError: string "${e}" is not a valid ${r}`:`WriteError: ${String(e)} is not a valid ${r}`)}function Y(e,t,n){let r;r=t>=0||e?t:4294967296+t;const i=4294967296*r+(n>=0?n:4294967296+n);if(!d(e,t,n))throw new Error(`ReadError: integer exceeded 53 bits (${i})`);return i}function K(e,t){return Y(!0,e,t)}function H(e,t){return Y(!1,e,t)}function W(e,t,n){if(t>=n)return 0;const r=0|e[t];return 128==(192&r)?r:0}},215373:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.intToBytes=function(e,t){let n=t;const r=new Uint8Array(e);for(let t=e-1;t>=0;t--)r[t]=255&n,n>>>=8;return r},t.uint8ArrayToBuffer=function(e){return e.buffer.slice(e.byteOffset,e.byteLength+e.byteOffset)}},63437:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={1:'[334,-1,"($1) $2-$3"],10',20:'["Ah","[23]"],[334,"1[0125]|[89]00"],["Bg","1[35]|[4-6]|[89][2-9]"],[9,10]',211:"333,9",212:'["[5-7]BF","5(2[015-7]|3[0-4])|[67]",1],["[58]CE",["5(2[2-489]|3[5-9]|92)|892","5(2([2-48]|9[0-7])|3([5-79]|8[0-7])|924)|892"],1],["5DD",["5(29|38)","5(29|38)[89]"],1],["[5]BBBB","5(4[067]|5[03])"],["8[09];G","8(0|9[013-9])",1],9',213:'["[5-8]BBBB","[5-8]"],["9ACBB",9],9',216:"233,8",218:'[27,"[25-79]",1],9',220:"34,7",221:'[2322,"[379]"],[3222,8],9',222:'"[2-48]ABBB",8',223:'[2222,"[246-9]"],8',224:'[2222,3],[3222,"[67]"],[8,9]',225:"2222,8",226:'[2222,"[025-7]"],8',227:'[233,"08"],[2222,"[0289]"],8',228:'[2222,"[279]"],8',229:"2222,8",230:'[34,"[2-46]|8[013]"],[44,5],[7,8]',231:'[133,"[45]"],[233,2],[234,"[23578]"],[7,8,9]',232:"26,8",233:'[234,"[235]"],9',234:'["CCd","[7-9]"],["CDe","[78]"],["CEf","[78]"],10',235:"2222,8",236:"2222,8",237:'[2222,88],[12222,"[26]"],[8,9]',238:"322,7",239:"34,7",240:'[333,"[235]"],[36,"[89]"],9',241:"[2222,0],8",242:'[234,"[02]"],[144,8],9',243:'[234,1],[333,"[89]"],9',244:'[333,"[29]"],9',245:'[333,"44|9[567]"],[34,40],[7,9]',246:"[34,3],7",247:"5",248:'[133,"[246]"],7',249:'[234,"[19]"],9',250:'["2BCC",2],["[7-9]BCC","[7-9]"],9',251:'"[1-59]ACD",9',252:'[17,"24|[67]"],["BA{5,7}","15|28|6[1-35-9]|799|9[2-9]"],[333,"3[59]|4[89]|6[24-6]|79|8[08]|90"],[8,9]',253:"2222,8",254:'["BA{5,7}","[24-6]"],[36,7],["CCd","[89]"],9',255:'["[24]ACD","[24]"],["[67]BCC","[67]"],["[89]BBD","[89]"],9',256:'[45,[202,2024]],[36,"[27-9]|4(6[45]|[7-9])"],[27,"[34]"],9',257:"2222,8",258:'["[28]ACd","2|8[2-7]"],["80ACC",80],9',260:'["[29]AG","[29]"],["800;CC",8],9',261:'[2232,"[23]"],9',262:'"[268]BBBB",9',263:'["7ACd",7],["86BCC","86[24]"],["CCd","2(1[39]|2[0157]|6[14]|7[35]|84)|329"],["[235]ACd","[23]9|54"],["[25]CA{3,5}",["(25|54)8","258[23]|5483"]],["8CF",86],["80ACD",80],[9,10]',264:'["8ACD","8[1235]"],["6ACd",6],["870;CC",870],9',265:'["2BCC",2],[3222,"[1789]"],9',266:"44,8",267:'["7ACC",7],8',268:'[44,"[027]"],8',269:"322,7",27:'[333,860],[234,"[1-9]"],9',290:"[4,5]",291:"133,7",297:"34,7",298:"6,6",299:"222,6",30:'[244,"21|7"],[46,"2(2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])"],[334,"[2689]"],10',31:'["[1-578]ACD","1[035]|2[0346]|3[03568]|4[0356]|5[0358]|7|8[4578]"],["[1-5]BCC","1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],["6;H","6[0-57-9]"],["66;G",66],["[89]0AA{4,7}","80|9"],[9,11]',32:"[3222,4],9",33:'[3222,8],[12222,"[1-79]"],9',34:'["[89]00;CC","[89]00"],["[5-9]BBBB","[568]|[79][0-8]"],9',350:"[35,2],8",351:'["2ACD","2[12]"],["[2-46-9]BCC","2[3-9]|[346-9]"],9',352:'[2223,20],[333,6],["BBBBb","2([0367]|4[3-8])"],["BBBA{1,5}","[3-57]|8[13-9]|9(0[89]|[2-579])|(2|80)[2-9]"],9',353:'["AdD",1],["BCd","[2569]|4[1-69]|7[14]"],[333,70],[333,81],[234,"[78]"],[433,1],[2134,8],[244,4],9',354:'[34,"[4-9]"],["3BCC",3],[7,8,9]',355:'["6[6-9];CD",6],9',356:'[44,"[2357-9]"],8',357:"26,8",358:'["CA{3,7}","([1-3]00|[6-8]0)"],["116C",116],["BA{4,10}","[14]|2[09]|50|7[135]"],["AA{4,11}","[25689][1-8]|3"],[6,7,8,9,10,11]',359:'[333,999],["BCd","48|8[7-9]|9[08]"],9',36:'["BCd","[2-9]"],9',370:'[134,"52[0-79]"],[323,"[7-9]"],[26,"37|4([15]|6[1-8])"],[35,"[3-6]"],8',371:'[233,"[269]|8[01]"],8',372:'["[3-79]BD",["[369]|4[3-8]|5([0-2]|5[0-478]|6[45])|7[1-9]","[369]|4[3-8]|5([02]|1([0-8]|95)|5[0-478]|6(4[0-4]|5[1-589]))|7[1-9]"]],["70;BD",70],["8000;CC",[800,8000]],["[458]Cd",["40|5|8(00|[1-5])","40|5|8(00[1-9]|[1-5])"]],[7,8]',373:'[233,"22|3"],["[25-7]BBC","2[13-9]|[5-7]"],["[89]BE","[89]"],8',374:'[26,"1|47"],[26,"4[1349]|[5-7]|9[1-9]"],[35,"[23]"],[323,"8|90"],8',375:'[2322,["17[0-3589]|2[4-9]|[34]","17([02358]|1[0-2]|9[0189])|2[4-9]|[34]"],"$1 $2-$3-$4"],[3222,["1(5[24]|6[235]|7[467])|2(1[246]|2[25]|3[26])","1(5[24]|6(2|3[04-9]|5[0346-9])|7([46]|7[37-9]))|2(1[246]|2[25]|3[26])"],"$1 $2-$3-$4"],[423,["1(5[169]|6[3-5]|7[179])|2(1[35]|2[34]|3[3-5])","1(5[169]|6(3[1-3]|4|5[125])|7(1[3-9]|7[0-24-6]|9[2-7]))|2(1[35]|2[34]|3[3-5])"],"$1 $2-$3"],["[89]BCD","8[01]|9"],["82ADD",82],["800;BA{2,4}",800],9',376:'[33,"[135-9]"],[44,1],[333,6],[6,9]',377:'[2222,"[39]"],[233,4],["6;BBBB",6],[332,8],[8,9]',378:'[2222,"[5-7]"],["0549;F",0,"($1) $2"],8',379:"10",380:'[333,["6[12][29]|(3[1-8]|4[136-8]|5[12457]|6[49])2|(56|65)[24]","6[12][29]|(35|4[1378]|5[12457]|6[49])2|(56|65)[24]|(3[1-46-8]|46)2[013-9]"]],[234,["4[45][0-5]|5(0|6[37])|6([12][018]|[36-8])|7|89|9[1-9]|(48|57)[0137-9]","4[45][0-5]|5(0|6(3[14-7]|7))|6([12][018]|[36-8])|7|89|9[1-9]|(48|57)[0137-9]"]],[45,"[3-6]"],["CCd","[89]"],9',381:'["[23]BA{4,9}","(2[389]|39)0"],["[1-3]AA{5,10}","1|2([0-24-7]|[389][1-9])|3([0-8]|9[1-9])"],["6AA{6,8}",6],["[89]BA{3,9}","[89]"],["7[26];A{4,9}","7[26]"],["7[08]AA{4,9}","7[08]"],[8,9,10]',382:'[233,"[2-57-9]|6[036-9]"],[8,9]',383:'[233,"[23][89]|4[3-79]"],[35,"[89]00"],333,8',385:'["1;DC",1],["[2-5]ACd","[2-5]"],["9ACd",9],["[67]ACd","[67]"],["80[01];Bc",8],["80[01];CC",8],[8,9]',386:'[1322,"[12]|3[24-8]|4[24-8]|5[2-8]|7[3-8]"],["[3-7]ACC","[37][01]|4[0139]|51|6"],["[89][09];A{3,6}","[89][09]"],["[58]BE","59|8[1-3]"],8',387:'[233,"6[1-356]|[7-9]"],[233,"[3-5]","$1 $2-$3"],[2223,6],[8,9]',389:'["2;CD",2],["[347]ACC","[347]"],["[58]BABB","[58]"],8',39:'["BdD","0[26]|55"],["0[26];DE","0[26]"],["0BdD","0[13-57-9][0159]"],["CA{3,6}",["0[13-57-9][0159]|8(03|4[17]|9[245])","0[13-57-9][0159]|8(03|4[17]|9(2|[45][0-4]))"]],["0CCD","0[13-57-9][2-46-8]"],["0CA{2,6}","0[13-57-9][2-46-8]"],["CCd",["[13]|8(00|4[08]|9[59])","[13]|8(00|4[08]|9(5[5-9]|9))"]],[344,3],[9,10]',40:'[234,"[23]1"],[333,"[23][3-7]|[7-9]"],9',41:'["[2-9]ACBB","[2-7]|[89]1"],["[89]BCC","8[047]|90"],[32322,860],9',420:'["[2-9]BCC","[2-8]|9[015-7]"],["96ACCC",96],["9ACCC","9[36]"],9',421:'["2;CCB",2,"$1/$2 $3 $4"],["[3-5]ACBB","[3-5]","$1/$2 $3 $4"],["[689]BCC","[689]"],9',423:'[322,"[237-9]"],[234,69],[333,6],7',43:'["1;A{3,12}",1],["5ADA{4,7}","5[079]"],["CA{3,10}","316|46|51|732|6(5[0-3579]|[6-9])|7([28]0)|[89]"],["DA{3,9}","2|3(1[1-578]|[3-8])|4[2378]|5[2-6]|6([12]|4[1-9]|5[468])|7(2[1-8]|35|4[1-8]|[5-79])"],[10,11,12,13]',44:'["Ee",["1(38|5[23]|69|76|94)","1((38|69)7|5(24|39)|768|946)","1(3873|5(242|39[4-6])|(697|768)[347]|9467)"]],["Df","1([2-69][02-9]|[78])"],[244,["[25]|7(0|6[024-9])","[25]|7(0|6([04-9]|2[356]))"]],[46,7],[334,"[1389]"],10',45:"2222,8",46:'["8;ccB",8],["[1-69]AcBB","1[013689]|2[0136]|3[1356]|4[0246]|54|6[03]|90"],[3222,"1[2457]|2([247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6([124-689]|7[0-2])|9([125-8]|3[0-5]|4[0-3])"],["7ACBB",7],["9[034]ABBC","9[034]"],[32322,"25[245]|67[3-6]"],9',47:'["[489]BBC","[489]"],["[235-7]ABBB","[235-7]"],8',48:'[2322,"[14]|2[0-57-9]|3[2-4]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145]"],[333,"26|39|5[0137]|6[0469]|7[02389]|8[08]"],9',49:'["BA{3,13}","3[02]|40|[68]9"],["CA{3,12}",["2(0[1-389]|1[124]|2[18]|3[14])|3([35-9][15]|4[015])|906|(2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(0[1-389]|12[0-8])|3([35-9][15]|4[015])|906|2([13][14]|2[18])|(2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"]],["DA{2,11}",["[24-6]|3([3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(3(0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(2[135]|4[13578]|9[1346])|5(0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(2[1-7]|4[145]|6[1-5]|7[1-4])|8(21|3[1468]|6|7[1467]|8[136])|9(0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(47|60)[1356]|3(3[46]|46|5[49])[1246]|3[4579]3[1357]"]],[34,138],["EA{2,10}",3],["CA{5,11}",181],["CAA{4,10}","1(3|80)|9"],["Ch","1[67]"],["CA{7,12}",8],[56,[185,1850,18500]],[344,7],[47,"18[68]"],[56,"15[0568]"],[47,"15[1279]"],[38,18],["CBh","1(6[023]|7)"],[427,"15[279]"],[328,15],[7,8,9,10,11,12]',500:"5",501:'[34,"[2-8]",1],["0;800;DC",0,1],7',502:'[44,"[2-7]"],[434,1],8',503:'[44,"[267]"],[344,"[89]"],8',504:'[44,"[237-9]",1],8',505:"44,8",506:'[44,"[24-7]|8[3-9]"],[334,"[89]0",1],8',507:"[44,6,1],8",508:'"[45]ABB",6',509:"224,8",51:"[333,9],9",52:'[244,"33|5[56]|81"],[334,"[2-9]"],[1244,"1(33|5[56]|81)"],[1334,1],[10,11]',53:'["Ag",7],["BA{4,6}","[2-4]"],[17,5],8',54:'[424,["2(2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2([23]02|6([25]|4[6-8])|9([02356]|4[02568]|72|8[23]))|3(3[28]|4([04679]|3[5-8]|5[4-68]|8[2379])|5([2467]|3[237]|8[2-5])|7[1-578]|8([2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(2[24-9]|3[1-59]|47)","2([23]02|6([25]|4(64|[78]))|9([02356]|4([0268]|5[2-6])|72|8[23]))|3(3[28]|4([04679]|3[78]|5(4[46]|8)|8[2379])|5([2467]|3[237]|8[23])|7[1-578]|8([2469]|3[278]|5[56][46]|86[3-6]))|2(2[24-9]|3[1-59]|47)|38([58][78]|7[378])|3(4[35][56]|58[45]|8([38]5|54|76))[4-6]","2([23]02|6([25]|4(64|[78]))|9([02356]|4([0268]|5([24-6]|3[2-5]))|72|8[23]))|3(3[28]|4([04679]|3(5(4[0-25689]|[56])|[78])|58|8[2379])|5([2467]|3[237]|8([23]|4([45]|60)|5(4[0-39]|5|64)))|7[1-578]|8([2469]|3[278]|54(4|5[13-7]|6[89])|86[3-6]))|2(2[24-9]|3[1-59]|47)|38([58][78]|7[378])|3(454|85[56])[46]|3(4(36|5[56])|8([38]5|76))[4-6]"],"$1 $2-$3"],[244,1,"$1 $2-$3"],[334,"[23]","$1 $2-$3"],[334,"[68]",1],[1424,["9(2[2-469]|3[3-578])","9(2(2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(2([23]02|6([25]|4[6-8])|9([02356]|4[02568]|72|8[23]))|3(3[28]|4([04679]|3[5-8]|5[4-68]|8[2379])|5([2467]|3[237]|8[2-5])|7[1-578]|8([2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(2[24-9]|3[1-59]|47)","9(2([23]02|6([25]|4(64|[78]))|9([02356]|4([0268]|5[2-6])|72|8[23]))|3(3[28]|4([04679]|3[78]|5(4[46]|8)|8[2379])|5([2467]|3[237]|8[23])|7[1-578]|8([2469]|3[278]|5([56][46]|[78])|7[378]|8(6[3-6]|[78]))))|92(2[24-9]|3[1-59]|47)|93(4[35][56]|58[45]|8([38]5|54|76))[4-6]","9(2([23]02|6([25]|4(64|[78]))|9([02356]|4([0268]|5([24-6]|3[2-5]))|72|8[23]))|3(3[28]|4([04679]|3(5(4[0-25689]|[56])|[78])|5(4[46]|8)|8[2379])|5([2467]|3[237]|8([23]|4([45]|60)|5(4[0-39]|5|64)))|7[1-578]|8([2469]|3[278]|5(4(4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(6[3-6]|[78]))))|92(2[24-9]|3[1-59]|47)|93(4(36|5[56])|8([38]5|76))[4-6]"],"$1 $2 $3-$4"],[1244,91,"$1 $2 $3-$4"],[1334,9,"$1 $2 $3-$4"],[10,11]',55:'[244,"[1-9][1-9]","$1 $2-$3"],[254,"([14689][1-9]|2[12478]|3[1-578]|5[1-5]|7[13-579])9","$1 $2-$3"],["[3589]00;cD","[3589]00"],[10,11]',56:'[144,"2[23]"],[234,"[357]|4[1-35]|6[13-57]"],["9;DD",9],["44;CD",44],["[68]00;Cd","60|8"],["600;CBC",60],["1230;CD",1],[54,219],9',57:'[17,["1(8[2-9]|9[0-3]|[2-7])|[24-8]","1(8[2-9]|9(09|[1-3])|[2-7])|[24-8]"]],[37,3],["1;CG",["1(80|9[04])","1(800|9(0[01]|4[78]))"]],[8,10]',58:"[37,-1,1],10",590:'["[56]90;BD",-1,"$1 $2-$3"],9',591:'[17,"[23]|4[46]"],[8,"[67]"],[324,8],8',592:"34,7",593:'[134,"[247]|[356][2-8]",1],[234,9],["1800;Cd",1],[8,9]',594:"3222,9",595:'["BCd","([26]1|3[289]|4[124678]|7[123]|8[1236])"],["CA{3,6}","[2-9]0"],[36,"9[1-9]"],[234,8700],[333,"[2-8][1-9]"],9',596:"3222,9",597:'[34,"[6-8]",1],7',598:'[233,9],[44,"[24]"],8',599:'[34,"[13-7]"],["9;CD",9],[7,8]',60:'["3;DD",3,"$1-$2 $3"],["[18]ACd","1[02-46-9][1-9]|8","$1-$2 $3"],["1;[36-8]00;BD","1[36-8]0",1],["11;DD",11,"$1-$2 $3"],["15[49];CD",15,"$1-$2 $3"],[9,10]',61:'["BCA{2,4}",16],[333,"14|[45]"],[144,"[2378]"],[433,"1(30|[89])"],9',62:'["BA{5,9}","2[124]|[36]1"],["CA{5,7}",800],["CA{5,8}","[2-79]"],["CdC","8[1-35-9]",1],["CA{6,8}",1],[334,804],[3133,80],["CDe",8,1],[2434,0],[9,10,11,12]',63:'["DA{4,6}",["3(23|39|46)|4(2[3-6]|[35]9|4[26]|76)|544|88[245]|(52|64|86)2","3(230|397|461)|4(2(35|[46]4|51)|396|4(22|63)|59[347]|76[15])|5(221|446)|642[23]|8(622|8([24]2|5[13]))"]],[334,"[89]"],[434,1],["DbCD",1],10',64:'[323,"[89]0"],[134,"24|[346]|7[2-57-9]|9[2-9]","$1-$2 $3"],["CCd","2(10|74)|[59]|80"],["BdD","2[028]"],["BCA{3,5}","2([169]|7[0-35-9])|7|86"],[8,9,10]',65:'["[3689]CD","[369]|8[1-9]"],["1[89]00;CD","1[89]"],["7000;DC",70],["800;CD",80],8',66:'["BCd","14|[3-9]"],[433,1],9',670:"[44,7],8",672:"[24,1],[15,3],[5,6]",673:'"[2-578]BD",7',674:"34,7",675:'[34,"[13-689]|27"],[44,"20|7"],[7,8]',676:'[34,"7[5-9]|8[47-9]"],[43,0],7',677:'[25,"[7-9]"],7',678:'[34,"[579]"],7',679:'[34,"[35-9]"],[434,0],7',680:"34,7",681:"222,6",682:"23,5",683:"4",685:'["8Bd",8],["7AE",7],[6,7]',686:"8",687:'[222,"[2-46-9]|5[0-4]","$1.$2.$3"],6',688:"[6,7]",689:'[2222,"4[09]|8[79]"],[222,44],[6,8]',690:"[4,5,6,7]",691:"34,7",692:"[34,-1,1],7",7:'[4222,["7(1[0-8]|2[1-9])","7(1([0-6]2|7|8[27])|2(1[23]|[2-9]2))","7(1([0-6]2|7|8[27])|2(13[03-69]|62[013-9]))|72[1-57-9]2"]],[5122,["7(1[0-68]|2[1-9])","7(1([06][3-6]|[18]|2[35]|[3-5][3-5])|2([13][3-5]|[24-689]|7[457]))","7(1(0([356]|4[023])|[18]|2(3[013-9]|5)|3[45]|43[013-79]|5(3[1-8]|4[1-7]|5)|6(3[0-35-9]|[4-6]))|2(1(3[178]|[45])|[24-689]|3[35]|7[457]))|7(14|23)4[0-8]|71(33|45)[1-79]"]],[334,7],[3322,"[3489]","$1 $2-$3-$4"],10',81:'[334,800,1],["DBd","0077",1],[424,"0088",1],["DCd","00(37|66)",1],["DDe","00(37|66)",1],["DEf","00(37|66)",1],["DFg","00(37|66)",1],[244,"[2579]0|80[1-9]",1],10',82:'["AdD",2,1],[234,"60|8",1],["BdD","[1346]|5[1-5]",1],[244,"[57]",1],[533,["003","0030"]],[254,5,1],["EdD",0],[5234,0],[9,10]',84:'[244,"2[48]"],[343,"2[0-35-79]"],["[89]ACBB","8(8|9[89])|9"],["1[2689]ACD","1([26]|8[68]|99)"],["[3578]ACD","[357]|8[1-5]"],["86[89];CC","86[89]"],["1[89]00;A{4,6}",["1[89]0","1[89]00"]],[9,10]',850:"[334,1],10",852:'[44,"[235-7]|[89](0[1-9]|[1-9])"],["800;CC",800],["900;BCC",900],["900;A{2,5}",900],8',853:'"[268]CD",8',855:'["BCd","[1-9]"],[433,1],[8,9]',856:"[2233,2],10",86:'["21;DA{4,6}",21],[344,"3(11|7[179])|4([15]1|3[1-35])|5(1|2[37]|3[12]|51|7[13-79]|9[15])|7(31|5[457]|6[09]|91)|8([57]1|98)"],[434,[807,8078]],[344,"1[3-578]"],["10800;CD",[108,1080,10800]],["Ch",950],11',880:'["CA{3,7}","3([67]|8[013-9])|4(6[168]|7|[89][18])|5(6[128]|9)|6(28|4[14]|5)|7[2-589]|8(0[014-9]|[12])|9[358]|(3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(44|66)[01346-9]",1],["DA{3,6}","[13-9]",1],10',886:'["AdD","[25][2-8]|[346]|7[1-9]|8[237-9]"],[234,"[258]"],[333,9],[244,7],9',90:'[334,"512|8[0589]|90"],[3322,["5([0-59]|61)","5([0-59]|616)","5([0-59]|6161)"]],[3322,"[24][1-8]|3[1-9]"],10',91:'[55,["600|7([02-8]|19|9[037-9])|8(0[015-9]|[1-9]|20)|9","600|7([078]|19[0-5]|2([02356-9]|[14][017-9]|9[389])|3([025-9]|1[07-9]|[34][017-9])|4([0-35689]|[47][017-9])|5([02346-9]|1[017-9]|5[017-9])|6([02-9]|1[0-257-9])|9([089]|31|7[02-9]))|8(0([01589]|6[67]|7[02-9])|1([0-57-9]|6[07-9])|2(0[078]|[14][07-9]|[235-9])|3([0357-9]|[126][07-9]|4[1-9])|[45]|6([02457-9]|[136][07-9])|7([078][07-9]|[1-69])|8([0-25-9]|3[07-9]|4[047-9])|9([02-9]|1[027-9]))|9","600|7(0|19[0-5]|2([0235679]|[14][017-9]|8([0-569]|[78][089])|9[389])|3([05-8]|1([089]|7[5-9])|2([5-8]|[0-49][089])|3[017-9]|4([07-9]|11)|9([01689]|[2345][089]|40|7[0189]))|4([056]|1([0135-9]|[23][089]|2[089]|4[089])|2(0[089]|[1-7][089]|[89])|3([0-8][089]|9)|4([089]|11|7[02-8])|7([089]|11|7[02-8])|8([0-24-7][089]|[389])|9([0-7][089]|[89]))|5([0346-9]|1[017-9]|2([03-9]|[12][089])|5[017-9])|6([0346-9]|1[0-257-9]|2([0-4].|[5-9][089])|5([0-367][089]|[4589]))|7(0([02-9]|1[089])|[1-9])|8([0-79]|8(0[0189]|11|8[013-9]|9))|9([089]|313|7([02-8]|9[07-9])))|8(0([01589]|6[67]|7([02-8]|9[05-9]))|1([02-57-9]|1([0-35-9]|4[0-46-9])|6([089]|7[02-8]))|2(0([08]|7[02])|[14]([089]|7[02-8])|[235-9])|3([0357-9]|1([089]|7[02-6])|2([09]|77|8[0-689])|4[1-9]|6([089]|7[02-7]))|[45]|6([02457-9]|1([089]|7[02-8])|3([089]|7[02358])|6([08]|7[02-8]|9[01]))|7(0[07-9]|[1-69]|7([089]|7[02-8])|8([089]|7[02-8]))|8([0-25-9]|3([089]|7[02-8])|4([0489]|7[02-68]))|9([02-9]|1([0289]|7[2-6])))|9"]],[244,"11|2[02]|33|4[04]|79[1-9]|80[2-46]"],[334,"1(2[0-249]|3[0-25]|4[145]|[569][14]|7[1257]|8[1346]|[68][1-9])|2(1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568]|9[14])|3(26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(1[025]|[36][25]|22|4[28]|5[12]|[78]1|9[15])|6(12|[2345]1|57|6[13]|7[14]|80)|7(12|2[14]|3[134]|4[47]|5[15]|[67]1|88)|8(16|2[014]|3[126]|6[136]|7[078]|8[34]|91)"],[433,"1([23579]|[468][1-9])|[2-8]"],[2343,"008"],[334,140],[424,[160,1600]],["DA{2,4};D",[180,1800]],["DdD",[186,1860]],[4333,"18[06]"],10',92:'["Bh","(2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],["Cg",["2(3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(2[2-689]|3[23578]|4[3478]|5[2356])|9(2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(2[3-8]|98)|(2(3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(2[2-689]|3[23578]|4[3478]|5[2356])|9(22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"]],[55,58],[37,3],[2333,"2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],[3333,"[24-9]"],10',93:'["[2-7]ACD","[2-7]"],9',94:'[234,7],[333,"[1-689]"],9',95:'["ACd","[12]"],["BCd","[4-7]|8[1-35]"],["ACA{4,6}","9(2[0-4]|[35-9]|4[137-9])"],[144,2],[334,8],[1333,92],[154,9],[8,9,10]',960:'[34,"[3467]|9([1-9]|0[1-9])",1],[334,"[89]00"],7',961:'[133,"[13-69]|7([2-57]|62|8[0-7]|9[04-9])|8[02-9]"],[233,"[7-9]"],[7,8]',962:'["7;DD","7[457-9]"],["Cf","70|8[0158]|9"],9',963:'["BCd","[1-5]"],["9BCC",9],9',964:'["BCd","[2-6]"],[334,7],[9,10]',965:'["Dd","[169]|2([235]|4[1-35-9])|52"],[35,"[25]"],8',966:'[45,9],[234,1],[234,5],["CCd",81],[334,8],9',967:'["7BCC","7[0137]"],9',968:'["CA{4,6}","[58]"],[26,2],[44,"[79]"],8',970:'["5[69]ACC",5],["1[78]00;CC","1[78]"],9',971:'["CA{2,9}","60|8"],[315,"[479]"],[234,5],9',972:'[234,"[57]",1],[433,12,1],[46,159,1],[1333,"1[7-9]",1],["CbCD",15,"$1-$2 $3-$4"],9',973:"44,8",974:'["[3-7]CD","[3-7]"],8',975:'[2222,"1|77"],8',976:'["[12]ABD","[12]1"],["[12]2Af","[12]2[1-3]"],["[12]CE",["[12](27|[3-5])","[12](27|[3-5].)2"]],[44,"[57-9]"],["[12]De",["[12](27|[3-5])","[12](27|[3-5].)[4-9]"]],8',977:'["9BG","9(6[013]|7[245]|8)",1],10',98:'[244,"[1-8]"],["CCd",9],10',992:'[612,[331,3317]],[324,"[34]7|91[78]"],[414,3],[234,"[457-9]"],9',993:'[2222,12,"$1 $2-$3-$4"],[26,6],[3122,"13|[2-5]","$1 $2-$3-$4"],8',994:'[3222,9],[2322,["[12]|365","[12]|365","[12]|365([0-46-9]|5[0-35-9])"]],[2322,"[3-8]"],9',995:'[3222,"[348]"],[333,7],[3222,5],9',996:'[45,"3(1[346]|[24-79])"],[333,"[235-79]"],["CCAc",8],9',998:'[2322,"[679]"],[7,8,9]'}},153260:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encryptAndMac=function(e,t,n){return(0,o.aesCbcEncrypt)(e,new Uint8Array(n)).then((e=>(0,s.hmacSha256)(t,e).then((t=>a.Binary.build(t,e).readBuffer()))))},t.macAndDecrypt=function(e,t,n){return Promise.resolve(new Uint8Array(n)).then((n=>{const r=(0,i.encodeB64)(n.subarray(0,32)),a=n.subarray(32);return(0,s.hmacSha256)(t,a).then((t=>{const n=(0,i.encodeB64)(t);if(r!==n)throw __LOG__(3)`crypto:macAndDecrypt HMAC don't match ${r} vs. ${n}`,new Error("macAndDecrypt HMAC mismatch");return(0,o.aesCbcDecryptSplit)(e,a)}))}))},t.removeEncryptedPadding=function(e,t){const n=e.slice(-t.byteLength);if((0,r.arrayBuffersEqualUNSAFE)(n,t))return e.slice(0,e.byteLength-t.byteLength);return e};var r=n(81758),i=n(417405),a=n(551168),o=n(826507),s=n(128326)},643930:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WrappedError=t.UnimplementedMethod=t.TimeoutError=t.HttpError=t.AggregateError=void 0,t.customError=r,t.hasSupressedQuotaExceededError=function(){return l},t.obtainErrorSummary=function(e){return JSON.stringify(e,Object.getOwnPropertyNames(e))},t.supressQuotaExceededError=function(e){if(null==e||"QuotaExceededError"!==e.name)throw e;l=!0};const n=Object.create(Error.prototype,{constructor:{value:void 0,writable:!0,configurable:!0}});function r(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2?arguments[2]:void 0;function i(n){const r=Error.call(this,n);this.message=n,r.name=e,this.name=e,t&&(this.stack=r.stack)}return i.prototype=Object.create(r?r.prototype:n),i.prototype.constructor=i,i}class i extends(r("AggregateError",!0)){constructor(e,t){super(null!=t&&t.length>0?t:function(e){return 0===e.length?"No errors":1===e.length?e[0].message:e.map((e=>"- "+e.message)).join("\n")}(e)),this.errors=e}}t.AggregateError=i;class a extends(r("TimeoutError",!1)){}t.TimeoutError=a;class o extends(r("HttpError",!1)){constructor(e,t){super(e),this.code=t}}t.HttpError=o;class s extends(r("UnimplementedMethod")){}t.UnimplementedMethod=s;let l=!1;class u extends Error{constructor(e,t){super(e),this.inner=t}}t.WrappedError=u},399144:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deepEqual=function e(t,n){if(t===n)return!0;if(!t||!n||"object"!=typeof t&&"object"!=typeof n)return!1;const r=Array.isArray(t),i=Array.isArray(n);if(r!==i)return!1;let a=!0;if(r){const r=t.length;if(r!==n.length)return!1;for(let i=0;a&&i<r;i++)a=e(t[i],n[i]);return a}const o=Object.keys(t);for(let r=0;a&&r<o.length;r++){const i=o[r];a=n.propertyIsEnumerable(i)&&e(t[i],n[i])}return a&&Object.keys(n).length===o.length}},261030:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GzipWrapper=void 0,t.createDeflate=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new i(e)},t.inflate=function(e){return(0,r.decompressSync)(e)};var r=n(256856);class i extends r.Gzip{constructor(e){super(e),this._chunks=[],this.ondata=(e,t)=>{if(this._chunks.push(e),!t)return;let n=0;this._chunks.forEach((e=>{n+=e.length}));const r=new Uint8Array(n);let i=0;this._chunks.forEach((e=>{r.set(e,i),i+=e.length})),this._result=r}}push(e,t){if(null!=this._result)throw new Error("Tried to push chunk to compressor after final block");e instanceof Uint8Array?super.push(e,t):e instanceof ArrayBuffer?super.push(new Uint8Array(e),t):super.push((0,r.strToU8)(e),t)}result(){if(null==this._result)throw new Error("Tried to access result before adding final block");return this._result}}t.GzipWrapper=i},836821:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},886651:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(null===e)return"null";switch(typeof e){case"undefined":return"undefined";case"number":return`n:${e}`;case"string":return`s:${e}`;case"boolean":return`b:${e.toString()}`;case"object":{let t=n.get(e);return null==t&&(t=r++,n.set(e,t)),`o:${t}`}default:throw new Error("Unsupported type")}};const n=new WeakMap;let r=0},710038:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NUM_HEX_IN_LONG=t.HEX_LOWER=void 0,t.bytesToBuffer=function(e){const t=e.buffer;return 0===e.byteOffset&&e.length===t.byteLength?t:t.slice(e.byteOffset,e.byteOffset+e.length)},t.bytesToDebugString=function(e){let t=!0,n=e.length;for(;t&&n;){const r=e[--n];t=32<=r&&r<127}return t?JSON.stringify(String.fromCharCode.apply(String,e)):i(e)},t.createHexLong=s,t.createHexLongFrom32Bits=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=p(e),i=p(t);return`${n?"-":""}0x${r}${i}`},t.hexAt=a,t.hexLongFromNumber=function(e){const t=e<0;return s(t?(-e).toString(16):e.toString(16),t)},t.hexLongIsNegative=c,t.hexLongToHex=u,t.hexOrThrow=o,t.isBiggerHexLong=function(e,t){const n=c(e),r=c(t);if(n!==r)return!n;const i=u(e)>u(t);return n?!i:i},t.negateHexLong=function(e){return c(e)?e.slice(1):"-"+e},t.parseHex=function(e){const t=o(e);if(t.length%2!=0)throw new Error(`parseHex given hex "${t}" which is not a multiple of 8-bits.`);const n=new Uint8Array(t.length>>1);for(let e=0,r=0;e<t.length;e+=2,r++)n[r]=a(t,e)<<4|a(t,e+1);return n.buffer},t.randomHex=function(e){const t=new Uint8Array(e);return self.crypto.getRandomValues(t),i(t)},t.toHex=i,t.toLowerCaseHex=function(e){const t=[];for(let n=0;n<e.length;n++){const i=e[n];t.push(r[i>>4],r[15&i])}return String.fromCharCode.apply(String,t)};t.NUM_HEX_IN_LONG=16;const n=[48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70],r=[48,49,50,51,52,53,54,55,56,57,97,98,99,100,101,102];function i(e){const t=[];for(let r=0;r<e.length;r++){const i=e[r];t.push(n[i>>4],n[15&i])}return String.fromCharCode.apply(String,t)}function a(e,t){const n=e.charCodeAt(t);return n<=57?n-48:n<=70?10+n-65:10+n-97}function o(e){if(/[^0-9a-fA-F]/.test(e))throw new Error(`"${e}" is not a valid hex`);return e}function s(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=o(e);return d(n,16),`${t?"-":""}0x${l(n,16)}`}function l(e,t){const n=t-e.length;let r=e;for(let e=0;e<n;e++)r="0"+r;return r}function u(e){return e.substring(e.indexOf("0x")+2)}function c(e){return"-"===e[0]}function d(e,t){if(e.length>t)throw new Error(`"${e}" is longer than ${4*t} bits.`)}function p(e){if(e>4294967295||e<-4294967296)throw new Error("uint32ToLowerCaseHex given number over 32 bits");return l((e>=0?e:4294967296+e).toString(16),8)}t.HEX_LOWER=r},406875:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inflatePhoneRegex=function(e){let t;t="number"==typeof e?String(e).split("").map((e=>".".repeat(Number(e)))).join(")("):e.replace(/;|[a-zA-Z]+/g,(e=>";"===e?")(":e.split("").map((e=>{const t=e.charCodeAt(0);return t>=97?".".repeat(t-96)+"?":".".repeat(t-64)})).join(")(")));return`(${t})`}},616310:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.WA_USER_JID_SUFFIX=t.WA_USER_DOMAIN=t.WA_SERVER_JID_SUFFIX=t.SURVEY_USER_JID=t.STATUS_JID=t.PSA_JID=t.MSGR_USER_JID_SUFFIX=t.MSGR_USER_DOMAIN=t.LID_SUFFIX=t.LID_DOMAIN=t.DEFAULT_DEVICE_ID=t.AUTHOR_SYSTEM=t.AUTHOR_ME=void 0,t.asChatJid=function(e){return e===s?null:e},t.asMulticastJid=function(e){return null==b(e)?e:null},t.asPhoneChatJid=function(e){return e===s?null:e},t.asStatusJid=function(e){return e===s?s:null},t.authorAsPhoneUserJid=function(e){if(e===a||e===o)return null;if(!e.endsWith(f))return null;return e},t.authorAsUserJid=function(e){if(e===a||e===o)return null;return e},t.authorToUserId=function(e,t){return e===a||e===o?t:O(e)},t.createJidUtils=function(e){let{platform:t}=e;const n="msgr"===t?c:f;return{toUserJid:function(e){return`${e}${n}`},getUserDomain:function(){return n},getGroupCallDomain:function(){return"@call"}}},t.defaultDeviceJidForUser=function(e){return`${C(e)}:0${j(e)}`},t.defaultLidDeviceJidForLidUserJid=function(e){return P(e,0)},t.defaultMsgrDeviceJidForUser=function(e){return`${C(e)}:0@msgr`},t.defaultPhoneDeviceJidForUser=function(e){return`${C(e)}:0@s.whatsapp.net`},t.extractDeviceIDParts=I,t.extractDeviceId=M,t.extractFromJid=L,t.extractJidFromJidWithType=function(e){return"phoneDevice"===e.jidType||"lidDevice"===e.jidType||"msgrDevice"===e.jidType?e.deviceJid:"lidUser"===e.jidType||"msgrUser"===e.jidType||"phoneUser"===e.jidType?e.userJid:"group"===e.jidType?e.groupJid:"status"===e.jidType?e.statusJid:"call"===e.jidType?e.callJid:(e.jidType,e.broadcastJid)},t.extractPhoneUserJid=function(e){return N(e)},t.extractUserId=O,t.extractUserJid=N,t.fullFormDeviceJidString=function(e){const{user:t,agent:n="0",device:r="0",server:i}=w(e);return`${t}.${n}:${r}@${i}`},t.getGroupDomain=function(){return l},t.getMsgrUserDomain=function(){return c},t.getServerDomain=function(){return"@s.whatsapp.net"},t.getWhatsappUserDomain=function(){return f},t.groupIdFromJid=function(e){if(e.endsWith(l))return e.slice(0,-l.length);throw new Error(`groupId called with non-group jid "${e}"`)},t.interpretAndValidateJid=D,t.interpretAsDeviceId=function(e){return e},t.interpretAsGroupJid=x,t.interpretAsNumber=function(e){return e},t.interpretAsPhoneUserJid=function(e){return e.endsWith(f)?e:null},t.interpretAsUserJid=b,t.isAuthorMe=function(e){return"@me"===e},t.isAuthorSystem=function(e){return"@system"===e},t.isPrimaryDevice=function(e){return 0===M(e)},t.lidFromLidUserJid=R,t.maybeSanitizeLogLineText=function(e){if(!e.includes("@"))return e;return e.replace(v,G)},t.parseJidParts=w,t.phoneNumberFromJid=function(e){if(!e.endsWith(f))throw new Error(`phoneNumberFromJid called with non-user jid "${e}"`);return e.slice(0,-f.length)},t.sanitizeJidForLogging=G,t.stripAgentIdFromPhoneDeviceJid=function(e){const{user:t,device:n="0",server:r}=w(e);return`${t}:${n}@${r}`},t.switchOnChatJidType=B,t.switchOnJidType=function(e,t){if(e===s)return t.status();return B(e,{phoneUser:t.phoneUser,msgrUser:t.msgrUser,lidUser:t.lidUser,group:t.group})},t.switchOnMsgrChatJidType=function(e,t){if(e.endsWith(c))return t.user(e);if(null!=x(e))return t.group(e);throw new Error(`Can not switch on chat jid ${e}`)},t.switchOnMulticastJidType=function(e,t){if(e===s)return t.multicast(s);return F(e,{user:t.user,group:t.multicast})},t.switchOnPhoneChatJidType=F,t.switchOnPhoneJidType=function(e,t){if(e===s)return t.status();return F(e,{user:t.user,group:t.group})},t.toBroadcastJid=function(e){return`${e}@broadcast`},t.toDeviceJid=function(e,t){return`${C(e)}:${t}${j(e)}`},t.toGroupJid=function(e){if(e.endsWith(l))return e;return`${e}@g.us`},t.toLidDeviceJid=P,t.toLidUserJid=function(e){return`${e}@lid`},t.toMsgrDeviceJid=function(e,t){return`${C(e)}:${t}@msgr`},t.toMsgrUserJid=A,t.toPhoneDeviceJid=function(e,t){return`${C(e)}:${t}@s.whatsapp.net`},t.toPhoneUserJid=function(e){return`${e}@s.whatsapp.net`},t.unsafeCoerceToDeviceId=J,t.unsafeCoerceToDeviceJid=Y,t.unsafeCoerceToGroupJid=q,t.unsafeCoerceToLidDeviceJid=W,t.unsafeCoerceToMsgrDeviceJid=H,t.unsafeCoerceToMsgrUserJid=z,t.unsafeCoerceToPhoneDeviceJid=K,t.unsafeCoerceToPhoneUserJid=$,t.unsafeCoerceToUserJid=V,t.userIdFromJid=C,t.validateBroadcastJid=function(e){return S.test(e)?e:null},t.validateCallJid=function(e){return T.test(e)?e:null},t.validateChatJid=function(e){return k(e)||U(e)},t.validateDeviceJid=function(e){return h.test(e)||d.test(e)||E.test(e)?e:null},t.validateDomainJid=function(e){return"s.whatsapp.net"===e||"g.us"===e?e:null},t.validateGroupJid=U,t.validateStatusJid=function(e){return"status@broadcast"===e?e:null},t.validateUserJid=k;var i=r(n(246203));t.DEFAULT_DEVICE_ID=0;const a="@me";t.AUTHOR_ME=a;const o="@system";t.AUTHOR_SYSTEM=o;const s="status@broadcast";t.STATUS_JID=s;t.PSA_JID="0@s.whatsapp.net";const l="@g.us",u=/^([1-9][0-9]{0,19}|(?!10)[1-9][0-9]{4,19}-[1-9][0-9]{9})@g.us$/,c="@msgr";t.MSGR_USER_DOMAIN=c;t.MSGR_USER_JID_SUFFIX="msgr";const d=/^([1-9][0-9]{0,19}(:[1-9][0-9]{0,2})?)@msgr$/,p=/^([1-9][0-9]{0,19})@msgr$/,_=/^([1-9][0-9]{0,19})(:0)?@msgr$/;t.WA_SERVER_JID_SUFFIX="s.whatsapp.net";const f="@s.whatsapp.net";t.WA_USER_DOMAIN=f;t.WA_USER_JID_SUFFIX="s.whatsapp.net";const h=/^(0|((?!10)[1-9][0-9]{4,19}(\.[0-9]{1,2})?(:[0-9]{1,2})))@s.whatsapp.net$/,g=/^(0|((?!10)[1-9][0-9]{4,19})(\.[0-9]{1,2})?)@s.whatsapp.net$/,m="@lid";t.LID_DOMAIN=m;t.LID_SUFFIX="lid";const y=/^([1-9][0-9]{0,14})@lid$/,E=/^([1-9][0-9]{0,14}(:[0-9]{1,2})?)@lid$/,S=/^(status|location|[1-9][0-9]{0,19})@broadcast$/,T=/^([0-9a-fA-F]{18,32})@call$/;t.SURVEY_USER_JID="16505361212@s.whatsapp.net";const v=/([0-9a-zA-Z-:]+)@(g\.us|call|s\.whatsapp\.net|broadcast|msgr|lid)/g;function A(e){return`${e}@msgr`}function C(e){if(e.endsWith(f))return e.slice(0,-f.length);if(e.endsWith(c))return e.slice(0,-c.length);if(e.endsWith(m))return e.slice(0,-m.length);throw new Error(`userIdFromJid called with non-user jid "${e}"`)}function P(e,t){return`${R(e)}:${t}@lid`}function O(e){return e.split("@")[0]}function I(e){const t=e.split("@")[0].split(":"),n=t[0],r=t[1];return{userId:n,deviceID:parseInt(r,10)}}function M(e){return I(e).deviceID}function b(e){return e.endsWith(f)||e.endsWith(c)||e.endsWith(m)?e:null}function R(e){if(!e.endsWith(m))throw new Error(`lidFromLidUserJid called with non-LidUserJid "${e}"`);return e.slice(0,-m.length)}function N(e){const t=e.split("@");let n=t[0];const r=t[1];return n=n.split(":")[0],n=n.split(".")[0],`${n}@${r}`}function w(e){const[t,n]=e.split("@"),[r,i]=t.split(":"),[a,o]=r.split(".");return{user:a,device:i,agent:o,server:n}}function L(e){switch(e.jidType){case"lidUser":case"msgrUser":case"phoneUser":return e.userJid;case"group":return e.groupJid;case"status":return e.statusJid;case"lidDevice":case"msgrDevice":case"phoneDevice":return e.deviceJid;case"broadcast":return e.broadcastJid;case"call":return e.callJid;default:return(0,i.default)(e.jidType)}}function D(e){if(e===s)return{jidType:"status",statusJid:s};if(g.test(e))return{jidType:"phoneUser",userJid:e};if(p.test(e))return{jidType:"msgrUser",userJid:e};if(_.test(e)){return{jidType:"msgrUser",userJid:A(e.substr(0,e.indexOf(":")))}}return h.test(e)?{jidType:"phoneDevice",deviceJid:e}:d.test(e)?{jidType:"msgrDevice",deviceJid:e}:u.test(e)?{jidType:"group",groupJid:e.endsWith(l)?e:`${e}@g.us`}:S.test(e)?{jidType:"broadcast",broadcastJid:e}:T.test(e)?{jidType:"call",callJid:e}:y.test(e)?{jidType:"lidUser",userJid:e}:E.test(e)?{jidType:"lidDevice",deviceJid:e}:{jidType:"unknown"}}function k(e){if(g.test(e)||p.test(e)||y.test(e))return e;if(_.test(e)){return A(e.substr(0,e.indexOf(":")))}return null}function U(e){return u.test(e)?e:null}function G(e){const t=D(e);return"unknown"===t.jidType?e:"status"===t.jidType?t.statusJid:(t.jidType,L(t).replace(/^([^@]*)([^@][^@][^@][^@])@(.*)$/,"...$2@$3"))}function x(e){return e.endsWith(l)?e:null}function B(e,t){if(e.endsWith(f))return t.phoneUser(e);if(e.endsWith(c))return t.msgrUser(e);if(e.endsWith(m))return t.lidUser(e);if(null!=x(e))return t.group(e);throw new Error(`Can not switch on chat jid ${e}`)}function F(e,t){if(e.endsWith(f))return t.user(e);if(null!=x(e))return t.group(e);throw new Error(`Can not switch on chat jid ${e}`)}function j(e){if(e.endsWith(f))return f;if(e.endsWith(c))return c;if(e.endsWith(m))return m;throw new Error(`userDomainFromJid called with non-user jid "${e}"`)}function Y(e){return e}function K(e){return e}function H(e){return e}function W(e){return e}function V(e){return e}function $(e){return e}function z(e){return e}function q(e){return e}function J(e){return e}},706223:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(417405),i=(0,n(406949).memoizeWithArgs)((function(e){return(0,r.encodeB64)(function(e,t){let n,r,i,o;e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;let d=1732584193,p=-271733879,_=-1732584194,f=271733878;for(let t=0;t<e.length;t+=16)n=d,r=p,i=_,o=f,d=s(d,p,_,f,e[t],7,-680876936),f=s(f,d,p,_,e[t+1],12,-389564586),_=s(_,f,d,p,e[t+2],17,606105819),p=s(p,_,f,d,e[t+3],22,-1044525330),d=s(d,p,_,f,e[t+4],7,-176418897),f=s(f,d,p,_,e[t+5],12,1200080426),_=s(_,f,d,p,e[t+6],17,-1473231341),p=s(p,_,f,d,e[t+7],22,-45705983),d=s(d,p,_,f,e[t+8],7,1770035416),f=s(f,d,p,_,e[t+9],12,-1958414417),_=s(_,f,d,p,e[t+10],17,-42063),p=s(p,_,f,d,e[t+11],22,-1990404162),d=s(d,p,_,f,e[t+12],7,1804603682),f=s(f,d,p,_,e[t+13],12,-40341101),_=s(_,f,d,p,e[t+14],17,-1502002290),p=s(p,_,f,d,e[t+15],22,1236535329),d=l(d,p,_,f,e[t+1],5,-165796510),f=l(f,d,p,_,e[t+6],9,-1069501632),_=l(_,f,d,p,e[t+11],14,643717713),p=l(p,_,f,d,e[t],20,-373897302),d=l(d,p,_,f,e[t+5],5,-701558691),f=l(f,d,p,_,e[t+10],9,38016083),_=l(_,f,d,p,e[t+15],14,-660478335),p=l(p,_,f,d,e[t+4],20,-405537848),d=l(d,p,_,f,e[t+9],5,568446438),f=l(f,d,p,_,e[t+14],9,-1019803690),_=l(_,f,d,p,e[t+3],14,-187363961),p=l(p,_,f,d,e[t+8],20,1163531501),d=l(d,p,_,f,e[t+13],5,-1444681467),f=l(f,d,p,_,e[t+2],9,-51403784),_=l(_,f,d,p,e[t+7],14,1735328473),p=l(p,_,f,d,e[t+12],20,-1926607734),d=u(d,p,_,f,e[t+5],4,-378558),f=u(f,d,p,_,e[t+8],11,-2022574463),_=u(_,f,d,p,e[t+11],16,1839030562),p=u(p,_,f,d,e[t+14],23,-35309556),d=u(d,p,_,f,e[t+1],4,-1530992060),f=u(f,d,p,_,e[t+4],11,1272893353),_=u(_,f,d,p,e[t+7],16,-155497632),p=u(p,_,f,d,e[t+10],23,-1094730640),d=u(d,p,_,f,e[t+13],4,681279174),f=u(f,d,p,_,e[t],11,-358537222),_=u(_,f,d,p,e[t+3],16,-722521979),p=u(p,_,f,d,e[t+6],23,76029189),d=u(d,p,_,f,e[t+9],4,-640364487),f=u(f,d,p,_,e[t+12],11,-421815835),_=u(_,f,d,p,e[t+15],16,530742520),p=u(p,_,f,d,e[t+2],23,-995338651),d=c(d,p,_,f,e[t],6,-198630844),f=c(f,d,p,_,e[t+7],10,1126891415),_=c(_,f,d,p,e[t+14],15,-1416354905),p=c(p,_,f,d,e[t+5],21,-57434055),d=c(d,p,_,f,e[t+12],6,1700485571),f=c(f,d,p,_,e[t+3],10,-1894986606),_=c(_,f,d,p,e[t+10],15,-1051523),p=c(p,_,f,d,e[t+1],21,-2054922799),d=c(d,p,_,f,e[t+8],6,1873313359),f=c(f,d,p,_,e[t+15],10,-30611744),_=c(_,f,d,p,e[t+6],15,-1560198380),p=c(p,_,f,d,e[t+13],21,1309151649),d=c(d,p,_,f,e[t+4],6,-145523070),f=c(f,d,p,_,e[t+11],10,-1120210379),_=c(_,f,d,p,e[t+2],15,718787259),p=c(p,_,f,d,e[t+9],21,-343485551),d=a(d,n),p=a(p,r),_=a(_,i),f=a(f,o);return new Uint8Array([255&d,d>>>8&255,d>>>16&255,d>>>24&255,255&p,p>>>8&255,p>>>16&255,p>>>24&255,255&_,_>>>8&255,_>>>16&255,_>>>24&255,255&f,f>>>8&255,f>>>16&255,f>>>24&255])}(function(e){let t;const n=[];for(n[(e.length>>2)-1]=0,t=0;t<n.length;t+=1)n[t]=0;const r=8*e.length;for(t=0;t<r;t+=8)n[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return n}(e),8*e.length))}),(e=>e));function a(e,t){const n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function o(e,t,n,r,i,o){return a((s=a(a(t,e),a(r,o)))<<(l=i)|s>>>32-l,n);var s,l}function s(e,t,n,r,i,a,s){return o(t&n|~t&r,e,t,i,a,s)}function l(e,t,n,r,i,a,s){return o(t&r|n&~r,e,t,i,a,s)}function u(e,t,n,r,i,a,s){return o(t^n^r,e,t,i,a,s)}function c(e,t,n,r,i,a,s){return o(n^(t|~r),e,t,i,a,s)}t.default=i},132375:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"?";if(null==e)throw new Error(`Unexpected null or undefined: ${t}`);return e}},624487:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let t=n;const r=function(){if(t===n){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];t=e.call(this,...i)}return t};return r.reset=()=>{t=n},r};const n={}},8525:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.extractDigits=function(e){const t=e.match(/\d+/g);return null!=t?t.join(""):""},t.findCC=p,t.formatPhone=_,t.formattedPhoneNumber=function(e){return _((0,o.phoneNumberFromJid)(e))},t.isPotentiallyPhoneNumber=function(e){return f.test(e)},t.isPotentiallyValid=function(e,t){if(!/^\d+$/.test(t))return!1;const n=c[e]||d(e);if(!n)return!1;return"number"==typeof n.lengths?n.lengths===t.length:n.lengths.includes(t.length)},t.phoneCC=function(e){return p(e)};var i=r(n(63437)),a=n(406875),o=n(616310);const s=/^(1|2[07]|3[0-469]|4[013-9]|5[1-8]|6[0-6]|7|8[1246]|9[0-58])/,l=new Map;class u{constructor(e){let t;if(Array.isArray(e)){t=e[0];let n=e[1];null!=n&&-1!==n&&(Array.isArray(n)||(n=[n]),this._leadins=n.map((function(e){return new RegExp("^("+e+")")}))),this._formatString=e[2]}else t=e;this._regex=new RegExp(`^${(0,a.inflatePhoneRegex)(t)}$`)}testAndFormat(e){if(!this._regex.test(e)||!this._checkLeadins(e))return;if("string"==typeof this._formatString)return e.replace(this._regex,this._formatString);const t=this._regex.exec(e);return null!=t?t.slice(1).join(null!=this._formatString?"-":" "):void 0}_checkLeadins(e){return!this._leadins||this._leadins.some((function(t){return t.test(e)}))}}const c={};function d(e){const t=null!=i.default[e]?JSON.parse(`[${i.default[e]}]`):null;if(null==t)return null;const n=t.pop();return c[e]={lengths:n,formats:t.map((function(e){return new u(e)}))}}function p(e){const t=e.match(s);return t?t[0]:e.length>=3?e.substring(0,3):e}function _(e){let t=l.get(e);return null==t&&(t=function(e){const t=e.length>0&&"+"===e[0]?e.substring(1):e,n=p(t);if(!n)return t;const r=t.substring(n.length),i=c[n]||d(n);if(!i)return"+"+n+" "+r;const a=i.formats;for(let e=0;e<a.length;e++){const t=a[e].testAndFormat(r);if(null!=t&&""!==t)return"+"+n+" "+t}return"+"+n+" "+r}(e),l.set(e,t)),t}const f=/^\+*[\d ()]+$/},452813:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.asyncChain=function(e,t){if(e.success)return t(e.value);return Promise.resolve(e)},t.asyncMapError=u,t.asyncMapResult=s,t.catchError=function(e){return function(){var t=(0,i.default)((function*(t){yield u(t,e)}));return function(){return t.apply(this,arguments)}}()},t.chain=function(e,t){if(e.success)return t(e.value);return e},t.makeError=a,t.makeResult=o,t.mapError=function(e,t){if(e.success)return o(e.value);return a(t(e.error),e.payload)},t.mapResult=function(e,t){if(!e.success)return e;return o(t(e.value))},t.onResult=function(e){return t=>s(t,e)};var i=r(n(311504));function a(e,t){return null!=t?{success:!1,error:e,payload:t}:{success:!1,error:e}}function o(e){return{success:!0,value:e}}function s(){return l.apply(this,arguments)}function l(){return(l=(0,i.default)((function*(e,t){if(!e.success)return e;return o(yield t(e.value))}))).apply(this,arguments)}function u(){return c.apply(this,arguments)}function c(){return(c=(0,i.default)((function*(e,t){if(e.success)return o(e.value);return a(yield t(e.error),e.payload)}))).apply(this,arguments)}},201063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ShiftTimer=void 0;function n(e){if(!(e>=0))throw new Error("ShiftTimer must be given delay >= 0")}t.ShiftTimer=class{constructor(e){this._timer=0,this._rafId=0,this.ts=0,this._timerTs=0,this._upperBound=0,this._lowerBound=0,this._arg=void 0,this._run=()=>{const e=this._arg,t=this._foo;this._rafId=0,this._timer=0,this.ts=0,this._timerTs=0,this._upperBound=0,this._lowerBound=0,this._arg=void 0,t(e)},this.onOrBefore=(e,t)=>{n(e);const r=Date.now()+e,i=this._upperBound;if(0!==i&&i<r)return;const a=this._lowerBound;0!==a&&r<a||(this._upperBound=r,this._rafId||this._timer&&!(r<this.ts)||this._setDelay(r,e,t))},this.forceRunNow=e=>{this._timer&&clearTimeout(this._timer),this._rafId&&cancelAnimationFrame(this._rafId),this._arg=e,this._run()},this.cancel=()=>{this._timer&&clearTimeout(this._timer),this._rafId&&cancelAnimationFrame(this._rafId),this._timer=0,this._rafId=0,this.ts=0,this._timerTs=0,this._upperBound=0,this._lowerBound=0,this._arg=void 0},this._foo=e}onOrBeforeRepaint(e){if(this._rafId)return;const t=Date.now(),n=this._lowerBound;if(0!==n&&t<n)return;const r=this._upperBound;(0===r||t<r)&&(this._upperBound=t),this._timer&&(clearTimeout(this._timer),this._timer=0),(!this.ts||this.ts>t)&&(this.ts=t),this._arg=e,this._rafId=requestAnimationFrame(this._run)}onOrAfter(e,t){n(e);const r=Date.now()+e,i=this._lowerBound;if(0!==i&&r<i)return;const a=this._upperBound;0!==a&&a<r||(this._lowerBound=r,(!this._timer||this.ts<r)&&this._setDelay(r,e,t))}debounce(e,t){n(e),this._debounce(Date.now(),e,t)}debounceAndCap(e,t,r){n(e),n(t);const i=Date.now(),a=i+t,o=this._lowerBound,s=this._upperBound;(0===o||o<=a)&&(0===s||a<s)&&(this._upperBound=a),this._debounce(i,e,r)}forceRunNowIfScheduled(){this._timer?(clearTimeout(this._timer),this._run()):this._rafId&&(cancelAnimationFrame(this._rafId),this._run())}isScheduled(){return 0!==this._timer||0!==this._rafId}_debounce(e,t,n){const r=e+t,i=this._lowerBound;if(0!==i&&r<i)return;const a=this.ts,o=this._upperBound;0!==o&&o<r?a<o&&this._setDelay(o,o-e,n):a<r&&this._setDelay(r,t,n)}_setDelay(e,t,n){if(this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=0),this._arg=n,this.ts=e,this._timer){const t=e-this._timerTs;if(-16<t&&t<16)return;clearTimeout(this._timer)}this._timer=setTimeout(this._run,t),this._timerTs=e}}},558553:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DO_NOT_RESCHEDULE=void 0,t.awaitTaskPromise=function(e){return l("awaitTaskPromise").awaitTaskPromise(e)},t.deactivate=function(e){s(e,i.DUMMY_UNIXTIME)},t.getScheduledTime=function(e){return l("getScheduledTime").getScheduledTime(e)},t.registerTask=function(e,t){l("registerTask").registerTask(e,t)},t.reschedule=s,t.rescheduleNow=function(e){s(e,(0,i.unixTime)())},t.startScheduler=function(e){__LOG__(2)`startScheduler invoked`,o||(o=new a(e))};var r=n(663166),i=n(990445);t.DO_NOT_RESCHEDULE="no_reschedule";class a{constructor(e){this._started=!1,this._resolvers={},this._timers={},this._timeoutIDs={},this._taskImplementations=new Map,this._scheduledTimeResolver=e.scheduledTimeResolver}_startTask(e){const t=this._taskImplementations.get(e);null!=t?this._scheduledTimeResolver.get(e).then((n=>{const r=null==n;if(!r&&n===i.DUMMY_UNIXTIME)return void __LOG__(2)`Task ${e} deactivated`;let a=null==n?0:1e3*n-(0,i.unixTimeMs)();a=Math.max(0,a),a=Math.min(a,~(1<<31)),__LOG__(2)`Scheduling task ${e} in ${a}ms`,this._timeoutIDs[e]=setTimeout((()=>{delete this._timeoutIDs[e],__LOG__(2)`Firing task ${e}`,t(r).then((t=>{if("no_reschedule"===t)return new Promise((()=>{}));let n;return t===i.DUMMY_UNIXTIME?(__LOG__(2)`Task ${e} complete, deactivating`,delete this._timers[e],n=i.DUMMY_UNIXTIME):t>=0?(__LOG__(2)`Task ${e} complete, waiting ${t}`,delete this._timers[e],n=(0,i.futureUnixTime)(t)):(__LOG__(2)`Task ${e} will try again later`,n=this._getNextRun(e)),this._scheduledTimeResolver.set(e,n)})).then((()=>{this._startTask(e),this._resolvers[e]&&(this._resolvers[e].forEach((e=>e())),delete this._resolvers[e])})).catch((t=>(__LOG__(2)`Task ${e} failed, try again later: ${t}`,this._scheduledTimeResolver.set(e,this._getNextRun(e)).then((()=>{this._startTask(e)})))))}),a)})):__LOG__(4,void 0,new Error)`Tried to start task ${e} before registering its implementation`}_getNextRun(e){return this._timers[e]||(this._timers[e]=(0,r.createTimer)({jitter:.1,max:1e3*i.HOUR_SECONDS,algo:{type:"fibonacci",first:1e3,second:2e3}})),(0,i.futureUnixTime)(Math.round(this._timers[e]()/1e3))}_registerResolver(e,t){this._resolvers[e]||(this._resolvers[e]=[]),this._resolvers[e].push(t)}awaitTaskPromise(e){return new Promise((t=>{this._registerResolver(e,t)}))}reschedule(e,t){this._started?(this._scheduledTimeResolver.set(e,t),null!=this._timeoutIDs[e]&&clearTimeout(this._timeoutIDs[e]),this._startTask(e)):this._scheduledTimeResolver.set(e,t)}registerTask(e,t){this._started||(this._started=!0),this._taskImplementations.set(e,t),this._startTask(e)}getScheduledTime(e){return this._scheduledTimeResolver.get(e)}}let o=null;function s(e,t){l("reschedule").reschedule(e,t)}function l(e){if(o)return o;throw new Error(`TaskScheduler::${e} called before startScheduler`)}},990445:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.YEAR_SECONDS=t.WEEK_SECONDS=t.WEEK_MILLISECONDS=t.MonotonicTimer=t.MINUTE_SECONDS=t.MINUTE_MILLISECONDS=t.MAX_INT=t.HOUR_SECONDS=t.HOUR_MILLISECONDS=t.FIVE_MINUTES=t.DUMMY_UNIXTIME=t.DAY_SECONDS=t.DAY_MILLISECONDS=void 0,t.cappedMillisecondsUntil=g,t.castLongIntToUnixTime=function(e){return"number"!=typeof e?(0,r.hexLongIsNegative)(e)?c:u:_(e)},t.castMilliSecondsToUnixTime=f,t.castMillisTimeToUnixTime=function(e){if(null==e)return e;return e>u?f(e):_(e)},t.castToMillisTime=h,t.castToUnixTime=_,t.castUnixTimeToMillisTime=function(e){return 1e3*e},t.convertHexToDate=function(e){const t=Number.parseInt(e,16);if(Number.isFinite(t))return new Date(1e3*_(t));return null},t.delayUntil=function(e){const t=g(e);return new Promise((e=>{setTimeout(e,t)}))},t.futureUnixTime=function(e,t){const n=null!=t?t:m();return _(Math.ceil(n+Math.max(e,0)))},t.getClockSkew=function(){return p},t.happenedWithin=function(e,t){return T(m(),e,t)},t.happenedWithinAt=T,t.isInFuture=function(e){return y(e)>0},t.isOverflowTime=function(e){return e<c||e>u},t.isWithinNext24h=function(e){return e-m()<=a},t.midnight=function(){return _((new Date).setHours(0,0,0,0)/1e3-p)},t.midnightOn=function(e){return _(v(e).setHours(0,0,0,0)/1e3-p)},t.millisTime=function(){return A()-1e3*p},t.monotonicTime=E,t.monotonicTimeSince=S,t.oldest=function(e,t){return e<t?e:t},t.pastUnixTime=function(e,t){const n=null!=t?t:m();return _(Math.ceil(n-Math.max(e,0)))},t.performanceAbsoluteNow=A,t.sameDay=function(e,t){if(Math.abs(e-t)>a)return!1;const n=d.time===e?d.day:v(e+p).getDay(),r=d.time===t?d.day:v(t+p).getDay();return d.time=t,d.day=r,n===r},t.secondsUntil=y,t.setClockSkew=function(e){p=e},t.timeSince_USE_ONLY_IF_APPROVED=function(e){return Math.max(m()-e,0)},t.timeoutFor=function(e,t){const n=m(),r=Math.max(e+t-n,0);return Math.min(1e3*r,~(1<<31))},t.toDate=v,t.toHttpHeaderDate=function(e){return v(e).toUTCString()},t.unixTime=m,t.unixTimeMs=function(){return Date.now()-1e3*p},t.unixTimeWithoutClockSkewCorrection=function(){return _(Date.now()/1e3)},t.unskewedDate_USE_ONLY_IF_APPROVED=function(){return new Date};var r=n(710038);t.MINUTE_SECONDS=60;t.FIVE_MINUTES=300;const i=3600;t.HOUR_SECONDS=i;const a=86400;t.DAY_SECONDS=a;t.WEEK_SECONDS=604800;t.YEAR_SECONDS=31536e3;t.MINUTE_MILLISECONDS=6e4;const o=36e5;t.HOUR_MILLISECONDS=o;const s=864e5;t.DAY_MILLISECONDS=s;t.WEEK_MILLISECONDS=6048e5;const l=1<<31;t.DUMMY_UNIXTIME=l;const u=2147483647;t.MAX_INT=u;const c=-2147483647,d={time:0,day:-4};let p=0;function _(e){return Math.max(c,Math.min(0|e,u))}function f(e){return _(e/1e3)}function h(e){return e}function g(e){const t=Math.max(e-m(),0);return Math.min(1e3*t,~(1<<31))}function m(){return _(Date.now()/1e3-p)}function y(e){return Math.max(e-m(),0)}function E(){return performance.now()}function S(e){return Math.floor(performance.now()-e)}function T(e,t,n){return Math.abs(e-t)<=n}function v(e){return new Date(1e3*e)}function A(){return Date.now()}t.MonotonicTimer=class{constructor(){const e=E();this._initTime=e,this._startTime=e}reset(){this._startTime=E()}elapsed(){return S(this._startTime)}cumulative(){return S(this._initTime)}}},425315:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isBoolean=function(e){return"boolean"==typeof e},t.isFunction=function(e){return"function"==typeof e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e}},553272:(e,t,n)=>{"use strict";let r,i;Object.defineProperty(t,"__esModule",{value:!0}),t.dir=function(e){!function(){if(r)return;const e=n(470592).D,t=e.length/2;r=new Int32Array(t),i=new Int32Array(t);for(let n=0,a=0;n<t;n++,a+=2)r[n]=e[a]+(0===n?0:r[n-1]),i[n]=e[a+1]}();for(let t=0;t<e.length;t++){let n=0|e.charCodeAt(t);if(55296<=n&&n<56320){if(++t===e.length)break;const r=e.charCodeAt(t);if(!(56320<=r&&r<57344))continue;n=65536+((1023&n)<<10|1023&r)}else if(56320<=n&&n<57344)continue;if(n<r[0])continue;const a=0|r.length;let o=0,s=a-1|0;for(;o<s;){const e=s+o>>1;if(r[e]>n)s=e-1|0;else{if(r[e+1]>n){s=e;break}o=e+1|0}}const l=i[s],u=r[s]+Math.abs(l)|0;if(n<u)return l<0?"rtl":"ltr"}return}},470592:(e,t)=>{"use strict";t.D=void 0;t.D=[65,26,32,26,73,1,11,1,5,1,6,23,24,31,32,449,451,7,21,2,16,5,14,1,130,4,6,2,4,4,5,1,7,1,2,3,4,1,2,20,21,83,84,140,147,166,167,38,40,49,55,-1,46,-1,2,-1,3,-1,3,-1,2,-56,64,-1,3,-1,2,-1,14,-48,82,-3,4,-101,116,-2,9,-2,12,-23,24,-30,57,-91,102,-58,67,-2,6,-3,4,-24,28,-1,10,-1,4,-1,6,-43,46,-119,167,55,56,1,2,4,12,4,5,3,10,10,12,29,30,2,3,8,10,2,4,22,23,7,8,1,4,4,7,4,10,2,4,2,3,1,9,1,5,2,3,3,7,12,14,7,8,2,7,1,2,6,10,2,4,22,23,7,8,2,3,2,3,2,6,3,27,4,5,1,8,10,12,3,4,1,13,1,2,9,10,3,4,22,23,7,8,2,3,5,8,4,12,1,2,2,5,1,16,2,6,11,19,1,9,2,3,8,10,2,4,22,23,7,8,2,3,5,8,2,3,1,7,2,4,2,12,1,5,2,3,3,7,18,29,1,2,6,9,3,4,4,7,2,3,1,2,2,5,2,5,3,6,12,16,2,3,2,5,3,4,3,6,1,7,1,15,13,27,3,4,8,9,3,4,23,24,16,19,1,4,4,23,3,8,2,6,10,17,1,8,2,3,11,12,3,4,23,24,10,11,5,8,8,9,3,4,2,11,2,9,1,2,2,6,10,11,2,17,11,12,3,4,41,43,4,9,3,4,3,4,2,6,14,18,26,28,2,3,18,21,24,25,9,10,1,3,7,15,3,9,8,14,10,12,3,15,48,49,2,14,7,15,13,50,2,3,1,2,5,6,24,25,1,2,10,11,2,11,1,3,5,6,1,10,10,12,4,36,24,26,27,28,1,2,1,6,10,11,36,54,1,6,1,3,5,54,8,9,6,7,13,50,45,49,1,7,1,3,2,4,25,27,4,7,16,20,13,14,2,4,6,7,15,16,40,41,1,6,1,3,377,378,4,6,7,8,1,2,4,6,41,42,4,6,33,34,4,6,7,8,1,2,4,6,15,16,57,58,4,6,67,72,29,32,16,32,86,88,6,9,639,640,26,31,89,96,13,14,4,18,18,21,2,11,18,32,13,14,3,18,52,54,1,8,8,9,2,13,7,8,1,4,10,48,10,16,89,96,5,7,34,35,1,6,70,80,31,35,4,6,3,7,2,3,6,19,40,42,5,16,44,48,26,32,11,48,23,25,2,5,56,57,1,10,1,2,2,10,6,19,10,16,10,16,14,100,48,49,1,6,1,2,5,6,9,13,27,36,9,14,32,36,2,4,1,4,56,57,1,3,3,4,1,4,2,10,48,56,2,7,15,18,60,67,43,45,11,22,1,14,1,8,4,5,6,7,3,5,1,6,192,256,278,280,6,8,38,40,6,8,8,9,1,2,1,2,1,2,31,33,53,54,7,8,1,4,3,4,7,10,4,6,6,10,13,18,3,4,7,24,1,1,-1,98,1,14,1,17,13,114,1,5,1,3,10,11,1,4,5,11,1,2,1,2,1,2,4,5,11,13,4,9,5,9,2,18,41,470,69,95,1,263,78,528,1,340,256,1024,47,48,47,48,133,139,4,7,2,14,38,39,1,6,1,3,56,63,2,17,23,32,7,8,7,8,7,8,7,8,7,8,7,8,7,8,7,557,3,28,9,13,2,3,5,7,5,9,86,92,3,4,90,91,4,9,43,44,94,95,48,96,45,48,48,64,28,31,50,65,12,16,167,171,99,101,31,32,6592,6656,20989,20992,1165,1232,317,320,28,48,47,64,30,32,80,82,6,48,102,103,55,57,9,51,13,14,3,4,4,5,25,27,1,9,8,16,52,64,68,78,12,36,13,14,38,46,25,36,2,13,30,36,48,49,2,6,2,4,16,17,11,15,7,8,25,26,41,47,2,4,2,13,3,4,8,9,1,3,10,12,32,33,51,52,1,4,2,4,5,7,1,2,1,25,17,19,8,19,6,8,6,8,6,15,7,8,7,8,58,64,117,118,2,3,4,7,10,16,11172,11184,23,27,49,2101,6766,6768,106,144,7,19,5,10,-1,2,-10,11,-532,534,-144,176,-13,14,-2,114,-143,177,26,32,26,37,89,92,6,8,6,8,6,8,3,38,12,13,26,27,19,20,2,3,15,17,14,48,123,128,1,2,1,5,45,48,9,86,2,67,45,176,29,32,49,96,36,45,30,35,38,48,30,31,37,41,14,56,158,160,10,16,36,40,36,40,40,48,52,63,1,145,311,320,22,32,8,160,-287,288,-225,228,-1,3,-5,9,-40,43,-4,5,-165,167,-82,89,-484,488,-8,18,-294,325,-44,46,-153,164,-175,175,1,2,54,69,7,31,10,28,49,53,2,4,7,18,1,3,25,32,10,19,36,41,1,10,18,26,35,36,3,14,52,61,10,14,2,3,16,17,20,31,18,19,28,31,2,3,1,3,6,72,7,8,1,2,4,5,15,16,11,17,47,48,3,16,10,18,2,3,8,10,2,4,22,23,7,8,2,3,5,8,3,4,4,6,2,4,3,5,1,7,1,6,7,163,56,64,2,5,1,2,21,22,1,2,3,33,51,57,1,2,4,6,1,3,4,12,10,176,50,56,4,6,1,3,27,63,51,59,2,3,1,3,4,15,10,48,43,44,1,2,2,8,1,2,1,8,10,64,27,32,2,6,1,10,16,208,47,56,1,3,1,101,83,95,8,10,1,3,8,9,2,3,30,31,2,6,1,2,4,5,3,12,10,80,8,10,42,50,4,5,4,31,1,7,2,4,40,46,2,6,8,17,1,7,2,5,46,59,1,3,9,38,57,320,9,10,38,52,8,18,29,32,32,57,1,8,1,3,1,76,7,8,2,3,38,59,1,10,10,16,6,7,2,3,37,41,2,3,1,2,1,8,10,320,19,21,4,187,1,16,21,63,923,1025,111,112,5,16,196,2944,1071,1072,9,4048,583,9216,569,576,31,32,10,14,2,98,30,37,1,11,48,55,15,25,10,11,7,8,21,26,19,707,91,192,75,80,56,67,13,77,2,3,1,13,2,16,6136,6144,1238,1280,9,8960,287,336,3,20,4,12,396,2704,107,112,13,16,9,16,10,12,1,3,1,4961,246,256,39,41,62,65,9,25,2,9,30,34,59,306,20,128,25,160,85,86,71,72,2,4,1,3,2,4,4,5,12,13,1,2,7,8,65,66,4,6,8,9,7,8,28,29,4,5,5,6,1,4,7,8,340,342,51,52,57,58,57,58,57,58,57,58,8,60,512,567,4,54,8,9,14,15,7,1659,45,55,7,9,10,14,2,370,44,48,10,1296,-208,215,-109,116,-1445,1447,-270,542,31,32,58,64,61,118,29,42,44,48,9,16,2,3504,42718,42752,4149,4160,222,224,5762,5776,7473,10576,542,2048,4939,786432,65534,65536,65534]},568588:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=class{constructor(e){if(e<=0)throw new RangeError("BitArray:numBits should be positive");this._numBits=e,this._array=new Uint8Array(Math.ceil(this._numBits/8))}get(e){const[t,n]=this._getArrayIndexOffset(e);return Boolean(this._array[t]>>n&1)}set(e){const[t,n]=this._getArrayIndexOffset(e);this._array[t]|=1<<n}unset(e){const[t,n]=this._getArrayIndexOffset(e);this._array[t]&=~(1<<n)}toggle(e){const[t,n]=this._getArrayIndexOffset(e);this._array[t]^=1<<n}clear(){this._array=new Uint8Array(Math.ceil(this._numBits/8))}toArray(){const e=[];for(let t=0;t<this._numBits;t++)e.push(this.get(t));return e}toString(){return this.toArray().map((e=>e?"1":"0")).join("")}_getArrayIndexOffset(e){if(e<0||e>=this._numBits)throw new RangeError("BitArray:index out of bounds");const t=Math.floor(e/8);return[t,e-8*t]}}},730368:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(132375));class a{constructor(e,t,n){this.key=e,this.value=t,this.timestamp=null!=n?n:Date.now(),this.prev=void 0,this.next=void 0}}class o{constructor(){this.start=new a(null,null),this.end=new a(null,null),this.start.next=this.end,this.end.prev=this.start}append(e,t){const n=new a(e,t),r=this.end,o=(0,i.default)(this.end.prev,"this.end.prev");return n.next=r,n.prev=o,r.prev=n,o.next=n,n}prepend(e,t){const n=new a(e,t),r=this.start,o=(0,i.default)(this.start.next,"this.start.next");return n.prev=r,n.next=o,r.next=n,o.prev=n,n}popEnd(){const e=(0,i.default)(this.end.prev,"this.end.prev");if(e===this.start)return;const t=(0,i.default)(e.prev,"entry.prev"),n=(0,i.default)(e.next,"entry.next");return t.next=n,n.prev=t,e.next=void 0,e.prev=void 0,e}popFront(){const e=(0,i.default)(this.start.next,"this.start.next");if(e===this.end)return;const t=(0,i.default)(e.prev,"entry.prev"),n=(0,i.default)(e.next,"entry.next");return t.next=n,n.prev=t,e.next=void 0,e.prev=void 0,e}peekFront(){const e=(0,i.default)(this.start.next,"this.start.next");if(e!==this.end)return e}peekEnd(){const e=(0,i.default)(this.end.prev,"this.end.prev");if(e!==this.start)return e}remove(e){const t=(0,i.default)(e.prev,"entry.prev"),n=(0,i.default)(e.next,"entry.next");return t.next=n,n.prev=t,e.next=void 0,e.prev=void 0,e}stats(){let e=this.start,t=0;for(;e!==this.end;)e=(0,i.default)(e.next,"entry.next"),t+=1;return t-1}}t.default=class{constructor(){this.keyMap=new Map,this.entryList=new o}lookup(e){const t=this.keyMap.get(e);if(t){this.entryList.remove(t);const e=this.entryList.append(t.key,t.value);return this.keyMap.set(e.key,e),t.value}}add(e,t){let n=this.keyMap.get(e);return n?n.value=t:(n=this.entryList.append(e,t),this.keyMap.set(e,n)),t}expireKeys(e){let t=this.entryList.peekFront();for(;t&&t.timestamp<e;)this.entryList.popFront(),this.keyMap.delete(t.key),t=this.entryList.peekFront()}printStats(){console.log("========================== STATS ============================="),console.log("entry list: ",this.entryList.stats()),console.log("map keys: ",this.keyMap.size)}}},138596:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LruCache=void 0;var r=n(201063);class i{constructor(e,t){this.key=e,this.value=t,this.prev=null,this.next=null}}t.LruCache=class{constructor(e){var t;this._keyToNode=new Map,this.purgeNow=()=>{for(let e=this._dummyTail.prev;this._currentSize>this._sizeLimit&&e!==this._dummyHead;e=e?e.prev:null){if(null==e)throw new Error("The linked list is not constructed properly.");const{key:t,value:n}=e;this._shouldEvict(t,n)&&(this.delete(t),this._onEvict&&this._onEvict(t,n))}this._onPurge&&this._onPurge(this._keyToNode)},this._sizeLimit=e.sizeLimit,this._getSize=e.getSize,this._onPurge=e.onPurge,this._shouldEvict=null!==(t=e.shouldEvict)&&void 0!==t?t:()=>!0,this._onEvict=e.onEvict,this._onAdd=e.onAdd,this._onDelete=e.onDelete,this._currentSize=0,this._dummyHead=new i("dummy-head",null),this._dummyTail=new i("dummy-tail",null),this._dummyHead.next=this._dummyTail,this._dummyTail.prev=this._dummyHead,this._purgeTimer=new r.ShiftTimer((()=>this.purgeNow()))}get(e){if(!this._keyToNode.has(e))return null;const t=this._keyToNode.get(e);if(null==t)return null;const n=t.prev,r=t.next;n&&(n.next=r),r&&(r.prev=n);const i=this._dummyHead.next;if(null==i)throw new Error("The linked list is not constructed properly.");return this._dummyHead.next=t,i.prev=t,t.prev=this._dummyHead,t.next=i,t.value}has(e){return this._keyToNode.has(e)}touch(e){this.get(e)}put(e,t){0!==this._sizeLimit&&(this._getSize(t)>this._sizeLimit?__LOG__(3)`Blob size is larger than the limit of the whole store.`:(this.delete(e),this._add(e,t),this.schedulePurge()))}_add(e,t){const n=new i(e,t);this._keyToNode.set(e,n);const r=this._dummyHead.next;if(null==r)throw new Error("The linked list is not constructed properly.");this._dummyHead.next=n,r.prev=n,n.prev=this._dummyHead,n.next=r,this._currentSize+=this._getSize(t),this._onAdd&&this._onAdd(e,t)}delete(e){if(!this._keyToNode.has(e))return;const t=this._keyToNode.get(e);if(null==t)return;this._currentSize-=this._getSize(t.value);const n=t.prev,r=t.next;n&&(n.next=r),r&&(r.prev=n),this._keyToNode.delete(e),this._onDelete&&this._onDelete(e,t.value)}clear(){this._keyToNode.clear(),this._currentSize=0,this._dummyHead.next=this._dummyTail,this._dummyTail.prev=this._dummyHead,this._onClear&&this._onClear()}schedulePurge(){this._purgeTimer.onOrBefore(1e3)}}},287802:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=class{constructor(e,t){this._valueFn=e,this._heap=[],this._load(t)}size(){return this._heap.length}_load(e){(null==e?void 0:e.length)&&e.forEach((e=>{this.push(e)}))}_swap(e,t){const n=this._heap[t];this._heap[t]=this._heap[e],this._heap[e]=n}_siftUp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(0===e)return;const t=this._getParent(e),n=2*t+1,r=2*t+2,i=this._heap.length;if(e>=i)return;let a=this._getVal(t),o=t;if(n<i){const e=this._getVal(n);a>e&&(o=n,a=e)}if(r<i){a>this._getVal(r)&&(o=r)}o!==t&&(this._swap(o,t),this._siftUp(t))}_doHeapify(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const t=2*e+1,n=2*e+2,r=this._heap.length;if(e>=r)return;let i=this._getVal(e),a=e;if(t<r){const e=this._getVal(t);i>e&&(a=t,i=e)}if(n<r){i>this._getVal(n)&&(a=n)}a!==e&&this._swap(a,e),t<r&&this._doHeapify(t),n<r&&this._doHeapify(n)}_getVal(e){return this._valueFn(this._heap[e])}_getParent(e){return e%2==0?(e-2)/2:(e-1)/2}push(e){this._heap.push(e);const t=this._heap.length-1;this._siftUp(t)}pull(){const e=this._heap.shift();return this.heapify(),e}heapify(){this._doHeapify(0)}peek(){return this._heap[0]}}},478102:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(132375));class a{constructor(e){this._children={},this._indices=[],e&&(this._data=e)}static fromBackwardsStrings(e,t){return e.reduce(((e,t,n)=>e.addBackwardsString(t,n)),new a(t))._optimize()}addBackwardsString(e,t){let n=e.length-1,r=this;for(;n>=0;){const i=e.charAt(n);r._addIndex(t),r=r.get(i)||r.set(i,new a),n--}return r._addIndex(t),this}static fromForwardsStrings(e,t){return e.reduce(((e,t,n)=>e.addForwardsString(t,n)),new a(t))._optimize()}addForwardsString(e,t){let n=0,r=this;for(;n<e.length;){const i=e.charAt(n);r._addIndex(t),r=r.get(i)||r.set(i,new a),n++}return r._addIndex(t),this}set(e,t){return this._children[e]=t,t}get(e){return this._children[e]}getChildren(){return Object.keys(this._children).map((e=>({prefix:e,node:(0,i.default)(this.get(e),"this.get(prefix)")})))}hasChildren(){return!function(e){for(const t in e)return!1;return!0}(this._children)}search(e){const t=this._data;if(!t)return[];let n=this;for(let t=0;t<e.length&&n;t++){const r=e[t];n=n.get(r)}if(!n)return[];return n.getIndices().map((e=>t[e]))}_addIndex(e){this._indices.push(e)}getIndices(){const e=this._indices,t=Object.keys(this._children);return 1===t.length&&0===this._indices.length?this._children[t[0]].getIndices():e}_optimize(){if(!this.hasChildren())return this;const e=Object.keys(this._children),t=this._children[e[0]]._indices;return e.forEach((e=>{this._children[e]._optimize()})),1===e.length&&this._indices.length===t.length&&(this._indices=[]),this}testOnlyGetChildrenProperty(){return this._children}testOnlyGetIndicesProperty(){return this._indices}}t.default=a},235670:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;return e.every(((e,n)=>e===t[n]))}},10647:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.defaults=void 0,t.exponentialBackoffIterator=function*(e){const{factor:t,jitter:n,maxTimeout:r,minTimeout:s,retries:l}=(0,i.default)((0,i.default)({},o),e);let u=0;for(const e of(0,a.default)(t)){if(u++,u>l)return;const t=Math.random()*n*2-n+1;yield Math.min(s*e*t,r)}};var i=r(n(73982)),a=r(n(609939));const o={factor:2,jitter:0,maxTimeout:1/0};t.defaults=o},609939:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function*(e){let t=1;for(;;)yield t,t*=e}},408580:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.filterIterator=function*(e,t){let n=0;for(const r of e)t(r,n)&&(yield r),n++},t.first=function(e){for(const t of e)return t;return},t.iteratorFromArray=function*(e){for(const t of e)yield t},t.mapIterator=function*(e,t){let n=0;for(const r of e)yield t(r,n),n++},t.rangeIterator=function*(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(0===n)throw new TypeError("Step can't be zero.");if(n>0){if(e>t)return;for(let r=e;r<t;r+=n)yield r}else{if(e<t)return;for(let r=e;r>t;r+=n)yield r}},t.takeIterator=function*(e,t){if(t<0)throw new TypeError("Count must be a positive integer");let n=0;for(const r of e){if(n>=t)return;yield r,n++}}},677378:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.findLink=A,t.findLinks=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!T.test(e))return[];S.lastIndex=0;const n=[];let r;for(;r=v(e);){const e=C(r,t);e&&n.push(e)}return n},t.validateEmail=function(e){const t=A(e);return!t||t.url!==e||"mailto:"!==t.scheme||null==t.username||""===t.username||null!=t.params&&""!==t.params||null!=t.anchor&&""!==t.anchor?null:t};var i=n(718461),a=r(n(728770));const o=Array.from(i.TLD).join("|"),s=/^https?:\/\/$/gi,l="\\w|[^\\s\0-«»‘’“”]|%[0-9a-f][0-9a-f]",u=`${o}|xn--(?:${l})+`,c=`(?:${l})|(?:${l})(?:${l}|-)*(?:${l})`,d=`(?:${l}|[^\\s%])`,p=`[@!.?,(\\[{<«‘“:]*(?!${d}|#)`,_="0-9a-z!#$%&'*+/=?^_`{|}~\\-",f=`(^|\\W\\.|[^/\\w.]|_)((?:http|https)://|mailto:)?(${`\\b\\w[${_}]*(?:\\.[${_}]+)*`}@)?(${`(?!_)(?:(?:${c})\\.)+(${u})(?!\\.${c})`})(?:(?!${c})|(?=_))(?:(?=[^:/?#])|(:\\d{1,5})?(${`/${d}*?`})?(${`\\?(?!${p})${d}*?`})?(${`#${d}*?`})?(?=${p}))`,h=7,g=8,m=9,y=new Map([[34,34],[41,40],[62,60],[93,91],[125,123],[187,171],[8217,8216],[8221,8220]]),E=new Map([[34,34],[40,41],[60,62],[91,93],[123,125],[171,187],[8216,8217],[8220,8221]]),S=new RegExp(`${f}`,"ig"),T=new RegExp(`\\.(?:${u})`,"i");function v(e){try{return S.exec(e)}catch(t){return __LOG__(4,void 0,new Error,!0)`text size: ${e.length}, error: ${String(t)}`,SEND_LOGS("linkify-regex-error"),null}}function A(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return T.test(e)?(S.lastIndex=0,C(v(e),t)):null}function C(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;const n=e[1].length;let r=e[0];const o=e.index+n,{index:l}=e,u="_"===e[1];if(u&&l-1&&/\S/.test(e.input[l-1]))return null;const c=e[5];if(c&&c.startsWith("xn--")&&!i.TLD.has(a.default.toUnicode(c)))return null;if(e[6]){const t=parseInt(e[6].slice(1),10);if("0"===e[6][1]||!(0<t&&t<65536))return null}const d=[m,g,h].find((t=>e&&e[t]))||0;if(d){const t=[];let i=e[d];"_"===i.slice(-1)&&"_"===r[o-1]&&(r=r.slice(0,-1),e[d]=i=i.slice(0,-1));let a=0,s=0;for(let e=0;e<i.length;e++){const n=i.charCodeAt(e);n===s?(s=t.pop()||0,0===s&&(a=e)):E.has(n)?(0!==s&&t.push(s),s=E.get(n)):y.has(n)||0===s&&(a=e)}if(a!==i.length-1){const t=e.slice(2,d);t.splice(3,1),r=t.filter((e=>e)).join("")+i.slice(0,a+1),S.lastIndex=o+r.length}else r=r.slice(n)}else r=r.slice(n);let p=r,_=e[2];const f=Boolean(_&&_.match(s));if(t&&!f)return null;_?_=_.toLowerCase():(_=0===p.toLowerCase().indexOf("irc.")?"irc://":0===p.toLowerCase().indexOf("ftp.")?"ftp://":e[3]?"mailto:":"http://",p=_+p);const T=e[4];return{href:p,url:r,index:o,input:e.input,scheme:_,username:e[3],domain:T,port:e[6],path:e[h],params:e[g],anchor:e[m],isHttp:f}}},718461:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TLD=void 0;const n=new Set(["abb","abbott","abudhabi","ac","academy","accountants","ad","ads","adult","ae","aero","af","afl","africa","ag","agency","ai","aig","al","am","amsterdam","anz","ao","apartments","app","aq","ar","army","art","as","asia","at","au","auction","audi","audio","auto","autos","aw","aws","ax","axa","az","ba","baby","band","bank","bar","barclays","basketball","bb","bbva","bd","be","beauty","beer","berlin","best","bet","bf","bg","bh","bi","bible","bid","bike","bingo","bio","biz","bj","black","blog","blue","bm","bmw","bn","bnpparibas","bo","bond","bot","boutique","box","br","bradesco","broker","brussels","bs","bt","build","builders","business","buzz","bw","by","bz","bzh","ca","cab","cafe","cam","camera","camp","canon","capital","car","cards","care","career","careers","cars","casa","cash","casino","cat","cc","cd","center","ceo","cern","cf","cfd","cg","ch","chat","cheap","church","ci","city","ck","cl","claims","click","clinic","clothing","cloud","club","cm","cn","co","coach","codes","coffee","com","community","company","condos","consulting","contact","contractors","cool","coop","country","coupons","courses","cpa","cr","credit","cricket","crs","cu","cv","cw","cx","cy","cyou","cz","dance","date","dating","day","de","deals","delivery","dental","dentist","desi","design","dev","dhl","diamonds","diet","digital","direct","directory","discount","dj","dk","dm","do","doctor","dog","domains","download","dvag","dz","earth","ec","eco","edu","education","ee","eg","email","energy","engineer","engineering","equipment","es","estate","et","eu","eus","events","exchange","expert","express","fail","faith","family","fan","fans","farm","fashion","fi","film","finance","financial","fish","fishing","fit","fitness","fj","flights","flowers","fm","fo","football","forex","forum","foundation","fr","frl","fun","fund","futbol","fyi","ga","gal","gallery","game","games","garden","gay","gd","gdn","ge","gent","gg","gh","gi","gift","gifts","gives","gl","glass","gle","global","gm","gmbh","gold","golf","goog","google","gop","gov","gp","gq","gr","graphics","gratis","green","group","gs","gt","guide","guru","gy","hair","hamburg","haus","health","healthcare","help","hk","hn","holdings","holiday","homes","horse","hospital","host","hosting","hot","house","how","hr","ht","hu","icu","id","ie","il","im","immo","in","inc","info","ink","institute","insure","int","international","investments","io","iq","ir","is","ist","istanbul","it","java","je","jewelry","jm","jo","jobs","jp","ke","kg","kh","ki","kim","kitchen","kiwi","kn","kp","kpmg","kpn","kr","krd","kred","kw","ky","kz","la","land","lat","law","lawyer","lb","lc","leclerc","legal","lgbt","li","lidl","life","limited","limo","link","live","lk","llc","loan","loans","lol","london","love","lr","ls","lt","ltd","ltda","lu","luxe","lv","ly","ma","madrid","makeup","management","market","marketing","markets","mba","mc","md","me","media","melbourne","men","menu","mg","miami","mil","mk","ml","mm","mn","mo","mobi","moda","moe","mom","monash","money","monster","mortgage","moscow","movie","mp","mq","mr","ms","mt","mu","museum","mv","mw","mx","my","mz","na","name","navy","nc","ne","net","network","neustar","new","news","nf","ng","ngo","ni","nico","ninja","nl","no","np","nr","nrw","ntt","nu","nyc","nz","observer","om","one","ong","onl","online","ooo","org","ovh","pa","page","paris","partners","parts","party","pay","pe","pet","pf","pg","ph","pharmacy","photo","photography","photos","physio","pics","pictet","pictures","pink","pioneer","pizza","pk","pl","place","plus","pm","pn","poker","porn","post","pr","press","pro","productions","promo","properties","ps","pt","pub","pw","py","qa","quebec","quest","racing","radio","re","realtor","recipes","red","ren","rent","repair","report","rest","restaurant","review","reviews","rio","rip","ro","rocks","rodeo","rs","ru","run","rw","sa","sale","salon","sap","saxo","sb","sbi","sbs","sc","school","science","scot","sd","se","security","services","sex","sexy","sg","sh","sharp","shiksha","shoes","shop","shopping","show","si","site","sk","ski","skin","sky","sl","sm","sn","sncf","so","social","softbank","software","solar","solutions","sony","soy","space","sport","spot","sr","srl","st","statebank","storage","store","stream","studio","study","style","su","sucks","supply","support","surf","sv","swiss","sx","sy","sydney","systems","sz","taipei","tatar","tax","taxi","tc","td","team","tech","technology","tel","tf","tg","th","tickets","tienda","tips","tires","tj","tk","tl","tm","tn","to","today","tokyo","tools","top","tours","town","toyota","toys","tr","trade","trading","training","travel","tt","tube","tv","tw","tz","ua","ug","uk","university","uno","us","uy","uz","va","vc","ve","vegas","ventures","vet","vg","vi","video","vin","vip","vision","vn","vote","voto","vu","wales","wang","watch","webcam","weber","website","wedding","wf","wien","wiki","win","wine","work","works","world","ws","wtf","xin","xyz","yandex","ye","yoga","yokohama","youtube","yt","za","zip","zm","zone","zw","бел","дети","москва","онлайн","орг","рус","рф","сайт","укр","קום","شبكة","भारत","భారత్","移动"]);t.TLD=n},406949:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MemoizeCache=r,t.clearAllMemoizeCache=function(){n.forEach((e=>e.clear()))},t.memoizeWithArgs=function(e,t){let n;return function(){n||(n=r());const i=t(...arguments);let a=n.get(i);return null==a&&(a=e(...arguments),n.set(i,a)),a}};const n=[];function r(){const e=new Map;return n.push(e),e}},957124:(e,t)=>{"use strict";function n(e,t){const r=function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];const o=t?t.apply(this,i):i[0];if(null==o)return e.apply(this,i);const s=r.cache;if(s.has(o))return s.get(o);const l=e.apply(this,i);return r.cache=s.set(o,l)||s,l};return r.cache=new(n.Cache||Map),r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n.Cache=Map;var r=n;t.default=r},437142:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.default,n=null;const r=function(r){return null!=n&&t(n.params,r)?n.params=r:n={params:r,result:e.call(this,r)},n.result};return r.clear=()=>{n=null},r};var i=r(n(871690))},323400:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNonZeroNumber=function(e){return null!=e&&0!==e&&!isNaN(e)}},552747:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n,r){n(t).forEach((t=>e(t,n,r))),r(t)}},185681:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.replace(/_|-/g," ").replace(/[0-9]/g,(e=>e+" ")).replace(/(?:^\w|[A-Z]|\b\w)/g,((e,t)=>0===t?e.toLowerCase():e.toUpperCase())).replace(/\s+/g,"")}},807035:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return/\s\s+/.test(e)?e.replace(/\s\s+/g,(e=>{let n="";for(let r=0;r<e.length;r++){n+=!0===t&&"\n"===e[r]?"\n":" "}return n})):e}},464359:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.replace(/\s+|-+|\/+|\$+/g,"_").replace(/[a-z]+|[0-9]+|(?:[A-Z][a-z]+)|(?:[A-Z]+(?=(?:[A-Z][a-z])|[^AZa-z]|[$\d\n]))/g,((e,t)=>0===t?e:`_${e}`)).replace(/_+/g,"_").toLowerCase()}},599125:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.astralRange=void 0,t.length=function(e){const t=e.match(n);return t?t.length:0},t.substring=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0;const i=e.match(n);if(!i)return"";return i.slice(Math.max(0,t),Math.max(0,r)).join("")},t.toArray=function(e){return e.match(n)||[]};const n=/\ud83c[\udffb-\udfff](?=\ud83c[\udffb-\udfff])|(?:[^\ud800-\udfff][\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]?|[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?)*/g;t.astralRange=n},203910:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.codePointAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e.codePointAt)return e.codePointAt(t);let n=e.charCodeAt(t);if(n>=55296&&n<=56319){const r=e.charCodeAt(t+1);r>=56320&&r<=57343&&(n=65536+(n-55296<<10)+(r-56320))}return n},t.firstNCodepoints=function(e,t){return i(e||"",0,t)},t.firstNEncodedBytes=function(e,t){if(null==t)return e;if(encodeURI(e).length<=t)return e;let n=0;const r=a(e),o=r.length;for(let a=0;a<o;a++){const o=r[a],s=encodeURI(o).length;if(n+s>t)return i(e,0,a);n+=s}return e},t.numCodepoints=function(e){return(0,r.length)(e||"")},t.substring=i,t.toArray=a;var r=n(599125);function i(e,t,n){if(null==e||""===e)return"";const i=t||0,a=null==n?1/0:n;return e.length,0===i&&a===1/0?e:e.length>=5e3&&a/e.length<=.5?function(e,t,n){const i=new RegExp(r.astralRange);let a,o="",s=0;do{a=i.exec(e),a&&(o+=a[0]),s++}while(a&&s<n);return o}(e,0,a):(0,r.substring)(e,i,a)}function a(e,t,n){const i=e||"",a=t||0,o=null==n?1/0:n;return i.length>=5e3&&o/i.length<=.5?function(e,t,n){const i=new RegExp(r.astralRange),a=[];let o;do{o=i.exec(e),o&&a.push(o[0])}while(o&&a.length<n);return a}(i,0,o):(0,r.toArray)(i).slice(a,o)}},854251:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.charAt(0).toUpperCase()+e.slice(1)}},476053:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findSuspiciousCharacters=function(e,t,n,s){const l=e.split(".");let p,_=!1;if(l.forEach((e=>{if(_=!e.match(d),_){if(p)return null;p=e}})),null==p||_)return null;const f=[];let h=!0;const g=(0,i.toArray)(p);for(let e=0;e<g.length;e++){const t=g[e];if(h=h&&c(t),!h&&a[t]){if(f.length>=2)return null;f.push(t)}}if(h)return u(n)||u(t)||s.some((e=>function(e){return o.has(e)}(e)))?null:new Set(g);if(!f.length)return null;const m=f.filter((e=>{const i=a[e];if(null==i)return!1;if(s.some((e=>i.includes(e))))return!1;const o=new Set;for(let e=0;e<i.length;e++){const t=r.LANGUAGE_TO_REGIONS[i[e]];if(null!=t)for(let e=0;e<t.length;e++)o.add(t[e])}return!o.has(n)&&!o.has(t)}));return m.length?new Set(m):null};var r=n(993342),i=n(599125);const a={í:["ast","ksf","bas","ca","cs","dua","nl","ee","ewo","fo","fr","gl","kl","hu","is","ga","dyo","kea","kkj","nmg","lkt","lag","ln","lu","mas","nnh","jgo","pt","qu","seh","sk","es","to","vai","vi","wae","cy","fy","yav","yo"],î:["af","agq","bss","bfd","bas","bkv","btt","nl","igb","ewo","fr","fur","gaj","gby","kl","jab","atg","jbu","kkj","naq","ksh","ku","nmb","lmp","ln","mda","mg","mas","mzm","jgo","nin","ann","ro","sg","scn","srn","yer","tr","wa","cy","yav","yle"],ü:["agg","ast","az","br","ca","co","cs","nl","etr","et","fr","gl","de","tof","god","hu","tbd","geb","ksh","kup","nds","lb","arn","oc","sg","sk","es","gsw","dts","tr","tk","vo","wa","wae","fy","yll"],ċ:["mt"],ī:["agq","bss","bfd","bas","bkv","btt","ddn","igb","kjy","ich","gux","haw","jab","iby","idu","jbu","kub","nmg","lv","mda","mi","mas","mql","nin","prg","gd","to","yba","yav"],ı:["az","crh","tr"],ļ:["lv"],ł:["dsb","nv","pl","hsb"],š:["bs","hr","cs","dzg","et","fi","smn","geb","khq","ses","kun","lkt","lv","lt","dsb","se","nso","prg","sr","sh","sms","sk","sl","taq","twq","tuq","hsb","wqe","dje"],ƙ:["ckl","ank","ha","ikx","kai","hia","mbu","anc","nin","pip","tal","tan","wja","wji"],ǀ:["naq"],ǁ:["naq"],ȯ:["liv"],ɑ:["fmp","dud","tmh"],ɓ:["fub","yay","bkc","bjt","bcn","bas","bsq","bmq","fue","bys","bwr","cky","fuq","ckl","asg","dbq","dnj","dgh","dow","dua","enn","ff","gby","gba","gmm","ank","gde","gkp","jgk","ha","hbb","ikx","kkj","hig","kzr","kai","kpe","nmg","hia","ffm","mbo","mbu","mif","mzm","mua","sur","anc","fuv","nin","dgi","pbi","pip","fuf","cla","sav","srr","sld","sok","tal","tan","yer","ttr","tik","kdl","tsw","vai","vut","wja","wji","fuh","gnd"],ḍ:["tzm","kab","okr","shi","tmh","taq"],ṛ:["tzm","kab","shi"],ṭ:["tzm","kab","shi","tmh","taq"],ẉ:[],ạ:["izi","yaz","blt","vi"],ẹ:["yay","bom","bin","mfn","dzg","igb","enn","gkn","iby","ikk","ikw","izi","okr","yaz","blt","tan","tuq","vi","yo"],ị:["avu","mfn","igb","enn","iby","ig","ige","ikk","ikw","izi","okr","blt","tan","vi"]},o=new Set(["abq","ab","ady","av","az","ba","be","bs","bg","bua","ce","ckt","cu","cv","crh","dar","dng","myv","evn","gag","inh","kbd","xal","krc","kaa","kk","kjh","kca","ky","kv","koi","kpy","kum","lbe","lez","mk","mns","chm","mdf","mn","ttt","gld","yrk","nog","os","ru","rue","sr","sh","cjs","alt","tab","tg","tt","tkr","tk","tyv","ude","udm","uk","uz","mrj","sah"]),s=new Set(["374","994","375","387","359","995","7","383","996","389","373","976","382","381","992","993","380","998"]),l="авгекмнорстухшщьѕіјѡѵүһӏԁԛԝԧꚙ";function u(e){return s.has(e)}function c(e){return l.includes(e)}const d=new RegExp("^[a-z0-9-]+$")},993342:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LANGUAGE_TO_REGIONS=void 0;t.LANGUAGE_TO_REGIONS={fub:["237","235","234"],af:["237","27"],agq:["237"],yay:["234"],bss:["237"],agg:["675"],ast:["34"],avu:["243","211"],az:["994"],bkc:["237","241"],ksf:["237"],bfd:["237"],bjt:["221"],bcn:["234"],bas:["237"],bsq:["231"],bkv:["234"],bom:["234"],btt:["234"],bin:["234"],bmq:["226","223"],bs:["387","385","383","382","381"],fue:["229","228"],br:["33"],bys:["234"],bwr:["234"],cky:["234"],ca:["376","33","39","34"],tzm:["212"],fuq:["234"],ckl:["234"],asg:["234"],co:["33","39"],crh:["7"],hr:["387","385","383","382","381"],mfn:["234"],cs:["420","421"],dbq:["237","234"],dnj:["225","231"],dzg:["235","227"],ddn:["229"],dgh:["234"],dow:["237"],dua:["229"],nl:["297","32","599","31","1","597"],igb:["234"],etr:["675"],enn:["234"],kgy:["675"],et:["372"],ich:["234"],ee:["229","233","228"],ewo:["237"],fo:["298"],fmp:["237"],fi:["358","46"],fr:["32","229","226","257","237","1","236","242","243","235","269","253","240","33","241","509","225","352","261","223","377","227","250","221","248","41","228","678"],fur:["39"],ff:["237","224","222","221"],gaj:["675"],gl:["34"],gby:["234"],gba:["236"],gmm:["237"],de:["43","32","49","423","352","41"],tof:["675"],god:["225"],ank:["234"],gkn:["234"],gux:["229","226","227","228"],gde:["237","234"],gkp:["224"],kl:["299"],jgk:["234"],ha:["229","237","235","233","225","227","234","249","228"],haw:["1"],hbb:["234"],hu:["36"],dud:["234"],jab:["234"],iby:["234"],is:["354"],idu:["234"],ig:["240"],ige:["234"],ikx:["256"],ikk:["234"],ikq:["234"],smn:["358"],ga:["353","44"],atg:["234"],izi:["234"],dyo:["220","221"],jbu:["237","234"],kab:["213"],kea:["238"],tbd:["675"],hig:["234"],kai:["234"],kkj:["237","236","242"],kzr:["237","235"],naq:["264"],geb:["675"],okr:["234"],ksh:["49"],ses:["223"],khq:["223"],kun:["291","251"],kup:["675"],kub:["237","234"],kpe:["224","231"],nmg:["237","240"],ku:["963","90"],lkt:["1"],hia:["234"],lag:["255"],lv:["371"],lmp:["237"],ln:["242","243"],liv:[],lt:["370"],yaz:["234"],nds:["55","49","31"],dsb:["49"],lu:["243"],lb:["32","33","49","352"],mda:["234"],mb:["261"],mt:["356"],mi:["64"],arn:["56"],mas:["254","255"],ffm:["223"],mql:["229","228"],mbo:["237"],mbu:["234"],mif:["237"],mzm:["234"],mua:["237","235"],sur:["234"],nv:["1"],anc:["234"],nnh:["237"],jgo:["237"],fuv:["237","234"],nin:["234"],dgi:["226"],se:["358","46","47"],nso:["27"],ann:["234"],oc:["33","39","377","34"],pbi:["237"],pip:["234"],pl:["48"],pt:["244","55","238","240","245","853","258","351","239","670"],prg:[],fuf:["224","223","221","232"],qu:["54","591","57","593","51"],ro:["373","40"],cla:["234"],sav:["221"],sg:["236","235","243"],gd:["44"],seh:["258"],sr:["387","385","383","382","381"],sh:["387","385","383","382","381"],srr:["220","221"],sch:["39"],sld:["226"],sms:["358"],sk:["420","421"],sl:["386"],sok:["235"],es:["54","501","591","56","57","506","53","593","503","240","502","504","52","505","507","595","51","34","1","598","58"],srn:["597"],gsw:["43","33","49","423","41"],shi:["212"],tal:["234"],tmh:["223"],taq:["226","223"],tan:["234"],twq:["227"],blt:["856","84"],yer:["234"],tuq:["235","218","227","234"],ttr:["234"],tik:["237"],to:["676"],dts:["223"],kdl:["234"],tsw:["234"],tr:["90"],tk:["993"],hsb:["49"],vai:["231","232"],vi:["855","84"],vo:[],vut:["237","234"],wja:["234"],wa:["32"],wae:["43","39","423","41"],wji:["234"],cy:["44"],fy:["31"],fuh:["229","226","227"],yba:["234"],yav:["237"],yle:["675"],yll:["675"],yo:["229","234"],dje:["227"],gnd:["237"]}},974637:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findSuspiciousCharacters=function(e,t,n,s){const l=e.match(o),u=l&&l[1];if(null==u)return null;const c=(0,a.phoneCC)(n);let d;if("whatsapp"===t)d="";else{const e=(0,i.interpretAndValidateJid)(t.toString());d="lidUser"!==e.jidType?(0,a.phoneCC)((0,i.toPhoneUserJid)(t)):"ZZ"}const p=s.map((e=>e.toLowerCase()));return(0,r.findSuspiciousCharacters)(u,d,c,p)};var r=n(476053),i=n(616310),a=n(8525);const o=/^(?:https?:\/\/)?([^/?#]+)(?:[/?#]|$)/i},802792:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.ParsableXmlNode=void 0,t.convertBytesToUint=o;var i=r(n(836821)),a=n(742422);function o(e,t){let n=0;for(let r=0;r<t;r++)n=256*n+e[r];return n}t.ParsableXmlNode=class{constructor(e,t){this._name=e,this._node=t,this._children=Array.isArray(t.content)?t.content.map((t=>new this.constructor(e,t))):null}name(){return this._name}node(){return this._node}hasAttr(e){return(0,i.default)(this._node.attrs,e)}assertTag(e){this._node.tag!==e&&this.throw(`to be <${e}>`)}tag(){return this._node.tag}maybeChild(e){const t=this._children;if(!t)return null;for(let n=0;n<t.length;n++)if(t[n].tag()===e)return t[n];return null}hasChild(e){return!!this.maybeChild(e)}child(e){const t=this.maybeChild(e);return t||this.throw(`to have child <${e}>`)}assertAttr(e,t){const n=this.attrString(e);n!==t&&this.throw(`to have "${e}"="${t}", but instead has "${n}"`)}attrString(e){return(0,i.default)(this._node.attrs,e)?this.decodeAsString(this._node.attrs[e]):this.throw(`to have attribute "${e}"`)}forEachAttributeKey(e){const t=this._node.attrs;Object.keys(t).forEach((t=>e(t)))}maybeAttrString(e){return this.hasAttr(e)?this.decodeAsString(this._node.attrs[e]):null}maybeAttrInt(e,t,n){return this.hasAttr(e)?this.attrInt(e,t,n):null}attrEnumValues(e,t,n){const r=new Set(t),i=this.attrString(e);if(!r.has(i)){if(null!=n)return n;const t=Array.from(r).join("|");return this.throw(`to have "${e}"={${t}} but has value "${i}"`)}return i}attrEnum(e,t){const n=this.attrString(e);if(!(0,i.default)(t,n)){const r=Object.keys(t).join("|");return this.throw(`to have "${e}"={${r}} but has value "${n}"`)}return t[n]}attrEnumOrNullIfUnknown(e,t){const n=this.attrString(e);return(0,i.default)(t,n)?t[n]:null}attrEnumOrDefault(e,t,n){return this.hasAttr(e)?this.attrEnum(e,t):n}attrInt(e,t,n){const r=this.attrString(e);return this._parseInt(r,e,t,n)}_parseInt(e,t,n,r){const i=parseInt(e,10);return Number.isNaN(i)?this.throw(`to have "${t}"={integer} but has value "${e}"`):void 0!==n&&i<n?this.throw(`to have "${t}"={at least ${n}} but has value ${i}`):void 0!==r&&i>=r?this.throw(`to have "${t}"={below ${r}} but has value ${i}`):i}forEachChild(e){const t=this._children;if(t)t.forEach((t=>e(t)));else if(null!=this._node.content)return this.throw("to have children")}forEachChildWithTag(e,t){this.forEachChild((n=>{n.tag()===e&&t(n)}))}mapChildren(e){const t=this._children;return t||null==this._node.content?t?t.map((t=>e(t))):[]:this.throw("to have children")}mapChildrenWithTag(e,t){const n=this._children;return n||null==this._node.content?n?n.filter((t=>t.tag()===e)).map((e=>t(e))):[]:this.throw("to have children")}mapFirstChild(e){const t=this._children;return t&&0!==t.length?e(t[0]):this.throw("to have children")}hasContent(){return!this._children&&!!this._node.content}hasChildren(){return null!=this._children}getChildren(){return this._children}mapAttrKeys(e){const t=this.getAttrKeys();return t&&t.length?t.map(e):[]}getAttrKeys(){return Object.keys(this._node.attrs)}hasAttrs(){return(this._node.attrs?Object.keys(this._node.attrs):[]).length>0}getNode(){return this._node}unsafeSetChildren(e){this._children=e}unsafeSetNodeContent(e){this._node.content=e}contentUint(e){return o(this.contentBytes(e),e)}contentBytes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(this._children)return this.throw("to have binary content, but has children instead");if(null!=this._node.content){const t=this._node.content;return-1!==e&&t.length!==e?this.throw(`to be ${e} bytes, but got ${t.length} instead`):t}return this.throw("to have content")}contentString(){return this._children?this.throw("to have string content, but has children instead"):null!=this._node.content?this._node.content:this.throw("to have content")}contentInt(e,t){const n=this.contentString();return this._parseInt(n,"content",e,t)}contentEnum(e){const t=this.contentString();if(!(0,i.default)(e,t)){const n=Object.keys(e).join("|");return this.throw(`to have content {${n}} but has value "${t}"`)}return e[t]}decodeAsString(e){if("string"!=typeof e)throw new Error(`decodeAsString: attribute is ${typeof e} not a string: ${e}`);return e}throw(e){throw new a.XmlParsingFailure(this._name,`expected <${this._node.tag}> ${e}`)}toString(){return this._node.toString()}}},301506:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=e.replace(/>\s{0,}</g,"><").replace(/</g,"~::~<").replace(/\s*xmlns:/g,"~::~xmlns:").replace(/\s*xmlns=/g,"~::~xmlns=").split("~::~"),n=t.length;let r=!1,i=0,a="",o=0;const s=["\n"];for(o=0;o<100;o++)s.push(s[o]+" ");const l=function(e,t){const n=/^<[\w:\-.,]+/.exec(e[t-1]),r=/^<\/[\w:\-.,]+/.exec(e[t]);return null!=n&&null!=r&&n[0]===r[0]};for(o=0;o<n;o++)t[o].search(/<!/)>-1?(a+=s[i]+t[o],r=!0,(t[o].search(/-->/)>-1||t[o].search(/\]>/)>-1||t[o].search(/!DOCTYPE/)>-1)&&(r=!1)):t[o].search(/-->/)>-1||t[o].search(/\]>/)>-1?(a+=t[o],r=!1):l(t,o)?(a+=t[o],r||i--):t[o].search(/<\w/)>-1&&-1===t[o].search(/<\//)&&-1===t[o].search(/\/>/)?a=a+=r?t[o]:s[i++]+t[o]:t[o].search(/<\w/)>-1&&t[o].search(/<\//)>-1?a=a+=r?t[o]:s[i]+t[o]:t[o].search(/<\//)>-1?a=a+=r?t[o]:s[--i]+t[o]:t[o].search(/\/>/)>-1?a=a+=r?t[o]:s[i]+t[o]:t[o].search(/<\?/)>-1||t[o].search(/xmlns:/)>-1||t[o].search(/xmlns=/)>-1?a+=s[i]+t[o]:a+=t[o];return"\n"===a[0]?a.slice(1):a}},838448:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XmlNode=void 0,t.attrsToString=a,t.uint8ArrayToDebugString=o;var r=n(710038);const i={};function a(e){const t=Object.keys(e);let n="";for(let r=0;r<t.length;r++){const i=t[r];n+=` ${i}="${e[i].toString()}"`}return n}function o(e){let t="";return t=0===e.length?"\x3c!-- empty binary --\x3e":e.length<50?(0,r.bytesToDebugString)(e):`\x3c!-- ${e.length} bytes --\x3e`,t}t.XmlNode=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;this.tag=e,this.attrs=t,this.content=n}toString(){let e="<"+this.tag;e+=a(this.attrs);const t=this.content;return Array.isArray(t)?e+=`>${t.map(String).join("")}</${this.tag}>`:t instanceof Uint8Array?e+=`>${o(t)}</${this.tag}>`:e+=null!=t?`>${String(t)}</${this.tag}>`:" />",e}}},742422:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.XmlParsingFailure=void 0;t.XmlParsingFailure=class{constructor(e,t){this.parser=e,this.reason=t}toString(){return`XmlParsingFailure: ${this.parser}: ${this.reason}`}}},623616:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Wam=t.PRIVATE_STATS_DEFAULT_PS_ID_KEY_HASH_INT=void 0;var r=n(476809),i=n(201063),a=n(769737);t.PRIVATE_STATS_DEFAULT_PS_ID_KEY_HASH_INT=113760892;const o={putBuffer:()=>Promise.resolve()};t.Wam=class{constructor(e){this._pending=[],this._globals=new Map,this._initialized=!1,this._buffers=new Map,this._streamId=-1,this._sink=o,this._getNextSequenceNumber=null,this.deinitialize=()=>{this._initialized=!1,this._pending=[],this._globals.clear(),this._buffers=new Map,this._streamId=-1,this._sink=o,this.serializePending.cancel(),this.finalizeBuffers.cancel()},this.enqueueEvent=(e,t,n,r,i,a)=>{this._pending.push({type:1,id:e,commitTime:t,psIdIntValue:n,weight:i,fields:r,resolve:a}),this._initialized&&this.serializePending.onOrBefore(3e3)},this.enqueueAttributesUpdate=e=>{const t={type:2,delta:[]};e.forEach(((e,n)=>{void 0!==e&&t.delta.push([n,e])})),t.delta.length>0&&(__LOG__(2)`WAM: Enqueued ${t.delta.length} attribute keys for update`,this._pending.push(t))},this.finalizeBuffers=new i.ShiftTimer((()=>{this._finalizeBuffers()})),this.serializePending=new i.ShiftTimer((()=>{this._serializePending()})),this.forceSerializePending=()=>{this._initialized&&this._hasPendingEvents()&&this.serializePending.forceRunNow()},this._channel=e}initialize(e,t,n,r){if(this._initialized)return __LOG__(4,void 0,new Error,!0)`WAM: Failed to initialize already initialized WAM`,void SEND_LOGS("wam-initialize");this._options=r,this._streamId=e,this._sink=n,this._getNextSequenceNumber=t,this._hasPendingEvents()&&this.serializePending.forceRunNow(),this._initialized=!0,__LOG__(2)`WAM: Initialized with stream id ${this._streamId}`}_finalizeBuffers(){this._buffers.forEach((e=>{e.finalize()})),this._buffers.size>0&&this.serializePending.onOrBefore(3e3)}_getKeyHashIntForSequence(e){var t;return(null===(t=this._options)||void 0===t?void 0:t.multipleSequences)?0===e?"null-psid":e:"regular"}_maybeCreateNewBuffer(e){let t=this._buffers.get(e);if(t)return t;const n=this._getKeyHashIntForSequence(e);if(null==this._getNextSequenceNumber)return __LOG__(4,void 0,new Error,!0)`WAM: Sequence number generator not initialised for channel ${this._channel}`,void SEND_LOGS("wam-serializePending");const r=this._getNextSequenceNumber(n);if(t=new a.WamBuffer(this._channel,this._streamId,r,this._globals),this._buffers.set(e,t),"regular"!==e)if(null==this._privateStatsIds)__LOG__(4,void 0,new Error,!0)`WAM: Tried to create a private buffer without setting private stats ids`,SEND_LOGS("wam-serializePending");else{const n=0===e?"none":this._privateStatsIds.get(e);null==n?(__LOG__(4,void 0,new Error,!0)`WAM: Tried to create a private buffer without setting private stats id`,SEND_LOGS("wam-serializePending")):t.writeGlobal(6005,n)}return t}_serializePending(){const e=[];this.finalizeBuffers.onOrBefore(3e5);const t=new Map;let n=-1;this._pending.forEach(((r,i)=>{if(1===r.type){let o=!0;t.forEach((e=>{(0,a.canWriteGlobal)(e)||(o=!1)}));const s=(0,a.canWriteEvent)(r.fields);if(s&&o){let e;"regular"===this._channel?e=this._maybeCreateNewBuffer("regular"):(this._channel,null==r.psIdIntValue?(__LOG__(4,void 0,new Error,!0)`A WAM event in channel private was dropped before serialization. Reason: missing psIdIntValue in the event payload`,SEND_LOGS("wam-serializePending")):e=this._maybeCreateNewBuffer(r.psIdIntValue)),null!=e&&(t.forEach(((e,t)=>{const n=this._globals.get(t);void 0!==n&&n===e||(this._buffers.forEach((n=>n.writeGlobal(t,e))),this._globals.set(t,e))})),t.clear(),e.writeEvent(r.commitTime,r.id,r.fields,r.weight))}else __LOG__(3)`A WAM event in channel ${this._channel} was dropped before serialization. Event correct: ${s}, pending attributes correct: ${o}`;null!=r.resolve&&e.push(r.resolve),n=i}else{r.type;for(let e=0;e<r.delta.length;++e){const[n,i]=r.delta[e];t.set(n,i)}}}));let i=!1;this._buffers.forEach((e=>{(e.isFinalized()||e.getSize()>65536)&&(i=!0)}));const o=[];this._buffers.forEach(((e,t)=>{e.hasEvents()?o.push([e.getKey(),e.peek(),this._getKeyHashIntForSequence(t)]):__LOG__(3)`Skipping putting buffer to sink, as it does not contain any events`}));const s=(0,r.promiseEach)(o,(e=>{let[t,n,r]=e;return this._sink.putBuffer(t,n,i,r)})).then((()=>{e.forEach((e=>{e()}))}));return this._pending=this._pending.slice(n+1),i&&(this._buffers=new Map,this.finalizeBuffers.cancel()),s}_hasPendingEvents(){return this._pending.length>0&&this._pending.some((e=>1===e.type))}isInitialized(){return this._initialized}updatePrivateStatsIds(e){if("private"!==this._channel)return __LOG__(4,void 0,new Error,!0)`WAM: Tried to set private stats ids on a non-private channel`,void SEND_LOGS("wam-updatePrivateStatsIds");this._privateStatsIds=e}}},769737:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WamBuffer=void 0,t.canWriteEvent=function(e){const t=u(e);for(let n=0;n<=t;n+=3){const t=e[n+2];if(null!=t){if(e[n+1]===i.TYPES.INT&&isNaN(t))return!1}}return!0},t.canWriteGlobal=function(e){if("number"==typeof e)return!isNaN(e);return!0};var r=n(551168),i=n(612089);function a(e,t,n,r){0===r?l(e,t,16|n):1===r?l(e,t,32|n):-128<=r&&r<128?(l(e,t,48|n),e.writeInt8(r)):-32768<=r&&r<32768?(l(e,t,64|n),e.writeInt16(r)):-2147483648<=r&&r<2147483648?(l(e,t,80|n),e.writeInt32(r)):(l(e,t,96|n),e.writeInt64(r))}function o(e,t,n,r){l(e,t,112|n),e.writeFloat64(r)}function s(e,t,n,i){const a=(0,r.numUtf8Bytes)(i);a<256?(l(e,t,128|n),e.writeUint8(a)):a<65536?(l(e,t,144|n),e.writeUint16(a)):(l(e,t,160|n),e.writeUint32(a)),e.writeString(i)}function l(e,t,n){t<256?(e.writeUint8(n),e.writeUint8(t)):(e.writeUint8(8|n),e.writeUint16(t))}function u(e){let t=-1;for(let n=0;n<e.length;n+=3)null!=e[n+2]&&(t=n);return t}t.WamBuffer=class{constructor(e,t,n,i){this._finalized=!1,this._hasEvents=!1;const a=new r.Binary(void 0,!0);switch(a.writeString("WAM"),a.writeUint8(5),a.writeUint8(t),a.writeUint16(n),e){case"regular":a.writeUint8(0);break;default:a.writeUint8(2)}this._channel=e,this._buffer=a,this._sequenceNumber=n,this._streamId=t,i.forEach(((e,t)=>{this.writeGlobal(t,e)}))}writeGlobal(e,t){if(null!=t)if("string"==typeof t)s(this._buffer,e,0,t);else if("number"==typeof t)a(this._buffer,e,0,t);else{if("boolean"!=typeof t)throw new Error("Incorrect value type "+typeof t);a(this._buffer,e,0,t?1:0)}else l(this._buffer,e,0)}writeEvent(e,t,n,r){const l=this._buffer;a(l,47,0,Math.floor(e/1e3));const c=u(n);a(l,t,-1===c?5:1,r);for(let e=0;e<=c;e+=3){const t=n[e+2];if(null!=t){const r=n[e],u=n[e+1],d=e===c?6:2;u===i.TYPES.INT?a(l,r,d,t):u===i.TYPES.BOOL?a(l,r,d,t?1:0):u===i.TYPES.STRING?s(l,r,d,t):o(l,r,d,t)}}this._hasEvents=!0}getKey(){return{streamId:this._streamId,sequenceNumber:this._sequenceNumber,channel:this._channel}}getSize(){return this._buffer.size()}peek(){return this._buffer.peek((e=>e.readByteArray()))}isFinalized(){return this._finalized}finalize(){this._finalized=!0}hasEvents(){return this._hasEvents}}},344428:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.closeChannelManager=function(){null!=r&&r.close()},t.getChannelManager=function(){null==r&&(r=new n);return r};class n{constructor(){this._sinkIsBusy=new Map,this._initializedChannel=new Map}getChannelInitialized(e){return this._initializedChannel.get(e)||!1}setChannelInitialized(e){this._initializedChannel.set(e,!0)}isSinkBusy(e){return this._sinkIsBusy.get(e)||!1}setSinkBusy(e,t){this._sinkIsBusy.set(e,t)}close(){this._sinkIsBusy.forEach(((e,t)=>{this._sinkIsBusy.set(t,!1)})),this._initializedChannel.forEach(((e,t)=>{this._initializedChannel.set(t,!1)}))}}let r},478793:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deinitializeWAM=function(){s().deinitialize()},t.enableDebugMode=function(){a=!0},t.forceFlushBuffers=function(){s().forceFlushBuffers()},t.initializeWAM=function(e,t,n,r,i){s().initialize(n,e,t,r,i)},t.log=function(e,t,n,r,a){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;const l=Date.now();s().enqueueEvent(e,t,l,n,(0,i.appendRawFields)(r,a),o)},t.logAsync=function(e,t,n,r,a){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1;const l=Date.now();return new Promise((u=>{s().enqueueEvent(e,t,l,n,(0,i.appendRawFields)(r,a),o,u)}))},t.logAttributes=function(e,t){const n=(0,i.getDeltaFromAttributes)(e);if(null==n)return;const{deltaRegular:r,deltaPrivate:a}=n;r.size>0&&s().enqueueAttributesUpdate("regular",r);a.size>0&&s().enqueueAttributesUpdate("private",a)},t.rotateBuffers=function(){s().rotateBuffers()},t.updatePrivateStatsIds=function(e){s().updatePrivateStatsIds(e)};var r=n(544550),i=n(741133);let a=!1,o=null;function s(){return o||(o=new r.WamManager),o}},544550:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WamManager=void 0;var r=n(623616);class i{constructor(e){this._sequenceNumbers=new Map,this._options=e}_setSequenceNumber(e,t){null==t||0===t||t<0?this._sequenceNumbers.set(e,"uninitialized"):this._sequenceNumbers.set(e,t)}initializeForChannel(e,t){t.forEach(((t,n)=>{var r;if("regular"===e&&"regular"===n)this._setSequenceNumber(n,t);else if("private"===e&&"regular"!==n)this._setSequenceNumber(n,t);else if("private"!==e||(null===(r=this._options)||void 0===r?void 0:r.multipleSequences)){var i;__LOG__(4,void 0,new Error)`SequenceNumberGenerator::initializeForChannel: Incorrect combination of parameters: ${e} ${n} ${null===(i=this._options)||void 0===i?void 0:i.multipleSequences}`}else this._setSequenceNumber(n,t)}))}next(e){const t=this._sequenceNumbers.get(e);let n;return null==t||"uninitialized"===t?n=1:(n=t+1,n>65535&&(n=1)),this._sequenceNumbers.set(e,n),n}}t.WamManager=class{constructor(){this._wamInstances=new Map,this._sequenceNumberGenerator=null}getWamInstance(e){let t=this._wamInstances.get(e);return t||(t=new r.Wam(e),this._wamInstances.set(e,t)),t}initialize(e,t,n,r,a){const o=this.getWamInstance(e);if(o.isInitialized())return void __LOG__(3)`WAM instance for channel ${e} has already been initialized`;null==this._sequenceNumberGenerator&&(this._sequenceNumberGenerator=new i(a));const s=this._sequenceNumberGenerator;this._sequenceNumberGenerator.initializeForChannel(e,n),o.initialize(t,(e=>s.next(e)),r,a)}deinitialize(){this._wamInstances.forEach(((e,t)=>{e.isInitialized()&&(__LOG__(2)`WamManager: Deinitializing WAM Channel ${t}`,e.deinitialize())})),this._sequenceNumberGenerator=null}enqueueEvent(e,t,n,r,i,a,o){this.getWamInstance(e).enqueueEvent(t,n,r,i,a,o)}enqueueAttributesUpdate(e,t){this.getWamInstance(e).enqueueAttributesUpdate(t)}updatePrivateStatsIds(e){this.getWamInstance("private").updatePrivateStatsIds(e)}forceFlushBuffers(){this._wamInstances.forEach((e=>{e.forceSerializePending()}))}rotateBuffers(){this._wamInstances.forEach((e=>{e.finalizeBuffers.forceRunNow()}))}}},20447:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.blindToken=function(e,t){return(0,r.runInAllocationScope)((()=>{const n=(0,r.p3Element)(),o=(0,r.allocate)(Uint8Array,32);o.set(t),a(o),i.lowlevel.scalarbase(n,o);const s=(0,r.hashToPoint)(e);(0,i.lowlevel.add)(s,n);const l=new Uint8Array(32);return(0,r.pack)(l,s),l}))},t.unblindToken=function(e,t,n){return(0,r.runInAllocationScope)((()=>{const o=(0,r.p3Element)();if((0,r.unpack)(o,e))return null;const s=(0,r.p3Element)();if(0!==(0,r.unpackneg)(s,n))return null;const l=(0,r.allocate)(Uint8Array,32);l.set(t),a(l);const u=(0,r.p3Element)();i.lowlevel.scalarmult(u,s,l);(0,i.lowlevel.add)(o,u);const c=new Uint8Array(32);return(0,r.pack)(c,o),c}))};var r=n(855068),i=n(903190);function a(e){e[0]&=248,e[31]&=127,e[31]|=64}},738304:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.closeWamStorage=function(){(0,a.deinitializeWAM)(),(0,i.closeChannelManager)(),l=null,s=null},t.getFinishedStreamBuffers=function(e){return u("getFinishedStreamBuffers").getBuffers().then((t=>(0,o.getFinishedBuffers)(e,t)))},t.initializeWAMSink=function(e,t,n,r){const l=u("initializeWAMSink"),c=(0,i.getChannelManager)();if(c.getChannelInitialized(t))return Promise.resolve();c.setChannelInitialized(t);const d=l.getStreamId(e),p={putBuffer(e,r,i,a){if(c.isSinkBusy(t))return __LOG__(3)`WamStorage: Sink flush did not happen within timeout, buffer is not saved`,Promise.resolve();c.setSinkBusy(t,!0);const{bufferKey:s,meta:u,bufferRow:p}=(0,o.asBufferEntry)(e,t,d,r,i);return l.saveBuffer(u,p,a).then((()=>{const t=[e.streamId,e.sequenceNumber];__LOG__(2)`WamStorage: Successfully put buffer ${t} to sink`,i&&(n(),__LOG__(2)`WamStorage: Buffer ${s} is scheduled for send`)})).finally((()=>{c.setSinkBusy(t,!1)}))}};null==s&&(s=l.finishBuffer(d));return s.then((()=>{if(l.getStartingSequenceNumbers)return l.getStartingSequenceRow,l.getStartingSequenceNumbers(t,d);if(l.getStartingSequenceRow,null==r?void 0:r.multipleSequences)throw new Error("getStartingSequenceRow must not used when enabling support for multiple sequences");return l.getStartingSequenceRow(d).then((e=>{const t=(0,o.getSequenceNumber)(e),n=new Map;return n.set("regular",t),n}))})).then((e=>{(0,a.initializeWAM)(d,e,t,p,r),"private"===t&&l.updatePrivateStatsIds&&l.updatePrivateStatsIds().then(a.updatePrivateStatsIds)}))},t.nukeMetrics=function(){return u("nukeMetrics").nukeMetrics()},t.privateStatsKillSwitchGetBlockedToken=function(){const e=u("privateStatsKillSwitchGetBlockedToken");if(!e.privateStatsKillSwitchGetBlockedToken)throw new Error("privateStatsKillSwitchGetBlockedToken not implemented for WAM DB");return e.privateStatsKillSwitchGetBlockedToken()},t.privateStatsKillSwitchSet=function(e){const t=u("privateStatsKillSwitchSet");if(!t.privateStatsKillSwitchSet)throw new Error("privateStatsKillSwitchSet not implemented for WAM DB");return t.privateStatsKillSwitchSet(e)},t.redeemPrivateStatsToken=function(){const e=u("getPrivateStatsToken");if(!e.redeemPrivateStatsToken)throw new Error("redeemPrivateStatsToken not implemented for WAM DB");return e.redeemPrivateStatsToken(d)},t.removeBufferByKey=function(e){return u("removeBufferByKey").removeBufferByKey(e)},t.savePrivateStatsToken=function(e){const t=u("savePrivateStatsToken");if(!t.savePrivateStatsToken)throw new Error("savePrivateStatsToken not implemented for WAM DB");return t.savePrivateStatsToken(e)},t.startWamStorage=function(e){null==l?l=e:(__LOG__(3,void 0,void 0,!0)`startWamStorage: called again`,SEND_LOGS("startWamStorage"))};var r=n(990445),i=n(344428),a=n(478793),o=n(741133);let s=null,l=null;function u(e){if(l)return l;throw new Error(`WamStorage::${e} called before startWamStorage`)}const c=r.DAY_SECONDS,d=(e,t)=>{const n={maxRedeemCount:null!=(null==t?void 0:t.maxRedeemCount)&&0!==t.maxRedeemCount?t.maxRedeemCount:64,maxExpirySeconds:null!=(null==t?void 0:t.maxExpirySeconds)&&0!==t.maxExpirySeconds?t.maxExpirySeconds:c};return(0,r.happenedWithin)(e.creationTs,n.maxExpirySeconds)?!(e.redeemCount>=n.maxRedeemCount)||(__LOG__(2)`The private stats token was redeemed maximum number of time. The client shall re-issue a new one`,!1):(__LOG__(2)`The private stats token expired. The client shall re-issue a new one`,!1)}},612089:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TYPES=void 0;t.TYPES={INT:0,BOOL:1,STRING:2,FLOAT:3}},741133:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.appendRawFields=function(e,t){if(null==t||0===t.length)return e;const n=new Map;for(let t=0;t<e.length;t+=3){const r=e[t];n.set(r,t)}for(let r=0;r<t.length;++r){const[i,o,s]=t[r];if(null==s)continue;const l=n.get(i);if(null!=l){if(void 0!==e[l+2])continue}a[o]===typeof s&&(null==l?(n.set(i,e.length),e.push(i,o,s)):e[l+2]=s)}return e},t.asBufferEntry=function(e,t,n,i,a){const o=function(e){return JSON.stringify([e.streamId,e.sequenceNumber,e.channel])}(e);return{bufferKey:o,meta:{streamId:e.streamId,sequenceNumber:e.sequenceNumber},bufferRow:{key:o,channel:t,streamId:n,buffer:(0,r.encodeB64)(i),finished:a}}},t.getDeltaFromAttributes=function(e){const t=new Map,n=new Map;for(let r=0;r<e.length;r+=4){const a=e[r],o=e[r+1],s=e[r+2],l=e[r+3];if(s===i.TYPES.FLOAT)throw new Error("Float attributes are currently not supported in runtime");if(!Array.isArray(a))return __LOG__(4,void 0,new Error,!0)`logAttributes WAM channel is not an array`,void SEND_LOGS("wam-log-attributes");a.includes("regular")&&t.set(o,l),a.includes("private")&&n.set(o,l)}return{deltaRegular:t,deltaPrivate:n}},t.getFinishedBuffers=function(e,t){const n=[];return t.forEach((t=>{const{channel:i}=t;if(null==i){if("regular"!==e)return}else if(i!==e)return;if(t.finished){const e=new Uint8Array((0,r.decodeB64)(t.buffer)),i=t.key;n.push({key:i,content:e})}})),n},t.getSequenceNumber=function(e){let t=null;e&&(t=e.sequenceNumber);return t};var r=n(417405),i=n(612089);const a={[i.TYPES.INT]:"number",[i.TYPES.FLOAT]:"number",[i.TYPES.STRING]:"string",[i.TYPES.BOOL]:"boolean"}},826507:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.AesCbcStream=t.AES_CBC_BLOCK_SIZE=void 0,t.aesCbcDecrypt=h,t.aesCbcDecryptSplit=function(e,t){return Promise.resolve().then((()=>{const n=t.slice(0,16),r=t.slice(16);return h(e,n,r)}))},t.aesCbcEncrypt=function(e,t,n){return Promise.resolve().then((()=>{const r=_(n),i=d(r);return Promise.resolve(p(e)).then((e=>self.crypto.subtle.encrypt(i,e,t))).then((e=>(0,l.concatTypedArrays)(Uint8Array,[r,new Uint8Array(e)]).buffer))}))},t.aesCbcEncryptChunk=m,t.aesCbcEncryptWithChunking=function(){return g.apply(this,arguments)},t.getIv=_,t.importRawKey=p;var i=r(n(311504)),a=n(551168),o=r(n(480925)),s=n(691015),l=n(786702);const u=16;t.AES_CBC_BLOCK_SIZE=u;const c=16777216;function d(e){return{name:"AES-CBC",iv:(0,s.castTypedArrays)(Uint8Array,e)}}function p(e){return self.crypto.subtle.importKey("raw",(0,s.castTypedArrays)(Uint8Array,e),"AES-CBC",!1,["encrypt"])}function _(e){if(e)return(0,s.castTypedArrays)(Uint8Array,e);const t=new Uint8Array(16);return self.crypto.getRandomValues(t),t}function f(e){const t=e.byteLength,n=u-t%u;return Number.isNaN(n)?t:t+n}function h(e,t,n){const r=d(t);return Promise.resolve(self.crypto.subtle.importKey("raw",(0,s.castTypedArrays)(Uint8Array,e),"AES-CBC",!1,["decrypt"])).then((e=>self.crypto.subtle.decrypt(r,e,n)))}function g(){return(g=(0,i.default)((function*(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:c;if(r%u!=0)throw(0,o.default)(`chunkSize must be a multiple of 16, ${r} received`);const i=yield p(e),a=new Uint8Array(t),s=Math.ceil(a.byteLength/r),l=_(n),d=new Uint8Array(f(a)+l.byteLength);d.set(l);for(let e,t=0,n=l;t<s;t++){const o=t===s-1,u=t*r;e=a.subarray(u,u+r);const{encryptedChunk:c,nextIv:p}=yield m(o,e,n,i);d.set(c,l.byteLength+t*r),n=p}return d.buffer}))).apply(this,arguments)}function m(){return y.apply(this,arguments)}function y(){return(y=(0,i.default)((function*(e,t,n,r){const i=yield self.crypto.subtle.encrypt(d(n),r,t).then((t=>e?new Uint8Array(t):new Uint8Array(t).subarray(0,-16))),a=i.slice(-16);return{encryptedChunk:i,nextIv:a}}))).apply(this,arguments)}t.AesCbcStream=class{constructor(e,t,n,r){this._input=null,this._finished=!1,this._output=e,this._type=t,this._rawKey=n;const i={name:"AES-CBC",iv:r};this._promise=self.crypto.subtle.importKey("raw",n,"AES-CBC",!1,[t]).then((e=>({algo:i,key:e})))}append(e){let t;this._throwIfFinished("append");const n=this._input;if(n)if(n.writeByteArray(e),n.size()>1024){const e=n.size()%u;t=n.readByteArray(n.size()-e),n.size()||(this._input=null)}else t=null;else if(e.length>1024){const n=e.length%u;n?(this._input=new a.Binary(e),t=this._input.readByteArray(e.length-n)):t=e}else this._input=new a.Binary(e),t=null;const r=t;return r&&(this._promise=this._promise.then((e=>{let{key:t,algo:n}=e;if("encrypt"===this._type)return self.crypto.subtle.encrypt(n,t,r).then((e=>(this._output.writeByteArray(new Uint8Array(e,0,e.byteLength-u)),new Uint8Array(e,e.byteLength-32,u))));{const e=r.slice(-16);return self.crypto.subtle.decrypt(n,t,r).then((t=>(this._output.writeBuffer(t),e)))}})).then((e=>{const t={name:"AES-CBC",iv:e};return self.crypto.subtle.importKey("raw",this._rawKey,"AES-CBC",!1,[this._type]).then((e=>({algo:t,key:e})))}))),this._promise.then((()=>{}))}finalize(e){let t;if(this._throwIfFinished("finalize"),this._input){const n=this._input;e&&n.writeByteArray(e),t=n.readByteArray(),this._input=null}else e&&(t=e);if(t){const e=t;return this._promise.then((t=>{let{algo:n,key:r}=t;return"encrypt"===this._type?self.crypto.subtle.encrypt(n,r,e):self.crypto.subtle.decrypt(n,r,e)})).then((e=>{this._output.writeBuffer(e)}))}return this._promise.then((()=>{}))}_throwIfFinished(e){if(this._finished)throw(0,o.default)(`AesCbcStream.${e} called after finalize`)}}},177467:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.gcmDecrypt=function(){return s.apply(this,arguments)},t.gcmEncrypt=function(){return o.apply(this,arguments)};var i=r(n(311504)),a=n(551168);function o(){return(o=(0,i.default)((function*(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:16;const a={name:"AES-GCM",iv:u(t),tagLength:8*i};return null!=r&&(a.additionalData=u(r)),self.crypto.subtle.encrypt(a,yield l(e),n)}))).apply(this,arguments)}function s(){return(s=(0,i.default)((function*(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:16;const a={name:"AES-GCM",iv:u(t),tagLength:8*i};return null!=r&&(a.additionalData=u(r)),self.crypto.subtle.decrypt(a,yield l(e),n)}))).apply(this,arguments)}function l(e){return self.crypto.subtle.importKey("raw",e,"AES-GCM",!1,["encrypt","decrypt"])}function u(e){if(e instanceof Uint8Array)return e;if("string"==typeof e){const t=new a.Binary;return t.writeString(e),t.readByteArray()}return new Uint8Array(e)}},855068:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.allocate=l,t.elligator=P,t.fieldElement=u,t.hashSha512=function(e,t,n){i.lowlevel.crypto_hash(e,t,n)},t.hashToPoint=function(e){return s((()=>function(e){const{unpack25519:t}=i.lowlevel,n=(0,i.hash)(e),r=(128&n[31])>>7;n[31]&=127;const a=u();t(a,n);const o=u();P(o,a);const s=_();!function(e,t,n){const{unpack25519:r,M:a}=i.lowlevel,o=u();r(o,A);const s=u();!function(e,t){const{Z:n,A:r,M:a}=i.lowlevel,o=p(),s=u(),l=u(),c=u();n(s,t,o),r(l,t,o),I(c,l),a(e,s,c)}(s,t);const c=u();m(c,t);const d=u();!function(e,t){const{unpack25519:n,pow2523:r,M:a,S:o}=i.lowlevel,s=u();n(s,E);const l=u();r(l,t);const c=u();a(c,t,l);const d=u();o(d,c);const p=u();a(p,c,s),y(c,p,1^(_=d,f=t,M(_,f)?0:1)),e.set(c);var _,f}(d,c);const _=u();a(_,t,o);const f=u();I(f,d);const h=u();a(h,_,f);const g=u();S(g,h),y(h,g,function(e){const{pack25519:t}=i.lowlevel,n=l(Uint8Array,32);return t(n,e),1&n[0]}(h)^n),e[0].set(h),e[1].set(s),e[2].set(p()),a(e[3],e[0],e[1])}(s,o,r);const c=_();return function(e,t){const n=[u(),u(),u(),u()],r=f();(function(e,t){const n=f();(function(e,t){e[0].set(t[0]),e[1].set(t[1]),e[2].set(t[2])})(n,t),v(e,n)})(n,t),T(r,n),v(n,r),T(r,n),v(n,r),function(e,t){const{M:n}=i.lowlevel;n(e[0],t[0],t[3]),n(e[1],t[1],t[2]),n(e[2],t[2],t[3]),n(e[3],t[0],t[1])}(e,n)}(c,s),c}(e)))},t.inv25519=I,t.modL=c,t.p3Element=_,t.pack=O,t.reduce=function(e,t){for(let n=0;n<64;++n)t[n]=e[n],e[n]=0;c(e,t),t.fill(0)},t.runInAllocationScope=s,t.scalarmultBase=function(e,t){const n=[u(),u(),u(),u()];i.lowlevel.scalarbase(n,t),O(e,n)},t.unpack=function(e,t){const n=_();if(0!==b(n,t))return-1;return function(e,t){S(e[0],t[0]),e[1].set(t[1]),e[2].set(t[2]),S(e[3],t[3])}(e,n),0},t.unpackneg=b;var i=n(903190),a=r(n(480925));let o=null;function s(e){const t=o;o=[];try{return e()}finally{var n;(null!==(n=o)&&void 0!==n?n:[]).forEach((e=>{e.fill(0)})),o=t}}function l(e,t){if(null==o)throw(0,a.default)("allocate called outside of active scope");return new e(t)}function u(e){const t=l(Float64Array,16);if(e){if(e.length>16)throw(0,a.default)("Incorrect initialiser array provided to the fieldElement");for(let n=0;n<e.length;n++)t[n]=e[n]}return t}function c(e,t){i.lowlevel.modL(e,t)}const d=()=>u([0]),p=()=>u([1]);function _(){return[u(),u(),u(),u()]}function f(){return[u(),u(),u()]}function h(e,t){let n=0,r=t;for(;r>0;){const t=r%65536;e[n]=t,r=(r-t)/65536,n++}}function g(e,t){const{S:n,M:r}=i.lowlevel,a=u([2]),o=u();n(o,t),r(e,a,o)}function m(e,t){const{S:n,M:r,A:a}=i.lowlevel,o=d(),s=p(),l=u(),c=u(),_=u(),f=u();h(o,486662),n(l,t),r(c,o,t),a(_,l,c),a(f,_,s),r(e,t,f)}function y(e,t,n){1===n&&e.set(t)}const E=new Uint8Array([176,160,14,74,39,27,238,196,120,228,47,173,6,24,67,47,167,215,251,61,153,0,77,43,11,223,193,79,128,36,131,43]);function S(e,t){const{Z:n}=i.lowlevel;n(e,d(),t)}function T(e,t){const{M:n}=i.lowlevel;n(e[0],t[0],t[3]),n(e[1],t[1],t[2]),n(e[2],t[2],t[3])}function v(e,t){const{S:n,A:r,Z:a}=i.lowlevel;n(e[0],t[0]),n(e[2],t[1]),g(e[3],t[2]),r(e[1],t[0],t[1]);const o=u();n(o,e[1]),r(e[1],e[2],e[0]),a(e[2],e[2],e[0]),a(e[0],o,e[1]),a(e[3],e[3],e[2])}const A=new Uint8Array([6,126,69,255,170,4,110,204,130,26,125,75,209,211,161,197,126,79,252,3,220,8,123,210,187,6,160,96,244,237,38,15]);function C(e,t){const{M:n,A:r}=i.lowlevel,a=p(),o=d();h(o,486662);const s=u();g(s,t);const l=u();r(l,s,a);const c=u();I(c,l);const _=u();n(_,c,o);const f=u();S(f,_);const E=u();m(E,f);const T=function(e){const{S:t,M:n,pow2523:r,pack25519:a}=i.lowlevel,o=u(),s=u(),l=u(),c=u(),d=u();r(o,e),t(s,o),t(l,s),n(c,l,e),n(d,c,e);const p=new Uint8Array(32);return a(p,d),1&p[31]}(E),v=u([0]);y(v,o,T);const A=u();r(A,f,v);const C=u();S(C,A),y(A,C,T),e.set(A)}function P(e,t){return s((()=>C(e,t)))}function O(e,t){const n=u(),r=u(),a=u(),{M:o,pack25519:s}=i.lowlevel;I(a,t[2]),o(n,t[0],a),o(r,t[1],a),s(e,r);const l=new Uint8Array(32);s(l,n),e[31]^=(1&l[0])<<7}function I(e,t){const n=u();n.set(t);const{M:r,S:a}=i.lowlevel;for(let e=253;e>=0;--e)a(n,n),2!==e&&4!==e&&r(n,n,t);e.set(n)}function M(e,t){const{pack25519:n,crypto_verify_32:r}=i.lowlevel,a=new Uint8Array(32),o=new Uint8Array(32);return n(a,e),n(o,t),r(a,0,o,0)}function b(e,t){const{set25519:n,S:r,M:a,Z:o,A:s,D:l,unpack25519:c,pow2523:_}=i.lowlevel,f=u(),h=u(),g=u(),m=u(),y=u(),E=u(),S=u();return n(e[2],p()),c(e[1],t),r(g,e[1]),a(m,g,l),o(g,g,e[2]),s(m,e[2],m),r(y,m),r(E,y),a(S,E,y),a(f,S,g),a(f,f,m),_(f,f),a(f,f,g),a(f,f,m),a(f,f,m),a(e[0],f,m),r(h,e[0]),a(h,h,m),M(h,g)&&a(e[0],e[0],u([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139])),r(h,e[0]),a(h,h,m),M(h,g)?-1:(function(e){const{pack25519:t}=i.lowlevel,n=new Uint8Array(32);return t(n,e),1&n[0]}(e[0])===t[31]>>7&&o(e[0],d(),e[0]),a(e[3],e[0],e[1]),0)}},684659:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.expand=l,t.extractAndExpand=function(e,t,n){return(0,a.extractSha256)(null,e).then((e=>l(new Uint8Array(e),t,n)))},t.extractWithSaltAndExpand=function(e,t,n,r){return(0,a.extractSha256)(t,e).then((e=>l(new Uint8Array(e),n,r)))};var i=n(551168),a=n(128326),o=r(n(480925));const s=255*a.SHA256_BYTE_LENGTH;function l(e,t,n){if(n<0||n>s)return Promise.reject((0,o.default)(`HKDF::expand given bad length ${n}`));let r;const l=Math.ceil(n/a.SHA256_BYTE_LENGTH),u=i.Binary.build(t).readByteArray(),c=new i.Binary;let d=(0,a.encodeKeySha256)(e).then((e=>(r=e,new Uint8Array(0))));for(let e=1;e<=l;e++)d=d.then((t=>(0,a.sign)(r,i.Binary.build(t,u,e).readByteArray()))).then((e=>{const t=new Uint8Array(e);return c.writeByteArray(t),t}));return d.then((()=>c.readBuffer(n)))}},128326:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA256_BYTE_LENGTH=t.DEFAULT_SALT=void 0,t.encodeKeySha256=function(e){return l(a,e)},t.extractSha256=function(e,t){return l(a,null!=e?e:i).then((e=>u(e,t)))},t.hmacSha1=function(e,t,n){return l(s,e).then((e=>u(e,t,n)))},t.hmacSha256=function(e,t,n){return l(a,e).then((e=>u(e,t,n)))},t.hmacSha512=function(e,t,n){return l(o,e).then((e=>u(e,t,n)))},t.sign=u;var r=n(691015);t.SHA256_BYTE_LENGTH=32;const i=new Uint8Array(32);t.DEFAULT_SALT=i;const a={name:"HMAC",hash:"SHA-256"},o={name:"HMAC",hash:"SHA-512"},s={name:"HMAC",hash:"SHA-1"};function l(e,t){const n=(0,r.castTypedArrays)(Uint8Array,t);return self.crypto.subtle.importKey("raw",n,e,!1,["sign"]).then((t=>({key:t,algo:e})))}function u(e,t,n){let{key:r,algo:i}=e;return self.crypto.subtle.sign(i,r,t).then((e=>null!=n&&0!==n?e.slice(0,n):e))}},192920:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.LtHash16=t.LT_HASH_ANTI_TAMPERING=t.KEY_LENGTH_BYTES=t.EMPTY_LT_HASH=void 0;var i=r(n(311504)),a=n(684659);const o=128;t.KEY_LENGTH_BYTES=o;const s=new ArrayBuffer(o);t.EMPTY_LT_HASH=s;class l{constructor(e){this.salt=e}add(e,t){var n=this;return t.reduce(function(){var e=(0,i.default)((function*(e,t){return n._addSingle(yield e,t)}));return function(){return e.apply(this,arguments)}}(),Promise.resolve(e))}subtract(e,t){var n=this;return t.reduce(function(){var e=(0,i.default)((function*(e,t){return n._subtractSingle(yield e,t)}));return function(){return e.apply(this,arguments)}}(),Promise.resolve(e))}subtractThenAdd(e,t,n){var r=this;return(0,i.default)((function*(){return r.add(yield r.subtract(e,n),t)}))()}_addSingle(e,t){var n=this;return(0,i.default)((function*(){const r=yield(0,a.extractAndExpand)(t,n.salt,o);return n.performPointwiseWithOverflow(e,r,((e,t)=>e+t))}))()}_subtractSingle(e,t){var n=this;return(0,i.default)((function*(){const r=yield(0,a.extractAndExpand)(t,n.salt,o);return n.performPointwiseWithOverflow(e,r,((e,t)=>e-t))}))()}performPointwiseWithOverflow(e,t,n){const r=new DataView(e),i=new DataView(t),a=new ArrayBuffer(r.byteLength),o=new DataView(a);for(let e=0;e<r.byteLength;e+=2)o.setUint16(e,n(r.getUint16(e,!0),i.getUint16(e,!0)),!0);return a}}t.LtHash16=l;const u=new l("WhatsApp Patch Integrity");t.LT_HASH_ANTI_TAMPERING=u},620430:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.unpadPkcs7=function(e){if(0===e.length)throw(0,i.default)("unpadPkcs7 given empty bytes");const t=e[e.length-1];if(t>e.length)throw(0,i.default)(`unpadPkcs7 given ${e.length} bytes, but pad is ${t}`);return new Uint8Array(e.buffer,e.byteOffset,e.length-t)},t.writePad=a,t.writeRandomPad=function(e){const t=new Uint8Array(1);do{self.crypto.getRandomValues(t)}while(0===t[0]);a(e,t[0])},t.writeRandomPadMax16=function(e){const t=new Uint8Array(1);self.crypto.getRandomValues(t),a(e,1+(15&t[0]))};var i=r(n(480925));function a(e,t){for(let n=0;n<t;n++)e.writeUint8(t)}},903190:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"hash",{enumerable:!0,get:function(){return r.hash}}),t.lowlevel=t.keypairFromSecretKey=t.keyPair=void 0,Object.defineProperty(t,"scalarMult",{enumerable:!0,get:function(){return r.scalarMult}}),t.signDetachedVerify=void 0,Object.defineProperty(t,"verify",{enumerable:!0,get:function(){return r.verify}});var r=n(214462);const i={scalarbase:r.lowlevel.scalarbase,crypto_hash:r.lowlevel.crypto_hash,modL:r.lowlevel.modL,pack25519:r.lowlevel.pack25519,S:r.lowlevel.S,M:r.lowlevel.M,A:r.lowlevel.A,Z:r.lowlevel.Z,D:r.lowlevel.D,unpack25519:r.lowlevel.unpack25519,pow2523:r.lowlevel.pow2523,crypto_verify_32:r.lowlevel.crypto_verify_32,set25519:r.lowlevel.set25519,add:r.lowlevel.add,scalarmult:r.lowlevel.scalarmult};t.lowlevel=i;const a=r.box.keyPair.fromSecretKey;t.keypairFromSecretKey=a;const o=r.box.keyPair;t.keyPair=o;const s=r.sign.detached.verify;t.signDetachedVerify=s},638778:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=i,t.sha256Base64=function(e){return Promise.resolve(i(e).then(r.encodeB64))};var r=n(417405);function i(e){return Promise.resolve(self.crypto.subtle.digest({name:"SHA-256"},e))}},703177:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.arrayBuffersEqual=function(e,t){return o(new Uint8Array(e),new Uint8Array(t))},t.randomNumberLessThan=function(e){if(e!==(0|e))throw(0,a.default)("bound must be int32");if(e<=0)throw(0,a.default)("bound must not be positive");const t=new Int32Array(1),n=e*Math.floor((-1>>>1)/e);let r=-1;for(;-1===r;){self.crypto.getRandomValues(t);const i=t[0]>>>1;i<n&&(r=i%e)}return r},t.rawKeysEqual=function(e,t){return 0===e.length&&0===t.length||(0,i.verify)(e,t)},t.serializedPubKeysEqual=function(e,t){return 0===e.length&&0===t.length||(0,i.verify)(e,t)},t.uint8ArraysEqual=o;var i=n(903190),a=r(n(480925));function o(e,t){return 0===e.length&&0===t.length||(0,i.verify)(e,t)}},722796:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UseCaseSecretModificationType=void 0,t.createUseCaseSecret=function(e){const{messageSecret:t,stanzaId:n,parentMsgOriginalSender:a,modificationSender:o,modificationType:s}=e,l=r.Binary.build(n,a,o,s).readBuffer();return(0,i.extractAndExpand)(t instanceof ArrayBuffer?new Uint8Array(t):t,l,32)};var r=n(551168),i=n(684659);const a=n(654302)({POLL_VOTE:"Poll Vote",ENC_REACTION:"Enc Reaction"});t.UseCaseSecretModificationType=a},819416:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.getConfig=function(){return o().config},t.getDbImpls=function(){return o().db},t.getJidUtilsApi=function(){return o().jidUtils},t.getMyDeviceJid=function(){var e;const t=null===(e=o().myJids)||void 0===e?void 0:e.deviceJid;if(null==t)throw(0,i.default)("Trying to access myDeviceJid, but it's not set");return t},t.getMyUserJid=function(){var e;const t=null===(e=o().myJids)||void 0===e?void 0:e.userJid;if(null==t)throw(0,i.default)("Trying to access myUserJid, but it's not set");return t},t.getQplConfig=function(){return o().qpl},t.runInTransaction=function(e,t){return o().runInTransaction(e,t)},t.setGlobals=function(e){a=e},t.setMyJids=function(e){o().myJids=e};var i=r(n(480925));let a=null;function o(){if(null==a)throw(0,i.default)("Trying to access WAGlobals before being set");return a}},125161:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeIndexWithoutPreservingOrder=function(e,t){const n=e.pop();t<e.length&&(e[t]=n)}},417405:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.BASE64_DATA_URL_SCHEME=void 0,t.decodeB64=function(e){const t=l(e,43,47,61);if(t)return t.buffer;throw(0,i.default)("Base64.decode given invalid string")},t.decodeB64ToJsArray=function(e){const t=e instanceof ArrayBuffer?new Uint8Array(e):l(e,43,47,61);return t&&Array.from(t)},t.decodeB64UrlSafe=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=l(e,45,95,t?61:-1);if(n)return n.buffer;throw(0,i.default)("Base64.decode given invalid string")},t.encodeB64=function(e){return o(e,43,47,!0)},t.encodeB64UrlSafe=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return o(e,45,95,t)},t.isBase64=void 0,t.sizeWhenB64Decoded=function(e){return Math.floor(3*e.length/4)};var i=r(n(480925));const a=3e3;t.BASE64_DATA_URL_SCHEME="data:image/jpeg;base64,";function o(e,t,n,r){const i=Array.isArray(e)||e instanceof ArrayBuffer?new Uint8Array(e):e;if(i.length<=a)return s(i,t,n,r);{const e=[];for(let o=0;o<i.length;o+=a)e.push(s(i.subarray(o,o+a),t,n,r));return e.join("")}}function s(e,t,n,r){const i=Math.ceil(4*e.length/3),a=4*Math.ceil(e.length/3),o=new Array(a);for(let t=0,n=0;t<a;t+=4,n+=3){const r=e[n]<<16|e[n+1]<<8|e[n+2];o[t]=r>>18,o[t+1]=r>>12&63,o[t+2]=r>>6&63,o[t+3]=63&r}for(let e=0;e<i;e++){const r=o[e];o[e]=r<26?65+r:r<52?71+r:r<62?r-4:62===r?t:n}for(let e=i;e<a;e++)o[e]=61;const s=String.fromCharCode.apply(String,o);return r?s:s.substring(0,i)}function l(e,t,n,r){let i=e.length;const a=new Int32Array(i+i%4);for(let o=0;o<i;o++){const s=e.charCodeAt(o);if(65<=s&&s<=90)a[o]=s-65;else if(97<=s&&s<=122)a[o]=s-71;else if(48<=s&&s<=57)a[o]=s+4;else if(s===t)a[o]=62;else{if(s!==n){if(s===r){i=o;break}return null!=self.ERROR&&__LOG__(4,void 0,new Error)`Found unexpected character code while decoding B64 at index ${o}, length ${i}: ${s}`,null}a[o]=63}}const o=a.length/4;for(let e=0,t=0;e<o;e++,t+=4)a[e]=a[t]<<18|a[t+1]<<12|a[t+2]<<6|a[t+3];const s=Math.floor(3*i/4),l=new Uint8Array(s);let u=0,c=0;for(;c+3<=s;u++,c+=3){const e=a[u];l[c]=e>>16,l[c+1]=e>>8&255,l[c+2]=255&e}switch(s-c){case 2:l[c]=a[u]>>16,l[c+1]=a[u]>>8&255;break;case 1:l[c]=a[u]>>16}return l}t.isBase64=e=>"string"==typeof e&&/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)},145335:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatArrayBuffers=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=t.reduce(((e,t)=>e+t.byteLength),0),i=new Uint8Array(r);let a=0;return t.forEach((e=>{i.set(new Uint8Array(e),a),a+=e.byteLength})),i.buffer}},332193:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const n=[],r=e.length,i=t.length,a=Math.max(r,i);for(let o=0;o<a;o++)o<r&&n.push(e[o]),o<i&&n.push(t[o]);return n}},487769:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arrayMoveMutate=t.arrayMove=void 0;const n=function(e,t,n){const r=n<0?e.length+n:n,i=e.splice(t,1)[0];e.splice(r,0,i)};t.arrayMoveMutate=n;t.arrayMove=function(e,t,r){const i=e.slice();return n(i,t,r),i}},104563:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){let n,r=!1;for(n=0;n<e.length;n++)if(e[n]===t){r=!0;break}if(r){const t=e[n];e.splice(n,1),e.unshift(t)}}},98017:(e,t)=>{"use strict";function n(e,t){return e===t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;if(e===t)return!0;if(e.length!==t.length)return!1;return e.every(((e,n)=>r(e,t[n])))}},867624:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.b64Equal=function(e,t){const n=e.length,r=t.length;switch(n-r){case-2:return 61===t.charCodeAt(n)&&61===t.charCodeAt(n+1)&&t.substr(0,n)===e;case-1:return 61===t.charCodeAt(n)&&t.substr(0,n)===e;case 0:return e===t;case 1:return 61===e.charCodeAt(r)&&e.substr(0,r)===t;case 2:return 61===e.charCodeAt(r)&&61===e.charCodeAt(r+1)&&e.substr(0,r)===t;default:return!1}}},670309:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const n=atob(e);let r=0;for(let e=0;e<n.length;e++){const i=n.charCodeAt(e);r=((r<<4)+(i>>4))%t,r=((r<<4)+(15&i))%t}return r}},82236:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(null==e)return null;const t=e.replace(/\s+$/,"");e!==t&&Math.random()<1e-5&&(__LOG__(3,void 0,void 0,!0)`base64 sanitized due to extra whitespace`,SEND_LOGS("media-key-sanitize"));return t}},861309:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.replace(/\//g,"_").replace(/\+/g,"-")}},691015:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.castTypedArrays=function(e,t){if(t instanceof e)return t;if("string"==typeof t)return new e((0,r.decodeB64)(t));return new e(t)};var r=n(417405)},786702:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatTypedArrays=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=t.reduce(((e,t)=>e+t.length),n),i=new e(r);let a=0;return t.forEach((e=>{i.set(e,a),a+=e.length})),i}},554810:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(551168),a=n(698210),o=r(n(680519));let s,l=0;t.default=class{constructor(e){this.oggBlob=e}generateBlob(){return this.oggBlobToWAVBlob(this.oggBlob,1)}oggBlobToWAVBlob(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return new Promise((n=>{const r=new o.default,i=[],u=[],c=(l++,s||new window.AudioContext),d={outputBufferSampleRate:c.sampleRate,bufferLength:4096};r.onmessage=e=>{if(null==e.data){for(let e=0;e<t;e++)i.forEach((t=>{const n=t[e]||t[0];for(let e=0;e<n.length;e++)u.push(n[e])}));const e=this.encodeWAV(u,c,t),r=new Blob([e.readByteArray()],{type:"audio/wav"});l--,0===l&&s&&(s.close&&s.close(),s=void 0),n(r)}else i.push(e.data),t=i[0].length},r.postMessage({command:"decode-init",config:d}),(0,a.blobToArrayBuffer)(e).then((e=>{r.postMessage({command:"decode",pages:new Uint8Array(e)}),r.postMessage({command:"decode-done"})})).catch((e=>{__LOG__(3)`Player::oggBlobToWAVBlob error: ${e}`}))}))}encodeWAV(e,t,n){const r=new i.Binary(void 0,!0);r.ensureCapacity(44+2*e.length),r.writeString("RIFF"),r.writeUint32(36+2*e.length),r.writeString("WAVE"),r.writeString("fmt "),r.writeUint32(16),r.writeUint16(1),r.writeUint16(n),r.writeUint32(t.sampleRate),r.writeUint32(t.sampleRate*n*2),r.writeUint16(2*n),r.writeUint16(16),r.writeString("data"),r.writeUint32(2*e.length);for(let t=0;t<e.length;t++){let n=Math.max(-1,Math.min(e[t],1));n*=n>0?32767:32768,r.writeInt16(Math.floor(n))}return r}}},940748:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.attributeAgentToMessage=function(e){if(null!=e.agentId||!(0,l.canUserSeeMessageAttribution)())return;const t=(0,h.getMe)();if(null!=t){const n=s.AgentCollection.getByDeviceId(t.getDeviceId());null!=n&&(e.agentId=n.id)}},t.initializeAgentLog=function(){if(!(0,u.isMultiDeviceAgentsLoggingEnabled)())return;const e=(0,h.assertGetMe)().getDeviceId(),t=d.default.persistentExpiringId();c.Cmd.on("logout",(()=>{T({browserId:t,companionMdId:e,logoutTimestamp:(0,o.unixTimeWithoutClockSkewCorrection)(),multideviceAction:g.default.MULTIDEVICE_ACTION_TYPE.LOGOUT},!0)})),document.addEventListener("visibilitychange",(()=>{document.hidden||T({browserId:t,companionMdId:e,multideviceAction:g.default.MULTIDEVICE_ACTION_TYPE.ACTIVE})}));const n=s.AgentCollection.getByDeviceId(e);null!=n?(E=n.id,v({browserId:t,companionMdId:e})):c.Cmd.on(c.APP_STATE_SYNC_COMPLETED,(()=>{const n=s.AgentCollection.getByDeviceId(e);null!=(null==n?void 0:n.id)&&null==E&&(E=n.id,v({browserId:t,companionMdId:e}))}))},t.logMessageInfo=function(e){const t=null!=e?s.AgentCollection.get(e):void 0;T({browserId:d.default.persistentExpiringId(),agentId:null==t?void 0:t.id,companionMdId:null==t?void 0:t.deviceId,multideviceAction:g.default.MULTIDEVICE_ACTION_TYPE.MESSAGE_INFO})},t.setShouldLogAgentLogin=function(e){S=e},t.updateUnattributedMessages=function(){return y.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(990445),s=n(268392),l=n(314350),u=n(72696),c=n(780549),d=r(n(524173)),p=n(301460),_=n(121260),f=n(375672),h=n(459857),g=r(n(571834));function m(e){var t;return e.author.user!==(null===(t=(0,h.getMaybeMeUser)())||void 0===t?void 0:t.user)}function y(){return(y=(0,a.default)((function*(e,t){if(m(e)||!(0,l.canUserSeeMessageAttribution)())return;const n=e.author.getDeviceId(),r=s.AgentCollection.getByDeviceId(n);if(null==r){const e=t.map((e=>({id:e.id.toString(),deviceId:n})));return f.UnattributedMessageCollection.add(e),void e.forEach((()=>{}))}const i=t.map((e=>p.MsgCollection.get(e.id))).filter(Boolean).filter((e=>null==e.agentId)),a=String(r.id);i.forEach((e=>{e.agentId=a}));const o=i.map((e=>({id:e.id.toString(),agentId:a})));yield(0,_.getTable)().bulkCreateOrMerge(o)}))).apply(this,arguments)}let E,S;function T(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,u.isMultiDeviceAgentsLoggingEnabled)()&&new g.default.MdExpansionAgentBrowserMdId((0,i.default)({agentId:E},e)).commit(t)}function v(e){null!=S&&T((0,i.default)((0,i.default)((0,i.default)({},e),S),{},{multideviceAction:g.default.MULTIDEVICE_ACTION_TYPE.LOGIN}))}},551746:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleBusinessChange=void 0;var r=n(266888),i=n(411067);t.handleBusinessChange=e=>{const t=(0,i.unproxy)(e),{businessProfile:a,id:o}=t,s=t.isBusiness||t.isMe&&r.Conn.isSMB;s&&!a?t.addChild("businessProfile",n(69108).BusinessProfileCollection.gadd(o)):!s&&a&&(t.stopListening(a),t.businessProfile=void 0,a.delete())}},630591:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.queryBusinessCategories=function(e){if(e===a.BUSINESS_CATEGORY_EMPTY_STR_ID)return(0,u.queryBusinessCategories)("");return(0,u.queryBusinessCategories)(e)},t.queryBusinessProfile=function(e,t){return(0,o.queryBusinessProfile)(e,t)},t.queryBusinessPublicKey=function(e){return(0,l.queryBusinessPublicKey)(e)},t.queryCustomUrlPaths=function(e){return(0,l.queryCustomUrlPaths)(e)},t.querySignedUserInfo=function(){return d.apply(this,arguments)},t.updateCartEnabled=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(497334),o=n(228733),s=n(459857),l=n(12642),u=n(684057);function c(){return(c=(0,i.default)((function*(e){const t=n(69108).BusinessProfileCollection,r=yield(0,l.updateCartEnabled)(e),i=t.getValid((0,s.getMeUser)()),a=null==i?void 0:i.profileOptions;i&&a&&(a.cartEnabled=r,t.add(i,{merge:!0}))}))).apply(this,arguments)}function d(){return(d=(0,i.default)((function*(e){const{phoneNumber:t,phoneNumberSignature:n,phoneNumberSignatureExpiration:r,businessDomain:i}=yield(0,l.querySignedUserInfo)(e);if(null==t||null==r||null==n||null==i)throw new Error("Unexpected null or undefined");return{phoneNumber:t,phoneNumberSignature:n,phoneNumberSignatureExpiration:r,businessDomain:i}}))).apply(this,arguments)}},582523:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.changeChatAssignment=function(){return I.apply(this,arguments)},t.checkOrphanAssignments=function(){S.Cmd.once(S.APP_STATE_SYNC_COMPLETED,(()=>{(0,l.checkOrphanAgents)(c.AgentCollection.getModelsArray().map((e=>{let{id:t}=e;return t}))),(0,l.checkOrphanChatAssignments)(_.ChatAssignmentCollection.getModelsArray().map((e=>{let{id:t}=e;return t})))}))},t.createChatAssignmentSystemMsgs=w,t.removeChatAssignmentsForChat=function(){return L.apply(this,arguments)};var i=r(n(348926)),a=n(715739),o=n(797666),s=n(155172),l=n(61314),u=n(990445),c=n(268392),d=(n(98671),n(716671)),p=n(72696),_=n(387202),f=n(2772),h=n(698052),g=n(561397),m=n(15605),y=n(319266),E=n(965012),S=n(780549),T=n(828770),v=n(240493),A=n(936771),C=n(459857),P=n(53575),O=n(924439);function I(){return(I=(0,i.default)((function*(e,t){if(!(0,y.canAssignChats)())return;const n=(0,C.assertGetMe)().getDeviceId(),r=e.map((e=>{const r=e.chat.id.toString({legacy:!0}),i=e.agentId,a=c.AgentCollection.getByDeviceId(n);return{id:`${r}_${i||""}`,chatId:r,agentId:null!=i?i:"",chatOpenedByAgent:(null==a?void 0:a.deviceId)===n&&t!==h.ChatAssignmentEntryPointType.MULTI_SELECT&&t!==h.ChatAssignmentEntryPointType.CONTACT_INFO_SCREEN}})),i=e.map((e=>null!=e.chat.assignedAgent));yield(0,O.lockForSync)(["chat-assignment"],N(r),(()=>b(r))),e.forEach(((n,r)=>{var a;(0,f.logChatAssignment)(n.chat,null!==(a=n.agentId)&&void 0!==a?a:"",i[r],t,e.length)})),w(e.map((e=>{let{chat:t,agentId:n}=e;const r=c.AgentCollection.get(null!=n?n:"");return{chatId:t.id,agent:r,timestamp:(0,u.unixTime)()}}))),P.userPreferencesStore.setUser("chat_assignment_agent_has_assigned_chats",!0),r.filter((e=>{let{chatOpenedByAgent:t}=e;return!0===t})).forEach((e=>{const t=E.ChatCollection.get(e.chatId);null!=t&&(0,d.markChatAsOpened)(t,!0)}))}))).apply(this,arguments)}function M(e){return _.ChatAssignmentCollection.getModelsArray().filter((t=>{let{chatId:n}=t;return e.includes(n)})).map((e=>e.id))}function b(){return R.apply(this,arguments)}function R(){return(R=(0,i.default)((function*(e){const t=M(e.map((e=>{let{chatId:t}=e;return t}))),n=e.map((e=>{let{id:t,chatId:n,agentId:r,chatOpenedByAgent:i}=e;return new g.ChatAssignment({id:t,chatId:n,agentId:r,chatOpenedByAgent:i,agent:c.AgentCollection.get(r)})}));_.ChatAssignmentCollection.remove(t),_.ChatAssignmentCollection.add(n);const r=(0,A.getTable)();yield Promise.all([r.bulkRemove(t),r.bulkCreateOrMerge(e)])}))).apply(this,arguments)}function N(e){const t=(0,u.unixTimeMs)();return e.map((e=>{let{chatId:n,agentId:r}=e;return(0,o.buildPendingMutation)({timestamp:t,collection:s.CollectionName.Regular,operation:a.SyncdMutation$SyncdOperation.SET,indexArgs:[n],value:{chatAssignment:{deviceAgentID:r}},action:s.Actions.ChatAssignment,version:s.CHAT_ASSIGNMENT_SYNC_VERSION})}))}function w(e){(0,p.chatAssignmentSystemMessagesEnabled)()&&e.forEach((e=>{let{chatId:t,agent:n,timestamp:r}=e;const i=E.ChatCollection.get(t);(0,v.handleSingleMsgMD)(t,(0,m.genChatAssignmentNotificationTemplateMsg)(t,n,r)).then((()=>{null!=i&&(0,f.logSystemMessageGeneratedFromCompanion)(i)})).catch((()=>{null!=i&&(0,f.logSystemMessageFailedToGenerate)(i)}))}))}function L(){return(L=(0,i.default)((function*(e){if(!(0,T.isSMB)())return;const t=M([e.toString({legacy:!0})]);yield(0,A.getTable)().bulkRemove(t),_.ChatAssignmentCollection.remove(t)}))).apply(this,arguments)}},716671:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.markChatAsOpened=function(){return m.apply(this,arguments)},t.updateLocalOpenedState=h;var i=r(n(348926)),a=n(715739),o=n(797666),s=n(155172),l=n(990445),u=n(268392),c=n(387202),d=n(319266),p=n(936771),_=n(459857),f=n(924439);function h(){return g.apply(this,arguments)}function g(){return(g=(0,i.default)((function*(e){e.forEach((e=>{let{id:t,chatOpenedByAgent:n}=e;const r=c.ChatAssignmentCollection.get(t);r&&r.set("chatOpenedByAgent",n)}));const t=(0,p.getTable)();yield t.bulkCreateOrMerge(e)}))).apply(this,arguments)}function m(){return(m=(0,i.default)((function*(e,t){var n;if(!(0,d.canAssignChats)())return;const r=(0,_.assertGetMe)().getDeviceId(),i=e.id,a=null===(n=u.AgentCollection.getByDeviceId(r))||void 0===n?void 0:n.id;if(null==a)return;const o=[{chatId:i,agentId:a,chatOpened:t}].map((e=>{const n=e.chatId.toString({legacy:!0});return{id:`${n}_${a}`,chatId:n,agentId:a,chatOpenedByAgent:t}}));yield(0,f.lockForSync)(["chat-assignment"],y(o),(()=>h(o)))}))).apply(this,arguments)}function y(e){const t=(0,l.unixTimeMs)();return e.map((e=>{let{chatId:n,agentId:r,chatOpenedByAgent:i}=e;return(0,o.buildPendingMutation)({timestamp:t,collection:s.CollectionName.Regular,operation:a.SyncdMutation$SyncdOperation.SET,indexArgs:[n,r],value:{chatAssignmentOpenedStatus:{chatOpened:i}},action:s.Actions.ChatAssignmentOpenedStatus,version:s.CHAT_ASSIGNMENT_SYNC_VERSION})}))}},731302:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return u.apply(this,arguments)};var i=r(n(348926)),a=n(389293),o=n(240493),s=n(35109),l=n(117429);function u(){return(u=(0,i.default)((function*(e,t,n){const r=p(t),i=p(n),a=[d(e,r,i),c(e,r,i)];yield Promise.all(a.map((t=>t?(0,o.handleSingleMsgMD)(e,t):null)))}))).apply(this,arguments)}function c(e,t,n){if(!0===(0,l.getGlobalSecurityNotifications)())return t===s.ReducedPrivacyMode.E2EE&&n!==s.ReducedPrivacyMode.E2EE?(0,a.genEncryptNotificationMsg)(e,"e2e_identity_unavailable"):void 0}function d(e,t,n){if(t!==n)switch(n){case s.ReducedPrivacyMode.E2EE:return(0,a.genEncryptNotificationMsg)(e,"encrypt_now");case s.ReducedPrivacyMode.BSP:return(0,a.genTealNotificationTemplateMsg)(e,"biz_privacy_mode_to_bsp");case s.ReducedPrivacyMode.FB:return(0,a.genTealNotificationTemplateMsg)(e,"biz_privacy_mode_to_fb")}}function p(e){return(0,s.getReducedPrivacyMode)(e.isBusiness?e.privacyMode:null)}},418012:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addProduct=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100;return(0,c.addProduct)(e,t,n)},t.appealProduct=function(e,t){return(0,c.appealProduct)(e,t)},t.createBusinessCatalog=function(){return(0,c.createCatalog)()},t.deleteProducts=function(e){return(0,c.deleteProducts)(e)},t.editProduct=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100;return(0,c.editProduct)(e,t,n)},t.queryCatalog=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:100,a=arguments.length>5?arguments[5]:void 0,o=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return(0,c.queryCatalog)(e,t,n,r,i,a,o)},t.queryProduct=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,i=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;return(0,c.queryProduct)(e,t,n,r,i,a)},t.queryProductList=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,i=arguments.length>4?arguments[4]:void 0;return(0,c.queryProductList)(e,t,n,r,i)},t.reportProduct=function(e,t,n){return(0,c.reportProduct)(e,t,n)},t.sendProductToChat=function(e,t,n){const{catalogWid:c}=e;if(!t)return;const d=t.productCollection.get(e.id),p=d?(0,u.unproxy)(d):(0,u.unproxy)(e);if(!p)return;const _=p.getProductImageCollectionHead(),f=null==_?void 0:_.mediaData;if(!f)return;(0,s.findChat)(c).then((function(e){i.Cmd.openChatFromUnread(e).then((t=>{if(t){const t=(0,u.unproxy)((0,r.createProductInquiry)(p,c,f,null==n?void 0:n.session.toString()));e.composeQuotedMsg=t,a.ComposeBoxActions.focus(e),window.innerWidth<=l.LAYOUT_2COLUMNS_MAX_WIDTH&&o.DrawerManager.closeDrawerRight()}}))}))};var r=n(954178),i=n(780549),a=n(877171),o=n(900316),s=n(855309),l=n(914368),u=(n(316348),n(411067)),c=n(841208)},701602:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateProductListHeaderImageRejected=function(e,t){var n,i,a;const o=r.MsgCollection.get(t),s=null==o||null===(n=o.list)||void 0===n||null===(i=n.productListInfo)||void 0===i||null===(a=i.headerImage)||void 0===a?void 0:a.productId;e.id===s&&null!=o&&(o.productHeaderImageRejected=!0)};var r=n(301460)},955763:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.applyContactBusinessProps=void 0,t.convertLevel=_,t.updateContactsWithVerifiedNames=d;var i=r(n(348926)),a=r(n(132375)),o=n(85734),s=n(817649),l=n(121977),u=n(257845),c=n(669050);function d(e,t){const n={};for(const t of e){const{id:e}=t;n[e.user]=t}for(const e of t){const{id:t}=e,r=n[t.user],i=Boolean(r),{level:a,name:o,isApi:s,isSmb:l,privacyMode:u}=r||{},c={isBusiness:i,isEnterprise:Boolean(s),isSmb:Boolean(l),verifiedLevel:_(a),verifiedName:o,privacyMode:u};e.set(c)}}const p=function(){var e=(0,i.default)((function*(){d((yield(0,o.getAllVerifiedNames)()).map((e=>{let{id:t,name:n,level:r,isApi:i,isSmb:o,privacyMode:s}=e;return{id:(0,c.createUserWid)(t),name:n,level:r,isApi:i,isSmb:o,privacyMode:s?{actualActors:(0,a.default)(u.ActualActorsEnumType.cast(s.actualActors),"ActualActorsEnumType.cast(privacyMode.actualActors)"),hostStorage:(0,a.default)(u.HostStorageEnumType.cast(s.hostStorage),"HostStorageEnumType.cast(privacyMode.hostStorage)"),privacyModeTs:s.privacyModeTs}:null}})),l.ContactCollection.toArray())}));return function(){return e.apply(this,arguments)}}();function _(e){if(null!=e){switch(e){case"unknown":return s.VERIFIED_LEVEL.UNKNOWN;case"low":return s.VERIFIED_LEVEL.LOW;case"high":return s.VERIFIED_LEVEL.HIGH}return s.VERIFIED_LEVEL.UNKNOWN}}t.applyContactBusinessProps=p},909975:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.queryAndUpdateContactPropertiesOnNewChat=function(){return p.apply(this,arguments)},t.updateVerifiedInfo=c;var i=r(n(348926)),a=n(85734),o=n(955763),s=n(121977),l=n(357593),u=n(672604);function c(){return d.apply(this,arguments)}function d(){return(d=(0,i.default)((function*(e,t){const n=e.id,{name:r,level:i,isApi:s,isSmb:u,serial:c,privacyMode:d}=t;null!=d&&(yield(0,l.handlePrivacyModeTransition)(n,d,{bypassVerifiedNameUpdate:!0})),(0,o.updateContactsWithVerifiedNames)([{id:n,name:r,level:i,isApi:s,isSmb:u,privacyMode:d}],[e]),yield(0,a.createOrUpdateVerifiedBusinessName)({id:n.isLid()?n.toString():n.user,level:i,serial:c,name:r,isApi:s,isSmb:u,privacyMode:d?{actualActors:d.actualActors,hostStorage:d.hostStorage,privacyModeTs:d.privacyModeTs}:null})}))).apply(this,arguments)}function p(){return(p=(0,i.default)((function*(e){const t=yield(0,u.queryExists)(e);if(null==t)return;const{bizInfo:n}=t;if(n){const t=s.ContactCollection.get(e);if(null==t)return __LOG__(4,void 0,new Error,!0)`queryAndUpdateContactPropertiesOnNewChat contact does not exist ${""}`,void SEND_LOGS("queryAndUpdateContactPropertiesOnNewChat contact does not exist");yield c(t,n.verifiedName)}}))).apply(this,arguments)}},314005:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleVerifiedNameSync=function(){return l.apply(this,arguments)};var i=r(n(348926)),a=n(955763),o=n(357593),s=n(646240);function l(){return(l=(0,i.default)((function*(e){if(0===e.length)return;yield e.map((e=>{let{id:t,verifiedName:{privacyMode:r}}=e;if(null==r)return;const i=n(965012).ChatCollection.get(t);return null!=i&&!0!==i.shouldAppearInList?(0,o.handlePrivacyModeTransition)(t,r,{chat:i,bypassVerifiedNameUpdate:!0}):void 0}));const t=e.map((e=>{let{id:t,verifiedName:{level:n,serial:r,name:i,isApi:a,isSmb:o,privacyMode:s}}=e;return{id:t.isLid()?t.toString():t.user,level:n,serial:r,name:i,isApi:a,isSmb:o,privacyMode:s?{actualActors:s.actualActors,hostStorage:s.hostStorage,privacyModeTs:s.privacyModeTs}:null}}));yield(0,s.getTable)().bulkCreateOrReplace(t),yield(0,a.applyContactBusinessProps)()}))).apply(this,arguments)}},578001:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getWidfromPath=function(){return l.apply(this,arguments)};var i=r(n(348926)),a=n(984330),o=n(262661),s=n(669050);function l(){return(l=(0,i.default)((function*(e){try{const t=yield(0,o.getUserByCustomURL)(e);return(0,s.createUserWid)(t.user.jid)}catch(e){if(e instanceof a.ServerStatusCodeError)return 404!==e.statusCode&&(__LOG__(4,void 0,new Error,!0)`[custom-url] Error fetching user by custom url ${e.message}`,SEND_LOGS("get-user-by-custom-url-error")),null;throw e}}))).apply(this,arguments)}},520898:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createOrder=function(e,t){return(0,r.createOrder)(e,t)},t.queryOrder=function(e,t,n,i,a){return(0,r.queryOrder)(e,t,n,i,a)};var r=n(968852)},970319:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return("function"==typeof BigInt?BigInt:Number)(String(Date.now())+Math.random().toFixed(4).slice(-4)).toString(36).toUpperCase()}},855309:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.findChat=function(){return u.apply(this,arguments)};var i=r(n(348926)),a=n(88237),o=n(450491),s=n(872722),l=n(485330);function u(){return(u=(0,i.default)((function*(e,t,n){if(null==n?void 0:n.aborted)throw new a.AbortError;const r=yield(0,l.getExisting)(e);if(r)return r;if(!e.isLid()){const t=yield(0,o.getCurrentLid)(e.user);if(t){const e=yield(0,l.getExisting)(t);if(e)return e}}if(null==n?void 0:n.aborted)throw new a.AbortError;return yield(0,s.create)(e,{createdLocally:!0},{forceUsync:t})}))).apply(this,arguments)}},111624:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleNewMsgForChat=function(e,t){if(!t)return;let n=Promise.resolve();t.isSentByMe&&!e.notSpam&&(n=(0,A.updateLocal)(e.id,{notSpam:!0}).then((()=>e.notSpam=!0)));if(t.eventType===h.EventType.IGNORE)return;n.then((0,i.default)((function*(){const n={};e.promises.updateSortTime&&e.promises.updateSortTime.abortController.abort(),(0,p.updateMediasCountOnMsg)(e,t),t.isSentByMeFromWeb&&e.archive&&(0,E.shouldUnarchiveChat)(t.isSentByMe)&&(n.archive=!1),e.promises.setArchive&&e.promises.setArchive.abortController.abort(),t.isSentByMe?e.markedUnread=!1:(0,c.default)({id:e.id,participant:t.author,type:"paused"},!1),yield(0,A.updateLocal)(e.id,n);try{if(O())n.t=t.t,t.eventType!==h.EventType.AMBIENT&&t.eventType!==h.EventType.DEFAULT||t.id.fromMe||(n.unreadCount=e.unreadCount+1||1);else{const{unreadCount:t,timestamp:r}=yield(0,l.getChatMeta)(e.id);n.unreadCount=t,n.t=r}}catch(t){__LOG__(4,void 0,new Error)`onNewMsg: unable to find metadata from chat table for id:${e.id.toString()}`}return n}))).then((n=>{e.set(n);const r=C.default.get(e.id);if(r&&(r.timestamp=(0,o.unixTime)()),"gp2"!==t.type||"add"!==t.subtype&&"create"!==t.subtype||e.getGroupMetadataCollection().trigger(`group_participant_change_${(0,T.getMaybeMeUser)().toString()}`,e.id),!t.isSentByMe){switch(t.eventType){case h.EventType.DEFAULT:case h.EventType.AMBIENT:t.eventType===h.EventType.DEFAULT&&_.Cmd.alertNewMsg(t),e.msgs.length<f.MSG_PRELOAD_THRESHOLD&&d.loadEarlierMsgs(e,void 0,v.default.WEBC_QUERY_TRIGGER_TYPE.NEW_MESSAGE_PREFETCH).catch((0,a.filteredCatch)(u.E404,(()=>{}))).catch((e=>{__LOG__(2)`chat:onNewMsg failed\n${e}`}));break;case h.EventType.NOTEWORTHY:t.type===y.MSG_TYPE.CALL_LOG&&_.Cmd.alertNewMsg(t);break;case h.EventType.SIGNIFICANT:if("gp2"===t.type&&"add"===t.subtype&&(0,T.getMaybeMeUser)().equals(t.recipients[0])&&!e.contact.name)return;_.Cmd.alertNewMsg(t);e.getGroupMetadataCollection().trigger(`group_participant_change_${(0,T.getMaybeMeUser)().toString()}`,e.id)}const r=t.mediaData;if(!r||"image"!==r.type&&"video"!==r.type||_.Cmd.newMediaMsg(t),null!=n.unreadCount&&n.unreadCount>0&&!O()&&(0,m.processOrphanPeerReceipt)(t.id),(0,s.isGroupCatchUpEnabled)()&&(0,h.isImportantMessage)(t)){var i;const n=new S.default({id:t.id.toString(),timestamp:t.t});if(null===(i=e.groupMetadata)||void 0===i||i.unreadMentionMetadata.addUnreadMentions(n,g.UnreadMessageType.NEW_MESSAGE),e.archiveAtMentionViewedInDrawer){const t=new Map;t.set(e.id.toString(),!1),(0,l.updateChatArchiveDrawer)(t),e.archiveAtMentionViewedInDrawer=!1}}}}))};var i=r(n(348926)),a=n(924583),o=n(990445),s=n(493928),l=n(697588),u=n(984330),c=r(n(675600)),d=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=P(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(987561)),p=n(220479),_=n(780549),f=n(292220),h=n(147980),g=n(307988),m=n(522841),y=n(373070),E=n(446556),S=r(n(642034)),T=n(459857),v=r(n(571834)),A=n(669880),C=r(n(774719));function P(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(P=function(e){return e?n:t})(e)}function O(){return!_.Cmd.isOfflineDeliveryEnd}},828927:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearPresence=function(e){e.presenceResendTimerId&&(clearTimeout(e.presenceResendTimerId),e.unset("presenceResendTimerId"));e.pausedTimerId&&(clearTimeout(e.pausedTimerId),e.unset("pausedTimerId"));e.typing=!1},t.markComposing=function(e){return function(e){if(c(e)&&!e.typing){const t=e.id;(0,s.sendChatStateComposing)(t).catch((0,r.filteredCatch)(i.ServerStatusCodeError,(e=>{e.status>=400&&__LOG__(3)`models:chat send presence composing error ${t.toString()}`}))),e.presenceResendTimerId=setTimeout((()=>p(e)),u)}e.typing=!0,e.pausedTimerId&&clearTimeout(e.pausedTimerId);e.pausedTimerId=setTimeout((()=>d(e)),2500)}((0,o.unproxy)(e))},t.markPaused=function(e){return d((0,o.unproxy)(e))},t.markRecording=function(e){return function(e){if(c(e)&&!e.recording){const t=e.id;(0,s.sendChatStateRecording)(t).catch((0,r.filteredCatch)(i.ServerStatusCodeError,(e=>{e.status>=400&&__LOG__(3)`models:chat send presence recording error ${t.toString()}`}))),e.presenceResendTimerId=setTimeout((()=>p(e)),u)}e.pausedTimerId&&(clearTimeout(e.pausedTimerId),e.unset("pausedTimerId"));e.recording=!0,e.typing=!1}((0,o.unproxy)(e))},t.presenceOnlineChanged=function(e){e.presence.isOnline?p(e):e.presenceResendTimerId&&(clearTimeout(e.presenceResendTimerId),e.unset("presenceResendTimerId"))},t.sendPresenceAvailable=function(){(0,l.setPresenceAvailable)()},t.sendPresenceUnavailable=function(){(0,l.setPresenceUnavailable)()};var r=n(924583),i=n(984330),a=n(97858),o=n(411067),s=n(377264),l=n(375026);const u=1e4;function c(e){return!(!e.isUser||!(0,a.shouldRemoveChatStateOptimization)())||!(!e.isGroup&&!e.presence.isOnline)}function d(e){if(c(e)&&(e.typing||e.recording)){const t=e.id;(0,s.sendChatStatePaused)(t).catch((0,r.filteredCatch)(i.ServerStatusCodeError,(e=>{e.status>=400&&__LOG__(3)`models:chat send presence paused error ${t.toString()}`})))}e.presenceResendTimerId&&(clearTimeout(e.presenceResendTimerId),e.unset("presenceResendTimerId")),e.pausedTimerId&&(clearTimeout(e.pausedTimerId),e.unset("pausedTimerId")),e.typing=e.recording=!1}function p(e){const t=e.id;if(e.recording)(0,s.sendChatStateRecording)(t).catch((0,r.filteredCatch)(i.ServerStatusCodeError,(e=>{e.status>=400&&__LOG__(3)`models:chat send presence resend recording error ${t.toString()}`})));else{if(!e.typing)return void e.unset("presenceResendTimerId");(0,s.sendChatStateComposing)(t).catch((0,r.filteredCatch)(i.ServerStatusCodeError,(e=>{e.status>=400&&__LOG__(3)`models:chat send presence resend composing error ${t.toString()}`})))}e.presenceResendTimerId=setTimeout((()=>p(e)),u)}},830390:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.clearChat=y,t.sendClear=function(e,t){return m((0,d.unproxy)(e),t)};var i=r(n(348926)),a=n(924583),o=n(328620),s=n(984330),l=r(n(140854)),u=r(n(932325)),c=n(97858),d=n(411067),p=n(390737),_=n(419026),f=n(669880),h=n(548360),g=n(785893);function m(e,t){const{promises:r}=e;if(r.sendClear)return r.sendClear;const d=e.getLastMsgKeyForAction(),E=r.sendClear=(0,_.sendClear)(e,d,t),S=new o.ActionType(u.default.t(19)),T=E.then((0,i.default)((function*(){const t=n(451402).ConversationEndOfHistoryTransferModelPropType;return e.endOfHistoryTransferType=t.COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY,yield(0,f.updateLocal)(e.id,{endOfHistoryTransferType:t.COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY}),(0,c.clearOrDeleteChatSyncEnabled)()?new o.ActionType(u.default.t(18)):new o.ActionType(h.fbt._("Chat cleared from this device",null,{hk:"1XIeYe"}))}))).catch((0,a.filteredCatch)(s.ServerStatusCodeError,(e=>{if(e.status>=400)return new o.ActionType(u.default.t(17))}))).catch((()=>(__LOG__(3)`models:chat:sendClear dropped`,new o.ActionType(u.default.t(17),{actionText:u.default.t(122),actionHandler:()=>m(e,t)}))));return p.ToastManager.open((0,g.jsx)(o.ActionToast,{id:(0,o.genId)(),initialAction:S,pendingAction:T})),E.then((r=>{if(!0!==r._duplicate){if(!(0,c.clearOrDeleteChatSyncEnabled)()){y(e,t);const{handleSingleMsgMD:r}=n(240493),i=(0,l.default)(e.id,e.contact.privacyMode);return r(i.from,i)}r.result&&function(e,t){e&&t&&e.deleteMessages(t)}(e,r.result)}})).catch((0,a.filteredCatch)(s.ServerStatusCodeError,(()=>{}))).finally((()=>{r.sendClear=null}))}function y(e,t){if(e){const n=e.getLastMsgKeyForAction(),r=n?e.msgs.get(n):void 0;e.deleteMsgsBeforeMsgInclusive(r,t)}}},257630:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addAndSendMsgToChat=function(e,t,r){return function(e,t){let r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const o=Promise.resolve(t).then((t=>{const i=n(301460).MsgCollection,o=(0,a.default)({},t),h=(0,g.getContactPrivacyMode)(e.id);null!=h&&(o.privacyModeWhenSent=h);const{attributeAgentToMessage:m}=n(940748);m(o);const y=i.add(o)[0];if(y){var E;y.wamMessageSendReporter=new d.MessageSendReporter(y),y.wamMessageSendPerfReporter=new c.MessageSendPerfReporter({chatWid:y.to,mediaType:y.getWamMediaType(),messageType:y.getWamMessageType()}),r=(0,u.default)(y,e);const t=r?[r,o]:[o];return null===(E=y.wamMessageSendPerfReporter)||void 0===E||E.startSavedStage(),(0,p.storeMessages)(t,e.id).then((()=>{var e;if(null===(e=y.wamMessageSendPerfReporter)||void 0===e||e.postSavedStage(),y.type===f.MSG_TYPE.GROUPS_V4_INVITE){const e=parseInt(y.inviteCodeExp,10);return(0,n(824737).revokeGroupInvitesV4)(y.from.toString(),y.to.toString(),y.inviteGrp,e).then((()=>(0,l.persistGroupInviteV4Msg)(y.id.toString(),{id:y.id.toString(),from:y.from.toString(),to:y.to.toString(),groupId:y.inviteGrp,expiration:e,expired:(0,s.unixTime)()>=e})))}})).then((()=>y.waitForPrep().then((()=>y))))}throw new _.ModelCreateError("Msg",o)})),h=e.addQueue.enqueue(o).then((t=>{var n;return null===(n=t.wamMessageSendPerfReporter)||void 0===n||n.startRenderedStage(),r&&e.msgs.add(r),e.msgs.add(t)[0]})).then((e=>{var t;return null===(t=e.wamMessageSendPerfReporter)||void 0===t||t.postRenderedStage(),e})),m=i?h.then(i).then((()=>h)):h,y=S(e,m);return[h,y]}((0,y.unproxy)(e),t,r)},t.resendMsgToChat=function(e,t){return S((0,y.unproxy)(e),t)};var i=r(n(348926)),a=r(n(81109)),o=n(431012),s=n(990445),l=n(298466),u=r(n(143249)),c=n(566509),d=n(141797),p=n(74927),_=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=E(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),f=n(373070),h=n(797703),g=n(35109),m=n(709018),y=(n(411562),n(411067));function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(E=function(e){return e?n:t})(e)}function S(e,t){return new h.NonPersistJob("sendMessage",(0,i.default)((function*(){const n=yield e.sendQueue.enqueue(t);return(0,m.sendMsgRecord)(n)})),{priority:o.JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}},214028:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.sendMessageReport=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_.SpamFlow.MessageMenu;const n=(0,f.unproxy)(e);return T(n.chat,t,n)},t.sendMessageReportBlock=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_.SpamFlow.MessageMenu;return C((0,f.unproxy)(e),t)},t.sendNotSpam=function(e,t){return A((0,f.unproxy)(e),t)},t.sendSpamBlockClear=function(e,t){return function(e,t){const{promises:n,isGroup:r,contact:i}=e;if(n.reportSpamBlockClear)return n.reportSpamBlockClear;if(r)return Promise.reject(new d.ActionError);const a=(0,l.getBlockEntryPointFromSpamFlow)(t),o=T(e,t);return n.reportSpamBlockClear=o.then((()=>(0,s.blockContact)(i,a))).then((()=>(0,p.sendClear)(e,!1))).catch((()=>{})).finally((()=>{n.reportSpamBlockClear=null})),n.reportSpamBlockClear}((0,f.unproxy)(e),t)},t.sendSpamExitClear=function(e,t){return function(e,t){const{promises:n,isGroup:r,isReadOnly:i}=e;if(n.reportSpamExitClear)return n.reportSpamExitClear;if(!r)return Promise.reject(new d.ActionError);let a;const o=T(e,t);if(i)a=o;else{const t=(0,u.sendExitGroup)(e);a=Promise.all([o,t])}return n.reportSpamExitClear=a.then((()=>(0,p.sendClear)(e,!1))).catch((()=>{})).finally((()=>{n.reportSpamExitClear=null})),n.reportSpamExitClear}((0,f.unproxy)(e),t)},t.sendSpamReport=function(e,t){return T((0,f.unproxy)(e),t)},t.sendStatusReport=function(e,t){return v(e,t)};var i=n(924583),a=n(328620),o=n(984330),s=n(217020),l=n(54562),u=n(231414),c=r(n(932325)),d=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=E(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),p=n(830390),_=n(453603),f=n(411067),h=n(390737),g=n(816076),m=n(548360),y=n(785893);function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(E=function(e){return e?n:t})(e)}function S(){return{couldntSendReportMsg:m.fbt._("Couldn't send report",null,{hk:"2ZtJYN"}),sendingReportMsg:m.fbt._("Sending report",null,{hk:"2uydPK"}),reportSentMsg:m.fbt._("Report sent",null,{hk:"bZRkW"}),reportNotSentMsg:m.fbt._("Report not sent",null,{hk:"2fMKVK"}),tryAgainMsg:m.fbt._("Try again.",null,{hk:"JaKh8"})}}function T(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,a.genId)();const{promises:s}=e;if(s.sendSpamReport)return s.sendSpamReport;const{sendingReportMsg:l,couldntSendReportMsg:u,tryAgainMsg:c,reportSentMsg:d}=S();let p;p=s.sendSpamReport=null!=n?(0,g.sendMessageReport)(n,t):(0,g.sendSpamReport)(e,t);const _=new a.ActionType(l),f=p.then((()=>new a.ActionType(d))).catch((0,i.filteredCatch)(o.ServerStatusCodeError,(()=>new a.ActionType(u)))).catch((()=>(__LOG__(3)`models:chat:sendSpamReport dropped`,new a.ActionType(u,{actionText:c,actionHandler:()=>T(e,t,n,r)}))));return h.ToastManager.open((0,y.jsx)(a.ActionToast,{id:r,initialAction:_,pendingAction:f})),p.finally((()=>{s.sendSpamReport=null}))}function v(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(0,a.genId)();const r=(0,g.sendStatusSpamReport)(e,t),{sendingReportMsg:s,couldntSendReportMsg:l,tryAgainMsg:u,reportSentMsg:c,reportNotSentMsg:d}=S(),p=new a.ActionType(s),_=r.then((()=>new a.ActionType(c)),(()=>new a.ActionType(d))).catch((0,i.filteredCatch)(o.ServerStatusCodeError,(()=>(__LOG__(3)`models:msg:reportStatus dropped`,new a.ActionType(l))))).catch((()=>(__LOG__(3)`models:msg:reportStatus dropped`,new a.ActionType(l,{actionText:u,actionHandler:()=>v(e,t,n)}))));return h.ToastManager.open((0,y.jsx)(a.ActionToast,{id:n,initialAction:p,pendingAction:_})),r}function A(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(0,a.genId)();const{promises:r,notSpam:s}=e;if(s)return Promise.resolve();if(r.sendNotSpam)return r.sendNotSpam;const l=r.sendNotSpam=(0,g.sendNotSpam)(e);if(t){const r=new a.ActionType(c.default.t(73)),s=l.then((()=>new a.ActionType(c.default.t(75)))).catch((0,i.filteredCatch)(o.ServerStatusCodeError,(()=>new a.ActionType(c.default.t(74))))).catch((()=>(__LOG__(3)`models:chat:sendNotSpam dropped`,new a.ActionType(c.default.t(74),{actionText:c.default.t(122),actionHandler:()=>A(e,t,n)}))));h.ToastManager.open((0,y.jsx)(a.ActionToast,{id:n,initialAction:r,pendingAction:s}))}return l.then((()=>{e.set({notSpam:!0})})).finally((()=>{e.isTrusted(),r.sendNotSpam=null}))}function C(e,t){const{senderObj:n,chat:r}=e,{promises:i}=r;if(i.reportMessageBlock)return i.reportMessageBlock;const a=(0,l.getBlockEntryPointFromSpamFlow)(t),o=T(r,t,e);return i.reportMessageBlock=o.then((()=>(0,s.blockContact)(n,a))).catch((()=>{})).finally((()=>{i.reportMessageBlock=null})),i.reportMessageBlock}},94187:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.sendTcToken=function(){return c.apply(this,arguments)},t.sendTcTokenWhenDeviceIdentityChange=function(){return d.apply(this,arguments)};var i=r(n(348926)),a=n(990445),o=n(965012),s=n(76469),l=n(67081),u=n(147034);function c(){return(c=(0,i.default)((function*(e){if(!e.isUserNotPSA())return;const t=o.ChatCollection.get(e);if(null!=t&&(0,u.shouldSendNewToken)(t.tcTokenSenderTimestamp))try{const n=(0,a.unixTime)();yield(0,l.setPrivacyTokens)(e,[l.TokenType.TrustedContact],n);const r={tcTokenSenderTimestamp:n};t.set(r),yield(0,s.getChatTable)().merge(e.toString(),r)}catch(e){__LOG__(3,!0,void 0,!0)`sendTcToken failed - ${e}`,SEND_LOGS("send-tc-token-failed")}}))).apply(this,arguments)}function d(){return(d=(0,i.default)((function*(e){const t=o.ChatCollection.get(e);if(null==t)return;const n=t.tcTokenSenderTimestamp;if(null!=n&&!(0,u.isTokenExpired)(n,u.TcTokenMode.Sender))try{yield(0,l.setPrivacyTokens)(e,[l.TokenType.TrustedContact],(0,a.castToUnixTime)(n))}catch(e){__LOG__(3,!0,void 0,!0)`sendTcTokenWhenDeviceIdentityChange failed - ${e}`,SEND_LOGS("send-tc-token-device-identity-change-failed")}}))).apply(this,arguments)}},788063:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.unstarAllMessages=function(e,t){return _(e,t?(0,l.unproxy)(t):t)};var i=n(924583),a=n(328620),o=n(984330),s=r(n(932325)),l=n(411067),u=n(390737),c=n(128523),d=n(986632),p=n(785893);function _(e,t){const r=n(965012).ChatCollection,l=t?t.promises:r.promises,f=t?t.id:void 0;if(l.sendUnstarAll)return l.sendUnstarAll;const h=l.sendUnstarAll=(0,c.sendUnstarAll)(e,f),g=new a.ActionType(s.default.t(90)),m=h.then((()=>new a.ActionType(s.default.t(88)))).catch((0,i.filteredCatch)(o.ServerStatusCodeError,(e=>{if(e.statusCode>=400)return new a.ActionType(s.default.t(84))}))).catch((()=>(__LOG__(3)`models:chat:sendUnstarAll dropped`,new a.ActionType(s.default.t(84),{actionText:s.default.t(122),actionHandler:()=>_(e,t)}))));return u.ToastManager.open((0,p.jsx)(a.ActionToast,{id:(0,a.genId)(),initialAction:g,pendingAction:m})),h.then((()=>{e.forEach((e=>{e.set("star",!1)})),t?(0,d.removeStarredMsgs)(e):(d.AllStarredMsgsCollection.reset(),r.forEach((e=>{e.starredMsgs&&e.starredMsgs.reset()})))})).finally((()=>{l.sendUnstarAll=null}))}},780668:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.setTcToken=function(){return u.apply(this,arguments)};var i=r(n(348926)),a=n(81758),o=n(559432),s=n(76469),l=n(485330);function u(){return(u=(0,i.default)((function*(e,t,n){if(null==n)return;if(!e.isUserNotPSA())return;const r=yield(0,l.getExisting)(e);if(null==r)return void(yield(0,o.createOrUpdateOrphanTcToken)(e.toString(),{tcToken:n,tcTokenTimestamp:t}));if(null!=r.tcToken&&(0,a.arrayBuffersEqualUNSAFE)(r.tcToken,n)||null!=r.tcTokenTimestamp&&r.tcTokenTimestamp>t)return;const i={tcToken:n,tcTokenTimestamp:t};r.set(i),yield(0,s.getChatTable)().merge(e.toString(),i)}))).apply(this,arguments)}},232695:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.setTcTokenSenderTimestamp=function(){return l.apply(this,arguments)};var i=r(n(348926)),a=n(559432),o=n(76469),s=n(485330);function l(){return(l=(0,i.default)((function*(e,t){if(!e.isUserNotPSA())return;const n=yield(0,s.getExisting)(e);if(null==n)return void(yield(0,a.createOrUpdateOrphanTcToken)(e.toString(),{tcTokenSenderTimestamp:t}));if(null!=n.tcTokenSenderTimestamp&&n.tcTokenSenderTimestamp>t)return;const r={tcTokenSenderTimestamp:t};n.set(r),yield(0,o.getChatTable)().merge(e.toString(),r)}))).apply(this,arguments)}},987523:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.deleteModelsForLastAddOnPreview=function(e){if(!(0,i.showReactionChatListPreview)())return;const t=new Set(e.map((e=>a.default.fromString(e).remote.toString()))),r=n(965012).ChatCollection;t.forEach((t=>{var n;const i=r.get(t);null!=i&&e.includes(null===(n=i.chatlistPreview)||void 0===n?void 0:n.parentMsgKey)&&i.unset(["chatlistPreview","lastReactionPreview"])}))},t.updateModelsForLastAddOnPreview=function(e){if(!(0,i.showReactionChatListPreview)())return;const t=n(965012).ChatCollection;e.forEach(((e,n)=>{const r=t.get(n);null!=r&&r.set({chatlistPreview:e,lastReactionPreview:void 0})}))};var i=n(97858),a=r(n(565754))},187148:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.clearUnreadMentions=function(e){var t;(0,o.isGroupCatchUpEnabled)()&&e.isGroup&&(null===(t=e.groupMetadata)||void 0===t||t.unreadMentionMetadata.reset())},t.markSeen=function(e,t,n){return function(){return A.apply(this,arguments)}((0,p.unproxy)(e),t,n)},t.markUnread=function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return E((0,p.unproxy)(e),t,n)},t.markUnseen=y,t.sendSeen=m,t.updateUnreadCountMD=C;var i=r(n(348926)),a=n(924583),o=n(493928),s=n(328620),l=n(697588),u=n(984330),c=r(n(846870)),d=r(n(932325)),p=n(411067),_=n(841273),f=n(390737),h=n(572573),g=n(785893);function m(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return S((0,p.unproxy)(e),t).catch((0,a.filteredCatch)(u.ServerStatusCodeError,(e=>{__LOG__(3)`sendSeen: got status ${e.status}`})))}function y(e){!function(e){0!==e.unreadCount&&e.unreadCount!==c.default.MARKED_AS_UNREAD||(e.active&&(e.markedUnread=!0),(0,h.markConversationUnseen)(e.id).then((()=>{e.unreadCount=c.default.MARKED_AS_UNREAD})))}((0,p.unproxy)(e))}function E(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,s.genId)();t?e.active&&(e.markedUnread=!0):e.markedUnread=!1;const{promises:i}=e;if(i.markUnread)return i.markUnread;const o=i.markUnread=t?T(e):S(e),l=t?new s.ActionType(d.default.t(28)):new s.ActionType(d.default.t(27)),c=o.then((()=>{const i=t?d.default.t(26):d.default.t(25);return n?new s.ActionType(i,{actionText:d.default.t(126),actionHandler:()=>E(e,!t,n,r)}):new s.ActionType(i)})).catch((0,a.filteredCatch)(u.ServerStatusCodeError,(e=>{if(e.status>=400)return t?new s.ActionType(d.default.t(24)):new s.ActionType(d.default.t(23));throw new Error("invalid response status")}))).catch((()=>{const i=t?d.default.t(24):d.default.t(23);return n?new s.ActionType(i,{actionText:d.default.t(122),actionHandler:()=>E(e,t,n,r)}):new s.ActionType(i)}));return f.ToastManager.open((0,g.jsx)(s.ActionToast,{id:r,initialAction:l,pendingAction:c})),o.then((()=>{})).catch((0,a.filteredCatch)(u.ServerStatusCodeError,(e=>{__LOG__(3)`markUnread: got status ${e.status}`}))).finally((()=>{i.markUnread=null}))}function S(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.markedUnread||0===e.unreadCount)return String(e.markedUnread),e.unreadCount,Promise.resolve();if(!_.Stream.available&&t)return e.listenToOnce(_.Stream,"change:available",(()=>m(e))),Promise.resolve();e.unreadCount,e.pendingSeenCount;const n=e.unreadCount-e.pendingSeenCount,r=-1===e.unreadCount&&-1===n;if(n<=0&&!r)return Promise.resolve();e.disableUnreadAnchor=!0,e.pendingSeenCount=e.unreadCount,e.unreadCount;const i=()=>{e.pendingSeenCount=e.pendingSeenCount-n,e.pendingSeenCount,e.pendingSeenCount<0&&(__LOG__(3)`models:chat:sendSeen unread ${e.unreadCount} pending: ${e.pendingSeenCount} delta: ${n}`,e.pendingSeenCount=0)},o=e.getLastMsgKeyForAction();return(0,h.sendConversationSeen)(e,o,n).then((()=>{C(e,n)})).catch((0,a.filteredCatch)(u.ServerStatusCodeError,(e=>(i(),Promise.reject(e))))).then((()=>{}))}function T(){return v.apply(this,arguments)}function v(){return(v=(0,i.default)((function*(e){const t=e.getLastMsgKeyForAction();try{yield(0,h.sendConversationUnseen)(e.id,t),y(e)}catch(t){return(0,a.filteredCatch)(u.ServerStatusCodeError,(t=>(e.markedUnread=!1,Promise.reject(t))))(t)}}))).apply(this,arguments)}function A(){return(A=(0,i.default)((function*(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];String(t);let r=null;null!=t?t>0&&t<=e.unreadCount?r=e.unreadCount-t:-1===t&&e.unreadCount<=0&&(r=0):r=0;const i=null==r?Promise.resolve():(0,h.markConversationSeen)(e.id,r);if(yield i,null!=t&&n){const n=e.pendingSeenCount-t;e.pendingSeenCount=Math.max(0,n),e.pendingSeenCount}null!=r&&(e.unreadCount=r),e.unreadMsgAnchor=void 0,e.markedUnread=!1}))).apply(this,arguments)}function C(){return P.apply(this,arguments)}function P(){return(P=(0,i.default)((function*(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const{unreadCount:r}=yield(0,l.getChatMeta)(e.id);if(e.unreadCount,e.unreadCount=r,e.unreadMsgAnchor=void 0,e.markedUnread=!1,n){const n=e.pendingSeenCount-t;e.pendingSeenCount=Math.max(0,n)}}))).apply(this,arguments)}},446556:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.shouldEnableArchiveV2=function(){return!1},t.shouldUnarchiveChat=function(){if((0,i.archiveV2Supported)()&&a.default.showArchiveV2)return!1;return!0};var i=n(97858),a=r(n(897215))},104223:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(669880),o=n(808639),s=n(632081),l=n(10777),u=n(108989);function c(){return(c=(0,i.default)((function*(e,t,n){var r,i;let c=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e.isGroup)return __LOG__(4,void 0,new Error,!0)`chat.maybeUpdateEphemeralSetting should not be called for group ${e.id.toString()}`,SEND_LOGS("handle-ephemeral-sync-response"),!1;if(!(0,l.isEphemeralDurationAllowed)(t))return __LOG__(2)`chat.maybeUpdateEphemeralSetting called with invalid setting ${t} seconds for chat ${e.id.toString()}`,!1;const d=null!==(r=e.ephemeralSettingTimestamp)&&void 0!==r?r:0,p=null!==(i=e.ephemeralDuration)&&void 0!==i?i:0,_=e.id,f=(0,u.shouldUpdateEphemeralSetting)({oldDuration:p,oldSettingTimestamp:d,newDuration:t,newSettingTimestamp:n,chatId:_});return f&&(yield(0,a.updateLocal)(e.id,{ephemeralDuration:t,ephemeralSettingTimestamp:n,disappearingModeInitiator:o.DisappearingModeInitiator.ChangedInChat}),p!==t&&c&&(yield(0,s.generateEphemeralSystemMessage)(e,t)),e.ephemeralDuration=t,e.ephemeralSettingTimestamp=n,e.disappearingModeInitiator=o.DisappearingModeInitiator.ChangedInChat,__LOG__(2)`chat.maybeUpdateEphemeralSetting updated chatId=${e.id.toString()} ephemeralDuration=${t} ephemeralSettingTimestamp=${n}`),f}))).apply(this,arguments)}},726171:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(e.isGroup)return __LOG__(4,void 0,new Error,!0)`chat.updateEphemeralSettingTimestamp should not be called for group ${e.id.toString()}`,void SEND_LOGS("update-ephemeral-setting-timestamp");(0,r.updateLocal)(e.id,{ephemeralSettingTimestamp:t}).then((()=>{e.ephemeralSettingTimestamp=t,__LOG__(2)`chat.updateEphemeralSettingTimestamp chatId=${e.id.toString()} ephemeralSettingTimestamp=${t}`}))};var r=n(669880)},377565:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{chat:t,undelivered:n,canForward:r,cannotForward:o}=e;const s=r.length-n.length,l=o.length+n.length;if(s>0)return n.length?o.length?t.isUser?i.default.t(166,{count:l,_plural:l,contact:t.formattedTitle}):i.default.t(166,{count:l,_plural:l}):i.default.t(165,{count:l,_plural:l}):i.default.t(163,{count:l,_plural:l,contact:t.formattedTitle});if(n.length)return o.length?t.isUser?a.fbt._("No messages could be forwarded because the file is missing or {contact} is on a version of WhatsApp that doesn't support them.",[a.fbt._param("contact",t.formattedTitle)],{hk:"1dNF4S"}):a.fbt._("No messages could be forwarded because the file is missing or __contact__ is on a version of WhatsApp that doesn't support them.",null,{hk:"11bRZ3"}):a.fbt._("No messages could be forwarded because the file is missing.",null,{hk:"1dn9Vk"});if(!t.isUser)return i.default.t(164);return i.default.t(164,{contact:t.formattedTitle})};var i=r(n(932325)),a=n(548360)},866337:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(643930);class i extends((0,r.customError)("ForwardError")){constructor(e){super(),this.reasons=e}}t.default=i},937720:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.databaseUpdatesForDeactivateCommunity=function(e,t){const n=[],r=_.default.get(e);if(null==r||!0!==r.isParentGroup)return n;const i={terminated:!0,parentGroup:void 0},a=(0,s.getCagIdFromCommunity)(e);return a.forEach((e=>{const r=_.default.get(e);(null==r?void 0:r.participants.iAmMember())&&n.push((0,d.persistGroupMetadata)(e,i,t))})),n.push(...v(r,a,e)),n.push(...I(e)),n},t.databaseUpdatesForExitedCommunity=function(e){const t=[];if(!e)return t;const n=_.default.get(e);if(!n||!0!==n.isParentGroup)return t;return t.push(...v(n,n.unjoinedSubgroups,e)),t.push(...I(e)),t},t.databaseUpdatesForIntegrityDeactivateCommunity=function(e,t){const n=[],r=_.default.assertGet(e);if(!0===r.isParentGroup){const i={suspended:!0,terminated:!0};n.push((0,d.persistGroupMetadata)(e,i,t));const a=(0,s.getCagIdFromCommunity)(e);a.forEach((e=>{const r=_.default.get(e);(null==r?void 0:r.participants.iAmMember())&&n.push((0,d.persistGroupMetadata)(e,i,t))})),n.push(...v(r,a,e))}return n},t.databaseUpdatesForSubgroupUnlink=T,t.fetchProfilePicsBatched=function(){return A.apply(this,arguments)},t.updateLastSeenTimestamp=function(){return P.apply(this,arguments)},t.updateModelsForDeactivateCommunity=function(e){const t=_.default.get(e);if(null==t||!0!==t.isParentGroup)return;const n=(0,s.getCagIdFromCommunity)(e);n.forEach((e=>{const t=_.default.get(e);(null==t?void 0:t.participants.iAmMember())&&(null==t||t.set({terminated:!0,parentGroup:void 0}))}));const r=(0,s.formatSubgroupUpdateTypes)(t.joinedSubgroups.filter((e=>!n.includes(e))),!0).concat((0,s.formatSubgroupUpdateTypes)(t.unjoinedSubgroups,!1));S(e,r),O(e)},t.updateModelsForExitedCommunity=function(e){if(!e)return;const t=_.default.get(e);if(!t)return;S(e,(0,s.formatSubgroupUpdateTypes)(t.unjoinedSubgroups,!1)),O(e)},t.updateModelsForIntegrityDeactivateCommunity=function(e){const t=_.default.assertGet(e);if(!0===t.isParentGroup){t.set({suspended:!0,terminated:!0});const n=(0,s.getCagIdFromCommunity)(e);n.forEach((e=>{const t=_.default.get(e);(null==t?void 0:t.participants.iAmMember())&&(null==t||t.set({terminated:!0,suspended:!0}))}));const r=(0,s.formatSubgroupUpdateTypes)(t.joinedSubgroups.filter((e=>!n.includes(e))),!0).concat((0,s.formatSubgroupUpdateTypes)(t.unjoinedSubgroups,!1));S(e,r)}},t.updateModelsForSubgroupLink=function(e){let{parentGroupId:t,subgroups:n,timestamp:r,author:i}=e;const{unjoinedSubgroups:o,joinedSubgroups:s}=C(n);(0,y.updateUnjoinedSubgroupsInCollection)(o,t),(0,y.updateJoinedSubgroupsInCollection)(s,t);if(_.default.assertGet(t).set({lastActivityTimestamp:(0,a.unixTime)()}),(0,E.isMeAccount)(i))return;const c=n.map((e=>({id:(0,g.default)(),timestamp:null!=r?r:(0,a.unixTime)(),communityId:t,type:u.ActivityTypeType.SUB_GROUP_LINK,subgroupName:e.subject,subgroupId:e.id})));l.default.addDeduppedSubgroupLink(c)},t.updateModelsForSubgroupUnlink=S;var i=r(n(348926)),a=n(990445),o=n(965012),s=n(909450),l=r(n(837104)),u=n(722564),c=n(121977),d=n(185212),p=n(226512),_=r(n(318797)),f=n(430599),h=n(76469),g=r(n(243957)),m=n(292390),y=n(198670),E=n(459857);function S(e,t){const{unjoinedSubgroups:n,joinedSubgroups:r}=C(t);(0,y.updateUnjoinedSubgroupsInCollection)(n,e,!1),(0,y.updateJoinedSubgroupsInCollection)(r,e,!1);const i=t.map((e=>e.id.toString()));l.default.remove(i)}function T(e,t){return function(e,t,n){t.forEach((t=>{t.parentGroupId=n?e:void 0}));const{joinedSubgroups:r,unjoinedSubgroups:i}=C(t),a=r.map((t=>(0,d.persistGroupMetadata)(t.id,{parentGroup:n?e.toString():void 0}))),o=(0,f.updateUnjoinedSubgroupsJob)(i,e,n);return[...a,o]}(e,t,!1)}function v(e,t,n){var r,i;return T(n,(0,s.formatSubgroupUpdateTypes)((null!==(r=e.joinedSubgroups)&&void 0!==r?r:[]).filter((e=>!t.includes(e))),!0).concat((0,s.formatSubgroupUpdateTypes)(null!==(i=e.unjoinedSubgroups)&&void 0!==i?i:[],!1)))}function A(){return(A=(0,i.default)((function*(e,t){if(!e.length)return;e.forEach((e=>{const t=m.ProfilePicThumbCollection.get(e.toString());null!=t&&(t.stale=!1)}));(yield(0,p.getProfilePics)(e,t,{subgroupHintId:e[0],type:p.ProfilePicsTypeEnum.PREVIEW,query:p.ProfilePicsQueryEnum.URL})).forEach((e=>{e.updatePicture&&m.ProfilePicThumbCollection.add({id:e.id,previewEurl:e.eurl,stale:!1,tag:e.tag},{merge:!0})}))}))).apply(this,arguments)}function C(e){return e.reduce(((e,t)=>((0,y.determineUnjoined)(t.id)?e.unjoinedSubgroups=e.unjoinedSubgroups.concat(t):e.joinedSubgroups=e.joinedSubgroups.concat(t),e)),{joinedSubgroups:[],unjoinedSubgroups:[]})}function P(){return(P=(0,i.default)((function*(e){const t=(0,a.unixTime)();yield(0,d.persistGroupMetadata)(e.id,{lastSeenActivityTimestamp:t}),e.lastSeenActivityTimestamp=t}))).apply(this,arguments)}function O(e){_.default.remove(e),o.ChatCollection.remove(e),c.ContactCollection.remove(e)}function I(e){const t=[];return t.push((0,h.getGroupMetadataTable)().remove(e.toString())),t.push((0,h.getChatTable)().remove(e.toString())),t.push((0,h.getContactTable)().remove(e.toString())),t}},130714:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.chatCollection=function(){return n(965012).ChatCollection},t.groupMetaDataCollection=function(){return n(318797).default},t.unjoinedSubgroupMetaDataCollection=function(){return n(56992).default}},706536:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.upgradeToCommunity=function(){return s.apply(this,arguments)};var i=r(n(348926)),a=n(287461),o=n(331285);function s(){return(s=(0,i.default)((function*(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=(0,a.getABPropConfigValue)("parent_group_query_ts");e||-1!==t||(yield(0,o.queryAndUpdateAllGroupMetadata)(),__LOG__(2)`upgradeToCommunity: parentGroupQueryTs (${t}), force-fetched groups and set isCommunityDiscovered to true`)}))).apply(this,arguments)}},198670:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.cleanUnjoinedSubgroupsInCollection=function(e,t){const n=(0,o.unjoinedSubgroupMetaDataCollection)().filter((e=>e.parentGroupId.equals(t))).map((e=>e.id)).filter((t=>!e.includes(t)));(0,o.unjoinedSubgroupMetaDataCollection)().remove(n)},t.determineUnjoined=_,t.getUnjoinedSubgroups=function(e){const t=(n=e.map((e=>{let{id:t}=e;return t})),n.filter((e=>_(e))));var n;return e.filter((e=>t.includes(e.id)))},t.subgroupJoinedToUnjoined=function(e,t){const n=(0,o.chatCollection)().get(t.toString()),r=null==n?void 0:n.groupMetadata;if(null==n||null==r)return;if(u(e),0===r.participants.length)return;const i={id:t,subject:n.formattedTitle,defaultSubgroup:!!r.defaultSubgroup,parentGroupId:e.id};(0,s.updateUnjoinedSubgroupsJob)([i],e.id),p([i],e.id)},t.subgroupUnjoinedToJoined=function(e,t){(0,a.removeUnjoinedSubgroupMetadataFromStorage)(t),d(t),c(e),u(e)},t.unlinkParentGroup=function(e,t){(0,o.groupMetaDataCollection)().add({id:t,parentGroup:null},{merge:!0}),u(e)},t.updateJoinedSubgroups=u,t.updateJoinedSubgroupsInCollection=function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];e.forEach((e=>{const{id:r,subject:a}=e;(0,l.updateSubject)(r,null!=a?a:""),(0,o.groupMetaDataCollection)().add((0,i.default)((0,i.default)({},e),{},{parentGroup:n?t:null}),{merge:!0})})),u((0,o.groupMetaDataCollection)().assertGet(t.toString()))},t.updateUnjoinedSubgroups=c,t.updateUnjoinedSubgroupsInCollection=p;var i=r(n(81109)),a=n(699612),o=n(130714),s=n(430599),l=n(926209);function u(e){e.joinedSubgroups=(0,o.groupMetaDataCollection)().filter((t=>{var n;return(null===(n=t.parentGroup)||void 0===n?void 0:n.equals(e.id))&&t.participants.iAmMember()})).map((e=>e.id))}function c(e){e.unjoinedSubgroups=(0,o.unjoinedSubgroupMetaDataCollection)().filter((t=>t.parentGroupId.equals(e.id))).map((e=>e.id))}function d(e){(0,o.unjoinedSubgroupMetaDataCollection)().remove(e.toString())}function p(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];e.forEach((e=>{if(!n)return void d(e.id);let{subject:r,subjectTime:a}=e;const s=(0,o.unjoinedSubgroupMetaDataCollection)().get(e.id.toString());s&&(s.subjectTime||0)>(a||0)&&(r=s.subject,a=s.subjectTime),(0,o.unjoinedSubgroupMetaDataCollection)().add((0,i.default)((0,i.default)({},e),{},{parentGroupId:t,subject:r,subjectTime:a}),{merge:!0})})),c((0,o.groupMetaDataCollection)().assertGet(t.toString()))}function _(e){var t;const n=(0,o.chatCollection)().get(e.toString());return null==n||!(null===(t=n.groupMetadata)||void 0===t?void 0:t.participants.iAmMember())}},404643:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setPushnameLocally=function(e){r.Conn.pushname=e,(0,i.setPushname)(e)};var r=n(266888),i=n(757453)},522414:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addMeToContacts=function(){return u.apply(this,arguments)};var i=r(n(348926)),a=n(714443),o=n(65889),s=n(490474),l=n(459857);function u(){return(u=(0,i.default)((function*(){const e=yield(0,o.requireContactCollection)(),t=(0,l.getMaybeMeUser)(),n=(0,a.toPhoneUserJid)(t.user);yield(0,s.getTable)().createOrMerge(n,{id:n}),e.gadd(t)}))).apply(this,arguments)}},217020:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.blockContact=function(e,t,n){const r=(0,l.getBlockEventMetricFromBlockEntryPoint)(t);return(0,p.logBlockEvent)({contact:e,blockEntryPoint:r,isBlock:!0}),g((0,c.unproxy)(e),!0,n)},t.unblockContact=function(e,t){const n=(0,l.getBlockEventMetricFromBlockEntryPoint)(t);return(0,p.logBlockEvent)({contact:e,blockEntryPoint:n,isBlock:!1}),g((0,c.unproxy)(e),!1)},t.updatePSAUserBlockingStatus=function(){return h.apply(this,arguments)};var i=r(n(348926)),a=n(328620),o=n(984330),s=n(157211),l=n(54562),u=r(n(932325)),c=n(411067),d=n(390737),p=n(437175),_=n(67797),f=n(785893);function h(){return(h=(0,i.default)((function*(e){const t=yield(0,_.updateBlockingStatusForPSAUser)(e),n=e.toString();t?s.BlocklistCollection.add({id:n}):s.BlocklistCollection.remove(n)}))).apply(this,arguments)}function g(e,t,n,r){const{id:i,shareOwnPn:l,phoneJid:c}=e,p=t&&i.isLid()&&null!=c?c:i,h=e.isBlocked();if(t&&h||!t&&!h)return Promise.resolve();const m=(0,_.sendSetBlock)(t,p,l,n).then((e=>{e&&(t?s.BlocklistCollection.add({id:p}):s.BlocklistCollection.remove(p))}));return function(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:(0,a.genId)();const s={participant:e.formattedName},l=n?new a.ActionType(u.default.t(10,s)):new a.ActionType(u.default.t(125,s)),c=t.then((()=>{const t=n?u.default.t(9,s):u.default.t(124,s);return new a.ActionType(t,{actionText:u.default.t(126),actionHandler:()=>g(e,!n,r,i)})})).catch((t=>{if(!(t instanceof o.ServerStatusCodeError)){__LOG__(3)`action:setBlock dropped`;const t=n?u.default.t(8,s):u.default.t(123,s);throw new a.ActionType(t,{actionText:u.default.t(122),actionHandler:()=>g(e,n,r,i)})}if(t.statusCode>=400)throw n?new a.ActionType(u.default.t(8,s)):new a.ActionType(u.default.t(123,s))}));d.ToastManager.open((0,f.jsx)(a.ActionToast,{id:i,initialAction:l,pendingAction:c}))}(e,m,t,n,r),m}},155858:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(643930);class i extends((0,r.customError)("ContactBlocked")){constructor(e,t){super(e),this.contact=t}}t.default=i},349943:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contactFindQuery=function(){return Promise.reject(new Error("This call is only supported in non-MD mode"))}},677159:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getOrQueryUsyncInfo=function(){return _.apply(this,arguments)},t.usyncContactCached=function(){return new a.default(p.queryPhoneExists,{maxCached:100,maxAge:36e4,shouldCache:e=>!!e})};var i=r(n(348926)),a=r(n(667397)),o=n(493928),s=r(n(913430)),l=n(965012),u=n(121977),c=n(824668),d=r(n(115899)),p=n(672604);function _(){return(_=(0,i.default)((function*(e){const t=u.ContactCollection.get(e);var n,r;if(null!=t&&(null!=t.name||null!=l.ChatCollection.get(e)))return{wid:e,biz:t.isBusiness,bizInfo:t.isBusiness?{verifiedName:{level:(0,s.default)(t.verifiedLevel),serial:null,name:t.verifiedName,isApi:Boolean(t.isEnterprise),isSmb:Boolean(t.isSmb),privacyMode:t.privacyMode}}:null,disappearingMode:(0,o.isDisappearingModeEnabled)()?{duration:null!==(n=t.disappearingModeDuration)&&void 0!==n?n:0,settingTimestamp:null!==(r=t.disappearingModeSettingTimestamp)&&void 0!==r?r:0}:null};const i=yield(0,p.queryExists)(e);if(i){const{biz:n,bizInfo:r,disappearingMode:a}=i;return n&&(yield(0,d.default)(e,r)),(0,o.isDisappearingModeEnabled)()&&a&&null!=t&&(yield(0,c.updateDisappearingMode)(e,a.duration,a.settingTimestamp)),i}return Promise.reject(new Error("Invalid number"))}))).apply(this,arguments)}},592036:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addLiveLocation=function(e,t){const n=(0,r.unproxy)(e);n.liveLocations||(n.liveLocations=[]);const{liveLocations:i}=n;i.push(t)},t.removeLiveLocation=function(e,t){const n=(0,r.unproxy)(e),{liveLocations:i}=n;if(!i)return;for(let e=i.length-1;e>=0;e--)if(i[e]===t){i.splice(e,1);break}0===i.length&&(n.liveLocations=null)};var r=n(411067)},702410:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleCopyPhoneNumber=function(e,t,n){(0,a.default)(e),l.ToastManager.open((0,_.jsx)(s.Toast,{msg:p.fbt._("Copied to clipboard.",null,{hk:"3JjQpO"}),id:(0,s.genId)()})),new c.default.PsPhoneNumberHyperlink({phoneNumHyperlinkAction:c.default.PHONE_NUM_HYPERLINK_ACTION_TYPE.CLICK_COPY_PHONE_NUMBER,isPhoneNumHyperlinkOwner:n,phoneNumberStatusOnWa:Boolean(t)}).commit()},t.handleOpenChat=function(e,t,n){o.ModalManager.open((0,_.jsx)(d.OpenChatFlow,{chatId:t,onSuccess:e=>{!function(e,t){if(!e)return;i.ComposeBoxActions.addMsgSendingLogAttributes(e,{handleOnce(){new c.default.PsPhoneNumberHyperlink({phoneNumHyperlinkAction:c.default.PHONE_NUM_HYPERLINK_ACTION_TYPE.MESSAGE_SENT,isPhoneNumHyperlinkOwner:t,phoneNumberStatusOnWa:!0}).commit()}})}(e,n)},msgText:null}),{transition:"modal-flow"}),new c.default.PsPhoneNumberHyperlink({phoneNumHyperlinkAction:c.default.PHONE_NUM_HYPERLINK_ACTION_TYPE.CLICK_MESSAGE_ON_WHATSAPP,isPhoneNumHyperlinkOwner:(0,u.isMeAccount)(t),phoneNumberStatusOnWa:!0}).commit()},t.logClickOnPhoneNumber=function(e,t){new c.default.PsPhoneNumberHyperlink({phoneNumHyperlinkAction:c.default.PHONE_NUM_HYPERLINK_ACTION_TYPE.CLICK_PHONE_NUM_HYPERLINK,isPhoneNumHyperlinkOwner:t,phoneNumberStatusOnWa:Boolean(e)}).commit()},t.logCloseDialog=function(e,t){new c.default.PsPhoneNumberHyperlink({phoneNumHyperlinkAction:c.default.PHONE_NUM_HYPERLINK_ACTION_TYPE.CLOSE_DIALOG_BOX,isPhoneNumHyperlinkOwner:t,phoneNumberStatusOnWa:Boolean(e)}).commit()};var i=n(877171),a=r(n(719838)),o=n(114850),s=n(625786),l=n(390737),u=n(459857),c=r(n(571834)),d=n(850589),p=n(548360),_=n(785893)},753691:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.deleteProfilePic=function(e){return g((0,u.unproxy)(e))},t.setProfilePic=function(e,t,n){return h((0,u.unproxy)(e),t,n)};var i=n(924583),a=n(328620),o=n(984330),s=r(n(932325)),l=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),u=n(411067),c=n(390737),d=n(459857),p=n(670903),_=n(785893);function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function h(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,a.genId)();const{id:u}=e;if(!e.canSet())return Promise.reject(new l.ActionError);const f=(0,p.sendSetPicture)(u,t,n);e.pendingPic=t;const g=(0,d.getMaybeMeUser)(),m=u.equals(g)?new a.ActionType(s.default.t(110)):new a.ActionType(s.default.t(62)),y=f.catch((()=>{throw __LOG__(3)`models:ProfilePicThumb:setPicture dropped`,u.equals(g)?new a.ActionType(s.default.t(109)):new a.ActionType(s.default.t(61))})).catch((0,i.filteredCatch)(o.ServerStatusCodeError,(i=>{if(i.status>=400){const i=u.equals(g)?s.default.t(109):s.default.t(61);return new a.ActionType(i,{actionText:s.default.t(122),actionHandler:()=>h(e,t,n,r)})}}))).then((()=>u.equals(g)?new a.ActionType(s.default.t(108)):new a.ActionType(s.default.t(60))));return c.ToastManager.open((0,_.jsx)(a.ActionToast,{id:r,initialAction:m,pendingAction:y})),f.then((t=>{!0!==t._duplicate&&e.set({tag:t.tag,eurl:t.eurl})})).finally((()=>{e.pendingPic=void 0}))}function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,a.genId)();const{id:n}=e;if(!e.canDelete())return Promise.reject(new l.ActionError);const r=(0,p.requestDeletePicture)(n);e.pendingPic=e.fallbackType;const u=(0,d.getMaybeMeUser)(),f=n.equals(u)?new a.ActionType(s.default.t(107)):new a.ActionType(s.default.t(59)),h=r.catch((()=>{throw __LOG__(3)`models:ProfilePicThumb:deletePicture dropped`,n.equals(u)?new a.ActionType(s.default.t(105)):new a.ActionType(s.default.t(57))})).catch((0,i.filteredCatch)(o.ServerStatusCodeError,(r=>{if(r.status>=400){const r=n.equals(u)?s.default.t(105):s.default.t(57);return new a.ActionType(r,{actionText:s.default.t(122),actionHandler:()=>g(e,t)})}}))).then((()=>n.equals(u)?new a.ActionType(s.default.t(106)):new a.ActionType(s.default.t(58))));return c.ToastManager.open((0,_.jsx)(a.ActionToast,{id:t,initialAction:f,pendingAction:h})),r.then((t=>{!0!==t._duplicate&&e.set({tag:void 0,eurl:void 0})})).finally((()=>{e.pendingPic=void 0}))}},397201:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getStatus=function(){return f.apply(this,arguments)},t.setMyStatus=h;var i=r(n(348926)),a=n(425315),o=n(328620),s=r(n(932325)),l=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=_(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),u=n(390737),c=n(459857),d=n(603774),p=n(785893);function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(_=function(e){return e?n:t})(e)}function f(){return(f=(0,i.default)((function*(e){const t=yield(0,d.getStatus)(e),r={id:e};if((0,a.isNumber)(t.status))switch(t.status){case 429:case 401:case 403:case 404:case 304:r.stale=!0;const t=n(600445).StatusCollection.get(e);t&&!(0,a.isString)(t.status)&&(r.status="");break;default:r.status=""}else{let i=t.status;if(t.stale){const t=n(600445).StatusCollection.get(e);t&&(i=t.status)}r.status=i}return r}))).apply(this,arguments)}function h(){return g.apply(this,arguments)}function g(){return(g=(0,i.default)((function*(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,o.genId)(),r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=e.trim();if(!i)return Promise.reject(new l.ActionError);const a=(0,d.setMyStatus)(i),_=new o.ActionType(s.default.t(121)),f=(0,c.getMaybeMeUser)(),g=n(600445).StatusCollection,m=g.assertGet(f).status,y=a.then((e=>{if(200===e.status){const e=r?void 0:{actionText:s.default.t(126),actionHandler:()=>h(m,t,!0)};return new o.ActionType(s.default.t(119),e)}if(e.status>=400)return new o.ActionType(s.default.t(120))})).catch((()=>{throw __LOG__(3)`models:statusCollection:setMyStatus dropped`,new o.ActionType(s.default.t(120),{actionText:s.default.t(122),actionHandler:()=>h(e,t)})}));u.ToastManager.open((0,p.jsx)(o.ActionToast,{id:t,initialAction:_,pendingAction:y}));const E=yield a;200===E.status&&!0!==E._duplicate&&(g.assertGet(f).status=e)}))).apply(this,arguments)}},931130:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.createGroup=function(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0;return S(e,t,n,r,void 0,i,a)},t.sendForNeededAddRequest=T;var i=r(n(81109)),a=n(924583),o=n(710038),s=n(328620),l=n(984330),u=n(780549),c=n(877171),d=n(121977),p=n(855309),_=r(n(932325)),f=n(292390),h=n(753691),g=n(390737),m=n(782093),y=n(548360),E=n(785893);function S(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:(0,s.genId)(),d=arguments.length>5?arguments[5]:void 0,v=arguments.length>6?arguments[6]:void 0;const A=r.map((e=>e.id)),C=void 0,P=(0,m.sendCreateGroup)(e,A,C,(0,o.randomHex)(8),!1,!1,d,v),O=new s.ActionType(_.default.t(50)),I=P.then((t=>(T(t,e,C),new s.ActionType(_.default.t(49))))).catch((0,a.filteredCatch)(l.ServerStatusCodeError,(e=>406===e.status?new s.ActionType(_.default.t(46)+" "+_.default.t(47)):429===e.status?new s.ActionType(_.default.t(46)+" "+y.fbt._("You've created too many groups too quickly. Try again later.",null,{hk:"2fN2Us"}).toString()):void 0))).catch((()=>(__LOG__(3)`models:chatCollection:createGroup dropped`,new s.ActionType(_.default.t(46),{actionText:_.default.t(122),actionHandler:()=>S(e,t,n,r,i,d)}))));return g.ToastManager.open((0,E.jsx)(s.ActionToast,{id:i,initialAction:O,pendingAction:I})),P.then((e=>{if(null==v&&e.gid&&(0,p.findChat)(e.gid).then((e=>{u.Cmd.openChatBottom(e).then((t=>{t&&c.ComposeBoxActions.focus(e)}))})),t&&n){const r=f.ProfilePicThumbCollection.gadd(e.gid);return(0,h.setProfilePic)(r,t,n).then((()=>e.gid))}return e.gid})).catch((0,a.filteredCatch)(l.ServerStatusCodeError,(()=>{})))}function T(e,t,n,r){if(!e.participants)return;const a=r||e.gid;a||(__LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("Group add request was provided with undefined gid"));const o=[];e.participants.forEach((e=>{if("403"!==e.code)return;const t=d.ContactCollection.gadd(e.userWid,{silent:!0});o.push((0,i.default)((0,i.default)({},e),{},{contact:t}))})),o.length>0&&a&&u.Cmd.openGroupsV4InviteRequestFlow(o,a,t,n)}},231414:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.localExitGroup=C,t.sendExitCommunity=function(e){return v((0,_.unproxy)(e))},t.sendExitGroup=function(e){return T((0,_.unproxy)(e))};var i=r(n(348926)),a=n(924583),o=n(328620),s=n(984330),l=n(150869),u=r(n(932325)),c=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=S(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),d=n(114850),p=n(616491),_=n(411067),f=n(390737),h=n(459857),g=n(735917),m=n(827350),y=n(548360),E=n(785893);function S(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(S=function(e){return e?n:t})(e)}function T(e){const{isGroup:t,promises:n}=e;if(!t)return Promise.reject(new c.ActionError);if(n.sendExit)return n.sendExit;const r=n.sendExit=(0,g.sendExitGroup)(e.id),i=new o.ActionType(u.default.t(56)),l=r.then((()=>new o.ActionType(u.default.t(55)))).catch((0,a.filteredCatch)(s.ServerStatusCodeError,(e=>{if(e.status>=400)return new o.ActionType(u.default.t(54))}))).catch((function(){return __LOG__(3)`actions:chat:sendExit dropped`,new o.ActionType(u.default.t(54),{actionText:u.default.t(122),actionHandler:()=>T(e)})}));return f.ToastManager.open((0,E.jsx)(o.ActionToast,{id:(0,o.genId)(),initialAction:i,pendingAction:l})),r.then((t=>{!0!==t._duplicate&&C(e)})).finally((()=>{n.sendExit=null})).catch((0,a.filteredCatch)(s.ServerStatusCodeError,(()=>{})))}function v(){return A.apply(this,arguments)}function A(){return(A=(0,i.default)((function*(e){const{isGroup:t,promises:r}=e;if(!t)return Promise.reject(new c.ActionError);if(r.sendExit)return r.sendExit;const i=r.sendExit=(0,l.leaveCommunity)(e.id),a=new o.ActionType(y.fbt._("Exiting community",null,{hk:"2Mruou"})),s=i.then((t=>{const{Name:r}=n(21645),i=null!=e.formattedTitle?y.fbt._('You left the community "{community}"',[y.fbt._param("community",(0,E.jsx)(r,{chat:e}))],{hk:"1PNE8e"}):y.fbt._("You left the community",null,{hk:"23OdmD"}),a=()=>{d.ModalManager.close(),v(e)};if(200===t.code)return new o.ActionType(i);500===t.code?d.ModalManager.open((0,E.jsx)(m.CommunityLeaveRetryError,{onOK:a})):d.ModalManager.open((0,E.jsx)(m.CommunityLeaveStandardError,{}))})).catch((e=>{__LOG__(3)`models:groupMetadata:participantCollection:exitCommunity dropped`,429===e.statusCode||500===e.statusCode?d.ModalManager.open((0,E.jsx)(m.CommunityLeaveTryAgainLaterError,{})):d.ModalManager.open((0,E.jsx)(m.CommunityLeaveStandardError,{}))})).finally((()=>{r.sendExit=null}));f.ToastManager.open((0,E.jsx)(o.ActionToast,{id:(0,o.genId)(),initialAction:a,pendingAction:s})),yield i}))).apply(this,arguments)}function C(e){var t;e.isGroup&&(null===(t=e.groupMetadata)||void 0===t||t.participants.remove((0,h.getMaybeMeUser)()),(0,g.markExited)(e.id).then((()=>{e.isReadOnly=!0,(0,p.invalidateChatPollMsgs)(e)})).catch((e=>{throw __LOG__(4,!0,new Error,!0)`failed to merge chat table`,SEND_LOGS("failed to merge chat table when exiting group: "+e),new Error("failed to merge chat table")})))}},863456:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.rejectMembershipApprovalRequest=t.readMembershipApprovalRequestsFromDB=t.queryMembershipApprovalRequestsFromServer=t.approveMembershipApprovalRequest=t.RequestError=t.GroupError=void 0;var i=r(n(348926)),a=n(643930),o=r(n(132375)),s=n(426717),l=n(984330),u=n(198111),c=n(290542),d=n(411067);class p extends((0,a.customError)("GroupError")){constructor(e,t){super(t),this.status=e}}t.GroupError=p;class _ extends((0,a.customError)("RequestError")){constructor(e,t){super(t),this.status=e}}t.RequestError=_;const f=function(){var e=(0,i.default)((function*(e){const t=(0,d.unproxy)(e),n=yield(0,s.getMembershipApprovalRequests)(t.id);(0,o.default)(t.groupMetadata,"chat.groupMetadata").membershipApprovalRequests.add(n,{merge:!0})}));return function(){return e.apply(this,arguments)}}();t.readMembershipApprovalRequestsFromDB=f;const h=function(){var e=(0,i.default)((function*(e){const t=(0,d.unproxy)(e),n=yield(0,u.queryMembershipApprovalRequests)(t.id),{membershipApprovalRequests:r}=(0,o.default)(t.groupMetadata,"chat.groupMetadata"),i=r.filter((e=>!n.some((t=>t.id.equals(e.id)))));yield(0,s.removeMembershipApprovalRequests)(t.id,i.map((e=>e.id))),yield(0,s.addMembershipApprovalRequests)(t.id,n),r.remove(i),r.add(n,{merge:!0})}));return function(){return e.apply(this,arguments)}}();t.queryMembershipApprovalRequestsFromServer=h;const g=function(){var e=(0,i.default)((function*(e,t,n){const r=(0,d.unproxy)(e);try{const[e]=yield(0,c.membershipApprovalRequestAction)(r.id,[t.id],n),{error:i}=e;if(null!=i){const{name:e,value:t}=i;throw new _(Number(t.error),e)}}catch(e){if(e instanceof l.ServerStatusCodeError)throw new p(e.status,e.message);throw e}}));return function(){return e.apply(this,arguments)}}();t.approveMembershipApprovalRequest=(e,t)=>g(e,t,c.MembershipApprovalRequestAction.Approve);t.rejectMembershipApprovalRequest=(e,t)=>g(e,t,c.MembershipApprovalRequestAction.Reject)},331285:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.queryAndUpdateAllGroupMetadata=function(){return T.apply(this,arguments)},t.queryAndUpdateGroupMetadataById=function(){return v.apply(this,arguments)};var i=r(n(348926)),a=n(990445),o=n(287461),s=n(565583),l=n(297031),u=r(n(318797)),c=n(945176),d=n(113269),p=n(614198),_=n(863456),f=n(240493),h=n(848624),g=n(76085),m=n(459857),y=n(15321),E=n(926209),S=n(343609);function T(){return(T=(0,i.default)((function*(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=yield(0,d.queryAllGroups)(),n=yield(0,s.injectPastParticipantsFromDB)(t);if(!n)return;const r=[];n.forEach((t=>{I(t),e&&P(t),r.push(M(t))})),yield(0,l.updateGroupMetadataTableJob)(n),yield(0,l.updateGroupParticipantTableWithoutDeviceSyncJob)(n),e&&(yield A(n)),yield(0,S.createOrReplaceDisplayNamesAndLidPnMappings)(n.reduce(((e,t)=>e.concat(t.participants)),[])),yield Promise.all(r)}))).apply(this,arguments)}function v(){return(v=(0,i.default)((function*(e,t){const n=yield(0,c.queryGroupJob)(e,t),[r]=yield(0,s.injectPastParticipantsFromDB)([n]);yield(0,l.updateGroupParticipantTableWithoutDeviceSyncJob)([r]),I(r),yield M(r)}))).apply(this,arguments)}function A(){return C.apply(this,arguments)}function C(){return(C=(0,i.default)((function*(e){__LOG__(2,void 0,void 0,void 0,["GroupUpdateGroupEndOfHistorySyncFlag"])`Start updateGroupEndOfHistorySyncFlag`;const t=n(451402).ConversationEndOfHistoryTransferModelPropType,r=(0,y.getInitialGroupPhashMap)(),i=n(965012).ChatCollection,a=[];e.forEach((e=>{if(i.get(e.id.toString()))return;null==(null==r?void 0:r[e.id.toString()])&&a.push({unreadCount:0,muteExpiration:0,isAutoMuted:!1,id:e.id,endOfHistoryTransferType:t.NOT_INCLUDED_IN_HIST_SYNC})})),i.add(a,{merge:!0}),yield(0,g.getTable)().bulkCreate(a.map((e=>{let{endOfHistoryTransferType:t,id:n}=e;return{endOfHistoryTransferType:t,id:n.toString(),unreadCount:0,muteExpiration:0,isAutoMuted:!1}}))).catch((e=>{__LOG__(2,void 0,void 0,void 0,["GroupUpdateGroupEndOfHistorySyncFlag"])`One ore more chat create failed for group not synced in initial sync with error: ${e.message} `})),__LOG__(2,void 0,void 0,void 0,["GroupUpdateGroupEndOfHistorySyncFlag"])`Completed updateGroupEndOfHistorySyncFlag`}))).apply(this,arguments)}function P(){return O.apply(this,arguments)}function O(){return(O=(0,i.default)((function*(e){const t=(0,y.getInitialGroupPhash)(e.id.toString());if(null==t)return;const n=yield(0,h.phashV1)(e.participants.map((e=>e.id))),r=n.substring(2);null!=t&&t!==n&&t!==r&&(0,f.handleSingleMsgMD)(e.id,(0,p.genInitialPhashMismatchMsg)(e.id,(0,a.unixTime)()))}))).apply(this,arguments)}function I(e){var t,n,r,i,a,o;(0,E.updateSubject)(e.id,e.subject),u.default.gadd({id:e.id,owner:e.owner,creation:e.creation,desc:e.desc,descId:e.descId,descOwner:e.descOwner,descTime:e.descTime,restrict:e.restrict||!1,announce:e.announce||!1,noFrequentlyForwarded:e.noFrequentlyForwarded||!1,ephemeralDuration:e.ephemeralDuration||0,growthLockExpiration:e.growthLockExpiration,growthLockType:e.growthLockType,membershipApprovalMode:e.membershipApprovalMode,participants:e.participants,pastParticipants:e.pastParticipants,support:null!==(t=e.support)&&void 0!==t&&t,suspended:null!==(n=e.suspended)&&void 0!==n&&n,terminated:null!==(r=e.terminated)&&void 0!==r&&r,isParentGroup:null!==(i=e.isParentGroup)&&void 0!==i&&i,isParentGroupClosed:null!==(a=e.isParentGroupClosed)&&void 0!==a&&a,parentGroup:e.parentGroup,defaultSubgroup:null!==(o=e.defaultSubgroup)&&void 0!==o&&o,deviceStale:!0,size:e.size,incognito:e.incognito})}function M(e){if(e.membershipApprovalMode&&e.participants.some((e=>(0,m.isMeAccount)(e.id)&&e.isAdmin))&&(0,o.getABPropConfigValue)("group_join_request_m2")){const t=n(965012).ChatCollection.get(e.id);if(!t)return;return(0,_.queryMembershipApprovalRequestsFromServer)(t)}}},526128:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.updateModelForGroupAction=function(e,t){const{chatId:n}=e,r=s.ChatCollection.get(n);if(!r)return Promise.resolve();const T=(0,i.default)(r.groupMetadata,"chat.groupMetadata"),{author:v,ts:A}=e;switch(t.actionType){case p.GROUP_ACTIONS.SUBJECT:const s={name:t.subject};r.contact.set(s);break;case p.GROUP_ACTIONS.LINKED_GROUP_DEMOTE:{if(!t.jid)break;const e=d.default.assertGet(t.jid);if(e.participants.iAmAdmin()){const n=t.participants.map((e=>{let{id:t}=e;return{id:t,isAdmin:!1}}));e.participants.add(n,{merge:!0})}else e.participants.remove(t.participants.map((e=>e.id)));if(t.participants.find((e=>(0,S.isMeAccount)(e.id)))){const t=e.participants.filter((e=>!e.isAdmin)).map((e=>e.id));e.participants.remove(t)}break}case p.GROUP_ACTIONS.LINKED_GROUP_PROMOTE:{if(!t.jid)break;const e=d.default.assertGet(t.jid),n=t.participants.map((e=>{let{id:t}=e;return{id:t,isAdmin:!0}}));e.participants.add(n,{merge:!0});break}case p.GROUP_ACTIONS.ADD:case p.GROUP_ACTIONS.PROMOTE:case p.GROUP_ACTIONS.DEMOTE:let P=[];T.participants.iAmAdmin()||t.actionType===p.GROUP_ACTIONS.ADD||t.actionType===p.GROUP_ACTIONS.PROMOTE?(P=t.participants.map((e=>{let{id:t}=e;return t})),t.participants.forEach((e=>{let{lid:t,id:n}=e;null==t||n.isLid()||T.participants.remove(t)}))):t.actionType===p.GROUP_ACTIONS.DEMOTE&&(P=t.participants.map((e=>{let{lid:t,id:n}=e;return null==t||n.isLid()?n:t})),t.participants.forEach((e=>{let{lid:t,id:n}=e;null==t||n.isLid()||T.participants.remove(n)})));const O=P.map((e=>({id:e,isAdmin:"promote"===t.actionType})));if(T.participants.add(O,{merge:!0}),t.actionType===p.GROUP_ACTIONS.ADD&&((0,E.pastParticipantsDbEnabled)()&&P.forEach((e=>{T.pastParticipants.remove(e),(0,S.isMeAccount)(e)&&T.pastParticipants.reset()})),T.membershipApprovalMode&&(0,o.getABPropConfigValue)("group_join_request_m2")&&P.forEach((e=>{T.membershipApprovalRequests.remove(e)})),P.forEach((e=>{d.default.trigger(`group_participant_change_${e.toString()}`,r.id)})),!0===t.isParentGroup&&u.default.add({id:n.toString(),communityId:n,type:c.ActivityTypeType.NEW_COMMUNITY,timestamp:null!=A?A:(0,a.unixTime)()})),P.find((e=>(0,S.isMeAccount)(e))))if(t.actionType===p.GROUP_ACTIONS.PROMOTE){if((0,h.communityAdminPromotionOneTimePromptEnabled)()&&T.groupType===p.GroupType.COMMUNITY){const e=(0,g.getCommunityAdminPromotionNuxKey)(T.id.toString());(0,m.resetNux)(e)}T.membershipApprovalMode&&(0,o.getABPropConfigValue)("group_join_request_m2")&&(0,f.queryMembershipApprovalRequestsFromServer)(r)}else t.actionType===p.GROUP_ACTIONS.DEMOTE&&(0,o.getABPropConfigValue)("group_join_request_m2")&&T.membershipApprovalRequests.reset();break;case p.GROUP_ACTIONS.REMOVE:let I=!1;const M=[],b=[];if(t.participants.forEach((t=>{let{id:n}=t;M.push(n),(0,E.pastParticipantsDbEnabled)()&&b.push({id:n,leaveTs:A,leaveReason:n.equals(e.author)?_.LeaveReason.Left:_.LeaveReason.Removed}),(0,S.isMeAccount)(n)&&(I=!0)})),T.participants.remove(M),T.pastParticipants.add(b),t.reason===p.REMOVE_REASON.DEFAULT_SUBGROUP_DEMOTE&&T.participants.add(t.participants.map((e=>{let{lid:t,id:n}=e;return null==t||n.isLid()||T.participants.iAmAdmin()?{id:n}:{id:t}})),{merge:!0}),t.participants.forEach((e=>{d.default.trigger(`group_participant_change_${e.id.toString()}`,r.id)})),I&&(0,y.invalidateChatPollMsgs)(r),!T.isParentGroupParticipant()&&T.parentGroup){var C;const e=T.getParentGroupChat();null==e||null===(C=e.groupMetadata)||void 0===C||C.trigger("exitParentGroup"),(0,l.updateModelsForExitedCommunity)(T.parentGroup)}break;case p.GROUP_ACTIONS.MODIFY:if(v&&t.participants&&t.participants.length>0){const e=t.participants[0].id,n=T.participants.remove(v);let r=!1,i=!1;n.length&&n[0]&&(r=n[0].isAdmin,i=n[0].isSuperAdmin);const a={id:e,isAdmin:r,isSuperAdmin:i};T.participants.add(a)}break;case p.GROUP_ACTIONS.INVITE_CODE:t.code?T.inviteCode=t.code:__LOG__(3)`model:chat:handleGroupAction:invalid invite code: ${t.code} for ${r.id.toString()}`;break;case p.GROUP_ACTIONS.DESC_ADD:T.set({desc:t.desc,descId:t.descId,descTime:t.descTime,descOwner:null==v?void 0:v.toString()});break;case p.GROUP_ACTIONS.DESC_REMOVE:if(T.descId===t.descId){T.set({desc:void 0,descId:void 0,descTime:void 0,descOwner:void 0});break}break;case p.GROUP_ACTIONS.RESTRICT:T.restrict=!!t.value;break;case p.GROUP_ACTIONS.SUSPEND:T.suspended=!!t.value;break;case p.GROUP_ACTIONS.ANNOUNCE:T.announce=!!t.value;break;case p.GROUP_ACTIONS.NO_FORWARD:T.noFrequentlyForwarded=!!t.value;break;case p.GROUP_ACTIONS.EPHEMERAL:T.ephemeralDuration=t.duration;break;case p.GROUP_ACTIONS.REVOKE_INVITE:break;case p.GROUP_ACTIONS.DELETE:t.reason===p.DELETE_REASON.INTEGRITY_DELETE_PARENT?(0,l.updateModelsForIntegrityDeactivateCommunity)(n):t.reason===p.DELETE_REASON.DELETE_PARENT?(0,l.updateModelsForDeactivateCommunity)(n):T.terminated=!0;break;case p.GROUP_ACTIONS.GROWTH_UNLOCKED:T.growthLockExpiration=void 0,T.growthLockType=void 0;break;case p.GROUP_ACTIONS.GROWTH_LOCKED:"invite"===t.type&&(T.growthLockExpiration=t.expiration,T.growthLockType=t.type);break;case p.GROUP_ACTIONS.PARENT_GROUP_LINK:T.parentGroup=t.groupDatas[0].id;break;case p.GROUP_ACTIONS.SUB_GROUP_LINK:(0,l.updateModelsForSubgroupLink)({parentGroupId:r.id,subgroups:t.groupDatas,timestamp:A,author:e.author});break;case p.GROUP_ACTIONS.SIBLING_GROUP_LINK:T.parentGroup&&(0,l.updateModelsForSubgroupLink)({parentGroupId:T.parentGroup,subgroups:t.groupDatas,timestamp:A,author:e.author});break;case p.GROUP_ACTIONS.PARENT_GROUP_UNLINK:T.parentGroup=void 0;break;case p.GROUP_ACTIONS.SUB_GROUP_UNLINK:(0,l.updateModelsForSubgroupUnlink)(r.id,t.groupDatas);break;case p.GROUP_ACTIONS.SIBLING_GROUP_UNLINK:T.parentGroup&&(0,l.updateModelsForSubgroupUnlink)(T.parentGroup,t.groupDatas);break;case p.GROUP_ACTIONS.MEMBERSHIP_APPROVAL_MODE:(0,o.getABPropConfigValue)("group_join_request_m2")&&(T.membershipApprovalMode=!!t.value,t.value||T.membershipApprovalRequests.reset());break;case p.GROUP_ACTIONS.MEMBERSHIP_APPROVAL_REQUEST:if((0,o.getABPropConfigValue)("group_join_request_m2")){const e=(0,i.default)(v,"author");T.membershipApprovalRequests.add({id:e,t:A,addedBy:e})}break;case p.GROUP_ACTIONS.REVOKED_MEMBERSHIP_REQUESTS:(0,o.getABPropConfigValue)("group_join_request_m2")&&t.requests.forEach((e=>{T.membershipApprovalRequests.remove(e)}));break;default:__LOG__(4,void 0,new Error,void 0,["groups"])`unhandled group notif action in handleGroupAction`}return Promise.resolve()};var i=r(n(132375)),a=n(990445),o=n(287461),s=n(965012),l=n(937720),u=r(n(837104)),c=n(722564),d=r(n(318797)),p=n(862159),_=n(687352),f=n(863456),h=n(97858),g=n(95589),m=n(44925),y=n(616491),E=n(556078),S=n(459857)},326398:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleGroupCreation=function(e,t,n){return function(){return g.apply(this,arguments)}(e,t,n)};var i=r(n(348926)),a=n(121977),o=n(297031),s=n(660913),l=n(789375),u=n(97858),c=n(979891),d=n(459857),p=r(n(571834)),_=n(872722),f=n(485330),h=n(926209);function g(){return(g=(0,i.default)((function*(e,t){var n,r,i;let g=arguments.length>2&&void 0!==arguments[2]&&arguments[2];__LOG__(2,void 0,void 0,void 0,["groups"])`inside handleGroupCreationMD`;const{chatId:m,author:y,pushname:E}=e,{id:S,participants:T,pvId:v,subject:A,creation:C}=t;null!=e.author&&e.author.equals((0,d.getMaybeMeUser)())||new p.default.GroupJoinC({}).commit(),y&&E&&(0,l.updatePushname)(y,E,g),yield Promise.all([(0,s.updateParticipantsJob)(S,T,v,g),(0,o.updateGroupMetadataTableJob)([t])]),__LOG__(2,void 0,void 0,void 0,["groups"])`updated GroupMetadata and participants tables`;let P=yield(0,f.getExisting)(m);if(P){var O;(0,h.updateSubject)(m,A),null===(O=P.groupMetadata)||void 0===O||O.set(t)}else{var I;P=yield(0,_.create)(m,{t:C,pendingInitialLoading:!1,createdLocally:!1},{createdOffline:g}),null===(I=P.groupMetadata)||void 0===I||I.set(t),__LOG__(2,void 0,void 0,void 0,["groups"])`updated chat model and table`;a.ContactCollection.gadd(S).set({name:A}),__LOG__(2,void 0,void 0,void 0,["groups"])`updated contact name`}const M=(null!==(n=null===(r=P.groupMetadata)||void 0===r?void 0:r.participants)&&void 0!==n?n:[]).length,b=null===(i=P.groupMetadata)||void 0===i?void 0:i.announce;!g&&!b&&M&&(0,u.sendKeyDistributionMsgToNewGroups)()&&M>=(0,u.sendKeyDistributionMsgMinGroupSize)()&&(__LOG__(2,void 0,void 0,void 0,["groups"])`handleGroupCreationMD sending key distribution message`,(0,c.sendKeyDistributionMsg)(P).then((()=>{__LOG__(2,void 0,void 0,void 0,["groups"])`handleGroupCreationMD sending key distribution message: done`})).catch((e=>{__LOG__(3,void 0,void 0,void 0,["groups"])`handleGroupCreationMD sending key distribution message failed: ${e}`})))}))).apply(this,arguments)}},672503:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getPendingParticipants=function(e){return(0,u.getPendingParticipants)(e)},t.joinGroupViaInviteV4=function(e,t,n,r){return(0,u.sendJoinGroupViaInviteV4)(e,t,n,r)},t.queryGroupInviteV4Info=function(){return c.apply(this,arguments)},t.revokeGroupInviteV4=function(e,t){return(0,u.sendRevokeGroupInviteV4)(e,t)};var i=r(n(348926)),a=n(965012),o=n(121977),s=n(848624),l=n(669050),u=n(699706);function c(){return(c=(0,i.default)((function*(e,t,r,i){let c=null;const d=n(318797).default.get(r);return d&&(c=yield(0,s.phashV1)(d.participants.map((e=>e.id)))),(0,u.sendQueryGroupInviteV4)(e,t,r,i,c).then((e=>{if(null!=e.status&&e.status>0)return e;if(null!=e.id)return o.ContactCollection.gadd(e.id),e;const t=n(318797).default.assertGet((0,l.createWidFromWidLike)(r)),i=a.ChatCollection.assertGet(t.id).contact.name;return{id:t.id,owner:t.owner,creation:t.creation,desc:t.desc,descId:t.descId,descOwner:t.descOwner,descTime:t.descTime,restrict:t.restrict,announce:t.announce,ephemeralDuration:t.ephemeralDuration,membershipApprovalMode:t.membershipApprovalMode,growthLockExpiration:t.growthLockExpiration,growthLockType:t.growthLockType,noFrequentlyForwarded:t.noFrequentlyForwarded,subject:i,participants:t.participants.map((e=>({id:e.id,isAdmin:e.isAdmin,isSuperAdmin:e.isSuperAdmin})))}}))}))).apply(this,arguments)}},675600:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!(0,i.getMaybeMeUser)().equals(e.id)){const n=r.PresenceCollection.get(e.id);n&&("unsubscribe"===e.type?n.set({isSubscribed:!1,stale:!0}):(a(n,e),t&&n.set({stale:!1})))}return Promise.resolve()};var r=n(935234),i=n(459857);function a(e,t){let n,r=!1;if(void 0===t.type?t.type=e.chatstate.type||"unavailable":"paused"===t.type&&(r=!0,t.type=e.isOnline?"available":"unavailable"),e.isGroup&&"available"!==t.type&&!r&&(t.updateTime=Date.now()),e.isGroup){if(!t.participant)return;t.id=t.participant,t.participant=void 0,n=e.chatstates.gadd(t.id)}else n=e.chatstate;r&&"composing"!==n.type&&"recording"!==n.type||n.set(t),n.expireTimerId&&clearTimeout(n.expireTimerId),"composing"===n.type||"recording"===n.type?n.expireTimerId=setTimeout((()=>function(e){const t=e.type;"composing"!==t&&"recording"!==t||(e.type="available")}(n)),25e3):n.expireTimerId=void 0;const i=e.forceDisplay||e.isOnline||e.isUser&&!e.chatstate.deny;e.set({hasData:!0,isSubscribed:!0,forceDisplay:i})}},346702:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.changeProfilePicThumb=function(){return o.apply(this,arguments)};var i=r(n(348926)),a=n(292390);function o(){return(o=(0,i.default)((function*(e,t){yield a.ProfilePicThumbCollection.imageChanged(e,t)}))).apply(this,arguments)}},927540:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.queryServerProps=function(){return s||(s=(0,o.queryServerProps)().then((e=>{a.ServerProps.updateProps(e),__LOG__(2,void 0,void 0,void 0,["serverprops"])`--- Print ServerProps Start ---`,Object.keys(a.ServerProps.attributes).forEach((e=>{__LOG__(2,void 0,void 0,void 0,["serverprops"])`key: ${e}, value: ${a.ServerProps.attributes[e]}, type: ${typeof a.ServerProps.attributes[e]}`})),__LOG__(2,void 0,void 0,void 0,["serverprops"])`--- Print ServerProps End ---`})).catch((0,r.filteredCatch)(i.ServerStatusCodeError,(()=>{}))).finally((()=>{s=null})),s)};var r=n(924583),i=n(984330),a=n(241588),o=n(577673);let s},477677:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.processOrphanAck=function(){return h.apply(this,arguments)},t.updateMsgAck=_;var i=r(n(348926)),a=n(402994),o=n(359987),s=n(357593),l=n(301460),u=r(n(710882)),c=r(n(124928)),d=n(669050),p=n(2647);function _(){return f.apply(this,arguments)}function f(){return(f=(0,i.default)((function*(e,t,n){const{ack:r,t:i,from:l,to:p}=n,{remote:_,id:f}=e.id;e.updateAck(r,i);const{deliveryPrivacyMode:h}=n;if(r===a.ACK.RECEIVED&&null!=h&&e.isSentByMe&&(yield(0,s.handlePrivacyModeTransition)(_,h).catch((()=>{__LOG__(4,void 0,new Error,!0)`msg ack: handlePrivacyModeTransition failed`,SEND_LOGS("msg ack: handlePrivacyModeTransition failed")})),yield(0,u.default)(e,h)),c.default.isUser(_)){if(yield(0,o.frontendSendAndReceive)("updateMsgInfo",{id:f,from:l,to:p,ack:r,participant:_,t:i}),t&&c.default.isBroadcast(t)){const e=t instanceof c.default?t:(0,d.createWid)(t);yield(0,o.frontendSendAndReceive)("updateMsgInfo",{id:f,from:l,to:e,ack:r,participant:_,t:i})}}else c.default.isStatusV3(_)&&(yield(0,o.frontendSendAndReceive)("updateMsgInfo",{id:f,from:l,to:_,ack:r,participant:p,t:i}))}))).apply(this,arguments)}function h(){return(h=(0,i.default)((function*(e){const t=l.MsgCollection.get(e);if(t)try{const e=yield(0,p.getHighestAck)(t);if(!e||e.ack===t.ack)return;return _(t,null,e)}catch(e){__LOG__(4,void 0,new Error)`Assertion failed: processOrphanAck failed!`}else __LOG__(2)`processOrphanAck: skip for msgId: ${String(e)}`}))).apply(this,arguments)}},980330:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.maybeUpdateAddOnAckForMsgAction=function(e,t){const n=h(e);if(null==n)return;(0,o.maybeUpdateAddOnAcks)(new Map([[n,[{msgKey:e.id.toString(),ack:t}]]]))},t.updateAddOnCollectionsSendStatesAction=f,t.updateAddOnSendStatesAction=p,t.updateAddOnSendStatesForMsgAction=function(e,t){const n=h(e);return null==n?Promise.resolve():p(new Map([[n,[(0,a.default)({msgKey:e.id.toString()},t)]]]))};var i=r(n(348926)),a=r(n(81109)),o=n(302947),s=r(n(565754)),l=n(373070),u=n(48907),c=n(925155),d=n(564121);function p(){return _.apply(this,arguments)}function _(){return(_=(0,i.default)((function*(e){const t=new Map;for(const[n,r]of e){const e=r.map((e=>null==e.ack?null:{msgKey:e.msgKey,ack:e.ack})).filter(Boolean);t.set(n,e)}yield(0,o.updateAddOnAcks)(t),f(e)}))).apply(this,arguments)}function f(e){for(const[t,n]of e)for(const e of n){const n=g(t,s.default.from(e.msgKey));null!=n&&(null!=e.ack&&(n.ack=e.ack),null!=e.isSendFailure&&(n.isSendFailure=e.isSendFailure))}}function h(e){switch(e.type){case l.MSG_TYPE.REACTION:case l.MSG_TYPE.REACTION_ENC:return d.MessageAddOnType.Reaction;case l.MSG_TYPE.POLL_UPDATE:if("poll_vote"===e.subtype)return d.MessageAddOnType.PollVote}return null}function g(e,t){switch(e){case d.MessageAddOnType.Reaction:return c.ReactionsCollection.getSenderByMsgKey(t);case d.MessageAddOnType.PollVote:return u.PollVoteCollection.getByMsgKey(t);case d.MessageAddOnType.KeepInChat:case d.MessageAddOnType.MessageEdit:case d.MessageAddOnType.Unknown:return null}}},816749:(e,t,n)=>{"use strict";var r=n(595318);t.r$=function(){return _.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(907539),s=n(143130),l=n(267420),u=n(373070);const c=[u.MSG_TYPE.REACTION];function d(){return p.apply(this,arguments)}function p(){return(p=(0,a.default)((function*(e){try{const{futureproofBuffer:t,futureproofParams:n}=e;if(null!=t){if(n)yield(0,s.processDecryptedProto)((0,i.default)((0,i.default)({},n),{},{decrypted:t,reparsing:!0}));else{const{e2eInfo:n,bizInfo:r,info:a}=(0,l.deprecatedGenerateBaseInfoParamsFutureproofReparsing)(e);let o=n;c.includes(e.subtype)&&(o=(0,i.default)((0,i.default)({},n),{},{hideFail:!0})),yield(0,s.processDecryptedProto)({info:a,e2eInfo:o,bizInfo:r,decrypted:t,reparsing:!0})}return e}return null}catch(e){return __LOG__(4,void 0,new Error)`reparseFutureproof: reparse error: ${e}`,null}}))).apply(this,arguments)}function _(){return(_=(0,a.default)((function*(e){try{const{getAddOnProviderForFutureproofMsg:t}=n(577721),r=[],i=[];e.forEach((e=>{const n=(0,o.messageFromDbRow)(e);t(n)?r.push(n):e.type===u.MSG_TYPE.UNKNOWN&&i.push(n)})),yield Promise.all(i.map((e=>d(e)))),yield Promise.all(r.map((e=>d(e))))}catch(e){__LOG__(4,void 0,new Error)`reparseFutureproof: processFutureproof error`}}))).apply(this,arguments)}},357593:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handlePrivacyModeTransition=function(){return s.apply(this,arguments)};var i=r(n(348926)),a=n(85734),o=r(n(731302));function s(){return(s=(0,i.default)((function*(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e.isUserNotPSA())return;let{chat:i}=r;if(null==i){const t=n(485330).getExisting;i=yield t(e)}if(null==i)return;const{contact:s}=i;if(!s.isBusiness)return;if(null!=s.privacyMode&&s.privacyMode.privacyModeTs>=t.privacyModeTs)return;const{bypassVerifiedNameUpdate:l=!1}=r,u={isBusiness:s.isBusiness,privacyMode:s.privacyMode};s.set({isBusiness:!0,isEnterprise:!0,privacyMode:t}),yield Promise.all([l?null:(0,a.createOrUpdateVerifiedBusinessName)({id:s.id.isLid()?s.id.toString():s.id.user,isApi:!0,isSmb:!1,privacyMode:{actualActors:t.actualActors,hostStorage:t.hostStorage,privacyModeTs:t.privacyModeTs}},a.VerifiedBusinessNameUpdateType.Merge),(0,o.default)(s.id,u,{isBusiness:!0,privacyMode:t})])}))).apply(this,arguments)}},349965:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.updateMsgInfo=function(e,t,n,r){return function(e,t,n,r){const a=e.id;o.default.isUser(a.remote)?function(e,t,n,r){t===i.ACK.PLAYED?(e.played.get(n)||(e.playedRemaining-=1),e.played.add({id:n,t:r})):t===i.ACK.READ?(e.read.get(n)||(e.readRemaining-=1),e.read.add({id:n,t:r})):t===i.ACK.RECEIVED&&(e.delivery.get(n)||(e.deliveryRemaining-=1),e.delivery.add({id:n,t:r}))}(e,t,n,r):function(e,t,n,r){let a=i.ACK.CLOCK;e.played.get(n)?a=i.ACK.PLAYED:e.read.get(n)?a=i.ACK.READ:e.delivery.get(n)&&(a=i.ACK.RECEIVED);if(t<=a)return;if(t>i.ACK.RECEIVED){const t=e.delivery.get(n);t?e.delivery.remove(t):e.deliveryRemaining-=1}if(t>i.ACK.READ){const t=e.read.get(n);t?e.read.remove(t):e.readRemaining-=1}t===i.ACK.PLAYED?(e.played.get(n)||(e.playedRemaining-=1),e.played.add({id:n,t:r})):t===i.ACK.READ?(e.read.get(n)||(e.readRemaining-=1),e.read.add({id:n,t:r})):t===i.ACK.RECEIVED&&(e.delivery.get(n)||(e.deliveryRemaining-=1),e.delivery.add({id:n,t:r}))}(e,t,n,r)}((0,a.unproxy)(e),t,n,r)};var i=n(402994),a=n(411067),o=r(n(124928))},818201:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.cancelOrDeclinePaymentRequest=function(){return s.apply(this,arguments)},t.fulfillPaymentRequest=function(){return l.apply(this,arguments)};var i=r(n(348926)),a=n(907539),o=n(826933);function s(){return(s=(0,i.default)((function*(e){const t=n(301460).MsgCollection,r=new t.constructor.model(e),i=yield(0,o.processPaymentMessages)([r]);i&&i.forEach((n=>{const r=t.get(n.id);r?r.set((0,a.messageFromDbRow)(n),{merge:!0}):n.id===e.id.toString()&&(e.type=n.type,e.templateParams=n.templateParams)}))}))).apply(this,arguments)}function l(){return(l=(0,i.default)((function*(e){const t=n(301460).MsgCollection,r=new t.constructor.model(e),i=yield(0,o.processPaymentMessages)([r]);i&&i.forEach((e=>{const n=t.get(e.id);n&&n.set((0,a.messageFromDbRow)(e),{merge:!0})}))}))).apply(this,arguments)}},461212:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addPlaceholderAction=function(){return _.apply(this,arguments)},t.populatePlaceholderAction=function(){return h.apply(this,arguments)},t.viewPlaceholderAction=function(){return f.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(990445),s=n(907539),l=n(323197),u=n(313556),c=n(440401),d=r(n(571834)),p=r(n(124928));function _(){return(_=(0,a.default)((function*(e){(yield g(e,{placeholderActionInd:d.default.PLACEHOLDER_ACTION.ADD})).commit()}))).apply(this,arguments)}function f(){return(f=(0,a.default)((function*(e){const t=(0,s.messageFromDbRow)(e);(yield g(t,{placeholderActionInd:d.default.PLACEHOLDER_ACTION.VIEW})).commit()}))).apply(this,arguments)}function h(){return(h=(0,a.default)((function*(e){const t=(0,s.messageFromDbRow)(e);(yield g(t,{placeholderActionInd:d.default.PLACEHOLDER_ACTION.POPULATE})).commit()}))).apply(this,arguments)}function g(){return m.apply(this,arguments)}function m(){return(m=(0,a.default)((function*(e,t){const r=new(n(387191).Msg)(e),a=r.id.remote,s=new d.default.PlaceholderActivity((0,i.default)({placeholderChatTypeInd:v(r),placeholderTimePeriod:Math.max((0,o.unixTime)()-r.t,0),placeholderTypeInd:"fanout"===r.subtype?d.default.PLACEHOLDER_TYPE.FANOUT:d.default.PLACEHOLDER_TYPE.CIPHERTEXT,messageIsRevoke:Boolean(r.asRevoked),messageMediaType:r.getWamMediaType(),messageType:r.getWamMessageType()},t));return(0,u.addTypeOfGroupToMetric)(a,s),yield S(r,s),yield y(r,s),s}))).apply(this,arguments)}function y(){return E.apply(this,arguments)}function E(){return(E=(0,a.default)((function*(e,t){var n;const r=null===(n=e.chat)||void 0===n?void 0:n.id;if(null==r?void 0:r.isGroup()){const n=(0,u.isCagIncognitoFromChatWid)(r),i=e.isReaction();null!=n&&null!=i&&(t.isLid=n&&i);const a=yield(0,c.getGroupMetrics)(r);null!=(null==a?void 0:a.participantCount)&&(t.participantCount=a.participantCount),null!=(null==a?void 0:a.deviceCount)&&(t.deviceCount=a.deviceCount),null!=(null==a?void 0:a.deviceSizeBucket)&&(t.deviceSizeBucket=a.deviceSizeBucket)}else t.isLid=null==r?void 0:r.isLid()}))).apply(this,arguments)}function S(){return T.apply(this,arguments)}function T(){return(T=(0,a.default)((function*(e,t){if((0,l.messageKeyHashEnabled)()){const n=yield(0,l.getMessageKeyHash)(e);null!=n&&(t.messageKeyHash=n)}}))).apply(this,arguments)}function v(e){const t=e.id.remote;return p.default.isGroup(t)?d.default.PLACEHOLDER_CHAT_TYPE.GROUP:p.default.isStatusV3(t)?d.default.PLACEHOLDER_CHAT_TYPE.STATUS:p.default.isBroadcast(t)?d.default.PLACEHOLDER_CHAT_TYPE.BROADCAST:p.default.isUser(t)?d.default.PLACEHOLDER_CHAT_TYPE.INDIVIDUAL:d.default.PLACEHOLDER_CHAT_TYPE.OTHER}},440585:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t._processMultipleMessages=function(){return O.apply(this,arguments)};var i=r(n(348926)),a=n(990445),o=r(n(21099)),s=n(650201),l=r(n(669964)),u=n(390912),c=n(644234),d=n(744526),p=r(n(343087)),_=n(860888),f=n(172259),h=n(97858),g=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=P(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(96219)),m=n(373070),y=n(896472),E=n(647912),S=n(241588),T=n(164832),v=n(757453),A=n(459857),C=r(n(124928));function P(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(P=function(e){return e?n:t})(e)}function O(){return(O=(0,i.default)((function*(e,t,r,i){var P;const{filteredRecs:O,reorderRecs:M,updates:b}=(0,l.default)(e,t,r,i);yield Promise.all(b);const R=n(965012).ChatCollection,N=n(855309).findChat,w=n(301460).MsgCollection;if(0===O.length&&0===M.length){if(e&&!0===r.pendingMsgsDone){const t=R.get(e);t&&(t.pendingMsgs=!1)}return t.map((e=>w.get(e.id))).filter((e=>e))}if(!e)return I(O).then((()=>t.map((e=>w.get(e.id))).filter((e=>e&&!!e.chat))));let L;const D=t[0];if(C.default.isStatusV3(e)){const e=D.id.fromMe?(0,A.getMaybeMeUser)():D.author;L=n(669818).StatusV3Collection.find(e)}else L=N(e);const k=yield L,U=yield I(O),G="after"===r.add||"last"===r.add,x=!r.isHistory;let B,F,j=!1;if("unread"===r.add?(B=i,k.msgChunks.push(B),F=r.firstUnreadKey):"last"===r.add&&!0===r.resume?(B=i,j=!0):B="function"==typeof i?i():i,(0,o.default)(t,U,M,k,G,B||k.msgs,F,j),!0===r.pendingMsgsDone&&(k.pendingMsgs=!1),x&&C.default.isBroadcast(e)&&!C.default.isStatusV3(e)&&U.forEach((function(e){e&&e.recvFresh&&!e.isNotification&&g.broadcastFanout(e)})),u.LegacyPhoneFeatures.supportsFeature(u.LegacyPhoneFeatures.F.RECENT_EMOJI_SYNC))for(let e=0;e<U.length;e++){const t=U[e];if(t.isNewMsg&&t.isSentByMe&&t.containsEmoji){y.RecentEmojiCollection.throttledSync();break}}if(null===(P=r.isHistory)||void 0===P||!P){const e=U.map((e=>{var t;if(!(e.isSentByMe&&e.type===m.MSG_TYPE.STICKER)||!0===e.isAvatar)return;const{mediaData:n,mediaObject:r}=e,i=e.id.toString(),o=null==r?void 0:r.entries.entries[0];return{sticker:new T.StickerModel({id:n.filehash,directPath:n.directPath,filehash:n.filehash,encFilehash:(null==o?void 0:o.encFilehash)||n.encFilehash,mediaKey:(null==o?void 0:o.mediaKey)||n.mediaKey,mediaKeyTimestamp:null!=n.mediaKeyTimestamp?n.mediaKeyTimestamp:(0,a.unixTime)(),width:n.fullWidth,height:n.fullHeight,size:n.size,mimetype:n.mimetype,type:f.OUTWARD_TYPES.STICKER,index:0}),timestamp:null!==(t=e.stickerSentTs)&&void 0!==t?t:0,msgId:i}})).filter(Boolean),t=n(951220).RecentStickerCollectionMd;__LOG__(2)`processed ${e.length} recent sticker messages`,e.forEach((e=>t.addNewSticker(e.sticker,e.msgId,e.timestamp)))}if((0,h.isRecentStickersEnabled)()){const e=U.map((e=>{if(!(e.isNewMsg&&e.isSentByMe&&e.type===m.MSG_TYPE.STICKER))return;const{mediaData:t}=e;return{id:t.filehash,directPath:t.directPath,filehash:t.filehash,encFilehash:t.encFilehash,mediaKey:t.mediaKey,mediaKeyTimestamp:null!=t.mediaKeyTimestamp?t.mediaKeyTimestamp:(0,a.unixTime)(),width:t.fullWidth,height:t.fullHeight,size:t.size,mimetype:t.mimetype,type:f.OUTWARD_TYPES.STICKER,index:0}})).filter(Boolean);E.RecentStickerCollection.enqueue(e)}if((0,h.webMediaAutoDownloadEnabled)()&&!C.default.isStatusV3(e)&&U.map((e=>e.asAutoDownloadableMedia)).filter(Boolean).forEach((e=>{d.AutoDownloadQueue.enqueue(e,d.AUTO_DOWNLOAD_TYPES.MEDIA)})),S.ServerProps.webDownloadDocumentThumbMmsEnabled&&U.map((e=>e.asDoc)).filter(Boolean).forEach((e=>{(0,h.webMediaAutoDownloadEnabled)()?d.AutoDownloadQueue.enqueue(e,d.AUTO_DOWNLOAD_TYPES.MMS_THUMBNAIL):(0,p.default)({msg:e,isPreload:!0})})),U.map((e=>e.asUrl)).filter(Boolean).forEach((e=>{(0,_.hqLinkPreviewExpired)(e.t)||((0,h.webMediaAutoDownloadEnabled)()?d.AutoDownloadQueue.enqueue(e,d.AUTO_DOWNLOAD_TYPES.MMS_THUMBNAIL):(0,p.default)({msg:e,isPreload:!0}))})),(0,s.isFeatureEnabled)("download_status_thumb_mms")&&C.default.isStatusV3(e)){const e=(0,v.getLastStatusUsage)();(null==e||Date.now()-e<12096e5)&&U.map((e=>e.asImage||e.asVideo)).filter(Boolean).forEach((e=>{(0,h.webMediaAutoDownloadEnabled)()?d.AutoDownloadQueue.enqueue(e,d.AUTO_DOWNLOAD_TYPES.MMS_THUMBNAIL):(0,c.downloadStatusV3Thumbnail)({msg:e,isPreload:!0})}))}return t.map((e=>w.get(e.id))).filter((e=>e))}))).apply(this,arguments)}function I(){return M.apply(this,arguments)}function M(){return(M=(0,i.default)((function*(e){let t=n(301460).MsgCollection.add(e,{merge:!0});return t=t.filter(((t,n)=>(null==t&&(__LOG__(4,void 0,new Error,!0)`Get empty message with id ${e[n].id}.`,SEND_LOGS("msgPrepWork-empty-message")),null!=t))),yield Promise.all(t.map((e=>e.waitForPrep().catch((e=>{__LOG__(4,void 0,new Error,!0)`Assertion failed! ${String(e)}`,SEND_LOGS("bad-msg-prep")}))))),t}))).apply(this,arguments)}},886829:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.revoke=k,t.sendRevoke=function(e,t,r){return function(e,t,r){if(t===d.Revoke.Sender&&!e.id.fromMe)return Promise.reject(new Error("revoking received message"));let a;e.id.remote.isGroup()&&(a=(0,b.getMeUser)());const l=new y.default({id:y.default.newId(),remote:e.id.remote,fromMe:!0,participant:a}),u=function(e){switch(e){case d.Revoke.Sender:return"sender_revoke";case d.Revoke.Admin:return"admin_revoke"}}(t),c=(0,s.unixTime)(),_={id:l,from:(0,b.getMeUser)(),to:e.id.remote,t:c,type:T.MSG_TYPE.PROTOCOL,subtype:u,protocolMessageKey:e.id,clearMedia:!!r,local:!0,revokeDuration:c-e.t,revokeTimestamp:c},f=new E.Msg(_);return f.wamMessageSendPerfReporter=new h.MessageSendPerfReporter({chatWid:f.to,mediaType:f.getWamMediaType(),messageType:f.getWamMessageType()}),f.wamMessageSendPerfReporter.setIsRevokeMessage(!0),new v.NonPersistJob("sendMessage",(0,i.default)((function*(){try{var t,r;null===(t=f.wamMessageSendPerfReporter)||void 0===t||t.startSavedStage(),yield(0,g.storeMessages)([_],e.chat.id),null===(r=f.wamMessageSendPerfReporter)||void 0===r||r.postSavedStage()}catch(e){throw __LOG__(4,!0,new Error,!0)`_sendRevoke: failed to storeMessages into storage`,SEND_LOGS("storeMessages failed"),e}return(yield(0,P.sendMsgRecord)(f))===O.SendMsgResult.OK?(new R.default.SendRevokeMessage({messageType:e.getWamMessageType(),messageMediaType:e.getWamMediaType(),revokeSendDelay:f.revokeDuration}).commit(),(0,p.processRevokeMsgs)([{revokeMsgKey:e.id,newMsgKey:l,timestamp:e.t,revokeTimestamp:c,subtype:u,sender:(0,b.getMeUser)()}]).then((0,i.default)((function*(){const t=n(628905).getJobManager;return(0,M.deleteModelsForLastAddOnPreview)([e.id.toString()]),yield t().waitUntilPersisted(A.jobSerializers.deleteAddOns(e.chat.id.toString(),[e.id.toString()])),k(e,{msgKey:l,subtype:u,sender:(0,b.getMeUser)(),revokeTimestamp:c}),O.SendMsgResult.OK})))):Promise.resolve(O.SendMsgResult.ERROR_UNKNOWN)})),{priority:o.JOB_PRIORITY.UI_ACTION}).waitUntilCompleted()}((0,I.unproxy)(e),t,r)};var i=r(n(348926)),a=r(n(604788)),o=n(431012),s=n(990445),l=n(493928),u=n(697588),c=n(220479),d=n(780549),p=n(488300),_=n(110567),f=D(n(644234)),h=n(566509),g=n(74927),m=n(97858),y=r(n(565754)),E=n(387191),S=D(n(96219)),T=n(373070),v=n(797703),A=n(323829),C=n(140661),P=n(709018),O=n(411562),I=n(411067),M=n(987523),b=n(459857),R=r(n(571834)),N=r(n(124928)),w=n(814929);function L(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(L=function(e){return e?n:t})(e)}function D(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=L(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function k(e,t){return function(e,t){var r;const i="admin_revoke"===t.subtype;if(i&&!(0,m.adminRevokeReceiverEnabled)())return void __LOG__(2)`revoke: admin revoke feature is disabled, ${e.id.toString()} has not been revoked`;if(i||(0,l.isSenderRevokeWindowReceiverEnabled)()){if(!((0,s.unixTime)()-e.t<=C.REVOKE_WINDOW_V2+C.REVOKE_WINDOW_V2_RECEIVER_MARGIN))return void __LOG__(2)`revoke: outside of revoke window, ${e.id.toString()} has not been revoked`}n(478353).LabelCollection.removeAllLabelsMD(e),S.typeIsMms(e)&&f.deregisterMsg(e);e.chat&&e.chat.removeFromCollection(e);e.trigger("revoked");const o=e.getCollection(),d=e.id;e.msgChunk&&e.msgChunk.replaceId(d,t.msgKey);o.replaceId(d,t.msgKey);const p=null===(r=e.chat)||void 0===r?void 0:r.isUnreadMsg(e),h={id:t.msgKey,type:T.MSG_TYPE.REVOKED,subtype:"admin_revoke"===t.subtype?"admin":"sender",revokeSender:t.sender,revokeTimestamp:t.revokeTimestamp,body:void 0,caption:void 0,clientUrl:void 0,deprecatedMms3Url:void 0,loc:void 0,lat:void 0,lng:void 0,isLive:void 0,accuracy:void 0,speed:void 0,degrees:void 0,comment:void 0,sequence:void 0,shareDuration:void 0,finalLat:void 0,finalLng:void 0,finalAccuracy:void 0,finalThumbnail:void 0,finalSpeed:void 0,finalDegrees:void 0,finalTimeOffset:void 0,title:void 0,description:void 0,canonicalUrl:void 0,matchedText:void 0,thumbnail:void 0,richPreviewType:void 0,doNotPlayInline:void 0,quotedMsg:void 0,quotedStanzaID:void 0,quotedRemoteJid:void 0,quotedParticipant:void 0,mediaData:void 0,mentionedJidList:void 0,vcardList:void 0,star:!1,kicState:void 0,kicTimestampMs:void 0,kicKey:void 0};e.set(h),e.trigger("change:msgKey",{newKey:t.msgKey,oldKey:d}),e.chat&&((0,c.updateMediasCountOnMsg)(e.chat,e,!0),d.equals(e.chat.lastReceivedKey)&&(0,w.setLastReceivedKey)(e.chat.id,t.msgKey).then((()=>{e.chat.lastReceivedKey=t.msgKey})),e.chat.composeQuotedMsg===e&&(e.chat.composeQuotedMsg=null),(0,l.isSenderRevokeUiEnabled)()&&p&&(e.chat.unreadCount=Math.max(e.chat.unreadCount-1,0),(0,u.reduceChatUnreadCount)(e.chat.id.toString())));e.isLive&&n(557346).LiveLocationCollection.removeMsg(e);if(N.default.isBroadcast(d.remote)){const r=S.getBroadcastFanoutKeys(d),i=S.getBroadcastFanoutKeys(t.msgKey);if(!r||!i||r.length!==i.length)return void __LOG__(2)`cannot fanout revoke: ${String(r)} ${String(i)}`;(0,a.default)(r,i).forEach((e=>{const n=o.get(e[0]);n&&k(n,{msgKey:e[1],subtype:t.subtype,sender:t.sender})})),_.ftsClient.purge([String(e.rowId)]).catch((()=>{}));const s=n(628905).getJobManager,l=e.chat?e.chat.id.toString():e.id.remote.toString();(0,M.deleteModelsForLastAddOnPreview)([d.toString()]),s().fireAndForget(A.jobSerializers.deleteAddOns(l.toString(),[d.toString()]))}}((0,I.unproxy)(e),t)}},887502:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.revokeAllStatusPSA=function(){const e=o.StatusV3Collection.getPSAStatus();if(!e)return Promise.resolve();const t=e.msgs.map((e=>e.id.toString()));return s(e,t)},t.revokeStatusPSA=function(e){const t=o.StatusV3Collection.getPSAStatus();if(!t)return Promise.resolve();const n=t.msgs.filter((t=>t.campaignId===e)).map((e=>e.id.toString()));return s(t,n)};var i=r(n(348926)),a=n(74927),o=n(669818);function s(){return l.apply(this,arguments)}function l(){return(l=(0,i.default)((function*(e,t){t.length>0&&(e.revokeMsgs(t),yield(0,a.removeMessagesFromHistory)(t),__LOG__(2,void 0,void 0,void 0,["revoke-status-psa"])`revokeStatusPSA completed`)}))).apply(this,arguments)}},979891:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.sendKeyDistributionMsg=function(){return u.apply(this,arguments)};var i=r(n(348926)),a=r(n(318797)),o=r(n(565754)),s=n(459857),l=n(669050);function u(){return(u=(0,i.default)((function*(e){if(!e.isGroup)return Promise.reject(new Error("[messaging] sendKeyDistributionMsg: only group chats are supported`"));const t=e.id,r=(0,s.getMaybeMeUser)(),i=new o.default({from:r,to:t,id:o.default.newId(),participant:(0,l.toUserWid)(r),selfDir:"out"});yield a.default.find(e.id);const{encryptAndSendKeyDistributionMsg:u}=n(919820);return u(i)}))).apply(this,arguments)}},709018:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.sendMsgRecord=function(){return R.apply(this,arguments)};var i=r(n(348926)),a=n(618445),o=n(924583),s=n(293594),l=n(204597),u=n(402994),c=n(980330),d=n(984330),p=n(157211),_=r(n(846870)),f=r(n(155858)),h=n(121977),g=n(141797),m=r(n(565754)),y=n(96219),E=n(373070),S=n(403385),T=n(411562),v=n(214028),A=n(187148),C=n(459857),P=r(n(571834)),O=r(n(124928)),I=n(814929),M=n(59293),b=n(643011);function R(){return(R=(0,i.default)((function*(e){return e.wamMessageSendReporter=e.wamMessageSendReporter||new g.MessageSendReporter(e),O.default.isGroup(e.to)&&(yield n(318797).default.find(e.to)),(0,s.promiseCallSync)((()=>{const t=e.id,r=n(855309).findChat;let i;r(t.remote).then((e=>{e.isTrusted()||(0,v.sendNotSpam)(e).catch((()=>{}))})),O.default.isBroadcast(e.to)&&(i=(0,y.broadcastFanout)(e)),e.isNewMsg=!0;const s=e.type===E.MSG_TYPE.PROTOCOL&&["sender_revoke","admin_revoke"].includes(e.subtype),g=e.isReaction()&&e.reactionText===S.REVOKED_REACTION_TEXT;if(!e.isGroupMsg&&!s&&!g&&p.BlocklistCollection.get(e.to))return Promise.reject(new f.default("Contact is blocked",h.ContactCollection.assertGet(e.to)));let R;s||(R=new P.default.WebcMessageSend({messageType:e.getWamMessageType(),messageMediaType:e.getWamMediaType(),messageIsForward:Boolean(e.isForwarded)}));const N=n(301460).MsgCollection;return r(e.id.remote).then((t=>((0,A.sendSeen)(t),e.type===E.MSG_TYPE.REACTION||e.type===E.MSG_TYPE.REACTION_ENC||e.type===E.MSG_TYPE.KEEP_IN_CHAT||e.type===E.MSG_TYPE.POLL_UPDATE||s||N.trigger(_.default.NEW_MSG_SENT),(0,l.promiseProps)({reply:(0,M.sendMsgRecord)(e),chat:t})))).then((n=>{let{reply:a,chat:o}=n;const s=t.remote;let l=u.ACK.SENT;if(t.fromMe&&(0,C.isMePrimary)(s)?l=u.ACK.READ:a.data&&(l=a.data.ack),e.updateAck(l,a.t),(0,c.maybeUpdateAddOnAckForMsgAction)(e,l),R&&(R.markMessageSendT(),R.commit()),(0,b.logMessageSendForChatThreadLogging)(e),[E.MSG_TYPE.PROTOCOL,E.MSG_TYPE.REACTION,E.MSG_TYPE.KEEP_IN_CHAT].includes(e.type)||(0,I.setLastReceivedKey)(o.id,t).then((()=>{o.lastReceivedKey=t})),O.default.isBroadcast(s))if(i){const e=(0,C.getMaybeMeUser)();i.forEach((n=>{const i=new m.default({from:e,to:n,id:t.id}),a=N.get(i);a&&(a.ack=u.ACK.SENT,null==a.ephemeralStartTimestamp&&a.updateEphemeralStartTimestamp(a.t),r(n).then((e=>{(0,I.setLastReceivedKey)(e.id,i).then((()=>{e.lastReceivedKey=i}))})))}))}else __LOG__(2)`model:msg:createRecord bclist server ack, no recipients`;return T.SendMsgResult.OK})).catch((0,o.filteredCatch)(d.ServerStatusCodeError,(t=>{var n;return 408!==t.status&&(__LOG__(4,void 0,new Error,!0)`Phone responded ${t.status}`,SEND_LOGS("send-not-200")),null===(n=e.wamMessageSendReporter)||void 0===n||n.postFailure({result:P.default.MESSAGE_SEND_RESULT_TYPE.ERROR_NETWORK,isTerminal:!1}),e.wamMessageSendReporter=null,T.SendMsgResult.ERROR_NETWORK}))).catch((0,o.filteredCatch)(a.BufferTooLargeError,(()=>{var t;return null===(t=e.wamMessageSendReporter)||void 0===t||t.postFailure({result:P.default.MESSAGE_SEND_RESULT_TYPE.ERROR_PAYLOAD_TOO_BIG,isTerminal:!0}),e.wamMessageSendReporter=null,T.SendMsgResult.ERROR_UNKNOWN}))).catch((t=>{var n;return __LOG__(3)`model:msg:createRecord dropped msg: ${e.id.toString()}`,__LOG__(4,void 0,new Error,!0)`Got error ${String(t)}`,SEND_LOGS("send-msg-error"),null===(n=e.wamMessageSendReporter)||void 0===n||n.postFailure({result:P.default.MESSAGE_SEND_RESULT_TYPE.ERROR_UNKNOWN,isTerminal:!0}),e.wamMessageSendReporter=null,T.SendMsgResult.ERROR_UNKNOWN}))}))}))).apply(this,arguments)}},411562:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SendMsgResult=void 0;const r=n(76672).Mirrored(["OK","ERROR_NETWORK","ERROR_EXPIRED","ERROR_CANCELLED","ERROR_UPLOAD","ERROR_UNKNOWN"]);t.SendMsgResult=r},710882:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return u.apply(this,arguments)};var i=r(n(348926)),a=n(35109),o=n(968923),s=n(121260),l=r(n(124928));function u(){return(u=(0,i.default)((function*(e,t){if(!l.default.isUser(e.id.remote))return;const n=e.privacyModeWhenSent;if(null!=n&&n.privacyModeTs>t.privacyModeTs)return;const r=(0,a.getReducedPrivacyMode)(t);if(r===(0,a.getReducedPrivacyMode)(n))return;if(null!=e.bizPrivacyStatus)return void __LOG__(3)`msg.bizPrivacyStatus exist already, we can not assign a new value anymore`;const i=c(r);e.bizPrivacyStatus=i,yield(0,s.getTable)().merge(e.id.toString(),{bizPrivacyStatus:i})}))).apply(this,arguments)}function c(e){switch(e){case a.ReducedPrivacyMode.E2EE:return o.WebMessageInfo$BizPrivacyStatus.E2EE;case a.ReducedPrivacyMode.BSP:return o.WebMessageInfo$BizPrivacyStatus.BSP;case a.ReducedPrivacyMode.FB:return o.WebMessageInfo$BizPrivacyStatus.FB}}},919919:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleInitialSyncMsgs=function(e){const t={add:"last",isHistory:!0},r=Object.keys(e).map((n=>(0,l.frontendSendAndReceive)("processMultipleMessages",{chatId:(0,p.createWid)(n),msgObjs:e[n].msgs,meta:t,chatMsgsCollection:null})));return Promise.all([...r,(0,s.storeInitialSyncMessages)(e)]).then((()=>{const t=Array.prototype.concat(...Object.keys(e).map((t=>e[t].msgs.map((e=>e.id.toString())))));return(0,c.checkUpdateForOrphanReactions)(t),(0,o.checkOrphanMutations)(t,Object.keys(e))})).then((()=>{const t=Array.prototype.concat(...Object.keys(e).map((t=>e[t].reactionMessages)));return(0,n(189865).storeReactionMsgBulk)(t)})).then((()=>{if((0,d.isPollVoteProcessingEnabled)())return Promise.all(Array.prototype.concat(...Object.keys(e).map((t=>e[t].pollVotes)))).then((e=>{const t=Array.prototype.concat(...e);return(0,n(189865).storePollVotesBulk)(t)}))})).then((()=>{})).catch((0,a.filteredCatch)(u.LogoutDrop,(()=>{}))).catch((e=>{__LOG__(4,void 0,new Error,!0)`Error: ${e.name}, message: ${e.message}, stack: ${e.stack}`,SEND_LOGS("msg_handler for MD: error storing/processing multiple messages")}))},t.handleProgressiveHistorySyncMsgs=function(){return _.apply(this,arguments)};var i=r(n(348926)),a=n(924583),o=n(61314),s=n(741748),l=n(359987),u=n(984330),c=n(6066),d=n(671598),p=n(669050);function _(){return(_=(0,i.default)((function*(e,t,r,i,p){return yield Promise.resolve(),(0,s.storeRecentAndFullHistSyncMessages)(e,t,!0,!0).then((()=>{const n=t.map((e=>e)),r=e.map((e=>e.id.toString()));return(0,c.checkUpdateForOrphanReactions)(r),(0,o.checkOrphanMutations)(r,n)})).then((()=>(0,n(189865).storeReactionMsgBulk)(r))).then((()=>{if((0,d.isPollVoteProcessingEnabled)())return Promise.all(i).then((e=>{const t=Array.prototype.concat(...e);return(0,n(189865).storePollVotesBulk)(t)}))})).then((()=>{const e=n(965012).ChatCollection;p.forEach((t=>{if(!t||!t.id||!t.id.remote)return;const n=t.id.remote,r=e.get(n);r&&0===r.msgs.length&&!r.pendingInitialLoading&&(0,l.frontendFireAndForget)("processMultipleMessages",{chatId:n,msgObjs:[t],meta:{add:"last",isHistory:!0},chatMsgsCollection:null})}))})).catch((0,a.filteredCatch)(u.LogoutDrop,(()=>{}))).catch((e=>{__LOG__(4,void 0,new Error,!0)`Error: ${e.name}, message: ${e.message}, stack: ${e.stack}`,SEND_LOGS("handleProgressiveHistorySyncMsgs: error storing/processing multiple messages")}))}))).apply(this,arguments)}},240493:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleSingleMsgMD=function(){return C.apply(this,arguments)};var i=r(n(348926)),a=n(989211),o=n(36530),s=n(962833),l=n(61314),u=n(990445),c=n(298466),d=n(260071),p=n(394275),_=n(359987),f=n(984330),h=n(6066),g=n(488300),m=n(641473),y=n(989),E=n(74927),S=n(373070),T=n(323829),v=n(461212),A=r(n(124928));function C(){return(C=(0,i.default)((function*(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],C=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const P={add:"after",update:r,isHistory:!1},O=t.type===S.MSG_TYPE.PROTOCOL&&["sender_revoke","admin_revoke"].includes(t.subtype);let I=t;if(!O){const e=yield(0,d.applyOrphanRevokes)([I]);if(0===e.length)return;I=e[0]}const M=yield(0,m.handleForActiveMessageRange)(e,I);if(M.has(y.ActiveRangeHandlerAction.DropMessage))return;const b=M.has(y.ActiveRangeHandlerAction.SkipUI);try{A.default.isStatusV3(e)&&(yield(0,_.frontendSendAndReceive)("handleStatusV3Update",{rawMsg:I,checksum:null,isMsgUpdate:!1})),yield(0,s.promiseLoop)(function(){var t=(0,i.default)((function*(t,i,s){const l=(0,o.delayMs)((0,a.expBackoff)(s,12e4,1e3,.1));try{if(r)yield(0,E.updateMessage)(I),__LOG__(2,void 0,void 0,void 0,["handleSingleMsgMD"])`placeholder populate successful`;else if(O){yield(0,g.processRevokeMsgs)([{revokeMsgKey:I.protocolMessageKey,newMsgKey:I.id,timestamp:I.t,subtype:I.subtype,sender:I.author,revokeTimestamp:I.t}]),(0,_.frontendFireAndForget)("deleteModelsForLastAddOnPreview",{messagesIds:[I.protocolMessageKey.toString()]});const t=n(628905).getJobManager;yield t().waitUntilPersisted(T.jobSerializers.deleteAddOns(e.toString(),[I.protocolMessageKey.toString()]))}else try{yield(0,E.storeMessages)([I],e),I.type===S.MSG_TYPE.CIPHERTEXT&&(0,v.addPlaceholderAction)(I)}catch(e){if(!(e instanceof E.DuplicateMessageError))throw e;I.type===S.MSG_TYPE.CIPHERTEXT?__LOG__(2)`processPlaceholderMsg: skip creating duplicate placeholder`:(__LOG__(2)`storeMessages loop: detect resend message`,yield(0,E.updateMessage)(I),P.update=!0)}if(I.type===S.MSG_TYPE.GROUPS_V4_INVITE){const e=I.id.toString();yield(0,c.persistGroupInviteV4Msg)(e,{id:e,from:I.from.toString(),to:I.to.toString(),groupId:I.inviteGrp,expiration:parseInt(I.inviteCodeExp,10),expired:(0,u.unixTime)()>=parseInt(I.inviteCodeExp,10)})}__LOG__(2,void 0,void 0,void 0,["handleSingleMsgMD"])`storeMessages loop`,t()}catch(e){return __LOG__(2,void 0,void 0,void 0,["handleSingleMsgMD"])`storeMessages loop: failed with error ${e}.`,s>3?(__LOG__(3)`storeMessages loop: Gave up after ${s} tries`,Promise.reject(e)):l}}));return function(){return t.apply(this,arguments)}}()),__LOG__(2,void 0,void 0,void 0,["messaging"])`handleSingleMsgMD: msgId::${I.id.id}, write message to db done, overwrite: ${r}, skipUI: ${b}`;try{yield(0,l.checkOrphanMutations)([I.id.toString()],[e.toString()]),yield(0,h.checkUpdateForOrphanReactions)([I.id.toString()])}catch(t){__LOG__(4,void 0,new Error)`handleSingleMsgMD: checkOrphanMutations failed during handleSingleMsgMD for: ${String(I.id)} chat: ${String(e)} Error: ${t.name}, message: ${t.message}, stack: ${t.stack}`}b||(I.recvFresh=!0,I.isNewMsg=!0,yield(0,_.frontendSendAndReceive)("processMultipleMessages",{chatId:e,msgObjs:[I],meta:P,chatMsgsCollection:null,preserveOrder:C}))}catch(t){if(t instanceof f.LogoutDrop)return;if(t instanceof p.PreviousMsgNotUpdatableError)return void __LOG__(3)`Msg: ${String(I.id)} chat: ${String(e)} Error: PreviousMsgNotUpdatableError`;__LOG__(3,void 0,void 0,void 0,["messaging"])`Msg: ${String(I.id)} chat: ${String(e)} Error: ${t.name}, message: ${t.message}, stack: ${t.stack}`}}))).apply(this,arguments)}},21099:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,i,a,o,s,l){const u=function(e,t,n,r,i){const a={},o={};let s,l,u,c=n.length,d=i;if(0===c)return{msgs:t,collection:d};for(s=0;s<c;s++)l=n[s],o[l.id]=l;for(c=t.length,s=0;s<c;s++)l=t[s],l&&(a[l.id]=l);const p=[];for(c=e.length,s=0;s<c;s++)if(l=e[s],l&&(u=a[l.id],u&&p.push(u),u=o[l.id],u))if(u.recvFresh)p.push(u),r.removeMsg(u),u.unset("recvFresh");else{const e=r.getAllCMCs().find((function(e){return e.get(u.id)}));i&&e===i||(e?(e.forEach((function(e){p.push(e),delete o[e.id]})),e===r.msgs?(r.replaceMsgsCollection(i),d=r.msgs):(r.notifyMsgCollectionMerge(i,e,i),r.removeMsgsCollection(e))):(__LOG__(3)`models:Msg:reorder trying to merge CMC of orphaned message ${l.id}`,p.push(o[l.id])))}return{msgs:p,collection:d}}(e,t,n,i,o);r.addRecordsToChat(u.msgs,i,a,u.collection,s,l)};var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=i(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=a?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(96219));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(i=function(e){return e?n:t})(e)}},669964:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,i){const l=[],p=[],P=[],b=n(965012).ChatCollection,R=n(301460).MsgCollection;let w=0;t.forEach((t=>{var n;t.id instanceof S.default||(w++,t.id=new S.default({from:t.from,to:t.to,id:t.id,participant:t.participant,selfDir:t.self})),(0,s.isString)(e)&&N.default.isBroadcast(e)&&delete t.broadcast,"ptt"===t.type&&!t.id.fromMe&&t.ack<u.ACK.CLOCK&&(t.ack=u.ACK.CLOCK),null!=t.hydratedButtons&&((n=t).buttons=new I.TemplateButtonCollection,n.buttons.add(n.hydratedButtons.map(((e,t)=>{var n,r;const i=`${null!=e.index?e.index:t}`;return e.quickReplyButton?new M.default({id:i,displayText:e.quickReplyButton.displayText,selectionId:e.quickReplyButton.id,subtype:"quick_reply"}):e.callButton?new M.default({id:i,displayText:e.callButton.displayText,phoneNumber:e.callButton.phoneNumber,subtype:"call"}):new M.default({id:i,displayText:null===(n=e.urlButton)||void 0===n?void 0:n.displayText,url:null===(r=e.urlButton)||void 0===r?void 0:r.url,subtype:"url"})})))),null!=t.dynamicReplyButtons&&function(e){e.replyButtons=new c.ButtonCollection,e.replyButtons.add(e.dynamicReplyButtons.map((e=>{let{buttonId:t,buttonText:n}=e;return new d.default({id:t,displayText:null==n?void 0:n.displayText})})))}(t);let L=R.get(t.id);if(t.type===A.MSG_TYPE.PROTOCOL&&"ephemeral_setting"!==t.subtype&&"share_phone_number"!==t.subtype)switch(t.subtype){case"admin_revoke":if(L=R.get(t.protocolMessageKey),L)if(L.isGroupMsg)if(N.default.equals(L.id.remote,t.id.remote)){__LOG__(2)`getMsgUpdates: admin revoked ${L.id.toString()}`;const e=new T.Msg(t);if((0,y.adminRevokeReceiverEnabled)()){const t=(0,o.default)(L.chat.groupMetadata,"m.chat.groupMetadata"),n=t.participants.get(e.sender);if(!n||!n.isAdmin){if(t.participants.add({id:e.sender,isAdmin:!0},{merge:!0}),!n){const t={actionType:g.GROUP_ACTIONS.ADD,participants:[{id:e.sender,isAdmin:!0,isSuperAdmin:!1}],reason:null},n=(0,h.genGroupNotificationMsg)({author:void 0,chatId:L.chat.id,ts:e.t},t);(0,E.handleSingleMsgMD)(n.from,n)}(0,f.markGroupParticipantStale)({group:L.chat.id})}}(0,O.revoke)(L,{msgKey:e.id,subtype:e.subtype,sender:e.sender,revokeTimestamp:e.t})}else __LOG__(2)`getMsgUpdates: ${L.id.toString()} has not been revoked`,__LOG__(4,void 0,new Error)`getMsgUpdates: admin revoke came for the different group than the original message was in`;else __LOG__(2)`getMsgUpdates: ${L.id.toString()} has not been revoked`,__LOG__(4,void 0,new Error)`getMsgUpdates: admin revoke was sent to a non-group chat`;break;case"sender_revoke":if(L=R.get(t.protocolMessageKey),L){const n=new T.Msg(t);N.default.equals(L.sender,n.sender)?(__LOG__(2)`getMsgUpdates: sender revoked ${L.id.toString()}`,N.default.isStatusV3(e)&&L.msgChunk&&L.msgChunk.remove(L),(0,O.revoke)(L,{msgKey:n.id,subtype:n.subtype,sender:n.sender,revokeTimestamp:n.t})):__LOG__(3)`getMsgUpdates: sender revoke: sender mismatch: ${n.id.toString()} <> ${L.id.toString()}`}break;case"ephemeral_sync_response":const n=b.get(t.id.remote);n&&(0,m.default)(n,t.ephemeralDuration,t.ephemeralSettingTimestamp);break;default:__LOG__(2)`unknown protocolMessage ${t.id.toString()}`}else if(L&&!L.asRevoked){t.ack<L.ack&&delete t.ack;for(const e in t)t.hasOwnProperty(e)&&void 0===t[e]&&delete t[e];r.isHistory&&(t.isNewMsg=!1);const e=L.t?(0,a.default)(t,["t","id","from","to"]):t,n=L.applyUpdate(e).then((()=>L));if(P.push(n),N.default.isBroadcast(L.id.remote)){const t=v.getBroadcastFanoutKeys(L);t&&t.forEach((t=>{const n=R.get(t);n&&P.push(n.applyUpdate(e).then((()=>L)))}))}r.isHistory&&(L.recvFresh||i)&&!L.search?(__LOG__(3)`model:Msg:handle:processMM:${L.recvFresh?"dup:":"overlap:"}${String(L.id)}`,p.push(L)):r.isHistory&&L.search?(L.search=!1,__LOG__(3)`model:Msg:handle:processMM load search as history ${String(L.id)}`,l.push({id:L.id})):"search"===r.add&&l.push({id:L.id})}else{"payment_action_request_declined"===t.subtype||"payment_transaction_request_cancelled"===t.subtype?P.push((0,C.cancelOrDeclinePaymentRequest)(t)):t.type===A.MSG_TYPE.PAYMENT&&"send"===t.subtype&&P.push((0,C.fulfillPaymentRequest)(t));const e=b.get(t.id.remote);"search"===r.add&&(t.search=!0),(0,_.isUnreadTypeMsg)(t)&&t.id.fromMe&&t.ack===u.ACK.CLOCK&&(t.isSendFailure=!0),r.update||l.push(t),!r.isHistory&&"search"!==r.add&&e&&P.push(function(){return k.apply(this,arguments)}(t,e)),t.ephemeralOutOfSync&&__LOG__(2)`ephemeralOutOfSync msgId=${t.id.toString()} chatId=${null==e?void 0:e.id.toString()}`}})),w>0&&__LOG__(2)`_processMultipleMessages: el.id is not a MsgKey: ${w} of ${t.length} messages`;return{filteredRecs:l,reorderRecs:p,updates:P}};var i=r(n(348926)),a=r(n(957557)),o=r(n(132375)),s=n(425315),l=n(287461),u=n(402994),c=n(64609),d=r(n(906787)),p=n(299261),_=n(147980),f=n(608916),h=n(614198),g=n(862159),m=r(n(104223)),y=n(97858),E=n(240493),S=r(n(565754)),T=n(387191),v=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=D(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(96219)),A=n(373070),C=n(818201),P=n(616491),O=n(886829),I=n(154685),M=r(n(439888)),b=n(459857),R=r(n(571834)),N=r(n(124928)),w=n(508133),L=n(298592);function D(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(D=function(e){return e?n:t})(e)}function k(){return(k=(0,i.default)((function*(e,t){if(!e.isNewMsg||!e.recvFresh)return __LOG__(3,void 0,void 0,!0)`processLiveMessage should not be called with history message id ${e.id.toString()}`,SEND_LOGS("bad-process-live-message-call"),Promise.resolve();if(e.type===A.MSG_TYPE.GP2&&"delete"===e.subtype&&(t.isReadOnly=!0,(0,P.invalidateChatPollMsgs)(t)),t.isUser){var n;const a=null!==(n=e.ephemeralDuration)&&void 0!==n?n:0;let o,s=!1;e.type===A.MSG_TYPE.PROTOCOL&&"ephemeral_setting"===e.subtype?o=e.t:e.ephemeralSettingTimestamp&&(o=e.ephemeralSettingTimestamp,s=!0);let l=!1;if(null!=o&&(l=yield(0,m.default)(t,a,o,s)),!(0,_.isNotificationType)(e.type,e.subtype)){var r,i;const n=null!==(r=e.ephemeralDuration)&&void 0!==r?r:0,a=null!==(i=(0,p.getEphemeralSetting)(t))&&void 0!==i?i:0;e.ephemeralOutOfSync=n!==a&&!l,e.ephemeralOutOfSync&&U(e,t)}}}))).apply(this,arguments)}function U(){return G.apply(this,arguments)}function G(){return(G=(0,i.default)((function*(e,t){var n,r,i,a;if(!(0,l.getABPropConfigValue)("out_of_sync_disappearing_messages_logging"))return;const o=null!==(n=e.ephemeralDuration)&&void 0!==n?n:0,s=null!==(r=(0,p.getEphemeralSetting)(t))&&void 0!==r?r:0,u=(0,L.getDisappearingModeSettingForUser)((0,b.assertGetMeUser)()),c=(0,L.getDisappearingModeSettingForUser)(t.id);new R.default.EphemeralOutOfSyncInfo({incomingMessageEphemeralityDuration:o,isAGroup:t.isGroup,threadEphemeralityDuration:s,otherDefaultModeDuration:null!==(i=null==c?void 0:c.duration)&&void 0!==i?i:0,userDefaultModeDuration:null!==(a=null==u?void 0:u.duration)&&void 0!==a?a:0,threadId:yield(0,w.getChatThreadID)(t.id.toJid()),isNewThreadForUser:0===t.msgs.length}).commit()}))).apply(this,arguments)}},323197:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageKeyHash=function(){return _.apply(this,arguments)},t.messageKeyHashEnabled=function(){return(0,s.getABPropConfigValue)("placeholder_message_key_hash_logging")};var i=r(n(348926)),a=n(417405),o=n(128326),s=n(287461),l=n(673168);let u=null;const c=new TextEncoder,d=e=>c.encode(e).buffer;function p(){return u||(u=(0,l.getChatThreadLoggingSecretB64)().then((e=>null==e?null:(0,a.decodeB64)(e)))),u}function _(){return(_=(0,i.default)((function*(e){const t=yield p();if(!t)return null;const n=d(String(e.id.id)),r=yield(0,o.hmacSha256)(t,n);return(0,a.encodeB64)(r)}))).apply(this,arguments)}},44925:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.dismissNux=function(e){return s(e,!0)},t.resetNux=function(e){(0,o.removeNUX)(e);const t=(0,a.getNuxSyncKey)(e);if(null!=t)return i.default.unAcknowledgeNux(t);return Promise.resolve()},t.viewNux=s;var i=r(n(617909)),a=n(95589),o=n(377773);function s(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=(0,o.getNUX)(e),r=null!=n?n:{views:0},s=(0,a.getNuxMaxViews)(e),l=t?s:r.views+1;if((0,o.setNUX)(e,{views:l}),l>=s){const t=(0,a.getNuxSyncKey)(e);if(null!=t)return i.default.acknowledgeNux(t)}return Promise.resolve()}},313687:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.syncPrivacyDisallowedLists=s,t.syncSinglePrivacyDisallowedList=function(){return u.apply(this,arguments)};var i=r(n(348926)),a=n(578300),o=n(572768);function s(){return l.apply(this,arguments)}function l(){return(l=(0,i.default)((function*(e){const t=yield Promise.all(e.map(function(){var e=(0,i.default)((function*(e){return{type:e,response:yield(0,a.queryPrivacyDisallowedList)(e)}}));return function(){return e.apply(this,arguments)}}())),n=[];return t.forEach((e=>{const{status:t,users:r,dhash:i}=e.response;"mismatch"===t&&null!=r&&null!=i&&n.push({id:e.type,disallowedList:r.map((e=>e.toString())),dhash:i})})),yield(0,o.getTable)().bulkCreateOrReplace(n),n}))).apply(this,arguments)}function u(){return(u=(0,i.default)((function*(e){yield s([e])}))).apply(this,arguments)}},390921:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleOfflineNotifications=function(e){},t.subscribePushManager=function(){return a.apply(this,arguments)},t.unsubscribePushManager=function(){return o.apply(this,arguments)};var i=r(n(348926));n(417405),n(287461),n(546927),n(215995);function a(){return(a=(0,i.default)((function*(){}))).apply(this,arguments)}function o(){return(o=(0,i.default)((function*(){return!1}))).apply(this,arguments)}},662469:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setArchiveClassicSetting=function(){return __LOG__(4,void 0,new Error)`Settings:setArchiveClassicSetting is not supported on MD Companion device.`,Promise.resolve()},t.setArchiveEnabledSetting=function(){__LOG__(4,void 0,new Error)`Settings:setArchiveEnabledSetting is not supported on MD Companion device.`}},754630:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prepareRetryReceipt=function(e){return(0,r.prepareRetryReceiptBridge)(e)},t.queryCall=function(e,t){return(0,r.sendQueryCallBridge)(e,t)},t.sendCallEnd=function(e,t){return(0,r.sendCallEndBridge)(e,t)},t.sendCallOffer=function(e){return(0,r.sendCallOfferBridge)(e)},t.sendCallSignalingMsg=function(e,t){return(0,r.sendCallSignalingMsgBridge)(e,t)},t.sendEncRekey=function(e){return(0,r.sendEncRekeyBridge)(e)};var r=n(138811)},526294:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,s,l){if(__LOG__(2)`voip:handleIncomingCallOfferNotice: callId ${t}`,(0,r.unixTime)()-n>45)return void __LOG__(2)`voip:handleIncomingCallOfferNotice: Ignoring stale offer_notice`;i.CallCollection.add({id:t,isVideo:s,isGroup:l,offerTime:n,canHandleLocally:!1,peerJid:e},{merge:!0}),a.Cmd.alertCall((0,o.toUserWid)(e),t,s,l,!1),setTimeout((()=>{a.Cmd.cancelCall(e);const n=i.CallCollection.get(t);n&&i.CallCollection.remove(n)}),45e3)};var r=n(990445),i=n(651634),a=n(780549),o=n(669050)},747360:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleIncomingCallOffer=function(e,t){if(o.CallCollection.processIncomingCall(e.call_id,e.peer_jid,{isVideo:e.isVideoCall,canHandleLocally:e.isVideoCall?(0,c.isVideoCallEnabled)():(0,c.isVoiceCallEnabled)(),offerTime:e.t}),!function(e){return e?(0,c.isVideoCallEnabled)():(0,c.isVoiceCallEnabled)()}(e.isVideoCall))return void u.Voip.handleIncomingSignalingMessage(e,t);const n=e.call_id;o.CallCollection.pendingOffers[n]=new a.Resolvable,o.CallCollection.pendingOffers[n].resolve(Promise.all([(0,p.default)(e,t),u.Voip.getNumParticipantsFromCallOffer(t)]).then((r=>{let[{result:i,retryCount:a},l]=r,d=!0;switch(l>0&&(__LOG__(4,void 0,new Error)`voip:incoming: Ignoring call offer since group calling is disabled`,d=!1),d=e.isVideoCall?d&&(0,c.isVideoCallEnabled)():d&&(0,c.isVoiceCallEnabled)(),i){case s.E2EProcessResult.SUCCESS:!function(e,t,n){const r=e.call_id;o.CallCollection.processIncomingCall(r,e.peer_jid,{isVideo:e.isVideoCall,canHandleLocally:null!=n&&n,offerTime:e.t}),!1===n&&o.CallCollection.cleanupPendingOffer(r);u.Voip.handleIncomingSignalingMessage(e,t)}(e,t,d);break;case s.E2EProcessResult.RETRY:__LOG__(2)`voip:handleIncomingCallOffer reject call because of enc retry`,function(){_.apply(this,arguments)}(e,a);break;case s.E2EProcessResult.PARSE_ERROR:__LOG__(2)`voip:handleIncomingCallOffer ending call because of enc parse error`,u.Voip.endCall(n);break;default:throw new Error("invalid e2e result type")}})).finally((()=>{delete o.CallCollection.pendingOffers[n]})))},t.handleIncomingEncRekey=function(e,t){u.Voip.handleIncomingSignalingMessage(e,t)},t.handleIncomingSignalingMsg=function(e,t){u.Voip.handleIncomingSignalingMessage(e,t)};var i=r(n(348926)),a=n(827653),o=n(651634),s=n(257845),l=n(326314),u=n(961745),c=n(571256),d=n(549227),p=r(n(471815));function _(){return(_=(0,i.default)((function*(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=yield l.waSignalStore.getRegistrationInfo();if(!i)throw Error("No registration info found");const{registrationId:a}=i,o=r+1;u.Voip.rejectCallWithoutCallCtx(e.call_id,null===(t=e.peer_jid)||void 0===t?void 0:t.toString({legacy:!0}),null===(n=e.call_creator)||void 0===n?void 0:n.toString({legacy:!0}),d.ENC_RETRY_RECEIPT_ATTRS.SINGLE_PARTICIPANT,o,a),5===o&&(__LOG__(2)`voip:rejectCallWithReasonEnc max retry reached, uploading fieldstats`,u.Voip.processMissedIncomingCallMaxRetry(e))}))).apply(this,arguments)}},359987:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fireAndForget=r,t.frontendFireAndForget=function(e,t){r("event",e,t)},t.frontendSendAndReceive=function(e,t){return i("event",e,t)},t.sendAndReceive=i,t.setApi=function(e){n=e};let n=null;function r(e,t,r){if(!n)throw new Error("fireAndForget called before setApi!");n.fireAndForget(e,t,r)}function i(e,t,r){return n?n.sendAndReceive(e,t,r):Promise.reject(new Error("sendAndReceive called before setApi!"))}},400116:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.logoutAfterValidationFail=function(){new a.ShiftTimer((()=>{y()})).onOrAfter(1e3)},t.resetCompanionReg=function(){f=!1,h=!1},t.startInitialHistorySyncTimeout=function(){null==S&&(S=setTimeout(g,18e4),l.Cmd.on("on_initial_chat_synced",(()=>{clearTimeout(S)})))},t.startLogin=function(){return m.apply(this,arguments)},t.startLogout=y;var i=r(n(348926)),a=n(201063),o=n(678002),s=n(359987),l=n(780549),u=n(332108),c=n(6961),d=n(784898),p=r(n(571834)),_=n(851460);let f=!1,h=!1;function g(){__LOG__(4,void 0,new Error)`logout due to initial history sync timeout`,(0,s.frontendFireAndForget)("socketLogout",{forcePost:!1,reason:u.LogoutReason.HistorySyncTimeout})}function m(){return(m=(0,i.default)((function*(){f||h||(yield(0,d.setDeviceLinkPairStage)(p.default.MD_LINK_DEVICE_COMPANION_STAGE.FIRST_CONNECT),f=!0,yield(0,o.clearADVSecretKey)(),(0,_.setIsConnectedAsRegistered)(!0))}))).apply(this,arguments)}function y(){return E.apply(this,arguments)}function E(){return(E=(0,i.default)((function*(){f||h||(h=!0,yield c.Socket.clearCredentialsAndStoredData(),yield(0,o.clearADVSecretKey)())}))).apply(this,arguments)}let S},468253:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(968923),i={voipIndividualOutgoing:r.WebFeatures$Flag.FORCE_UPGRADE,groupsV3:r.WebFeatures$Flag.FORCE_UPGRADE,groupsV3Create:r.WebFeatures$Flag.DEVELOPMENT,changeNumberV2:r.WebFeatures$Flag.FORCE_UPGRADE,queryStatusV3Thumbnail:r.WebFeatures$Flag.DEVELOPMENT,liveLocations:r.WebFeatures$Flag.FORCE_UPGRADE,queryVname:r.WebFeatures$Flag.FORCE_UPGRADE,voipIndividualIncoming:r.WebFeatures$Flag.FORCE_UPGRADE,quickRepliesQuery:r.WebFeatures$Flag.FORCE_UPGRADE,payments:r.WebFeatures$Flag.FORCE_UPGRADE,labelsDisplay:r.WebFeatures$Flag.FORCE_UPGRADE,labelsEdit:r.WebFeatures$Flag.FORCE_UPGRADE,stickerPackQuery:r.WebFeatures$Flag.FORCE_UPGRADE,liveLocationsFinal:r.WebFeatures$Flag.FORCE_UPGRADE,mediaUpload:r.WebFeatures$Flag.FORCE_UPGRADE,vnameV2:r.WebFeatures$Flag.FORCE_UPGRADE,videoPlaybackUrl:r.WebFeatures$Flag.FORCE_UPGRADE,statusRanking:r.WebFeatures$Flag.FORCE_UPGRADE,voipIndividualVideo:r.WebFeatures$Flag.DEVELOPMENT,thirdPartyStickers:r.WebFeatures$Flag.FORCE_UPGRADE,frequentlyForwardedSetting:r.WebFeatures$Flag.FORCE_UPGRADE,recentStickers:r.WebFeatures$Flag.FORCE_UPGRADE,recentStickersV2:r.WebFeatures$Flag.PRODUCTION,recentStickersV3:r.WebFeatures$Flag.PRODUCTION,groupsV4JoinPermission:r.WebFeatures$Flag.FORCE_UPGRADE,catalog:r.WebFeatures$Flag.FORCE_UPGRADE,starredStickers:r.WebFeatures$Flag.PRODUCTION,templateMessage:r.WebFeatures$Flag.PRODUCTION,templateMessageInteractivity:r.WebFeatures$Flag.DEVELOPMENT,ephemeralMessages:r.WebFeatures$Flag.PRODUCTION,e2ENotificationSync:r.WebFeatures$Flag.FORCE_UPGRADE,syncdRelease1:r.WebFeatures$Flag.PRODUCTION,userNotice:r.WebFeatures$Flag.PRODUCTION,syncdRelease11:r.WebFeatures$Flag.PRODUCTION,support:r.WebFeatures$Flag.PRODUCTION,groupUiiCleanup:r.WebFeatures$Flag.FORCE_UPGRADE,groupDogfoodingInternalOnly:r.WebFeatures$Flag.DEVELOPMENT,ephemeral24HDuration:r.WebFeatures$Flag.DEVELOPMENT,archiveV2:r.WebFeatures$Flag.PRODUCTION,mdForceUpgrade:r.WebFeatures$Flag.FORCE_UPGRADE,disappearingMode:r.WebFeatures$Flag.PRODUCTION,noDeleteMessageTimeLimit:r.WebFeatures$Flag.DEVELOPMENT};t.default=i},926552:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleChunkProgress=function(e){p=e?0:e+1,0===p&&d();g(p>=3)},t.updateHistorySyncProgressModel=function(){return _.apply(this,arguments)};var i=r(n(348926)),a=n(359987),o=n(780549),s=n(60370),l=n(673168);let u=null;function c(){null!=u&&clearTimeout(u)}function d(){c(),u=setTimeout((()=>{g(!0)}),12e4)}let p=0;function _(){return(_=(0,i.default)((function*(){try{const[e,t]=yield Promise.all([f(),(0,l.getHistorySyncStatus)()]),n=!0!==(null==t?void 0:t.recentCompleted);(0,a.frontendSendAndReceive)("setHistorySyncProgress",{inProgress:n}),null!=e&&(0,a.frontendSendAndReceive)("setHistorySyncProgress",{progress:e})}catch(e){__LOG__(4,void 0,new Error)`updateProgressModel: error computing progress`}}))).apply(this,arguments)}function f(){return h.apply(this,arguments)}function h(){return(h=(0,i.default)((function*(){const e=yield(0,l.getChunkCountForEndOfRecentHistorySync)();if(0===e)return void __LOG__(2)`[history sync] computeProgress: haven't received total chunk count, unable to compute progress`;const t=yield(0,l.getLastHistorySyncedChunk)();if(null==t)return;const[n,r]=t.split("_").map((e=>parseInt(e,10)));if(n!==s.HistorySync$HistorySyncType.RECENT)return;const i=Math.floor(r/e*100);return Math.min(100,i)}))).apply(this,arguments)}function g(e){(0,a.frontendSendAndReceive)("setHistorySyncPaused",{paused:e})}o.Cmd.on("on_critical_sync_done",(()=>{d()})),o.Cmd.on("on_recent_chat_history_synced",(()=>{c(),g(!1),(0,a.frontendSendAndReceive)("setHistorySyncProgress",{progress:100,inProgress:!1})}))},717671:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.processFeatureFlags=function(e){if(!e)return;const t=(0,c.decodeProtobufWithUnknowns)(u.WebFeaturesSpec,(0,i.decodeB64)(e)),n=(0,c.getUnknownFields)(t);delete t.$$unsafeUnknownFields;const r=(0,a.getProtoInternalSpec)(u.WebFeaturesSpec),d=Object.keys(r),p=Object.keys(t);d.forEach((e=>{const t=(0,s.getProtobufFeatureName)(e);!p.includes(e)&&s.LegacyPhoneFeatures.supportsFeature(t)&&s.LegacyPhoneFeatures.setFeature(t,!1)}));for(const e in t){const n=t[e],r=o.default[e];if(n===u.WebFeatures$Flag.FORCE_UPGRADE&&r!==u.WebFeatures$Flag.FORCE_UPGRADE)throw __LOG__(3)`wap:features:${e} phone value is ${n} and web value is ${r}. updating...`,new l.UpdateImmediately("wap_feature_force_upgrade");s.LegacyPhoneFeatures.setFeatureFromFlags(e,r,n)}for(const e in n){const t=n[e];if("number"==typeof t&&u.WebFeatures$Flag.cast(t)===u.WebFeatures$Flag.FORCE_UPGRADE)throw __LOG__(3)`wap:features:unknown: ${e}: ${t}`,new l.UpdateImmediately("wap_feature_implemented_unknown")}};var i=n(417405),a=n(609398),o=(n(650201),r(n(468253))),s=n(390912),l=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),u=n(968923),c=n(309512);function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}},581263:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.startBackend=function(){return se.apply(this,arguments)};var i=r(n(348926)),a=(n(417405),n(551168),n(911794)),o=n(261030),s=n(975175),l=n(121494),u=n(183660),c=n(266485),d=n(854718),p=(n(359987),n(41730)),_=n(940748),f=n(582523),h=n(72696),g=n(955763),m=n(698867),y=n(822017),E=n(780549),S=n(642067),T=r(n(762848)),v=(n(403206),n(436005)),A=r(n(555470)),C=n(110567),P=n(926552),O=n(565804),I=n(486392),M=n(65889),b=n(390912),R=n(383047),N=n(332108),w=n(97858),L=n(76469),D=n(323791),k=n(706536),U=n(628905),G=(r(n(219368)),n(978751)),x=n(736751),B=n(871850),F=n(717671),j=n(60287),Y=n(927540),K=n(665894),H=(n(646240),n(241588)),W=n(326314),V=n(6961),$=n(170428),z=r(n(775410)),q=n(416911),J=n(702627),Q=n(87429),X=(n(885765),n(41517)),Z=(r(n(79291)),n(757453),n(409847)),ee=n(94872),te=n(627162),ne=n(459857),re=n(673168),ie=n(784898),ae=r(n(571834)),oe=(n(669050),n(924439));function se(){return(se=(0,i.default)((function*(){if(!W.waSignalStore.getRegistrationInfo())return void __LOG__(2)`startBackendRegistered: chatd user not registered`;__LOG__(2)`[startBackend]: connected as ${(0,ne.assertGetMe)()}`;try{yield(0,s.promiseTimeout)(Promise.all([(0,L.initialize)()]),2e4),yield(0,s.promiseTimeout)((0,D.initialize)(),2e4)}catch(e){E.Cmd.storageInitializationError()}const e=yield(0,K.getTable)().count(),t=yield W.waSignalStore.getServerHasPreKeys(),n=(0,S.getCommsConfig)({passive:e>0||!t,pull:!0});pe(),yield(0,A.default)(),yield(0,a.startComms)(T.default,n,(e=>Promise.resolve((0,o.inflate)(e)))),yield(0,a.waitForConnection)();{const n=[];e>0&&n.push((0,y.sendAndClearDanglingReceipts)()),t||(yield(0,ie.setDeviceLinkPairStage)(ae.default.MD_LINK_DEVICE_COMPANION_STAGE.UPLOAD_PREKEYS),n.push((0,X.uploadPreKeys)().catch(function(){var e=(0,i.default)((function*(e){__LOG__(4,!0,new Error,!0)`error while uploading prekeys, ${e}`,SEND_LOGS("error while uploading prekeys"),yield(0,ie.commitDeviceLinkEvent)(-1)}));return function(){return e.apply(this,arguments)}}()))),yield Promise.all(n),yield(0,ie.setDeviceLinkPairStage)(ae.default.MD_LINK_DEVICE_COMPANION_STAGE.COMPLETE),yield(0,ie.commitDeviceLinkEvent)(),yield(0,l.sendPassiveModeIq)("active")}x.PrimaryFeatures.initializeFromLocalStorage(),(0,u.isABPropsAfterFirstSync)()||(yield(0,c.syncABPropsTask)()),le(),yield Z.userPrefsIndexedDBStorage.setItemToIndexedDB(ee.KEYS.LANG,(0,te.getLangPref)()||"en"),yield(0,oe.initialize)(),B.PrimaryForceUpgrade.setup(),yield(0,m.initChatThreadLogging)(),yield(0,U.startWebPersistedJobManager)(),(0,w.messagePluginBackendRegistrationEnabled)()&&(0,p.initializeBackendPlugins)(),yield(0,a.startHandlingRequests)();const r=!(yield z.default.isCriticalDataSynced());r?yield z.default.syncCriticalData():__LOG__(2)`[bootstrap] need to sync critical data: false`,yield v.DbEncKeyStore.waitForFinalDbMsgEncKey(),null==H.ServerProps.serverPropsVersion&&(yield(0,Y.queryServerProps)()),yield ue(),Q.TosManager.run(),(0,j.startQPL)(),(0,k.upgradeToCommunity)(r),yield(0,G.initialize)((0,h.getBillingPremiumAccessConfig)()),(0,$.runSubscriptionsManager)(),_e()}))).apply(this,arguments)}function le(){var e;const t=null===(e=(0,ne.getMaybeMeUser)())||void 0===e?void 0:e.user;t&&ae.default.Global.set({psCountryCode:(0,I.getCountryShortcodeByPhone)(t)})}function ue(){return ce.apply(this,arguments)}function ce(){return(ce=(0,i.default)((function*(){(0,g.applyContactBusinessProps)(),(0,O.restoreLabels)(),(0,O.restoreQuickReplies)(),(0,O.restoreLabelAssociations)(),(0,O.restoreCarts)(),yield(0,O.restoreArchiveV2Settings)(),yield(0,O.restoreAgents)().then(_.initializeAgentLog),(0,f.checkOrphanAssignments)(),(0,O.restoreChatAssignments)()}))).apply(this,arguments)}function de(){return(de=(0,i.default)((function*(){z.default.continueProgressiveHistorySyncProcessing(),C.ftsClient.startIndexer().catch((()=>{})),(0,M.requireStatusV3Collection)().then((e=>{e.sync()})),(0,J.registerTasks)(),yield(0,q.runSyncDirtyContactsJob)(),(0,O.restoreRecentStickers)(),(0,O.restoreFavoriteStickers)(),(0,d.scheduleAdvDeviceInfoCheck)(),(0,O.restoreCommunityActivity)(),(0,P.updateHistorySyncProgressModel)(),(0,O.restoreMediaUploadResult)()}))).apply(this,arguments)}function pe(){const e=n(757453).getVersion(),t=(null==e?void 0:e.protoVersion)||[0,17];b.LegacyPhoneFeatures.setVersion(t),(0,F.processFeatureFlags)("EAEYASACKAEwAjgBQAFIAVgBYAFoAXgBmAEBoAEBqAEBsAECuAEBwAEByAEB0AEA2AEB4AEC8AED+AEDgAIDkAIDmAIAqAIDsAIAuAIDwAIB"),H.ServerProps.updateSelectiveProps({groupDescLength:512,multicastLimitGlobal:5,frequentlyForwardedMax:5,stickers:1})}function _e(){return fe.apply(this,arguments)}function fe(){return(fe=(0,i.default)((function*(){}))).apply(this,arguments)}E.Cmd.on("offline_delivery_end",(0,i.default)((function*(){try{yield function(){return de.apply(this,arguments)}()}catch(e){__LOG__(2)`debug setup failed:`}}))),E.Cmd.on("storage_initialization_error",(0,i.default)((function*(){((0,re.isRegistered)()||(0,R.getPrevLogoutReasonCode)()!==N.LOGOUT_REASON_CODE.CLIENT_FATAL)&&(__LOG__(2)`storage initialization error, logging out`,yield V.Socket.clearCredentialsAndStoredData(N.LogoutReason.ClientFatalError),E.Cmd.logout())})))},775410:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=r(n(81109)),o=n(36530),s=n(279385),l=n(155172),u=n(990445),c=n(696155),d=n(443780),p=n(359987),_=r(n(542817)),f=n(780549),h=n(436005),g=n(996578),m=n(332108),y=r(n(524173)),E=n(180019),S=n(331285),T=n(978538),v=n(510607),A=n(366891),C=n(673168),P=r(n(571834)),O=n(965259),I=r(n(543465)),M=n(589719);const b=n(76672).Mirrored(["NotStarted","InProcess","Completed"]),R={initialChatHistory:!1,readReceipts:!1,syncdCritical:!1},N={initialChatHistoryTotalMsg:-1,initialChatHistoryTotalChats:-1};const w=new class{constructor(){this._criticalState={},this._debugOnlyState=N,this._progressiveHistorySyncRemainingIteration=25,this._progressiveHistorySyncInFlight=!1,this._allCriticalDataSynced=!1,this._syncDCriticalDataTimeout=null,this.initState()}initState(){this._criticalState=(0,a.default)({},R),this._debugOnlyState=(0,a.default)({},N),this._syncDCriticalDataState=b.NotStarted,this._syncDNonCriticalDataState=b.NotStarted,this._syncDGroupMetadataQueryDataState=b.NotStarted}_isCriticalSyncDoneThisSession(){for(const e in this._criticalState)if(!this._criticalState[e])return!1;return!0}_setSynced(e){var t=this;return(0,i.default)((function*(){__LOG__(2)`[bootstrap] completed sync for ${e}`,t._criticalState[e]=!0,t._isCriticalSyncDoneThisSession()&&(__LOG__(2)`[bootstrap] critical sync done`,yield(0,C.setAllCriticalDataSynced)(),f.Cmd.criticalSyncDone(),_.default.initOrUpdateTracking(P.default.WEBC_SCENARIO_TYPE.INITIAL_PAIRING),t.syncNonCriticalData())}))()}_syncContactsInChunks(e,t){return(0,i.default)((function*(){__LOG__(2,void 0,void 0,void 0,["contact-sync"])`start contact sync for ${e?t.length+1:0} chunks of contacts during the inital sync`,null!=e&&(yield(0,T.syncContactListJob)(Array.from(e),!1));for(let e=0;e<t.length;e++){const n=Array.from(t[e]);yield(0,o.delayMs)(2e4),yield(0,T.syncContactListJob)(n)}__LOG__(2,void 0,void 0,void 0,["contact-sync"])`inital contact sync completes`}))()}_syncDeviceList(e){if(null==e)return __LOG__(2,void 0,void 0,void 0,["contact-sync"])`syncMostRecentDevices has no contact to sync during bootstrap`,Promise.resolve();__LOG__(2,void 0,void 0,void 0,["contact-sync"])`sync ${e.size} contacts for device info during the initial sync`;const t=Array.from(e);return(0,v.syncDeviceListJob)(t,null,null).catch((e=>{__LOG__(4,!0,new Error,!0)`Sync device failed`,SEND_LOGS("Sync device failed: "+e)}))}setReadReceiptsSynced(){var e=this;return(0,i.default)((function*(){yield e._setSynced("readReceipts")}))()}setInitialChatHistorySynced(){var e=this;return(0,i.default)((function*(){yield e._setSynced("initialChatHistory")}))()}setSyncDCriticalSynced(){var e=this;return(0,i.default)((function*(){e._syncDCriticalDataState=b.Completed,e._criticalState.syncdCritical||(yield e._setSynced("syncdCritical"))}))()}syncNonCriticalData(){let e=[];this._syncDGroupMetadataQueryDataState=b.InProcess,(0,S.queryAndUpdateAllGroupMetadata)(!0).then((()=>{e=(0,E.getAllContactsFromChatCollectionIntoChunks)(),this._syncDeviceList(e[0]),(0,E.getAndUpdateNonAddressBookContacts)()})).then((()=>{setTimeout(function(){this._syncContactsInChunks(e[0],e.slice(1,e.length))}.bind(this),4e4)})).finally((()=>{this._syncDGroupMetadataQueryDataState=b.Completed})),(0,g.getAndUpdateStatus)(),(0,c.getAndUpdateProfilePicture)(),(0,c.updateBlocklist)(),this._syncDNonCriticalDataState=b.InProcess,(0,s.markCollectionsForSync)([l.CollectionName.Regular,l.CollectionName.RegularLow,l.CollectionName.RegularHigh]).then((()=>{this._syncDNonCriticalDataState=b.Completed}))}markInitialHistorySyncCountDebugStats(e,t){this._debugOnlyState={initialChatHistoryTotalMsg:e,initialChatHistoryTotalChats:t}}isSyncDCriticalDataSyncInProcess(){return this._syncDCriticalDataState===b.InProcess}isSyncDBootstrapInProcess(){return this._syncDCriticalDataState===b.InProcess||this._syncDNonCriticalDataState===b.InProcess}isSyncDBootstrapGroupMetadataQueryInProcess(){return this._syncDGroupMetadataQueryDataState===b.InProcess}_initCriticalDataTimeoutIfNeeded(){var e=this;null==this._syncDCriticalDataTimeout&&(__LOG__(2)`[bootstrap] setting critical data syncd timeout (${180})`,this._syncDCriticalDataTimeout=setTimeout((0,i.default)((function*(){(yield e._isSyncDCriticalDataComplete())||(__LOG__(2)`[bootstrap] syncd critical data timeout exceeded, logging out`,yield(0,O.forceFlushAllWamBuffers)(),(0,p.frontendFireAndForget)("socketLogout",{forcePost:!1,reason:m.LogoutReason.SyncdTimeout}));!0!==(yield(0,C.getInitialHistorySyncComplete)())&&(__LOG__(2)`[bootstrap] history sync critical data timeout exceeded, logging out`,yield(0,O.forceFlushAllWamBuffers)(),(0,p.frontendFireAndForget)("socketLogout",{forcePost:!1,reason:m.LogoutReason.HistorySyncTimeout})),__LOG__(2)`[bootstrap] all critical data synced within timeout period`})),18e4))}_isSyncDCriticalDataComplete(){return(0,i.default)((function*(){const e=yield I.default.getSyncActionsRows(["action"],[l.Actions.SettingPushName]);return e.length>0&&null!=e.find((e=>e.actionState===l.SyncActionState.Success))}))()}setSyncDCriticalDataSyncCompleted(){var e=this;return(0,i.default)((function*(){null!=e._syncDCriticalDataTimeout&&(yield new P.default.MdBootstrapDataApplied({mdBootstrapPayloadType:P.default.MD_BOOTSTRAP_PAYLOAD_TYPE.CRITICAL,mdBootstrapSource:P.default.MD_BOOTSTRAP_SOURCE.APP_STATE,mdSessionId:yield A.MdSyncFieldStatsMeta.getMdSessionId(),mdTimestamp:(0,u.unixTimeMs)()}).commit(!0))}))()}getCriticalSyncDebugSummary(){var e=this;return(0,i.default)((function*(){if(yield e.isCriticalDataSynced())return"-------\nAll critical data synced\n-------\n\n";return`-------\n Initial history sync complete: ${(yield(0,C.getHistorySyncStatus)())?"true":e._criticalState.initialChatHistory.toString()}\n Initial msgs: ${e._debugOnlyState.initialChatHistoryTotalMsg}, initial chats: ${e._debugOnlyState.initialChatHistoryTotalChats}\n Receipt sync complete: ${e._criticalState.readReceipts.toString()} \n Critical collection sync complete: ${e._criticalState.syncdCritical.toString()} \n-------\n`}))()}isCriticalDataSynced(){var e=this;return(0,i.default)((function*(){return e._allCriticalDataSynced=e._allCriticalDataSynced||(yield(0,C.getAllCriticalDataSynced)()),e._allCriticalDataSynced}))()}syncCriticalData(){var e=this;return(0,i.default)((function*(){_.default.initOrUpdateTracking(P.default.WEBC_SCENARIO_TYPE.INITIAL_PAIRING),__LOG__(2)`[bootstrap] need to sync critical data: true`;const t=yield e.getCriticalSyncDebugSummary();__LOG__(2)`[bootstrap] ${t}`,__LOG__(2)`[bootstrap] syncing my device list`;const n=(0,v.syncMyDeviceListJob)(),r=new Promise(((t,n)=>{(0,c.updatePrivacySettings)().then((()=>e.setReadReceiptsSynced())).then(t).catch(n)})).catch((e=>{__LOG__(4,!0,new Error,!0)`failed to sync privacy settings ${e.stack}`,SEND_LOGS("failed to update privacy settings from privacy request to webd"),(0,p.frontendFireAndForget)("socketLogout",{forcePost:!1,reason:m.LogoutReason.AccountSyncError})}));(0,M.updateSyncdDisabledDueToFatalFlag)(!1),e._initCriticalDataTimeoutIfNeeded(),e._syncDCriticalDataState=b.InProcess;const a=n.then((()=>(0,s.markCollectionsForSync)([l.CollectionName.CriticalBlock,l.CollectionName.CriticalUnblockLow]))).then((0,i.default)((function*(){e._criticalState.syncdCritical||(yield e._isSyncDCriticalDataComplete())&&(yield e.setSyncDCriticalSynced(),yield e.setSyncDCriticalDataSyncCompleted())})));!0===(yield(0,C.getInitialHistorySyncComplete)())&&(yield e.setInitialChatHistorySynced());const o=(0,c.updateDefaultDisappearingMode)().catch((e=>{__LOG__(4,!0,new Error,!0)`failed to sync default disappearing mode ${e.stack}`,SEND_LOGS("failed initial sync of default disappearing mode")}));yield Promise.all([r,a,o])}))()}continueProgressiveHistorySyncProcessing(){__LOG__(2)`[history sync] continueProgressiveHistorySyncProcessing`;const e="Safari"!==y.default.info().name;this._initNextProgressiveHistorySyncRunLoop(e)}_progressiveHistorySyncRun(){var e=this;return(0,i.default)((function*(){if(!e._allCriticalDataSynced&&!0!==e._criticalState.initialChatHistory)return __LOG__(2)`[history sync] Skip processLoop, until initial sync is complete`,void e._progressiveHistorySyncRemainingIteration++;if(!f.Cmd.isMainStreamReadyMd)return __LOG__(2,void 0,void 0,void 0,["History sync"])`Skip processLoop, until main is loaded`,void e._progressiveHistorySyncRemainingIteration++;const t=yield(0,d.fetchNextHitorySyncChunkForProcessing)();if(!t)return;__LOG__(2)`[history sync] processLoop picked up chunk`,e._progressiveHistorySyncRemainingIteration++;const r=n(889877).handleHistorySyncChunk;yield r(t)}))()}_initNextProgressiveHistorySyncRunLoop(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(0,i.default)((function*(){if(t&&e._progressiveHistorySyncRemainingIteration++,!e._progressiveHistorySyncInFlight&&e._progressiveHistorySyncRemainingIteration>0){e._progressiveHistorySyncRemainingIteration--,e._progressiveHistorySyncInFlight=!0;try{yield h.DbEncKeyStore.waitForFinalDbMsgEncKey(),yield e._progressiveHistorySyncRun()}catch(e){__LOG__(4,void 0,new Error)`[History sync] _progressiveHistorySyncRun failed with ${null==e?void 0:e.message}, stack: ${null==e?void 0:e.stack}`}e._progressiveHistorySyncInFlight=!1,yield new Promise((e=>setTimeout(e,2e4))),e._initNextProgressiveHistorySyncRunLoop()}}))()}};f.Cmd.on("on_initial_chat_synced",(0,i.default)((function*(){yield w.setInitialChatHistorySynced()}))),f.Cmd.on("logout",(()=>{w.initState()}));var L=w;t.default=L},446715:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ensureNonCriticaDataSyncIsInitialized=function(){return g.apply(this,arguments)},t.handlePnhCagUpgradeABPropConfigValueChange=function(){return h.apply(this,arguments)},t.handlePnhGroupLidABPropConfigValueChange=function(){return f.apply(this,arguments)};var i=r(n(348926)),a=n(287461),o=n(533494),s=n(331285),l=n(126092),u=n(105461),c=r(n(775410)),d=n(673168),p=n(128378),_=n(669050);function f(){return(f=(0,i.default)((function*(e){if(c.default.isSyncDBootstrapGroupMetadataQueryInProcess())return;const t=null==e?void 0:e.pnh_group_lid;null!=t&&(0,a.getABPropConfigValue)("pnh_group_lid")>t&&(yield(0,s.queryAndUpdateAllGroupMetadata)())}))).apply(this,arguments)}function h(){return(h=(0,i.default)((function*(e){if(c.default.isSyncDBootstrapGroupMetadataQueryInProcess())return;const t=null==e?void 0:e.pnh_cag_upgrade;if(null!=t&&(0,a.getABPropConfigValue)("pnh_cag_upgrade")>t){const e=yield(0,l.getTable)().all();yield Promise.all(e.map((e=>{let{defaultSubgroup:t,id:n}=e;if(!0===t)return(0,s.queryAndUpdateGroupMetadataById)((0,_.createWid)(n))})))}}))).apply(this,arguments)}function g(){return(g=(0,i.default)((function*(){if((0,a.getABPropConfigValue)("recent_sticker_rollout_phase")<3)return;const e=yield(0,d.getNonCriticalDataSyncStatus)();(null==e?void 0:e[p.NON_CRITIAL_DATA_SYNC_STATUS_TYPE.RECENT_STICKER_INITIALIZED])===p.RECENT_STICKER_INITIALIZED_STATUS_TYPE.NEED_REQUEST_BOOTSTRAP&&(__LOG__(2)`Recent Stickers: request peer message for recent sticker bootstrap.`,yield(0,u.sendPeerDataOperationRequest)(o.Message$PeerDataOperationRequestType.SEND_RECENT_STICKER_BOOTSTRAP))}))).apply(this,arguments)}},766187:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.workerSafeFireAndForget=function(e,t){(0,r.fireAndForget)("workerSafeEvent",e,t)},t.workerSafeSendAndReceive=function(e,t){return(0,r.sendAndReceive)("workerSafeEvent",e,t)};var r=n(359987)},707065:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.toCoreAckTemplate=function(e){const t=(0,a.extractJidFromJidWithType)((0,o.widToJidWithType)(e.from)),n=null==e.participant?null:(0,o.widToDeviceJid)(e.participant);return(0,i.default)((0,i.default)({},e),{},{from:t,participant:n})};var i=r(n(81109)),a=n(714443),o=n(574819)},642067:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getCommsConfig=function(e){const t=e||{passive:!1,pull:!1};return{openChatSocket:e=>(0,s.default)(t).then((n=>(e(),t.passive=!1,n))),healthCheckInterval:15,deadSocketTime:2e4,maxSocketLoopWaitTime:9e5,shouldCloseStaleSocket:!0,shouldBlockReceivingUntilSuccess:!0,handlers:{onConnect:()=>{(0,u.isRegistered)()&&(i.Cmd.setSocketState(l.SOCKET_STATE.CONNECTED),i.Cmd.openSocketStream())},onDisconnect:()=>{i.Cmd.socketStreamDisconnected()},onSocketOpen:()=>{i.Cmd.setSocketState(l.SOCKET_STATE.PAIRING)},onSocketLoopIteration:()=>{i.Cmd.setSocketState(l.SOCKET_STATE.OPENING)},onConnectionChange:()=>{},onOptimisticConnectionChange:()=>{},onCastStanza:()=>{},onHandleAck:e=>{(0,a.default)(e)},onHandleStanza:()=>{},onSendIq:()=>{},onClockSkewUpdate:e=>{(0,o.updateClockSkew)(e)}}}};var i=n(780549),a=r(n(871811)),o=n(355802),s=(n(114850),r(n(128296))),l=n(226562),u=n(673168);n(785893)},762848:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return V.apply(this,arguments)};var i=r(n(348926)),a=n(693586),o=n(616310),s=n(968826),l=n(738102),u=n(287461),c=n(337199),d=n(996578),p=n(435170),_=r(n(80886)),f=r(n(81979)),h=n(256396),g=r(n(674530)),m=n(139917),y=r(n(63099)),E=n(200279),S=n(246226),T=r(n(312930)),v=r(n(154269)),A=r(n(299689)),C=r(n(310393)),P=r(n(996736)),O=r(n(288627)),I=r(n(743516)),M=r(n(283365)),b=r(n(251886)),R=r(n(459671)),N=n(216622),w=r(n(233717)),L=n(244670),D=n(416341),k=n(828104),U=r(n(657874)),G=r(n(265927)),x=n(730104),B=n(295595),F=r(n(994534)),j=r(n(651152)),Y=n(359484),K=r(n(571834));function H(){return W.apply(this,arguments)}function W(){return(W=(0,i.default)((function*(e,t,n){const{attrs:r}=e;if(r.offline){const e=parseInt(r.t,10);Y.OfflineMessageHandler.newOfflineStanza(e,n)}switch(e.tag){case"iq":return $(e);case"receipt":try{return z(e)?yield(0,B.handleCallReceipt)(e):"retry"===r.type?yield(0,L.handleMessageRetryRequest)(e):"enc_rekey_retry"===r.type?yield(0,F.default)(e):yield(0,C.default)(e)}catch(t){if(t instanceof s.XmppParsingFailure)return q(e),(0,l.wap)("ack",{class:"receipt",id:r.id,to:r.from||l.DROP_ATTR,type:r.type||l.DROP_ATTR,error:"487"});throw t}case"notification":try{switch(r.type){case"server_sync":return yield(0,k.handleServerSyncNotification)(e);case"w:gp2":return yield(0,E.handleGroupNotification)(e);case"picture":return yield(0,N.handleProfilePicNotificationJob)(e);case"business":return yield(0,p.handleBusinessNotificationJob)(e);case"contacts":return yield(0,f.default)(e);case"devices":return yield(0,h.handleDevicesNotification)(e);case"disappearing_mode":return yield(0,m.handleDisappearingModeNotificationJob)(e);case"mediaretry":return yield(0,v.default)(e);case"encrypt":{const n=e.content;if(!Array.isArray(n)||!n.length)break;switch(n[0].tag){case"count":return yield(0,M.default)(e,t);case"identity":return yield(0,S.handleE2eIdentityChange)(e);case"digest":return yield(0,g.default)(e)}break}case"server":return yield(0,D.handleServerNotification)(e);case"status":return yield(0,c.handleAboutNotification)(e);case"account_sync":return yield(0,d.handleAccountSyncNotification)(e);case"pay":return yield(0,I.default)(e);case"psa":if(null!=r.from&&r.from.toString()===o.PSA_JID){if((0,u.getABPropConfigValue)("enable_client_chat_psa"))return yield(0,j.default)(e);break}return yield(0,w.default)(e);case"privacy_token":return yield(0,R.default)(e)}}catch(t){if(t instanceof s.XmppParsingFailure)return q(e),(0,l.wap)("ack",{class:"notification",id:r.id,type:r.type||l.DROP_ATTR,error:"487"});throw t}if(r.hasOwnProperty("id"))return(0,l.wap)("ack",{class:"notification",id:r.id,type:r.type||l.DROP_ATTR,error:"487"});break;case"chatstate":return(0,_.default)(e);case"presence":return(0,b.default)(e);case"message":try{return yield(0,A.default)(e)}catch(t){if(t instanceof s.XmppParsingFailure)return q(e),(0,l.wap)("ack",{class:"message",id:r.id,to:r.from,type:r.type||l.DROP_ATTR,error:"487"});throw t}case"ib":return(0,T.default)(e);case"stream:error":return(0,U.default)(e);case"failure":return(0,y.default)(e);case"success":return(0,G.default)(e);case"call":return(0,x.handleCall)(e);case"error":return(0,a.handleError)(e)}}))).apply(this,arguments)}function V(){return(V=(0,i.default)((function*(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=yield Promise.resolve(H(e,t,n));return null==r?"NO_ACK":r}))).apply(this,arguments)}function $(e){const{attrs:t,content:n}=e;if("urn:xmpp:ping"===t.xmlns)return(0,l.wap)("iq",{type:"result",to:t.from});if("md"!==t.xmlns)throw new Error(`handleIq unrecognized ${e.toString()}`);if(!Array.isArray(n)||!n.length)return;switch(n[0].tag){case"pair-device":return(0,P.default)(e);case"pair-success":return(0,O.default)(e)}}function z(e){if(Array.isArray(e.content)&&e.content.length>0){const t=e.content[0].tag;return"offer"===t||"accept"===t||"reject"===t}return!1}function q(e){var t;new K.default.UnknownStanza({unknownStanzaTag:e.tag,unknownStanzaType:null===(t=e.attrs.type)||void 0===t?void 0:t.toString()}).commit()}},871811:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const{id:t,from:n,t:r}=e.attrs;"message"===e.attrs.class&&function(){d.apply(this,arguments)}(String(t),(0,c.createWid)(String(n)),parseInt(r,10))};var i=r(n(348926)),a=n(254665),o=n(878685),s=r(n(565754)),l=n(373070),u=n(121260),c=n(669050);function d(){return(d=(0,i.default)((function*(e,t,n){const r=new s.default({fromMe:!0,remote:t,id:e}),i=String(r);try{const e=yield(0,u.getTable)().get(i);if((null==e?void 0:e.type)===l.MSG_TYPE.REACTION)return;const r=o.MessagePropertyType.cast(null==e?void 0:e.messageRangeIndex.split("_")[1]);(0,u.getTable)().merge(i,{messageRangeIndex:(0,o.craftMessageRangeIndex)(t.toString(),!1,r===o.MessagePropertyType.SystemMessage,n)})}catch(e){throw __LOG__(4,!0,new Error,!0)`processAckForOutgoingMessage: failed to update in storage`,SEND_LOGS("message processAckForOutgoingMessage failed"),e}(0,a.checkAndRemoveActiveMessageRanges)(r,n)}))).apply(this,arguments)}},355802:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.blockSendPing=function(){return s.apply(this,arguments)},t.updateClockSkew=function(e){(0,o.setClockSkew)(e)};var i=r(n(348926)),a=n(911794),o=n(990445);function s(){return(s=(0,i.default)((function*(){yield(0,a.sendPing)()}))).apply(this,arguments)}},355813:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.CHAT_JID=function(e){if(!(e instanceof o.default&&(e.isUser()||e.isGroup()||e.isBroadcast())))throw Error(`CHAT_JID: invalid jid type: ${e instanceof o.default?e.toString():"Not an instance of WID"}`);return a.WapJid.create(e.user,e.getJidServer())},t.DEVICE_JID=function(e){if(!(e instanceof o.default&&e.isUser()))throw Error(`DEVICE_JID: invalid jid type: ${e instanceof o.default?e.toString():"Not an instance of WID"}`);return a.WapJid.createJidU(e.user,l(e),e.device)},t.GROUP_CALL_JID=function(e){if(!(e instanceof o.default&&e.isGroupCall()))throw Error(`GROUP_CALL_JID: invalid jid type: ${e instanceof o.default?e.toString():"Not an instance of WID"}`);return a.WapJid.create(e.user,s.Domains.CALL)},t.GROUP_JID=function(e){if(!(e instanceof o.default&&e.isGroup()))throw Error(`GROUP_JID: invalid jid type: ${e instanceof o.default?e.toString():"Not an instance of WID"}`);return a.WapJid.create(e.user,s.Domains.G_US)},t.JID=function(e){if(!(e instanceof o.default))throw Error(`JID: invalid jid type: ${e instanceof o.default?e.toString():"Not an instance of WID"}`);if(null!=e.device&&0!==e.device)return a.WapJid.createJidU(e.user,l(e),e.device);return a.WapJid.create(e.user,e.getJidServer())},t.USER_JID=function(e){if(!(e instanceof o.default&&e.isUser()))throw Error(`USER_JID: invalid jid type: ${e instanceof o.default?e.toString():"Not an instance of WID"}`);return a.WapJid.create(e.user,e.getJidServer())},t.wapNodeToVoipXml=t.voipXmlToWapNode=void 0;var i=n(738102),a=n(638134),o=r(n(124928)),s=n(323389);function l(e){return"lid"===e.server?a.DOMAIN_TYPE.LID:a.DOMAIN_TYPE.WHATSAPP}t.voipXmlToWapNode=e=>{if(!e||!Array.isArray(e)||3!==e.length)throw Error("Invalid VOIP xml node");return function e(t){if(!t)return null;if(Array.isArray(t)){const n=t[0],r=t[1];let o;r&&Object.keys(r).map((e=>{o||(o={});let t=r[e];if(!t)throw Error("Attribute value is null");if("object"==typeof t){if(t.type!==a.WAP_JID_SUBTYPE.JID&&!a.WAP_JID_SUBTYPE.JID_AD&&!a.WAP_JID_SUBTYPE.JID_U)throw Error("Invalid attribute value type");t=new a.WapJid(t)}o[e]=t}));const s=t[2];let l=null;Array.isArray(s)&&s.length>0&&(l="number"==typeof s[0]?new Uint8Array(s):s.map(e).filter((e=>e)));const u=l;return new i.WapNode(n,o,u)}return t}(e)};t.wapNodeToVoipXml=e=>function e(t){const n=[];return n.push(t.tag),n.push(t.attrs||{}),Array.isArray(t.content)&&0===t.content.filter((e=>!Array.isArray(e)))?n.push(t.content):Array.isArray(t.content)?n.push(t.content.map((t=>e(t)))):null!=t.content?t.content instanceof Uint8Array?n.push(Array.from(t.content)):n.push(t.content):n.push(null),n}(e)},403206:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.calculateSignature=function(){return _.apply(this,arguments)},t.keyPair=function(e){let t;void 0===e?(t=new Uint8Array(32),self.crypto.getRandomValues(t)):t=new Uint8Array(e);return t[0]&=248,t[31]&=127,t[31]|=64,p({pubKey:32,privKey:t,basepoint:l},(function(e){const n=s._curve25519_donna(e.pubKey,e.privKey,e.basepoint);if(n)throw new Error(`Curve25519:keyPair Error Code ${n}`);return{pubKey:d(e.pubKey,32),privKey:t.buffer}}))},t.sharedSecret=function(e,t){return Promise.resolve().then((()=>p({sharedKey:32,pubKey:e,privKey:t},(function(e){const t=s._curve25519_donna(e.sharedKey,e.privKey,e.pubKey);if(t)throw new Error(`Curve25519:sharedSecret Error Code ${t}`);return d(e.sharedKey,32)}))))},t.toCurveKeyPair=function(e){if(33!==e.pubKey.byteLength||32!==e.privKey.byteLength)throw new Error("Invalid key pair type");const t=new Uint8Array(32),n=new Uint8Array(32);return t.set(new Uint8Array(e.pubKey).subarray(1)),n.set(new Uint8Array(e.privKey)),{pubKey:t.buffer,privKey:n.buffer}},t.toCurveKeyPubKey=function(e){if(33!==e.byteLength)throw new Error("Invalid key type");const t=new Uint8Array(32);return t.set(new Uint8Array(e).subarray(1)),t.buffer},t.toSignalCurveKeyPair=function(e){if(32!==e.pubKey.byteLength||32!==e.privKey.byteLength)throw new Error("Invalid key pair type");const t=u(e.pubKey),n=new Uint8Array(32);return n.set(new Uint8Array(e.privKey)),{pubKey:t,privKey:n.buffer}},t.toSignalCurvePubKey=u,t.verifySignature=function(e,t,n){if(32!==e.byteLength)throw new Error(`Invalid public key length: ${e.byteLength}`);const r=new Uint8Array(33);if(r[0]=5,r.set(e,1),(0,a.isCryptoLibraryEnabled)()&&o)return o.verifySignature(r,t,n);return!1===self.libsignal.Curve.verifySignature(r,t,n)};var i=r(n(348926)),a=n(492917);const o=null;let s;const l=new Uint8Array(32);l[0]=9;function u(e){if(32!==e.byteLength)throw new Error("Invalid key type");const t=new Uint8Array(33);return t[0]=5,t.set(new Uint8Array(e),1),t.buffer}function c(e){if("number"==typeof e)return s._malloc(e);const t=new Uint8Array(e.buffer||e),n=s._malloc(t.length);return s.HEAPU8.set(t,n),n}function d(e,t){const n=new Uint8Array(t);return n.set(s.HEAPU8.subarray(e,e+t)),n.buffer}function p(e,t){s||(s=n(123098));const r={};try{for(const t in e)r[t]=c(e[t]);return t(r)}finally{for(const e in r)s._free(r[e])}}function _(){return(_=(0,i.default)((function*(e,t){return(0,a.isCryptoLibraryEnabled)(),self.libsignal.Curve.calculateSignature(e.privKey,t)}))).apply(this,arguments)}},188472:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.deleteEncKeysAndCache=function(){return d.apply(this,arguments)},t.generateFinalDbEncryptionAndFtsKeyForInvoker=function(e){return(0,s.get)().generateFinalDbEncryptionAndFtsKey(e)},t.initEncSalt=function(){return u.apply(this,arguments)},t.initEncSaltForInvoker=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(780549),o=n(436005),s=n(542137);let l=null;function u(){return(u=(0,i.default)((function*(){if(null==l){const e=n(47405).nx;l=e()}const e=yield l;if(e&&e.constructor===Uint8Array)return o.DbEncKeyStore.init(e)}))).apply(this,arguments)}function c(){return(c=(0,i.default)((function*(){if(null==l){const e=n(47405).nx;l=e()}const e=yield l;e&&e.constructor===Uint8Array&&(0,s.get)().initDatabaseEncnKey(e)}))).apply(this,arguments)}function d(){return(d=(0,i.default)((function*(){yield Promise.all([o.DbEncKeyStore.deleteKeys(),(0,s.get)().deleteDbEncKeyCache()])}))).apply(this,arguments)}a.Cmd.on("logout",(()=>{l=Promise.resolve(null)}))},47405:(e,t,n)=>{"use strict";var r=n(595318);t.cn=function(){return c.apply(this,arguments)},t.nx=function(){return u.apply(this,arguments)};var i=r(n(348926)),a=n(359987),o=n(332108),s=n(459857),l=n(673168);function u(){return(u=(0,i.default)((function*(){let e=null;return!!(0,s.getMaybeMeUser)()||(e=new Uint8Array(128),self.crypto.getRandomValues(e),e=btoa(String.fromCharCode(...Array.from(new Uint8Array(e)))),yield(0,l.setWebEncSalt)(e)),e=(0,l.getWebEncSalt)(),null==e&&(__LOG__(4,void 0,new Error)`[DB ENC CRITICAL ERROR] null returned for local enc salt`,(0,a.frontendFireAndForget)("socketLogout",{forcePost:!1,reason:o.LogoutReason.MissingEncSalt})),e=Uint8Array.from(atob(e),(e=>e.charCodeAt(0))),Promise.resolve(e)}))).apply(this,arguments)}function c(){return(c=(0,i.default)((function*(){yield(0,l.setWebEncSalt)(null)}))).apply(this,arguments)}},912384:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ENC_IV_SIZE=void 0,t.decryptMediaRetryNotification=function(){return _.apply(this,arguments)},t.encryptServerErrorReceipt=function(){return p.apply(this,arguments)};var i=r(n(348926)),a=n(551168),o=n(177467),s=n(684659),l=n(229479),u=n(309512),c=n(653313);function d(e){__LOG__(2)`encodeServerErrorReceipt`;const t=new a.Binary;return(0,c.encodeProtobuf)(l.ServerErrorReceiptSpec,e,t),t.readByteArray()}function p(){return(p=(0,i.default)((function*(e,t,n){const r=yield f(e),i=(null==n?void 0:n.slice())||h(),a=d({stanzaId:t});return{ciphertext:yield(0,o.gcmEncrypt)(r,i,a,t),iv:i}}))).apply(this,arguments)}function _(){return(_=(0,i.default)((function*(e,t,n,r){const i=yield f(e),a=yield(0,o.gcmDecrypt)(i,n,r,t);return(0,u.decodeProtobuf)(l.MediaRetryNotificationSpec,a)}))).apply(this,arguments)}t.ENC_IV_SIZE=12;function f(e){return(0,s.extractAndExpand)(e,"WhatsApp Media Retry Notification",32)}function h(){const e=new Uint8Array(12);return self.crypto.getRandomValues(e),e}},976030:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.decryptReaction=_,t.encryptReaction=function(){return d.apply(this,arguments)},t.parseEncReaction=function(){return p.apply(this,arguments)};var i=r(n(348926)),a=n(177467),o=n(722796),s=n(533494),l=n(574819),u=n(309512),c=n(653313);function d(){return(d=(0,i.default)((function*(e){const{reaction:t,messageSecret:n,iv:r,stanzaId:i,originalMessageSender:u,reactionSender:d}=e,p=(0,l.widToUserJid)(d),_=yield(0,o.createUseCaseSecret)({messageSecret:n,stanzaId:i,parentMsgOriginalSender:(0,l.widToUserJid)(u),modificationSender:p,modificationType:o.UseCaseSecretModificationType.ENC_REACTION}),f=(0,c.encodeProtobuf)(s.Message$ReactionMessageSpec,t).readBuffer();return(0,a.gcmEncrypt)(_,r,f)}))).apply(this,arguments)}function p(){return(p=(0,i.default)((function*(e){const t=yield _(e);return(0,u.decodeProtobuf)(s.Message$ReactionMessageSpec,t)}))).apply(this,arguments)}function _(){return f.apply(this,arguments)}function f(){return(f=(0,i.default)((function*(e){const{encryptedReaction:t,messageSecret:n,iv:r,stanzaId:i,originalMessageSender:s,reactionSender:u}=e,c=(0,l.widToUserJid)(u),d=yield(0,o.createUseCaseSecret)({messageSecret:n,stanzaId:i,parentMsgOriginalSender:(0,l.widToUserJid)(s),modificationSender:c,modificationType:o.UseCaseSecretModificationType.ENC_REACTION});return yield(0,a.gcmDecrypt)(d,r,t)}))).apply(this,arguments)}},698867:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getChatThreadID=function(){return y.apply(this,arguments)},t.getChatThreadLoggingStateDebug=function(){},t.handleActivitiesForChatThreadLogging=function(e){var t,n;return __LOG__(2)`chat_thread_logging: handling ${e.length} message(s)`,null!==(t=null===(n=_())||void 0===n?void 0:n.eventStore.handleMessages(e))&&void 0!==t?t:Promise.resolve()},t.initChatThreadLogging=function(){return f.apply(this,arguments)},t.setThreadDsTimeframeOffset=function(){return h.apply(this,arguments)},t.setThreadIdUserSecret=function(e){var t,n;return __LOG__(2)`chat_thread_logging: setting thread_id_user_secret`,null!==(t=null===(n=_())||void 0===n?void 0:n.metadataStore.setSecret(e))&&void 0!==t?t:Promise.resolve(!1)},t.uploadChatThreadLoggingEvents=function(){return g.apply(this,arguments)};var i=r(n(348926)),a=n(990445),o=n(287461),s=n(434072),l=n(648841),u=n(245146),c=n(257147),d=(n(862159),n(673168));let p=null;function _(){return null==p&&__LOG__(4,void 0,new Error)`getChatThreadLoggingState: init incomplete!`,p}function f(){return(f=(0,i.default)((function*(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=e&&(yield(0,o.getABPropConfigValue)("message_count_logging_md_enabled"));null==(yield(0,d.getChatThreadLoggingLastUploadedStartTs)())&&(yield(0,d.setChatThreadLoggingLastUploadedStartTs)(0));const n=new u.ChatThreadLoggingMetadataLocalStorage,r=t?new s.ChatThreadLoggingEventStoreImpl(n):{handleMessages:()=>Promise.resolve(),getEvent:()=>Promise.resolve(),getBeforeInclusive:()=>Promise.resolve([]),deleteBeforeInclusive:()=>Promise.resolve(0)},i=t?new l.ChatThreadLoggingEventUploaderImpl(n,r):{uploadEvents:()=>Promise.resolve(0)},a=yield n.getOffset();return null!=a&&m(a),p={metadataStore:n,eventStore:r,eventUploader:i},Promise.resolve(p)}))).apply(this,arguments)}function h(){return(h=(0,i.default)((function*(e){var t,n;__LOG__(2)`chat_thread_logging: setting offset`;const r=null!==(t=yield null===(n=_())||void 0===n?void 0:n.metadataStore.setOffset(e))&&void 0!==t&&t;return r&&m(e),r}))).apply(this,arguments)}function g(){return(g=(0,i.default)((function*(e){var t,n,r;if(null==(yield null===(t=_())||void 0===t?void 0:t.metadataStore.getOffset()))return void __LOG__(2)`chat_thread_logging: attempting to upload but offset is unset.`;null!=(yield null===(n=_())||void 0===n?void 0:n.metadataStore.getSecret())?yield null===(r=_())||void 0===r?void 0:r.eventUploader.uploadEvents(e):__LOG__(2)`chat_thread_logging: attempting to upload but secret is unset.`}))).apply(this,arguments)}function m(e){const t=(0,a.unixTime)();let n=t-t%86400+e-t;n<0&&(n+=a.DAY_SECONDS),setTimeout((0,i.default)((function*(){var t;yield null===(t=_())||void 0===t?void 0:t.eventUploader.uploadEvents(),m(e)})),1e3*n)}function y(){return(y=(0,i.default)((function*(e,t){const n=yield _(),r=yield null==n?void 0:n.metadataStore.getSecret();if(null==r)throw __LOG__(4,void 0,new Error,!0)`chat_thread_logging: cannot get chat thread ID because secret is unset.`,SEND_LOGS("ctl-secret-unset"),new Error("chat_thread_logging: cannot get chat thread ID because secret is unset.");const i=(0,c.getThreadDs)(null!=t?t:(0,a.unixTime)());return(0,c.generateThreadID)(r,e,i)}))).apply(this,arguments)}},742988:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FLAG_FIELD_NAMES=t.FLAG_FIELDS=void 0,t.toMaybeBoolFlagActionType=function(e){if(!r.hasOwnProperty(e))return null;return e};const n={isCartAddClicked:!1,isCtaOnPdpClicked:!1,isCommerceViewed:!1},r=Object.freeze(n);t.FLAG_FIELDS=r;const i=Object.freeze(Object.keys(n));t.FLAG_FIELD_NAMES=i},244612:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.COUNT_FIELD_NAMES=t.COUNT_FIELDS=void 0,t.toMaybeCountActionType=function(e){if(!r.hasOwnProperty(e))return null;return e};const n={profileViews:0,statusViews:0,statusReplies:0,groupMembershipReplies:0,groupPrivateReplies:0,profileReplies:0,chatOverflowClicks:0,pdpViews:0,ordersSent:0,repliesSent:0},r=Object.freeze(n);t.COUNT_FIELDS=r;const i=Object.freeze(Object.keys(n));t.COUNT_FIELD_NAMES=i},434072:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ChatThreadLoggingEventStoreImpl=void 0;var i=r(n(81109)),a=r(n(348926)),o=n(201063),s=n(697588),l=n(995772),u=n(469475),c=n(742988),d=n(244612),p=n(257147),_=n(658233),f=n(644034),h=n(185212),g=n(862159),m=n(76469),y=n(459857),E=r(n(124928)),S=n(669050);t.ChatThreadLoggingEventStoreImpl=class{constructor(e,t){this.metadataStore=e,this._cachedChanges=new Map,this._updateIntervalSeconds=null!=t?t:5,this._shiftTimer=new o.ShiftTimer((()=>{this._flush()}))}handleMessages(e){var t=this;return(0,a.default)((function*(){const n=yield t.metadataStore.getOffset();if(null==n)return void __LOG__(2)`ChatThreadLoggingEventStoreImpl: handleMessages: offset unset.`;const r=yield t.metadataStore.getLastUploadedStartTs();__LOG__(2)`ChatThreadLoggingEventStoreImpl: lastUploadedStartTs=${r}`,e.forEach((e=>{if(!(0,p.shouldUpdateChatEvent)(n,e.ts,r))return;const a=(0,p.computeStartTs)(n,e.ts),o=e.chatId.toString({legacy:!0}),s=o+"_"+String(a),l=t._cachedChanges.get(s),u=null!=l?l:(0,i.default)((0,i.default)((0,i.default)({},d.COUNT_FIELDS),c.FLAG_FIELDS),{},{startTs:a,chatId:o,addMsgsSent:0,addMsgsReceived:0,addViewOnceMsgsSent:0,addViewOnceMsgsReceived:0,addViewOnceMsgsOpened:0,addCallOffersSent:0,addCallOffersReceived:0,addTotalCallDuration:0,addCommerceMsgsSent:0,addCommerceMsgsReceived:0,addPdpInquiriesSent:0,addReactionsSent:0,addReactionsReceived:0,addForwardMessagesSent:0,addForwardMessagesReceived:0});null==l&&t._cachedChanges.set(s,u);const _=(0,d.toMaybeCountActionType)(e.activityType),f=(0,c.toMaybeBoolFlagActionType)(e.activityType);if(null!=_)u[_]+=1;else if(null!=f)u[f]=void 0===e.boolValue||e.boolValue;else switch(e.activityType){case"msgSend":u.addMsgsSent+=1,e.isViewOnce&&(u.addViewOnceMsgsSent+=1),!0===e.isCommerceMessage&&(u.addCommerceMsgsSent+=1),!0===e.isPdpInquiry&&(u.addPdpInquiriesSent+=1),e.isReply&&(u.repliesSent+=1),e.isReaction&&(u.addReactionsSent+=1),e.isForwarded&&(u.addForwardMessagesSent+=1);break;case"msgReceive":u.addMsgsReceived+=1,e.isViewOnce&&(u.addViewOnceMsgsReceived+=1),!0===e.isCommerceMessage&&(u.addCommerceMsgsReceived+=1),e.isReaction&&(u.addReactionsReceived+=1),e.isForwarded&&(u.addForwardMessagesReceived+=1);break;case"viewOnceOpen":u.addViewOnceMsgsOpened+=1;break;case"voipCall":e.outgoing?u.addCallOffersSent+=1:u.addCallOffersReceived+=1,u.addTotalCallDuration+=e.durationInSeconds;break;default:__LOG__(3)`Passed event store info type not valid: ${e.activityType}`}})),yield t._setFlushIfNecessary()}))()}_setFlushIfNecessary(){this._shiftTimer.onOrBefore(1e3*this._updateIntervalSeconds)}_flush(){var e=this;return(0,a.default)((function*(){const t=Array.from(e._cachedChanges.values());e._cachedChanges.clear(),yield(0,l.createOrUpdateChatEvents)(t)}))()}_populateEvents(e){return(0,a.default)((function*(){const t=(0,s.bulkGetChats)(e.map((e=>(0,S.createWid)(e.chatId)))),n=t.then((e=>function(e){return Promise.all(e.map(function(){var e=(0,a.default)((function*(e){return null==e?0:(yield(0,f.getStarredMessagesForChat)((0,S.createWid)(e.id),Number.MAX_SAFE_INTEGER)).length}));return function(){return e.apply(this,arguments)}}()))}(e))),r=t.then((e=>function(e){return(0,_.bulkGetIsContactABusiness)(e.map((e=>null==e?null:(0,S.createWid)(e.id))))}(e))),o=t.then((e=>function(e){return(0,h.bulkGetGroupMetadata)(e.map((e=>null==e?null:(0,S.createWid)(e.id))))}(e))),l=t.then((function(e){return(0,m.getParticipantTable)().bulkGet(e.map((e=>null==e?"":(0,S.createWid)(e.id).toString())))})),[c,d,T,v,A]=yield Promise.all([t,n,r,o,l]);return Promise.all(e.map(function(){var e=(0,a.default)((function*(e,t){var n,r,a,o,s,l,_;const f=c[t],h=E.default.isGroup(e.chatId),m=v[t],C=h?{isAGroup:h,groupSize:null!==(n=null===(r=A[t])||void 0===r||null===(a=r.participants)||void 0===a?void 0:a.length)&&void 0!==n?n:1,groupType:null==m?g.GroupType.DEFAULT:(0,g.getGroupTypeFromGroupMetadata)(m)}:{isAGroup:h,isAContact:yield(0,u.isAddressBookContact)(e.chatId)},P=(null!==(o=null==f?void 0:f.pin)&&void 0!==o?o:0)>0,O=null!==(s=null==f?void 0:f.archive)&&void 0!==s&&s,I=d[t],M=null!==(l=null==f?void 0:f.unreadCount)&&void 0!==l?l:0,b=0!==(null!==(_=null==f?void 0:f.muteExpiration)&&void 0!==_?_:0),R=T[t]?yield(0,p.getBizCatalogType)((0,S.createWid)(e.chatId)):null,N=!0===(null==m?void 0:m.defaultSubgroup)&&!0===(null==m?void 0:m.incognito),w=(0,y.isMeAccount)((0,S.createWid)(e.chatId));return(0,i.default)((0,i.default)({},e),{},{isPinned:P,isArchived:O,contactInfo:C,messagesStarred:I,messagesUnread:M,isMuted:b,bizCatalogType:R,isPnhEnabledChat:N,isMessageYourself:w})}));return function(){return e.apply(this,arguments)}}()))}))()}getEvent(e,t){var n=this;return(0,a.default)((function*(){n._cachedChanges.size>0&&(yield n._flush());const r=yield(0,l.getChatEvent)(e,t);return null==r?null:(yield n._populateEvents([r]))[0]}))()}getBeforeInclusive(e){var t=this;return(0,a.default)((function*(){return t._cachedChanges.size>0&&(yield t._flush()),t._populateEvents(yield(0,l.getBeforeInclusive)(e))}))()}deleteBeforeInclusive(e){var t=this;return(0,a.default)((function*(){return t._cachedChanges.size>0&&(yield t._flush()),(0,l.deleteBeforeInclusive)(e)}))()}}},648841:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ChatThreadLoggingEventUploaderImpl=void 0;var i=r(n(81109)),a=r(n(348926)),o=r(n(132375)),s=n(990445),l=n(742988),u=n(244612),c=n(257147),d=n(862159),p=r(n(571834));t.ChatThreadLoggingEventUploaderImpl=class{constructor(e,t){this.eventStore=t,this.metadataStore=e}uploadEvents(e){var t=this;return(0,a.default)((function*(){var n,r;const _=null===(n=null==e?void 0:e.purgeAfter)||void 0===n||n,f=yield t.metadataStore.getOffset();if(null==f)return __LOG__(3)`ChatThreadLoggingBatchEventUploader: offset not in store!`,-1;const h=null!==(r=null==e?void 0:e.lastStartTs)&&void 0!==r?r:(0,c.computeStartTs)(f,(0,s.unixTime)()-s.DAY_SECONDS);if(null==t.secret){const e=yield t.metadataStore.getSecret();if(null==e)return __LOG__(3)`ChatThreadLoggingBatchEventUploader: secret not in store!`,-1;t.secret=e}const g=yield t.eventStore.getBeforeInclusive(h);try{yield Promise.all(g.map(function(){var e=(0,a.default)((function*(e){const n=(0,c.getThreadDs)(e.startTs),r=e.contactInfo;new p.default.ChatMessageCounts((0,i.default)((0,i.default)((0,i.default)({},u.COUNT_FIELD_NAMES.reduce(((t,n)=>(t[n]=e[n],t)),{})),l.FLAG_FIELD_NAMES.reduce(((t,n)=>(t[n]=e[n],t)),{})),{},{messagesSent:e.msgsSent,messagesReceived:e.msgsReceived,viewOnceMessagesSent:e.viewOnceMsgsSent,viewOnceMessagesReceived:e.viewOnceMsgsReceived,viewOnceMessagesOpened:e.viewOnceMessagesOpened,threadDs:n,threadId:yield(0,c.generateThreadID)((0,o.default)(t.secret,"_this.secret"),e.chatId,n),isAGroup:e.contactInfo.isAGroup,groupSize:r.isAGroup?r.groupSize:void 0,isAContact:r.isAGroup?void 0:r.isAContact,isArchived:e.isArchived,isPinned:e.isPinned,messagesStarred:e.messagesStarred,messagesUnread:e.messagesUnread,chatMuted:e.isMuted?p.default.CHAT_MUTED_TYPE.MUTED_NO_NOTIFICATIONS:p.default.CHAT_MUTED_TYPE.NOT_MUTED,callOffersSent:e.callOffersSent,callOffersReceived:e.callOffersReceived,totalCallDuration:e.totalCallDuration,typeOfGroup:null!=e.contactInfo.groupType?(0,d.groupTypeToWamEnum)(e.contactInfo.groupType):void 0,isPnhEnabledChat:e.isPnhEnabledChat,reactionsSent:e.reactionsSent,reactionsReceived:e.reactionsReceived,isMessageYourself:e.isMessageYourself,forwardMessagesSent:e.forwardMessagesSent,forwardMessagesReceived:e.forwardMessagesReceived})).commit()}));return function(){return e.apply(this,arguments)}}()))}catch(e){__LOG__(4,void 0,new Error,!0)`chat_thread_logging: error uploading events: ${e.toString()}`,SEND_LOGS("thread-logging-upload-failure")}if(_){const e=yield t.eventStore.deleteBeforeInclusive(h);e!==g.length&&__LOG__(4,void 0,new Error)`uploadEvents: uploaded ${g.length} events but only deleted ${e} (they should be the same!)`}return yield t.metadataStore.setLastUploadedStartTs(h),g.length}))()}}},245146:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ChatThreadLoggingMetadataLocalStorage=void 0;var i=r(n(348926)),a=n(417405),o=n(673168);t.ChatThreadLoggingMetadataLocalStorage=class{setOffset(e){return(0,i.default)((function*(){return yield(0,o.setChatThreadLoggingOffset)(e),!0}))()}getOffset(){return(0,o.getChatThreadLoggingOffset)()}setSecret(e){return(0,i.default)((function*(){return yield(0,o.setChatThreadLoggingSecretB64)((0,a.encodeB64)(e)),!0}))()}getSecret(){return(0,i.default)((function*(){const e=yield(0,o.getChatThreadLoggingSecretB64)();return null==e?null:(0,a.decodeB64)(e)}))()}setLastUploadedStartTs(e){return(0,i.default)((function*(){return yield(0,o.setChatThreadLoggingLastUploadedStartTs)(e),!0}))()}getLastUploadedStartTs(){return(0,i.default)((function*(){const e=yield(0,o.getChatThreadLoggingLastUploadedStartTs)();return null!=e?e:0}))()}}},257147:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.computeStartTs=g,t.generateThreadID=function(){return h.apply(this,arguments)},t.getBizCatalogType=function(){return m.apply(this,arguments)},t.getThreadDs=function(e){return(0,s.toDate)((0,s.castToUnixTime)(e-8*s.HOUR_SECONDS)).toISOString().split("T")[0].replace(/-/g,"/")},t.isCommerceMessage=function(e){var t;const n=new Set([c.MSG_TYPE.PRODUCT,c.MSG_TYPE.ORDER,c.MSG_TYPE.LIST]);return n.has(e.type)||n.has(null===(t=e.quotedMsg)||void 0===t?void 0:t.type)||!!(e.matchedText&&(r=e.matchedText,(0,p.matchCatalogUrl)(r)||(0,p.matchProductUrl)(r)))||e.type===c.MSG_TYPE.NATIVE_FLOW&&(e.nativeFlowName===u.default.ORDER_DETAILS||e.nativeFlowName===u.default.ORDER_STATUS);var r},t.shouldIncrementMsgSendAndReceive=function(e){if([c.MSG_TYPE.KEEP_IN_CHAT].includes(e.type))return!1;return!0},t.shouldUpdateChatEvent=function(e,t,n){return g(e,t)>n};var i=r(n(348926)),a=n(417405),o=n(128326),s=n(990445),l=n(817649),u=r(n(753110)),c=n(373070),d=n(228733),p=n(127714);const _=new TextEncoder,f=e=>_.encode(e).buffer;function h(){return(h=(0,i.default)((function*(e,t,n){const r=f(t+n),i=yield(0,o.hmacSha256)(e,r);return(0,a.encodeB64)(i)}))).apply(this,arguments)}function g(e,t){const n=t%s.DAY_SECONDS,r=t-n;return n>=e?r+e:r-s.DAY_SECONDS+e}function m(){return(m=(0,i.default)((function*(e){var t,n;let r;try{r=yield(0,d.queryBusinessProfile)([{wid:e}])}catch(e){return __LOG__(4,!0,new Error,!0)`Thread Logging: Failed to query business profile to set "biz_catalog_type"`,SEND_LOGS("query-business-profile-fail"),null}const i=r[0];if(!i)return null;const a=null===(t=i.profile)||void 0===t||null===(n=t.profile_options)||void 0===n?void 0:n.commerce_experience;return a===l.COMMERCE_EXPERIENCE_TYPES.CATALOG?"native":a===l.COMMERCE_EXPERIENCE_TYPES.SHOP?"shop":null}))).apply(this,arguments)}},644034:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getStarredMessagesForChat=function(e,t,n){return Promise.resolve().then((()=>{if(null!=n)return(0,a.getTable)().get(n.toString())})).then((n=>{const o=null==n?[(0,i.endOfChat)(e),1/0]:[n.internalId,n.isStarred],s=[(0,i.beginningOfChat)(e),0];return(0,a.getTable)().between(["internalId","isStarred"],s,o,{lowerInclusive:!1,upperInclusive:!1,reverse:!0,limit:t}).then((e=>e.map(r.messageFromDbRow)))}))};var r=n(907539),i=n(878685),a=n(121260)},410322:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateDatabaseForLastAddOnPreview=function(e){if(!(0,i.showReactionChatListPreview)())return Promise.resolve();return(0,r.bulkUpdateChatLastAddOnPreview)(e)};var r=n(697588),i=n(97858)},928563:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.lastAddOnPreviewCandidateFromReactionRowType=function(e){return{msgKey:e.msgKey,parentMsgKey:e.parentMsgKey,sender:e.senderUserJid,reactionText:e.reactionText,timestamp:e.timestamp,isOrphan:1===e.orphan,type:"reaction"}},t.lastAddOnPreviewCandidateFromVoteData=function(e,t){return{msgKey:e.msgKey.toString(),isOrphan:t,selectedOptionsCount:e.selectedOptionLocalIds.length,parentMsgKey:e.parentMsgKey.toString(),sender:e.sender.toString(),timestamp:e.senderTimestampMs,type:"poll_vote"}},t.lastAddOnPreviewFromCandidate=function(e){switch(e.type){case"reaction":return{type:"reaction",msgKey:e.msgKey,parentMsgKey:e.parentMsgKey,reactionText:e.reactionText,sender:e.sender,timestamp:e.timestamp};case"poll_vote":return{type:"poll_vote",msgKey:e.msgKey,parentMsgKey:e.parentMsgKey,sender:e.sender,timestamp:e.timestamp}}},t.lastAddOnPreviewFromDeprecatedLastReactionPreview=function(e){return{msgKey:e.msgKey,parentMsgKey:e.parentMsgKey,sender:e.senderUserJid,timestamp:e.timestamp,reactionText:(0,i.default)(e.reactionText,"lastReactionPreview.reactionText"),type:"reaction"}};var i=r(n(132375))},450491:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.attachContactLidInfo=function(){return f.apply(this,arguments)},t.clearLidInfoMappingCache=function(){p.clear(),_.clear()},t.createOrReplaceDisplayNames=function(){return h.apply(this,arguments)},t.createOrReplaceLidPnMappings=function(){return g.apply(this,arguments)},t.getCurrentLid=function(){return y.apply(this,arguments)},t.getCurrentPn=function(e){const t=p.get(e);if(null!=t)return(0,d.createUserWid)(t)},t.loadPnMapping=function(){return E.apply(this,arguments)},t.retrieveAllLidFromPn=function(){return m.apply(this,arguments)},t.updateLidChatState=function(){return S.apply(this,arguments)};var i=r(n(348926)),a=n(990445),o=n(359987),s=n(605316),l=n(640322),u=n(594014),c=n(257678),d=n(669050);const p=new Map,_=new Map;function f(){return(f=(0,i.default)((function*(e){const t=e.id.user;let n,r;if(p.has(t))n=p.get(t);else{const e=yield(0,c.getTable)().get(t);n=null==e?void 0:e.phoneNumber,p.set(t,n)}if(null!=n&&(e.phoneJid=(0,d.createUserWid)(n)),_.has(t))r=_.get(t);else{const e=yield(0,u.getTable)().get(t);r=null==e?void 0:e.displayName,_.set(t,r)}null!=r&&(e.displayNameLID=r);const i=yield(0,l.getTable)().get(t);null!=i&&(e.shareOwnPn=i.shareOwnPn,e.requestedPnTimestamp=i.requestedPnTimestamp)}))).apply(this,arguments)}function h(){return(h=(0,i.default)((function*(e){const t=e.filter((e=>{let{lid:t,displayName:n}=e;return _.get(t)!==n}));0!==t.length&&(t.forEach((e=>{let{lid:t,displayName:n}=e;_.set(t,n),(0,o.frontendFireAndForget)("updateDisplayNameLid",{lid:t,displayName:n})})),yield(0,u.getTable)().bulkCreateOrReplace(t.map((e=>{let{lid:t,displayName:n}=e;return{id:t,displayName:n}}))))}))).apply(this,arguments)}function g(){return(g=(0,i.default)((function*(e){const t=e.filter((e=>{let{lid:t,pn:n}=e;return p.get(t)!==n}));0!==t.length&&(t.forEach((e=>{let{lid:t,pn:n}=e;p.set(t,n),(0,o.frontendFireAndForget)("updatePhoneNumberJid",{lid:t,phoneNumber:n})})),yield(0,s.getStorage)().lock(["lid-pn-mapping"],(0,i.default)((function*(){const e=yield(0,c.getTable)().bulkGet(t.map((e=>{let{lid:t}=e;return t}))),n=new Map(e.filter((e=>null!=e)).map((e=>[e.id,e.phoneNumber]))),r=t.filter((e=>{let{lid:t,pn:r}=e;return n.get(t)!==r}));if(0===r.length)return;const i=(0,a.unixTime)();yield(0,c.getTable)().bulkCreateOrReplace(r.map((e=>{let{lid:t,pn:n}=e;return{id:t,phoneNumber:n,createdAtTimestamp:i}})))}))))}))).apply(this,arguments)}function m(){return(m=(0,i.default)((function*(e){const t=[];return yield(0,c.getTable)().equals(["phoneNumber"],e).then((e=>{e.map((e=>{let{id:n}=e;return t.push(n)}))})),t}))).apply(this,arguments)}function y(){return(y=(0,i.default)((function*(e){let t,n;return(yield(0,c.getTable)().equals(["phoneNumber"],e)).map((e=>{let{id:r,createdAtTimestamp:i}=e;n?i>n&&(t=r,n=i):(t=r,n=i)})),null!=t?(0,d.createUserWid)(t,"lid"):null}))).apply(this,arguments)}function E(){return(E=(0,i.default)((function*(e){if(p.has(e))return;const t=yield(0,c.getTable)().get(e),n=null==t?void 0:t.phoneNumber;p.set(e,n)}))).apply(this,arguments)}function S(){return(S=(0,i.default)((function*(e,t,n){(0,o.frontendFireAndForget)("updateLidChatState",{lid:e,shareOwnPn:t,requestedPnTimestamp:n}),yield(0,l.getTable)().createOrReplace({id:e,shareOwnPn:t,requestedPnTimestamp:n})}))).apply(this,arguments)}},658233:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bulkGetIsContactABusiness=function(e){return(0,r.getTable)().bulkGet(e.map((e=>{var t;return null!==(t=null==e?void 0:e.user)&&void 0!==t?t:""}))).then((e=>e.map((e=>null!=e))))};var r=n(646240)},881646:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.persistContactUpdateBatched=void 0;var i=r(n(81109)),a=r(n(348926)),o=n(282302),s=n(490474);const l=(0,o.batch)({delayMs:3e3},function(){var e=(0,a.default)((function*(e){return yield function(){return u.apply(this,arguments)}(e),e.map((()=>{}))}));return function(){return e.apply(this,arguments)}}());function u(){return(u=(0,a.default)((function*(e){const t=Array.from(e.reduce(((e,t)=>{var n;return e.set(t.id,(0,i.default)((0,i.default)({},null!==(n=e.get(t.id))&&void 0!==n?n:{}),t)),e}),new Map).values());yield(0,s.getTable)().bulkCreateOrMerge(t)}))).apply(this,arguments)}t.persistContactUpdateBatched=l},83672:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getFanOutList=function(){return l.apply(this,arguments)};var i=r(n(348926)),a=n(866729),o=n(459857),s=n(669050);function l(){return(l=(0,i.default)((function*(e){let{wids:t}=e;const n=yield(0,a.getDeviceIds)(t),r=new Map;return n.forEach(((e,n)=>{if(e){const{devices:t}=e;t.forEach((t=>{const n=(0,s.createDeviceWidFromDeviceListPk)(e.id,t);(0,o.isMeDevice)(n)||r.set(n.toString(),n)}))}else{__LOG__(2,void 0,void 0,void 0,["messaging"])`getFanOutList: no device is found, just send to the primary device`;const e=(0,s.toUserWid)(t[n]);(0,o.isMeAccount)(e)||r.set(e.toString(),e)}})),Array.from(r.values())}))).apply(this,arguments)}},35665:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.persistCommunityLink=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i={chatId:e,subgroups:t,action:n};if(r)return d(i);return u([i])};var i=r(n(348926)),a=n(282302),o=n(667662),s=n(76469),l=n(484187);function u(){return c.apply(this,arguments)}function c(){return(c=(0,i.default)((function*(e){const t=new Map,n=new Map;e.forEach((e=>{switch(e.subgroups.forEach((e=>{n.set(String(e.id),null)})),e.action){case o.CommunityLinkOperation.SiblingGroupLink:case o.CommunityLinkOperation.SiblingGroupUnlink:t.set(String(e.chatId),null)}})),(yield(0,s.getGroupMetadataTable)().bulkGet(Array.from(t.keys()))).forEach((e=>{e&&null!=e.parentGroup&&t.set(e.id,String(e.parentGroup))})),(yield(0,s.getChatTable)().bulkGet(Array.from(n.keys()))).forEach((e=>{e&&n.set(e.id,e)}));const r=new Map,i=new Map,a=new Set;e.forEach((e=>{let s=null,l=!1;switch(e.action){case o.CommunityLinkOperation.SiblingGroupLink:s=t.get(String(e.chatId)),l=!0;break;case o.CommunityLinkOperation.SiblingGroupUnlink:s=t.get(String(e.chatId)),l=!1;break;case o.CommunityLinkOperation.SubGroupLink:s=String(e.chatId),l=!0;break;case o.CommunityLinkOperation.SubGroupUnlink:s=String(e.chatId),l=!1}null!=s&&((e,t,o)=>{t.forEach((t=>{const s=String(t.id),l=n.get(s);if(null==l||l.isReadOnly)if(o){var u;a.delete(s);const n={id:s,subject:t.subject,subjectTime:null!==(u=t.subjectTime)&&void 0!==u?u:0,parentGroup:e},r=i.get(s);r&&r.subjectTime>n.subjectTime&&(n.subject=r.subject,n.subjectTime=r.subjectTime),i.set(s,n)}else i.delete(s),a.add(s);else r.set(s,{id:s,parentGroup:o?e:void 0})}))})(s,e.subgroups,l)})),yield Promise.all([(0,s.getGroupMetadataTable)().bulkCreateOrMerge(Array.from(r.values())),(0,l.getTable)().bulkRemove(Array.from(a)),(0,l.getTable)().bulkGet(Array.from(i.keys())).then((e=>(e.forEach((e=>{if(!e)return;const t=i.get(e.id);t&&null!=e.subjectTime&&e.subjectTime>t.subjectTime&&(t.subjectTime=e.subjectTime,t.subject=e.subject)})),(0,l.getTable)().bulkCreateOrMerge(Array.from(i.values())))))])}))).apply(this,arguments)}const d=(0,a.batch)({delayMs:5e3},function(){var e=(0,i.default)((function*(e){return yield u(e),Promise.resolve(e.map((()=>{})))}));return function(){return e.apply(this,arguments)}}())},608916:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addParticipantInfo=A,t.addPastParticipants=function(e){return(0,p.getStorage)().lock(["participant"],function(){var t=(0,a.default)((function*(t){let[n]=t;const r=yield n.bulkGet(e.map((e=>e.groupId))),i=e.map(((e,t)=>{let{groupId:n,pastParticipants:i}=e;const a=r[t];return a?function(e,t){return{groupId:e.groupId,senderKey:e.senderKey,participants:e.participants,pastParticipants:t.map((e=>{let{id:t,leaveReason:n,leaveTs:r}=e;return{jid:t.toString(),leaveTs:r,leaveReason:n}})),admins:e.admins,rotateKey:e.rotateKey,version:e.version,staleType:e.staleType}}(a,i):I(n,{pastParticipants:i})}));n.bulkCreateOrReplace(i)}));return function(){return t.apply(this,arguments)}}())},t.createParticipantInfo=I,t.getGroupParticipant=function(){return b.apply(this,arguments)},t.markGroupParticipantStale=function(e){let{group:t}=e;return(0,p.getStorage)().lock(["participant"],(e=>{let[n]=e;return n.merge(String(t),{staleType:s.STALE_TYPES.PARTICIPANT})}))},t.modifyGroupParticipant=function(e){let{group:t,oldId:n,newId:r,prevVersion:o,newVersion:l}=e;const u=String(t);return(0,p.getStorage)().lock(["participant"],function(){var e=(0,a.default)((function*(e){let[t]=e;const a=yield t.get(u);if(!a)throw new s.GroupUnSyncedError("modifyGroupParticipant: group participant info missing");if(a.version&&(null==o||o!==a.version)&&!(0,c.isVIdDeprecationEnabled)())throw new s.GroupUnSyncedError("modifyGroupParticipant: prev version info missing");return t.createOrReplace(function(e,t,n,r){const a=String(t),o=String(n),s=new Map(e.senderKey),l=e.participants.filter((e=>e!==a)).concat(o);Array.from(s.keys()).forEach((e=>{const n=(0,y.createWid)(e).user;t.user===n?s.delete(e):s.set(e,!1)})),s.set(o,!1);const u=e.admins.map((e=>e===a?o:e));return(0,i.default)((0,i.default)({},e),{},{participants:l,senderKey:s,admins:u,version:r,rotateKey:!0})}(a,n,r,l))}));return function(){return e.apply(this,arguments)}}())},t.removeParticipantInfo=C,t.replaceParticipantInfo=M,t.replaceParticipants=function(e){let{group:t,participants:n,admins:r,deviceIds:i,version:a}=e;const o=t.toString();return(0,p.getStorage)().lock(["participant"],(e=>{let[t]=e;return t.get(o).then((e=>e?t.createOrReplace(M(e,{participants:n,admins:r,deviceIds:i,version:a})):t.create(I(o,{participants:n,admins:r,deviceIds:i,version:a}))))}))},t.updateCommunityParticipants=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(n)return v({id:String(e),data:t});const{participants:r}=t,i=e.toString();return(0,p.getStorage)().lock(["participant"],function(){var e=(0,a.default)((function*(e){let[n]=e;const a=yield n.get(i);if(!a)throw new s.GroupUnSyncedError(`updateCommunityParticipants: group participant info missing for action ${t.action}`);switch(t.action){case s.PARTICIPANT_OPERATION.LINKED_GROUP_PROMOTE:return n.createOrReplace(O(a,r,s.PARTICIPANT_OPERATION.LINKED_GROUP_PROMOTE));case s.PARTICIPANT_OPERATION.LINKED_GROUP_DEMOTE:return n.createOrReplace(O(a,r,s.PARTICIPANT_OPERATION.LINKED_GROUP_DEMOTE));default:throw new Error(`updateCommunityParticipants: failed with unknown action ${t.action}`)}}));return function(){return e.apply(this,arguments)}}())},t.updateGroupParticipantTableWithoutDeviceSync=function(){return S.apply(this,arguments)},t.updateParticipants=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(n)return T({id:String(e),data:t});const{participants:r,version:i,prevVersion:o}=t,l=e.toString();return(0,p.getStorage)().lock(["participant"],function(){var e=(0,a.default)((function*(e){let[n]=e;const a=yield n.get(l);if(!a)throw new s.GroupUnSyncedError(`updateParticipants: group participant info missing for action ${t.action}`);if(a.version&&(null==o||o!==a.version)&&!(0,c.isVIdDeprecationEnabled)())throw new s.GroupUnSyncedError(`updateParticipants: prevVersion info missing for action ${t.action}`);switch(t.action){case s.PARTICIPANT_OPERATION.ADD:return n.createOrReplace(A(a,r,t.deviceIds,i));case s.PARTICIPANT_OPERATION.REMOVE:return n.createOrReplace(C(a,r,t.timestamp,t.author,i,t.reason));case s.PARTICIPANT_OPERATION.DEMOTE:return n.createOrReplace(P(a,r,i,s.PARTICIPANT_OPERATION.DEMOTE));case s.PARTICIPANT_OPERATION.PROMOTE:return n.createOrReplace(P(a,r,i,s.PARTICIPANT_OPERATION.PROMOTE));default:throw new Error(`updateParticipants: failed with unknown action ${t.action}`)}}));return function(){return e.apply(this,arguments)}}())};var i=r(n(81109)),a=r(n(348926)),o=n(282302),s=n(209639),l=n(862159),u=n(687352),c=n(97858),d=n(76469),p=n(605316),_=n(437695),f=n(556078),h=n(459857),g=n(440401),m=r(n(571834)),y=n(669050),E=n(511448);function S(){return(S=(0,a.default)((function*(e){let{groupInfos:t}=e;const n=yield(0,d.getParticipantTable)().bulkGet(t.map((e=>e.id.toString()))),r=new Map;n.forEach((e=>e&&r.set(e.groupId,e.senderKey)));const i=t.map((e=>{var t;const n=[],i=[],a=e.id.toString(),o=r.get(a)||new Map;null===(t=e.participants)||void 0===t||t.forEach((e=>{e.isAdmin&&i.push(e.id),n.push(e.id)}));let l=[];var u,c;(0,f.pastParticipantsDbEnabled)()&&(l=null!==(u=null===(c=e.pastParticipants)||void 0===c?void 0:c.map((e=>{let{id:t,leaveTs:n,leaveReason:r}=e;return{jid:t.toString(),leaveTs:n,leaveReason:r}})))&&void 0!==u?u:[]);if(Boolean(e.incognito)&&Boolean(e.defaultSubgroup)){const t=i.some((e=>(0,h.isMeAccount)(e)));(0,E.augmentedCagGroupParticipantList)(t,e.participants).forEach((function(e){const t=String(e);o.has(t)||o.set(t,!1)}))}else{var d;null===(d=e.participants)||void 0===d||d.forEach((e=>{o.set(String(e.id),!1)}))}return{groupId:a,participants:n.map(String),pastParticipants:l,admins:i.map(String),senderKey:o,rotateKey:!1,staleType:s.STALE_TYPES.DEVICE}}));return(0,d.getParticipantTable)().bulkCreateOrReplace(i)}))).apply(this,arguments)}const T=(0,o.batch)({delayMs:3e3},function(){var e=(0,a.default)((function*(e){const t=Array.from(new Set(e.map((e=>e.id))));return yield(0,p.getStorage)().lock(["participant"],function(){var n=(0,a.default)((function*(n){let[r]=n;const i=new Map((yield r.bulkGet(t)).filter(Boolean).map((e=>[e.groupId,e])));return e.forEach((e=>{let{id:t,data:n}=e;const r=i.get(t);if(!r)return void __LOG__(2)`updateParticipantsBatched: no local record found for group ${t}`;const{participants:a,version:o,prevVersion:l}=n;if(null!=r.version&&(null==l||l!==r.version))return __LOG__(2)`updateParticipantsBatched: out-of-order group notification for ${t}, action: ${n.action}`,void(r.deviceSyncComplete=!1);let u=null;switch(n.action){case s.PARTICIPANT_OPERATION.ADD:u=A(r,a,n.deviceIds,o);break;case s.PARTICIPANT_OPERATION.REMOVE:u=C(r,a,n.timestamp,n.author,o,n.reason);break;case s.PARTICIPANT_OPERATION.DEMOTE:u=P(r,a,o,s.PARTICIPANT_OPERATION.DEMOTE);break;case s.PARTICIPANT_OPERATION.PROMOTE:u=P(r,a,o,s.PARTICIPANT_OPERATION.PROMOTE);break;default:__LOG__(2)`updateParticipants: failed with unknown action ${n.action}`}null!=u&&i.set(u.groupId,u)})),r.bulkCreateOrReplace(Array.from(i.values()))}));return function(){return n.apply(this,arguments)}}()),e.map((()=>{}))}));return function(){return e.apply(this,arguments)}}()),v=(0,o.batch)({delayMs:3e3},function(){var e=(0,a.default)((function*(e){const t=Array.from(new Set(e.map((e=>e.id))));return yield(0,p.getStorage)().lock(["participant"],function(){var n=(0,a.default)((function*(n){let[r]=n;const i=new Map((yield r.bulkGet(t)).filter(Boolean).map((e=>[e.groupId,e])));return e.forEach((e=>{let{id:t,data:n}=e;const r=i.get(t);if(!r)return void __LOG__(2)`updateCommunityParticipantsBatched: no local record found for group ${t}`;const{participants:a}=n;let o=null;switch(n.action){case s.PARTICIPANT_OPERATION.LINKED_GROUP_PROMOTE:o=O(r,a,s.PARTICIPANT_OPERATION.LINKED_GROUP_PROMOTE);break;case s.PARTICIPANT_OPERATION.LINKED_GROUP_DEMOTE:o=O(r,a,s.PARTICIPANT_OPERATION.LINKED_GROUP_DEMOTE);break;default:__LOG__(2)`updateCommunityParticipantsBatched: failed with unknown action ${n.action}`}null!=o&&i.set(o.groupId,o)})),r.bulkCreateOrReplace(Array.from(i.values()))}));return function(){return n.apply(this,arguments)}}()),e.map((()=>{}))}));return function(){return e.apply(this,arguments)}}());function A(e,t,n,r){const i=new Map(e.senderKey);n.forEach((e=>{if((0,h.isMeDevice)(e))return;const t=String(e);i.set(t,!1)}));const a=t.map((e=>{let{id:t,lid:n}=e;return null==n||t.isLid()?null:String(n)})).filter(Boolean),o=t.map((e=>{let{id:t}=e;return String(t)}));let s=e.pastParticipants;var l,u;(0,f.pastParticipantsDbEnabled)()&&(s=null!==(l=null===(u=s)||void 0===u?void 0:u.filter((e=>!o.includes(e.jid))))&&void 0!==l?l:[]);const c=e.participants.filter((e=>!a.includes(e))).concat(o);return{groupId:e.groupId,senderKey:i,participants:c,pastParticipants:s,admins:e.admins,rotateKey:e.rotateKey,version:r,staleType:e.staleType}}function C(e,t,n,r,i,a){const o=new Map(e.senderKey);let s=!(0,c.rotateSenderKeyIfSentEnabled)()||e.rotateKey;t.every((e=>e.id.isLid()))&&(s=e.rotateKey);const d=t.map((e=>e.id.isLid()?e.id:e.lid)).filter(Boolean);o.forEach(((e,n)=>{const r=(0,y.createWid)(n);if(r.isLid()){return void(d.some((e=>e.user===r.user&&e.server===r.server))&&o.delete(n))}t.some((e=>e.id.user===r.user&&e.id.server===r.server))&&(s=s||e,o.delete(n))})),s&&o.forEach(((e,t)=>{(0,y.createWid)(t).isLid()||o.set(t,!1)}));const p=t.map((e=>{let{id:t}=e;return String(t)}));let g=e.pastParticipants;var E,S;(0,f.pastParticipantsDbEnabled)()&&(g=null===(E=g)||void 0===E?void 0:E.concat(null!==(S=t.map((e=>({jid:e.id.toString(),leaveTs:n,leaveReason:e.id.equals(r)?u.LeaveReason.Left:u.LeaveReason.Removed}))))&&void 0!==S?S:[]));!e.rotateKey&&s&&(0,_.postSenderKeyExpiredMetric)({chatId:e.groupId,deviceCount:e.senderKey.size,expiryReason:m.default.EXPIRY_REASON.USER_LEAVE});const T=e.admins.filter((e=>!p.includes(e)));let v=e.participants;if(a===l.REMOVE_REASON.DEFAULT_SUBGROUP_DEMOTE){if(!T.some((e=>(0,h.isMeAccount)((0,y.createWid)(e))))){const e=t.reduce(((e,t)=>{let{lid:n,id:r}=t;return null==n||r.isLid()?e:e.set(r.toString(),n.toString())}),new Map);v=v.map((t=>{var n;return null!==(n=e.get(t))&&void 0!==n?n:t}))}}else v=v.filter((e=>!p.includes(e)));return{groupId:e.groupId,senderKey:o,participants:v,pastParticipants:g,admins:T,rotateKey:s,version:i,staleType:e.staleType}}function P(e,t,n,r){let i=e.admins;const a=t.map((e=>{let{id:t}=e;return String(t)}));let o=e.participants;if(r===s.PARTICIPANT_OPERATION.DEMOTE){i=e.admins.filter((e=>!a.includes(e)));if(!i.some((e=>(0,h.isMeAccount)((0,y.createWid)(e))))){const e=t.reduce(((e,t)=>{let{lid:n,id:r}=t;return null==n||r.isLid()?e:e.set(r.toString(),n.toString())}),new Map);o=o.map((t=>{var n;return null!==(n=e.get(t))&&void 0!==n?n:t}))}}else if(r===s.PARTICIPANT_OPERATION.PROMOTE){const n=t.reduce(((e,t)=>{let{lid:n,id:r}=t;return null==n||r.isLid()?e:e.set(n.toString(),r.toString())}),new Map);i=e.admins.concat(a),o=o.map((e=>{var t;return null!==(t=n.get(e))&&void 0!==t?t:e}))}return{groupId:e.groupId,senderKey:e.senderKey,participants:o,pastParticipants:e.pastParticipants,admins:i,rotateKey:e.rotateKey,version:n,staleType:e.staleType}}function O(e,t,n){let r=e.admins,i=e.participants;const a=t.map((e=>{let{id:t}=e;return String(t)}));if(n===s.PARTICIPANT_OPERATION.LINKED_GROUP_DEMOTE)r=e.admins.filter((e=>!a.includes(e))),i=r;else if(n===s.PARTICIPANT_OPERATION.LINKED_GROUP_PROMOTE){const t=a.filter((t=>!e.admins.includes(t)));r=e.admins.concat(t),i=r}return{groupId:e.groupId,senderKey:e.senderKey,participants:i,pastParticipants:e.pastParticipants,admins:r,rotateKey:e.rotateKey,version:e.version,staleType:e.staleType}}function I(e,t){const{participants:n=[],pastParticipants:r=[],admins:i=[],deviceIds:a=[],version:o}=t,l=new Map;return a.forEach((e=>{if((0,h.isMeDevice)(e))return;const t=String(e);l.has(t)||l.set(t,!1)})),{groupId:e,senderKey:l,participants:n.map((e=>{let{id:t}=e;return String(t)})),pastParticipants:r.map((e=>{let{id:t,leaveReason:n,leaveTs:r}=e;return{jid:t.toString(),leaveTs:r,leaveReason:n}})),admins:i.map(String),rotateKey:!1,version:o,staleType:0===n.length?s.STALE_TYPES.PARTICIPANT:void 0}}function M(e,t){const{participants:n,admins:r,deviceIds:i,version:a}=t;let o=e.rotateKey;const s=e.senderKey,l=new Map;i.forEach((e=>{if((0,h.isMeDevice)(e))return;const t=String(e),n=s.get(t);null==n?l.set(t,!1):(l.set(t,n),s.delete(t))}));for(const[e,t]of s.entries())if(t&&!(0,y.createWid)(e).isLid()){o=!0;break}return{groupId:e.groupId,senderKey:l,participants:n.map((e=>{let{id:t}=e;return String(t)})),pastParticipants:e.pastParticipants,admins:r.map(String),rotateKey:o,version:a}}function b(){return(b=(0,a.default)((function*(e){var t,n,r;let{groupWid:i}=e;const a=yield(0,d.getParticipantTable)().get(String(i));if(!a)return null;const o=new Set(a.admins),l=null!==(t=null===(n=a.participants)||void 0===n?void 0:n.map((e=>({id:(0,y.createWid)(e),isAdmin:o.has(e),isSuperAdmin:!1}))))&&void 0!==t?t:[];let u=[];var c,p;(0,f.pastParticipantsDbEnabled)()&&(u=null!==(c=null===(p=a.pastParticipants)||void 0===p?void 0:p.map((e=>{let{jid:t,leaveTs:n,leaveReason:r}=e;return{id:(0,y.createWid)(t),leaveTs:n,leaveReason:r}})))&&void 0!==c?c:[]);(0,g.cacheGroupMetrics)(a);const _=null==a.deviceSyncComplete||a.deviceSyncComplete?void 0:s.STALE_TYPES.PARTICIPANT;return{participants:l,pastParticipants:u,staleType:null!==(r=a.staleType)&&void 0!==r?r:_,deviceCount:a.senderKey.size}}))).apply(this,arguments)}},185212:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.bulkGetGroupMetadata=function(e){return(0,s.getGroupMetadataTable)().bulkGet(e.map((e=>null==e?"":e.toString())))},t.getGroupMetadata=function(){return d.apply(this,arguments)},t.persistGroupMetadata=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(n)return p((0,i.default)({id:e.toString()},t));return(0,s.getGroupMetadataTable)().createOrMerge(e.toString(),(0,i.default)({id:e.toString()},t))},t.updateGroupMetadataTable=function(){return c.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(282302),s=n(76469),l=n(605316),u=n(669050);function c(){return(c=(0,a.default)((function*(e){let{groupInfos:t}=e,n=[];yield(0,l.getStorage)().lock(["group-metadata"],function(){var e=(0,a.default)((function*(e){let[r]=e;const a=yield r.bulkGet(t.map((e=>e.id.toString())));return n=t.map(((e,t)=>{var n,r,o,s,l,u,c,d;const p=a[t];let _={subject:e.subject,subjectTime:e.subjectTime||0},f={announce:e.announce,a_v_id:e.a_v_id||0},h={desc:e.desc,descId:e.descId,descOwner:null===(n=e.descOwner)||void 0===n?void 0:n.toString(),descTime:e.descTime||0};if(p){const e=p.subjectTime||0,t=p.a_v_id||0,n=p.descTime||0;e>_.subjectTime&&(_={subject:p.subject,subjectTime:e}),t>f.a_v_id&&(f={announce:p.announce,a_v_id:t}),n>h.descTime&&(h={desc:p.desc,descId:p.descId,descOwner:p.descOwner,descTime:n})}return(0,i.default)((0,i.default)((0,i.default)({id:e.id.toString(),creation:e.creation,owner:null===(r=e.owner)||void 0===r?void 0:r.toString(),restrict:e.restrict,noFrequentlyForwarded:e.noFrequentlyForwarded,ephemeralDuration:e.ephemeralDuration||0,membershipApprovalMode:e.membershipApprovalMode,growthLockExpiration:e.growthLockExpiration,growthLockType:e.growthLockType,size:e.size||0,support:null!==(o=e.support)&&void 0!==o&&o,suspended:null!==(s=e.suspended)&&void 0!==s&&s,terminated:null!==(l=e.terminated)&&void 0!==l&&l,parentGroup:null===(u=e.parentGroup)||void 0===u?void 0:u.toString(),isParentGroup:e.isParentGroup,isParentGroupClosed:e.isParentGroupClosed,defaultSubgroup:e.defaultSubgroup,lastActivityTimestamp:null!==(c=null==p?void 0:p.lastActivityTimestamp)&&void 0!==c?c:0,lastSeenActivityTimestamp:null!==(d=null==p?void 0:p.lastSeenActivityTimestamp)&&void 0!==d?d:0,incognito:e.incognito},_),h),f)})),r.bulkCreateOrMerge(n)}));return function(){return e.apply(this,arguments)}}())}))).apply(this,arguments)}function d(){return(d=(0,a.default)((function*(e){var t,n,r,i,a,o;let{groupWid:l}=e;const c=yield(0,s.getGroupMetadataTable)().get(String(l));return c?{id:l,owner:null==c.owner?null:(0,u.createWid)(c.owner),creation:c.creation,desc:null!==(t=c.desc)&&void 0!==t?t:void 0,descId:null!==(n=c.descId)&&void 0!==n?n:void 0,descOwner:null==c.descOwner?null:(0,u.createWid)(c.descOwner),descTime:null!==(r=c.descTime)&&void 0!==r?r:void 0,restrict:c.restrict||!1,announce:c.announce||!1,noFrequentlyForwarded:c.noFrequentlyForwarded||!1,ephemeralDuration:c.ephemeralDuration||0,membershipApprovalMode:null!==(i=c.membershipApprovalMode)&&void 0!==i&&i,subject:c.subject,support:!0===c.support,lastActivityTimestamp:null!==(a=c.lastActivityTimestamp)&&void 0!==a?a:0,lastSeenActivityTimestamp:null!==(o=c.lastSeenActivityTimestamp)&&void 0!==o?o:0,incognito:c.incognito}:null}))).apply(this,arguments)}const p=(0,o.batch)({delayMs:3e3},function(){var e=(0,a.default)((function*(e){const t=Array.from(e.reduce(((e,t)=>{var n;return e.set(t.id,(0,i.default)((0,i.default)({},null!==(n=e.get(t.id))&&void 0!==n?n:{}),t)),e}),new Map).values());return yield(0,s.getGroupMetadataTable)().bulkCreateOrMerge(t),e.map((()=>{}))}));return function(){return e.apply(this,arguments)}}())},890490:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DroppingMsgRowDueToLogout=void 0,t.encryptMultipleDBMsgs=function(){return f.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(583159),s=r(n(542817)),l=n(436005),u=n(907539),c=n(878685),d=n(446303),p=n(76469);class _ extends Error{constructor(){super(...arguments),this.name="DroppingMsgRowDueToLogout"}}function f(){return(f=(0,a.default)((function*(e){let t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(yield l.DbEncKeyStore.waitForFinalDbMsgEncKey(),yield new Promise((e=>setTimeout(e,0))),n){t=[];for(let n=0;n<e.length;n++)try{const r=e[n],i=yield h(r,n);t.push(i)}catch(e){if(e instanceof _)throw e;__LOG__(4,void 0,new Error,void 0,["message-store"])`processAndEncryptSingleMsgRow with throttle failed with error: ${e.name}, message: ${e.message}, stack: ${e.stack}`}}else t=yield Promise.all(e.map(function(){var e=(0,a.default)((function*(e){return yield h(e).catch((e=>{if(e instanceof _)throw e;__LOG__(4,void 0,new Error,void 0,["message-store"])`processAndEncryptSingleMsgRow without throttle failed with error: ${e.name}, message: ${e.message}, stack: ${e.stack}`})).finally((()=>{}))}));return function(){return e.apply(this,arguments)}}())),t=t.filter(Boolean);return t}))).apply(this,arguments)}function h(){return g.apply(this,arguments)}function g(){return(g=(0,a.default)((function*(e,t){if(s.default.isLogoutInProgress)return Promise.reject(new _);null!=t&&(yield(0,o.asyncSleepAfterGivenLoopIteration)(t,35,100));const n=(0,p.getMessageTable)(),r=(0,c.getVcardWids)(e),a=(0,u.dbRowFromMessage)(e),l=yield n.preflightEncryptSingleRecord((0,i.default)({},a));return[(0,i.default)((0,i.default)((0,i.default)({},a),l),{},{vcardWAids:r}),!!(0,d.findLink)(e.body,!0)]}))).apply(this,arguments)}t.DroppingMsgRowDueToLogout=_},187845:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.persistNewMessagesInBulk=function(){return p.apply(this,arguments)};var i=r(n(348926)),a=n(616310),o=n(493928),s=n(147980),l=n(890490),u=n(6007),c=n(605316),d=n(76085);function p(){return(p=(0,i.default)((function*(e,t){const[n,r]=yield Promise.all([_(e),(0,l.encryptMultipleDBMsgs)(e,!1)]);yield(0,c.getStorage)().lock(["chat","message","fts-indexing-queue"],function(){var e=(0,i.default)((function*(e){let[i,a,o]=e;yield i.bulkCreateOrMerge(n),yield(0,u.storeEncryptedDBMessages)(r,t,!1)}));return function(){return e.apply(this,arguments)}}())}))).apply(this,arguments)}function _(){return f.apply(this,arguments)}function f(){return(f=(0,i.default)((function*(e){const t=new Map;e.forEach((e=>{const n=e.id,r=n.remote.toString();if(r!==a.STATUS_JID&&(0,s.isUnreadTypeMsg)(e)){const i=t.get(r)||{unread:0,t:0,unreadMentionsOfMe:[]};if(!n.fromMe&&(i.unread+=1,(0,o.isGroupCatchUpEnabled)()&&(0,s.isImportantMessage)(e))){const t={id:e.id.toString(),timestamp:e.t};i.unreadMentionsOfMe?i.unreadMentionsOfMe.push(t):i.unreadMentionsOfMe=[t]}e.t>i.t&&(i.t=Math.max(e.t,i.t)),t.set(r,i)}}));const n=Array.from(t.keys()),r=(yield(0,d.getTable)().bulkGet(n)).map(((e,r)=>{var i;const a=n[r],s=t.get(a),l=(null==s?void 0:s.unread)||0,u=Math.max(0,e?e.unreadCount:0);let c=(null==s?void 0:s.t)||void 0;e&&null!=e.t&&(null==c||e.t>c)&&(c=e.t);let d=[],p=null!==(i=null==e?void 0:e.archiveAtMentionViewedInDrawer)&&void 0!==i&&i;if((0,o.isGroupCatchUpEnabled)()){var _,f;const t=null!==(_=null==s?void 0:s.unreadMentionsOfMe)&&void 0!==_?_:[],n=null!==(f=null==e?void 0:e.unreadMentionsOfMe)&&void 0!==f?f:[];t.length>0&&(p=!1),d=t.concat(n)}return{id:a,unreadCount:u+l,t:c,unreadMentionsOfMe:d,archiveAtMentionViewedInDrawer:p}}));return __LOG__(2)`[offline-resume][msg-cache]: storing chat updates: ${JSON.stringify(r)}`,r}))).apply(this,arguments)}},907539:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.dbRowFromMessage=function(e){var t;let n=(0,i.default)({},e);e.quotedMsg&&(n.quotedMsg=(0,i.default)({},e.quotedMsg));(null===(t=e.quotedMsg)||void 0===t?void 0:t.paymentNoteMsg)&&(n.quotedMsg.paymentNoteMsg=(0,i.default)({},e.quotedMsg.paymentNoteMsg));e.paymentNoteMsg&&(n.paymentNoteMsg=(0,i.default)({},e.paymentNoteMsg));e.from&&(n.from=e.from.toString());return m.forEach((e=>{null!=n[e]&&(n[e]=n[e].toString())})),delete n.notifyName,delete n.local,delete n.isNewMsg,delete n.clearMedia,delete n.multicast,delete n.urlNumber,delete n.urlText,delete n.linkPreview,delete n.star,delete n.forwardedFromWeb,n=function(e){var t,n,r;const i={currentMsg:{},quotedMsg:{}};if(null===(t=e.paymentNoteMsg)||void 0===t?void 0:t.body){var o;i.currentMsg.paymentNoteMsgBody=e.paymentNoteMsg.body,null===(o=e.paymentNoteMsg)||void 0===o||delete o.body}(null===(n=e.quotedMsg)||void 0===n||null===(r=n.paymentNoteMsg)||void 0===r?void 0:r.body)&&(i.quotedMsg.paymentNoteMsgBody=e.quotedMsg.paymentNoteMsg.body,delete e.quotedMsg.paymentNoteMsg.body);s.MSG_OPAQUE_DATA_KEYS.forEach((t=>{i.currentMsg[t]=e[t],delete e[t]})),e.originalSelfAuthor&&(i.currentMsg.originalSelfAuthor=(0,a.extractUserJid)((0,f.widToDeviceJid)(e.originalSelfAuthor)),delete e.originalSelfAuthor);i.currentMsg.pollOptions=(0,c.compressPollOptions)(e.pollOptions),delete e.pollOptions,e.quotedMsg&&(s.MSG_OPAQUE_DATA_KEYS.forEach((t=>{i.quotedMsg[t]=e.quotedMsg[t],delete e.quotedMsg[t]})),i.quotedMsg.pollOptions=(0,c.compressPollOptions)(e.quotedMsg.pollOptions),delete e.quotedMsg.pollOptions);const l=(0,g.encodeProtobuf)(d.MsgRowOpaqueDataSpec,i);return e.msgRowOpaqueData=l.readBuffer(),e}(n),n},t.messageFromDbRow=function(e){var t;let n=(0,i.default)({},e);e.quotedMsg&&(n.quotedMsg=(0,i.default)({},e.quotedMsg));(null===(t=e.quotedMsg)||void 0===t?void 0:t.paymentNoteMsg)&&(n.quotedMsg.paymentNoteMsg=(0,i.default)({},e.quotedMsg.paymentNoteMsg));e.paymentNoteMsg&&(n.paymentNoteMsg=(0,i.default)({},e.paymentNoteMsg));e.paymentBackground&&(n.paymentBackground=(0,i.default)({},e.paymentBackground));n.star=void 0!==n.isStarred,n.isMdHistoryMsg=n.rowId<1e9,delete n.internalId,delete n.isStarred,delete n.count,delete n.hasLink,delete n.isMediaMsg,delete n.isDocMsg,delete n.expiredTimestamp,delete n.pendingReadReceipt,n=function(e){const t=(0,h.decodeProtobuf)(d.MsgRowOpaqueDataSpec,e.msgRowOpaqueData);if(t.currentMsg){var n,r,i;if(t.currentMsg.paymentNoteMsgBody&&e.paymentNoteMsg)e.paymentNoteMsg.body=null===(i=t.currentMsg)||void 0===i?void 0:i.paymentNoteMsgBody;s.MSG_OPAQUE_DATA_KEYS.forEach((n=>{var r;e[n]=null===(r=t.currentMsg)||void 0===r?void 0:r[n]})),e.pollOptions=(0,c.expandPollOptions)(null===(n=t.currentMsg)||void 0===n?void 0:n.pollOptions);const a=null===(r=t.currentMsg)||void 0===r?void 0:r.originalSelfAuthor;null!=a&&p.default.isWid(a)&&(e.originalSelfAuthor=(0,_.createWid)(a))}if(e.quotedMsg&&t.quotedMsg){var a;t.quotedMsg.paymentNoteMsgBody&&(e.quotedMsg.paymentNoteMsg.body=t.quotedMsg.paymentNoteMsgBody),s.MSG_OPAQUE_DATA_KEYS.forEach((n=>{var r;e.quotedMsg[n]=null===(r=t.quotedMsg)||void 0===r?void 0:r[n]})),e.quotedMsg.pollOptions=(0,c.expandPollOptions)(null===(a=t.quotedMsg)||void 0===a?void 0:a.pollOptions),e.type===u.MSG_TYPE.POLL_UPDATE&&null==e.subtype&&(e.subtype="poll_vote")}return e}(n),(0,o.hydrateWids)(n),m.forEach((e=>{null!=n[e]&&(n[e]=l.default.from(n[e]))})),null!=n.messageSecret&&(n.messageSecret=new Uint8Array(n.messageSecret));return n};var i=r(n(81109)),a=n(616310),o=n(642232),s=n(848755),l=r(n(565754)),u=n(373070),c=n(426750),d=n(412744),p=r(n(124928)),_=n(669050),f=n(574819),h=n(309512),g=n(653313);const m=["id","protocolMessageKey","paymentRequestMessageKey","keptMessageKey","pollUpdateParentKey","kicKey","latestEditMsgKey","encReactionTargetMessageKey"]},878685:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessagePropertyType=void 0,t.beginningOfChat=function(e){return`${e.toString()}_/`},t.craftInternalId=function(e,t){const n=i(t);return`${e}_${n}_m`},t.craftMessageRangeIndex=function(e,t,n,a){let o;o=n?r.SystemMessage:t?r.IncomingChatMessage:r.Outgoing;return`${e}_${o}_${null!=a?i(a):""}`},t.endOfChat=function(e){return`${e.toString()}_g`},t.getInChatMsgId=function(e){return a(e.split("_")[1])},t.getVcardWids=function(e){let t=[];if("vcard"===e.type)t=[e.body];else{if("multi_vcard"!==e.type)return;t=e.vcardList.map((e=>e.vcard))}const{parseVcard:r,vcardWids:i}=n(105284);return t.filter(Boolean).reduce(((e,t)=>{const n=i(r(t));return e.concat(n.map((e=>e.toString())))}),[])},t.undoOrderPreservingHex=a;const r=n(76672)({IncomingChatMessage:"1",Outgoing:"2",SystemMessage:"3"});function i(e){const t=e.toString(16);return(t.length-1).toString(16)+t}function a(e){return parseInt(e.substring(1),16)}t.MessagePropertyType=r},848755:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MSG_OPAQUE_DATA_KEYS=void 0;t.MSG_OPAQUE_DATA_KEYS=["body","caption","paymentAmount1000","futureproofBuffer","messageSecret","clientUrl","loc","lng","lat","isLive","canonicalUrl","matchedText","title","description","pollName","pollSelectableOptionsCount","encReactionTargetMessageKey","encReactionEncIv","encReactionEncPayload","pollUpdateParentKey","encPollVote","senderTimestampMs"]},52045:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.processEditProtocolMsgs=function(){return E.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=r(n(944908)),s=r(n(132375)),l=n(484777),u=n(359987),c=n(147980),d=n(907539),p=n(591988),_=n(605316),f=n(558249),h=r(n(986128)),g=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=m(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(110567));function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(m=function(e){return e?n:t})(e)}const y=new Map;function E(){return(E=(0,a.default)((function*(e){if(0===e.length)return[];const t=yield T(e),r=S(e,t),i=[],a=[];r.sort(((e,t)=>(0,s.default)(t.latestEditSenderTimestampMs,"b.latestEditSenderTimestampMs")-(0,s.default)(e.latestEditSenderTimestampMs,"a.latestEditSenderTimestampMs")));for(const e of r){var o,l,c,d,p,_,f;const n=e.protocolMessageKey&&t.get(e.protocolMessageKey.toString());if(!n){i.push(e);continue}const r={subtype:Boolean(e.matchedText)||Boolean(e.canonicalUrl)||Boolean(e.description)||Boolean(e.title)?"url":void 0,body:e.body,mentionedJidList:e.mentionedJidList,title:e.title,description:e.description,canonicalUrl:e.canonicalUrl,matchedText:e.matchedText,inviteGrpType:e.inviteGrpType,thumbnail:e.thumbnail,richPreviewType:e.richPreviewType,doNotPlayInline:e.doNotPlayInline,thumbnailDirectPath:null!==(o=e.thumbnailDirectPath)&&void 0!==o?o:void 0,thumbnailSha256:null!==(l=e.thumbnailSha256)&&void 0!==l?l:void 0,thumbnailEncSha256:null!==(c=e.thumbnailEncSha256)&&void 0!==c?c:void 0,thumbnailHeight:null!==(d=e.thumbnailHeight)&&void 0!==d?d:void 0,thumbnailWidth:null!==(p=e.thumbnailWidth)&&void 0!==p?p:void 0,mediaKey:e.mediaKey,mediaKeyTimestamp:e.mediaKeyTimestamp,latestEditMsgKey:e.latestEditMsgKey,latestEditSenderTimestampMs:e.latestEditSenderTimestampMs},u=null!==(_=null!==(f=y.get(n.id.toString()))&&void 0!==f?f:n.latestEditSenderTimestampMs)&&void 0!==_?_:0,h=(0,s.default)(e.latestEditSenderTimestampMs,"protocolMsg.latestEditSenderTimestampMs"),g=h>u;g&&y.set(n.id.toString(),h),a.push({parentMsg:n,protocolMsg:e,editedMsgData:r,isLatest:g})}yield A(i),a.length&&(yield P(a),I(a.filter((e=>e.isLatest)).map((e=>e.parentMsg))));const h=a.filter((e=>e.isLatest));h.length&&(0,u.frontendFireAndForget)("updateEditedMessagesAction",{messageEdits:h});const{markFutureproofMessagesReparsed:g}=n(719060);return yield g(e.map((e=>e.id.toString()))),h}))).apply(this,arguments)}function S(e,t){return e.filter((e=>{const n=e.protocolMessageKey;if(!n)return __LOG__(4,void 0,new Error)`[message-edit] protocol msg is missing original msg key`,!1;const r=t.get(n.toString());if(r){if(!(0,p.msgTypeSupportsEditing)(r.type))return __LOG__(4,void 0,new Error)`[message-edit] original message type is ${r.type} which cannot be edited`,!1;if(!0===r.isForwarded)return __LOG__(4,void 0,new Error)`[message-edit] original message cannot be a forwarded message`,!1;if(null!=r.messageSecret)return __LOG__(4,void 0,new Error)`[message-edit] original message cannot be a CAG message`,!1;const t=(0,s.default)(r.t,"parentMsg.t"),n=(0,s.default)(e.t,"protocolMsg.t");if(!(0,p.isWithinParentEditWindow)(t,n))return __LOG__(3)`[message-edit] protocol msg exceeds edit window, will be dropped`,!1;const i=(0,c.getSender)(r),a=(0,c.getSender)(e);if(!i||!a||!i.equals(a))return __LOG__(3)`[message-edit] sender is not the parent msg sender`,!1}return null!=e.latestEditSenderTimestampMs||(__LOG__(4,void 0,new Error)`[message-edit] protocol msg does not have a valid sender timestamp`,null)}))}function T(){return v.apply(this,arguments)}function v(){return(v=(0,a.default)((function*(e){const t=e.map((e=>e.protocolMessageKey)).filter(Boolean).map((e=>e.toString())),n=yield(0,l.getMsgsByMsgKey)(t);return new Map(n.map((e=>[e.id.toString(),e])))}))).apply(this,arguments)}function A(){return C.apply(this,arguments)}function C(){return(C=(0,a.default)((function*(e){if(!e.length)return;const{storeMessageOrphans:t}=n(43794);yield t(e,(e=>e.protocolMessageKey))}))).apply(this,arguments)}function P(){return O.apply(this,arguments)}function O(){return(O=(0,a.default)((function*(e){e.length&&(yield(0,_.getStorage)().lock(["message"],function(){var t=(0,a.default)((function*(t){let[n]=t;const r=[];e.forEach((e=>{const{parentMsg:t,editedMsgData:n,isLatest:a}=e;a&&r.push((0,i.default)((0,i.default)({},t),n))}));const a=[];r.length&&a.push(n.bulkCreateOrMerge(r.map(d.dbRowFromMessage))),yield Promise.all(a)}));return function(){return t.apply(this,arguments)}}()))}))).apply(this,arguments)}function I(e){if(!e.length)return;const t=(0,o.default)(e.map((e=>String((0,s.default)(e.rowId,"msg.rowId")))));null==g||g.ftsClient.purge(t).catch((()=>{})),h.default.ignoreTransaction((()=>{(0,f.getTable)().bulkCreateOrReplace(t.map((e=>({id:e})))).then((()=>{null==g||g.ftsClient.index().catch((()=>{}))}))}))}},795360:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.processGroupInviteMessages=function(){return s.apply(this,arguments)};var i=r(n(348926)),a=n(990445),o=n(298466);function s(){return(s=(0,i.default)((function*(e){yield(0,o.persistGroupInviteV4Msgs)(e.map((e=>({id:e.id.toString(),from:e.from.toString(),to:e.to.toString(),groupId:e.inviteGrp,expiration:parseInt(e.inviteCodeExp,10),expired:(0,a.unixTime)()>=parseInt(e.inviteCodeExp,10)}))))}))).apply(this,arguments)}},826933:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.PreviousMsgNotPlaceholderError=t.DuplicateMessageError=void 0,t.processPaymentMessages=function(){return _.apply(this,arguments)};var i=r(n(348926)),a=n(484777),o=n(76469),s=n(605316),l=n(373070),u=n(968923),c=n(459857);class d extends Error{constructor(){super(...arguments),this.name="DuplicateMessageError"}}t.DuplicateMessageError=d;class p extends Error{constructor(){super(...arguments),this.name="PreviousMsgNotPlaceholderError"}}function _(){return(_=(0,i.default)((function*(e){const t=[],n=[],r=e.map((e=>e.paymentRequestMessageKey?e.paymentRequestMessageKey.toString():"")).filter((e=>""!==e)),d=e.filter((e=>"payment_action_request_declined"===e.subtype||"payment_transaction_request_cancelled"===e.subtype)).map((e=>e.id.toString()));return(0,s.getStorage)().lock(["message"],function(){var s=(0,i.default)((function*(i){let[s]=i;const p=yield(0,a.getMsgsByMsgKey)(r.concat(d)),_=new Map;return p.forEach((e=>{null!=e&&_.set(e.id.toString(),e)})),e.forEach((e=>{var r;const i=null===(r=e.paymentRequestMessageKey)||void 0===r?void 0:r.toString(),a=_.get(i||"");if(a)if("send"===e.subtype&&null!=e.paymentTxnStatus)t.push({id:i,paymentTxnStatus:e.paymentTxnStatus});else{const n=a.from.isGroup()?a.author:a.from,r=a.paymentMessageReceiverJid.equals((0,c.getMeUser)())?n:a.paymentMessageReceiverJid;"payment_action_request_declined"===e.subtype?t.push({id:i,paymentStatus:u.PaymentInfo$Status.REJECTED,paymentTxnStatus:u.PaymentInfo$TxnStatus.COLLECT_REJECTED}):"payment_transaction_request_cancelled"===e.subtype&&t.push({id:i,paymentStatus:u.PaymentInfo$Status.CANCELLED,paymentTxnStatus:u.PaymentInfo$TxnStatus.COLLECT_CANCELED}),t.push({id:e.id.toString(),type:l.MSG_TYPE.NOTIFICATION_TEMPLATE,templateParams:[r,a.paymentCurrency,String(a.paymentAmount1000)]})}else _.get(e.id.toString())&&!e.isMdHistoryMsg&&n.push(e.id.toString())})),yield(0,o.getMessageTable)().bulkRemove(n),yield(0,o.getMessageTable)().bulkCreateOrMerge(t),t}));return function(){return s.apply(this,arguments)}}())}))).apply(this,arguments)}t.PreviousMsgNotPlaceholderError=p},963495:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.processPollUpdateMsgs=function(){return f.apply(this,arguments)};var i=r(n(348926)),a=r(n(132375)),o=n(359987),s=n(410322),l=n(928563),u=n(990356),c=n(671598),d=n(475726),p=n(479261),_=n(696859);function f(){return(f=(0,i.default)((function*(e){if(0===e.length)return[];const{pollUpdateMsgsToParentMsgs:t,orphans:r}=yield(0,d.getParentMessages)(e);for(const[e,n]of t.entries())n.pollInvalidated&&t.delete(e);const[,f]=yield Promise.all([(0,i.default)((function*(){if(0===r.length)return;const{storeMessageOrphans:e}=n(43794);yield e(r,(e=>(0,a.default)(e.pollUpdateParentKey,"pollUpdateMsg.pollUpdateParentKey")));const t=r.map((e=>e.id.toString())),{markFutureproofMessagesReparsed:i}=n(719060);yield i(t)}))(),(0,i.default)((function*(){if(0===t.size)return;const e=yield(0,u.extractVotes)(t);yield(0,p.upsertVotes)(e),yield(0,o.frontendSendAndReceive)("upsertVotesModelCollection",{votes:e,restoredFromDb:!1});const r=e.map((e=>e.msgKey.toString())),{markFutureproofMessagesReparsed:i}=n(719060);if(yield i(r),(0,c.isPollsChatlistPreviewEnabled)()){const t=yield(0,_.filterChatsWithAddOnPreviewUpdates)(e.map((e=>(0,l.lastAddOnPreviewCandidateFromVoteData)(e,!1))));return t.size>0&&(yield(0,s.updateDatabaseForLastAddOnPreview)(t),(0,o.frontendFireAndForget)("updateChatLastAddOnPreview",{chatMap:t})),e}}))()]);return null!=f?f:[]}))).apply(this,arguments)}},124503:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.processReactionMsgs=function(){return p.apply(this,arguments)};var i=r(n(348926)),a=n(697588),o=n(822246),s=n(359987),l=n(928563),u=n(97858),c=n(403385),d=n(696859);function p(){return(p=(0,i.default)((function*(e){if(e.length>0){const t=yield(0,c.createReactionsRowFromMsg)(e),r=yield(0,o.createOrUpdateReactions)(t);(0,c.updateHasReactionFromParent)(r);const i=e.map((e=>e.id.toString())),{markFutureproofMessagesReparsed:p}=n(719060);if(yield p(i),(0,u.showReactionChatListPreview)()){const e=yield(0,d.filterChatsWithAddOnPreviewUpdates)(r.map((e=>(0,l.lastAddOnPreviewCandidateFromReactionRowType)(e))));yield(0,a.bulkUpdateChatLastAddOnPreview)(e),(0,s.frontendFireAndForget)("updateChatLastAddOnPreview",{chatMap:e})}}}))).apply(this,arguments)}},460810:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.processReplyMsgs=function(){return m.apply(this,arguments)};var i=r(n(348926)),a=r(n(618446)),o=r(n(791747)),s=r(n(535937)),l=r(n(132375)),u=n(484777),c=n(147980),d=n(907539),p=n(862159),_=n(97858),f=n(605316),h=r(n(565754)),g=n(459857);function m(){return(m=(0,i.default)((function*(e){if(!(0,_.receiveMessageEditEnabled)()||!e.length)return;const t=yield(0,f.getStorage)().lock(["message"],function(){var t=(0,i.default)((function*(t){let[n]=t;const r=new Set;e.forEach((e=>{r.add(y(e).toString())}));const i=yield(0,u.getMsgsByMsgKey)(Array.from(r.values())),a=new Map;i.forEach((e=>{a.set(e.id.toString(),e)}));const o=[];if(e.forEach((e=>{a.get(y(e).toString())&&o.push(e.id.toString())})),!o.length)return;const s=yield(0,u.getMsgsByMsgKey)(o),c=[];return s.forEach((e=>{S((0,l.default)(e.quotedMsg,"msg.quotedMsg"),(0,l.default)(a.get(y(e).toString()),"quotedMsgsByKey.get(createQuotedMsgKey(msg).toString())"))&&c.push(e)})),c.length?(yield n.bulkCreateOrMerge(c.map(d.dbRowFromMessage)),c):void 0}));return function(){return t.apply(this,arguments)}}());(null==t?void 0:t.length)&&t.forEach((t=>{(0,l.default)(e.find((e=>e.id.equals(t.id))),"replyMsgs.find(m => m.id.equals(updatedMsg.id))").quotedMsg=t.quotedMsg}))}))).apply(this,arguments)}function y(e){var t,n;const r=null!==(t=e.quotedParticipant)&&void 0!==t?t:void 0,i=null!==(n=e.quotedRemoteJid)&&void 0!==n?n:e.id.remote;return new h.default({id:(0,l.default)(e.quotedStanzaID,"msg.quotedStanzaID"),fromMe:(0,g.isMeAccount)(r),remote:i,participant:(0,c.isGroupMsg)(e)?r:void 0})}const E={inviteGrpType:p.GroupType.DEFAULT,thumbnail:""};function S(e,t){const n=(0,s.default)(e,(e=>null!=e)),r=(0,s.default)(t,((e,t)=>n.hasOwnProperty(t)));return(0,o.default)(n,E),(0,o.default)(r,E),!(0,a.default)(n,r)&&(Object.assign(e,r),!0)}},6007:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.storeEncryptedDBMessages=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,d.getStorage)().lock(["message"],function(){var r=(0,a.default)((function*(r){let[i]=r;const o=yield i.all({reverse:!n,limit:1,index:["rowId"],returnKeyType:"keys"}).then((e=>0===e.length?S:e[0])),l=new Map;yield Promise.all(t.map((e=>{const t=(0,h.createWid)(e),r=(0,c.beginningOfChat)(t),a=(0,c.endOfChat)(t);return i.between(["internalId"],r,a,{limit:1,reverse:!n,returnKeyType:"keys"}).then((e=>{const n=0===e.length?S:(0,c.getInChatMsgId)(e[0]);l.set(t.toString(),n)}))})));const u=n?-1:1,d=(yield(0,s.promiseMap)(e,function(){var e=(0,a.default)((function*(e,t){let[r,i]=e;n&&(r.isMdHistoryMsg=!0);const a=p.default.fromString(r.id),s=a.remote.toString(),c=l.get(s);if(null==c||Number.isNaN(c))return;const d=c+1*u;l.set(s,d);const _=!n&&(yield T(a,r));return A(r,s,i,o+u*(t+1),d,_)}));return function(){return e.apply(this,arguments)}}())).filter(Boolean);return i.bulkCreateWith_ALREADY_ENCRYPTED_RECORDS_ONLY(d).catch((e=>{if(n&&e instanceof g.default.BulkError)return __LOG__(4,void 0,new Error)`[storeEncryptedMessage] BulkError in bulkCreate for history sync msgs, retrying with bulk create or replace`,i.bulkCreateOrReplace_ALREADY_ENCRYPTED_RECORDS_ONLY(d);throw e})).then((()=>d))}));return function(){return r.apply(this,arguments)}}()).then((e=>{g.default.ignoreTransaction((()=>{(0,f.getTable)().bulkCreateOrReplace(e.map((e=>({id:String(e.rowId)})))).then((()=>{null==m||m.ftsClient.index().catch((()=>{}))}))}))}))};var i=r(n(81109)),a=r(n(348926)),o=n(616310),s=n(917140),l=n(359987),u=n(147980),c=n(878685),d=n(605316),p=r(n(565754)),_=n(373070),f=n(558249),h=n(669050),g=r(n(986128)),m=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=E(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(110567)),y=n(6961);function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(E=function(e){return e?n:t})(e)}const S=1e9;function T(){return v.apply(this,arguments)}function v(){return(v=(0,a.default)((function*(e,t){if(e.fromMe||e.remote.isStatusV3())return!1;const n=yield(0,l.frontendSendAndReceive)("getEventTypeFromMsgType",{msg:t});return n===u.EventType.AMBIENT||n===u.EventType.DEFAULT}))).apply(this,arguments)}function A(e,t,n,r,a,s){var l;const d=[_.MSG_TYPE.IMAGE,_.MSG_TYPE.VIDEO,_.MSG_TYPE.AUDIO].includes(e.type),f=(0,i.default)((0,i.default)({},e),{},{vcardWAids:e.vcardWAids||(0,c.getVcardWids)(e),id:e.id.toString(),isStarred:e.star?r:void 0,hasLink:"chat"===e.type&&n?r:void 0,isMediaMsg:d?r:void 0,isDocMsg:e.type===_.MSG_TYPE.DOCUMENT?r:void 0,expiredTimestamp:null!==(l=(0,u.getEphemeralExpirationTimestamp)(e))&&void 0!==l?l:void 0});null!=r&&(f.rowId=r),null!=a&&(f.internalId=(0,c.craftInternalId)(t,a)),s&&t!==o.STATUS_JID&&(f.pendingReadReceipt=1);let h=e.c2sTimestamp;var g;e.id.fromMe&&y.Socket&&!y.Socket.hasSynced?h=null!==(g=e.c2sTimestamp)&&void 0!==g?g:e.t:h=e.t;try{e.type!==_.MSG_TYPE.REACTION&&(f.messageRangeIndex=(0,c.craftMessageRangeIndex)(t,!p.default.fromString(e.id).fromMe,_.SYSTEM_MESSAGE_TYPES.includes(e.type),h))}catch(e){__LOG__(4,void 0,new Error)`[process-msg] craftMessageRangeIndex failed with error ${e}`}return f}},488300:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.processRevokeMsgs=function(){return g.apply(this,arguments)};var i=r(n(348926)),a=n(493928),o=n(697588),s=n(260071),l=n(147980),u=n(97858),c=n(605316),d=r(n(565754)),p=n(373070),_=r(n(124928)),f=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=h(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(110567));function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(h=function(e){return e?n:t})(e)}function g(){return(g=(0,i.default)((function*(e){const t=[],n=[],r=[],h=new Map,g=e.filter((e=>{const{revokeMsgKey:t,newMsgKey:n,subtype:r}=e;let i=!0;return"admin_revoke"===r?(0,u.adminRevokeReceiverEnabled)()?_.default.isGroup(t.remote)?_.default.equals(t.remote,n.remote)||(i=!1,__LOG__(2)`processRevokeMsgs: ${String(t)} has not been revoked`,__LOG__(3,void 0,void 0,!0)`processRevokeMsgs: admin revoke came for the different group than the original message was in`,SEND_LOGS("process-admin-revoke-message")):(i=!1,__LOG__(2)`processRevokeMsgs: ${String(t)} has not been revoked`,__LOG__(3,void 0,void 0,!0)`processRevokeMsgs: admin revoke was sent to a non-group chat`,SEND_LOGS("process-admin-revoke-message")):(i=!1,__LOG__(2)`processRevokeMsgs: admin revoke feature is disabled, ${String(t)} has not been revoked`):(i=_.default.equals(t.remote,n.remote)&&_.default.equals(t.participant,n.participant)&&t.fromMe===n.fromMe,i||__LOG__(2)`processRevokeMsgs: invalid revoke request ${String(t)}, ${String(n)}`),i}));g.forEach((e=>{n.push(e.revokeMsgKey.toString()),r.push(e.newMsgKey.toString())}));const m=g.length;yield(0,c.getStorage)().lock(["message","orphan-revoke"],function(){var e=(0,i.default)((function*(e){let[i,o]=e;const u=yield i.bulkGet(n.concat(r),!1),c=u.slice(0,m),_=u.slice(m),f=[],y=[];c.forEach(((e,i)=>{var o,s;if(null==e)return __LOG__(2)`processRevokeMsg: orphan revoke message key ${c[i]}`,void y.push({msgKey:n[i],sender:g[i].sender,timestamp:g[i].timestamp,subtype:null!==(s=g[i].subtype)&&void 0!==s?s:"sender_revoke"});if(f.push({id:r[i],to:e.to,author:e.author,type:p.MSG_TYPE.REVOKED,subtype:"admin_revoke"===g[i].subtype?"admin":"sender",revokeSender:g[i].sender,protocolMessageKey:n[i],protocolMessageRowId:null===(o=_[i])||void 0===o?void 0:o.rowId,from:e.from,t:e.t,rowId:e.rowId,internalId:e.internalId,messageRangeIndex:e.messageRangeIndex,revokeTimestamp:g[i].revokeTimestamp}),t.push(String(e.rowId)),(0,a.isGroupCatchUpEnabled)()&&(0,l.isImportantMessage)(e)){const t=d.default.fromString(e.id).remote.toString();if(h.has(t)){var u;const n=null!==(u=h.get(t))&&void 0!==u?u:[];h.set(t,[...n,e.id])}else h.set(t,[e.id])}}));const E=[i.bulkRemove(n),i.bulkCreateOrReplace(f)];y.length>0&&E.push((0,s.addOrphanRevokes)(y)),yield Promise.all(E)}));return function(){return e.apply(this,arguments)}}()),null==f||f.ftsClient.purge(t).catch((()=>{})),(0,a.isGroupCatchUpEnabled)()&&(0,o.removeUnreadMentionChat)(h)}))).apply(this,arguments)}},667662:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommunityLinkOperation=void 0;const r=n(76672).Mirrored(["SubGroupLink","SiblingGroupLink","SubGroupUnlink","SiblingGroupUnlink"]);t.CommunityLinkOperation=r},209639:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.STALE_TYPES=t.PARTICIPANT_OPERATION=t.GroupUnSyncedError=void 0;n(862159);const r=Object.freeze({ADD:"add",REMOVE:"remove",DEMOTE:"demote",PROMOTE:"promote",LINKED_GROUP_PROMOTE:"linked_group_promote",LINKED_GROUP_DEMOTE:"linked_group_demote"});t.PARTICIPANT_OPERATION=r;const i=Object.freeze({DEVICE:"device",PARTICIPANT:"participant"});t.STALE_TYPES=i;class a extends Error{constructor(){super(...arguments),this.name="GroupUnSyncedError"}}t.GroupUnSyncedError=a},579473:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WHATSAPP_GRAPHQL_ENDPOINT=t.WHATSAPP_GRAPHQL_ACCESS_TOKEN=void 0;t.WHATSAPP_GRAPHQL_ENDPOINT="https://graph.whatsapp.com/graphql/catalog";t.WHATSAPP_GRAPHQL_ACCESS_TOKEN="WA|787118555984857|7bb1544a3599aa180ac9a3f7688ba243"},35011:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PersistedQueries=void 0;t.PersistedQueries={WAWebQueryCatalogHasCategoriesQuery:"5247905281934978",WAWebQueryCatalogProductQuery:"3975937262530766",WAWebQueryCatalogQuery:"5456143974442934",WAWebQueryProductCollectionsQuery:"5349138355174780",WAWebQueryProductListCatalogJobQuery:"5431107963648273",WAWebQueryProductSingleCollectionQuery:"5797153010317042",queryProductListCatalogQuery:"5127568407281377"}},138990:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.graphQLRemapLocale=void 0;var i=r(n(968630));t.graphQLRemapLocale=(e,t)=>{try{const n=JSON.parse(t);return(0,i.default)(n)?Object.keys(n).find((t=>{const r=n[t];return!!Array.isArray(r)&&r.includes(e)}))||e:(__LOG__(3)`Invalid json locale mapping`,e)}catch(t){return __LOG__(3)`Invalid json locale mapping`,e}}},550866:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLServerError=void 0;class n extends Error{constructor(e){super(),this.name="GraphQLServerError",this.source=e}}t.GraphQLServerError=n},270658:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.fetchQuery=function(){return u.apply(this,arguments)},t.graphql=function(){throw new Error("Invariant Violation")},t.graphqlWWWTODO=function(){throw new Error("Invariant Violation")};var i=r(n(506479)),a=r(n(348926)),o=n(550866),s=n(725799);const l=["eventLogger"];function u(){return(u=(0,a.default)((function*(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{eventLogger:r}=n,a=(0,i.default)(n,l);const{fetchQuery:u}=yield(0,s.requireRelayRuntime)();try{const n=yield(0,s.getEnvironment)(),i=yield u(n,e,t,a).toPromise();return null==r||r.success(),i}catch(e){throw e instanceof o.GraphQLServerError&&(null==r||r.failure(e.source.errors)),e}}))).apply(this,arguments)}},725799:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvironment=function(){return _.apply(this,arguments)},t.requireRelayRuntime=d;var i=r(n(348926)),a=n(579473),o=n(35011),s=n(138990),l=n(550866),u=r(n(932325)),c=n(97858);function d(){return n.e(4815).then(n.t.bind(n,244311,23))}let p;function _(){return(_=(0,i.default)((function*(){if(null!=p)return p;const{Environment:e,Network:t,RecordSource:n,Store:r}=yield d(),_={Accept:"application/json","Content-Type":"application/json"},f=function(){var e=(0,i.default)((function*(e,t){const n={access_token:a.WHATSAPP_GRAPHQL_ACCESS_TOKEN,doc_id:o.PersistedQueries[e.name],variables:t,lang:(0,s.graphQLRemapLocale)(u.default.getFullLocale().replace("-","_"),(0,c.getGraphqlLocaleRemapping)())},r=yield fetch(a.WHATSAPP_GRAPHQL_ENDPOINT,{method:"POST",headers:_,body:JSON.stringify(n)});if(!r.ok)throw new l.GraphQLServerError({errors:[{code:r.status,message:r.statusText}]});const i=yield r.json();if(null!=(null==i?void 0:i.errors))throw new l.GraphQLServerError({errors:i.errors});return i}));return function(){return e.apply(this,arguments)}}();return p=new e({network:t.create(f),store:new r(new n)}),p}))).apply(this,arguments)}},767916:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){throw new Error("Invariant Violation")}},258269:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.fetchQuery=function(){return c.apply(this,arguments)},Object.defineProperty(t,"graphql",{enumerable:!0,get:function(){return l.graphql}}),Object.defineProperty(t,"graphqlWWWTODO",{enumerable:!0,get:function(){return l.graphqlWWWTODO}});var i=r(n(506479)),a=r(n(348926)),o=n(550866),s=n(469044),l=n(270658);const u=["eventLogger"];function c(){return(c=(0,a.default)((function*(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{eventLogger:r}=n,a=(0,i.default)(n,u);__LOG__(2,void 0,void 0,void 0,["GQL","MEX"])`[MEX] RelayClient Query:`;const{fetchQuery:l}=yield(0,s.requireRelayRuntime)();try{const n=yield l(yield(0,s.getEnvironment)(),e,t,a).toPromise();null==r||r.success();const i={};return i.result=n,i.query=e,i.variables=t,__LOG__(2,void 0,void 0,void 0,["GQL","MEX"])`[MEX] RelayClient Result:`,n}catch(e){throw e.source.errors.find((e=>e.isIQError))?(__LOG__(4,void 0,new Error,void 0,["GQL","MEX"])`[MEX] RelayClient Error`,e instanceof o.GraphQLServerError&&(null==r||r.failure(e.source.errors))):__LOG__(2,void 0,void 0,void 0,["GQL","MEX"])`[MEX] RelayClient Error`,e}}))).apply(this,arguments)}},469044:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getEnvironment=function(){return f.apply(this,arguments)},Object.defineProperty(t,"requireRelayRuntime",{enumerable:!0,get:function(){return d.requireRelayRuntime}});var i=r(n(348926)),a=n(551168),o=n(911794),s=r(n(132375)),l=n(738102),u=n(769707),c=n(550866),d=n(725799);function p(e){return(0,o.deprecatedSendIq)((0,l.wap)("iq",{id:(0,l.generateId)(),to:l.S_WHATSAPP_NET,type:"get",xmlns:"w:mex"},new l.WapNode("query",void 0,a.Binary.build(JSON.stringify(e)).readByteArray())),new u.WapParser("parse",(e=>new TextDecoder("utf-8").decode(e.child("result").contentBytes()))))}let _;function f(){return(f=(0,i.default)((function*(){if(null!=_)return _;const{Environment:e,Network:t,RecordSource:n,Store:r}=yield(0,d.requireRelayRuntime)();return _=new e({network:t.create(function(){var e=(0,i.default)((function*(e,t){const n=yield p({operationName:e.name,query:(0,s.default)(e.text,"operation.text"),variables:t});if(!n.success)throw new c.GraphQLServerError({errors:[{code:n.errorCode,message:n.errorText,isIQError:!0}]});const r=JSON.parse(n.result);if(null!=(null==r?void 0:r.errors))throw new c.GraphQLServerError({errors:r.errors.map((e=>({code:e.extensions.error_code,message:e.message,isIQError:!1})))});return r}));return function(){return e.apply(this,arguments)}}()),store:new r(new n)}),_}))).apply(this,arguments)}},337199:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.NOTIFICATION_TYPE=void 0,t.handleAboutNotification=function(e){const t=d.parse(e);if(t.error)return __LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,Promise.reject(t.error);return function(e){switch(__LOG__(2)`handleAboutNotification: received ${e.type}
for ${e.from.toString()}`,e.type){case c.SIDE_LIST_CHANGE:break;case c.CHANGE:const t=u.StatusCollection.get(e.from);t?t.status=e.content:__LOG__(3)`handleAboutNotification: get status update for unknown contact ${e.from}`;break;default:__LOG__(3)`handleAboutNotification: unhandled notification of
type ${e.type}`}return(0,a.wap)("ack",{id:(0,a.CUSTOM_STRING)(e.stanzaId),to:"change"===e.type?(0,s.JID)(e.from):(0,a.CUSTOM_STRING)(e.from),class:"notification",type:"status"})}(t.success)};var i=r(n(81109)),a=n(738102),o=n(769707),s=n(355813),l=n(854379),u=n(600445);const c=Object.freeze({CHANGE:"change",SIDE_LIST_CHANGE:"sideListChange",UNKNOWN:"unknown"});t.NOTIFICATION_TYPE=c;const d=new o.WapParser("incomingAboutNotification",(e=>{e.assertTag("notification");const t={stanzaId:e.attrString("id")},n=e.hasChild("set")&&e.child("set");if(n&&!n.hasAttr("hash"))return(0,i.default)({type:c.CHANGE,from:(0,l.userJidToUserWid)(e.attrUserJid("from")),pushname:e.attrString("notify"),content:n.contentString(),ts:e.attrTime("t")},t);let r=c.UNKNOWN;return n&&n.hasAttr("hash")&&(r=c.SIDE_LIST_CHANGE),(0,i.default)({type:r,from:e.attrString("from")},t)}))},996578:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getAndUpdateStatus=M,t.getDeviceSyncInputs=R,t.handleAccountSyncNotification=function(){return w.apply(this,arguments)};var i=r(n(348926)),a=r(n(81109)),o=n(616310),s=n(738102),l=n(769707),u=n(493928),c=n(696155),d=n(798440),p=n(277330),_=n(780549),f=n(355813),h=n(824668),g=n(515309),m=n(256905),y=n(854379),E=n(280464),S=n(359484),T=n(999821),v=n(326314),A=n(600445),C=n(459857),P=n(669050);const O=e=>{const t=e.maybeChild("key-index-list"),n=null==t?null:{ts:t.attrTime("ts"),signedKeyIndexBytes:t.hasContent()?t.contentBytes():null,expectedTs:t.hasAttr("expected_ts")?t.attrTime("expected_ts"):void 0},r=e.mapChildrenWithTag("device",(e=>({id:(0,P.createWid)(e.attrDeviceJid("jid")).device||o.DEFAULT_DEVICE_ID,keyIndex:e.hasAttr("key-index")?e.attrInt("key-index"):null})));return 0===r.length?null:{deviceList:r,keyIndex:n}},I=new l.WapParser("incomingAccountSyncNotification",(e=>{e.assertTag("notification");const t={stanzaId:e.attrString("id"),ts:e.attrTime("t"),from:(0,y.deviceJidToDeviceWid)(e.attrDeviceJid("from"))};if(e.hasChild("status")){const n=e.child("status"),r=n.hasAttr("action")?n.attrString("action"):void 0;return(0,a.default)({type:c.ACCOUNT_SYNC_TYPE.STATUS,action:r},t)}if(e.hasChild("privacy"))return(0,a.default)({type:c.ACCOUNT_SYNC_TYPE.PRIVACY},t);if(e.hasChild("devices"))return(0,a.default)({type:c.ACCOUNT_SYNC_TYPE.DEVICES,devices:O(e.child("devices"))},t);if(e.hasChild("blocklist"))return(0,a.default)({type:c.ACCOUNT_SYNC_TYPE.BLOCKLIST},t);if(e.hasChild("picture"))return(0,a.default)({type:c.ACCOUNT_SYNC_TYPE.PICTURE},t);if(e.hasChild("tos")){const n=e.child("tos"),r=[];return n.forEachChildWithTag("notice",(e=>{const t="false"!==e.maybeAttrString("state"),n=e.attrString("id");r.push({id:n,state:t})})),(0,a.default)({type:c.ACCOUNT_SYNC_TYPE.TOS,notices:r},t)}if(e.hasChild("disappearing_mode")){const n=e.child("disappearing_mode");let r,i,o;return n.hasAttr("action")?r=n.attrString("action"):(i=n.attrInt("duration"),o=n.attrInt("t")),(0,a.default)((0,a.default)({},t),{},{type:c.ACCOUNT_SYNC_TYPE.DISAPPEARING_MODE,action:r,disappearingModeDuration:i,disappearingModeSettingTimestamp:o})}throw e.createParseError("notification type not supported")}));function M(){return b.apply(this,arguments)}function b(){return(b=(0,i.default)((function*(){const e=(0,C.assertGetMe)(),t=yield(0,g.getAbout)(e);if(t.error)return __LOG__(3)`getStatus failed for ${e}: failed ${t.error.errorCode} : ${t.error.errorText}`,Promise.reject(t.error.errorText);const n=t.status;n&&(A.StatusCollection.assertGet((0,C.getMaybeMeUser)()).status=n)}))).apply(this,arguments)}function R(){return N.apply(this,arguments)}function N(){return(N=(0,i.default)((function*(e){let{wid:t,devices:n}=e;const r=(0,C.getMaybeMeLidUser)(),i={wid:t,devices:n};if(null==r)return[i];const a=(0,C.getMeUser)();if(!t.isSameAccount(a))return __LOG__(4,void 0,new Error,!0)`wid-is-not-self`,SEND_LOGS("wid-is-not-self"),[i];const[o,s]=yield v.waSignalStore.bulkGetIdentity([(0,T.createSignalAddress)(a).toString(),(0,T.createSignalAddress)(r).toString()]);return null==s&&null!=o&&(yield v.waSignalStore.putIdentity((0,T.createSignalAddress)(r).toString(),o)),[i,{wid:r,devices:n}]}))).apply(this,arguments)}function w(){return(w=(0,i.default)((function*(e){const t=I.parse(e);if(t.error)return __LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,Promise.reject(t.error);const n=t.success,r=(0,s.wap)("ack",{id:(0,s.CUSTOM_STRING)(n.stanzaId),to:(0,f.JID)(n.from),class:"notification",type:"account_sync"});switch(n.type){case c.ACCOUNT_SYNC_TYPE.STATUS:yield M();break;case c.ACCOUNT_SYNC_TYPE.DEVICES:if(!S.OfflineMessageHandler.isResumeFromRestartComplete())return E.OfflinePendingDeviceCache.addOfflinePendingDevice(n.from.toString(),r),"NO_ACK";if(S.OfflineMessageHandler.isResumeOnSocketDisconnectInProgress())return yield(0,p.addUserToPendingDeviceSync)([n.from.toString()]),r;const e=n.devices;if(e){const t=yield R({wid:(0,P.toUserWid)(n.from),devices:e});yield(0,d.handleADVDeviceSyncResult)(t)}else yield(0,c.getDevices)("notification");break;case c.ACCOUNT_SYNC_TYPE.PICTURE:yield(0,c.getAndUpdateProfilePicture)();break;case c.ACCOUNT_SYNC_TYPE.PRIVACY:_.Cmd.onAccountSyncForPrivacy(yield(0,c.updatePrivacySettings)());break;case c.ACCOUNT_SYNC_TYPE.BLOCKLIST:(0,c.updateBlocklist)();break;case c.ACCOUNT_SYNC_TYPE.TOS:n.notices&&(0,c.updateTosState)(n.notices);break;case c.ACCOUNT_SYNC_TYPE.DISAPPEARING_MODE:if((0,u.isDisappearingModeEnabled)()){const{action:e,from:t}=n;let r=n.disappearingModeDuration,i=n.disappearingModeSettingTimestamp;if("modify"===e){const e=yield(0,m.getDisappearingMode)(t);null==e.error&&null!=e.disappearingModeDuration&&null!=e.disappearingModeSettingTimestamp&&(r=e.disappearingModeDuration,i=e.disappearingModeSettingTimestamp)}null!=r&&null!=i&&(yield(0,h.updateDisappearingMode)(t,r,i));break}default:__LOG__(2)`account sync notification of type ${n.type} not supported`}return r}))).apply(this,arguments)}},80886:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=s.parse(e);if(t.error)return __LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,Promise.reject(t.error);return(0,a.default)(t.success)};var i=n(769707),a=r(n(675600)),o=n(854379);const s=new i.WapParser("incomingChatStateParser",(e=>{let t;if(e.assertTag("chatstate"),e.hasChild("paused"))t="paused";else{if(!e.hasChild("composing"))return e.throw("Expected child of type paused or composing");t=e.child("composing").hasAttr("media")?"recording":"composing"}return{id:(0,o.chatJidToChatWid)(e.attrChatJid("from")),type:t,participant:e.hasAttr("participant")?(0,o.userJidToUserWid)(e.attrUserJid("participant")):void 0}}))},81979:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=(0,_.isNotifSchedulerEnabled)()?o.JOB_PRIORITY.LOW:o.JOB_PRIORITY.SKIP;return(0,m.NonPersistJob)("handleContactNotification",(e=>function(){return N.apply(this,arguments)}(e.node)),{priority:t}).waitUntilCompleted({node:e})};var i=r(n(348926)),a=r(n(81109)),o=n(431012),s=r(n(132375)),l=n(738102),u=(n(638134),n(769707)),c=n(450491),d=n(965012),p=n(121977),_=n(724469),f=n(854379),h=n(240493),g=r(n(565754)),m=n(797703),y=n(935234),E=n(476314),S=n(346702),T=n(76085),v=n(600445),A=n(397201),C=n(459857),P=n(669050),O=n(26074);const I=new u.WapParser("incomingContactsNotification",(e=>{e.assertTag("notification");const t=e.attrString("id"),n={from:e.attrWapJid("from"),ts:e.attrTime("t"),rawTs:e.attrString("t"),stanzaId:t};if(e.hasChild("update")){const t=e.child("update");if(t.hasAttr("jid"))return(0,a.default)({type:"update",jid:(0,f.userJidToUserWid)(t.attrUserJid("jid"))},n);if(t.hasAttr("hash")){const e=p.ContactCollection.findFirst((e=>{var n;return(null===(n=e.userhash)||void 0===n?void 0:n.slice(0,4))===t.attrString("hash")}));return null==e?(0,a.default)({type:"empty",jid:null},n):(0,a.default)({type:"update",jid:e.id},n)}return(0,a.default)({type:"empty",jid:null},n)}if(e.hasChild("add")){const t=e.child("add");return(0,a.default)({type:"add",hash:t.hasContent()?t.contentBytes():null,jid:null},n)}if(e.hasChild("remove")){const t=e.child("remove");return(0,a.default)({type:"remove",jid:(0,f.userJidToUserWid)(t.attrUserJid("jid"))},n)}if(e.hasChild("modify")){const t=e.child("modify");return(0,a.default)({type:"modify",jid:(0,f.userJidToUserWid)(t.attrUserJid("new")),oldJid:(0,f.userJidToUserWid)(t.attrUserJid("old")),lid:t.maybeAttrUserJid("new_lid")?(0,f.userJidToUserWid)(t.attrUserJid("new_lid")):null,oldLid:t.maybeAttrUserJid("old_lid")?(0,f.userJidToUserWid)(t.attrUserJid("old_lid")):null},n)}if(e.hasChild("sync")){const t=e.child("sync");return(0,a.default)({type:"sync",after:t.attrTime("after"),jid:null},n)}return __LOG__(3)`Unexpected "contacts" notification`,(0,a.default)({type:"empty",jid:null},n)}));function M(e,t){const n=function(e,t){if("modify"!==t.type)throw new Error("Error: genContactChangeNotificationMsg invalid type");{const n=(0,C.getMeUser)(),r=(0,s.default)(t.oldJid,"notification.oldJid"),i=(0,s.default)(t.jid,"notification.jid");let a;return a=null!=t.lid&&null!=t.oldLid?[r,i,t.oldLid,t.lid]:[r,i],{id:new g.default({remote:e,fromMe:!1,id:g.default.newId()}),from:e,subtype:"change_number",t:t.ts,to:n,type:"notification_template",templateParams:a}}}(e,t);return(0,h.handleSingleMsgMD)(e,n)}function b(){return R.apply(this,arguments)}function R(){return(R=(0,i.default)((function*(e){if(e.oldJid){const t=e.oldJid,n=e.jid,r=null!=e.oldLid?e.oldLid:null,i=null!=e.lid?e.lid:null,a=[];d.ChatCollection.get(t)&&a.push({id:t.toString(),changeNumberNewJid:n.toString(),changeNumberOldJid:void 0});d.ChatCollection.get(n)&&a.push({id:n.toString(),changeNumberNewJid:void 0,changeNumberOldJid:t.toString()}),(0,T.getTable)().bulkCreateOrMerge(a).then((()=>{a.forEach((e=>{const t=d.ChatCollection.get(e.id);t&&(t.changeNumberNewJid=e.changeNumberNewJid?(0,P.createWid)(e.changeNumberNewJid):void 0,t.changeNumberOldJid=e.changeNumberOldJid?(0,P.createWid)(e.changeNumberOldJid):void 0)}))})),null!=r&&null!=i&&(yield Promise.all([(0,c.createOrReplaceLidPnMappings)([{lid:r.user,pn:t.user},{lid:i.user,pn:n.user}]),M(r,e),M(i,e)])),yield Promise.all([M(t,e),M(n,e)])}else __LOG__(2)`notification.oldJid is null`}))).apply(this,arguments)}function N(){return(N=(0,i.default)((function*(e){const t=I.parse(e);if(t.error)throw __LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,t.error;const n=t.success,r=n.jid;switch(n.type){case"update":{if(!r)return __LOG__(3)`handleContactsNotification: an update command does not include jid`,i(n);const e=y.PresenceCollection.get(r);e&&e.reset();const t=v.StatusCollection.get(r),a=null==t?null:(0,A.getStatus)(r).then((e=>{t.set({status:e.status})})),o=(0,S.changeProfilePicThumb)(n.jid,E.PROFILE_PIC_COMMAND.SET);return yield Promise.all([o,a]),i(n)}case"modify":return yield b(n),i(n);case"sync":return __LOG__(2,void 0,void 0,void 0,["contact-sync"])`received contact sync notification`,yield(0,O.contactSync)(),i(n);default:return __LOG__(2)`handleContactsNotification: unhandled notification of type ${n.type}`,i(n)}function i(e,t){return(0,l.wap)("ack",{id:(0,l.CUSTOM_STRING)(e.stanzaId),to:e.from,class:"notification",type:"contacts"},t)}}))).apply(this,arguments)}},256396:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleDevicesNotification=function(){return v.apply(this,arguments)};var i=r(n(348926)),a=n(738102),o=n(769707),s=n(798440),l=n(277330),u=n(355813),c=n(854379),d=n(714443),p=n(76469),_=n(280464),f=n(359484),h=n(510607),g=n(961745),m=n(669050);const y="add",E="remove",S="update",T=new o.WapParser("incomingDevicesNotification",(e=>{e.assertTag("notification"),e.assertTag("notification"),e.assertAttr("type","devices");let t,n,r,i=[],a=null;if(e.hasChild("remove"))n=E,t=e.child("remove");else if(e.hasChild("add"))n=y,t=e.child("add");else{if(!e.hasChild("update"))throw __LOG__(3)`Unknown Devices Notification: Devices notification without "remove" and "add" nodes`,e.createParseError("Failed to parse devices notification");n=S,t=e.child("update")}if(n===y||n===E){const o=t.maybeChild("key-index-list");if(!o)throw e.createParseError("key index node is required to handle device add or remove notification");const s=o.attrTime("ts");if(n===E&&!s)throw e.createParseError("timestamp is required to handle device remove notification");r={ts:s,signedKeyIndexBytes:n===y?o.contentBytes():null};const l=t.child("device"),u=(0,d.extractDeviceId)(l.attrDeviceJid("jid")),c=l.hasAttr("lid")?(0,d.extractDeviceId)(e.attrDeviceJid("lid")):null,p=l.hasAttr("key-index")?l.attrInt("key-index"):null;i=[{id:u,keyIndex:p}],null!=c&&(a=[{id:c,keyIndex:p}])}return{type:n,stanzaId:e.attrString("id"),hash:t.attrString(n===S?"hash":"device_hash"),lidHash:t.hasAttr("device_lid_hash")?t.attrString(n===S?"hash":"device_lid_hash"):null,user:(0,c.deviceJidToUserWid)(e.attrDeviceJid("from")),lidUser:e.hasAttr("lid")?(0,c.deviceJidToUserWid)(e.attrDeviceJid("lid")):null,deviceList:i,lidDeviceList:a,keyIndex:r}}));function v(){return(v=(0,i.default)((function*(e){const t=T.parse(e);if(t.error)throw __LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,t.error;const n=t.success,r=(0,a.wap)("ack",{to:(0,u.USER_JID)(n.user),id:(0,a.CUSTOM_STRING)(n.stanzaId),class:"notification"}),o=[{wid:n.user,devices:{deviceList:n.deviceList,keyIndex:n.keyIndex},type:n.type,hash:n.hash},null!=n.lidUser&&null!=n.lidHash&&null!=n.lidDeviceList?{wid:n.lidUser,devices:{deviceList:n.lidDeviceList,keyIndex:n.keyIndex},type:n.type,hash:n.lidHash}:null].filter(Boolean);return f.OfflineMessageHandler.isResumeFromRestartComplete()?(yield Promise.all(o.map(function(){var e=(0,i.default)((function*(e){let{wid:t,devices:r,type:i,hash:a}=e;if(f.OfflineMessageHandler.isResumeOnSocketDisconnectInProgress())yield(0,l.addUserToPendingDeviceSync)([t.toString()]);else if(n.type===y)try{yield(0,s.handleADVDeviceNotification)({wid:t,devices:r,type:i})}catch(e){__LOG__(3)`handleDevicesNotification - add error: ${e}`}else if(n.type===E)try{var o;yield(0,s.handleADVDeviceNotification)({wid:t,devices:r,type:i});const e=(null===(o=n.deviceList)||void 0===o?void 0:o.map((e=>e.id)))||[],{user:a,server:l}=t;yield Promise.all(e.map((e=>{const t=(0,m.createDeviceWidFromUserAndDevice)(a,l,e);g.Voip.notifyDeviceIdentityChangedOrDeleted(t,!0)})))}catch(e){__LOG__(3)`handleDevicesNotification - remove error: ${e}`}else if(n.type===S){const e=yield(0,p.getContactTable)().equals(["contactHash"],a);if(0===e.length)__LOG__(3)`could not find side contact hash for device update operation`;else try{yield(0,h.syncDeviceListJob)([(0,m.createWid)(e[0].id)],"notification",null)}catch(e){__LOG__(3)`handleDevicesNotification - update error: ${e}`}}else __LOG__(3)`handleDevicesNotification - unknown notification type ${n.type}`}));return function(){return e.apply(this,arguments)}}())),r):(o.forEach((e=>{let{wid:t}=e;return _.OfflinePendingDeviceCache.addOfflinePendingDevice(t.toString(),r)})),"NO_ACK")}))).apply(this,arguments)}},674530:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=o.parse(e);if(t.error)return __LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,Promise.reject(t.error);const n=t.success,i=(0,r.wap)("ack",{to:r.S_WHATSAPP_NET,id:(0,r.CUSTOM_STRING)(n.stanzaId),class:"notification"});return(0,a.digestKey)().then((()=>i))};var r=n(738102),i=n(769707),a=n(9210);const o=new i.WapParser("digestKeyParser",(e=>(e.assertTag("notification"),e.assertAttr("type","encrypt"),e.assertFromServer(),e.child("digest").assertTag("digest"),{stanzaId:e.attrString("id")})))},139917:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleDisappearingModeNotificationJob=function(e){const t=(0,d.isNotifSchedulerEnabled)()?a.JOB_PRIORITY.LOW:a.JOB_PRIORITY.SKIP;return(0,_.NonPersistJob)("handleDisappearingModeNotification",(()=>{const t=f.parse(e);return t.error?(__LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,Promise.reject(t.error)):function(){return h.apply(this,arguments)}(t.success)}),{priority:t}).waitUntilCompleted({node:e})};var i=r(n(348926)),a=n(431012),o=n(738102),s=n(769707),l=n(493928),u=n(355813),c=n(824668),d=n(724469),p=n(854379),_=n(797703);const f=new s.WapParser("disappearingModeNotification",(e=>{e.assertTag("notification");const t=e.child("disappearing_mode");return{stanzaId:e.attrString("id"),from:(0,p.deviceJidToDeviceWid)(e.attrDeviceJid("from")),duration:t.attrInt("duration",0),ts:t.attrTime("t")}}));function h(){return(h=(0,i.default)((function*(e){let{duration:t,from:n,stanzaId:r,ts:i}=e;return __LOG__(2,void 0,void 0,void 0,["DM","DDM"])`handleDisappearingModeNotification: received d=${t}:t=${i}
for ${n.toString()}`,(0,l.isDisappearingModeEnabled)()&&(yield(0,c.updateDisappearingMode)(n,t,i)),(0,o.wap)("ack",{id:(0,o.CUSTOM_STRING)(r),to:(0,u.JID)(n),class:"notification",type:"disappearing_mode"})}))).apply(this,arguments)}},63099:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return f.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(769707),s=n(780549),l=n(6961),u=n(366320),c=n(343343),d=n(885765),p=n(350906);const _=new o.WapParser("failureParser",(e=>(e.assertTag("failure"),{reason:e.attrInt("reason",400,599),location:e.attrString("location"),code:e.hasAttr("code")?e.attrInt("code"):null,expire:e.hasAttr("expire")?e.attrInt("expire"):null,message:e.maybeAttrString("message"),url:e.maybeAttrString("url")})));function f(){return(f=(0,i.default)((function*(e){const t=_.parse(e);if(t.error)return __LOG__(4,void 0,new Error)`${t.error.toString()} parsing ${e.toString()}`,Promise.reject(t.error);switch(t.success.reason){case 401:case 403:case 406:__LOG__(2)`received failure stanza, reason: ${t.success.reason}, logging out`,yield l.Socket.clearCredentialsAndStoredData(),s.Cmd.logout();break;case 405:case 409:__LOG__(2)`Client too old or bad user agent, attempting to update the app`;"web"===c.PLATFORMS[p.WAM_PLATFORM]?u.Updater.update(d.SANITIZED_VERSION_STR,!1,0):u.Updater.update(void 0,!1,0,!1),(0,a.stopComms)();break;case 402:const{code:e,expire:n,message:r,url:i}=t.success;if(null==e||null==n)throw __LOG__(4,void 0,new Error)`Incorrect temporary ban data ${e} ${n}`,new Error("handleFailure: wrong temp ban data");s.Cmd.onTemporaryBan({banned:!0,code:e,message:r,url:i,expire:n});break;case 400:case 500:case 501:__LOG__(3)`handleFailure: got failure code ${t.success.reason}`;break;default:return __LOG__(3)`failure reason ${t.success.reason} not implemented yet`,Promise.reject(new Error(`failure reason ${t.success.reason} not implemented yet`))}}))).apply(this,arguments)}},200279:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleGroupNotification=function(e){const t=G.parse(e);if(t.error)return __LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,Promise.reject(t.error);const n=t.success,r=!!n.offline&&!P.OfflineMessageHandler.isResumeFromRestartComplete();if((0,S.isGroupNotificationOptimizationEligible)(n,r)&&r)return(0,S.handleGroupNotificationV2)(n,r);return(0,v.handleMessage)(n.chatId.toString(),r,(0,i.default)((function*(){return yield Promise.all(n.actions.map((e=>function(){return H.apply(this,arguments)}(n,e,r)))),(0,o.wap)("ack",{to:(0,d.GROUP_JID)(n.chatId),id:(0,o.CUSTOM_STRING)(n.externalId),class:"notification",participant:n.author?(0,d.USER_JID)(n.author):o.DROP_ATTR})})))};var i=r(n(348926)),a=r(n(81109)),o=n(738102),s=n(769707),l=n(287461),u=n(565583),c=n(359987),d=n(355813),p=n(389293),_=n(800321),f=n(529921),h=n(326398),g=n(429267),m=n(614198),y=n(862159),E=n(111070),S=n(225390),T=n(854379),v=n(412985),A=n(97858),C=n(240493),P=n(359484),O=n(130207),I=n(76085),M=n(126092),b=n(193970),R=n(459857),N=n(343609);function w(e){return e.mapChildrenWithTag("participant",(e=>{const t=e.attrEnumOrDefault("type",f.GROUP_PARTICIPANT_TYPES,"participant"),n=e.maybeAttrLidUserJid("lid");return{displayName:e.maybeAttrString("display_name"),id:(0,T.userJidToUserWid)(e.attrUserJid("jid")),isSuperAdmin:t===f.GROUP_PARTICIPANT_TYPES.superadmin,isAdmin:t===f.GROUP_PARTICIPANT_TYPES.admin||t===f.GROUP_PARTICIPANT_TYPES.superadmin,lid:null!=n?(0,T.userJidToUserWid)(n):null}}))}function L(e){return{prevVersion:e.hasAttr("prev_v_id")?e.attrInt("prev_v_id"):void 0,version:e.hasAttr("v_id")?e.attrInt("v_id"):void 0}}const D={invite:y.ADD_REASON.INVITE,linked_group_join:y.ADD_REASON.LINKED_GROUP_JOIN,auto_add:y.ADD_REASON.AUTO_ADD,default_sub_group_admin_add:y.ADD_REASON.DEFAULT_SUBGROUP_ADMIN_ADD,default_sub_group_promote:y.ADD_REASON.DEFAULT_SUBGROUP_PROMOTE,invite_auto_add:y.ADD_REASON.INVITE_AUTO_ADD},k={default_sub_group_demote:y.REMOVE_REASON.DEFAULT_SUBGROUP_DEMOTE},U={invite_link:O.RequestMethod.InviteLink,linked_group_join:O.RequestMethod.LinkedGroupJoin};const G=new s.WapParser("groupNotificationParser",(e=>{e.assertTag("notification"),e.hasAttr("to")&&e.assertAttr("to",(0,R.assertGetMe)().toJid());const t=(0,T.groupJidToWid)(e.attrGroupJid("from")),n=e.hasAttr("participant")?(0,T.userJidToUserWid)(e.attrUserJid("participant")):null,r=e.attrTime("t");function i(e){return{jid:e.hasAttr("jid")?(0,T.groupJidToWid)(e.attrGroupJid("jid")):void 0}}const o=e.mapChildren((n=>{const o=n.tag();switch(o){case E.GROUP_NOTIFICATION_TAG.CREATE:return function(e){var t,n,r;const i=e.child("group"),a=w(i),o=function(e){if(e.hasChild("description")){const t=e.child("description");if(t.hasChild("body")){const e=t.child("body");if(e.hasContent())return{content:e.contentString(),id:t.attrString("id")}}}return null}(i),s=function(e){if(e.hasChild("ephemeral")){const t=e.child("ephemeral");if(t.hasAttr("expiration"))return{ephemeralDuration:t.attrInt("expiration")}}return null}(i),l=(0,g.extractLinkedParent)(i),u={subject:i.attrString("subject"),restrict:i.hasChild("locked"),announce:i.hasChild("announcement"),noFrequentlyForwarded:i.hasChild("no_frequently_forwarded"),ephemeralDuration:s?s.ephemeralDuration:void 0,owner:i.hasAttr("creator")?(0,T.userJidToUserWid)(i.attrUserJid("creator")):void 0,creation:i.attrTime("creation"),participants:a,desc:o?o.content:void 0,descId:o?o.id:void 0,subjectOwner:i.hasAttr("s_o")?(0,T.userJidToUserWid)(i.attrUserJid("s_o")):void 0,subjectTime:i.hasAttr("s_t")?i.attrTime("s_t"):void 0,support:i.hasChild("support"),pvId:i.attrInt("p_v_id"),isParentGroup:i.hasChild("parent"),isParentGroupClosed:"request_required"===(null===(t=i.maybeChild("parent"))||void 0===t?void 0:t.maybeAttrString("default_membership_approval_mode")),parentGroup:l?l.parentGroup:void 0,defaultSubgroup:i.hasChild("default_sub_group"),size:i.hasAttr("size")?i.attrInt("size"):void 0,incognito:i.hasChild("incognito"),membershipApprovalMode:"on"===(null==i||null===(n=i.maybeChild("membership_approval_mode"))||void 0===n||null===(r=n.maybeChild("group_join"))||void 0===r?void 0:r.maybeAttrString("state"))};return{actionType:E.GROUP_NOTIFICATION_TAG.CREATE,reason:e.hasAttr("reason")?D[e.attrString("reason")]:null,contextGroupId:e.hasAttr("context_group_jid")?(0,T.groupJidToWid)(e.attrGroupJid("context_group_jid")):null,groupInfo:u}}(n);case E.GROUP_NOTIFICATION_TAG.ADD:return(0,a.default)((0,a.default)({actionType:y.GROUP_ACTIONS.ADD,participants:w(n)},L(n)),{},{reason:n.hasAttr("reason")?D[n.attrString("reason")]:null});case E.GROUP_NOTIFICATION_TAG.DELETE:const u={integrity_delete_parent:y.DELETE_REASON.INTEGRITY_DELETE_PARENT,delete_parent:y.DELETE_REASON.DELETE_PARENT};return{actionType:y.GROUP_ACTIONS.DELETE,reason:n.hasAttr("reason")?u[n.attrString("reason")]:null,groupDatas:[{id:t,subject:""}]};case E.GROUP_NOTIFICATION_TAG.REMOVE:return(0,a.default)((0,a.default)({actionType:E.GROUP_NOTIFICATION_TAG.REMOVE,participants:w(n)},L(n)),{},{reason:n.hasAttr("reason")?k[n.attrString("reason")]:null});case E.GROUP_NOTIFICATION_TAG.PROMOTE:return(0,a.default)({actionType:E.GROUP_NOTIFICATION_TAG.PROMOTE,participants:w(n)},L(n));case E.GROUP_NOTIFICATION_TAG.DEMOTE:return(0,a.default)({actionType:E.GROUP_NOTIFICATION_TAG.DEMOTE,participants:w(n)},L(n));case E.GROUP_NOTIFICATION_TAG.LINKED_GROUP_PROMOTE:return(0,a.default)((0,a.default)({actionType:E.GROUP_NOTIFICATION_TAG.LINKED_GROUP_PROMOTE,participants:w(n)},L(n)),i(n));case E.GROUP_NOTIFICATION_TAG.LINKED_GROUP_DEMOTE:return(0,a.default)((0,a.default)({actionType:E.GROUP_NOTIFICATION_TAG.LINKED_GROUP_DEMOTE,participants:w(n)},L(n)),i(n));case E.GROUP_NOTIFICATION_TAG.MODIFY:return(0,a.default)({actionType:y.GROUP_ACTIONS.MODIFY,participants:w(n)},L(n));case E.GROUP_NOTIFICATION_TAG.SUBJECT:return{actionType:y.GROUP_ACTIONS.SUBJECT,subject:n.attrString("subject"),s_o:n.hasAttr("s_o")?(0,T.userJidToUserWid)(n.attrUserJid("s_o")):null,s_t:n.hasAttr("s_t")?n.attrTime("s_t"):null};case E.GROUP_NOTIFICATION_TAG.DESC:return n.hasChild("delete")?{actionType:y.GROUP_ACTIONS.DESC_REMOVE,descId:n.attrString("id")}:{actionType:y.GROUP_ACTIONS.DESC_ADD,descId:n.attrString("id"),desc:n.hasChild("body")?n.child("body").contentString():null,descTime:r};case E.GROUP_NOTIFICATION_TAG.SUSPENDED:return{actionType:y.GROUP_ACTIONS.SUSPEND,value:!0};case E.GROUP_NOTIFICATION_TAG.UNSUSPENDED:return{actionType:y.GROUP_ACTIONS.SUSPEND,value:!1};case E.GROUP_NOTIFICATION_TAG.LOCKED:return{actionType:y.GROUP_ACTIONS.RESTRICT,value:!0};case E.GROUP_NOTIFICATION_TAG.UNLOCKED:return{actionType:y.GROUP_ACTIONS.RESTRICT,value:!1};case E.GROUP_NOTIFICATION_TAG.ANNOUNCE:return{actionType:y.GROUP_ACTIONS.ANNOUNCE,value:!0};case E.GROUP_NOTIFICATION_TAG.NOT_ANNOUNCE:return{actionType:y.GROUP_ACTIONS.ANNOUNCE,value:!1};case E.GROUP_NOTIFICATION_TAG.NO_FREQUENTLY_FORWARDED:return{actionType:y.GROUP_ACTIONS.NO_FORWARD,value:!0};case E.GROUP_NOTIFICATION_TAG.FREQUENTLY_FORWARDED_OK:return{actionType:y.GROUP_ACTIONS.NO_FORWARD,value:!1};case E.GROUP_NOTIFICATION_TAG.INVITE:return{actionType:y.GROUP_ACTIONS.INVITE_CODE,code:n.attrString("code")};case E.GROUP_NOTIFICATION_TAG.EPHEMERAL:return{actionType:y.GROUP_ACTIONS.EPHEMERAL,duration:n.attrInt("expiration")};case E.GROUP_NOTIFICATION_TAG.NOT_EPHEMERAL:return{actionType:y.GROUP_ACTIONS.EPHEMERAL,duration:0};case E.GROUP_NOTIFICATION_TAG.REVOKE_INVITE:return{actionType:y.GROUP_ACTIONS.REVOKE_INVITE,participants:n.mapChildrenWithTag("participant",(e=>({id:(0,T.userJidToUserWid)(e.attrUserJid("jid")),expiration:e.attrInt("expiration")})))};case E.GROUP_NOTIFICATION_TAG.GROWTH_UNLOCKED:return{actionType:y.GROUP_ACTIONS.GROWTH_UNLOCKED};case E.GROUP_NOTIFICATION_TAG.GROWTH_LOCKED:return{actionType:y.GROUP_ACTIONS.GROWTH_LOCKED,expiration:n.attrInt("expiration"),type:n.attrString("type")};case E.GROUP_NOTIFICATION_TAG.LINK:{const e=n.attrString("link_type");return{actionType:{sub_group:y.GROUP_ACTIONS.SUB_GROUP_LINK,parent_group:y.GROUP_ACTIONS.PARENT_GROUP_LINK,sibling_group:y.GROUP_ACTIONS.SIBLING_GROUP_LINK}[e],groupDatas:n.mapChildrenWithTag("group",(e=>({id:(0,T.groupJidToWid)(e.attrGroupJid("jid")),subject:e.attrString("subject"),subjectTime:e.attrInt("s_t")})))}}case E.GROUP_NOTIFICATION_TAG.UNLINK:{const e=n.attrString("unlink_type"),t=n.hasAttr("unlink_reason")?n.attrString("unlink_reason"):null,r=n.mapChildrenWithTag("group",(e=>({id:(0,T.groupJidToWid)(e.attrGroupJid("jid")),subject:e.attrString("subject"),subjectTime:e.attrInt("s_t")})));if("parent_group"===e){if(t===y.DELETE_REASON.DELETE_PARENT)return{actionType:y.GROUP_ACTIONS.DELETE_PARENT_GROUP_UNLINK,groupDatas:r};if(t===y.DELETE_REASON.INTEGRITY_DELETE_PARENT)return{actionType:y.GROUP_ACTIONS.INTEGRITY_PARENT_GROUP_UNLINK,groupDatas:r}}else if("sub_group"===e){if(t===y.DELETE_REASON.DELETE_PARENT)return{actionType:y.GROUP_ACTIONS.DELETE_PARENT_GROUP_UNLINK,groupDatas:r};if(t===y.DELETE_REASON.INTEGRITY_DELETE_PARENT)return{actionType:y.GROUP_ACTIONS.INTEGRITY_SUB_GROUP_UNLINK,groupDatas:r}}return{actionType:{sub_group:y.GROUP_ACTIONS.SUB_GROUP_UNLINK,parent_group:y.GROUP_ACTIONS.PARENT_GROUP_UNLINK,sibling_group:y.GROUP_ACTIONS.SIBLING_GROUP_UNLINK}[e],groupDatas:r}}case E.GROUP_NOTIFICATION_TAG.MEMBERSHIP_APPROVAL_MODE:var s;return{actionType:y.GROUP_ACTIONS.MEMBERSHIP_APPROVAL_MODE,value:"on"===(null===(s=n.child("group_join"))||void 0===s?void 0:s.attrString("state")),triggered:n.hasAttr("triggered")?n.attrString("triggered"):void 0};case E.GROUP_NOTIFICATION_TAG.MEMBERSHIP_APPROVAL_REQUEST:var l;return{actionType:y.GROUP_ACTIONS.MEMBERSHIP_APPROVAL_REQUEST,requestMethod:null!==(l=U[n.attrString("request_method")])&&void 0!==l?l:O.RequestMethod.InviteLink};case E.GROUP_NOTIFICATION_TAG.REVOKED_MEMBERSHIP_REQUESTS:return{actionType:y.GROUP_ACTIONS.REVOKED_MEMBERSHIP_REQUESTS,requests:n.mapChildrenWithTag("participant",(e=>(0,T.userJidToUserWid)(e.attrUserJid("jid"))))};default:throw e.createParseError(`Unrecognized group action ${o}`)}}));return{externalId:e.attrString("id"),chatId:t,author:n,ts:e.attrTime("t"),pushname:e.hasAttr("notify")?e.attrString("notify"):null,offline:e.hasAttr("offline")?e.attrString("offline"):null,actions:o}}));function x(){return B.apply(this,arguments)}function B(){return(B=(0,i.default)((function*(e){const[t,n]=yield Promise.all([(0,M.getTable)().get(e.toString()),(0,I.getTable)().get(e.toString())]);return!!t||!!n&&!!n.t}))).apply(this,arguments)}function F(){return j.apply(this,arguments)}function j(){return(j=(0,i.default)((function*(e){var t;const n=yield(0,M.getTable)().get(e.toString());return null!==(t=null==n?void 0:n.membershipApprovalMode)&&void 0!==t&&t}))).apply(this,arguments)}function Y(){return K.apply(this,arguments)}function K(){return(K=(0,i.default)((function*(e,t,n){const r=yield F(e.chatId);return(0,m.genGroupNotificationMsg)((0,a.default)((0,a.default)({},e),{},{isAdmin:n}),{actionType:y.GROUP_ACTIONS.PARENT_GROUP_LINK_MEMBERSHIP_APPROVAL,membershipApprovalMode:r,groupDatas:t})}))).apply(this,arguments)}function H(){return(H=(0,i.default)((function*(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!t)return;__LOG__(2,void 0,void 0,void 0,["groups"])`handle action ${t.actionType}`;const r=[];try{if(t.actionType===E.GROUP_NOTIFICATION_TAG.CREATE){const i=(0,a.default)((0,a.default)({},t.groupInfo),{},{id:e.chatId}),o=yield x(i.id);__LOG__(2,void 0,void 0,void 0,["groups"])`group id ${i.id} exists in storage = ${o}`,yield(0,h.handleGroupCreation)(e,i,n),__LOG__(2,void 0,void 0,void 0,["groups"])`handleGroupCreation done for group id ${i.id}`,V(i)&&r.push((0,p.genCagMaskedThreadCreatedSystemMsg)(e.chatId)),o||r.push((0,m.genGroupCreationMsg)(e,i));const{ephemeralDuration:s}=i;e.author&&null!=e.ts&&null!=s&&s>0&&r.push((0,m.genGroupEphemeralSettingMsg)(e.chatId,e.ts,e.author,s));const{defaultSubgroup:c,incognito:d,parentGroup:_}=i;if((0,A.communitiesEnabled)()&&null!=_&&!0!==c&&!o){const t={actionType:y.GROUP_ACTIONS.PARENT_GROUP_LINK,groupDatas:[{id:_,subject:""}]};if(r.push((0,m.genGroupNotificationMsg)(e,t,i.creation)),(0,l.getABPropConfigValue)("group_join_request_m0_anyone_can_join")||(0,l.getABPropConfigValue)("group_join_request_m2_setting")){const n=yield(0,u.isCurrentUserGroupAdmin)(e.chatId.toString());r.push(yield Y(e,t.groupDatas,n))}}if(!(0,R.isMeAccount)(e.author)||t.reason===y.ADD_REASON.INVITE_AUTO_ADD){const a={actionType:y.GROUP_ACTIONS.ADD,version:i.pvId,participants:[{id:!0===c&&!0===d?(0,R.getMaybeMeLidUser)():(0,R.getMaybeMeUser)(),isAdmin:!1,isSuperAdmin:!1}],reason:t.reason,parentGroupId:i.parentGroup,isParentGroup:i.isParentGroup,contextGroupId:t.contextGroupId};yield(0,b.updateDBForGroupAction)(e,a,n),W(e,a),r.push((0,m.genGroupNotificationMsg)(e,a))}yield(0,N.createOrReplaceDisplayNamesAndLidPnMappings)(i.participants)}else if(t.actionType===y.GROUP_ACTIONS.ADD){const i=yield(0,E.notAlreadyInGroup)(e.chatId,t.participants);if(yield(0,b.updateDBForGroupAction)(e,t,n),W(e,t),__LOG__(2,void 0,void 0,void 0,["groups"])`updateDBForGroupAction done for ${JSON.stringify(t)}`,i.length||t.reason){const n=i.filter((e=>{let{id:t}=e;return!t.isLid()}));n.length>0&&r.push((0,m.genGroupNotificationMsg)(e,(0,a.default)((0,a.default)({},t),{},{participants:n}))),yield(0,N.createOrReplaceDisplayNamesAndLidPnMappings)(i)}}else if(t.actionType===y.GROUP_ACTIONS.INTEGRITY_PARENT_GROUP_UNLINK||t.actionType===y.GROUP_ACTIONS.INTEGRITY_SUB_GROUP_UNLINK);else if(t.actionType===y.GROUP_ACTIONS.DELETE_PARENT_GROUP_UNLINK||t.actionType===y.GROUP_ACTIONS.DELETE_PARENT_SUB_GROUP_UNLINK);else if(t.actionType===y.GROUP_ACTIONS.DELETE&&t.reason===y.DELETE_REASON.INTEGRITY_DELETE_PARENT){if((0,A.communitiesEnabled)()){(0,m.genIntegrityDeleteParentNotifcationMsgs)(e,t).forEach((e=>{r.push(e)}))}yield(0,b.updateDBForGroupAction)(e,t,n),W(e,t),__LOG__(2,void 0,void 0,void 0,["groups"])`updateDBForGroupAction done for ${JSON.stringify(t)}`}else if(t.actionType===y.GROUP_ACTIONS.DELETE&&t.reason===y.DELETE_REASON.DELETE_PARENT){if((0,A.communitiesEnabled)()){const t=(0,m.generateDeleteParentNotificationMessages)(e);if(0===t.length)return;t.forEach((e=>{r.push(e)}))}yield(0,b.updateDBForGroupAction)(e,t,n),W(e,t),__LOG__(2,void 0,void 0,void 0,["groups"])`updateDBForGroupAction done for ${JSON.stringify(t)}`}else{const i=yield(0,E.shouldSkipGenMsg)(e,t);if(yield(0,b.updateDBForGroupAction)(e,t,n),W(e,t),__LOG__(2,void 0,void 0,void 0,["groups"])`updateDBForGroupAction done for ${JSON.stringify(t)}`,!i){const n=yield(0,u.isCurrentUserGroupAdmin)(e.chatId.toString());if(t.actionType===y.GROUP_ACTIONS.REMOVE){const i=t.participants.filter((e=>{let{id:t}=e;return!t.isLid()}));r.push((0,m.genGroupNotificationMsg)((0,a.default)((0,a.default)({},e),{},{isAdmin:n}),(0,a.default)((0,a.default)({},t),{},{participants:i})))}else if(t.actionType===y.GROUP_ACTIONS.PROMOTE||t.actionType===y.GROUP_ACTIONS.DEMOTE||t.actionType===y.GROUP_ACTIONS.MODIFY||t.actionType===y.GROUP_ACTIONS.LINKED_GROUP_PROMOTE||t.actionType===y.GROUP_ACTIONS.LINKED_GROUP_DEMOTE){const i=t.participants.filter((e=>{let{id:t}=e;return!t.isLid()}));r.push((0,m.genGroupNotificationMsg)((0,a.default)((0,a.default)({},e),{},{isAdmin:n}),(0,a.default)((0,a.default)({},t),{},{participants:i})))}else r.push((0,m.genGroupNotificationMsg)((0,a.default)((0,a.default)({},e),{},{isAdmin:n}),t));t.actionType===y.GROUP_ACTIONS.PARENT_GROUP_LINK&&(0,l.getABPropConfigValue)("group_join_request_m0_anyone_can_join")&&r.push(yield Y(e,t.groupDatas,n))}t.actionType!==y.GROUP_ACTIONS.REMOVE&&t.actionType!==y.GROUP_ACTIONS.PROMOTE&&t.actionType!==y.GROUP_ACTIONS.DEMOTE&&t.actionType!==y.GROUP_ACTIONS.MODIFY||(yield(0,N.createOrReplaceDisplayNamesAndLidPnMappings)(t.participants))}n?(0,_.getMessageCache)().addMessages(r.map((e=>({msg:e}))),!1):yield Promise.all(r.map((e=>(0,C.handleSingleMsgMD)(e.from,e))))}catch(e){__LOG__(2)`handleGroupNotification: failed with ${e}`}}))).apply(this,arguments)}function W(e,t){return(0,c.frontendSendAndReceive)("updateModelForGroupAction",{groupMeta:e,groupAction:t})}function V(e){return!e.participants.find((e=>{let{isAdmin:t,id:n}=e;return(0,R.isMeAccount)(n)&&t}))&&(0,A.cagReactionsReceive)()&&!0===e.defaultSubgroup&&!0===e.incognito}},889877:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getHistorySyncLogDebugString=Te,t.handleHistorySyncChunk=fe,t.handleHistorySyncNotification=function(){return _e.apply(this,arguments)};var a=i(n(81109)),o=i(n(348926)),s=n(583159),l=n(551168),u=n(261030),c=n(616310),d=n(478337),p=i(n(132375)),_=n(990445),f=n(287461),h=n(443780),g=n(359987),m=n(451402),y=n(698867),E=n(780549),S=n(121977),T=n(389293),v=n(403206),A=n(608916),C=n(185212),P=n(941555),O=i(n(318797)),I=i(n(27210)),M=n(660913),b=n(257845),R=n(919919),N=n(926552),w=n(921698),L=n(791357),D=n(687352),k=i(n(28790)),U=n(76469),G=n(240493),x=i(n(565754)),B=n(267420),F=i(n(99398)),j=n(75540),Y=n(923544),K=n(533494),H=n(60370),W=n(76085),V=i(n(74082)),$=n(259377),z=n(241588),q=n(999821),J=i(n(9705)),Q=i(n(775410)),X=n(366891),Z=n(757453),ee=n(459857),te=n(15321),ne=n(673168),re=n(117429),ie=i(n(571834)),ae=i(n(124928)),oe=n(669050),se=n(658046),le=n(519106),ue=i(n(486850)),ce=n(808639),de=n(71870),pe=n(309512);function _e(){return(_e=(0,o.default)((function*(e,t,n){if(!e)return;const{downloadOptions:r}=e;if(!r)return;const i=!!e.historySyncNotification.originalMessageId,o=i?e.historySyncNotification.originalMessageId:n,s={msgKey:new x.default({remote:t,fromMe:!0,id:o}).toString(),processed:0,downloadOptions:r,isReupload:1,historySyncStepStartedTs:(0,_.unixTimeMs)(),reuploadPending:!1,historySyncPayloadSize:e.historySyncNotification.fileLength,oldestMsgInChunkTimestampSec:e.historySyncNotification.oldestMsgInChunkTimestampSec};i&&e.historySyncNotification.syncType!==H.HistorySync$HistorySyncType.INITIAL_BOOTSTRAP||(s.syncType=e.historySyncNotification.syncType,s.chunkOrder=e.historySyncNotification.chunkOrder||0,s.isReupload=0);const l=s;switch(new ie.default.MdBootstrapHistoryDataReceived({mdBootstrapPayloadType:l.syncType===H.HistorySync$HistorySyncType.INITIAL_BOOTSTRAP?ie.default.MD_BOOTSTRAP_PAYLOAD_TYPE.CRITICAL:ie.default.MD_BOOTSTRAP_PAYLOAD_TYPE.NON_CRITICAL,mdBootstrapHistoryPayloadType:(0,se.getMetricHistorySyncPayloadType)(l.syncType),mdTimestamp:(0,_.unixTimeMs)(),mdSessionId:yield X.MdSyncFieldStatsMeta.getMdSessionId()}).commit(),l.syncType){case H.HistorySync$HistorySyncType.INITIAL_BOOTSTRAP:case H.HistorySync$HistorySyncType.INITIAL_STATUS_V3:case H.HistorySync$HistorySyncType.NON_BLOCKING_DATA:__LOG__(2)`[History sync] initial sync received ${Te(l)}`,fe(l);break;case H.HistorySync$HistorySyncType.PUSH_NAME:return __LOG__(2)`[History sync] initial pushname received ${Te(l)}`,yield(0,h.enqueueNotification)((0,a.default)((0,a.default)({},l),{},{downloadOptions:(0,a.default)({},l.downloadOptions)}),!0),void fe(l);default:if(__LOG__(2)`[History sync] recent or full chunk received, adding chunk info to db: ${Te(l)}`,l.syncType===H.HistorySync$HistorySyncType.RECENT&&(100===e.progress&&(__LOG__(2)`[history sync] setting total chunk count: ${s.chunkOrder}`,(0,ne.setChunkCountForEndOfRecentHistorySync)(s.chunkOrder||1)),null!=s.oldestMsgInChunkTimestampSec)){const e=(0,ne.getHistorySyncEarliestDate)();e&&s.oldestMsgInChunkTimestampSec<e&&(0,ne.setHistorySyncEarliestDate)(s.oldestMsgInChunkTimestampSec)}yield(0,h.enqueueNotification)(l)}Q.default.continueProgressiveHistorySyncProcessing()}))).apply(this,arguments)}function fe(){return he.apply(this,arguments)}function he(){return(he=(0,o.default)((function*(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;if(__LOG__(2,void 0,void 0,void 0,["History sync"])`handleHistorySyncChunk started for ${Te(e)}`,e.syncType===H.HistorySync$HistorySyncType.INITIAL_BOOTSTRAP){if(!0===(yield(0,ne.getInitialHistorySyncComplete)()))return void __LOG__(2,void 0,void 0,void 0,["History sync"])`Skip duplicate initial sync chunk ${Te(e)}`}if(e.syncType===H.HistorySync$HistorySyncType.INITIAL_STATUS_V3)try{const t=x.default.fromString(e.msgKey);(0,$.sendAggregateReceipts)(t.remote,$.RECEIPT_TYPE.HISTORY_SYNC_COMPLETION,void 0,(new Map).set(t.remote,[t.id]))}catch(e){__LOG__(3,void 0,void 0,void 0,["History sync"])`history_sync_notification_handler: sending Status v3 receipt failed`}const i=e.syncType===H.HistorySync$HistorySyncType.INITIAL_BOOTSTRAP?ie.default.MD_BOOTSTRAP_PAYLOAD_TYPE.CRITICAL:ie.default.MD_BOOTSTRAP_PAYLOAD_TYPE.NON_CRITICAL,g=new ie.default.MdBootstrapHistoryDataDownloaded({mdBootstrapPayloadType:i,mdBootstrapPayloadSize:e.historySyncPayloadSize}),y=e.syncType!==H.HistorySync$HistorySyncType.PUSH_NAME&&!i;g.mdSessionId=yield X.MdSyncFieldStatsMeta.getMdSessionId();const A=yield X.MdSyncFieldStatsMeta.getStorageEstimation();A.mdStorageQuotaBytes!==X.STORAGE_QUOTA_UNAVAILABLE&&(g.mdStorageQuotaUsedBytes=A.mdStorageQuotaUsedBytes,g.mdStorageQuotaBytes=A.mdStorageQuotaBytes);let C=null;try{C=yield P.downloadManager.downloadAndDecrypt((0,a.default)({signal:(new r).signal},e.downloadOptions))}catch(n){if(__LOG__(3)`history sync download failed`,n instanceof L.HttpNetworkError)return e.syncType===H.HistorySync$HistorySyncType.INITIAL_BOOTSTRAP&&t>0?(yield F.default.waitIfOffline({signal:(new r).signal}),__LOG__(3,void 0,void 0,void 0,["History sync"])`Initial sync download failed due to network error retry download`,fe(e,t-1)):void(0,h.removeLocalFailureFromInFlightChunk)(e.msgKey);const i=x.default.fromString(e.msgKey);return ve(g,e.historySyncStepStartedTs,!1),(0,V.default)(i.remote,i.id,e.downloadOptions.mediaKey),void(yield(0,h.markChunkForReuploadPending)(e.msgKey))}e.downloadOptions.mediaKey="",y&&(yield new Promise((e=>setTimeout(e,1e3)))),g.mdBootstrapStepResult=ie.default.MD_BOOTSTRAP_STEP_RESULT.SUCCESS;const O=new l.Binary(C),I=yield(0,u.inflate)(O.readByteArray());y&&(yield new Promise((e=>setTimeout(e,1e3))));const M=(0,pe.decodeProtobuf)(H.HistorySyncSpec,I);__LOG__(2)`[History sync] chunk downloaded, ${Te(e)}`,y&&(yield new Promise((e=>setTimeout(e,1e3))));const D=new ie.default.MdBootstrapDataApplied({mdBootstrapPayloadType:i,mdBootstrapSource:ie.default.MD_BOOTSTRAP_SOURCE.HISTORY});D.mdSessionId=yield X.MdSyncFieldStatsMeta.getMdSessionId();const j=function(){var t=(0,o.default)((function*(t){e.syncType===H.HistorySync$HistorySyncType.INITIAL_BOOTSTRAP?(yield(0,ne.setInitialHistorySyncComplete)(),yield(0,ne.setHistorySyncStatus)({initialCompleted:!0}),E.Cmd.onInitialChatHistorySynced()):e.syncType===H.HistorySync$HistorySyncType.RECENT&&100===t?(__LOG__(2,void 0,void 0,void 0,["History sync"])`Recent history sync complete`,(0,te.setHistoryInitialSyncBoundry)({}),yield(0,ne.setHistorySyncStatus)({recentCompleted:!0}),E.Cmd.onRecentChatHistorySynced()):e.syncType===H.HistorySync$HistorySyncType.FULL&&100===t&&(__LOG__(2,void 0,void 0,void 0,["History sync"])`Full history sync complete`,(0,te.setHistoryInitialSyncBoundry)({}),yield(0,ne.setHistorySyncStatus)({fullCompleted:!0}),E.Cmd.onFullChatHistorySynced())}));return function(){return t.apply(this,arguments)}}();if(e.syncType===H.HistorySync$HistorySyncType.INITIAL_STATUS_V3&&M.statusV3Messages&&M.statusV3Messages.length>0?(g.mdBootstrapMessagesCount=M.statusV3Messages.length,ve(g,e.historySyncStepStartedTs,!0),M.statusV3Messages.sort(((e,t)=>{let{messageTimestamp:n}=e,{messageTimestamp:r}=t;return(0,_.castToUnixTime)(parseInt(n,10))-(0,_.castToUnixTime)(parseInt(r,10))})),yield Promise.all(M.statusV3Messages.map(function(){var e=(0,o.default)((function*(e){let t=null;if(!0===e.key.fromMe)t=(0,ee.getMeUser)();else if(t=(0,oe.createWid)((0,p.default)(e.participant,"msg.participant")),t.isLid()&&!(0,de.lidHistorySyncEnabled)())return;const n={type:b.MESSAGE_TYPE.OTHER_STATUS,externalId:(0,p.default)(e.key.id,"msg.key.id"),ts:(0,_.castToUnixTime)(parseInt(e.messageTimestamp,10)),edit:-1,isHsm:!1,count:null,chat:(0,oe.createWid)(c.STATUS_JID),author:(0,p.default)(t,"author"),pushname:null,isDirect:!1},r=yield(0,B.parseMessage)({info:n,ciphertextType:"skmsg",msgProtobuf:(0,p.default)(e.message,"msg.message")}),i=r.renderableMsgs&&r.renderableMsgs;if(!i||1!==i.length)return Promise.resolve();const a=i[0];return"0@s.whatsapp.net"!==e.participant||(0,f.getABPropConfigValue)("web_status_psa_history_sync")&&null!=a.staticUrl?(0,G.handleSingleMsgMD)(a.id.remote,a,!1):Promise.resolve()}));return function(){return e.apply(this,arguments)}}())),yield(0,h.updateCurrentlyProcessed)(e.msgKey),D.mdTimestamp=(0,_.unixTimeMs)(),D.commit(),__LOG__(2)`[History sync] storing Status V3 complete, ${Te(e,M.statusV3Messages.length)}`):e.syncType===H.HistorySync$HistorySyncType.NON_BLOCKING_DATA?(__LOG__(2)`processing history non blocking data`,null!=M.pastParticipants&&M.pastParticipants.length>0&&(0,f.getABPropConfigValue)("silent_group_exit_sync")&&(yield ge(M,e)),(0,w.processRecentStickers)(M,e)):e.syncType!==H.HistorySync$HistorySyncType.PUSH_NAME&&(M.conversations=M.conversations.reduce(((e,t)=>{let n=null;try{n=(0,oe.createWid)(t.id),n.isLid()&&!(0,de.lidHistorySyncEnabled)()&&(n=null)}catch(e){__LOG__(3,void 0,void 0,void 0,["History sync"])`history_sync_notification_handler: invalid wid`}return n?e.concat(t):e}),[])),e.syncType===H.HistorySync$HistorySyncType.INITIAL_BOOTSTRAP){const t={},n=(0,ee.assertGetMe)(),r=(0,oe.toUserWid)(n),i=n.getDeviceId(),a={},o={},s=[];let l=0;const u=[];M.conversations.forEach((n=>{var c,p,_;const h=(0,oe.createWid)(n.id);if(h.isLid()&&!(0,de.lidHistorySyncEnabled)())return;let g=[],y=[];l+=n.messages.length;let E=[];0===n.messages.length&&(t[n.id]=-1),n.pHash&&(o[n.id]=n.pHash),n.messages.forEach(((r,i)=>{i===n.messages.length-1&&(t[n.id]=r.msgOrderId);const a=Ae(e,r.message);E.push(a),g=g.concat((0,le.parseWebMsgInfoReaction)(r.message,a)),y=y.concat((0,Y.parseWebMsgInfoPollUpdates)(r.message,a))})),E=E.filter(Boolean).reverse();const S=n.contactPrimaryIdentityKey;if(S&&ae.default.isUser(h)){const e=(0,q.createSignalAddress)((0,oe.toUserWid)(h)).toString(),t=(0,q.bufferToStr)((0,v.toSignalCurvePubKey)(S));h.equals((0,ee.getMeUser)())?Ce(e,t):u.push({identifier:e,identityKey:t})}const A=(0,re.getGlobalSecurityNotifications)()&&!(0,f.getABPropConfigValue)("adv_v2_m6");if(!h.isStatusV3()&&A){const e=(0,T.genDeviceNotificationMsg)(h,r,[i],[]);E.push(e)}let C;if(null!=(null===(c=n.disappearingMode)||void 0===c?void 0:c.initiator))switch(n.disappearingMode.initiator){case K.DisappearingMode$Initiator.CHANGED_IN_CHAT:C=ce.DisappearingModeInitiator.ChangedInChat;break;case K.DisappearingMode$Initiator.INITIATED_BY_ME:C=ce.DisappearingModeInitiator.InitiatedByMe;break;case K.DisappearingMode$Initiator.INITIATED_BY_OTHER:C=ce.DisappearingModeInitiator.InitiatedByOther}const P=null!=n.tcToken&&null!=n.tcTokenTimestamp,O={t:(0,d.maybeNumberOrThrowIfTooLarge)(null!==(p=n.conversationTimestamp)&&void 0!==p?p:n.lastMsgTimestamp),id:h,unreadCount:n.unreadCount,ephemeralDuration:n.ephemeralExpiration,ephemeralSettingTimestamp:n.ephemeralSettingTimestamp,disappearingModeInitiator:C,endOfHistoryTransferType:null!==(_=n.endOfHistoryTransferType)&&void 0!==_?_:m.ConversationEndOfHistoryTransferModelPropType.INCOMPLETE,name:n.name,notSpam:n.notSpam,pendingInitialLoading:!1,unreadMentionCount:n.unreadMentionCount,tcToken:P?n.tcToken:null,tcTokenTimestamp:P?n.tcTokenTimestamp:null,tcTokenSenderTimestamp:n.tcTokenSenderTimestamp};Se(n,O.id),s.push(O),a[n.id]={chatInfo:O,msgs:E,reactionMessages:g,pollVotes:y}})),g.mdBootstrapMessagesCount=l,g.mdBootstrapChatsCount=M.conversations.length,ve(g,e.historySyncStepStartedTs,!0),Q.default.markInitialHistorySyncCountDebugStats(l,s.length);const c=M.conversations.some((e=>void 0!==e.unreadMentionCount));(0,Z.setUnreadMentionCountEnabled)(c),yield J.default.bulkCreateIdentity(u),yield(0,ue.default)([{cmd:"preempt",response:s,binarySize:10}])||Promise.resolve(),yield(0,R.handleInitialSyncMsgs)(a),yield(0,h.updateCurrentlyProcessed)(e.msgKey),D.mdTimestamp=(0,_.unixTimeMs)(),D.commit(!0),__LOG__(2)`[History sync] storing initial sync complete, ${Te(e,l,s.length)}`,yield Oe(M),(0,te.setHistoryInitialSyncBoundry)(t),(0,te.setInitialGroupPhash)(o)}else if(e.syncType===H.HistorySync$HistorySyncType.PUSH_NAME){ve(g,e.historySyncStepStartedTs,!0);const t=M.pushnames.map((e=>({id:e.id||"",pushname:e.pushname||""})));yield(0,U.getContactTable)().bulkCreateOrMerge(t),yield(0,h.updateCurrentlyProcessed)(e.msgKey);const n=M.pushnames.map((e=>{const t=(0,oe.createWid)(e.id||""),n=S.ContactCollection.get(t);return{id:t,pushname:e.pushname||"",type:(null==n?void 0:n.type)||"out",name:null==n?void 0:n.name}}));S.ContactCollection.add(n,{merge:!0}),D.mdTimestamp=(0,_.unixTimeMs)(),D.commit(),__LOG__(2)`[History sync] storing initial pushname complete with ${M.pushnames.length} records`}else if(e.syncType!==H.HistorySync$HistorySyncType.INITIAL_STATUS_V3){yield new Promise((e=>setTimeout(e,0)));const t=[];let r=[],i=[];const a=new Set,o=[],l=(0,te.getHistoryInitialSyncBoundry)();let u=0,c=0;for(let p=0;p<M.conversations.length;p++){const _=M.conversations[p],f=null==l?void 0:l[_.id];if(null!=f)for(let l=0;l<_.messages.length;l++){const p=(0,oe.createWid)(_.id);if(p.isLid()&&!(0,de.lidHistorySyncEnabled)())continue;const h=n(965012).ChatCollection.get(p),g=(null==h?void 0:h.endOfHistoryTransferType)===m.ConversationEndOfHistoryTransferModelPropType.COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY;if(!h&&null!=f||h&&null==h.endOfHistoryTransferType||g){__LOG__(2,void 0,void 0,void 0,["History sync"])`One chat in sync payload ${Te(e)} is already marked as complete locally`;break}u++;const y=_.messages[l],E=(0,d.maybeNumberOrThrowIfTooLarge)(y.msgOrderId);if(null!=f&&-1!==f&&null!=E&&E>=f)continue;a.add(_.id);const S=Ae(e,y.message);S&&S.id.remote.toString()!==_.id&&a.add(S.id.remote.toString()),0===l&&S&&h&&0===h.msgs.length&&o.push(S),r=r.concat((0,le.parseWebMsgInfoReaction)(y.message,S)),i=i.concat((0,Y.parseWebMsgInfoPollUpdates)(y.message,S)),S&&t.push(S),yield(0,s.asyncSleepAfterGivenLoopIteration)(c++,100)}}g.mdBootstrapMessagesCount=u,g.mdBootstrapChatsCount=M.conversations.length,ve(g,e.historySyncStepStartedTs,!0),0!==t.length&&(yield(0,R.handleProgressiveHistorySyncMsgs)(t,Array.from(a),r,i,o)),yield(0,ne.setLastHistorySyncedChunk)(e.syncType,e.chunkOrder),(0,N.updateHistorySyncProgressModel)(),yield(0,h.updateCurrentlyProcessed)(e.msgKey);const p=new Set;M.conversations.forEach((e=>{const t=(0,oe.createWid)(e.id);if(t.isLid()&&!(0,de.lidHistorySyncEnabled)())return;p.add(t.toString());let n=null;return null!=(null==l?void 0:l[e.id])&&(n=e.endOfHistoryTransferType),null!=n?ye(t,n):void 0})),E.Cmd.onHistorySyncChunkProcessed(p),D.mdTimestamp=(0,_.unixTimeMs)(),D.commit(),__LOG__(2)`[History sync] chunk storing recent or full chunk complete, ${Te(e,u)}`}const W=x.default.fromString(e.msgKey),se=new Map;se.set(W.remote,[W.id]),e.syncType!==H.HistorySync$HistorySyncType.INITIAL_STATUS_V3&&(0,$.sendAggregateReceipts)(W.remote,$.RECEIPT_TYPE.HISTORY_SYNC_COMPLETION,void 0,se),yield(0,h.updateCurrentlyProcessed)(e.msgKey),z.ServerProps.webMdMmsSyncDeletionRequest&&null!=e.downloadOptions.encFilehash&&k.default.deleteMdHistorySyncBlob({directPath:e.downloadOptions.directPath,encFilehash:e.downloadOptions.encFilehash,signal:(new r).signal}).catch((()=>{__LOG__(3)`MMS client delete error`})),yield j(M.progress)}))).apply(this,arguments)}function ge(){return me.apply(this,arguments)}function me(){return(me=(0,o.default)((function*(e,t){const r=e.pastParticipants.map((e=>({groupId:(0,p.default)(e.groupJid,"group.groupJid"),pastParticipants:e.pastParticipants.map((e=>({id:(0,oe.createWid)((0,p.default)(e.userJid,"participant.userJid")),leaveReason:e.leaveReason===H.PastParticipant$LeaveReason.LEFT?D.LeaveReason.Left:D.LeaveReason.Removed,leaveTs:(0,d.numberOrThrowIfTooLarge)((0,p.default)(e.leaveTs,"participant.leaveTs"))})))})));yield(0,A.addPastParticipants)(r);const{ChatCollection:i}=n(965012);r.forEach((e=>{const{groupMetadata:t}=i.gadd((0,oe.createWid)(e.groupId));null==t||t.pastParticipants.add(e.pastParticipants,{merge:!0})})),__LOG__(2)`[History sync] Past Participants completed, ${Te(t)}`}))).apply(this,arguments)}function ye(){return Ee.apply(this,arguments)}function Ee(){return(Ee=(0,o.default)((function*(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=t,i={id:e,endOfHistoryTransferType:r};n&&(i.t=0),yield(0,g.frontendSendAndReceive)("chatCollectionAdd",{things:[i],options:{merge:!0}}),yield(0,W.getTable)().merge(e.toString(),{endOfHistoryTransferType:r})}))).apply(this,arguments)}function Se(e,t){if(null!=e.suspended||null!=e.terminated||null!=e.createdBy||null!=e.createdAt||null!=e.description||null!=e.support||null!=e.isParentGroup||null!=e.isDefaultSubgroup||null!=e.parentGroupId){var n;const r={id:t,subject:e.name,suspended:e.suspended,terminated:e.terminated,owner:null!=e.createdBy?(0,oe.createWid)(e.createdBy):void 0,creation:e.createdAt,desc:e.description,support:e.support,isParentGroup:e.isParentGroup,defaultSubgroup:e.isDefaultSubgroup,parentGroup:null!=e.parentGroupId?(0,oe.createWid)(e.parentGroupId):void 0};(0,C.persistGroupMetadata)(t,(0,a.default)((0,a.default)({},r),{},{id:r.id.toString(),owner:void 0!==r.owner?r.owner.toString():void 0,creation:void 0!==r.creation?Number(r.creation):void 0,parentGroup:void 0!==r.parentGroup?String(r.parentGroup):void 0}));const i=O.default.add(r,{merge:!0})[0],o=null===(n=e.participant)||void 0===n?void 0:n.map((e=>{const t=e.rank===H.GroupParticipant$Rank.SUPERADMIN,n=e.rank===H.GroupParticipant$Rank.ADMIN;return new I.default({id:(0,oe.createWid)(e.userJid),isAdmin:n||t,isSuperAdmin:t})}));null==i||i.participants.add(o,{merge:!0}),(!0===e.readOnly||o.length>0)&&(0,M.updateParticipantsJob)(t,o.map((e=>({id:e.id,isAdmin:e.isAdmin,isSuperAdmin:e.isSuperAdmin}))))}}function Te(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=(e.msgKey||"").split("_")[2];return` type_${e.syncType}_order_${null!=e.chunkOrder?e.chunkOrder:"none"}_isReupload_${e.isReupload||0}, id: ${r} ## msgCount: ${t}, chatCount: ${n}`}function ve(e,t,n){e.mdTimestamp=(0,_.unixTimeMs)(),e.mdBootstrapStepDuration=(0,_.unixTimeMs)()-t,e.mdBootstrapStepResult=n?ie.default.MD_BOOTSTRAP_STEP_RESULT.SUCCESS:ie.default.MD_BOOTSTRAP_STEP_RESULT.FAILURE,e.commit()}function Ae(e,t){let n=null;try{if(null!=t&&(n=(0,j.parseWebMessageInfo)(t,"after")),null!=n&&"ephemeral_setting"===n.subtype&&n.id.remote.equals((0,ee.getMeUser)()))return null}catch(e){__LOG__(4,void 0,new Error)`[history sync] parseWebMessageInfo failed with error ${null==e?void 0:e.name} and stack ${null==e?void 0:e.stack}`}return n}function Ce(){return Pe.apply(this,arguments)}function Pe(){return(Pe=(0,o.default)((function*(e,t){const n=yield J.default.loadIdentityKey(e);n&&n!==t&&(__LOG__(4,void 0,new Error,!0,["History sync"])`get changed self identity key from history sync,
exisiting length: ${n.length}, new length: ${t.length}`,SEND_LOGS("self-identity-change-from-history-sync"))}))).apply(this,arguments)}function Oe(e){let t=Promise.resolve(),n=Promise.resolve();return null!=e.threadIdUserSecret&&(t=(0,y.setThreadIdUserSecret)(e.threadIdUserSecret)),null!=e.threadDsTimeframeOffset&&(n=(0,y.setThreadDsTimeframeOffset)(e.threadDsTimeframeOffset)),Promise.all([t,n])}},246226:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleE2eIdentityChange=function(e){const t=T.parse(e);if(t.error)return __LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,Promise.reject(t.error);const{wid:n,stanzaId:r,displayName:s,delay:d,lid:v,offline:A}=t.success,C=(0,o.wap)("ack",{to:(0,u.DEVICE_JID)(n),id:(0,o.CUSTOM_STRING)(r),class:"notification"});if(null!=n.device&&n.device!==a.DEFAULT_DEVICE_ID)return __LOG__(2)`handleNewIdentity: ignore identity change from companion device`,Promise.resolve(C);if((0,E.isMePrimary)(n))return(0,l.frontendFireAndForget)("handleSelfPrimaryIdentityChange",{}),Promise.resolve(C);const P=!!A&&!f.OfflineMessageHandler.isResumeFromRestartComplete();return(0,_.handleMessage)(String(n),P,(0,i.default)((function*(){yield(0,c.clearDeviceRecordForIdentityChange)(n,P);return(yield(0,y.getSignalProtocolStore)().loadIdentityKey((0,m.createSignalAddress)(n).toString()))&&(__LOG__(2)`handleE2eIdentityChange: ${n.toString()} has old identity, establishing new session`,yield g.Session.deleteRemoteInfo(n),(0,h.addSecurityCodeChangedNotifications)(n,P),(0,l.frontendFireAndForget)("sendTcTokenWhenDeviceIdentityChange",{chatId:n}),P||(null!=d?(0,p.ensureE2ESessionsWithDelay)([n],d,!0):(0,p.ensureE2ESessions)([n],!0)),yield(0,S.createOrReplaceDisplayNamesAndLidPnMappings)([{id:n,lid:v,displayName:s}])),C})))};var i=r(n(348926)),a=n(616310),o=n(738102),s=n(769707),l=n(359987),u=n(355813),c=n(74869),d=n(854379),p=n(917504),_=n(412985),f=n(359484),h=n(944641),g=n(138706),m=n(999821),y=n(76256),E=n(459857),S=n(343609);const T=new s.WapParser("identityChange",(e=>{e.assertTag("notification"),e.assertAttr("type","encrypt"),e.child("identity");const t=parseInt(e.maybeAttrString("delay"),10);return{wid:(0,d.deviceJidToDeviceWid)(e.attrDeviceJid("from")),stanzaId:e.attrString("id"),delay:isFinite(t)&&t>0?t:null,displayName:e.maybeAttrString("display_name"),lid:e.hasAttr("lid")?(0,d.deviceJidToDeviceWid)(e.attrDeviceJid("lid")):null,offline:e.hasAttr("offline")?e.attrString("offline"):null}}))},154269:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return h.apply(this,arguments)};var i=r(n(348926)),a=n(417405),o=r(n(132375)),s=n(738102),l=n(769707),u=n(355813),c=n(912384),d=n(229479),p=n(994451),_=n(459857);const f=new l.WapParser("mediaRetryNotification",(e=>{e.assertTag("notification");const t=e.maybeChild("error");if(t)return{msgId:e.attrString("id"),ciphertext:null,iv:null,errorCode:d.MediaRetryNotification$ResultType.cast(t.attrInt("code"))};const n=e.child("encrypt");return{msgId:e.attrString("id"),ciphertext:n.child("enc_p").contentBytes(),iv:n.child("enc_iv").contentBytes(c.ENC_IV_SIZE),errorCode:null}}));function h(){return(h=(0,i.default)((function*(e){const t=f.parse(e);if(t.error)throw __LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,t.error;const{msgId:n,errorCode:r}=t.success,i=(0,s.wap)("ack",{id:(0,s.CUSTOM_STRING)(n),class:"notification",type:"mediaretry",to:(0,u.USER_JID)((0,_.getMeUser)())});if(null!=r)return p.RequestMediaReuploadManager.resolveMediaReupload({msgId:n,result:r}),i;const{ciphertext:l,iv:d}=t.success,h=p.RequestMediaReuploadManager.getMediaKey(n);if(!h)return __LOG__(3)`handleMediaRetryNotification: mediaKey is not found for msgId ${n}`,i;const{stanzaId:g,directPath:m,result:y}=yield(0,c.decryptMediaRetryNotification)((0,a.decodeB64)(h),n,(0,o.default)(d,"iv"),(0,o.default)(l,"ciphertext"));if(g!==n)throw new Error("handleMediaRetryNotification: msg id does not match");return p.RequestMediaReuploadManager.resolveMediaReupload({msgId:n,result:y,directPath:m}),i}))).apply(this,arguments)}},996736:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return y.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(201063),s=n(738102),l=n(769707),u=n(678002),c=n(266888),d=r(n(99398)),p=n(226562),_=n(6961),f=n(673168);let h=[],g=null;const m=new l.WapParser("pairDeviceParser",(e=>{e.assertTag("iq"),e.assertFromServer();const t=[];return e.child("pair-device").forEachChild((e=>{e.assertTag("ref"),t.push(e.contentString())})),{refs:t,id:e.attrString("id")}}));function y(){return(y=(0,i.default)((function*(e){const t=m.parse(e);if(t.error)return __LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,Promise.reject(t.error);const n=t.success;if(n&&n.refs&&Array.isArray(n.refs)&&6===n.refs.length){const{refs:e,id:t}=n;(0,a.deprecatedCastStanza)((0,s.wap)("iq",{to:s.S_WHATSAPP_NET,type:"result",id:(0,s.CUSTOM_STRING)(t)})),yield(0,u.generateADVSecretKey)(),h=e,g||(g=new o.ShiftTimer((()=>{if((0,f.isRegistered)()||!d.default.online)g&&g.cancel(),g=null;else if(h&&h.length){const e=6===h.length?6e4:2e4,t=h.shift();c.Conn.set({ref:t,refTTL:e}),_.Socket.state=p.SOCKET_STATE.UNPAIRED,g&&g.onOrAfter(e)}else g&&g.cancel(),g=null,_.Socket.state=p.SOCKET_STATE.UNPAIRED_IDLE}))),g.forceRunNow()}else __LOG__(3)`handlePairDevice: wrong pair device result received from server`}))).apply(this,arguments)}},288627:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return D.apply(this,arguments)};var i=r(n(348926)),a=n(417405),o=n(911794),s=n(128326),l=n(990445),u=n(738102),c=n(769707),d=n(678002),p=n(359987),_=n(940748),f=n(400116),h=n(266888),g=n(403206),m=n(854379),y=n(332108),E=n(828770),S=n(962559),T=n(999821),v=n(326314),A=n(459857),C=n(673168),P=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=N(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(784898)),O=r(n(571834)),I=n(669050),M=n(309512),b=n(653313),R=r(n(441143));function N(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(N=function(e){return e?n:t})(e)}let w=!1;const L=new c.WapParser("pairSuccessParser",(e=>{var t;e.assertTag("iq"),e.assertFromServer();const n=e.attrString("id"),r=e.child("pair-success"),i=null===(t=r.maybeChild("platform"))||void 0===t?void 0:t.maybeAttrString("name"),a=r.child("device"),o=r.child("device-identity").contentBytes(),s=r.maybeChild("biz"),l=s?s.attrString("name"):"";return{wid:(0,m.deviceJidToDeviceWid)(a.attrDeviceJid("jid")),id:n,deviceIdentityBytes:o,businessName:l,platform:i}}));function D(){return(D=(0,i.default)((function*(e){if(w||(0,C.isRegistered)())return;w=!0;const t=(0,l.unixTimeWithoutClockSkewCorrection)(),n=L.parse(e);if(n.error)return __LOG__(4,void 0,new Error)`Parsing Error: ${n.error.toString()}`,w=!1,Promise.reject(n.error);try{(0,f.resetCompanionReg)(),(0,C.setPairingTimestamp)(t);const e=n.success,{id:r,wid:i,deviceIdentityBytes:l,platform:c}=e;if(h.Conn.blockStoreAdds=!1,!c)throw Error("platform is not provided in the pair success stanza.");h.Conn.platform=c,yield(0,E.setMobilePlatform)(c);const p=(0,M.decodeProtobuf)(S.ADVSignedDeviceIdentityHMACSpec,l),m=p.details,y=p.hmac;(0,R.default)(null!=m&&null!=y,"ADVSignedDeviceIdentityHMAC should not have empty details or hmac");const N=yield(0,d.getADVSecretKey)(),L=yield(0,s.hmacSha256)(N,m),D=(0,a.encodeB64)(L);if(D!==(0,a.encodeB64)(y))return(0,o.deprecatedCastStanza)((0,u.wap)("iq",{to:u.S_WHATSAPP_NET,type:"error",id:(0,u.CUSTOM_STRING)(r)},(0,u.wap)("error",{code:"401",text:"not-authorized"}))),(0,f.logoutAfterValidationFail)(),void(w=!1);const k=(0,M.decodeProtobuf)(S.ADVSignedDeviceIdentitySpec,m),U=k.accountSignatureKey;(0,R.default)(null!=U,"accountSignatreKey should not be null");const G=k.accountSignature;(0,R.default)(null!=G,"accountSignature should not be null");const x=yield v.waSignalStore.getRegistrationInfo();(0,R.default)(null!=x,"Empty regInfo"),yield P.initDeviceLinkEvent(U,x.identityKeyPair.pubKey,t),yield P.setDeviceLinkPairStage(O.default.MD_LINK_DEVICE_COMPANION_STAGE.PAIR_SUCCESS_RECEIVED);if(!(0,d.verifyDeviceIdentityAccountSignature)(k,x.identityKeyPair.pubKey))return(0,o.deprecatedCastStanza)((0,u.wap)("iq",{to:u.S_WHATSAPP_NET,type:"error",id:(0,u.CUSTOM_STRING)(r)},(0,u.wap)("error",{code:"401",text:"not-authorized"}))),yield P.commitDeviceLinkEvent(401),(0,f.logoutAfterValidationFail)(),void(w=!1);k.deviceSignature=yield(0,d.generateDeviceSignature)(k,x.identityKeyPair,U),yield v.waSignalStore.putIdentity((0,T.createSignalAddress)((0,I.toUserWid)(i)).toString(),(0,T.bufferToStr)((0,g.toSignalCurvePubKey)(U))),yield(0,d.setADVSignedIdentity)(k);const B=(0,M.decodeProtobuf)(S.ADVDeviceIdentitySpec,k.details).keyIndex;(0,R.default)(null!=B,"keyIndex should not be null"),k.accountSignatureKey=void 0;const F=(0,b.encodeProtobuf)(S.ADVSignedDeviceIdentitySpec,k).readByteArray();(0,o.deprecatedCastStanza)((0,u.wap)("iq",{to:u.S_WHATSAPP_NET,type:"result",id:(0,u.CUSTOM_STRING)(r)},(0,u.wap)("pair-device-sign",null,(0,u.wap)("device-identity",{"key-index":(0,u.INT)(B)},F)))),yield P.setDeviceLinkPairStage(O.default.MD_LINK_DEVICE_COMPANION_STAGE.PAIR_DEVICE_SIGN_SENT),(0,A.setMe)(i);!0!==(yield(0,C.getInitialHistorySyncComplete)())&&(0,f.startInitialHistorySyncTimeout)(),w=!1,(0,_.setShouldLogAgentLogin)({loginTimestamp:t})}catch(e){__LOG__(4,!0,new Error,!0)`error in handlePairSuccess, ${e}`,SEND_LOGS("error in handlePairSuccess"),yield(0,P.commitDeviceLinkEvent)(-1),(0,p.frontendFireAndForget)("socketLogout",{forcePost:!1,reason:y.LogoutReason.UnknownCompanion})}}))).apply(this,arguments)}},283365:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return p.apply(this,arguments)};var i=r(n(348926)),a=n(738102),o=n(769707),s=r(n(797137)),l=n(326314),u=n(41517);const c=new Set,d=new o.WapParser("lowKeyParser",(e=>(e.assertTag("notification"),e.assertAttr("type","encrypt"),e.assertFromServer(),{stanzaId:e.attrString("id"),numRemaining:e.child("count").attrInt("value")})));function p(){return(p=(0,i.default)((function*(e,t){const n=d.parse(e);if(n.error)throw __LOG__(4,void 0,new Error)`handlePreKeyLow: Parsing Error: ${n.error.toString()}`,n.error;{const e=n.success,r=(0,a.wap)("ack",{to:a.S_WHATSAPP_NET,id:(0,a.CUSTOM_STRING)(e.stanzaId),class:"notification"});return c.has(t)?r:(c.add(t),l.waSignalStore.setServerHasPreKeys(!1),yield(0,s.default)(),(0,u.uploadPreKeys)().then((()=>r)).finally((()=>{c.delete(t)})))}}))).apply(this,arguments)}},251886:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=s.parse(e);if(t.error)return __LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,Promise.reject(t.error);return(0,a.default)(t.success)};var i=n(769707),a=r(n(675600)),o=n(854379);const s=new i.WapParser("incomingPresenceParser",(e=>{e.assertTag("presence");const t=e.attrEnumOrDefault("type",{available:"available",unavailable:"unavailable",unsubscribe:"unsubscribe"},"available"),n="deny"===e.maybeAttrString("last")||void 0;let r;return"unavailable"===t&&(e.hasAttr("last")?["deny","none","error"].includes(e.attrString("last"))||(r=e.attrTime("last")):r=Date.now()),{id:(0,o.chatJidToChatWid)(e.attrChatJid("from")),type:t,t:r,deny:n}}))},459671:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return g.apply(this,arguments)};var i=r(n(348926)),a=n(215373),o=n(738102),s=n(769707),l=n(854379),u=n(935234),c=n(780668),d=n(232695),p=n(459857);const _=new s.WapParser("incomingPrivacyTokensParser",(e=>{e.assertTag("notification");const t=e.attrString("id"),n=e.attrUserJid("from"),r=e.child("tokens"),i=[];return r.forEachChildWithTag("token",(e=>{const t=e.attrString("type");switch(t){case"trusted_contact":i.push(function(e){return{type:"trusted_contact",content:(0,a.uint8ArrayToBuffer)(e.contentBytes()),ts:e.attrTime("t")}}(e));break;case"trusted_contact_outgoing":i.push(function(e){const t=e.attrUserJid("jid");return{type:"trusted_contact_outgoing",ts:e.attrTime("t"),jid:t}}(e));break;default:__LOG__(2)`incomingPrivacyTokensParser - receiving an unknow token: ${t}`}})),{id:t,from:n,privacyTokens:i}}));function f(){return h.apply(this,arguments)}function h(){return(h=(0,i.default)((function*(e,t){const{ts:n}=t,r=(0,l.userJidToUserWid)(e.from);if("trusted_contact_outgoing"===t.type&&(0,p.isMeAccount)(r)){const e=(0,l.userJidToUserWid)(t.jid);yield(0,d.setTcTokenSenderTimestamp)(e,n)}else"trusted_contact"===t.type&&(yield(0,c.setTcToken)(r,n,t.content),yield u.PresenceCollection.reSubscribeWhenActive(r))}))).apply(this,arguments)}function g(){return(g=(0,i.default)((function*(e){const t=_.parse(e);if(t.error)throw __LOG__(2)`error while parsing: ${e.toString()}`,__LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,t.error;const{success:n}=t,r=(0,o.wap)("ack",{id:(0,o.CUSTOM_STRING)(n.id),class:"notification",to:(0,o.JID)(n.from),type:"privacy_token"});return yield Promise.all(n.privacyTokens.map((e=>f(n,e)))),r}))).apply(this,arguments)}},216622:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleProfilePicNotificationJob=function(e){const t=(0,l.isNotifSchedulerEnabled)()?r.JOB_PRIORITY.LOW:r.JOB_PRIORITY.SKIP;return(0,d.NonPersistJob)("handleProfilePicNotification",(e=>function(e){const t=h.parse(e);if(t.error)return __LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,Promise.reject(t.error);const n=t.success;let r=Promise.resolve();if(n.jid){const e=n.jid;switch(n.type){case"delete":case"set":const t="delete"===n.type?p.PROFILE_PIC_COMMAND.REMOVE:p.PROFILE_PIC_COMMAND.SET;r=(0,_.changeProfilePicThumb)(e,t).then((()=>{if(!e.isGroup())return;const r=(0,s.genGroupPicChangeNotificationMsg)(n.jid,t,n.ts,n.author||(0,f.getMeUser)());return(0,c.handleSingleMsgMD)(n.jid,r)}));break;case"request":break;default:__LOG__(3)`Invalid type received`}}return r.then((()=>(0,i.wap)("ack",{id:(0,i.CUSTOM_STRING)(n.stanzaId),to:(0,o.JID)(n.from),class:"notification",type:"picture"})))}(e.node)),{priority:t}).waitUntilCompleted({node:e})};var r=n(431012),i=n(738102),a=n(769707),o=n(355813),s=n(614198),l=n(724469),u=n(854379),c=n(240493),d=n(797703),p=n(476314),_=n(346702),f=n(459857);const h=new a.WapParser("incomingProfilePicNotificationParser",(e=>{let t,n;if(e.assertTag("notification"),e.hasChild("delete"))t="delete",n=e.child("delete");else if(e.hasChild("set"))t="set",n=e.child("set");else{if(!e.hasChild("request"))return e.throw("Expected child type to be one of: set, delete, request");t="request",n=e.child("request"),n.assertAttr("jid",(0,f.assertGetMe)().toJid())}const r=e.attrString("id");return n.hasAttr("jid")?{type:t,from:(0,u.chatJidToChatWid)(e.attrChatJid("from")),jid:(0,u.chatJidToChatWid)(n.attrChatJid("jid")),author:n.hasAttr("author")?(0,u.userJidToUserWid)(n.attrUserJid("author")):null,ts:e.attrTime("t"),rawTs:e.attrString("t"),stanzaId:r,picId:"set"===t?n.attrInt("id",1):0}:{from:(0,u.userJidToUserWid)(e.attrUserJid("from")),jid:null,type:t,hash:n.attrString("hash"),stanzaId:r}}))},233717:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return T.apply(this,arguments)};var i=r(n(348926)),a=n(215373),o=n(616310),s=n(738102),l=n(769707),u=n(287461),c=n(303754),d=n(355813),p=n(143130),_=n(257845),f=n(854379),h=n(887502),g=n(669050);const m=n(76672)({Image:"image",Video:"video",Text:"text"}),y=new l.WapParser("incomingCampaignParser",(e=>{e.assertTag("notification"),e.assertAttr("from",o.STATUS_JID);const t=e.attrString("id"),n=(0,f.userJidToUserWid)(e.attrUserJid("participant")),r=e.attrTime("t"),i=e.child("campaign"),s=i.hasChild("revoke"),l=i.attrString("id"),u=i.maybeAttrInt("duration"),c=i.mapChildrenWithTag("message",(e=>{const t=e.child("media");t.attrEnumValues("mediatype",m.members());return{id:e.attrString("id"),ts:r,body:(0,a.uint8ArrayToBuffer)(t.contentBytes())}}));return{participant:n,stanzaId:t,campaignId:l,campaignDuration:u,revoke:s,ts:r,messages:c}}));function E(){return S.apply(this,arguments)}function S(){return(S=(0,i.default)((function*(e,t){const{participant:n,campaignId:r,campaignDuration:i}=e,{id:a,ts:s,body:l}=t,u={type:_.MESSAGE_TYPE.OTHER_STATUS,externalId:a,ts:s,edit:-1,isHsm:!1,count:null,chat:(0,g.createWid)(o.STATUS_JID),author:n,pushname:null,isDirect:!1,campaignId:r,campaignDuration:i},d={retryCount:0,e2eType:c.CiphertextType.Msg,mediaType:c.MediaType.Photo,hideFail:!1};yield(0,p.processDecryptedProto)({decrypted:l,info:u,e2eInfo:d,bizInfo:{nativeFlowName:null,verifiedNameSerial:null,verifiedLevel:null,verifiedNameCert:null,privacyMode:null},isPadded:!1})}))).apply(this,arguments)}function T(){return(T=(0,i.default)((function*(e){const t=y.parse(e);if(t.error)throw __LOG__(2)`error while parsing: ${e.toString()}`,__LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,t.error;const{success:n}=t,r=(0,s.wap)("ack",{id:(0,s.CUSTOM_STRING)(n.stanzaId),participant:(0,d.USER_JID)(n.participant),class:"notification",type:"psa",to:(0,d.JID)((0,g.createWid)(o.STATUS_JID))});return(0,u.getABPropConfigValue)("web_status_psa")?(n.revoke?yield(0,h.revokeStatusPSA)(n.campaignId):yield Promise.all(n.messages.map((e=>E(n,e)))),r):r}))).apply(this,arguments)}},789375:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.updatePushname=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=(0,l.toUserWid)(e);return u.enqueue((0,i.default)((function*(){let e;n||(e=yield a(r,t)),!0!==e&&void 0!==e||(__LOG__(2)`updatePushName: set pushname for ${String(r)}`,(0,s.persistContactUpdateBatched)({id:r.toString(),pushname:t}))})));function a(e,t){return(0,o.frontendSendAndReceive)("updatePushname",{contactId:e,pushname:t})}};var i=r(n(348926)),a=n(316860),o=n(359987),s=n(881646),l=n(669050);const u=new a.PromiseQueue},416341:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NOTIFICATION_TYPE=void 0,t.handleServerNotification=function(e){const t=c.parse(e);if(t.error)return __LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,Promise.reject(t.error);return function(e){const t=(0,r.wap)("ack",{id:(0,r.CUSTOM_STRING)(e.stanzaId),class:"notification",type:"server",to:e.from});switch(e.type){case u.LOG:return o.upload({reason:o.SERVER_REQUESTED,immediate:!0,isHighPri:!0}),Promise.resolve(t);case u.PROPS:return(0,s.queryServerProps)().then((()=>t));case u.ABPROPS:return(0,a.syncABPropsTask)(!1).then((()=>t));default:return __LOG__(3)`Unsupported notification with type "server",
blindly ack-ing it and doing nothing`,Promise.resolve(t)}}(t.success)};var r=n(738102),i=n(769707),a=n(266485),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(996588)),s=n(927540);function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}const u=Object.freeze({LOG:"log",PROPS:"props",ABPROPS:"abprops"});t.NOTIFICATION_TYPE=u;const c=new i.WapParser("incomingServerNotificationParser",(e=>{e.assertTag("notification");const t=e.attrString("id"),n=e.attrWapJid("from");return e.hasChild(u.LOG)?{type:u.LOG,stanzaId:t,from:n}:e.hasChild(u.PROPS)?{type:u.PROPS,stanzaId:t,from:n}:e.hasChild(u.ABPROPS)?{type:u.ABPROPS,stanzaId:t,from:n}:{type:null,stanzaId:t,from:n}}))},828104:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleServerSyncNotification=function(e){const t=p.parse(e);if(t.error)return __LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,Promise.reject(t.error);return function(e){if(e.changedCollections){const t=new Map;for(const[n,r]of e.changedCollections){const e=o.CollectionName.cast(n);null!=e?t.set(e,r):__LOG__(3)`syncd: unknown collection name in notification: ${n}`}let n=Array.from(t.keys());e.offline&&n.forEach((e=>{const t=d.get(e);null!=t?d.set(e,t+1):d.set(e,1)})),__LOG__(2)`syncd: incoming sync notification for collections
${Array.from(t.entries()).map((e=>{let[t,n]=e;return`${t} v${n}`})).join("\n")}`,u.default.isSyncDCriticalDataSyncInProcess()&&(n=n.filter((e=>(0,a.isCriticalCollection)(e))),__LOG__(2)`syncd: filtered non critical collections during bootstrap. new collections: ${n}`),(0,i.markCollectionsForSync)(n,t)}return Promise.resolve((0,s.wap)("ack",{id:(0,s.CUSTOM_STRING)(e.stanzaId),class:"notification",type:"server_sync",to:s.S_WHATSAPP_NET}))}(t.success)},t.reportOfflineNotifications=function(){if(d.size<1)return;let e=0;Array.from(d.entries()).forEach((t=>{let[,n]=t;e+=n-1})),new c.default.MdAppStateOfflineNotifications({redundantCount:e}).commit(),d.clear()};var i=n(279385),a=n(729208),o=n(155172),s=n(738102),l=n(769707),u=r(n(775410)),c=r(n(571834));const d=new Map,p=new l.WapParser("serverSyncNotification",(e=>{if(e.assertTag("notification"),!e.hasChild("collection"))throw e.createParseError("Server sync notifcation does not contain any collections");const t=e.attrString("id"),n=new Map(e.mapChildrenWithTag("collection",(e=>[e.attrString("name"),e.attrInt("version")]))),r=e.hasAttr("offline");return e.attrString("from")!==s.S_WHATSAPP_NET.toString()&&__LOG__(4,void 0,new Error)`handleServerSyncNotification: "from" is not domain jid "s.whatsapp.net"`,{changedCollections:n,stanzaId:t,offline:r}}))},657874:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return _.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(769707),s=n(780549),l=n(400116),u=n(6961),c=n(581263),d=n(784898);const p=new o.WapParser("streamErrorParser",(e=>{if(e.assertTag("stream:error"),!e.hasChild("conflict"))return e.hasAttr("code")?{type:"code",code:e.attrInt("code")}:e.hasChild("ack")?{type:"ack",id:e.child("ack").hasAttr("id")?e.child("ack").attrString("id"):null}:e.hasChild("xml-not-well-formed")?{type:"xml-not-well-formed"}:(__LOG__(3)`Unrecognized stream:error: ${e.toString()}`,{type:"other"});switch(e.child("conflict").attrString("type")){case"replaced":return{type:"replaced"};case"device_removed":default:return{type:"device_removed"}}}));function _(){return(_=(0,i.default)((function*(e){const t=p.parse(e);if(t.error)return __LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,Promise.reject(t.error);const n=t.success;if("code"===n.type&&n.code>=500&&n.code<600){if(515===n.code)return(0,a.stopComms)(),yield(0,l.startLogin)(),(0,c.startBackend)(),Promise.resolve("NO_ACK");if(516===n.code)return(0,a.stopComms)(),yield(0,d.commitDeviceLinkEvent)(516),yield(0,l.startLogout)(),(0,c.startBackend)(),Promise.resolve("NO_ACK");(0,a.onStreamErrorReceived)()}else{if("device_removed"===n.type)return s.Cmd.onStartingLogout(),(0,a.stopComms)(),yield u.Socket.clearCredentialsAndStoredData(),__LOG__(2)`stream error due to device removed, logging out`,s.Cmd.logout(),Promise.resolve("NO_ACK");if("replaced"===n.type)return(0,a.stopComms)(),Promise.resolve("NO_ACK");"xml-not-well-formed"===n.type&&__LOG__(3)`handleStreamError: sent xml not well formed, closing the socket`}return Promise.resolve("CLOSE_SOCKET")}))).apply(this,arguments)}},265927:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=m.parse(e);if(t.error)return __LOG__(4,void 0,new Error)`handleSuccess: failed to parse ${t.error}`,Promise.reject(t.error);const n=t.success;(function(e){const t=Date.now()/1e3,n=Math.round(t-e),r=Math.round(n/3600);0!==r&&(0,s.getABPropConfigValue)("log_clock_skew")&&new h.default.ClockSkewDifferenceT({clockSkewHourly:-1*r}).commit();(0,a.setClockSkew)(n),l.Clock.setSkew(n)})(n.ts),function(e){const t=(0,f.getMaybeMeLid)();if(null==t&&null==e)return;if(null==t&&null!=e)return void(0,f.setMeLid)(e);if(null!=t&&null==e)return;if((0,i.default)(t,"lid").equals(e))return;(0,f.setMeLid)((0,i.default)(e,"nextLid"))}(null!=n.lid?(0,g.createWid)(n.lid):null),null!=n.displayName&&(0,f.setMeDisplayName)(n.displayName);u.Cmd.onTemporaryBan({banned:!1});const r=n.companionEncStatic;if(d.DbEncKeyStore.generateFinalDbEncryptionAndFtsKey(r),(0,c.generateFinalDbEncryptionAndFtsKeyForInvoker)(r),null==_.ServerProps.serverPropsVersion||_.ServerProps.serverPropsVersion<n.propsVersion)return(0,p.queryServerProps)()};var i=r(n(132375)),a=n(990445),o=n(769707),s=n(287461),l=n(63014),u=n(780549),c=n(188472),d=n(436005),p=n(927540),_=n(241588),f=n(459857),h=r(n(571834)),g=n(669050);const m=new o.WapParser("successParser",(e=>(e.assertTag("success"),{ts:e.attrTime("t"),propsVersion:e.attrInt("props"),companionEncStatic:e.maybeAttrString("companion_enc_static")||"NULL",lid:e.maybeAttrString("lid"),displayName:e.maybeAttrString("display_name")})))},651152:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return T.apply(this,arguments)};var i=r(n(348926)),a=n(215373),o=n(616310),s=n(738102),l=n(769707),u=n(728088),c=n(303754),d=n(355813),p=n(143130),_=n(257845),f=n(854379),h=n(301460),g=r(n(565754)),m=n(669050);const y=new l.WapParser("incomingWAChatNotificationParser",(e=>{e.assertTag("notification"),e.assertAttr("from",o.PSA_JID);const t=e.attrString("id"),n=e.attrTime("t"),r=(0,f.userJidToUserWid)(e.attrUserJid("from"));let i="",s=[],l=[];if(e.hasChild("messages")){const t=e.child("messages");i=t.attrString("campaign_id"),l=t.mapChildrenWithTag("message",(e=>{const t=e.attrString("type"),r=e.attrString("id"),i="text"===t?e:e.child("media");return{id:r,ts:n,body:(0,a.uint8ArrayToBuffer)(i.contentBytes())}}))}else{const t=e.child("revoke");i=t.attrString("campaign_id"),s=t.mapChildrenWithTag("message",(e=>new g.default({fromMe:!1,remote:(0,m.createWid)(o.PSA_JID),id:e.attrString("id"),participant:(0,m.createWid)(o.PSA_JID)}).toString()))}return{participant:r,stanzaId:t,ts:n,campaignId:i,messages:l,revokeMessageIds:s}}));function E(){return S.apply(this,arguments)}function S(){return(S=(0,i.default)((function*(e,t){const{participant:n,campaignId:r}=e,{id:i,ts:a,body:s}=t,l={type:_.MESSAGE_TYPE.OTHER_STATUS,externalId:i,ts:a,edit:-1,isHsm:!1,count:null,chat:(0,m.createWid)(o.PSA_JID),author:n,pushname:null,isDirect:!1,campaignId:r},u={retryCount:0,e2eType:c.CiphertextType.Msg,mediaType:c.MediaType.Photo,hideFail:!1};yield(0,p.processDecryptedProto)({decrypted:s,info:l,e2eInfo:u,bizInfo:{nativeFlowName:null,verifiedNameSerial:null,verifiedLevel:null,verifiedNameCert:null,privacyMode:null},isPadded:!1})}))).apply(this,arguments)}function T(){return(T=(0,i.default)((function*(e){const t=y.parse(e);if(t.error)throw __LOG__(2)`error while parsing: ${e.toString()}`,__LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,t.error;const{success:n}=t,r=(0,s.wap)("ack",{id:(0,s.CUSTOM_STRING)(n.stanzaId),class:"notification",type:"psa",to:(0,d.JID)((0,m.createWid)(o.PSA_JID))});return null!=n.revokeMessageIds&&0!==n.revokeMessageIds.length?(yield(0,u.removeMessagesFromHistory)(n.revokeMessageIds),n.revokeMessageIds.forEach((e=>{const t=h.MsgCollection.get(e);t&&t.delete()}))):yield Promise.all(n.messages.map((e=>E(n,e)))),r}))).apply(this,arguments)}},929840:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractCertificateDetailsParams=function(e){return{serial:e.serial,name:e.verifiedName,isApi:"ent:wa"===e.issuer,isSmb:"smb:wa"===e.issuer}},t.getParsedProtoObjects=function(e){if(!e)return null;const t=(0,i.decodeProtobuf)(r.VerifiedNameCertificateSpec,e);if(!t.details)throw new Error("verifyCertificate cert missing details");if(!t.signature)throw new Error("verifyCertificate cert missing signature");const n=(0,i.decodeProtobuf)(r.VerifiedNameCertificate$DetailsSpec,t.details);return{cert:t,details:n}};var r=n(759089),i=n(309512)},9671:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleVerifiedBusinessNameNotificationContact=function(){return A.apply(this,arguments)},t.handleVerifiedBusinessNameNotificationHash=function(){return v.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(85734),u=r(n(731302)),c=n(955763),d=r(n(65230)),p=n(355813),_=n(121977),f=n(338835),h=n(605316);function g(e,t,n,r,i,a){const o=_.ContactCollection.get(e);return null!=o&&(0,c.updateContactsWithVerifiedNames)([{id:e,name:n,level:t,isApi:r,isSmb:i,privacyMode:a}],[o]),Promise.resolve()}function m(){return y.apply(this,arguments)}function y(){return(y=(0,i.default)((function*(e){yield(0,h.getStorage)().lock(["verified-business-name"],(()=>(0,l.createOrUpdateVerifiedBusinessName)({id:e.wid.isLid()?e.wid.toString():e.wid.user,level:e.level,serial:parseInt(e.serial||"0",10),name:e.verifiedName,isApi:e.isApi,isSmb:e.isSmb,privacyMode:e.privacyMode?{actualActors:e.privacyMode.actualActors,hostStorage:e.privacyMode.hostStorage,privacyModeTs:e.privacyMode.privacyModeTs}:null})));const t=[],n=_.ContactCollection.get(e.wid);null!=n&&t.push((0,u.default)(e.wid,{isBusiness:n.isBusiness,privacyMode:n.privacyMode},{isBusiness:!0,privacyMode:e.privacyMode})),t.push(g(e.wid,e.level,e.verifiedName,e.isApi,e.isSmb,e.privacyMode)),yield Promise.all(t)}))).apply(this,arguments)}const E=new s.WapParser("verifiedNameParser",(e=>(0,d.default)(e.child("verified_name"))));function S(){return T.apply(this,arguments)}function T(){return(T=(0,i.default)((function*(e){const t=(0,o.wap)("iq",{to:o.S_WHATSAPP_NET,type:"get",xmlns:"w:biz",id:(0,o.generateId)()},(0,o.wap)("verified_name",{jid:(0,p.DEVICE_JID)(e)})),n=yield(0,a.deprecatedSendIq)(t,E);if(!n.success){if(404===n.errorCode)return void __LOG__(3)`verified name notification not found`;throw new Error("Could not send IQ in retrieveBusinessDetails")}return n.result}))).apply(this,arguments)}function v(){return(v=(0,i.default)((function*(e){if("verified_name_hash"!==e.type)throw Error("Invalid notification type");const t=_.ContactCollection.resolveWidsFromHash(e.hash);if(!t)return!1;const n=yield Promise.all(t.map(function(){var e=(0,i.default)((function*(e){return{wid:e,verifiedName:yield S(e)}}));return function(){return e.apply(this,arguments)}}()));return n.length&&(yield Promise.all(n.map((t=>{let{wid:n,verifiedName:r}=t;if(r){const{name:t,level:i,serial:a,isApi:o,isSmb:s,privacyMode:l}=r;return m({wid:n,verifiedName:t,level:i,stanzaId:e.stanzaId,ts:e.ts,serial:a,isApi:o,isSmb:s,privacyMode:l})}if(void 0===r)return(0,f.handleBusinessRemoval)(n,e.stanzaId,e.ts)})))),!0}))).apply(this,arguments)}function A(){return(A=(0,i.default)((function*(e){let{jid:t,stanzaId:n,ts:r,verifiedName:i}=e;const{serial:a="",level:o,isApi:s,isSmb:l,privacyMode:u}=i;let c=i.name;var d;if(!c)if(null!=(null===(d=_.ContactCollection.get(t))||void 0===d?void 0:d.verifiedName)){var p;c=(null===(p=_.ContactCollection.get(t))||void 0===p?void 0:p.verifiedName)||""}else{const e=yield S(t);if(!e)return;c=e.name}return m({verifiedName:c,level:o,stanzaId:n,ts:r,wid:t,serial:a,isApi:s,isSmb:l,privacyMode:u})}))).apply(this,arguments)}},435170:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleBusinessNotification=T,t.handleBusinessNotificationJob=function(e){const t=(0,h.isNotifSchedulerEnabled)()?o.JOB_PRIORITY.LOW:o.JOB_PRIORITY.SKIP;return(0,m.NonPersistJob)("handleBusinessNotification",(e=>T(e.node)),{priority:t}).waitUntilCompleted({node:e})};var i=r(n(348926)),a=r(n(81109)),o=n(431012),s=n(738102),l=n(769707),u=r(n(106819)),c=r(n(65230)),d=n(9671),p=n(614466),_=n(563905),f=n(338835),h=n(724469),g=n(854379),m=n(797703),y=n(170428);const E=new l.WapParser("businessNotificationParser",(e=>{e.assertTag("notification");const t={stanzaId:e.attrString("id"),from:e.attrWapJid("from"),ts:e.attrTime("t")};let n;if(e.hasChild("remove"))return n=e.child("remove"),n.hasAttr("jid")?(0,a.default)({type:"remove_jid",jid:(0,g.chatJidToChatWid)(n.attrChatJid("jid"))},t):(0,a.default)({type:"remove_hash",hash:n.attrString("hash")},t);if(e.hasChild("verified_name"))return n=e.child("verified_name"),n.hasAttr("jid")?(0,a.default)({type:"verified_name_jid",jid:(0,g.chatJidToChatWid)(n.attrChatJid("jid")),verifiedName:(0,c.default)(n)},t):(0,a.default)({type:"verified_name_hash",hash:n.attrString("hash")},t);if(e.hasChild("profile")){const n=e.child("profile"),r=n.maybeAttrString("hash");if(r)return(0,a.default)({type:"profile_hash",hash:r},t);const i=(0,u.default)(n);return(0,a.default)({type:"profile",profile:i},t)}if(e.hasChild("product_catalog")){const n=e.child("product_catalog");if(n.hasChild("product")){const e=[];return n.forEachChildWithTag("product",(t=>{const n=t.child("id").contentString();e.push(n)})),(0,a.default)({type:"product",productsIds:e},t)}if(n.hasChild("collection")){const e=[],r=[];return n.forEachChildWithTag("collection",(t=>{if(t.hasChild("status_info")){var n,i;const a={reviewStatus:t.child("status_info").child("status").contentString(),rejectReason:null===(n=t.child("status_info").maybeChild("reject_reason"))||void 0===n?void 0:n.contentString(),commerceUrl:null===(i=t.child("status_info").maybeChild("commerce_url"))||void 0===i?void 0:i.contentString()};e.push(t.attrString("id")),r.push(a)}})),(0,a.default)({type:"collection",collectionIds:e,reviewStatuses:r},t)}}else if(e.hasChild("subscriptions")){const n=e.child("subscriptions"),r=[];return n.forEachChildWithTag("subscription",(e=>{const t=e.attrString("status"),n=e.maybeAttrInt("subscription_end_time"),i=e.attrString("id");r.push({id:i,status:t,expirationDate:n})})),(0,a.default)({type:"subscriptions",subscriptions:r},t)}return(0,a.default)({type:"unknown"},t)}));function S(e,t,n){return n?(0,s.wap)("ack",{id:(0,s.CUSTOM_STRING)(e),to:t,class:"notification",type:"business"},(0,s.wap)("user",{side_list:"out"})):(0,s.wap)("ack",{id:(0,s.CUSTOM_STRING)(e),to:t,class:"notification",type:"business"})}function T(){return v.apply(this,arguments)}function v(){return(v=(0,i.default)((function*(e){const t=E.parse(e);if(t.error)throw __LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,t.error;const n=t.success;switch(n.type){case"verified_name_hash":const e=yield(0,d.handleVerifiedBusinessNameNotificationHash)(n);return S(n.stanzaId,n.from,!e);case"verified_name_jid":return yield(0,d.handleVerifiedBusinessNameNotificationContact)(n),S(n.stanzaId,n.from,!1);case"remove_hash":const t=yield(0,f.handleBusinessRemovalNotificationHash)(n);return S(n.stanzaId,n.from,!t);case"remove_jid":return yield(0,f.handleBusinessRemovalNotificationContact)(n),S(n.stanzaId,n.from,!1);case"profile":return(0,_.handleBusinessProfile)(n),S(n.stanzaId,n.from,!1);case"profile_hash":const r=yield(0,_.handleBusinessProfileHash)(n);return S(n.stanzaId,n.from,!r);case"product":return yield(0,p.handleProductNotification)(n.productsIds),S(n.stanzaId,n.from,!1);case"collection":return yield(0,p.handleCollectionNotification)(n),S(n.stanzaId,n.from,!1);case"subscriptions":return yield(0,y.applySubscriptions)(n.subscriptions),S(n.stanzaId,n.from,!1);default:return S(n.stanzaId,n.from,!1)}}))).apply(this,arguments)}},614466:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleCollectionNotification=function(e){const t=a.CatalogCollection.get((0,o.getMeUser)().toString());if(null==t?void 0:t.collections)for(let n=0;n<e.collectionIds.length;n++){const r=t.collections.get(e.collectionIds[n]);r&&r.set(e.reviewStatuses[n])}return Promise.resolve()},t.handleProductNotification=function(){return s.apply(this,arguments)};var i=r(n(348926)),a=n(644130),o=n(459857);function s(){return(s=(0,i.default)((function*(e){const t=a.CatalogCollection.get((0,o.getMeUser)().toString());if(t){const n=[];e.forEach((e=>{n.push(t.refreshProduct(e))})),yield Promise.all(n)}}))).apply(this,arguments)}},563905:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleBusinessProfileHash=t.handleBusinessProfile=void 0;var i=r(n(348926)),a=n(69108),o=n(85663),s=n(121977),l=n(459857),u=n(669050);t.handleBusinessProfile=e=>{let{from:t,profile:n}=e;const r=(0,u.createWidFromWidLike)(t.toString()),i=Boolean(a.BusinessProfileCollection.getValid(r)),s=(0,o.parseBusinessProfile)({id:r,profile:n,queryCatalog:!1,customUrlPaths:null}),c=a.BusinessProfileCollection.gaddUp(s);i?(0,l.isMeAccount)(r)&&a.BusinessProfileCollection.fetchBizProfile(r):c.stale=!0};const c=function(){var e=(0,i.default)((function*(e){let{hash:t}=e;const n=s.ContactCollection.resolveWidsFromHash(t);return!!n&&(yield Promise.all(n.map(function(){var e=(0,i.default)((function*(e){const t=Boolean(a.BusinessProfileCollection.getValid(e)),n=yield a.BusinessProfileCollection.update(e),r=Array.isArray(n)?n:[n];for(const e of r)t||(e.stale=!0)}));return function(){return e.apply(this,arguments)}}())),!0)}));return function(){return e.apply(this,arguments)}}();t.handleBusinessProfileHash=c},338835:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleBusinessRemoval=p,t.handleBusinessRemovalNotificationContact=function(){return h.apply(this,arguments)},t.handleBusinessRemovalNotificationHash=function(){return f.apply(this,arguments)};var i=r(n(348926)),a=r(n(731302)),o=n(121977),s=n(605316);function l(){return u.apply(this,arguments)}function u(){return(u=(0,i.default)((function*(e,t){const n=yield e.get(t.user);if(null!=n)return n.isBusiness=!1,n.verifiedLevel=0,n.verifiedName="",e.merge(t.user,n)}))).apply(this,arguments)}function c(e,t){return e.remove(t.user)}const d={isBusiness:!1};function p(){return _.apply(this,arguments)}function _(){return(_=(0,i.default)((function*(e){const t=o.ContactCollection.get(e),n=t?{isBusiness:t.isBusiness,privacyMode:t.privacyMode}:d;yield(0,s.getStorage)().lock(["contact","verified-business-name"],(t=>{let[n,r]=t;return Promise.all([l(n,e),c(r,e)])}));const r=o.ContactCollection.get(e);return null!=r&&r.set({isBusiness:!1,verifiedLevel:null,verifiedName:null}),(0,a.default)(e,n,d)}))).apply(this,arguments)}function f(){return(f=(0,i.default)((function*(e){if("remove_hash"!==e.type)throw Error("Invalid notification type");const t=o.ContactCollection.resolveWidsFromHash(e.hash);return!!t&&(yield Promise.all(t.map((t=>p(t,e.stanzaId,e.ts)))),!0)}))).apply(this,arguments)}function h(){return(h=(0,i.default)((function*(e){if("remove_jid"!==e.type)throw Error("Invalid notification type");yield p(e.jid,e.stanzaId,e.ts)}))).apply(this,arguments)}},111070:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.GROUP_NOTIFICATION_TAG=void 0,t.notAlreadyInGroup=function(e,t){return(0,l.frontendSendAndReceive)("notAlreadyInGroup",{groupId:e,participants:t})},t.shouldSkipGenMsg=function(){return E.apply(this,arguments)};var i=r(n(348926)),a=n(990445),o=n(287461),s=n(565583),l=n(359987),u=n(965012),c=n(862159),d=n(97858),p=n(126092),_=n(556078),f=n(459857),h=r(n(124928));const g=Object.freeze({REMOVE:"remove",ADD:"add",DEMOTE:"demote",DELETE:"delete",PROMOTE:"promote",MODIFY:"modify",CREATE:"create",SUBJECT:"subject",DESC:"description",LOCKED:"locked",UNLOCKED:"unlocked",ANNOUNCE:"announcement",NOT_ANNOUNCE:"not_announcement",NO_FREQUENTLY_FORWARDED:"no_frequently_forwarded",FREQUENTLY_FORWARDED_OK:"frequently_forwarded_ok",INVITE:"invite",EPHEMERAL:"ephemeral",NOT_EPHEMERAL:"not_ephemeral",REVOKE_INVITE:"revoke",SUSPENDED:"suspended",UNSUSPENDED:"unsuspended",GROWTH_LOCKED:"growth_locked",GROWTH_UNLOCKED:"growth_unlocked",LINK:"link",UNLINK:"unlink",LINKED_GROUP_PROMOTE:"linked_group_promote",LINKED_GROUP_DEMOTE:"linked_group_demote",MEMBERSHIP_APPROVAL_MODE:"membership_approval_mode",MEMBERSHIP_APPROVAL_REQUEST:"membership_approval_request",REVOKED_MEMBERSHIP_REQUESTS:"revoked_membership_requests"});function m(){return y.apply(this,arguments)}function y(){return(y=(0,i.default)((function*(e,t){var n;const r=yield(0,p.getTable)().get(e);return!!r&&r.growthLockType===t&&(null!==(n=r.growthLockExpiration)&&void 0!==n?n:0)>(0,a.unixTime)()}))).apply(this,arguments)}function E(){return(E=(0,i.default)((function*(e,t){if(t.actionType===c.GROUP_ACTIONS.REVOKE_INVITE||t.actionType===c.GROUP_ACTIONS.SUSPEND||t.actionType===c.GROUP_ACTIONS.REVOKED_MEMBERSHIP_REQUESTS)return!0;if(t.actionType===c.GROUP_ACTIONS.GROWTH_LOCKED||t.actionType===c.GROUP_ACTIONS.GROWTH_UNLOCKED){if(t.actionType===c.GROUP_ACTIONS.GROWTH_LOCKED){if("invite"!==t.type)return!0;if(yield m(e.chatId.toString(),t.type))return!0}return!(yield(0,s.isCurrentUserGroupAdmin)(e.chatId.toString()))}if((t.actionType===c.GROUP_ACTIONS.SUB_GROUP_LINK||t.actionType===c.GROUP_ACTIONS.PARENT_GROUP_LINK||t.actionType===c.GROUP_ACTIONS.SIBLING_GROUP_LINK||t.actionType===c.GROUP_ACTIONS.SUB_GROUP_UNLINK||t.actionType===c.GROUP_ACTIONS.SIBLING_GROUP_UNLINK||t.actionType===c.GROUP_ACTIONS.PARENT_GROUP_UNLINK||t.actionType===c.GROUP_ACTIONS.INTEGRITY_PARENT_GROUP_UNLINK||t.actionType===c.GROUP_ACTIONS.DELETE_PARENT_GROUP||t.actionType===c.GROUP_ACTIONS.LINKED_GROUP_PROMOTE||t.actionType===c.GROUP_ACTIONS.LINKED_GROUP_DEMOTE)&&!(0,d.communitiesEnabled)())return!0;if((0,d.communitiesEnabled)()&&(t.actionType===c.GROUP_ACTIONS.PROMOTE||t.actionType===c.GROUP_ACTIONS.DEMOTE)){var n;const t=null===(n=u.ChatCollection.get(e.chatId))||void 0===n?void 0:n.groupMetadata;if((null==t?void 0:t.groupType)===c.GroupType.DEFAULT_ANNOUNCEMENT_GROUP)return!0}if(t.actionType===c.GROUP_ACTIONS.PROMOTE||t.actionType===c.GROUP_ACTIONS.DEMOTE){if(!(1===t.participants.length&&(0,f.isMeAccount)(t.participants[0].id)))return!0}if(t.actionType===c.GROUP_ACTIONS.LINKED_GROUP_DEMOTE&&1===t.participants.length&&!(0,f.isMeAccount)(t.participants[0].id)){if(!(yield(0,s.isCurrentUserGroupAdmin)(e.chatId.toString())))return!0}if((0,_.skipLeaveSystemMessageEnabled)()&&t.actionType===c.GROUP_ACTIONS.REMOVE&&1===t.participants.length&&h.default.equals(e.author,t.participants[0].id)){const t=yield(0,s.isCurrentUserGroupAdmin)(e.chatId.toString()),n=(0,f.isMeAccount)(e.author);if(!t||n)return!0}if(t.actionType===c.GROUP_ACTIONS.DELETE){var r;const n=null===(r=u.ChatCollection.get(e.chatId))||void 0===r?void 0:r.groupMetadata;return(t.reason!==c.DELETE_REASON.INTEGRITY_DELETE_PARENT||(null==n?void 0:n.groupType)!==c.GroupType.DEFAULT_ANNOUNCEMENT_GROUP||!(0,o.getABPropConfigValue)("community_suspend_v0_enabled"))&&(t.reason===c.DELETE_REASON.DELETE_PARENT&&(null==n||n.groupType,c.GroupType.DEFAULT_ANNOUNCEMENT_GROUP),!0)}if((t.actionType===c.GROUP_ACTIONS.MEMBERSHIP_APPROVAL_MODE||t.actionType===c.GROUP_ACTIONS.MEMBERSHIP_APPROVAL_REQUEST)&&!(0,o.getABPropConfigValue)("group_join_request_m1"))return!0;if(t.actionType===c.GROUP_ACTIONS.REMOVE||t.actionType===c.GROUP_ACTIONS.PROMOTE||t.actionType===c.GROUP_ACTIONS.DEMOTE||t.actionType===c.GROUP_ACTIONS.MODIFY||t.actionType===c.GROUP_ACTIONS.LINKED_GROUP_PROMOTE||t.actionType===c.GROUP_ACTIONS.LINKED_GROUP_DEMOTE){if(t.participants.every((e=>{let{id:t}=e;return t.isLid()})))return!0}return!1}))).apply(this,arguments)}t.GROUP_NOTIFICATION_TAG=g},225390:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleGroupNotificationV2=function(){return h.apply(this,arguments)},t.isGroupNotificationOptimizationEligible=function(e,t){return null!=g(e,t)};var i=r(n(81109)),a=r(n(348926)),o=n(738102),s=n(359987),l=n(355813),u=n(800321),c=n(614198),d=n(111070),p=n(412985),_=n(240493),f=n(193970);function h(){return(h=(0,a.default)((function*(e,t){const n=g(e,t);return null==n?(__LOG__(3)`no handler for group notification ${e.chatId.toString()}`,r()):(yield Promise.all([n.writeSystemMessages(),n.writeGroupInfoUpdates()]),r());function r(){return(0,o.wap)("ack",{to:(0,l.GROUP_JID)(e.chatId),id:(0,o.CUSTOM_STRING)(e.externalId),class:"notification",participant:e.author?(0,l.USER_JID)(e.author):o.DROP_ATTR})}}))).apply(this,arguments)}function g(e,t){const n=[];for(const t of e.actions){const r=o(e,t);if(null==r)return null;n.push(r)}return{writeSystemMessages:(i=(0,a.default)((function*(){yield Promise.all(n.map((e=>e.writeSystemMessages())))})),function(){return i.apply(this,arguments)}),writeGroupInfoUpdates:(r=(0,a.default)((function*(){yield Promise.all(n.map((e=>e.writeGroupInfoUpdates())))})),function(){return r.apply(this,arguments)})};var r,i;function o(e,n){return n.actionType===d.GROUP_NOTIFICATION_TAG.CREATE?null:{writeGroupInfoUpdates:(r=(0,a.default)((function*(){yield(0,f.updateDBForGroupAction)(e,n,t),(0,s.frontendSendAndReceive)("updateModelForGroupAction",{groupMeta:e,groupAction:n})})),function(){return r.apply(this,arguments)}),writeSystemMessages:()=>function(e,t,n,r){let i=()=>{};const o=new Promise((e=>i=e));return(0,p.handleMessage)(e.toString(),n,(0,a.default)((function*(){if(yield r())return void i();const e=t().then((e=>s(e))).then(i);return n?Promise.resolve():e}))),o;function s(){return l.apply(this,arguments)}function l(){return(l=(0,a.default)((function*(e){if(n)return(0,u.getMessageCache)().addMessages(e.map((e=>({msg:e}))),!1);yield Promise.all(e.map((e=>(0,_.handleSingleMsgMD)(e.from,e))))}))).apply(this,arguments)}}(e.chatId,(()=>function(){return m.apply(this,arguments)}(e,n)),t,(()=>(0,d.shouldSkipGenMsg)(e,n)))};var r}}function m(){return(m=(0,a.default)((function*(e,t){let n=[];if(t.actionType===d.GROUP_NOTIFICATION_TAG.ADD){const r=yield(0,d.notAlreadyInGroup)(e.chatId,t.participants);r.length>0&&(n=[(0,c.genGroupNotificationMsg)(e,(0,i.default)((0,i.default)({},t),{},{participants:r}))])}else t.actionType!==d.GROUP_NOTIFICATION_TAG.CREATE&&(n=[(0,c.genGroupNotificationMsg)(e,t)]);return n}))).apply(this,arguments)}},99562:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.SUPPORTED_DIRTY_TYPE=t.SUPPORTED_DIRTY_PROTOCOLS=void 0,t.handleDirtyBits=function(){return v.apply(this,arguments)};var i=r(n(348926)),a=n(279385),o=n(155172),s=n(696155),l=n(277330),u=n(273500),c=n(780549),d=r(n(797137)),p=n(280464),_=n(359484),f=n(331285),h=n(459857),g=r(n(571834));const m={groups:"groups",account_sync:"account_sync",syncd_app_state:"syncd_app_state"};t.SUPPORTED_DIRTY_TYPE=m;function y(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.map((e=>s.ACCOUNT_SYNC_TYPE.cast(e))).filter(Boolean);return 0===t.length&&(t=Array.from(s.ACCOUNT_SYNC_TYPE.members())),Promise.all(t.map((e=>e===s.ACCOUNT_SYNC_TYPE.DEVICES?T():e===s.ACCOUNT_SYNC_TYPE.PICTURE?(0,s.getAndUpdateProfilePicture)():void(e===s.ACCOUNT_SYNC_TYPE.PRIVACY?(0,s.updatePrivacySettings)():e===s.ACCOUNT_SYNC_TYPE.BLOCKLIST&&(0,s.updateBlocklist)()))))}function E(e){return null!=e.patches&&e.patches.length>0||null!=e.snapshot}function S(){return c.Cmd.once(c.APP_STATE_SYNC_COMPLETED,(e=>{const t=e.some(E);new g.default.MdAppStateDirtyBits({dirtyBitsFalsePositive:!t}).commit()})),(0,a.markCollectionsForSync)(Array.from(o.CollectionName.members()))}function T(){const e=String((0,h.getMeUser)());return _.OfflineMessageHandler.isResumeFromRestartComplete()?_.OfflineMessageHandler.isResumeOnSocketDisconnectInProgress()?(0,l.addUserToPendingDeviceSync)([e]):(0,s.getDevices)("notification"):(p.OfflinePendingDeviceCache.addOfflinePendingDevice(e,null),Promise.resolve())}function v(){return(v=(0,i.default)((function*(e){const{supported:t,unsupported:n,protocols:r}=e;__LOG__(2)`handleDirtyBits: handle dirty bits, supported: ${t.map((e=>e.type)).join(",")}, unsupported: ${n.map((e=>e.type)).join(",")}`;const i=[...n,...t];return yield Promise.all(t.map((e=>{const t=e.type;return t===m.groups?(0,d.default)().then((()=>(0,f.queryAndUpdateAllGroupMetadata)())):t===m.account_sync?y(r):t===m.syncd_app_state?S():void 0}))),(0,u.clearDirtyBits)(i)}))).apply(this,arguments)}t.SUPPORTED_DIRTY_PROTOCOLS={devices:"devices",picture:"picture",privacy:"privacy",blocklist:"blocklist"}},312930:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return f.apply(this,arguments)};var i=r(n(348926)),a=n(769707),o=n(287461),s=n(99562),l=n(162574),u=n(15790),c=n(828104),d=n(359484),p=n(87429);const _=new a.WapParser("infoBulletinParser",(e=>{if(e.assertTag("ib"),e.assertFromServer(),e.hasChild(l.INFO_TYPE.DIRTY)){const t=[],n=[],r=[];return e.forEachChildWithTag(l.INFO_TYPE.DIRTY,(e=>{const i={type:e.attrString("type"),timestamp:e.attrInt("timestamp")};if("account_sync"===i.type){e.mapChildren((e=>e.tag())).forEach((e=>{s.SUPPORTED_DIRTY_PROTOCOLS.hasOwnProperty(e)&&r.push(e)})),n.push(i)}else s.SUPPORTED_DIRTY_TYPE.hasOwnProperty(i.type)?n.push(i):t.push(i)})),{type:l.INFO_TYPE.DIRTY,supported:n,unsupported:t,protocols:r}}if(e.hasChild(l.INFO_TYPE.ROUTING)){const t=e.child(l.INFO_TYPE.ROUTING);return{type:l.INFO_TYPE.ROUTING,edgeRouting:t.child("routing_info").contentBytes(),domain:t.hasChild("dns_domain")?t.child("dns_domain").contentEnum(u.DOMAINS):null}}if(e.hasChild(l.INFO_TYPE.OFFLINE))return{count:e.child(l.INFO_TYPE.OFFLINE).attrInt("count"),type:l.INFO_TYPE.OFFLINE};if(e.hasChild(l.INFO_TYPE.OFFLINE_PREVIEW))return{count:{message:e.child(l.INFO_TYPE.OFFLINE_PREVIEW).attrInt("message"),receipt:e.child(l.INFO_TYPE.OFFLINE_PREVIEW).attrInt("receipt"),notification:e.child(l.INFO_TYPE.OFFLINE_PREVIEW).attrInt("notification")},type:l.INFO_TYPE.OFFLINE_PREVIEW};if(e.hasChild(l.INFO_TYPE.TOS)){const t=[];return e.child("tos").forEachChildWithTag("notice",(e=>{t.push(e.attrString("id"))})),{type:l.INFO_TYPE.TOS,noticeIds:t}}if(e.hasChild(l.INFO_TYPE.THREAD_META)){const t=e.child(l.INFO_TYPE.THREAD_META),n={};return t.forEachChildWithTag("item",(e=>{const t=e.attrChatJid("from"),r=e.attrTime("t");n[String(t)]=r})),{type:l.INFO_TYPE.THREAD_META,threadMeta:n}}return null}));function f(){return(f=(0,i.default)((function*(e){const t=_.parse(e);if(t.error)throw __LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,t.error;const n=t.success;if(n)switch(n.type){case l.INFO_TYPE.DIRTY:return yield(0,s.handleDirtyBits)(n),"NO_ACK";case l.INFO_TYPE.ROUTING:return yield(0,u.handleRoutingInfo)(n),"NO_ACK";case l.INFO_TYPE.OFFLINE:return d.OfflineMessageHandler.setOfflineSessionComplete(n.count),(0,c.reportOfflineNotifications)(),"NO_ACK";case l.INFO_TYPE.OFFLINE_PREVIEW:return yield d.OfflineMessageHandler.setOfflineMessagePreviewCounter(n.count),"NO_ACK";case l.INFO_TYPE.TOS:return p.TosManager.maybeUpdateServer(n.noticeIds),"NO_ACK";case l.INFO_TYPE.THREAD_META:return(0,o.getABPropConfigValue)("offline_thread_meta_enabled")&&d.OfflineMessageHandler.setOfflineThreadMeta(n.threadMeta),"NO_ACK"}else __LOG__(3)`handleInfoBulletin unrecognized info bulletin`}))).apply(this,arguments)}},162574:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.INFO_TYPE=void 0;const n=Object.freeze({DIRTY:"dirty",ROUTING:"edge_routing",OFFLINE:"offline",OFFLINE_PREVIEW:"offline_preview",TOS:"tos",THREAD_META:"thread_metadata"});t.INFO_TYPE=n},15790:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DOMAINS=void 0,t.handleRoutingInfo=function(){return l.apply(this,arguments)};var i=r(n(348926)),a=n(710038),o=n(673168);const s={fb:"fb",sl:"sl"};function l(){return(l=(0,i.default)((function*(e){let t=e.domain;if(!t){const e=yield(0,o.getRoutingInfo)();t=e?e.domain:s.fb}const n=(0,a.bytesToBuffer)(e.edgeRouting);yield(0,o.setRoutingInfo)({domain:t,edgeRouting:n}),__LOG__(2)`handleInfoBulletin setting and domain: ${t} and edgeRouting:`}))).apply(this,arguments)}t.DOMAINS=s},299689:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=l.incomingMsgParser.parse(e);if(t.error){const n=l.incomingMsgParserForAckOnly.parse(e);if(n.error)return Promise.reject(t.error);const{externalId:r,from:i,type:a,participant:o}=n.success;return(0,c.sendAck)(r,i,a,o)}const n=t.success,{msgMeta:r,msgInfo:m}=n;m.clientReceivedTsMillis=(0,a.unixTimeMs)(),null!=m.offline&&(h.OfflineMessageHandler.addOfflinePendingMessage(),h.OfflineMessageHandler.offlineStanzaReceivedAfterCompelete());h.OfflineMessageHandler.isResumeFromRestartComplete()&&delete n.msgInfo.offline;return(0,p.handleMessage)(m.chat.toString(),!!n.msgInfo.offline,(0,i.default)((function*(){if(m.msgProcessStartTsMillis=(0,a.unixTimeMs)(),r.isUnavailable)return __LOG__(2,void 0,void 0,void 0,["messaging"])`handleMessage: msgId::${m.externalId}, get fanout placeholder`,yield g.processPlaceholderMsg(m,d.PlaceholderType.FANOUT),void(0,u.sendReceipt)(m,r,{result:d.E2EProcessResult.BACKFILL});__LOG__(2,void 0,void 0,void 0,["messaging"])`handleMessage: msgId::${m.externalId}, start processing message, offline: ${!!m.offline}`;const e=yield(0,f.decryptE2EPayload)(n);null!=m.offline?(h.OfflineMessageHandler.processMessageDecryptResult(e.result),e.result!==d.E2EProcessResult.SUCCESS||m.category===s.CATEGORY_PEER?(0,u.sendReceipt)(m,r,e):(0,o.getMessageCache)().addMessages([{receiptInfo:{externalId:m.externalId,from:(0,_.getFrom)(m),author:m.author}}],!1)):(0,u.sendReceipt)(m,r,e)})))};var i=r(n(348926)),a=n(990445),o=n(800321),s=n(883310),l=n(467302),u=n(852694),c=n(422302),d=n(257845),p=n(412985),_=n(267420),f=n(881077),h=n(359484),g=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=m(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(143130));function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(m=function(e){return e?n:t})(e)}},883310:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.STANZA_MSG_TYPES=t.POLL_TYPES=t.PAY_NODE_TYPES=t.MSG_VERIFIED_LEVEL=t.HsmMismatchError=t.CATEGORY_PEER=void 0;var r=n(643930);t.STANZA_MSG_TYPES={text:"text",media:"media",pay:"pay",poll:"poll",reaction:"reaction"};t.POLL_TYPES={creation:"creation",vote:"vote"};t.MSG_VERIFIED_LEVEL={high:"high",low:"low",unknown:"unknown"};t.CATEGORY_PEER="peer";class i extends((0,r.customError)("HSMMismatchError")){}t.HsmMismatchError=i;t.PAY_NODE_TYPES={send:"send",request:"request",futureproof:"futureproof","request-decline":"request-decline","request-cancel":"request-cancel",invite:"invite"}},177205:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.UnknownMessageError=t.ReactionValidationError=t.PollVoteValidationErrorCode=t.PollVoteValidationError=t.PollUpdateValidationErrorCode=t.PollUpdateValidationError=t.PollCreationValidationWarningCode=t.PollCreationValidationErrorCode=t.PollCreationValidationError=t.EncReactionDisabledValidationError=t.DeviceSentMessageError=t.BizNodeValidationError=void 0;var i=n(643930),a=r(n(571834));class o extends((0,i.customError)("DeviceSentMessageError")){constructor(e,t){t===a.default.DSM_ERROR.MISSING_DSM?super("parseMessage: message should be deviceSentMessage"):t===a.default.DSM_ERROR.INVALID_SENDER?super("parseMessage: message should not be deviceSentMessage"):t===a.default.DSM_ERROR.INVALID_DSM?super("parseMessage: invalid deviceSentMessage"):super("parseMessage: unknown deviceSentMessage error"),new a.default.MdBadDeviceSentMessage({peerType:e,dsmError:t}).commit(),this.peerType=e,this.dsmError=t}}t.DeviceSentMessageError=o;class s extends((0,i.customError)("UnknownMessageError")){}t.UnknownMessageError=s;class l extends((0,i.customError)("ReactionValidationError")){}t.ReactionValidationError=l;class u extends((0,i.customError)("EncReactionDisabledValidationError")){}t.EncReactionDisabledValidationError=u;class c extends((0,i.customError)("BizNodeValidationError")){}t.BizNodeValidationError=c;const d=n(76672)({DUPLICATE_OPTIONS:"poll_creation_duplicate_options"});t.PollCreationValidationWarningCode=d;const p=n(76672)({INVALID_MESSAGE_SECRET:"poll_creation_invalid_message_secret",INVALID_NAME:"poll_creation_invalid_name",INVALID_OPTIONS_COUNT:"poll_creation_invalid_options_count",INVALID_OPTION:"poll_creation_invalid_option",INVALID_SELECTABLE_OPTIONS_COUNT:"poll_creation_invalid_selectable_options_count",MISSING_MESSAGE_SECRET:"poll_creation_missing_message_secret",MISSING_NAME:"poll_creation_missing_name",MISSING_OPTIONS:"poll_creation_missing_options",MISSING_SELECTABLE_OPTIONS_COUNT:"poll_creation_missing_selectable_options_count"});t.PollCreationValidationErrorCode=p;class _ extends((0,i.customError)("PollCreationValidationError")){constructor(e){super(e),this.code=e}}t.PollCreationValidationError=_;const f=n(76672)({MESSAGE_STANZA_INVALID:"poll_update_message_stanza_invalid",INVALID_VOTE_ENC_IV:"poll_update_invalid_vote_enc_iv",MISSING_POLL_MESSAGE_KEY:"poll_update_missing_poll_message_key",MISSING_SENDER_TIMESTAMP:"poll_update_missing_sender_timestamp",MISSING_UPDATE:"poll_update_missing_update",MISSING_VOTE_ENC_IV:"poll_update_missing_vote_enc_iv",MISSING_VOTE_ENC_PAYLOAD:"poll_update_missing_vote_enc_payload",INVALID_RENDERABLE_MSG_COUNT:"invalid_renderable_msg_count"});t.PollUpdateValidationErrorCode=f;class h extends((0,i.customError)("PollUpdateValidationError")){constructor(e){super(e),this.code=e}}t.PollUpdateValidationError=h;const g=n(76672)({INVALID_MESSAGE_SECRET:"poll_vote_invalid_message_secret",INVALID_OPTION:"poll_vote_invalid_option",INVALID_OPTIONS_COUNT:"poll_vote_invalid_options_count",OPTION_NOT_FOUND:"poll_vote_option_not_found"});t.PollVoteValidationErrorCode=g;class m extends((0,i.customError)("PollVoteValidationError")){constructor(e){super(e),this.code=e}}t.PollVoteValidationError=m},467302:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.incomingMsgParserForAckOnly=t.incomingMsgParser=void 0;var i=r(n(81109)),a=n(769707),o=n(303754),s=n(883310),l=n(257845),u=n(346401),c=n(854379),d=n(11304),p=n(850788),_=n(968923),f=n(459857),h=n(669050);const g=new a.WapParser("incomingMsgParser",(e=>{e.assertTag("message"),e.hasAttr("to")&&e.assertAttr("to",(0,f.assertGetMe)().toJid());const t=e.mapChildrenWithTag("enc",(e=>({e2eType:e.attrEnumValues("type",o.CiphertextType.members()),mediaType:o.MediaType.cast(e.maybeAttrString("mediatype")),ciphertext:e.contentBytes(),retryCount:e.hasAttr("count")?e.attrInt("count"):0,hideFail:"hide"===e.maybeAttrString("decrypt-fail")}))),n=e.maybeChild("device-identity"),r=n?n.contentBytes():null,a=function(e,t){const n={externalId:e.attrString("id"),ts:e.attrTime("t"),edit:e.hasAttr("edit")?e.attrInt("edit"):-1,isHsm:e.hasChild("hsm"),count:e.hasAttr("count")?e.attrInt("count"):null,pushname:e.hasAttr("notify")?e.attrString("notify"):null,displayName:e.hasAttr("display_name")?e.attrString("display_name"):null,senderPn:e.hasAttr("sender_pn")?(0,c.userJidToUserWid)(e.attrUserJid("sender_pn")):null,recipientPn:e.hasAttr("recipient_pn")?(0,c.userJidToUserWid)(e.attrUserJid("recipient_pn")):null,category:e.hasAttr("category")?e.attrString("category"):null,offline:e.hasAttr("offline")?e.attrString("offline"):null},r=(0,c.jidWithTypeToWid)(e.attrJidWithType("from")),a=e.hasAttr("participant")?(0,c.deviceJidToDeviceWid)(e.attrDeviceJid("participant")):null,s=e.hasAttr("recipient")?(0,c.userJidToUserWid)(e.attrUserJid("recipient")):null,u=t.every((e=>e.e2eType!==o.CiphertextType.Skmsg)),d=t.some((e=>e.retryCount>0));let p;const _={},g=e.maybeChild("participants");if(g){const e=[];g.forEachChildWithTag("to",(t=>{const n=(0,c.deviceJidToDeviceWid)(t.attrDeviceJid("jid")),r=t.maybeAttrString("eph_setting");e.push(n),null!=r&&(_[n.toString()]=r)})),p=e}if(r.isUser())return null!=s?(0,f.isMeAccount)(r)?(0,i.default)((0,i.default)({type:l.MESSAGE_TYPE.CHAT},n),{},{chat:(0,h.toUserWid)(s),author:r}):e.throw("recipient on non peer chat message"):(0,i.default)((0,i.default)({type:l.MESSAGE_TYPE.CHAT},n),{},{chat:(0,h.toUserWid)(r),author:r});if(r.isGroup())return null==a?e.throw("group message with no participant"):(0,i.default)((0,i.default)({type:l.MESSAGE_TYPE.GROUP},n),{},{chat:r,author:a,isDirect:u});if(r.isBroadcast()&&!r.isStatusV3()){if(null==a)return e.throw("broadcast message with no participant");if((0,f.isMeAccount)(a)){if(null==p){if(!d)return e.throw("peer broadcast message with no participants node");p=[]}return(0,i.default)((0,i.default)({type:l.MESSAGE_TYPE.PEER_BROADCAST},n),{},{chat:r,author:a,isDirect:u,bclParticipants:p,bclHashValidated:!1,bclEphSettings:_})}return(0,i.default)((0,i.default)({type:l.MESSAGE_TYPE.OTHER_BROADCAST},n),{},{chat:r,author:a,isDirect:u,ephSetting:e.maybeAttrString("eph_setting")})}if(r.isBroadcast()&&r.isStatusV3())return null==a?e.throw("status message with no participant"):(0,f.isMeAccount)(a)&&u?null==p?(0,i.default)((0,i.default)({type:l.MESSAGE_TYPE.DIRECT_PEER_STATUS},n),{},{chat:r,author:a,isDirect:u}):(0,i.default)((0,i.default)({type:l.MESSAGE_TYPE.DIRECT_PEER_STATUS},n),{},{chat:r,author:a,bclParticipants:p,bclHashValidated:!1}):(0,i.default)((0,i.default)({type:l.MESSAGE_TYPE.OTHER_STATUS},n),{},{chat:r,author:a,isDirect:u});return e.throw("Unrecognized message type")}(e,t);return{encs:t,msgInfo:a,msgMeta:function(e,t){const n=e.hasChild("unavailable");n||0!==t.length||e.throw("incomingMsgParser: to have enc node children");const r=e.attrEnum("type",s.STANZA_MSG_TYPES),i=r===s.STANZA_MSG_TYPES.poll?e.child("meta").attrEnumOrNullIfUnknown("polltype",s.POLL_TYPES):null;return{isUnavailable:n,type:r,pollType:i,rawTs:e.attrString("t"),urlNumber:e.hasChild("url_number"),urlText:e.hasChild("url_text")}}(e,t),bizInfo:function(e){const t=e.hasChild("verified_name")?e.child("verified_name").contentBytes():null,n=e.attrEnumOrDefault("verified_level",s.MSG_VERIFIED_LEVEL,null),r=e.hasAttr("verified_name")?e.attrInt("verified_name"):-1,a=e.maybeChild("biz");let o=null;if(null!=a){const e=l.ActualActorsEnumType.cast(a.maybeAttrInt("actual_actors")),t=l.HostStorageEnumType.cast(a.maybeAttrInt("host_storage")),n=a.maybeAttrInt("privacy_mode_ts");null!=e&&null!=t&&null!=n&&(o={actualActors:e,hostStorage:t,privacyModeTs:n})}const u=null==a?void 0:a.maybeAttrString("native_flow_name");return(0,i.default)({verifiedNameCert:t,verifiedLevel:n,verifiedNameSerial:r,privacyMode:o,nativeFlowName:u},a&&{verifiedButtonsEnvelope:a.hasChild("buttons"),verifiedListEnvelope:a.hasChild("list"),verifiedHsmEnvelope:e.hasChild("hsm")})}(e),paymentInfo:function(e){let t=null;const n=e.hasChild("pay")?e.child("pay"):null,r=e.hasChild("transaction")?e.child("transaction"):null,i=(0,c.jidWithTypeToWid)(e.attrJidWithType("from")).isGroup(),a=e.hasAttr("participant")?(0,c.jidWithTypeToWid)(e.attrJidWithType("participant")):null;if((0,d.isNoviTransaction)(n)||(0,d.isNoviTransaction)(r))t={futureproofed:!0};else if(r){const e=(0,d.parseTransactionNode)(r);e&&(t=m(i,a,(0,h.createWid)(e.receiver.toString()))?{receiverJid:e.receiver.toString(),currency:e.currency,amount1000:e.amount1000,transactionTimestamp:e.ts,txnStatus:(0,p.getPaymentTxnWebStatus)(e.status)}:{receiverJid:e.receiver.toString(),currency:e.currency,amount1000:e.amount1000,transactionTimestamp:e.ts})}else if(n){switch(n.attrEnum("type",s.PAY_NODE_TYPES)){case s.PAY_NODE_TYPES.send:const{amount1000:r,currency:o}=(0,u.getAmount1000AndCurrency)(n),l=n.hasAttr("receiver")?n.attrString("receiver"):e.attrString("recipient");t=m(i,a,(0,h.createWid)(l))?{receiverJid:l,currency:o,amount1000:r,transactionTimestamp:e.attrInt("t"),txnStatus:_.PaymentInfo$TxnStatus.INIT}:{receiverJid:l,currency:o,amount1000:r,transactionTimestamp:e.attrInt("t")};break;case s.PAY_NODE_TYPES.request:case s.PAY_NODE_TYPES.invite:}}return t}(e),deviceIdentity:r}}));function m(e,t,n){if(e&&null!=t&&null!=n){const e=(0,f.getMeUser)();if(!e.equals(t)&&!e.equals(n))return!1}return!0}t.incomingMsgParser=g;const y=new a.WapParser("incomingMsgParserForAckOnly",(e=>(e.assertTag("message"),{externalId:e.attrString("id"),from:(0,c.jidWithTypeToWid)(e.attrJidWithType("from")),type:e.attrEnum("type",s.STANZA_MSG_TYPES),participant:e.hasAttr("participant")?(0,c.deviceJidToDeviceWid)(e.attrDeviceJid("participant")):null})));t.incomingMsgParserForAckOnly=y},143130:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.processDecryptedProto=function(){return D.apply(this,arguments)},t.processPlaceholderMsg=function(e,t){return m.processPlaceholderMessage(e,t)},t.processPollUpdateVoteMsg=F,t.processReactionEncMsg=G,t.processReactionMsg=B,t.processRenderableMsg=U;var i=r(n(348926)),a=n(620430),o=n(577721),s=n(359987),l=n(780549),u=n(800321),c=n(889877),d=n(177205),p=n(189865),_=n(257845),f=n(778650),h=n(789375),g=n(212369),m=L(n(593139)),y=n(74927),E=n(97858),S=(n(387191),n(267420)),T=n(373070),v=n(758771),A=n(671598),C=n(533494),P=L(n(138706)),O=n(117429),I=r(n(571834)),M=n(704630),b=n(104144),R=n(84461),N=n(309512);function w(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(w=function(e){return e?n:t})(e)}function L(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=w(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function D(){return(D=(0,i.default)((function*(e){const{decrypted:t,info:n,paymentInfo:r,e2eInfo:i,bizInfo:s,isPadded:l=!0,msgMeta:u,reparsing:m=!1}=e,E=l?(0,a.unpadPkcs7)(new Uint8Array(t)):new Uint8Array(t),A=(0,N.decodeProtobuf)(C.MessageSpec,E),R=(0,S.getFrom)(n);if(m){__LOG__(2,void 0,void 0,void 0,["messaging"])`Reparsing processDecryptedProto: msgId::${n.externalId}, message decrypted:`;const t=yield(0,S.parseMessage)({info:n,ciphertextType:i.e2eType,msgProtobuf:A,paymentInfo:r,bizInfo:s,hidePlaceholder:i.hideFail,processDecryptedProtoParams:e});if(null!=t.renderableMsgs){const e=t.renderableMsgs,[a]=e,l=(0,o.getAddOnProviderForMsg)(a),c=[T.MSG_TYPE.DOCUMENT,T.MSG_TYPE.POLL_CREATION];if(!l&&!c.includes(a.type))return Promise.resolve();(0,f.renderableMessagesValidation)({renderableMsgs:e,msgMeta:u,proto:A,bizInfo:s});const d=k({renderableMsgs:e,msgMeta:u,reparsing:m,proto:A,bizInfo:s,paymentInfo:r,e2eInfo:i,info:n});return yield Promise.all(d),void __LOG__(2,void 0,void 0,void 0,["messaging"])`Reparsed processDecryptedProto: msgId::${n.externalId}, message decrypted:`}__LOG__(4,void 0,new Error)`parsed render able msgs not reparsed as expected`}if(yield(0,p.preProcessMsg)(n,A),n.type===_.MESSAGE_TYPE.PEER_BROADCAST&&i.retryCount>0){const e=yield(0,y.getMsgByMsgKey)((0,S.messageInfoToKey)(n));null!=(null==e?void 0:e.broadcastParticipants)&&(n.bclParticipants=e.broadcastParticipants,null!=e.broadcastEphSettings&&(n.bclEphSettings=e.broadcastEphSettings))}const w=yield(0,S.parseMessage)({info:n,ciphertextType:i.e2eType,msgProtobuf:A,paymentInfo:r,bizInfo:s,hidePlaceholder:i.hideFail,processDecryptedProtoParams:e});if(w.history)(0,c.handleHistorySyncNotification)(w.history,R,n.externalId);else if(w.securityNotificationEnabled)(0,O.setGlobalSecurityNotifications)(w.securityNotificationEnabled.isEnabled);else if(w.appStateSyncKeyShare)(0,b.handleAppStateSyncKeyShare)(w.appStateSyncKeyShare,R);else if(w.appStateSyncKeyRequest)yield(0,M.handleAppStateSyncKeyRequest)(w.appStateSyncKeyRequest,R);else if(w.peerDataOperationRequestResponseMessage)(0,v.handlePeerDataOperationRequestResponse)(n.externalId,w.peerDataOperationRequestResponseMessage);else if(w.peerDataOperationRequestMessage)(0,v.handlePeerDataOperationRequest)(n.externalId,w.peerDataOperationRequestMessage);else{let e=!1;if(null==w.deviceSent?e=!0:w.deviceSent.phash?e=yield(0,f.validateBclHash)(w.deviceSent.phash,w.deviceSent.info):w.deviceSent.destination&&(e=yield(0,f.validateMsgDestination)(w.deviceSent.destination,n)),!e)throw new d.DeviceSentMessageError((0,S.getDeviceType)(n.author),I.default.DSM_ERROR.INVALID_DSM);const{renderableMsgs:t}=w;(0,f.renderableMessagesValidation)({renderableMsgs:t,msgMeta:u,proto:A,bizInfo:s});const a=k({renderableMsgs:t,msgMeta:u,reparsing:m,proto:A,bizInfo:s,paymentInfo:r,e2eInfo:i,info:n});null!=w.storeMsg&&(0,y.storeMessages)([w.storeMsg],w.storeMsg.id.remote),null!=w.senderKey&&a.push(P.Session.createGroupSignalSession(n.author,w.senderKey.groupId,w.senderKey.key)),n.pushname&&(0,h.updatePushname)(n.author,n.pushname,null!=n.offline),yield Promise.all(a),(0,g.logReceivedMessagesInWAM)(w.renderableMsgs,null!=n.offline,1e3*n.ts,n.clientReceivedTsMillis,n.msgProcessStartTsMillis)}}))).apply(this,arguments)}function k(e){var t,n,r,i,a,o,s;let{renderableMsgs:l,msgMeta:u,reparsing:c,proto:d,bizInfo:_,paymentInfo:f,e2eInfo:h,info:g}=e;const m=[];if((null===(t=l[0])||void 0===t?void 0:t.type)===T.MSG_TYPE.REACTION)m.push(B(l[0],g,c));else if((0,E.cagReactionsReceive)()&&(null===(n=l[0])||void 0===n?void 0:n.type)===T.MSG_TYPE.REACTION_ENC)m.push(G(l[0],g,c));else if((0,A.isPollVoteProcessingEnabled)()&&(null===(r=l[0])||void 0===r?void 0:r.type)===T.MSG_TYPE.POLL_UPDATE&&"poll_vote"===(null===(i=l[0])||void 0===i?void 0:i.subtype))m.push(F(l[0],g,c));else if((0,R.isKeepInChatReadAndUIEnabled)()&&(null===(a=l[0])||void 0===a?void 0:a.type)===T.MSG_TYPE.KEEP_IN_CHAT)m.push((0,p.processKeepInChatMsg)(l[0],g,c));else if((0,E.receiveMessageEditEnabled)()&&(null===(o=l[0])||void 0===o?void 0:o.type)===T.MSG_TYPE.PROTOCOL&&"message_edit"===(null===(s=l[0])||void 0===s?void 0:s.subtype))m.push((0,p.processEditProtocolMsg)(l[0],g,c));else if(l.length>0){let e=h.retryCount>0&&(0,S.placeholderCheck)(g);c&&(e=!0),m.push(U(l,g,f,_,e,c))}return m}function U(e,t,n,r,i,a){return m.processRenderableMessages(e,t,n,r,i,a)}function G(){return x.apply(this,arguments)}function x(){return(x=(0,i.default)((function*(e,t,n){return yield(0,p.convertEncReactionToReaction)(e,t),B(e,t,n)}))).apply(this,arguments)}function B(e,t,n){return m.processReactionMessage(e,t,n)}function F(){return j.apply(this,arguments)}function j(){return(j=(0,i.default)((function*(e,t,n){const r=null!=t.offline&&!n,i=(0,u.getMessageCache)().addMessages([{msg:e,receiptInfo:{from:e.from,author:t.author}}],!r);if(!l.Cmd.isMainStreamReadyMd&&!n)return;const a=l.Cmd.isOfflineDeliveryEnd||n?yield i:null,o=(null==a?void 0:a.pollUpdateMsgsResult)?Array.from(a.pollUpdateMsgsResult.values()):[];(0,s.frontendFireAndForget)("upsertVotesModelCollection",{votes:o,restoredFromDb:!1})}))).apply(this,arguments)}},852694:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendReceipt=function(e,t,n){const{externalId:_}=e,{rawTs:f,type:h}=t,g=(0,l.getFrom)(e),m=e.type===s.MESSAGE_TYPE.CHAT&&(0,p.isMeAccount)(e.author)?e.chat:null,y=e.type===s.MESSAGE_TYPE.CHAT?null:e.author,E=e.category===o.CATEGORY_PEER;switch(n.result){case s.E2EProcessResult.SUCCESS:return(0,c.sendDeliveryReceiptsAfterDecryption)(_,g,m,y,E,h);case s.E2EProcessResult.HSM_MISMATCH:return Promise.resolve();case s.E2EProcessResult.RETRY:const o=null==n.retryCount?1:n.retryCount+1,l=(0,d.sendRetryReceipt)(o,g,y,m,_,f,E);return(0,u.maybePostMessageHighRetryCountMetric)(o,e),l;default:return Promise.resolve((0,r.deprecatedCastStanza)((0,i.wap)("ack",{id:(0,i.CUSTOM_STRING)(_),class:"message",from:(0,a.DEVICE_JID)((0,p.assertGetMe)()),to:g?(0,a.JID)(g):i.DROP_ATTR,type:t.type,participant:y?(0,a.DEVICE_JID)(y):i.DROP_ATTR})))}};var r=n(911794),i=n(738102),a=n(355813),o=n(883310),s=n(257845),l=n(267420),u=n(967762),c=n(124240),d=n(525773),p=n(459857)},422302:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendAck=function(e,t,n,s){return Promise.resolve((0,r.deprecatedCastStanza)((0,i.wap)("ack",{id:(0,i.CUSTOM_STRING)(e),class:"message",from:(0,a.DEVICE_JID)((0,o.assertGetMe)()),to:t?(0,a.JID)(t):i.DROP_ATTR,participant:s?(0,a.DEVICE_JID)(s):i.DROP_ATTR,type:n})))};var r=n(911794),i=n(738102),a=n(355813),o=n(459857)},257845:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PlaceholderType=t.MESSAGE_TYPE=t.HostStorageEnumType=t.E2EProcessResult=t.ActualActorsEnumType=void 0;const r=n(76672)({Self:1,Bsp:2});t.ActualActorsEnumType=r;const i=n(76672)({OnPremise:1,Facebook:2});t.HostStorageEnumType=i;const a=n(76672).Mirrored(["SUCCESS","RETRY","HSM_MISMATCH","BACKFILL","PARSE_ERROR","PARSE_VALIDATION_ERROR"]);t.E2EProcessResult=a;const o=n(76672).Mirrored(["E2E","FANOUT"]);t.PlaceholderType=o;const s=Object.freeze({CHAT:"chat",GROUP:"group",PEER_BROADCAST:"peer_broadcast",OTHER_BROADCAST:"other_broadcast",DIRECT_PEER_STATUS:"direct_peer_status",OTHER_STATUS:"other_status"});t.MESSAGE_TYPE=s},778650:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.isFromKnownDevice=function(){return f.apply(this,arguments)},t.renderableMessagesValidation=function(e){let{renderableMsgs:t,msgMeta:n,proto:r,bizInfo:i}=e;if(t.length>0&&!h(r,i))throw new l.BizNodeValidationError("[messaging] Biz node vailidation failed due to absence of biz node in SMAX");if((null==n?void 0:n.type)===s.STANZA_MSG_TYPES.reaction&&t.length>0){if(1!==t.length)throw new l.ReactionValidationError("[messaging] Reaction failed validation due to renderableMsgs being more than 1");if(t[0].type!==u.MSG_TYPE.REACTION&&t[0].type!==u.MSG_TYPE.REACTION_ENC)throw new l.ReactionValidationError("[messaging] Reaction failed validation due to missing ReactionMessage in proto")}if((null==n?void 0:n.type)===s.STANZA_MSG_TYPES.poll&&(null==n?void 0:n.pollType)===s.POLL_TYPES.vote){if(t.length>1)throw new l.PollUpdateValidationError(l.PollUpdateValidationErrorCode.INVALID_RENDERABLE_MSG_COUNT);const[e]=t;if(null!=e){const t=e.type===u.MSG_TYPE.UNKNOWN&&e.subtype===u.MSG_TYPE.POLL_UPDATE,n=e.type===u.MSG_TYPE.POLL_UPDATE&&"poll_vote"===e.subtype;if(!t&&!n)throw new l.PollUpdateValidationError(l.PollUpdateValidationErrorCode.MESSAGE_STANZA_INVALID)}}},t.validateBclHash=function(){return _.apply(this,arguments)},t.validateBizNode=h,t.validateMsgDestination=function(){return p.apply(this,arguments)};var i=r(n(348926)),a=n(616310),o=n(866729),s=n(883310),l=n(177205),u=n(373070),c=n(848624),d=n(459857);function p(){return(p=(0,i.default)((function*(e,t){var n;const r=t.chat;if(!e.equals(r))return __LOG__(4,void 0,new Error,!0)`encDestination: ${String(e)}, destination: ${r.toString()}`,SEND_LOGS("validateMsgDestination: drop due to the deviceSentMessage meta mismatch."),!1;const i=t.author;if(!(0,d.isMeAccount)(i))return __LOG__(4,void 0,new Error,!0)`sender: ${i.toString()}`,SEND_LOGS("validateMsgDestination: drop due to msg is not sent from your own device."),!1;const a=yield(0,o.hasDevice)(i,null!==(n=i.device)&&void 0!==n?n:0);return a||(__LOG__(4,void 0,new Error,!0)`no record found for sender: ${i.toString()}`,SEND_LOGS("validateMsgDestination:drop due to invalid device")),a}))).apply(this,arguments)}function _(){return(_=(0,i.default)((function*(e,t){var n;const r=null!==(n=t.bclParticipants)&&void 0!==n?n:[],i=yield(0,c.phashV2)(r);return i!==e?(__LOG__(4,void 0,new Error,!0)`expected: ${e}, got: ${i}`,SEND_LOGS("validateBclHash: drop due to invalid hash."),!1):(t.bclHashValidated=!0,!0)}))).apply(this,arguments)}function f(){return(f=(0,i.default)((function*(e){const t=null==e.device?a.DEFAULT_DEVICE_ID:e.device;if(t===a.DEFAULT_DEVICE_ID)return!0;const[n]=yield(0,o.getDeviceIds)([e]);return null!=n&&n.devices.includes(t)}))).apply(this,arguments)}function h(e,t){const{listMessage:n,buttonsMessage:r,highlyStructuredMessage:i}=e;if(n&&!0!==(null==t?void 0:t.verifiedListEnvelope))return __LOG__(4,void 0,new Error,!0)`no biz node found in list message`,SEND_LOGS("validateBizNode:drop due to missing biz node in invalid SMAX in list message"),!1;if(r){var a,o;const e=!0===(null==t?void 0:t.verifiedButtonsEnvelope)||null!=(null==t?void 0:t.nativeFlowName)||!0===(null===(a=r.contextInfo)||void 0===a?void 0:a.isForwarded)&&0===(null==r||null===(o=r.buttons)||void 0===o?void 0:o.length);return e||(__LOG__(4,void 0,new Error,!0)`button message is invalid`,SEND_LOGS("validateBizNode:drop due to invalid SMAX for buttons message")),e}return!i||!0===(null==t?void 0:t.verifiedHsmEnvelope)||(__LOG__(4,void 0,new Error,!0)`no biz node found in HSM`,SEND_LOGS("validateBizNode:drop due to missing biz node in invalid SMAX in HSM"),!1)}},212369:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.logReceivedMessagesInWAM=function(e,t,n,r,m){(function(e,t,n,r,o){const s=(0,p.getMaybeMeUser)(),c=(0,a.unixTimeMs)();Promise.all(e.map(function(){var e=(0,i.default)((function*(e){const i=new l.Msg(e),a=i.from,d=new h.default.MessageReceive({messageType:i.getWamMessageType(),messageMediaType:i.getWamMediaType(),messageIsInternational:i.isInternational,messageIsOffline:t,isViewOnce:Boolean(i.isViewOnce),isForwardedForward:Boolean(i.numTimesForwarded>1),isAReply:(0,u.isReplyMsg)(i)});if(!a.isGroup()){const e=(0,g.getDisappearingModeSettingForUser)(a);null!=e&&(d.senderDefaultDisappearingDuration=e.duration);const t=(0,g.getDisappearingModeSettingForUser)(s);null!=t&&(d.receiverDefaultDisappearingDuration=t.duration)}i.isRevoke&&(d.revokeType="admin_revoke"===i.subtype?h.default.REVOKE_TYPE.ADMIN:h.default.REVOKE_TYPE.SENDER),null!=r&&(d.messageReceiveT0=r-n,d.messageReceiveT1=c-r,null!=o&&(d.messageQueueTime=o-r)),null!=i.ephemeralDuration&&i.ephemeralDuration>0&&(d.ephemeralityDuration=i.ephemeralDuration);const p=i.getWamDisappearingModeInitiator();null!=p&&(d.disappearingChatInitiator=p);const m=(0,_.getGroupTypeFromChatWid)(a);if(null!=m&&(d.typeOfGroup=m),null==a?void 0:a.isGroup()){const e=(0,_.isCagIncognitoFromChatWid)(a),t=i.isReaction();null!=e&&null!=t&&(d.isLid=e&&t);const n=yield(0,f.getGroupMetrics)(a);null!=(null==n?void 0:n.participantCount)&&(d.participantCount=n.participantCount),null!=(null==n?void 0:n.deviceCount)&&(d.deviceCount=n.deviceCount),null!=(null==n?void 0:n.deviceSizeBucket)&&(d.deviceSizeBucket=n.deviceSizeBucket)}else d.isLid=a.isLid();d.commit()}));return function(){return e.apply(this,arguments)}}()))})(e,t,n,r,m),function(e){for(const t of e){const e=new l.Msg(t);e.chat&&!e.isSentByMe&&((0,c.shouldBlockByCountry)(e.chat.contact)?new h.default.GatedMessageReceived({chatGatedReason:h.default.CHAT_GATED_REASON.COUNTRY}).commit():(0,d.shouldBlockByTos)(e.chat.contact)&&new h.default.GatedMessageReceived({chatGatedReason:h.default.CHAT_GATED_REASON.TOS3}).commit())}}(e),function(e){(0,o.handleActivitiesForChatThreadLogging)(e.filter(s.shouldIncrementMsgSendAndReceive).map((e=>{const t=new l.Msg(e);return{activityType:t.id.fromMe?"msgSend":"msgReceive",ts:t.t,chatId:t.id.remote,isViewOnce:t.isViewOnce,isReaction:t.isReaction(),isForwarded:t.isForwarded,isCommerceMessage:(0,s.isCommerceMessage)(t),isReply:(0,u.isReplyMsg)(t)}})))}(e)};var i=r(n(348926)),a=n(990445),o=n(698867),s=n(257147),l=n(387191),u=n(973480),c=n(168661),d=n(227834),p=n(459857),_=n(313556),f=n(440401),h=r(n(571834)),g=n(298592)},758771:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handlePeerDataOperationRequest=function(e,t){if(null==t.peerDataOperationRequestType)return;switch(t.peerDataOperationRequestType){case l.Message$PeerDataOperationRequestType.UPLOAD_STICKER:return void(0,o.handleUploadStickerPeerDataOperationRequest)(e,t.requestStickerReupload)}},t.handlePeerDataOperationRequestResponse=function(e,t){if(null==t.peerDataOperationRequestType)return;switch(t.peerDataOperationRequestType){case l.Message$PeerDataOperationRequestType.UPLOAD_STICKER:return void(0,o.handleUploadStickerPeerDataOperationRequestResponse)(e,t.peerDataOperationResult);case l.Message$PeerDataOperationRequestType.GENERATE_LINK_PREVIEW:return void(0,a.handleGenerateLinkPreviewOperationRequestResponse)(t)}},t.logMediaUpload=function(e,t,n,r,a,o,c){if(!(0,i.getABPropConfigValue)("non_message_data_request_logging_enabled")||e!==l.Message$PeerDataOperationRequestType.UPLOAD_STICKER)return;const d=(0,s.convertRequestTypeEnumForLogging)(e);new u.default.NonMessagePeerDataMediaUpload({peerDataRequestCount:n,peerDataSuccessUploadCount:r,peerDataExistingDataNoUploadCount:a,peerDataErrorCount:o,peerDataNotFoundCount:c,peerDataRequestType:d,peerDataRequestSessionId:t}).commit()},t.logNonMessagePeerDataResponse=function(e,t,n,r,a,o,l){if(!(0,i.getABPropConfigValue)("non_message_data_request_logging_enabled"))return;const c=(0,s.convertRequestTypeEnumForLogging)(e);new u.default.NonMessagePeerDataOperationResponse({peerDataResponseCount:n,peerDataSuccessResponseCount:r,peerDataSuccessProcessCount:a,peerDataErrorCount:o,peerDataNotFoundCount:l,peerDataRequestType:c,peerDataRequestSessionId:t}).commit()};var i=n(287461),a=n(495751),o=n(142202),s=n(734173),l=n(533494),u=r(n(571834))},495751:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleGenerateLinkPreviewOperationRequestResponse=function(e){var t;if((0,a.logLinkPreviewResponse)(e.stanzaId,(null===(t=e.peerDataOperationResult[0])||void 0===t?void 0:t.mediaUploadResult)===i.MediaRetryNotification$ResultType.SUCCESS),null!=e.stanzaId){const t=e.stanzaId;if(o.has(t)){const n=o.get(t);o.delete(t),null==n||n.resolve(e.peerDataOperationResult[0])}}},t.registerLinkPreviewHandlerHook=function(e){const t=new r.Resolvable;return o.set(e,t),t};var r=n(827653),i=n(229479),a=n(105461);const o=new Map},189865:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.convertEncReactionToReaction=function(){return R.apply(this,arguments)},t.preProcessMsg=function(){return b.apply(this,arguments)},t.processEditProtocolMsg=function(){return w.apply(this,arguments)},t.processKeepInChatMsg=function(){return N.apply(this,arguments)},t.storePollVotesBulk=function(){return L.apply(this,arguments)},t.storeReactionMsgBulk=function(){return G.apply(this,arguments)};var i=r(n(348926)),a=n(478337),o=n(822246),s=n(484777),l=n(359987),u=n(147980),c=n(52045),d=n(410322),p=n(523930),_=n(800321),f=n(883310),h=n(177205),g=n(778650),m=n(833476),y=n(928563),E=n(97858),S=n(373070),T=n(280464),v=n(671598),A=n(479261),C=n(403385),P=n(976030),O=n(696859),I=n(510607),M=n(669050);function b(){return(b=(0,i.default)((function*(e,t){if(null==e.offline&&__LOG__(2,void 0,void 0,void 0,["messaging"])`processDecryptedProto: msgId::${e.externalId}, message decrypted: `,!e.isHsm&&t.highlyStructuredMessage)throw new f.HsmMismatchError;if(!(yield(0,g.isFromKnownDevice)(e.author))){const t=(0,M.toUserWid)(e.author);throw null==e.offline?(0,I.syncDeviceListJob)([t],null,null):T.OfflinePendingDeviceCache.addOfflinePendingDevice(String(t),null),new h.UnknownMessageError(`[messaging] msgId::${e.externalId}, processDecryptedProto: reject message from unknown device`)}t.messageContextInfo&&(0,m.handleICDCData)(e.author,e.chat.isUser()?e.chat:null,t.messageContextInfo)}))).apply(this,arguments)}function R(){return(R=(0,i.default)((function*(e){const{encReactionTargetMessageKey:t,encReactionEncIv:n,encReactionEncPayload:r}=e;if(null==t||null==n||null==r)throw new Error("[messaging] convertEncReactionToReaction - invalid reaction");const i=yield(0,s.getMsgByMsgKey)(t),o=e.author?e.author:e.id.participant;if(null==o)throw new Error("[messaging] convertEncReactionToReaction - reactionSender can't be null");if(null==(null==i?void 0:i.messageSecret))throw new Error("[messaging] convertEncReactionToReaction - messageSecret can't be null");const l={encryptedReaction:r,messageSecret:i.messageSecret,iv:n,stanzaId:i.id.id,originalMessageSender:(0,u.getOriginalSender)(i),reactionSender:(0,M.toUserWid)(o)},c=yield(0,P.parseEncReaction)(l),d=(0,p.convertToTextWithoutSpecialEmojis)(c.text);null!=d&&(e.reactionText=d),null!=c.senderTimestampMs&&(e.reactionTimestamp=(0,a.numberOrThrowIfTooLarge)(c.senderTimestampMs)),e.reactionParentKey=e.encReactionTargetMessageKey,e.type=S.MSG_TYPE.REACTION,delete e.encReactionEncPayload,delete e.encReactionTargetMessageKey,delete e.encReactionEncIv}))).apply(this,arguments)}function N(){return(N=(0,i.default)((function*(e,t,n){if(null!=t.offline&&!n){const n={msg:e,receiptInfo:{from:e.from,author:t.author}};(0,_.getMessageCache)().addMessages([n],!1)}else yield(0,l.frontendSendAndReceive)("processKeepInChatMessage",{keepInChatMessage:e,allowNotification:!0})}))).apply(this,arguments)}function w(){return(w=(0,i.default)((function*(e,t,n){if(null!=t.offline&&!n){const n={msg:e,receiptInfo:{from:e.from,author:t.author}};(0,_.getMessageCache)().addMessages([n],!1)}else yield(0,c.processEditProtocolMsgs)([e])}))).apply(this,arguments)}function L(){return(L=(0,i.default)((function*(e){(0,l.frontendFireAndForget)("upsertVotesModelCollection",{votes:e,restoredFromDb:!0}),yield(0,A.upsertVotes)(e),(0,v.isPollsChatlistPreviewEnabled)()&&(yield D(e.map((e=>(0,y.lastAddOnPreviewCandidateFromVoteData)(e,!1)))))}))).apply(this,arguments)}function D(){return k.apply(this,arguments)}function k(){return(k=(0,i.default)((function*(e){const t=yield(0,O.filterChatsWithAddOnPreviewUpdates)(e);t.size>0&&(yield(0,d.updateDatabaseForLastAddOnPreview)(t),(0,l.frontendFireAndForget)("updateChatLastAddOnPreview",{chatMap:t}))}))).apply(this,arguments)}function U(e){let{id:t,reactionTimestamp:n,reactionText:r,reactionParentKey:i,sender:a,unread:o}=e;const s=(0,M.toUserWid)(a);return{msgKey:t.toString(),parentMsgKey:i.toString(),senderUserJid:s.toString(),reactionText:null!=r?r:C.REVOKED_REACTION_TEXT,timestamp:n,orphan:0,read:!o}}function G(){return(G=(0,i.default)((function*(e){const t=e.map((e=>U(e)));t.map((e=>`${e.msgKey.toString()} to ${e.parentMsgKey}`)).toString();const n=yield(0,o.createOrUpdateReactions)(t);return n&&(0,E.showReactionChatListPreview)()&&(yield D(n.map((e=>(0,y.lastAddOnPreviewCandidateFromReactionRowType)(e))))),n}))).apply(this,arguments)}},696859:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.bulkGetChatLastAddOnPreviewMap=d,t.filterChatsWithAddOnPreviewUpdates=function(){return h.apply(this,arguments)},t.isAddOnPreviewUpdateCandidate=c;var i=r(n(348926)),a=n(928563),o=n(76469),s=r(n(565754)),l=n(403385),u=n(459857);function c(e){const t=s.default.fromString(e.parentMsgKey);return((0,u.isSerializedWidMe)(e.sender)||t.fromMe)&&!e.isOrphan}function d(){return p.apply(this,arguments)}function p(){return(p=(0,i.default)((function*(e){const t=new Map;return(yield(0,o.getChatTable)().bulkGet(e)).forEach((e=>{var n;null!=e&&t.set(e.id.toString(),null!==(n=e.chatlistPreview)&&void 0!==n?n:e.lastReactionPreview)})),t}))).apply(this,arguments)}function _(e){return s.default.fromString(e.parentMsgKey).remote.toString()}function f(e,t){return!!g(e)&&(e.sender===t.sender&&e.parentMsgKey===t.parentMsgKey&&e.timestamp>=t.timestamp)}function h(){return(h=(0,i.default)((function*(e){const t=e.filter((e=>c(e))),n=new Map;if(!t.length)return n;const r=new Set(t.map((e=>s.default.fromString(e.parentMsgKey).remote.toString()))),i=yield d(Array.from(r));return t.forEach((e=>{const t=_(e),r=i.get(t),o=n.get(t),s=null!=o?o:r;g(e)?s&&f(e,s)&&e.timestamp>=s.timestamp&&n.set(t,void 0):s?e.timestamp>=s.timestamp&&n.set(t,(0,a.lastAddOnPreviewFromCandidate)(e)):n.set(t,(0,a.lastAddOnPreviewFromCandidate)(e))})),n}))).apply(this,arguments)}function g(e){switch(e.type){case"poll_vote":return 0===e.selectedOptionsCount;case"reaction":default:return e.reactionText===l.REVOKED_REACTION_TEXT}}},394081:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleAckPeerSimpleReceipt=function(){return o.apply(this,arguments)};var i=r(n(348926)),a=n(118487);function o(){return(o=(0,i.default)((function*(e){yield(0,a.deletePeerMessage)(e.stanzaId)}))).apply(this,arguments)}},138213:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleChatSimpleReceipt=function(e){const{from:t,externalIds:n,ts:r,recipient:f,ackString:h,offline:g,biz:m}=e;let{ack:y}=e;const E=h===a.ACK_STRING.SENDER,S=!E&&(0,_.toUserWid)(t).equals((0,p.getMeUser)());let T;if(S||E){if(!f)throw __LOG__(3)`error: invalid sender/peer receipt without recipient`,new Error("handleChatSimpleReceipt: invalid sender/peer receipt without recipient");T=f}else{T=(0,_.toUserWid)(t);"none"===(0,d.getUserPrivacySettings)().readReceipts&&(y===a.ACK.READ||y===a.ACK.PLAYED&&(0,i.getABPropConfigValue)("played_self_enabled"))&&(y=a.ACK.RECEIVED)}const v=n.map((e=>new u.default({id:e,remote:T,fromMe:!S})));S&&y===a.ACK.PLAYED&&(0,o.handleViewOnceOpenedIfNecessary)(v);const A=v.map((e=>e.toString()));null!=g&&c.OfflineMessageHandler.offlineStanzaReceivedAfterCompelete();const C=null!=g&&!c.OfflineMessageHandler.isResumeFromRestartComplete();if(S){if(null!=f&&C&&(0,s.isReadOrPlayedReceipt)(h)&&n.length>0)return l.receiptBatcher.acceptPeerReceipt({ack:y,ts:r,msgKeys:A})}else l.receiptBatcher.acceptOtherReceipt({ack:y,ts:r,receiverId:t,msgKeys:A});C||(l.receiptBatcher.runActiveBatches(),function(e,t,n,r,i,s,l){if(i<a.ACK.RECEIVED)return Promise.resolve();if(t)return __LOG__(2)`handleChatSimpleReceipt: sender receipt from peer device ${r.toString()}`,Promise.resolve();if(e)return __LOG__(2)`handleChatSimpleReceipt: peer receipt from peer device ${r.toString()}`,i===a.ACK.READ?(0,o.updateChatPeerRead)(r,n):i===a.ACK.PLAYED?(0,o.updateMsgAcks)(n,i,s):Promise.resolve();(0,o.updateMsgAcks)(n,i,s,l)}(S,E,v,T,y,r,m))};var i=n(287461),a=n(402994),o=n(522841),s=n(942241),l=n(319169),u=r(n(565754)),c=n(359484),d=n(757453),p=n(459857),_=n(669050)},503728:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleGroupSimpleReceipt=function(){return y.apply(this,arguments)};var i=r(n(348926)),a=n(402994),o=n(477677),s=n(522841),l=n(942241),u=n(319169),c=n(301460),d=n(349965),p=n(739245),_=r(n(565754)),f=n(359484),h=n(797703),g=n(459857),m=n(669050);function y(){return(y=(0,i.default)((function*(e){const{ack:t,from:n,externalIds:r,ts:i,ackString:o,participant:c,recipient:d,offline:p}=e;if(!c)throw __LOG__(4,void 0,new Error,!0)`error: got group ack without participant.`,SEND_LOGS("handleGroupSimpleReceipt: failed"),new Error("handleGroupSimpleReceipt: got group ack without participant.");const y=(0,g.getMeUser)(),S=(0,m.toUserWid)(c),T=o===a.ACK_STRING.SENDER,v=!T&&S.equals(y);let A;if(v){if(!d)throw __LOG__(3)`error: invalid sender/peer receipt without recipient`,new Error("handleGroupSimpleReceipt: invalid sender/peer receipt without recipient");A=d}else A=y;const C=r.map((e=>new _.default({id:e,remote:n,fromMe:!v,participant:A})));v&&t===a.ACK.PLAYED&&(0,s.handleViewOnceOpenedIfNecessary)(C);const P=C.map((e=>e.toString()));null!=p&&f.OfflineMessageHandler.offlineStanzaReceivedAfterCompelete();const O=null!=p&&!f.OfflineMessageHandler.isResumeFromRestartComplete();if(v){if(null!=d&&O&&(0,l.isReadOrPlayedReceipt)(o)&&r.length>0)return u.receiptBatcher.acceptPeerReceipt({ack:t,ts:i,msgKeys:P})}else u.receiptBatcher.acceptOtherReceipt({ack:t,ts:i,receiverId:c,msgKeys:P});if(!O){const e=[];e.push(E(v,T,C,n,t,S,i)),e.push(new h.NonPersistJob("receiptBatcherRunActiveBatches",(()=>{u.receiptBatcher.runActiveBatches()})).waitUntilCompleted()),yield Promise.all(e)}}))).apply(this,arguments)}function E(){return S.apply(this,arguments)}function S(){return(S=(0,i.default)((function*(e,t,n,r,l,u,_){return l<a.ACK.RECEIVED?Promise.resolve():t?(__LOG__(2)`handleGroupSimpleReceipt: sender receipt from peer device ${r.toString()}`,Promise.resolve()):e?(__LOG__(2)`handleGroupSimpleReceipt: peer receipt from peer device ${r.toString()}`,l===a.ACK.READ&&(0,s.updateChatPeerRead)(r,n),l===a.ACK.PLAYED?(0,s.updateMsgAcks)(n,l,_):Promise.resolve()):void(yield Promise.all(n.map(function(){var e=(0,i.default)((function*(e){const t=c.MsgCollection.get(e);if(!t)return void __LOG__(2)`handleGroupSimpleReceipt: no message found for incoming ack, with msgKey:`;const n=yield p.MsgInfoCollection.find(e);return n?((0,d.updateMsgInfo)(n,l,u,_),l===a.ACK.RECEIVED&&0===n.deliveryRemaining||l===a.ACK.READ&&0===n.readRemaining||l===a.ACK.PLAYED&&0===n.playedRemaining?(0,o.updateMsgAck)(t,null,{from:(0,g.assertGetMe)(),to:r,ack:l,t:_}):void 0):(__LOG__(3,void 0,void 0,!0)`Assertion failed! ${e.toString()}`,void SEND_LOGS("handleGroupSimpleReceipt: no msgInfo found for msg:"))}));return function(){return e.apply(this,arguments)}}())))}))).apply(this,arguments)}},310393:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return _.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(402994),s=n(394081),l=n(138213),u=n(503728),c=n(320396),d=n(84313),p=n(319169);function _(){return(_=(0,a.default)((function*(e){const t=c.msgReceiptParser.parse(e);if(t.error)throw __LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,t.error;{const e=t.success,{ack:n,ackString:r,from:i,stanzaId:a}=e;if(e.type===c.RECEIPT_TYPE.SIMPLE){if(n===o.ACK.CONTENT_GONE)return(0,p.buildReceiptAckResponse)(i,a,r,null);p.receiptBatcher.acceptReceiptAck({from:i,stanzaId:a,ackString:r,participant:e.participant});try{__LOG__(2)`handleSimpleReceipt: got receipt ${e.ack} for msg ${e.stanzaId}`,yield f(e)}catch(t){__LOG__(3,void 0,void 0,void 0,["messaging"])`handleSimpleReceipt: got error for receipt ${e.ack} for msg ${e.stanzaId}: ${t}`}return}if(e.type===c.RECEIPT_TYPE.AGGREGATE){const t=(0,p.buildReceiptAckResponse)(i,a,r,null);try{__LOG__(2)`handleAggregateReceipt: got ${e.receipts.length} receipts of ack type ${e.ack} for msg ${e.externalId}`,yield h(e)}catch(e){}return t}return __LOG__(4,void 0,new Error,!0)`type: ${e.type}`,SEND_LOGS("handleMsgReceipt: Invalid receipt type"),(0,p.buildReceiptAckResponse)(i,a,r,null)}}))).apply(this,arguments)}function f(e){const{from:t,ack:n}=e;if(n===o.ACK.PEER)return(0,s.handleAckPeerSimpleReceipt)(e),Promise.resolve();if(t.isStatusV3())return Promise.resolve((0,d.handleStatusSimpleReceipt)(e));if(t.isUser())return Promise.resolve((0,l.handleChatSimpleReceipt)(e));if(t.isGroup())return(0,u.handleGroupSimpleReceipt)(e);if(t.isBroadcast()){if(!e.participant)return __LOG__(4,void 0,new Error,!0)`error: missing participant for broadcast receipt ${t.toString()}`,SEND_LOGS("handleSimpleReceipt: failed"),Promise.reject(new Error(`handleSimpleReceipt: missing participant for broadcast receipt ${t.toString()}`));const n=(0,i.default)((0,i.default)({},e),{},{from:e.participant,participant:null});return Promise.resolve((0,l.handleChatSimpleReceipt)(n))}return __LOG__(4,void 0,new Error,!0)`error: unsupported type for ${t.toString()}`,SEND_LOGS("handleSimpleReceipt: failed"),Promise.reject(new Error(`handleSimpleReceipt: unsupported type for ${t.toString()}`))}function h(e){const{ack:t,from:n}=e;return t===o.ACK.CONTENT_GONE?(__LOG__(4,void 0,new Error,!0)`error: reupload receipts cannot be aggregated`,SEND_LOGS("handleAggregateReceipt: failed"),Promise.reject(new Error("handleAggregateReceipt: failed"))):n.isGroup()||n.isBroadcast()?Promise.all(e.receipts.map((t=>f({type:c.RECEIPT_TYPE.SIMPLE,stanzaId:e.externalId,externalIds:[e.externalId],from:e.from,participant:t.participant,recipient:null,ts:t.ts,ack:e.ack,ackString:e.ackString,offline:e.offline,biz:null})))):(__LOG__(4,void 0,new Error,!0)`handleAggregateReceipt: aggregate receipts should come only from group, broadcast`,SEND_LOGS("handleAggregateReceipt: failed"),Promise.reject(new Error("handleAggregateReceipt: failed")))}},522841:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleViewOnceOpenedIfNecessary=function(){return O.apply(this,arguments)},t.processOrphanPeerReceipt=function(e){return S.enqueue((0,i.default)((function*(){const t=yield(0,d.getOrphanReceipt)(String(e));t?(null!=t[s.ACK_STRING.PLAYED]&&(__LOG__(2)`processOrphanPeerReceipt: orphan played ack found for incoming ${e}`,yield P([e],s.ACK.PLAYED,t[s.ACK_STRING.PLAYED])),null!=t[s.ACK_STRING.READ]&&(__LOG__(2)`processOrphanPeerReceipt: orphan read ack found for incoming ${e}`,A(e.remote,[e])),yield(0,d.removeOrphanReceipt)(String(e))):__LOG__(2)`processOrphanPeerReceipt: no orphan ack found for incoming ${e}`})))},t.processReactionOrphanPeerReceipt=function(e){return S.enqueue((0,i.default)((function*(){const t=yield(0,d.getOrphanReceipt)(String(e));t?(null!=t[s.ACK_STRING.READ]&&(__LOG__(2)`processReactionOrphanPeerReceipt: orphan read ack found for incoming ${e}`,yield(0,f.markReactionsAsReadByMessageKeys)([h.default.fromString(t.msgKey)])),yield(0,d.removeOrphanReceipt)(String(e))):__LOG__(2)`processReactionOrphanPeerReceipt: no orphan ack found for incoming ${e}`})))},t.updateChatPeerRead=A,t.updateMsgAcks=P,t.updateMsgAcksDb=function(e,t,n){S.enqueue((()=>{__LOG__(2)`updateMsgAcks: store ${e.length} orphan acks`;let r=null;if(t===s.ACK.PLAYED?r=s.ACK_STRING.PLAYED:t===s.ACK.READ&&(r=s.ACK_STRING.READ),r)return(0,d.createOrUpdateOrphanReceipt)(r,n,e.map(String))}))};var i=r(n(348926)),a=n(316860),o=n(990445),s=n(402994),l=n(254665),u=n(133331),c=n(697588),d=n(944161),p=n(359987),_=n(907539),f=n(108595),h=r(n(565754)),g=n(121260),m=n(237),y=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=E(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(698867));function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(E=function(e){return e?n:t})(e)}const S=new a.PromiseQueue;function T(){return v.apply(this,arguments)}function v(){return(v=(0,i.default)((function*(e,t){const n=(yield(0,u.getActiveMessageRanges)(e)).filter((e=>"markChatAsRead"===e.action&&!1===e.actionValue.read&&null!=e.actionValue.messageRange));if(0===n.length)return!0;const r=n[0];return t.some((e=>!(0,l.rangeContainsMessage)(r.actionValue.messageRange,{id:h.default.fromString(e.id),t:e.t})))}))).apply(this,arguments)}function A(){return C.apply(this,arguments)}function C(){return(C=(0,i.default)((function*(e,t){const n=t.map(String),r=[];let i=[],a=null;const o=yield(0,g.getTable)().bulkGet(n,!1),l=[];if(o.forEach(((e,t)=>{e?null==e.pendingReadReceipt||null!=e.rowId&&(null==a||e.rowId>a)&&(a=e.rowId):l.push(n[t])})),l.length>0&&(i=(yield(0,m.getTable)().anyOf(["msgKey"],l)).map((e=>e.msgKey)),__LOG__(2)`updateChatPeerRead: maybeOrphans ${l.length}`,l.forEach((e=>{i.includes(e)||r.push(e)}))),S.enqueue((()=>(__LOG__(2)`updateChatPeerRead: storing ${r.length} orphan acks`,(0,d.createOrUpdateOrphanReceipt)(s.ACK_STRING.READ,0,r)))),yield(0,c.markMessageAndChatAsRead)(a,String(e),!(yield T(e.toString(),o.filter(Boolean)))),i.length>0){const e=i.map((e=>h.default.fromString(e)));yield(0,f.markReactionsAsReadByMessageKeys)(e)}yield(0,p.frontendSendAndReceive)("updateChatUnreadMsgCountAndClearMentions",{remote:e})}))).apply(this,arguments)}function P(e,t,n,r){return(0,p.frontendSendAndReceive)("updateMsgAcks",{msgKeys:e,ack:t,t:n,privacyMode:r})}function O(){return(O=(0,i.default)((function*(e){const t=e.map(String),n=yield(0,g.getTable)().bulkGet(t,!1);null==y||y.handleActivitiesForChatThreadLogging(n.filter(Boolean).map(_.messageFromDbRow).filter((e=>e.isViewOnce)).map((e=>{var t;return{activityType:"viewOnceOpen",ts:null!==(t=e.t)&&void 0!==t?t:(0,o.unixTime)(),chatId:e.id.remote}})))}))).apply(this,arguments)}},320396:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.msgReceiptParser=t.RECEIPT_TYPE=void 0;var i=r(n(81109)),a=n(769707),o=n(402994),s=n(257845),l=n(854379),u=n(459857);const c={read:o.ACK.READ,played:o.ACK.PLAYED,inactive:o.ACK.INACTIVE,"server-error":o.ACK.CONTENT_GONE,sender:o.ACK.RECEIVED,"read-self":o.ACK.READ,"played-self":o.ACK.PLAYED,peer_msg:o.ACK.PEER},d={SIMPLE:"simple",AGGREGATE:"aggregate"};t.RECEIPT_TYPE=d;const p=new a.WapParser("incomingMsgReceiptParser",(e=>{e.assertTag("receipt"),e.hasAttr("to")&&e.assertAttr("to",(0,u.assertGetMe)().toJid());const t={ack:(e.hasAttr("type")?e.attrEnumOrNullIfUnknown("type",c):o.ACK.RECEIVED)||o.ACK.RECEIVED,stanzaId:e.attrString("id"),from:(0,l.jidWithTypeToWid)(e.attrJidWithType("from")),ackString:e.hasAttr("type")?e.attrString("type"):null,offline:e.hasAttr("offline")?e.attrString("offline"):null},n=e.maybeChild("error");null!=n&&"lid"===n.attrString("reason")&&"feature-incapable"===n.attrString("type")&&(t.ack=o.ACK.SENT);const r=e.maybeChild("participants");return r?function(e,t){const n=t.mapChildrenWithTag("user",(e=>{try{const t=(0,l.deviceJidToDeviceWid)(e.attrDeviceJid("jid"));return{participant:t,ts:e.attrTime("t")}}catch(e){return null}})).filter((e=>null!=e));return(0,i.default)((0,i.default)({},e),{},{type:d.AGGREGATE,externalId:t.attrString("key"),receipts:n})}(t,r):function(e,t){const n=t.hasAttr("participant")?(0,l.deviceJidToDeviceWid)(t.attrDeviceJid("participant")):null,r=t.hasAttr("recipient")?(0,l.userJidToUserWid)(t.attrUserJid("recipient")):null;let a,o;a=t.hasChild("list")?t.child("list").mapChildrenWithTag("item",(e=>e.attrString("id"))):[];if(t.hasChild("biz")){const e=t.child("biz"),n=s.ActualActorsEnumType.cast(e.maybeAttrInt("actual_actors")),r=s.HostStorageEnumType.cast(e.maybeAttrInt("host_storage")),i=e.maybeAttrInt("privacy_mode_ts");null!=n&&null!=r&&null!=i&&(o={actualActors:n,hostStorage:r,privacyModeTs:i})}return a.push(e.stanzaId),(0,i.default)((0,i.default)({},e),{},{type:"simple",externalIds:a,participant:n,recipient:r,ts:t.attrTime("t"),biz:o})}(t,e)}));t.msgReceiptParser=p},942241:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isReadOrPlayedReceipt=function(e){return e===r.ACK_STRING.READ||e===r.ACK_STRING.READ_SELF||e===r.ACK_STRING.PLAYED||e===r.ACK_STRING.PLAYED_SELF};var r=n(402994)},84313:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleStatusSimpleReceipt=function(e){const{externalIds:t,ts:n,ackString:r,ack:i,participant:s,recipient:u,offline:c}=e,_=t[0];if(!s)return __LOG__(4,void 0,new Error,!0)`error: got status ack without participant`,void SEND_LOGS("handleStatusSimpleReceipt: failed");const y=(0,h.getMeUser)(),E=(0,g.toUserWid)(s),S=E.equals(y),T="none"===(0,f.getUserPrivacySettings)().readReceipts;if(!S&&(T||r!==o.ACK_STRING.READ))return;const v=new d.default({id:_,remote:(0,g.createWid)(a.STATUS_JID),fromMe:!S,participant:null!=u?u:y}),A=[v.toString()],C=null!=c&&!p.OfflineMessageHandler.isResumeFromRestartComplete();if(S&&C)return l.receiptBatcher.acceptPeerReceipt({ts:n,msgKeys:A,ack:i});S||l.receiptBatcher.acceptOtherReceipt({ack:i,ts:n,receiverId:E,msgKeys:A});C||(l.receiptBatcher.runActiveBatches(),function(){m.apply(this,arguments)}(S,v,E,n))};var i=r(n(348926)),a=n(616310),o=n(402994),s=n(522841),l=n(319169),u=n(349965),c=n(739245),d=r(n(565754)),p=n(359484),_=n(669818),f=n(757453),h=n(459857),g=n(669050);function m(){return(m=(0,i.default)((function*(e,t,n,r){if(e){const e=_.StatusV3Collection.get(t.participant);e&&e.handleReadStatus(t)}else{const e=yield c.MsgInfoCollection.find(t);e&&(0,u.updateMsgInfo)(e,o.ACK.READ,n,r)}yield(0,s.updateMsgAcks)([t],o.ACK.READ,r)}))).apply(this,arguments)}},108595:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.markReactionsAsReadByMessageKeys=function(){return l.apply(this,arguments)};var i=r(n(348926)),a=n(200199),o=n(359987),s=r(n(565754));function l(){return(l=(0,i.default)((function*(e){const t=yield(0,a.markReactionsAsReadByMessageKeysInStore)(e);if(t)return(0,o.frontendSendAndReceive)("markReactionsAsRead",{reactions:u(t)})}))).apply(this,arguments)}function u(e){return e.map((e=>{let{parentMsgKey:t,msgKey:n,reactionText:r}=e;return{parentMsgKey:s.default.fromString(t),msgKey:s.default.fromString(n),reactionText:r}}))}},822017:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.clearDanglingReceipts=d,t.sendAndClearDanglingReceipts=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(990445),o=n(355802),s=n(665894),l=n(259377),u=n(669050);function c(){return(c=(0,i.default)((function*(){const e=yield(0,s.getTable)().all(),t=new Map;e.forEach((e=>{const{receipts:n}=e;n.forEach((e=>{const n=(0,u.createWid)(e.from),r=(0,u.createWid)(e.author);let i=t.get(n);i||(i=new Map,t.set(n,i));let a=i.get(r);a||(a=[],i.set(r,a)),a.push(e.externalId)}))}));const n=String((0,a.unixTime)());yield Promise.all(Array.from(t.keys()).map((e=>{const r=t.get(e);if(r)return(0,l.sendAggregateReceipts)(e,l.RECEIPT_TYPE.DELIVERY,n,r)}))),yield d()}))).apply(this,arguments)}function d(){return p.apply(this,arguments)}function p(){return(p=(0,i.default)((function*(){yield(0,o.blockSendPing)(),yield(0,s.getTable)().clear()}))).apply(this,arguments)}},724469:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getNonBlockingOfflineResumeMaxMessageCount=function(){return(0,r.getABPropConfigValue)("web_non_blocking_offline_resume_max_message_count")},t.isActiveRefreshEnabled=function(){return(0,r.getABPropConfigValue)("web_electron_active_reload")},t.isNotifSchedulerEnabled=function(){return(0,r.getABPropConfigValue)("web_offline_resume_m3_enabled")};var r=n(287461)},280464:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.OfflinePendingDeviceCache=void 0;var i=r(n(348926)),a=n(911794),o=n(316860),s=n(201063),l=n(277330);const u=new class{constructor(){this.pendingDeviceCache=new Set,this.pendingAcks=[],this.snapshotTimer=new s.ShiftTimer((()=>{this.createSnapshot()})),this.checkpointQueue=new o.PromiseQueue}addOfflinePendingDevice(e,t){this.pendingDeviceCache.add(e),t&&this.pendingAcks.push(t),this.snapshotTimer.isScheduled()||(__LOG__(2)`[offline-resume][device-cache]: creating snapshot: schedule in ${3e3} ms`,this.snapshotTimer.onOrAfter(3e3))}createSnapshot(){this.snapshotTimer.isScheduled()&&this.snapshotTimer.cancel();const e=Array.from(this.pendingDeviceCache),t=this.pendingAcks;__LOG__(2)`[offline-resume][device-cache]: creating snapshot for pending devices ${e.join(",")}`,this.checkpointQueue.enqueue((0,i.default)((function*(){yield(0,l.addUserToPendingDeviceSync)(e),t.forEach(a.deprecatedCastStanza),(0,a.cancelDeadSocketTimer)()}))),this.pendingDeviceCache=new Set,this.pendingAcks=[]}};t.OfflinePendingDeviceCache=u},359484:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OfflineMessageHandlerImpl=t.OfflineMessageHandler=void 0;var r=n(608040),i=n(780549),a=n(724469),o=n(654082),s=(n(538222),n(674899)),l=n(209983);class u{constructor(){this.initState(),i.Cmd.on("open_socket_stream",(()=>{i.Cmd.isOfflineDeliveryEnd||l.OfflineResumeReporter.logSocketConnectT()}))}initState(){this._offlineResumeManager=new r.OfflineBlockingResumeStageManager,this._pendingMessageCount=0,this._isPendingPrevBatch=!1,this._offlineManagerInitialized=!1}setOfflineMessagePreviewCounter(e){this._offlineManagerInitialized||this.isResumeFromRestartComplete()||!function(e){if(e>=(0,a.getNonBlockingOfflineResumeMaxMessageCount)())return!1;return!0}(e.message)||(this._offlineResumeManager=new o.OfflineNonBlockingResumeStageManager),this._offlineManagerInitialized=!0,this._offlineResumeManager.processOfflinePreview(e)}setOfflineThreadMeta(e){this._offlineResumeManager.processOfflineThreadMeta(e)}processMessageDecryptResult(e){this._offlineResumeManager.processDecryptResult(e),this._pendingMessageCount-=1,this._maybeRequestMoreStanza()}addOfflinePendingMessage(){this.isResumeFromRestartComplete()||(this._pendingMessageCount+=1)}newOfflineStanza(e,t){return this._isPendingPrevBatch=!1,null==this._endBatchCheck&&(this._endBatchCheck=setTimeout((()=>{this._maybeRequestMoreStanza(),this._endBatchCheck=null,__LOG__(2)`[offline-resume][adaptive] _endBatchCheck: done`}),0)),this._offlineResumeManager.newOfflineStanza(e,t)}offlineStanzaReceivedAfterCompelete(){return this._offlineResumeManager.offlineStanzaReceivedAfterCompelete()}getOfflineDeliveryProgress(){return this._offlineResumeManager.getOfflineDeliveryProgress()}isResumeOnSocketDisconnectInProgress(){return this._offlineResumeManager.isResumeOnSocketDisconnectInProgress()}isResumeFromRestartComplete(){return this._offlineResumeManager.isResumeFromRestartComplete()}getHasMessagesToDownload(){return this._offlineResumeManager.getHasMessagesToDownload()}getFinishedDownloading(){return 100===this.getOfflineDeliveryProgress()}setOfflineSessionComplete(e){return this._offlineResumeManager.processOfflineSessionComplete(e)}shouldUseOfflineResumeScreen(){return this._offlineResumeManager.shouldUseOfflineResumeScreen()}shouldShowResumeButterBar(){return this._offlineResumeManager.shouldShowResumeButterBar()}_maybeRequestMoreStanza(){this.isResumeFromRestartComplete()||this._isPendingPrevBatch||this._pendingMessageCount<=200&&((0,s.sendBatchRequestIb)(200),this._isPendingPrevBatch=!0,__LOG__(2)`[offline-resume][adaptive] _maybeRequestMoreStanza: request next batch, pending message ${this._pendingMessageCount}`)}}t.OfflineMessageHandlerImpl=u;const c=new u;t.OfflineMessageHandler=c},674899:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendBatchRequestIb=function(e){const t=(0,i.wap)("ib",null,(0,i.wap)("offline_batch",{count:(0,i.CUSTOM_STRING)(String(e))}));(0,r.deprecatedCastStanza)(t)};var r=n(911794),i=n(738102)},971186:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.filterStoreMessagesResult=function(e,t){const n={};if(!e)return n;if(!e)return n;const{pollUpdateMsgsResult:r}=e;r&&(n.pollUpdateMsgsResult=new Map(Array.from(r).filter((e=>{let[n,r]=e;return t.includes(n)}))));return n},t.storeMsgs=function(){return P.apply(this,arguments)};var i=r(n(348926)),a=n(61314),o=n(260071),s=n(359987),l=n(6066),u=n(147980),c=n(187845),d=n(907539),p=n(52045),_=n(795360),f=n(826933),h=n(963495),g=n(124503),m=n(460810),y=n(488300),E=n(641473),S=n(373070),T=n(671598),v=n(121260),A=n(766187),C=n(84461);function P(){return(P=(0,i.default)((function*(e){try{const{newMsgs:t,replaceMsgs:n,revokeMsgs:r,paymentMsgs:i,reactionMsgs:u,groupInviteMsgs:d,chatsWithNewOfflineMsg:y,pollUpdateMsgs:S,removedPlaceholders:T,keepInChatMessages:A,editProtocolMsgs:C,replyMsgs:P}=yield M(e);__LOG__(2)`[store-msgs]: newMsgs: ${t.length}, replaceMsgs: ${n.length}, revokeMsgs: ${r.length}, paymentMsgs: ${i.length}`;const b=yield(0,o.applyOrphanRevokes)(t);yield(0,c.persistNewMessagesInBulk)(b,y),yield(0,v.getTable)().bulkCreateOrReplace(n),yield I(r),yield(0,f.processPaymentMessages)(i),yield(0,g.processReactionMsgs)(u),yield(0,_.processGroupInviteMessages)(d),yield(0,s.frontendSendAndReceive)("processKeepInChatMessages",{keepInChatMessages:A,allowNotification:!1}),yield(0,p.processEditProtocolMsgs)(C),yield(0,m.processReplyMsgs)(P);const R=yield(0,h.processPollUpdateMsgs)(S);yield(0,E.handleOfflineForMessageRange)(e);const N=e.map((e=>e.id.toString()));try{yield(0,a.checkOrphanMutations)(N,y),yield(0,l.checkUpdateForOrphanReactions)(N)}catch(t){__LOG__(4,void 0,new Error)`storeMsgs: checkOrphanMutations failed during handleSingleMsgMD for: ${String(N.join(" "))} chat: ${String(e[0].id.remote)} Error: ${t.name}, message: ${t.message}, stack: ${t.stack}`}return O(t,T),{pollUpdateMsgsResult:new Map(R.map((e=>[e.msgKey.toString(),e])))}}catch(e){__LOG__(4,void 0,new Error)`[store-msgs] Error: ${e.name}, message: ${e.message}, stack: ${e.stack}`}}))).apply(this,arguments)}function O(e,t){e.forEach((e=>{R(e)&&(0,s.frontendFireAndForget)("addPlaceholderWamAction",{msg:e})})),t.forEach((e=>{(0,s.frontendFireAndForget)("populatePlaceholderWamAction",{msgRow:e})}))}function I(e){const t=[];return e.forEach((e=>{e.protocolMessageKey&&t.push({revokeMsgKey:e.protocolMessageKey,newMsgKey:e.id,timestamp:e.t,subtype:e.subtype,sender:(0,u.getSender)(e),revokeTimestamp:e.t})})),(0,y.processRevokeMsgs)(t).then(function(){var e=(0,i.default)((function*(e){if(t.length>0){const e=[],n=new Set;t.forEach((t=>{e.push(t.revokeMsgKey.toString());const r=t.revokeMsgKey.remote.toString();n.add(r)})),yield(0,A.workerSafeSendAndReceive)("deleteAddOnsJob",{chatIds:n,revokeMsgsOldIds:e})}return e}));return function(){return e.apply(this,arguments)}}())}function M(){return b.apply(this,arguments)}function b(){return(b=(0,i.default)((function*(e){const t=yield(0,v.getTable)().bulkGet(e.map((e=>String(e.id))),!1),n=[],r=[],i=[],a=[],o=[],s=[],l=[],u=[],c=[],p=[],_=new Set,f=new Map,h=new Map;return e.forEach(((e,g)=>{const m=String(e.id),y=t[g];if(null!=y&&L(e,y)){const t=(0,d.dbRowFromMessage)(e);t.t=y.t,t.internalId=y.internalId,t.rowId=y.rowId,r.push(t),R(y)&&h.set(m,y)}else if(!y||N(y)&&w(e)){const t=f.get(m);t&&!R(t)?n.push(e.id.id):(0,C.isKeepInChatReadEnabled)()&&e.type===S.MSG_TYPE.KEEP_IN_CHAT?l.push(e):e.type===S.MSG_TYPE.REACTION?a.push(e):(0,T.isPollVoteProcessingEnabled)()&&e.type===S.MSG_TYPE.POLL_UPDATE?s.push(e):["sender_revoke","admin_revoke"].includes(e.subtype)?i.push(e):e.type===S.MSG_TYPE.PAYMENT&&"send"===e.subtype||"payment_action_request_declined"===e.subtype||"payment_transaction_request_cancelled"===e.subtype?(o.push(e),f.set(m,e),_.add(String(e.id.remote))):e.type===S.MSG_TYPE.GROUPS_V4_INVITE?(u.push(e),f.set(m,e),_.add(String(e.id.remote))):e.type===S.MSG_TYPE.PROTOCOL&&"message_edit"===e.subtype?c.push(e):e.quotedMsg?(p.push(e),f.set(m,e),_.add(String(e.id.remote))):(f.set(m,e),_.add(String(e.id.remote)))}else n.push(e.id.id)})),n.length>0&&__LOG__(2)`[store-msgs] [classify-msgs]: skip for ${n.length} duplicate messages, with id ${n}`,{newMsgs:Array.from(f.values()),chatsWithNewOfflineMsg:Array.from(_),removedPlaceholders:Array.from(h.values()),replaceMsgs:r,revokeMsgs:i,paymentMsgs:o,reactionMsgs:a,pollUpdateMsgs:s,keepInChatMessages:l,groupInviteMsgs:u,editProtocolMsgs:c,replyMsgs:p}}))).apply(this,arguments)}function R(e){return e.type===S.MSG_TYPE.UNKNOWN&&"fanout"===e.subtype||e.type===S.MSG_TYPE.CIPHERTEXT}function N(e){return e.type===S.MSG_TYPE.UNKNOWN}function w(e){const{getAddOnProviderForMsg:t}=n(577721);return Boolean(t(e))}function L(e,t){return R(t)&&!R(e)||N(t)&&!N(e)&&!w(e)}},743516:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(638669).handlePaymentNotification;t.default=r},346401:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAmount1000AndCurrency=function(e){return function(e){if(e.hasChild("amount")){return function(e){e.assertTag("money");const t=parseFloat(e.attrString("value")),r=e.attrString("currency"),i=e.maybeAttrInt("offset");return{currency:r,amount1000:t*n/(null!=i&&0!==i?i:n)}}(e.child("amount").child("money"))}if(e.hasAttr("amount")){return{amount1000:parseFloat(e.attrString("amount"))*n,currency:e.attrString("currency")}}throw __LOG__(3)`Amount missing in pay or transaction node`,new Error("Amount missing in pay or transaction node")}(e)};const n=1e3},638669:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handlePaymentNotification=function(){return y.apply(this,arguments)},t.processAllOrphanPaymentNotifications=function(){return C.apply(this,arguments)},t.processOrphanPaymentNotifications=function(){return A.apply(this,arguments)},t.updateReceivedPaymentInfo=S;var i=r(n(81109)),a=r(n(348926)),o=r(n(132375)),s=n(484777),l=n(74927),u=n(301460),c=n(240493),d=r(n(565754)),p=n(387191),_=n(11304),f=n(326953),h=n(850788),g=n(609910),m=n(411067);function y(){return(y=(0,a.default)((function*(e){if(e.content&&"invite"===e.content[0].tag)return E(e);const t=_.paymentNotificationParser.parse(e);if(t.error)throw __LOG__(2)`${t.error.toString()} parsing ${e.toString()}`,t.error;if(!t.success)return Promise.resolve();const n=t.success,r=(0,o.default)(n.msgKey,"info.msgKey"),a=u.MsgCollection.get(r),l=a?(0,m.unproxy)(a):yield(0,s.getMsgByMsgKey)(r);if(!l){__LOG__(3)`handlePaymentNotification: no msg found for id ${r.toString()}`;const e=(0,i.default)((0,i.default)({},n),{},{msgKey:r.toString()});return(0,g.getTable)().createOrReplace(e)}return S(l,n)}))).apply(this,arguments)}function E(e){const t=_.paymentInviteNotificationParser.parse(e);if(t.error)return __LOG__(2)`${t.error.toString()} parsing ${e.toString()}`,Promise.reject(t.error);if(!t.success)return Promise.resolve();const n=t.success;if("account-set-up"===n.type){const e=(0,f.genPaymentInviteAccoutSetupMsg)(n.from,n.timestamp);return(0,c.handleSingleMsgMD)(e.from,e)}return Promise.resolve()}function S(){return T.apply(this,arguments)}function T(){return(T=(0,a.default)((function*(e,t){const n=[];v(e,t),n.push(e.id.toString());const r=[e instanceof p.Msg?e.toJSON():e];if(null!=e.paymentRequestMessageKey){const t=u.MsgCollection.get(e.paymentRequestMessageKey),n=t?(0,m.unproxy)(t):yield(0,s.getMsgByMsgKey)(e.paymentRequestMessageKey||"");n&&(n.paymentStatus=e.paymentStatus,n.paymentTxnStatus=(0,h.determinePaymentRequestFulfilledStatus)(e.paymentTxnStatus),r.push(n instanceof p.Msg?n.toJSON():n))}return(0,g.getTable)().bulkRemove(n).catch((()=>{__LOG__(4,void 0,new Error)`getOrphanPaymentNotificationTable bulkremove of ${n} failed. {e}`})),(0,l.updateExistingMessages)(r)}))).apply(this,arguments)}function v(e,t){t&&(null!=t.status&&(e.paymentStatus=(0,h.getPaymentWebStatus)(t.status,t.type),e.paymentTxnStatus=(0,h.getPaymentTxnWebStatus)(t.status)),e.paymentCurrency=t.currency||"",e.paymentAmount1000=(0,o.default)(t.amount1000,"mdPaymentInfo.amount1000"),e.paymentMessageReceiverJid=t.receiver,e.paymentTransactionTimestamp=(0,o.default)(t.ts,"mdPaymentInfo.ts"))}function A(){return(A=(0,a.default)((function*(e){const t=e.map((e=>e.id.toString())),n=yield(0,g.getTable)().bulkGet(t),r=new Map;e.forEach((e=>{r.set(e.id.toString(),e)})),n.forEach((e=>{if(e){const t=r.get(e.msgKey);if(!t)return;S(t,{receiver:e.receiver,currency:e.currency,amount1000:e.amount1000,type:e.type,status:e.status,ts:e.ts,msgKey:d.default.fromString(e.msgKey)})}}))}))).apply(this,arguments)}function C(){return(C=(0,a.default)((function*(){const e=yield(0,g.getTable)().all(),t=new Map,n=[];if(e.forEach((e=>{const r=u.MsgCollection.get(e.msgKey);r?S(r,{receiver:e.receiver,currency:e.currency,amount1000:e.amount1000,type:e.type,status:e.status,ts:e.ts,msgKey:d.default.fromString(e.msgKey)}):(t.set(e.msgKey,e),n.push(e.msgKey))})),n.length>0){const e=yield(0,s.getMsgsByMsgKey)(n);return e.forEach((e=>{const n=t.get(e.id.toString());n&&(e.paymentTxnStatus=(0,h.getPaymentTxnWebStatus)(n.status),e.paymentCurrency=n.currency||"",e.paymentAmount1000=(0,o.default)(n.amount1000,"notification.amount1000"),e.paymentMessageReceiverJid=n.receiver,e.paymentTransactionTimestamp=(0,o.default)(n.ts,"notification.ts"))})),(0,l.updateExistingMessages)(e)}}))).apply(this,arguments)}},11304:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.isNoviTransaction=c,t.parseTransactionNode=_,t.paymentNotificationParser=t.paymentInviteNotificationParser=void 0;var i=n(769707),a=n(346401),o=n(854379),s=r(n(565754)),l=n(850788),u=n(459857);function c(e){return!(!e||!e.hasAttr("service")||"NOVI"!==e.attrString("service").toUpperCase())}const d=new i.WapParser("paymentNotificationParser",(e=>{if(e.hasChild("transaction")){return _(e.child("transaction"))}return __LOG__(2)`No transaction node in the payment notification`,null}));t.paymentNotificationParser=d;const p=new i.WapParser("paymentInviteNotificationParser",(e=>{if(e.hasChild("invite")){const t=e.child("invite");return{type:t.maybeAttrString("type"),service:t.maybeAttrString("service"),inviteUsed:t.hasAttr("invite-used")?"1"===t.attrString("invite-used"):null,from:(0,o.chatJidToChatWid)(e.attrChatJid("from")),timestamp:e.attrTime("t")}}return __LOG__(2)`No invite node in the payment invite notification`,null}));function _(e){if(c(e))return __LOG__(2)`Payment notification from Novi not supported`,null;let t,n;const r=(0,u.getMeUser)(),i=(0,o.jidWithTypeToWid)(e.attrJidWithType("sender")),d=(0,o.jidWithTypeToWid)(e.attrJidWithType("receiver")),p=r.equals(i);e.hasAttr("group")?(t=(0,o.jidWithTypeToWid)(e.attrJidWithType("group")),n=(0,o.jidWithTypeToWid)(e.attrJidWithType("sender"))):t=p?d:i;const _=new s.default({id:e.attrString("message-id"),fromMe:p,remote:t,participant:n}),f=(0,l.getPaymentTransactionType)(e.attrString("transaction-type"),_.fromMe),{amount1000:h,currency:g}=(0,a.getAmount1000AndCurrency)(e);return{receiver:d,currency:g,amount1000:h,status:(0,l.getNotificationTransactionStatus)(f,e.attrString("status")),ts:e.attrInt("ts"),type:f,msgKey:_}}t.paymentInviteNotificationParser=p},850788:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PaymentTransactionTypeServerString=t.PaymentTransactionType=t.PaymentTransactionStatusServerString=t.NotificationTransactionStatus=void 0,t.determinePaymentRequestFulfilledStatus=function(e){if(function(e){return e===r.PaymentInfo$TxnStatus.COMPLETED||e===r.PaymentInfo$TxnStatus.SUCCESS}(e))return e;return r.PaymentInfo$TxnStatus.COLLECT_INIT},t.getNotificationTransactionStatus=function(e,t){if(!t)return a.STATUS_UNSET;const n=t.toUpperCase();switch(e){case i.TYPE_P2P_SENT:case i.TYPE_P2M_SENT:case i.TYPE_DEPOSIT:switch(n){case s.PENDING_RECEIVER_SETUP:return a.SEND_PAY_PENDING_RECEIVER;case s.FAILED_DA:return a.SEND_PAY_PENDING;case s.REFUND_FAILED_DA:return a.SEND_PAY_REFUND_PENDING;case s.FAILED_RISK:return a.SEND_PAY_FAILURE_RISK;case s.INITIAL:return a.SEND_PAY_INIT;case s.SUCCESS:case s.COMPLETED:return a.SEND_PAY_SUCCESS;case s.FAILURE:case s.FAILED:return a.SEND_PAY_FAILURE;case s.REFUNDED:return a.SEND_PAY_REFUNDED;case s.REFUND_FAILED:return a.SEND_PAY_REFUND_FAILED;case s.FAILED_RECEIVER_PROCESSING:return a.SEND_PAY_FAILURE_RECEIVER;case s.REFUND_FAILED_PROCESSING:return a.SEND_PAY_REFUND_FAILED_PROCESSING;case s.FAILED_DA_FINAL:return a.SEND_PAY_PENDING_REFUND;case s.AUTH_CANCEL_FAILED_PROCESSING:return a.SEND_PAY_AUTH_CANCEL_FAILED_PROCESSING;case s.AUTH_CANCEL_FAILED:return a.SEND_PAY_AUTH_CANCEL_FAILED;case s.AUTH_CANCELED:return a.SEND_PAY_AUTH_CANCELED;case s.EXPIRED:return a.SEND_PAY_EXPIRED;case s.IN_REVIEW:return a.SEND_PAY_IN_REVIEW;case s.PENDING:return a.SEND_PAY_PENDING_PROCESSING;case s.CANCELED:return a.SEND_PAY_USER_CANCELED}break;case i.TYPE_P2P_RCVD:case i.TYPE_P2M_RCVD:switch(n){case s.PENDING_SETUP:return a.RECV_PAY_PENDING_SETUP;case s.FAILED_DA:return a.RECV_PAY_PENDING;case s.FAILED_PROCESSING:return a.RECV_PAY_RETRY_ON_FAILURE;case s.SUCCESS:case s.COMPLETED:return a.RECV_PAY_SUCCESS;case s.FAILURE:case s.FAILED:return a.RECV_PAY_FAILURE;case s.EXPIRED:return a.RECV_PAY_EXPIRED;case s.FAILED_RISK:return a.RECV_PAY_FAILURE_RISK;case s.WITHDRAWAL_PROCESSING:return a.RECV_PAY_WITHDRAWAL_PROCESSING;case s.WITHDRAWAL_FAILURE:return a.RECV_PAY_WITHDRAWAL_FAILURE;case s.WITHDRAWAL_PERMANENT_FAILED:return a.RECV_PAY_WITHDRAWAL_PERMANENT_FAILED;case s.CANCELED:return a.RECV_PAY_SENDER_CANCELED}break;case i.TYPE_P2P_REQ_SENT:case i.TYPE_P2P_REQ_RCVD:switch(n){case s.COLLECT_SUCCESS:return a.REQUEST_PAY_SUCCESS;case s.COLLECT_FAILED:return a.REQUEST_PAY_FAILED;case s.COLLECT_FAILED_RISK:return a.REQUEST_PAY_FAILED_RISK;case s.COLLECT_REJECTED:return a.REQUEST_PAY_REJECTED;case s.COLLECT_EXPIRED:return a.REQUEST_PAY_EXPIRED;case s.COLLECT_CANCELED:return a.REQUEST_PAY_CANCELLED}break;case i.TYPE_P2P_REQ_SCHEDULED_PAYMENT_RCVD:switch(n){case s.COLLECT_SUCCESS:return a.REQUEST_PAY_SCHEDULED_PAYMENT_SUCCESS;case s.AUTH_SUCCESS:return a.SEND_PAY_AUTH_SUCCESS}break;case i.TYPE_REFUND:switch(n){case s.SUCCESS:case s.COMPLETED:return a.RECV_PAY_SUCCESS}break;case i.TYPE_WITHDRAWAL:switch(n){case s.PENDING:return a.WITHDRAWAL_PENDING;case s.IN_REVIEW:return a.WITHDRAWAL_IN_REVIEW;case s.SUCCESS:case s.COMPLETED:return a.WITHDRAWAL_SUCCESS;case s.FAILED:case s.DECLINED:return a.WITHDRAWAL_FAILED;case s.CANCELED:return a.WITHDRAWAL_USER_CANCELED;case s.EXPIRED:return a.WITHDRAWAL_EXPIRED;case s.WITHDRAWAL_ACTIVE:return a.WITHDRAWAL_ACTIVE}break;default:return a.STATUS_UNSET}return a.STATUS_UNSET},t.getPaymentTransactionType=function(e,t){if(e){const n=e.toLowerCase();switch(n){case o.TYPE_P2P:return t?i.TYPE_P2P_SENT:i.TYPE_P2P_RCVD;case o.TYPE_P2M:return t?i.TYPE_P2M_SENT:i.TYPE_P2M_RCVD;case o.TYPE_P2M_PAYOUT:return i.TYPE_P2M_PAYOUT;case o.TYPE_DEPOSIT:return i.TYPE_DEPOSIT;case o.TYPE_REFUND:return i.TYPE_REFUND;case o.TYPE_WITHDRAWAL:return i.TYPE_WITHDRAWAL;default:__LOG__(2)`parsePaymentTransactionType payment transaction string=${n}`}}return t?i.TYPE_P2P_SENT:i.TYPE_P2P_RCVD},t.getPaymentTxnWebStatus=function(e){if(null==e)return r.PaymentInfo$TxnStatus.UNKNOWN;switch(e){case a.RECV_PAY_EXPIRED:case a.SEND_PAY_EXPIRED:return r.PaymentInfo$TxnStatus.EXPIRED_TXN;case a.RECV_PAY_FAILURE:case a.SEND_PAY_FAILURE:return r.PaymentInfo$TxnStatus.FAILED;case a.RECV_PAY_INIT:case a.SEND_PAY_INIT:return r.PaymentInfo$TxnStatus.INIT;case a.RECV_PAY_PENDING_SETUP:return r.PaymentInfo$TxnStatus.PENDING_SETUP;case a.RECV_PAY_PENDING:case a.SEND_PAY_PENDING:return r.PaymentInfo$TxnStatus.FAILED_DA;case a.RECV_PAY_RETRY_ON_FAILURE:return r.PaymentInfo$TxnStatus.FAILED_PROCESSING;case a.RECV_PAY_SUCCESS:case a.SEND_PAY_SUCCESS:case a.REQUEST_PAY_FULFILLED:return r.PaymentInfo$TxnStatus.SUCCESS;case a.REQUEST_PAY_CANCELLED:return r.PaymentInfo$TxnStatus.COLLECT_CANCELED;case a.REQUEST_PAY_CANCELLING:return r.PaymentInfo$TxnStatus.COLLECT_CANCELLING;case a.REQUEST_PAY_EXPIRED:return r.PaymentInfo$TxnStatus.COLLECT_EXPIRED;case a.REQUEST_PAY_FAILED_RISK:return r.PaymentInfo$TxnStatus.COLLECT_FAILED_RISK;case a.REQUEST_PAY_FAILED:return r.PaymentInfo$TxnStatus.COLLECT_FAILED;case a.REQUEST_PAY_INIT:return r.PaymentInfo$TxnStatus.COLLECT_INIT;case a.REQUEST_PAY_REJECTED:return r.PaymentInfo$TxnStatus.COLLECT_REJECTED;case a.REQUEST_PAY_SUCCESS:return r.PaymentInfo$TxnStatus.COLLECT_SUCCESS;case a.SEND_PAY_AUTH_CANCELED:return r.PaymentInfo$TxnStatus.AUTH_CANCELED;case a.SEND_PAY_AUTH_CANCEL_FAILED_PROCESSING:return r.PaymentInfo$TxnStatus.AUTH_CANCEL_FAILED_PROCESSING;case a.SEND_PAY_AUTH_CANCEL_FAILED:return r.PaymentInfo$TxnStatus.AUTH_CANCEL_FAILED;case a.SEND_PAY_FAILURE_RECEIVER:return r.PaymentInfo$TxnStatus.FAILED_RECEIVER_PROCESSING;case a.SEND_PAY_FAILURE_RISK:case a.RECV_PAY_FAILURE_RISK:return r.PaymentInfo$TxnStatus.FAILED_RISK;case a.SEND_PAY_PENDING_RECEIVER:return r.PaymentInfo$TxnStatus.PENDING_RECEIVER_SETUP;case a.SEND_PAY_PENDING_REFUND:return r.PaymentInfo$TxnStatus.FAILED_DA_FINAL;case a.SEND_PAY_REFUNDED:return r.PaymentInfo$TxnStatus.REFUNDED_TXN;case a.SEND_PAY_REFUND_FAILED_PROCESSING:return r.PaymentInfo$TxnStatus.REFUND_FAILED_PROCESSING;case a.SEND_PAY_REFUND_FAILED:return r.PaymentInfo$TxnStatus.REFUND_FAILED;case a.SEND_PAY_REFUND_PENDING:return r.PaymentInfo$TxnStatus.REFUND_FAILED_DA;case a.SEND_PAY_IN_REVIEW:return r.PaymentInfo$TxnStatus.IN_REVIEW;case a.STATUS_UNSET:default:return r.PaymentInfo$TxnStatus.UNKNOWN}},t.getPaymentWebStatus=function(e,t){if(null==e)return r.PaymentInfo$Status.UNKNOWN_STATUS;switch(e){case a.SEND_PAY_INIT:case a.SEND_PAY_PENDING:case a.RECV_PAY_INIT:case a.RECV_PAY_PENDING:case a.RECV_PAY_RETRY_ON_FAILURE:case a.REQUEST_PAY_INIT:return r.PaymentInfo$Status.PROCESSING;case a.SEND_PAY_PENDING_RECEIVER:case a.SEND_PAY_FAILURE_RECEIVER:return r.PaymentInfo$Status.SENT;case a.REQUEST_PAY_SUCCESS:return t===i.TYPE_P2P_REQ_SENT?r.PaymentInfo$Status.WAITING_FOR_PAYER:r.PaymentInfo$Status.WAITING;case a.RECV_PAY_PENDING_SETUP:return r.PaymentInfo$Status.NEED_TO_ACCEPT;case a.SEND_PAY_SUCCESS:case a.RECV_PAY_SUCCESS:case a.REQUEST_PAY_FULFILLED:return r.PaymentInfo$Status.COMPLETE;case a.SEND_PAY_FAILURE:case a.SEND_PAY_FAILURE_RISK:case a.SEND_PAY_PENDING_REFUND:case a.SEND_PAY_REFUND_PENDING:case a.SEND_PAY_REFUND_FAILED:case a.SEND_PAY_REFUND_FAILED_PROCESSING:case a.RECV_PAY_FAILURE:case a.REQUEST_PAY_FAILED:case a.REQUEST_PAY_FAILED_RISK:return r.PaymentInfo$Status.COULD_NOT_COMPLETE;case a.SEND_PAY_REFUNDED:return r.PaymentInfo$Status.REFUNDED;case a.RECV_PAY_EXPIRED:case a.REQUEST_PAY_EXPIRED:case a.SEND_PAY_AUTH_CANCELED:case a.SEND_PAY_AUTH_CANCEL_FAILED:case a.SEND_PAY_AUTH_CANCEL_FAILED_PROCESSING:return r.PaymentInfo$Status.EXPIRED;case a.REQUEST_PAY_REJECTED:return r.PaymentInfo$Status.REJECTED;case a.REQUEST_PAY_CANCELLED:return r.PaymentInfo$Status.CANCELLED;case a.STATUS_UNSET:case a.REQUEST_PAY_CANCELLING:default:return r.PaymentInfo$Status.UNKNOWN_STATUS}};var r=n(968923);const i=n(76672)({TYPE_UNSET:0,TYPE_P2P_SENT:1,TYPE_P2P_RCVD:2,TYPE_P2P_GRP:3,TYPE_P2P_NO_INFO:4,TYPE_FUTURE:5,TYPE_P2P_REQ_SENT:10,TYPE_P2P_REQ_RCVD:20,TYPE_P2P_REQ_SCHEDULED_PAYMENT_RCVD:21,TYPE_P2P_REQ_GRP:30,TYPE_P2M_SENT:100,TYPE_P2M_RCVD:200,TYPE_P2M_PAYOUT:300,TYPE_MISSING_DETAILS:400,TYPE_DEPOSIT:500,TYPE_REFUND:600,TYPE_WITHDRAWAL:700});t.PaymentTransactionType=i;const a=n(76672)({STATUS_UNSET:0,REQUEST_PAY_INIT:11,REQUEST_PAY_SUCCESS:12,REQUEST_PAY_FAILED:13,REQUEST_PAY_FAILED_RISK:14,REQUEST_PAY_REJECTED:15,REQUEST_PAY_EXPIRED:16,REQUEST_PAY_FULFILLED:17,REQUEST_PAY_CANCELLED:18,REQUEST_PAY_CANCELLING:19,REQUEST_PAY_SCHEDULED_PAYMENT_SUCCESS:20,RECV_PAY_INIT:101,RECV_PAY_PENDING_SETUP:102,RECV_PAY_PENDING:103,RECV_PAY_RETRY_ON_FAILURE:104,RECV_PAY_FAILURE:105,RECV_PAY_SUCCESS:106,RECV_PAY_EXPIRED:107,RECV_PAY_FAILURE_RISK:108,RECV_PAY_WITHDRAWAL_PROCESSING:109,RECV_PAY_WITHDRAWAL_FAILURE:110,RECV_PAY_WITHDRAWAL_PERMANENT_FAILED:111,RECV_PAY_SENDER_CANCELED:112,SEND_PAY_INIT:401,SEND_PAY_PENDING_RECEIVER:402,SEND_PAY_PENDING:403,SEND_PAY_REFUND_PENDING:404,SEND_PAY_SUCCESS:405,SEND_PAY_FAILURE:406,SEND_PAY_FAILURE_RISK:407,SEND_PAY_REFUNDED:408,SEND_PAY_REFUND_FAILED:409,SEND_PAY_FAILURE_RECEIVER:410,SEND_PAY_REFUND_FAILED_PROCESSING:411,SEND_PAY_PENDING_REFUND:412,SEND_PAY_AUTH_CANCEL_FAILED_PROCESSING:413,SEND_PAY_AUTH_CANCEL_FAILED:414,SEND_PAY_AUTH_CANCELED:415,SEND_PAY_EXPIRED:416,SEND_PAY_AUTH_SUCCESS:417,SEND_PAY_AUTH_SUCCESS_CANCELING:418,SEND_PAY_IN_REVIEW:419,SEND_PAY_PENDING_PROCESSING:420,SEND_PAY_USER_CANCELED:421,WITHDRAWAL_INIT:601,WITHDRAWAL_PENDING:602,WITHDRAWAL_IN_REVIEW:603,WITHDRAWAL_SUCCESS:604,WITHDRAWAL_FAILED:605,WITHDRAWAL_USER_CANCELED:606,WITHDRAWAL_EXPIRED:607,WITHDRAWAL_ACTIVE:608});t.NotificationTransactionStatus=a;const o={TYPE_P2P:"p2p",TYPE_P2M:"p2m",TYPE_P2M_PAYOUT:"payout",TYPE_WITHDRAWAL:"withdrawal",TYPE_DEPOSIT:"deposit",TYPE_REFUND:"refund"};t.PaymentTransactionTypeServerString=o;const s={PENDING_RECEIVER_SETUP:"PENDING_RECEIVER_SETUP",PENDING_SETUP:"PENDING_SETUP",PENDING:"PENDING",INITIAL:"INITIAL",SUCCESS:"SUCCESS",COMPLETED:"COMPLETED",IN_REVIEW:"IN_REVIEW",FAILED:"FAILED",DECLINED:"DECLINED",FAILURE:"FAILURE",FAILED_RISK:"FAILED_RISK",FAILED_PROCESSING:"FAILED_PROCESSING",FAILED_RECEIVER_PROCESSING:"FAILED_RECEIVER_PROCESSING",REFUND_FAILED_PROCESSING:"REFUND_FAILED_PROCESSING",REFUNDED:"REFUNDED",REFUND_FAILED:"REFUND_FAILED",EXPIRED:"EXPIRED",CANCELED:"CANCELLED",AUTH_SUCCESS:"AUTH_SUCCESS",AUTH_CANCELED:"AUTH_CANCELED",AUTH_CANCEL_FAILED_PROCESSING:"AUTH_CANCEL_FAILED_PROCESSING",AUTH_CANCEL_FAILED:"AUTH_CANCEL_FAILED",COLLECT_SUCCESS:"COLLECT_SUCCESS",COLLECT_FAILED:"COLLECT_FAILED",COLLECT_REJECTED:"COLLECT_REJECTED",COLLECT_EXPIRED:"COLLECT_EXPIRED",COLLECT_CANCELED:"COLLECT_CANCELED",FAILED_DA:"FAILED_DA",FAILED_DA_FINAL:"FAILED_DA_FINAL",REFUND_FAILED_DA:"REFUND_FAILED_DA",COLLECT_FAILED_RISK:"COLLECT_FAILED_RISK",WITHDRAWAL_PROCESSING:"WITHDRAWAL_PROCESSING",WITHDRAWAL_FAILURE:"WITHDRAWAL_FAILURE",WITHDRAWAL_PERMANENT_FAILED:"WITHDRAWAL_PERMANENT_FAILED",WITHDRAWAL_ACTIVE:"WITHDRAWAL_ACTIVE"};t.PaymentTransactionStatusServerString=s},244670:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleMessageRetryRequest=function(e){const t=_.default.parse(e);if(t.error)return __LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,Promise.reject(t.error);const n=t.success,{from:r,participant:a,recipient:s,retryCount:u,stanzaId:d}=n;if(null==d)return __LOG__(3)`Received null stanzaID when handling message retry request`,Promise.reject(new Error("Received null stanzaID when handling message retry request"));const f=(0,o.wap)("ack",{id:(0,o.CUSTOM_STRING)(d),to:(0,l.JID)(r),participant:a?(0,l.DEVICE_JID)(a):o.DROP_ATTR,class:"receipt",type:"retry"}),g=C(r,s);if(!g)return Promise.resolve(f);return(0,c.handleMessage)(String(g),!1,(0,i.default)((function*(){const e=yield v(n);if(null==e)return f;const{originalMsgId:t,chat:i,requester:o,identityRowId:l}=e;try{const e=yield(0,p.getMsgIfAuthorized)(t,i,o,u,l);if(!e)return __LOG__(3)`handleMessageRetryRequest msg retry not authorized`,f;yield(0,h.sendRetry)(r,a,s,e,u)}catch(e){__LOG__(3)`handleMessageRetryRequest error: ${e}`}return f})))},t.handleVoipRetryRequest=function(){return T.apply(this,arguments)};var i=r(n(348926)),a=n(616310),o=n(738102),s=n(866729),l=n(355813),u=n(917504),c=n(412985),d=n(967762),p=n(929096),_=r(n(514209)),f=n(739172),h=n(723406),g=n(999821),m=r(n(9705)),y=n(459857),E=r(n(571834)),S=n(669050);function T(){return(T=(0,i.default)((function*(e){return null!=(yield v(e))}))).apply(this,arguments)}function v(){return A.apply(this,arguments)}function A(){return(A=(0,i.default)((function*(e){const{originalMsgId:t,from:n,participant:r,recipient:o,retryCount:l,offline:c}=e;if(l>=d.MAX_RETRY)return void __LOG__(2)`handleRetryRequest refusing retry attempt #${l}`;const _=C(n,o);if(!_)return void __LOG__(3)`handleRetryRequest: no chat found for incoming retry request.`;const h=_.isUser()?n:r;if(!h)return void __LOG__(3)`handleRetryRequest: no requester found for incoming retry request.`;const y=h.device||0;try{return(yield(0,s.hasDevice)(h,y))?yield f.sendMsgQueueMap.enqueue(_.toString(),(0,i.default)((function*(){yield(0,p.updateLocalSession)(_,e),yield(0,u.ensureE2ESessions)([h]);const n=yield m.default.getIdentityRowId((0,g.createSignalAddress)(h).toString());return{originalMsgId:t,chat:_,requester:h,identityRowId:n}}))):(__LOG__(3)`handleRetryRequest: no device ${y} found for ${h.user} for incoming retry request .`,void new E.default.MdRetryFromUnknownDevice({offline:c,senderType:y===a.DEFAULT_DEVICE_ID?E.default.DEVICE_TYPE.PRIMARY:E.default.DEVICE_TYPE.COMPANION}).commit())}catch(e){__LOG__(3)`handleRetryRequest error: ${e}`}}))).apply(this,arguments)}function C(e,t){return e.isUser()?(0,S.toUserWid)(e).equals((0,y.getMeUser)())?t||(__LOG__(3)`getActualChatId: from is a peer device, but without recipient`,null):(0,S.toUserWid)(e):e}},929096:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getMsgIfAuthorized=function(){return m.apply(this,arguments)},t.processKeyBundle=y,t.updateLocalSession=function(){return S.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(486492),s=n(565583),l=n(907539),u=r(n(565754)),c=n(387191),d=n(373070),p=n(121260),_=n(138706),f=n(459857),h=r(n(571834)),g=n(669050);function m(){return(m=(0,a.default)((function*(e,t,n,r,i){const a=(0,f.getMaybeMeLidUser)(),s=(0,f.getMeUser)(),_=n.isLid()&&null!=a?a:s,g=new u.default({id:e,remote:t,fromMe:!0,participant:t.isUser()?void 0:_}),m=yield(0,p.getTable)().get(String(g));if(!m)return __LOG__(3)`getMsgIfAuthorized: can not find msg ${g.toString()}.`,null;const y=m.type===d.MSG_TYPE.REVOKED?m.protocolMessageRowId:m.rowId;if(null==y)return __LOG__(3)`getMsgIfAuthorized: msg missing rowId ${g.toString()}.`,null;const E=yield(0,o.isRetryEligible)(g,n,i,y);__LOG__(2,void 0,void 0,void 0,["messaging"])`getMsgIfAuthorized: ${e}, ${String(n)} retry eligibility ${E}`;const S=new c.Msg((0,l.messageFromDbRow)(m));yield S.waitForPrep();let T=!1,v=h.default.RETRY_REJECT_REASON.OTHER;switch(S.type===d.MSG_TYPE.REVOKED&&(T=!0,S.type="protocol",S.subtype="admin"===S.subtype?"admin_revoke":"sender_revoke"),E){case o.RetryEligibilityResult.ELIGIBLE:return S;case o.RetryEligibilityResult.INELIGIBLE_ALREADY_DELIVERED:v=h.default.RETRY_REJECT_REASON.DOUBLE_CHECKMARK;break;case o.RetryEligibilityResult.INELIGIBLE_CHANGED_IDENTITY:v=h.default.RETRY_REJECT_REASON.IDENTITY_CHANGE;break;default:v=h.default.RETRY_REJECT_REASON.OTHER}return new h.default.E2eRetryReject({senderDeviceType:n.isCompanion()?h.default.DEVICE_TYPE.COMPANION:h.default.DEVICE_TYPE.PRIMARY,messageType:S.getWamMessageType(),msgRetryCount:r,retryRevoke:T,retryRejectReason:v}).commit(),null}))).apply(this,arguments)}function y(){return E.apply(this,arguments)}function E(){return(E=(0,a.default)((function*(e,t,n,r,a){return null!=n&&e&&e.key?a?null==r?(__LOG__(2)`processKeyBundle: missing session for retry`,yield _.Session.deleteRemoteInfo(t),!1):r!==n?(__LOG__(2)`processKeyBundle: delete session because reg does not match, saved: ${r}, received: ${n}`,yield _.Session.deleteRemoteInfo(t),!1):(__LOG__(2)`processKeyBundle: update local session with the retry key bundle`,yield _.Session.createSignalSession((0,i.default)({wid:t,regId:n},e)),!0):(__LOG__(2)`processKeyBundle: update local session with the retry key bundle`,yield _.Session.createSignalSession((0,i.default)({wid:t,regId:n},e)),!0):(__LOG__(2)`processKeyBundle: skip due to missing key bundle`,!1)}))).apply(this,arguments)}function S(){return(S=(0,a.default)((function*(e,t){const{from:r,keyBundle:i,offline:a,originalMsgId:o,participant:l,regId:u,retryCount:c}=t,d=l||r;if(__LOG__(2)`updateLocalSession: retryCount: ${c}, offline: ${a.toString()}, has keyBundle: ${(!!i).toString()}`,e.isGroup()){const t=n(965012).ChatCollection.get(e);t&&d&&(0,s.markForgetSenderKey)(t.id,[d])}const p=yield _.Session.getRemoteRegId(d);if((0,g.toUserWid)(d).equals((0,f.getMeUser)())&&p!==u)throw new Error(`updateLocalSession: detect registration Id change remote: ${u}, local: ${p} for peer device`);(yield y(i,d,u,p,a))||null!=p&&p!==u&&(__LOG__(2)`updateLocalSession: delete session because reg does not match, saved: ${p}, received: ${p}`,yield _.Session.deleteRemoteSession(d));if(2===c)return _.Session.saveSessionBaseKey(d,o);if(c>2){if(yield _.Session.hasSameBaseKey(d,o))return __LOG__(2)`updateLocalSession: delete local session due to same base key`,_.Session.deleteRemoteSession(d)}}))).apply(this,arguments)}},514209:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(769707),i=n(854379),a=n(459857);var o=new r.WapParser("retryRequestParser",(e=>{e.assertTag("receipt"),e.assertAttr("type","retry"),e.hasAttr("to")&&e.assertAttr("to",(0,a.assertGetMe)().toJid());const t=(0,i.jidWithTypeToWid)(e.attrJidWithType("from")),n=e.hasAttr("participant")?(0,i.deviceJidToDeviceWid)(e.attrDeviceJid("participant")):null,r=e.hasAttr("recipient")?(0,i.deviceJidToUserWid)(e.attrDeviceJid("recipient")):null,o=e.child("retry"),s=e.maybeChild("keys");let l=null;if(null!=s){var u;const e=s.child("skey"),t=s.child("key");l={identity:s.child("identity").contentBytes(32),deviceIdentity:null===(u=s.maybeChild("device-identity"))||void 0===u?void 0:u.contentBytes(),skey:{id:e.child("id").contentUint(3),pubkey:e.child("value").contentBytes(32),signature:e.child("signature").contentBytes(64)},key:{id:t.child("id").contentUint(3),pubkey:t.child("value").contentBytes(32)}}}return{stanzaId:e.attrString("id"),originalMsgId:o.attrString("id"),ts:e.attrTime("t"),retryCount:o.hasAttr("count")?o.attrInt("count"):0,regId:e.child("registration").contentUint(4),offline:e.hasAttr("offline"),from:t,participant:n,recipient:r,keyBundle:l}}));t.default=o},730104:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleCall=function(e){const t=m.parse(e);if(t.error)return __LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,Promise.resolve("NO_ACK");const{callCreator:n,from:r,message:i,payloadTag:o,stanzaId:c}=t.success,p=(0,s.wapNodeToVoipXml)(e),g={elapsed_msec:i.elapsed_msec,epoch_msec:i.epoch_msec,is_offline:i.is_offline,payload:p[2][0],peer_app_version:i.peer_app_version,peer_platform:i.peer_platform,peer_jid:i.peer_jid?i.peer_jid.toString({legacy:!0}):void 0},E=i.call_id;switch(i.type){case h.TYPE.OFFER:return y(r,c,E,n,i.type),(0,d.getDoNotDisturb)()&&!_.default.isFocused?__LOG__(2)`handleCall: ignoring incoming call offer because do not disturb mode is enabled or screen is locked`:(0,u.handleIncomingCallOffer)(i,g),Promise.resolve("NO_ACK");case h.TYPE.ENC_REKEY:return(0,u.handleIncomingEncRekey)(i,g).then((e=>{let{shouldRetry:t,retryCount:a}=e;t?(0,f.default)(c,i,a):y(r,c,E,n,h.TYPE.ENC_REKEY)})),Promise.resolve("NO_ACK");case h.TYPE.ACCEPT:case h.TYPE.REJECT:return y(r,c,E,n,i.type),(0,u.handleIncomingSignalingMsg)(i,g),Promise.resolve("NO_ACK");case h.TYPE.OFFER_NOTICE:return(0,l.default)(e);default:return(0,u.handleIncomingSignalingMsg)(i,g),Promise.resolve(function(e,t,n){return(0,a.wap)("ack",{to:(0,s.JID)(e),id:(0,a.CUSTOM_STRING)(t),class:"call",type:(0,a.MAYBE_CUSTOM_STRING)(n)})}(r,c,o))}};var i=n(911794),a=n(738102),o=n(769707),s=n(355813),l=(r(n(846870)),r(n(766770))),u=n(747360),c=n(854379),d=n(171612),p=n(459857),_=r(n(611592)),f=r(n(109037)),h=n(549227);function g(e){return h.TYPE[e.tag().toUpperCase()]||h.TYPE.NONE}const m=new o.WapParser("callParser",(e=>{e.assertTag("call");const t=(0,c.jidWithTypeToWid)(e.attrJidWithType("from")),n=e.mapFirstChild((e=>e));if(n){const r=n.attrString("call-id"),i=(0,c.jidWithTypeToWid)(n.attrJidWithType("call-creator")),a={call_id:r,call_creator:i,peer_jid:t,peer_platform:e.hasAttr("platform")?e.attrString("platform"):void 0,peer_app_version:e.hasAttr("version")?e.attrString("version"):void 0,epoch_msec:e.hasAttr("t")?String(1e3*e.attrInt("t")):void 0,elapsed_msec:e.hasAttr("e")?String(1e3*e.attrInt("e")):void 0,type:g(n),common:{call_id:r,peer_jid:t.toString(),type:String(g(n))},isVideoCall:n.hasChild("video"),t:e.attrTime("t")};return{from:(0,c.jidWithTypeToWid)(e.attrJidWithType("from")),stanzaId:e.attrString("id"),payloadTag:n.tag(),message:a,callCreator:i}}throw new Error("Unrecognized call stanza")}));function y(e,t,n,r,o){let l;switch(o){case h.TYPE.OFFER:l=(0,a.wap)("offer",{"call-id":(0,a.CUSTOM_STRING)(n),"call-creator":(0,s.JID)(r)});break;case h.TYPE.ENC_REKEY:l=(0,a.wap)("enc_rekey",{"call-id":(0,a.CUSTOM_STRING)(n),"call-creator":(0,s.JID)(r)});break;case h.TYPE.ACCEPT:l=(0,a.wap)("accept",{"call-id":(0,a.CUSTOM_STRING)(n),"call-creator":(0,s.JID)(r)});break;case h.TYPE.REJECT:l=(0,a.wap)("reject",{"call-id":(0,a.CUSTOM_STRING)(n),"call-creator":(0,s.JID)(r)})}(0,i.deprecatedCastStanza)((0,a.wap)("receipt",{to:(0,s.JID)(e),id:(0,a.CUSTOM_STRING)(t),from:(0,s.JID)((0,p.getMaybeMeUser)())},l))}},295595:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleCallReceipt=function(e){const t=l.parse(e);if(t.error)return __LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,Promise.reject(t.error);const{stanzaId:n,type:i,from:o}=t.success;return Promise.resolve((0,r.wap)("ack",{id:(0,r.CUSTOM_STRING)(n),to:(0,a.JID)(o),from:(0,a.JID)((0,s.getMaybeMeUser)()),class:"receipt",type:(0,r.MAYBE_CUSTOM_STRING)(i)}))};var r=n(738102),i=n(769707),a=n(355813),o=n(854379),s=n(459857);const l=new i.WapParser("callReceiptParser",(e=>{e.assertTag("receipt");if(!(e.maybeChild("offer")||e.maybeChild("accept")||e.maybeChild("reject")))throw e.createParseError("Unrecognized call stanza");return{stanzaId:e.attrString("id"),type:e.hasAttr("type")?e.attrString("type"):null,from:(0,o.jidWithTypeToWid)(e.attrJidWithType("from"))}}))},994534:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return _.apply(this,arguments)};var i=r(n(348926)),a=r(n(132375)),o=n(738102),s=n(769707),l=n(355813),u=n(244670),c=n(854379),d=n(961745);const p=new s.WapParser("rekeyRetryReceiptParser",(e=>{e.assertTag("receipt"),e.assertAttr("type","enc_rekey_retry");const t=e.child("enc_rekey");return{from:(0,c.jidWithTypeToWid)(e.attrJidWithType("from")),originalMsgId:t.attrString("call-id"),stanzaId:e.attrString("id"),retryCount:t.hasAttr("count")?t.attrInt("count"):0,regId:e.child("registration").contentUint(4),ts:null,participant:null,recipient:null,keyBundle:null,offline:!1}}));function _(){return(_=(0,i.default)((function*(e){const t=p.parse(e);if(t.error)throw __LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,t.error;const n=t.success,r=(0,o.wap)("ack",{id:(0,o.CUSTOM_STRING)((0,a.default)(n.stanzaId,"retryInfo.stanzaId")),to:(0,l.JID)(n.from),class:"receipt",type:"enc_rekey_retry"});try{return(yield(0,u.handleVoipRetryRequest)(n))?d.Voip.resendEncRekeyRetry(n.from.toString({legacy:!0,formatFull:!0}),n.retryCount):(__LOG__(3)`voip:handle_enc_rekey_retry_receipt: not sending enc_rekey retry`,d.Voip.endCall(n.originalMsgId)),r}catch(e){return __LOG__(3)`voip:handle_enc_rekey_retry_receipt: error while attempting to send enc_rekey retry`,r}}))).apply(this,arguments)}},766770:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=u.parse(e);if(t.error)return __LOG__(4,void 0,new Error)`Parsing Error: ${t.error.toString()}`,Promise.resolve("NO_ACK");const{stanzaId:n,fromWid:r,callCreator:a,callId:l,isGroup:c,isVideo:d,t:p}=t.success;return(0,s.default)(a,l,p,d,c),Promise.resolve((0,i.wap)("ack",{to:(0,o.JID)(r),id:(0,i.CUSTOM_STRING)(n),class:"call",type:(0,i.CUSTOM_STRING)("offer_notice")}))};var i=n(738102),a=n(769707),o=n(355813),s=r(n(526294)),l=n(854379);const u=new a.WapParser("callOfferNoticeParser",(e=>{e.assertTag("call");const t=e.attrString("id"),n=(0,l.jidWithTypeToWid)(e.attrJidWithType("from")),r=e.child("offer_notice");return{stanzaId:t,fromWid:n,callCreator:(0,l.deviceJidToDeviceWid)(r.attrDeviceJid("call-creator")),callId:r.attrString("call-id"),isGroup:"group"===r.attrString("type"),isVideo:"video"===r.attrString("media"),t:e.attrTime("t")}}))},434736:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseErrorFields=void 0;const r=new(n(769707).WapParser)("parseErrorFields",(e=>{const t=[];return e.forEachChildWithTag("field",(e=>{const n=e.hasAttr("detail")?e.maybeAttrString("detail"):null;t.push({name:e.attrString("name"),reason:e.attrString("reason"),detail:n})})),t}));t.parseErrorFields=r},106819:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=e.maybeChild("address"),n=t?t.contentString():void 0,r=e.maybeChild("description"),s=r?r.contentString():void 0,l=e.maybeChild("email"),u=l?l.contentString():void 0,c=e.maybeChild("latitude"),d=c?parseFloat(c.contentString()):void 0,p=e.maybeChild("longitude"),_=p?parseFloat(p.contentString()):void 0,f=e.maybeChild("vertical");let h;if(f){const e=f.maybeAttrString("canonical"),t=f.hasContent()?f.contentString():void 0;h={name:t,canonical:e}}const g=[];e.forEachChildWithTag("website",(e=>{g.push(e.contentString())}));const m=[],y=e.maybeChild("categories");y&&y.forEachChildWithTag("category",(e=>{const t=e.attrString("id");m.push({id:t,localized_display_name:e.contentString()})}));let E;const S=e.maybeChild("business_hours");if(S){const e=S.maybeAttrString("timezone"),t=[];S.forEachChildWithTag("business_hours_config",(e=>{t.push({day_of_week:e.attrString("day_of_week"),mode:e.attrString("mode"),open_time:e.hasAttr("open_time")?parseInt(e.attrString("open_time"),10):0,close_time:e.hasAttr("close_time")?parseInt(e.attrString("close_time"),10):0})})),E={config:t,timezone:e}}let T;const v=e.maybeChild("profile_options");if(v){T={};const e=v.maybeChild("commerce_experience");var A;if(e)T.commerce_experience=null!==(A=a.COMMERCE_EXPERIENCE_TYPES.cast(e.contentString()))&&void 0!==A?A:a.COMMERCE_EXPERIENCE_TYPES.NONE;const t=v.maybeChild("cart_enabled");t&&(T.cart_enabled="true"===t.contentString());const n=v.maybeChild("shop_url");n&&(T.shop_url=n.contentString());const r=v.maybeChild("commerce_manager_url");r&&(T.commerce_manager_url=r.contentString());const i=v.maybeChild("is_banned");i&&(T.is_banned="true"===i.contentString());const o=v.maybeChild("direct_connection");o&&(T.direct_connection="true"===o.contentString())}const C=e.maybeChild("direct_connection");let P;if(C){const e=C.maybeChild("default_postcode");P={enabled:"true"===C.maybeAttrString("enabled"),defaultPostcode:e?{code:e.attrString("code"),locationName:e.attrString("location_name")}:void 0}}const O=e.maybeChild("catalog_status"),I=O?O.attrString("status"):void 0;let M,b={},R={},N=!1;const w=e.maybeChild("linked_accounts");if(w){N=!0;const e=w.maybeChild("fb_page");if(e){const t=e.maybeChild("display_name"),n=e.maybeChild("likes");b={displayName:null==t?void 0:t.contentString(),likes:null==n?void 0:n.contentString(),id:e.maybeAttrString("id")}}const t=w.maybeChild("ig_professional");if(t){const e=t.maybeChild("ig_handle"),n=t.maybeChild("followers");R={handle:null==e?void 0:e.contentString(),followers:null==n?void 0:n.contentString()}}}const L=e.maybeChild("cover_photo"),D=L?{id:L.attrString("id"),url:new URL(L.contentString())}:void 0;if((0,i.isCustomURLViaBizProfileEnabled)()){const t=e.maybeChild("custom_url");t&&(M=null==t?void 0:t.contentString())}const k={address:n,description:s,email:u,latitude:d,longitude:_,vertical:h,website:g,categories:m,business_hours:E,catalog_status:I,profile_options:T,fbPage:b,igProfessional:R,isProfileLinked:N,directConnection:P,cover_photo:D,customUrlPath:M};return(0,o.default)(k)};var i=n(72696),a=n(817649),o=r(n(176309))},65230:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=e.attrEnum("verified_level",r.MSG_VERIFIED_LEVEL),n=e.hasContent()?e.contentBytes():null,o=e.maybeAttrString("serial"),{serial:s,name:l,isApi:u,isSmb:c}=n&&function(e){const t=(0,a.getParsedProtoObjects)(e);if(null==t?void 0:t.details){const{name:e,serial:n,isApi:r,isSmb:i}=(0,a.extractCertificateDetailsParams)(t.details);return{name:e,serial:String(n),isApi:r,isSmb:i}}}(n)||{},d=i.ActualActorsEnumType.cast(e.maybeAttrInt("actual_actors")),p=i.HostStorageEnumType.cast(e.maybeAttrInt("host_storage")),_=e.maybeAttrInt("privacy_mode_ts");return{level:t,serial:o||s,name:l,isApi:!0===u,isSmb:!0===c,privacyMode:null!=d&&null!=p&&null!=_?{actualActors:d,hostStorage:p,privacyModeTs:_}:null}};var r=n(883310),i=n(257845),a=n(929840)},570103:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getCustomUrlPaths=function(){return d.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(984330),u=n(355813);const c=new s.WapParser("customURLResponse",(e=>{e.assertTag("iq"),e.assertFromServer();const t=e.child("custom_urls"),n=[];return t.forEachChildWithTag("custom_url",(e=>{const t=e.maybeChild("path");if(t){const e=t.contentString();null!=e&&n.push(e)}})),{paths:n}}));function d(){return(d=(0,i.default)((function*(e){const t=(0,o.wap)("iq",{smax_id:"78",xmlns:"fb:thrift_iq",type:"get",to:o.S_WHATSAPP_NET,id:(0,o.generateId)()},(0,o.wap)("user",{jid:(0,u.JID)(e)})),n=yield(0,a.deprecatedSendIq)(t,c);if(!n.success||!n.result)throw new l.ServerStatusCodeError(n.errorCode,n.errorText);return n.result}))).apply(this,arguments)}},262661:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getUserByCustomURL=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(984330);const u=new s.WapParser("customURLResponse",(e=>{e.assertTag("iq"),e.assertFromServer();return{user:{jid:e.child("user").attrUserJid("jid")}}}));function c(){return(c=(0,i.default)((function*(e){const t=(0,o.wap)("iq",{smax_id:"79",xmlns:"fb:thrift_iq",type:"get",to:o.S_WHATSAPP_NET,id:(0,o.generateId)()},(0,o.wap)("custom_url",null,(0,o.wap)("path",null,e))),n=yield(0,a.deprecatedSendIq)(t,u);if(!n.success)throw new l.ServerStatusCodeError(n.errorCode,n.errorText);return n.result}))).apply(this,arguments)}},40110:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.createOrderMD=function(){return p.apply(this,arguments)},t.createOrderResponse=void 0;var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(984330),u=n(355813);const c=new s.WapParser("createOrderResponse",(e=>{e.assertTag("iq"),e.assertFromServer();const t=e.child("order"),n=t.attrString("id"),r=t.attrString("token"),i=t.maybeChild("price"),a={},o=null==i?void 0:i.maybeChild("subtotal");o&&(a.subtotal=o.contentString());const s=null==i?void 0:i.maybeChild("total");s&&(a.total=s.contentString());const l=null==i?void 0:i.maybeChild("currency");l&&(a.currency=l.contentString());const u=null==i?void 0:i.maybeChild("price_status");return u&&(a.price_status=u.contentString()),{id:n,token:r,price:a}}));function d(e){const t=null!=e.priceAmount1000?(0,o.wap)("price",null,e.priceAmount1000.toString()):void 0,n=e.currency?(0,o.wap)("currency",null,e.currency):void 0;return(0,o.wap)("product",null,(0,o.wap)("id",null,e.id),(0,o.wap)("name",null,e.name),t,n,(0,o.wap)("quantity",null,e.quantity.toString()))}function p(){return(p=(0,i.default)((function*(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=(0,o.wap)("iq",{to:o.S_WHATSAPP_NET,smax_id:"10",xmlns:"fb:thrift_iq",id:(0,o.generateId)(),type:"set"},(0,o.wap)("order",{op:(0,o.CUSTOM_STRING)("create"),biz_jid:(0,u.USER_JID)(e)},t.map((e=>d(e))).concat(n?(0,o.wap)("direct_connection_encrypted_info",null,n):[]))),i=yield(0,a.deprecatedSendIq)(r,c);if(i.success)return i.result;if(451===i.errorCode)throw new l.E451;throw new l.ServerStatusCodeError(i.errorCode)}))).apply(this,arguments)}t.createOrderResponse=c},897769:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.queryOrder=function(){return d.apply(this,arguments)},t.queryOrderResponse=void 0;var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(984330),u=n(72696);const c=new s.WapParser("queryOrderResponse",(e=>{e.assertTag("iq"),e.assertFromServer();const t=e.child("order"),n=t.hasAttr("creation_ts")?t.attrTime("creation_ts"):null,r=t.maybeChild("price"),i=null==r?void 0:r.maybeChild("subtotal"),a=i?parseInt(i.contentString(),10):null,o=null==r?void 0:r.maybeChild("currency"),s=o?o.contentString():null,l=null==r?void 0:r.maybeChild("tax"),u=l?parseInt(l.contentString(),10):null,c=null==r?void 0:r.maybeChild("total"),d=c?parseInt(c.contentString(),10):null,p=[];return t.forEachChildWithTag("product",(e=>{const t=e.child("id").contentString(),n=e.child("name").contentString(),r=e.maybeChild("price"),i=r?parseInt(r.contentString(),10):null,a=e.maybeChild("quantity"),o=a?parseInt(a.contentString(),10):null,s=e.maybeChild("currency"),l=s?s.contentString():null;let u=null,c=null;const d=e.maybeChild("image");if(null!=d){const e=d.maybeChild("url");c=e&&e.hasContent()?e.contentString():null;const t=d.maybeChild("id");u=t&&t.hasContent()?t.contentString():null}p.push({id:t,price:i,thumbnailId:u,thumbnailUrl:c,currency:l,name:n,quantity:o})})),{currency:s,createdAt:n,products:p,subtotal:a,total:d,tax:u}}));function d(){return(d=(0,i.default)((function*(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;if((0,u.commerceFeaturesDisabledBySanctions)())return Promise.reject(new l.E451);const s=(0,o.wap)("iq",{to:o.S_WHATSAPP_NET,smax_id:"5",xmlns:"fb:thrift_iq",id:(0,o.generateId)(),type:"get"},(0,o.wap)("order",{op:(0,o.CUSTOM_STRING)("get"),id:(0,o.CUSTOM_STRING)(e)},(0,o.wap)("image_dimensions",null,(0,o.wap)("width",null,t.toString()),(0,o.wap)("height",null,n.toString())),(0,o.wap)("token",null,r),i?(0,o.wap)("direct_connection_encrypted_info",null,i):null)),d=yield(0,a.deprecatedSendIq)(s,c);if(d.success)return d.result;if(451===d.errorCode)throw new l.E451;throw new l.ServerStatusCodeError(d.errorCode)}))).apply(this,arguments)}t.queryOrderResponse=c},113150:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.querySubscriptions=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(984330);const u=new s.WapParser("subscriptionsParser",(e=>{e.assertTag("iq"),e.assertFromServer();const t=e.child("subscriptions"),n=[];return t.forEachChildWithTag("subscription",(e=>{const t=e.attrString("status"),r=e.maybeAttrInt("subscription_end_time"),i=e.attrString("id");n.push({id:i,status:t,expirationDate:r})})),n}));function c(){return(c=(0,i.default)((function*(){const e=(0,o.wap)("iq",{xmlns:"fb:thrift_iq",id:(0,o.generateId)(),type:"get",smax_id:"90",to:o.S_WHATSAPP_NET}),t=yield(0,a.deprecatedSendIq)(e,u);if(t.success)return t.result;throw new l.ServerStatusCodeError(t.errorCode,t.errorText)}))).apply(this,arguments)}},524503:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addProductMD=function(){return _.apply(this,arguments)},t.addProductResponse=void 0;var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(984330),u=n(646083),c=n(72696),d=n(434736);const p=new s.WapParser("addProductResponse",(e=>{e.assertTag("iq"),e.assertFromServer();const t=e.child("product_catalog_add").child("product");return(0,u.parseProductNode)(t)}));function _(){return(_=(0,i.default)((function*(e,t,n){if((0,c.commerceFeaturesDisabledBySanctions)())throw new l.E451;const r=(0,o.wap)("iq",{id:(0,o.generateId)(),to:o.S_WHATSAPP_NET,type:"set",xmlns:"w:biz:catalog"},(0,o.wap)("product_catalog_add",{v:"1"},(0,u.productModelToNode)(e),(0,o.wap)("width",null,t.toString()),(0,o.wap)("height",null,n.toString()))),i=yield(0,a.deprecatedSendIqErrorParser)(r,p,d.parseErrorFields);if(i.success)return i.result;if(451===i.errorCode)throw new l.E451;throw null!=i.customError?new l.CatalogEditServerError(i.errorCode,i.customError):new l.ServerStatusCodeError(i.errorCode)}))).apply(this,arguments)}t.addProductResponse=p},650184:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.appealProductMD=function(){return d.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(984330),u=n(72696);const c=new s.WapParser("appealProductResponse",(e=>{e.assertTag("iq"),e.assertFromServer();return"true"===e.child("response").child("success").contentString()}));function d(){return(d=(0,i.default)((function*(e,t){if((0,u.commerceFeaturesDisabledBySanctions)())throw new l.E451;const n=(0,o.wap)("iq",{id:(0,o.generateId)(),to:o.S_WHATSAPP_NET,type:"set",xmlns:"fb:thrift_iq"},(0,o.wap)("request",{type:"appeal_product"},(0,o.wap)("reason",null,t),(0,o.wap)("id",null,e))),r=yield(0,a.deprecatedSendIq)(n,c);if(r.success)return r.result;if(451===r.errorCode)throw new l.E451;throw new l.ServerStatusCodeError(r.errorCode)}))).apply(this,arguments)}},728408:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.deleteProductsMD=function(){return d.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(984330),u=n(72696);const c=new s.WapParser("productDeleteResponse",(e=>{e.assertTag("iq"),e.assertFromServer();return{deletedCount:e.child("product_catalog_delete").attrInt("deleted_count")}}));function d(){return(d=(0,i.default)((function*(e){if((0,u.commerceFeaturesDisabledBySanctions)())throw new l.E451;const t=(0,o.wap)("iq",{id:(0,o.generateId)(),to:o.S_WHATSAPP_NET,type:"set",xmlns:"w:biz:catalog"},(0,o.wap)("product_catalog_delete",{v:"1"},e.map((e=>(0,o.wap)("product",null,(0,o.wap)("id",null,e)))))),n=yield(0,a.deprecatedSendIq)(t,c);if(n.success)return n.result;if(451===n.errorCode)throw new l.E451;throw new l.ServerStatusCodeError(n.errorCode)}))).apply(this,arguments)}},519897:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return _.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(984330),u=n(646083),c=n(72696),d=n(434736);const p=new s.WapParser("editProductResponse",(e=>{e.assertTag("iq"),e.assertFromServer();const t=e.child("product_catalog_edit").child("product");return(0,u.parseProductNode)(t)}));function _(){return(_=(0,i.default)((function*(e,t,n){if((0,c.commerceFeaturesDisabledBySanctions)())throw new l.E451;const r=(0,o.wap)("iq",{id:(0,o.generateId)(),to:o.S_WHATSAPP_NET,type:"set",xmlns:"w:biz:catalog"},(0,o.wap)("product_catalog_edit",{v:"1"},(0,u.productModelToNode)(e),(0,o.wap)("width",null,t.toString()),(0,o.wap)("height",null,n.toString()))),i=yield(0,a.deprecatedSendIqErrorParser)(r,p,d.parseErrorFields);if(i.success)return i.result;if(451===i.errorCode)throw new l.E451;throw i.customError?new l.CatalogEditServerError(i.errorCode,i.customError):new l.ServerStatusCodeError(i.errorCode)}))).apply(this,arguments)}},646083:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.parseProductNode=void 0,t.productModelToNode=function(e){var t,n;const r=e.id?(0,a.wap)("id",null,e.id.toString()):void 0,o=e.description?(0,a.wap)("description",null,e.description):void 0,c=e.url?(0,a.wap)("url",null,e.url):void 0,d=e.retailerId?(0,a.wap)("retailer_id",null,e.retailerId):void 0,p=null!=e.priceAmount1000?(0,a.wap)("currency",null,e.currency):void 0,_=null!=e.priceAmount1000?(0,a.wap)("price",null,e.priceAmount1000.toString()):void 0,f=[(0,a.wap)("image",null,(0,a.wap)("url",null,e.imageCdnUrl))].concat(null===(t=e.additionalImageCdnUrl)||void 0===t?void 0:t.map((e=>(0,a.wap)("image",null,(0,a.wap)("url",null,e))))),h=function(e){var t,n,r,i,o,l;const{isExempt:u,hasCountryCodeOrigin:c,hasImporterName:d,hasImporterAddress:p}=(0,s.scanComplianceInfoForMissingData)(e);return!u&&(c||d||p)?(0,a.wap)("compliance_info",null,c?(0,a.wap)("country_code_origin",null,null==e?void 0:e.countryCodeOrigin):void 0,d?(0,a.wap)("importer_name",null,null==e?void 0:e.importerName):void 0,p?(0,a.wap)("importer_address",null,(null==e||null===(t=e.importerAddress)||void 0===t?void 0:t.street1)?(0,a.wap)("street1",null,e.importerAddress.street1):void 0,(null==e||null===(n=e.importerAddress)||void 0===n?void 0:n.street2)?(0,a.wap)("street2",null,e.importerAddress.street2):void 0,(null==e||null===(r=e.importerAddress)||void 0===r?void 0:r.city)?(0,a.wap)("city",null,e.importerAddress.city):void 0,(null==e||null===(i=e.importerAddress)||void 0===i?void 0:i.region)?(0,a.wap)("region",null,e.importerAddress.region):void 0,(null==e||null===(o=e.importerAddress)||void 0===o?void 0:o.postalCode)?(0,a.wap)("postal_code",null,e.importerAddress.postalCode):void 0,(null==e||null===(l=e.importerAddress)||void 0===l?void 0:l.countryCode)?(0,a.wap)("country_code",null,e.importerAddress.countryCode):void 0):void 0):void 0}(e.complianceInfo),g=(0,i.default)({is_hidden:e.isHidden?"true":"false"},(null===(n=e.complianceInfo)||void 0===n?void 0:n.countryCodeOrigin)===String(l.SyntheticCountryCode.NotApplicable)?{compliance_category:u.ProductComplianceCategory.CountryOriginExempt}:void 0);return(0,a.wap)("product",g,r,(0,a.wap)("name",null,e.name),o,c,d,(0,a.wap)("media",null,f),_,p,h)};var i=r(n(81109)),a=n(738102),o=n(753958),s=n(637842),l=n(537469),u=n(694630);t.parseProductNode=e=>{var t,n,r;const a=e.child("id").contentString(),s=e.maybeChild("url");let c="";s&&s.hasContent()&&(c=s.contentString());const d=e.child("name").contentString(),p=null!==(t=e.maybeAttrString("availability"))&&void 0!==t?t:u.ProductAvailability.UNKNOWN;let _=o.CART_ITEM_MAX_QUANTITY;const f=e.maybeAttrString("max_available");null!=f&&(_=Number(f));const h=e.maybeChild("max_available"),g=null==h?void 0:h.contentString();null!=g&&(_=Number(g));const m=e.maybeChild("description"),y=m?m.contentString():"",E=e.maybeChild("belongs_to"),S="true"===(null==E?void 0:E.contentString())||!1,T=[],v=[],A=[],C=e.child("media");let P=!0;C.forEachChildWithTag("image",(e=>{if(P)P=!1,T.push({key:"requested",value:e.child("request_image_url").contentString()}),T.push({key:"full",value:e.child("original_image_url").contentString()}),A.push(e.child("id").contentString());else{const t=[];t.push({key:"requested",value:e.child("request_image_url").contentString()}),t.push({key:"full",value:e.child("original_image_url").contentString()}),v.push(t),A.push(e.child("id").contentString())}}));const O=e.maybeChild("status_info"),I=(null==O?void 0:O.child("status").contentString())||"APPROVED",M=null==O||null===(n=O.maybeChild("can_appeal"))||void 0===n?void 0:n.contentString(),b=e.maybeChild("currency"),R=b?b.contentString():void 0,N=e.maybeChild("price"),w=null==N?void 0:N.contentString(),L=e.maybeChild("retailer_id"),D=L?L.contentString():"",k=!!e.hasAttr("is_hidden")&&"true"===e.attrString("is_hidden"),U=e.hasAttr("compliance_category")?u.ProductComplianceCategory.cast(e.attrString("compliance_category")):u.ProductComplianceCategory.Default,G=e.maybeChild("sale_price"),x=G?(0,i.default)({sale_price:null===(r=G.maybeChild("price"))||void 0===r?void 0:r.contentString()},G.hasChild("start_date")&&G.hasChild("end_date")?{sale_start_date:G.child("start_date").contentString(),sale_end_date:G.child("end_date").contentString()}:null):null,B=(0,i.default)({id:a,is_hidden:k,url:c,name:d,description:y,availability:p,max_available:_,additional_image_cdn_urls:v,image_cdn_urls:T,capability_to_review_status:[{key:"WHATSAPP",value:I}],whatsapp_product_can_appeal:"true"===M,image_hashes_for_whatsapp:A,currency:R,price:w,retailer_id:D,checkmark:S},x),F=e.maybeChild("compliance_info");return U===u.ProductComplianceCategory.CountryOriginExempt?B.compliance_info={country_code_origin:String(l.SyntheticCountryCode.NotApplicable)}:F&&(B.compliance_info=function(e){var t;const n=e.child("country_code_origin").contentString(),r=null===(t=e.maybeChild("importer_name"))||void 0===t?void 0:t.contentString(),i=e.maybeChild("importer_address"),a={country_code_origin:n,importer_name:r};var o,s,l;i&&(a.importer_address={street1:i.child("street1").contentString(),street2:null===(o=i.maybeChild("street2"))||void 0===o?void 0:o.contentString(),postal_code:null===(s=i.maybeChild("postal_code"))||void 0===s?void 0:s.contentString(),city:i.child("city").contentString(),region:null===(l=i.maybeChild("region"))||void 0===l?void 0:l.contentString(),country_code:i.child("country_code").contentString()});return a}(F)),B}},621753:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return d.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(984330),u=n(72696);const c=new s.WapParser("visibilitySetResponse",(e=>{e.assertTag("iq"),e.assertFromServer()}));function d(){return(d=(0,i.default)((function*(e){if((0,u.commerceFeaturesDisabledBySanctions)())throw new l.E451;const t=(0,o.wap)("iq",{to:o.S_WHATSAPP_NET,type:"set",xmlns:"w:biz:catalog",smax_id:"23",id:(0,o.generateId)()},(0,o.wap)("product_visibility_update",{v:"1"},e.map((e=>(0,o.wap)("product",{is_hidden:e.isHidden?"true":"false"},(0,o.wap)("id",null,e.productId)))))),n=yield(0,a.deprecatedSendIq)(t,c);if(n.success)return n.result;if(451===n.errorCode)throw new l.E451;throw new l.ServerStatusCodeError(n.errorCode)}))).apply(this,arguments)}},168965:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.createProductCatalog=function(){return d.apply(this,arguments)},t.productCatalogCreateResponse=void 0;var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(984330),u=n(72696);const c=new s.WapParser("productCatalogCreateResponse",(e=>{e.assertTag("iq"),e.assertFromServer(),e.child("product_catalog_create")}));function d(){return(d=(0,i.default)((function*(){if((0,u.commerceFeaturesDisabledBySanctions)())throw new l.E451;const e=(0,o.wap)("iq",{id:(0,o.generateId)(),to:o.S_WHATSAPP_NET,type:"set",xmlns:"w:biz:catalog"},(0,o.wap)("product_catalog_create",{version:"1"})),t=yield(0,a.deprecatedSendIq)(e,c);if(t.success)return t.result;if(451===t.errorCode)throw new l.E451;throw new l.ServerStatusCodeError(t.errorCode)}))).apply(this,arguments)}t.productCatalogCreateResponse=c},631991:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.parseProductGraphQL=function(e){var t,n,r,p,_,f,h,g,m;let{status_info:y,sale_price:E,product_availability:S,compliance_info:T}=e,v=(0,a.default)(e,c);const[A,...C]=null!==(t=null===(n=v.media)||void 0===n?void 0:n.images)&&void 0!==t?t:[],P=(0,i.default)((0,i.default)({id:(0,o.default)(v.id,"product.id"),retailer_id:null!==(r=v.retailer_id)&&void 0!==r?r:"",name:(0,o.default)(v.name,"product.name"),description:null!==(p=v.description)&&void 0!==p?p:"",url:null!==(_=v.url)&&void 0!==_?_:"",currency:v.currency,price:v.price,is_hidden:"ISHIDDEN_TRUE"===v.is_hidden,max_available:null!==(f=v.max_available)&&void 0!==f?f:s.CART_ITEM_MAX_QUANTITY,availability:S&&S in d?d[S]:u.ProductAvailability.UNKNOWN},null!=(null==E?void 0:E.price)?(0,i.default)({sale_price:E.price},null!=E.start_date&&null!=E.end_date?{sale_start_date:E.start_date,sale_end_date:E.end_date}:null):null),{},{checkmark:"true"===v.belongs_to,image_hashes_for_whatsapp:(null!==(h=null===(g=v.media)||void 0===g?void 0:g.images)&&void 0!==h?h:[]).map((e=>(0,o.default)(e.id,"img.id"))),image_cdn_urls:A?[{key:"requested",value:(0,o.default)(A.request_image_url,"firstImage.request_image_url")},{key:"full",value:(0,o.default)(A.original_image_url,"firstImage.original_image_url")}]:[],additional_image_cdn_urls:C.map((e=>[{key:"requested",value:(0,o.default)(e.request_image_url,"img.request_image_url")},{key:"full",value:(0,o.default)(e.original_image_url,"img.original_image_url")}])),whatsapp_product_can_appeal:"true"===(null==y?void 0:y.can_appeal),capability_to_review_status:[{key:"WHATSAPP",value:null!==(m=null==y?void 0:y.status)&&void 0!==m?m:"APPROVED"}]});if(null!=T){var O,I,M,b,R;const{importer_address:e}=T;P.compliance_info="COMPLIANCECATEGORY_COUNTRYORIGINEXEMPT"===v.compliance_category?{country_code_origin:l.SyntheticCountryCode.NotApplicable}:{country_code_origin:null!==(O=T.country_code_origin)&&void 0!==O?O:void 0,importer_name:null!==(I=T.importer_name)&&void 0!==I?I:void 0,importer_address:{street1:(0,o.default)(null==e?void 0:e.street1,"importerAddress?.street1"),street2:null!==(M=null==e?void 0:e.street2)&&void 0!==M?M:void 0,postal_code:null!==(b=null==e?void 0:e.postal_code)&&void 0!==b?b:void 0,city:(0,o.default)(null==e?void 0:e.city,"importerAddress?.city"),region:null!==(R=null==e?void 0:e.region)&&void 0!==R?R:void 0,country_code:(0,o.default)(null==e?void 0:e.country_code,"importerAddress?.country_code")}}}return P};var i=r(n(81109)),a=r(n(506479)),o=r(n(132375)),s=n(753958),l=n(537469),u=n(694630);n(270658);const c=["status_info","sale_price","product_availability","compliance_info"];const d={AVAILABLE_FOR_ANOTHER_POSTCODE:u.ProductAvailability.AVAILABLE_FOR_ANOTHER_POSTCODE,IN_STOCK:u.ProductAvailability.IN_STOCK,OUT_OF_STOCK:u.ProductAvailability.OUT_OF_STOCK}},830944:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.createCatalogEventLogger=t.GRAPHQL_CATALOG_ENDPOINT=void 0;var i=r(n(571834));const a=i.default.GRAPHQL_CATALOG_ENDPOINT;t.GRAPHQL_CATALOG_ENDPOINT=a;t.createCatalogEventLogger=e=>{const t=new i.default.GraphqlCatalogRequest({graphqlCatalogEndpoint:e});return{success:()=>{t.set({graphqlErrorCode:-1,graphqlRequestResult:i.default.GRAPHQL_REQUEST_RESULT.SUCCESS}),t.commit()},failure:e=>{let[n]=e;t.set({graphqlErrorCode:n.code,graphqlRequestResult:i.default.GRAPHQL_REQUEST_RESULT.FAILURE}),t.commit()}}}},535190:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.CollectionReorderError=void 0,t.appealCollection=function(){return M.apply(this,arguments)},t.createCollection=function(){return A.apply(this,arguments)},t.deleteCollection=function(){return P.apply(this,arguments)},t.editCollection=function(){return O.apply(this,arguments)},t.querySingleCollectionIQ=t.queryCollectionsIQ=void 0,t.reorderCollection=function(){return w.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(643930),s=n(738102),l=n(769707),u=n(984330),c=n(646083),d=n(72696),p=n(355813),_=n(791357),f=r(n(99398));const h=e=>{var t,n,r;return{status:e.child("status").contentString(),canAppeal:"true"===(null===(t=e.maybeChild("can_appeal"))||void 0===t?void 0:t.contentString().toLowerCase()),rejectReason:null===(n=e.maybeChild("reject_reason"))||void 0===n?void 0:n.contentString(),commerceUrl:null===(r=e.maybeChild("commerce_url"))||void 0===r?void 0:r.contentString()}},g=e=>{var t;const n=e.maybeChild("status_info"),r=n?h(n):void 0,i=(null==r?void 0:r.status)||"APPROVED",a=!!r&&r.canAppeal,o={id:e.child("id").contentString(),name:e.child("name").contentString(),isHidden:"TRUE"===(null===(t=e.maybeChild("is_hidden"))||void 0===t?void 0:t.contentString()),rejectReason:null==r?void 0:r.rejectReason,commerceUrl:null==r?void 0:r.commerceUrl,totalItemsCount:0,products:[],reviewStatus:i,canAppeal:a};return e.forEachChildWithTag("product",(e=>{o.products.push((0,c.parseProductNode)(e))})),o},m=new l.WapParser("collectionsResponse",(e=>{e.assertTag("iq"),e.assertFromServer();const t=e.child("collections"),n=[];t.forEachChildWithTag("collection",(e=>{n.push(g(e))}));const r=t.child("paging").child("after"),i=r.hasContent()?r.contentString():"";return{collections:n,afterCursor:i}})),y=function(){var e=(0,i.default)((function*(e){let{catalogWid:t,afterCursor:n,limit:r,productsCount:i,width:o,height:l,directConnectionEncryptedInfo:c=null}=e;if((0,d.commerceFeaturesDisabledBySanctions)())throw new u.E451;const _=n?(0,s.wap)("after",null,n):void 0,f=(0,s.wap)("iq",{to:s.S_WHATSAPP_NET,type:"get",xmlns:"w:biz:catalog",id:(0,s.generateId)(),smax_id:"35"},(0,s.wap)("collections",{biz_jid:(0,p.DEVICE_JID)(t)},(0,s.wap)("collection_limit",null,r.toString()),(0,s.wap)("item_limit",null,i.toString()),(0,s.wap)("width",null,o.toString()),(0,s.wap)("height",null,l.toString()),_,c?(0,s.wap)("direct_connection_encrypted_info",null,c):null)),h=yield(0,a.deprecatedSendIq)(f,m);if(h.success)return h.result;if(404===h.errorCode)return{collections:[],afterCursor:""};if(451===h.errorCode)throw new u.E451;throw new u.ServerStatusCodeError(h.errorCode)}));return function(){return e.apply(this,arguments)}}();t.queryCollectionsIQ=y;const E=new l.WapParser("singleCollectionResponse",(e=>{e.assertTag("iq"),e.assertFromServer();const t=e.child("collection"),n=g(t),r=t.child("paging").child("after");return{collections:[n],afterCursor:r.hasContent()?r.contentString():""}})),S=function(){var e=(0,i.default)((function*(e){let{catalogWid:t,collectionId:n,afterCursor:r,limit:i,width:o,height:l,directConnectionEncryptedInfo:c=null}=e;if((0,d.commerceFeaturesDisabledBySanctions)())throw new u.E451;const _=r?(0,s.wap)("after",null,r):void 0,f=(0,s.wap)("iq",{to:s.S_WHATSAPP_NET,type:"get",xmlns:"w:biz:catalog",id:(0,s.generateId)(),smax_id:"30"},(0,s.wap)("collection",{biz_jid:(0,p.DEVICE_JID)(t),id:(0,s.CUSTOM_STRING)(n)},(0,s.wap)("limit",null,i.toString()),(0,s.wap)("width",null,o.toString()),(0,s.wap)("height",null,l.toString()),_,c?(0,s.wap)("direct_connection_encrypted_info",null,c):null)),h=yield(0,a.deprecatedSendIq)(f,E);if(h.success)return h.result;if(451===h.errorCode)throw new u.E451;throw new u.ServerStatusCodeError(h.errorCode)}));return function(){return e.apply(this,arguments)}}();t.querySingleCollectionIQ=S;const T=new l.WapParser("createOrEditCollectionResponse",(e=>{e.assertTag("iq"),e.assertFromServer();const t=e.child("collection"),n=t.child("id").contentString(),r=t.maybeChild("status_info");return{id:n,reviewStatus:r?h(r).status:"APPROVED"}})),v=new l.WapParser("createOrEditCollectionResponseErrorParser",(e=>{const t=e.attrString("code"),n=e.attrString("text"),r=e.maybeChild("field");return{code:t,text:n,fieldName:null==r?void 0:r.attrString("name"),fieldReason:null==r?void 0:r.attrString("reason")}}));function A(){return(A=(0,i.default)((function*(e,t,n){if((0,d.commerceFeaturesDisabledBySanctions)())throw new u.E451;const r=[];r.push((0,s.wap)("name",null,e)),r.push(...t.map((e=>(0,s.wap)("product",null,(0,s.wap)("id",null,e))))),r.push((0,s.wap)("catalog_session_id",null,n));const i=(0,s.wap)("iq",{to:s.S_WHATSAPP_NET,type:"set",xmlns:"w:biz:catalog",id:(0,s.generateId)(),smax_id:"36"},(0,s.wap)("collection",{op:"create"},r)),o=yield(0,a.deprecatedSendIqErrorParser)(i,T,v);if(o.success)return o.result;if(451===o.errorCode)throw new u.E451;throw o.customError}))).apply(this,arguments)}const C=new l.WapParser("deleteCollectionResponse",(e=>{e.assertTag("iq");const t=e.maybeChild("response");return null!=(null==t?void 0:t.maybeChild("success"))}));function P(){return(P=(0,i.default)((function*(e,t){if((0,d.commerceFeaturesDisabledBySanctions)())throw new u.E451;const n=(0,s.wap)("iq",{to:s.S_WHATSAPP_NET,type:"set",xmlns:"w:biz:catalog",id:(0,s.generateId)(),smax_id:"43"},(0,s.wap)("collections",{op:"delete"},(0,s.wap)("id",null,e),(0,s.wap)("catalog_session_id",null,t))),r=yield(0,a.deprecatedSendIq)(n,C);if(!r.success){if(451===r.errorCode)throw new u.E451;throw new u.ServerStatusCodeError(r.errorCode)}if(!r.result)throw new u.ServerStatusCodeError(500)}))).apply(this,arguments)}function O(){return(O=(0,i.default)((function*(e,t,n,r,i,o){if((0,d.commerceFeaturesDisabledBySanctions)())throw new u.E451;const l=(0,s.wap)("iq",{to:s.S_WHATSAPP_NET,type:"set",xmlns:"w:biz:catalog",id:(0,s.generateId)(),smax_id:"40"},(0,s.wap)("collection",{op:"update"},(0,s.wap)("id",null,e),t?(0,s.wap)("name",null,t):void 0,r.length>0?(0,s.wap)("add",null,r.map((e=>(0,s.wap)("id",null,e)))):void 0,i.length>0?(0,s.wap)("remove",null,i.map((e=>(0,s.wap)("id",null,e)))):void 0,(0,s.wap)("catalog_session_id",null,o))),c=yield(0,a.deprecatedSendIqErrorParser)(l,T,v);if(c.success)return c.result;if(451===c.errorCode)throw new u.E451;throw c.customError}))).apply(this,arguments)}const I=new l.WapParser("appealCollectionResponse",(e=>{e.assertTag("iq"),e.assertFromServer();const t=e.maybeChild("response");return null!=(null==t?void 0:t.maybeChild("success"))}));function M(){return(M=(0,i.default)((function*(e,t){if((0,d.commerceFeaturesDisabledBySanctions)())throw new u.E451;const n=t?(0,s.wap)("reason",null,t):void 0,r=(0,s.wap)("iq",{id:(0,s.generateId)(),to:s.S_WHATSAPP_NET,xmlns:"w:biz:catalog",type:"set",smax_id:"48"},(0,s.wap)("collection",{op:"appeal",id:(0,s.CUSTOM_STRING)(e)},n)),i=yield(0,a.deprecatedSendIq)(r,I);if(i.success)return i.result;if(451===i.errorCode)throw new u.E451;throw new u.ServerStatusCodeError(i.errorCode)}))).apply(this,arguments)}const b=new l.WapParser("reorderCollectionResponse",(e=>{e.assertTag("iq");const t=e.maybeChild("response");return null!=(null==t?void 0:t.maybeChild("success"))}));class R extends((0,o.customError)("CollectionReorderError",!0,Error)){constructor(){super("CollectionReorderError")}}t.CollectionReorderError=R;const N=n(76672)({ProductOutOfOrder:457,IndexOutOfBound:458});function w(){return(w=(0,i.default)((function*(e){if(!f.default.online)throw new _.HttpNetworkError;if((0,d.commerceFeaturesDisabledBySanctions)())throw new u.E451;const t=(0,s.wap)("iq",{id:(0,s.generateId)(),to:s.S_WHATSAPP_NET,xmlns:"w:biz:catalog",type:"set",smax_id:"92"},(0,s.wap)("collections",{op:"update"},(0,s.wap)("move",null,e.map((e=>{let[t,n,r]=e;return(0,s.wap)("id",{from_index:(0,s.CUSTOM_STRING)(n.toString()),to_index:(0,s.CUSTOM_STRING)(r.toString())},t)}))))),n=yield(0,a.deprecatedSendIq)(t,b);if(n.success)return n.result;if(451===n.errorCode)throw new u.E451;if([N.IndexOutOfBound,N.ProductOutOfOrder].includes(n.errorCode))throw new R;throw new u.ServerStatusCodeError(n.errorCode)}))).apply(this,arguments)}},818576:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,a=r(n(348926)),o=n(911794),s=r(n(639713)),l=n(738102),u=n(769707),c=n(984330),d=n(646083),p=n(72696),_=n(631991),f=n(830944),h=n(355813),g=n(550866),m=n(270658),y=n(459857);const E=new u.WapParser("catalogResponse",(e=>{e.assertTag("iq"),e.assertFromServer();const t=e.child("product_catalog"),n=[];t.forEachChildWithTag("product",(e=>{e.maybeChild("id")&&n.push((0,d.parseProductNode)(e))}));const r=t.child("paging"),i=r.child("before"),a=i.hasContent()?i.contentString():"",o=r.child("after"),s=o.hasContent()?o.contentString():"";return{data:n,paging:{cursors:{after:s,before:a}}}}));const S=function(){var e=(0,a.default)((function*(e){let{catalogWid:t,afterCursor:n,limit:r,width:i,height:a,checkmarkCollectionId:s,allowShopSource:u,directConnectionEncryptedInfo:d=null}=e;if((0,p.commerceFeaturesDisabledBySanctions)())throw new c.E451;const _=n?(0,l.wap)("after",null,n):void 0,f=s?(0,l.wap)("belongs_to",null,(0,l.wap)("collection_id",null,s)):void 0,g=(0,l.wap)("iq",{to:l.S_WHATSAPP_NET,type:"get",xmlns:"w:biz:catalog",id:(0,l.generateId)()},(0,l.wap)("product_catalog",{jid:(0,h.DEVICE_JID)(t),allow_shop_source:(m=u,m?"true":"false")},(0,l.wap)("limit",null,r.toString()),(0,l.wap)("width",null,i.toString()),(0,l.wap)("height",null,a.toString()),_,f,d?(0,l.wap)("direct_connection_encrypted_info",null,d):null));var m;const y=yield(0,o.deprecatedSendIq)(g,E);if(y.success)return y.result;if(451===y.errorCode)throw new c.E451;throw new c.ServerStatusCodeError(y.errorCode)}));return function(){return e.apply(this,arguments)}}(),T=function(){var e=(0,a.default)((function*(e){if((0,p.commerceFeaturesDisabledBySanctions)())throw new c.E451;try{var t,r,a;const{catalogWid:o,afterCursor:s,limit:l,width:u,height:c,checkmarkCollectionId:d,allowShopSource:p,directConnectionEncryptedInfo:h}=e,g=yield(0,m.fetchQuery)(void 0!==i?i:i=n(39063),{request:{product_catalog:{jid:o.toString(),allow_shop_source:p?"ALLOWSHOPSOURCE_TRUE":"ALLOWSHOPSOURCE_FALSE",width:String(u),height:String(c),direct_connection_encrypted_info:h,limit:String(l),after:s,catalog_session_id:d}}},{eventLogger:(0,f.createCatalogEventLogger)(f.GRAPHQL_CATALOG_ENDPOINT.GET_CATALOG)}),{paging:y,products:E}=(null==g||null===(t=g.xwa_product_catalog_get_product_catalog)||void 0===t?void 0:t.product_catalog)||{};return{data:E.map(_.parseProductGraphQL),paging:{cursors:{before:null!==(r=null==y?void 0:y.before)&&void 0!==r?r:"",after:null!==(a=null==y?void 0:y.after)&&void 0!==a?a:""}}}}catch(t){return t instanceof g.GraphQLServerError&&(0,s.default)(t),__LOG__(3)`GraphQL: Failed fetching xwa_product_catalog_get_product_catalog query. Falling back to IQ.`,S(e)}}));return function(){return e.apply(this,arguments)}}();var v=e=>((0,p.graphQLForCatalogM1Enabled)()&&!(0,y.getMaybeMeUser)().equals(e.catalogWid)?T:S)(e);t.default=v},471564:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.queryCatalogHasCategories=void 0;var i,a=r(n(348926)),o=r(n(639713)),s=n(830944),l=n(550866),u=n(270658);r(n(767916));const c=function(){var e=(0,a.default)((function*(e){let{catalogWid:t,directConnectionEncryptedInfo:r,imageDimensions:a={width:100,height:100},sessionId:c}=e;try{var d;const e=yield(0,u.fetchQuery)(void 0!==i?i:i=n(70649),{request:{categories:{biz_jid:t.toString(),direct_connection_encrypted_info:r,image_dimensions:a,catalog_session_id:c}}},{eventLogger:(0,s.createCatalogEventLogger)(s.GRAPHQL_CATALOG_ENDPOINT.GET_CATEGORIES)});return Boolean(null==e||null===(d=e.xwa_product_catalog_get_categories)||void 0===d?void 0:d.categories.length)}catch(e){if(e instanceof l.GraphQLServerError){const[t]=e.source.errors||[];if(2498052===(null==t?void 0:t.code))return!1;(0,o.default)(e)}return __LOG__(3)`GraphQL: Failed fetching xwa_product_catalog_get_categories query.`,!1}}));return function(){return e.apply(this,arguments)}}();t.queryCatalogHasCategories=c},340591:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,a=r(n(348926)),o=n(911794),s=r(n(639713)),l=r(n(132375)),u=n(738102),c=n(769707),d=n(984330),p=n(646083),_=n(72696),f=n(631991),h=n(830944),g=n(355813),m=n(550866),y=n(270658),E=n(459857);r(n(767916));const S=new c.WapParser("productResponse",(e=>{e.assertTag("iq"),e.assertFromServer();const t=e.child("product_catalog").child("product");return(0,p.parseProductNode)(t)})),T=function(){var e=(0,a.default)((function*(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;if((0,_.commerceFeaturesDisabledBySanctions)())throw new d.E451;const s=(0,u.wap)("iq",{to:u.S_WHATSAPP_NET,type:"get",xmlns:"w:biz:catalog",id:(0,u.generateId)()},(0,u.wap)("product",{jid:(0,g.DEVICE_JID)(e)},(0,u.wap)("product_id",null,t),(0,u.wap)("width",null,n.toString()),(0,u.wap)("height",null,r.toString()),i?(0,u.wap)("fetch_compliance_info",null,i.toString()):void 0,a?(0,u.wap)("direct_connection_encrypted_info",null,a):null)),l=yield(0,o.deprecatedSendIq)(s,S);if(l.success)return{data:l.result};if(404===l.errorCode)return{error:"NOT_FOUND"};throw 451===l.errorCode?new d.E451:new d.ServerStatusCodeError(l.errorCode)}));return function(){return e.apply(this,arguments)}}(),v=function(){var e=(0,a.default)((function*(){if((0,_.commerceFeaturesDisabledBySanctions)())throw new d.E451;for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const[a,o,u,c,p=!1,g=null]=t;try{var E,S;const e=yield(0,y.fetchQuery)(void 0!==i?i:i=n(141330),{request:{product:{jid:a.toString(),product_id:o,width:String(u),height:String(c),fetch_compliance_info:String(p),direct_connection_encrypted_info:g}}},{eventLogger:(0,h.createCatalogEventLogger)(h.GRAPHQL_CATALOG_ENDPOINT.GET_PRODUCT)}),t=(0,l.default)(null==e||null===(E=e.xwa_product_catalog_get_product)||void 0===E||null===(S=E.product_catalog)||void 0===S?void 0:S.product,"data?.xwa_product_catalog_get_product?.product_catalog?.product");return{data:(0,f.parseProductGraphQL)(t)}}catch(e){if(e instanceof m.GraphQLServerError){var v;const[t]=(null===(v=e.source)||void 0===v?void 0:v.errors)||[];if(2498052===(null==t?void 0:t.code))return{error:"NOT_FOUND"};(0,s.default)(e)}return __LOG__(3)`GraphQL: Failed fetching xwa_product_catalog_get_product query. Falling back to IQ.`,T(...t)}}));return function(){return e.apply(this,arguments)}}();var A=function(){var e;return((0,_.graphQLForCatalogM1Enabled)()&&!(null===(e=(0,E.getMaybeMeUser)())||void 0===e?void 0:e.equals(arguments.length<=0?void 0:arguments[0]))?v:T)(...arguments)};t.default=A},36707:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,a=r(n(348926)),o=r(n(639713)),s=n(984330),l=n(72696),u=n(631991),c=n(830944),d=n(550866),p=n(535190),_=n(270658),f=n(459857);r(n(767916));const h=function(){var e=(0,a.default)((function*(e){if((0,l.commerceFeaturesDisabledBySanctions)())throw new s.E451;try{const{catalogWid:t,afterCursor:r,limit:a,productsCount:o,width:s,height:l,directConnectionEncryptedInfo:d}=e,p=yield(0,_.fetchQuery)(void 0!==i?i:i=n(933644),{request:{collections:{biz_jid:t.toString(),collection_limit:String(a),item_limit:String(o),after:r,width:String(s),height:String(l),direct_connection_encrypted_info:d}}},{eventLogger:(0,c.createCatalogEventLogger)(c.GRAPHQL_CATALOG_ENDPOINT.GET_COLLECTIONS)}),{collections:f,paging:h}=(null==p?void 0:p.xwa_product_catalog_get_collections)||{};return{afterCursor:(null==h?void 0:h.after)||"",collections:f.map((e=>{let{id:t,name:n,status_info:r,products:i}=e;return{id:t||"",name:n||"",canAppeal:"true"===(null==r?void 0:r.can_appeal),isHidden:!1,reviewStatus:(null==r?void 0:r.status)||"APPROVED",totalItemsCount:0,products:i.map(u.parseProductGraphQL),rejectReason:null==r?void 0:r.reject_reason,commerceUrl:null==r?void 0:r.commerce_url}}))}}catch(n){if(n instanceof d.GraphQLServerError){var t;const[e]=(null===(t=n.source)||void 0===t?void 0:t.errors)||[];if(2498052===(null==e?void 0:e.code))return{collections:[],afterCursor:""};(0,o.default)(n)}return __LOG__(3)`GraphQL: Failed fetching xwa_product_catalog_get_collections query. Falling back to IQ.`,(0,p.queryCollectionsIQ)(e)}}));return function(){return e.apply(this,arguments)}}(),g=e=>{let{catalogWid:t}=e;return(0,l.graphQLForCollectionM2Enabled)()&&!(0,f.getMaybeMeUser)().equals(t)};var m=function(){return(g(...arguments)?h:p.queryCollectionsIQ)(...arguments)};t.default=m},804166:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,a=r(n(348926)),o=r(n(639713)),s=n(984330),l=n(72696),u=n(631991),c=n(830944),d=n(550866),p=n(535190),_=n(270658),f=n(459857);const h=function(){var e=(0,a.default)((function*(e){if((0,l.commerceFeaturesDisabledBySanctions)())throw new s.E451;try{const{catalogWid:t,collectionId:r,afterCursor:a,limit:o,width:s,height:l,directConnectionEncryptedInfo:d}=e,p=yield(0,_.fetchQuery)(void 0!==i?i:i=n(477174),{request:{collection:{biz_jid:t.toString(),id:r,limit:String(o),after:a,width:String(s),height:String(l),direct_connection_encrypted_info:d}}},{eventLogger:(0,c.createCatalogEventLogger)(c.GRAPHQL_CATALOG_ENDPOINT.GET_SINGLE_COLLECTION)}),{collection:f,paging:h}=(null==p?void 0:p.xwa_product_catalog_get_single_collection)||{},{id:g,name:m,status_info:y,products:E}=f||{};return{afterCursor:(null==h?void 0:h.after)||"",collections:[{id:g||"",name:m||"",canAppeal:"true"===(null==y?void 0:y.can_appeal),isHidden:!1,reviewStatus:(null==y?void 0:y.status)||"APPROVED",totalItemsCount:0,products:E.map(u.parseProductGraphQL),rejectReason:null==y?void 0:y.reject_reason,commerceUrl:null==y?void 0:y.commerce_url}]}}catch(t){return t instanceof d.GraphQLServerError&&(0,o.default)(t),__LOG__(3)`GraphQL: Failed fetching xwa_product_catalog_get_single_collection query. Falling back to IQ.`,(0,p.querySingleCollectionIQ)(e)}}));return function(){return e.apply(this,arguments)}}(),g=e=>{let{catalogWid:t}=e;return(0,l.graphQLForCollectionM2Enabled)()&&!(0,f.getMaybeMeUser)().equals(t)};var m=function(){return(g(...arguments)?h:p.querySingleCollectionIQ)(...arguments)};t.default=m},901671:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return p.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(984330),u=n(72696),c=n(355813);const d=new s.WapParser("reportProductResponse",(e=>{e.assertTag("iq"),e.assertAttr("type","result")}));function p(){return(p=(0,i.default)((function*(e,t,n){if((0,u.commerceFeaturesDisabledBySanctions)())throw new l.E451;const r=(0,o.wap)("iq",{to:o.S_WHATSAPP_NET,xmlns:"fb:thrift_iq",type:"set",id:(0,o.generateId)()},(0,o.wap)("request",{type:"report_product",biz_jid:(0,c.USER_JID)(e)},n?(0,o.wap)("reason",null,n):void 0,(0,o.wap)("id",null,t))),i=yield(0,a.deprecatedSendIq)(r,d);if(!i.success){if(451===i.errorCode)throw new l.E451;throw new l.ServerStatusCodeError(i.errorCode)}}))).apply(this,arguments)}},70649:e=>{"use strict";const t={fragment:{argumentDefinitions:n=[{defaultValue:null,kind:"LocalArgument",name:"request"}],kind:"Fragment",metadata:null,name:"WAWebQueryCatalogHasCategoriesQuery",selections:r=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"request"}],concreteType:"XWAProductCatalogGetCategoriesResponseSuccess",kind:"LinkedField",name:"xwa_product_catalog_get_categories",plural:!1,selections:[{alias:null,args:null,concreteType:"XWAProductCatalogGetCategoriesResponseSuccessCategoryWithSubCategories",kind:"LinkedField",name:"categories",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"WAWebQueryCatalogHasCategoriesQuery",selections:r},params:{id:"WAWebQueryCatalogHasCategoriesQuery",metadata:{},name:"WAWebQueryCatalogHasCategoriesQuery",operationKind:"query",text:null}};var n,r;t.hash="05cf640c4ace8fe9368dfe9c9768bcd9",e.exports=t},141330:e=>{"use strict";const t={fragment:{argumentDefinitions:n=[{defaultValue:null,kind:"LocalArgument",name:"request"}],kind:"Fragment",metadata:null,name:"WAWebQueryCatalogProductQuery",selections:a=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"request"}],concreteType:"XWAProductCatalogGetProductResponseSuccess",kind:"LinkedField",name:"xwa_product_catalog_get_product",plural:!1,selections:[{alias:null,args:null,concreteType:"XWAProductCatalogGetProductResponseSuccessProductCatalog",kind:"LinkedField",name:"product_catalog",plural:!1,selections:[{alias:null,args:null,concreteType:"XWACatalogProduct",kind:"LinkedField",name:"product",plural:!1,selections:[r={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"retailer_id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"is_hidden",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_availability",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"max_available",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductStatusInfo",kind:"LinkedField",name:"status_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"can_appeal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductSalePrice",kind:"LinkedField",name:"sale_price",plural:!1,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"start_date",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"end_date",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductMedia",kind:"LinkedField",name:"media",plural:!1,selections:[{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaImage",kind:"LinkedField",name:"images",plural:!0,selections:[r,{alias:null,args:null,kind:"ScalarField",name:"original_image_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"belongs_to",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"compliance_category",storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductComplianceInfo",kind:"LinkedField",name:"compliance_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"country_code_origin",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"importer_name",storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductComplianceInfoImporterAddress",kind:"LinkedField",name:"importer_address",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"street1",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"street2",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"postal_code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"city",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"region",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"country_code",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"WAWebQueryCatalogProductQuery",selections:a},params:{id:"WAWebQueryCatalogProductQuery",metadata:{},name:"WAWebQueryCatalogProductQuery",operationKind:"query",text:null}};var n,r,i,a;t.hash="1cfd9c20421504c7dcc5c2a615b9ea63",e.exports=t},39063:e=>{"use strict";const t={fragment:{argumentDefinitions:n=[{defaultValue:null,kind:"LocalArgument",name:"request"}],kind:"Fragment",metadata:null,name:"WAWebQueryCatalogQuery",selections:a=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"request"}],concreteType:"XWAProductCatalogGetResponseSuccess",kind:"LinkedField",name:"xwa_product_catalog_get_product_catalog",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogGetResponseSuccessProductCatalog",kind:"LinkedField",name:"product_catalog",plural:!1,selections:[{alias:null,args:null,concreteType:"XWACatalogProduct",kind:"LinkedField",name:"products",plural:!0,selections:[r={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"retailer_id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"is_hidden",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_availability",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"max_available",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductStatusInfo",kind:"LinkedField",name:"status_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"can_appeal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductSalePrice",kind:"LinkedField",name:"sale_price",plural:!1,selections:[i,{alias:null,args:null,kind:"ScalarField",name:"start_date",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"end_date",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductMedia",kind:"LinkedField",name:"media",plural:!1,selections:[{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaImage",kind:"LinkedField",name:"images",plural:!0,selections:[r,{alias:null,args:null,kind:"ScalarField",name:"original_image_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"belongs_to",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"compliance_category",storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductComplianceInfo",kind:"LinkedField",name:"compliance_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"country_code_origin",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"importer_name",storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductComplianceInfoImporterAddress",kind:"LinkedField",name:"importer_address",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"street1",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"street2",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"postal_code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"city",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"region",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"country_code",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogPaging",kind:"LinkedField",name:"paging",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"before",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"after",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"WAWebQueryCatalogQuery",selections:a},params:{id:"WAWebQueryCatalogQuery",metadata:{},name:"WAWebQueryCatalogQuery",operationKind:"query",text:null}};var n,r,i,a;t.hash="66429da6768590d7b59a5cb5971ac827",e.exports=t},933644:e=>{"use strict";const t={fragment:{argumentDefinitions:n=[{defaultValue:null,kind:"LocalArgument",name:"request"}],kind:"Fragment",metadata:null,name:"WAWebQueryProductCollectionsQuery",selections:l=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"request"}],concreteType:"XWAProductCatalogGetCollectionsResponseSuccess",kind:"LinkedField",name:"xwa_product_catalog_get_collections",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{alias:null,args:null,concreteType:"XWACatalogProductCollection",kind:"LinkedField",name:"collections",plural:!0,selections:[r={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogCollectionStatusInfo",kind:"LinkedField",name:"status_info",plural:!1,selections:[a={alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"can_appeal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"reject_reason",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"commerce_url",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogProduct",kind:"LinkedField",name:"products",plural:!0,selections:[r,{alias:null,args:null,kind:"ScalarField",name:"retailer_id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"is_hidden",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_availability",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"max_available",storageKey:null},i,{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null},s={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductStatusInfo",kind:"LinkedField",name:"status_info",plural:!1,selections:[o,a],storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductSalePrice",kind:"LinkedField",name:"sale_price",plural:!1,selections:[s,{alias:null,args:null,kind:"ScalarField",name:"start_date",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"end_date",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductMedia",kind:"LinkedField",name:"media",plural:!1,selections:[{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaImage",kind:"LinkedField",name:"images",plural:!0,selections:[r,{alias:null,args:null,kind:"ScalarField",name:"original_image_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"belongs_to",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"compliance_category",storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductComplianceInfo",kind:"LinkedField",name:"compliance_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"country_code_origin",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"importer_name",storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductComplianceInfoImporterAddress",kind:"LinkedField",name:"importer_address",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"street1",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"street2",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"postal_code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"city",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"region",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"country_code",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogPaging",kind:"LinkedField",name:"paging",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"after",storageKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"WAWebQueryProductCollectionsQuery",selections:l},params:{id:"WAWebQueryProductCollectionsQuery",metadata:{},name:"WAWebQueryProductCollectionsQuery",operationKind:"query",text:null}};var n,r,i,a,o,s,l;t.hash="12a9551193361530e95abb2b4c1b32a4",e.exports=t},477174:e=>{"use strict";const t={fragment:{argumentDefinitions:n=[{defaultValue:null,kind:"LocalArgument",name:"request"}],kind:"Fragment",metadata:null,name:"WAWebQueryProductSingleCollectionQuery",selections:l=[{alias:null,args:[{kind:"Variable",name:"request",variableName:"request"}],concreteType:"XWAProductCatalogGetSingleCollectionResponseSuccess",kind:"LinkedField",name:"xwa_product_catalog_get_single_collection",plural:!1,selections:[{alias:null,args:null,concreteType:"XWACatalogProductCollection",kind:"LinkedField",name:"collection",plural:!1,selections:[r={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogCollectionStatusInfo",kind:"LinkedField",name:"status_info",plural:!1,selections:[a={alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"can_appeal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"reject_reason",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"commerce_url",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogProduct",kind:"LinkedField",name:"products",plural:!0,selections:[r,{alias:null,args:null,kind:"ScalarField",name:"retailer_id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"is_hidden",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"product_availability",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"max_available",storageKey:null},i,{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"currency",storageKey:null},s={alias:null,args:null,kind:"ScalarField",name:"price",storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductStatusInfo",kind:"LinkedField",name:"status_info",plural:!1,selections:[o,a],storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductSalePrice",kind:"LinkedField",name:"sale_price",plural:!1,selections:[s,{alias:null,args:null,kind:"ScalarField",name:"start_date",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"end_date",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductMedia",kind:"LinkedField",name:"media",plural:!1,selections:[{alias:null,args:null,concreteType:"XWAProductCatalogProductMediaImage",kind:"LinkedField",name:"images",plural:!0,selections:[r,{alias:null,args:null,kind:"ScalarField",name:"original_image_url",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"request_image_url",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"belongs_to",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"compliance_category",storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductComplianceInfo",kind:"LinkedField",name:"compliance_info",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"country_code_origin",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"importer_name",storageKey:null},{alias:null,args:null,concreteType:"XWAProductCatalogProductComplianceInfoImporterAddress",kind:"LinkedField",name:"importer_address",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"street1",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"street2",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"postal_code",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"city",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"region",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"country_code",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"XWACatalogPaging",kind:"LinkedField",name:"paging",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"after",storageKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"WAWebQueryProductSingleCollectionQuery",selections:l},params:{id:"WAWebQueryProductSingleCollectionQuery",metadata:{},name:"WAWebQueryProductSingleCollectionQuery",operationKind:"query",text:null}};var n,r,i,a,o,s,l;t.hash="04369b38de2207faebf29136d50b8819",e.exports=t},761849:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.deleteCoverPhoto=function(){return h.apply(this,arguments)},t.editBusinessProfile=function(){return _.apply(this,arguments)},t.sendCoverPhoto=function(){return f.apply(this,arguments)},t.updateCartEnabled=function(){return p.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(984330);const u=new s.WapParser("businessProfileResponse",(e=>{e.assertTag("iq"),e.assertFromServer()})),c=new s.WapParser("commerceSettingsResponse",(e=>{e.assertTag("iq"),e.assertFromServer();return"true"===e.child("commerce_settings").child("cart").attrString("enabled")}));function d(e){let{note:t,timezone:n,config:r}=e;const i=[];for(const e in r){const t=r[e],{mode:n,hours:a}=t;if(a)for(const[t,r]of a)i.push({day_of_week:e,mode:n,open_time:t,close_time:r});else i.push({day_of_week:e,mode:n})}const a=[];return t&&a.push((0,o.wap)("business_hours_note",null,t)),a.push(...i.map((e=>(0,o.wap)("business_hours_config",{day_of_week:(0,o.CUSTOM_STRING)(e.day_of_week),mode:e.mode,open_time:e.open_time?(0,o.CUSTOM_STRING)(e.open_time.toString()):o.DROP_ATTR,close_time:e.close_time?(0,o.CUSTOM_STRING)(e.close_time.toString()):o.DROP_ATTR})))),(0,o.wap)("business_hours",{timezone:n?(0,o.CUSTOM_STRING)(n):o.DROP_ATTR},a)}function p(){return(p=(0,i.default)((function*(e){const t=(0,o.wap)("iq",{to:o.S_WHATSAPP_NET,smax_id:"25",xmlns:"fb:thrift_iq",id:(0,o.generateId)(),type:"set"},(0,o.wap)("commerce_settings",null,(0,o.wap)("cart",{enabled:(0,o.CUSTOM_STRING)(e.toString())}))),n=yield(0,a.deprecatedSendIq)(t,c);if(n.success)return n.result;throw new l.ServerStatusCodeError(n.errorCode)}))).apply(this,arguments)}function _(){return(_=(0,i.default)((function*(e){let{address:t,description:n,categories:r,email:i,website:s,businessHours:c}=e;const p=(0,o.wap)("iq",{to:o.S_WHATSAPP_NET,xmlns:"w:biz",id:(0,o.generateId)(),type:"set"},(0,o.wap)("business_profile",{v:"3",mutation_type:"delta"},void 0!==t?(0,o.wap)("address",null,t):null,void 0!==n?(0,o.wap)("description",null,n):null,void 0!==i?(0,o.wap)("email",null,i):null,s&&0===s.length?(0,o.wap)("website",null):null,s&&s.length>0?(0,o.wap)("website",null,s[0]):null,s&&s.length>1?(0,o.wap)("website",null,s[1]):null,r?(0,o.wap)("categories",null,r.map((e=>(0,o.wap)("category",{id:(0,o.CUSTOM_STRING)(e.id)})))):null,c?d(c):null)),_=yield(0,a.deprecatedSendIq)(p,u);if(!_.success)throw new l.ServerStatusCodeError(_.errorCode)}))).apply(this,arguments)}function f(){return(f=(0,i.default)((function*(e,t,n){const r=(0,o.wap)("iq",{to:o.S_WHATSAPP_NET,xmlns:"w:biz",id:(0,o.generateId)(),type:"set"},(0,o.wap)("business_profile",{v:"3",mutation_type:"delta"},(0,o.wap)("cover_photo",{op:"update",id:(0,o.CUSTOM_STRING)(e.toString()),ts:(0,o.CUSTOM_STRING)(t.toString()),token:(0,o.CUSTOM_STRING)(n)}))),i=yield(0,a.deprecatedSendIq)(r,u);if(!i.success)throw new l.ServerStatusCodeError(i.errorCode)}))).apply(this,arguments)}function h(){return(h=(0,i.default)((function*(e){const t=(0,o.wap)("iq",{to:o.S_WHATSAPP_NET,xmlns:"w:biz",id:(0,o.generateId)(),type:"set"},(0,o.wap)("business_profile",{v:"3",mutation_type:"delta"},(0,o.wap)("cover_photo",{op:"delete",id:(0,o.CUSTOM_STRING)(e.toString())}))),n=yield(0,a.deprecatedSendIq)(t,u);if(!n.success)throw new l.ServerStatusCodeError(n.errorCode)}))).apply(this,arguments)}},20970:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getMerchantCompliance=function(){return _.apply(this,arguments)},t.setMerchantCompliance=function(){return f.apply(this,arguments)};var i=r(n(348926)),a=r(n(81109)),o=n(911794),s=n(738102),l=n(769707),u=n(984330),c=n(355813);const d=e=>{var t,n,r;return{email:(null==e||null===(t=e.maybeChild("email"))||void 0===t?void 0:t.contentString())||"",landline_number:(null==e||null===(n=e.maybeChild("landline_number"))||void 0===n?void 0:n.contentString())||"",mobile_number:(null==e||null===(r=e.maybeChild("mobile_number"))||void 0===r?void 0:r.contentString())||""}},p=new l.WapParser("merchantComplianceResponse",(e=>{e.assertTag("iq"),e.assertFromServer();const t=[];return e.forEachChildWithTag("merchant_info",(e=>{var n,r,i,o;const s=(null===(n=e.maybeChild("entity_name"))||void 0===n?void 0:n.contentString())||"",l=(null===(r=e.maybeChild("entity_type"))||void 0===r?void 0:r.contentString())||"",u=null===(i=e.maybeChild("entity_type_custom"))||void 0===i?void 0:i.contentString(),c="true"===e.attrString("is_registered"),p=e.maybeChild("customer_care_details"),_=e.maybeChild("grievance_officer_details"),f=(0,a.default)({},d(p)),h=(0,a.default)({name:(null==_||null===(o=_.maybeChild("name"))||void 0===o?void 0:o.contentString())||""},d(_));t.push({entity_name:s,entity_type:l,is_registered:c,entity_type_custom:u,customer_care_details:f,grievance_officer_details:h})})),t}));function _(){return(_=(0,i.default)((function*(e){const t=(0,s.wap)("iq",{to:s.S_WHATSAPP_NET,xmlns:"w:biz:merchant_info",id:(0,s.generateId)(),type:"get",smax_id:"53"},e.map((e=>(0,s.wap)("merchant_info",{jid:(0,c.USER_JID)(e.wid)})))),n=yield(0,o.deprecatedSendIq)(t,p);if(n.success)return n.result;throw new u.ServerStatusCodeError(n.errorCode)}))).apply(this,arguments)}function f(){return(f=(0,i.default)((function*(){let{entityName:e,entityType:t,isRegistered:n,entityTypeCustom:r,customerCareDetails:i,grievanceOfficerDetails:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=(0,s.wap)("iq",{to:s.S_WHATSAPP_NET,xmlns:"w:biz:merchant_info",id:(0,s.generateId)(),type:"set",smax_id:"54"},(0,s.wap)("merchant_info",{is_registered:n?"true":"false"},void 0!==e?(0,s.wap)("entity_name",null,e):null,void 0!==t?(0,s.wap)("entity_type",null,t):null,void 0!==r?(0,s.wap)("entity_type_custom",null,r):null,i?(0,s.wap)("customer_care_details",null,void 0!==i.email?(0,s.wap)("email",null,i.email):null,void 0!==i.landlineNumber?(0,s.wap)("landline_number",null,i.landlineNumber):null,void 0!==i.mobileNumber?(0,s.wap)("mobile_number",null,i.mobileNumber):null):null,a?(0,s.wap)("grievance_officer_details",null,void 0!==a.name?(0,s.wap)("name",null,a.name):null,void 0!==a.email?(0,s.wap)("email",null,a.email):null,void 0!==a.landlineNumber?(0,s.wap)("landline_number",null,a.landlineNumber):null,void 0!==a.mobileNumber?(0,s.wap)("mobile_number",null,a.mobileNumber):null):null)),c=yield(0,o.deprecatedSendIq)(l,p);if(c.success)return c.result;throw new u.ServerStatusCodeError(c.errorCode)}))).apply(this,arguments)}},331923:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.queryBusinessCategories=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(984330);const u=new s.WapParser("businessCategoriesResponse",(e=>{e.assertTag("iq"),e.assertFromServer();const t=e.child("response"),n=[];let r="";try{const e=t.maybeChild("not_a_biz");null==e||e.forEachChildWithTag("category",(e=>{r=e.attrString("id")}));t.child("categories").forEachChildWithTag("category",(e=>{const t=e.attrString("id"),i=e.contentString();n.push({id:t,localized_display_name:i,not_a_biz:!!r.length&&t===r})}))}catch(e){}return{categories:n,notABizId:r}}));function c(){return(c=(0,i.default)((function*(e){const t=(0,o.wap)("iq",{to:o.S_WHATSAPP_NET,xmlns:"fb:thrift_iq",id:(0,o.generateId)(),type:"get"},(0,o.wap)("request",{op:(0,o.CUSTOM_STRING)("profile_typeahead"),type:"catkit",v:"1"},(0,o.wap)("query",null,e))),n=yield(0,a.deprecatedSendIq)(t,u);if(n.success)return n.result;throw new l.ServerStatusCodeError(n.errorCode)}))).apply(this,arguments)}},228733:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.mergeBusinessProfileAndCompliance=u,t.queryBusinessProfile=function(e,t){const n=(0,l.getBusinessProfileQueryVersion)();let r;r=t?Promise.all([(0,s.default)(e,n),(0,o.getMerchantCompliance)(e)]).then(u):(0,s.default)(e,n);return(0,a.attachErrorLogger)(r,"Query business profile failed")};var i=r(n(81109)),a=n(984330),o=n(20970),s=r(n(764059)),l=n(771146);function u(e){let[t,n]=e;return t.map(((e,t)=>(0,i.default)((0,i.default)({},e),{},{profile:(0,i.default)((0,i.default)({},e.profile),{},{legal_entity_details:n[t]})})))}},764059:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return _.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(984330),u=r(n(106819)),c=n(355813),d=n(854379);const p=new s.WapParser("businessProfileResponse",(e=>{e.assertTag("iq"),e.assertFromServer();const t=e.child("business_profile"),n=[];return t.forEachChildWithTag("profile",(e=>{const t=(0,d.jidWithTypeToWid)(e.attrJidWithType("jid")),r=e.attrString("tag"),i=(0,u.default)(e);Object.keys(i).length?n.push({wid:t,tag:r,profile:i}):n.push({wid:t,tag:r})})),n}));function _(){return(_=(0,i.default)((function*(e,t){const n=(0,o.wap)("iq",{to:o.S_WHATSAPP_NET,xmlns:"w:biz",id:(0,o.generateId)(),type:"get"},(0,o.wap)("business_profile",{v:(0,o.INT)(t)},e.map((e=>(0,o.wap)("profile",{jid:(0,c.USER_JID)(e.wid),tag:null!=e.tag?(0,o.INT)(e.tag):o.DROP_ATTR}))))),r=yield(0,a.deprecatedSendIq)(n,p);if(r.success)return r.result;throw new l.ServerStatusCodeError(r.errorCode)}))).apply(this,arguments)}},912513:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.queryTosState=function(){return c.apply(this,arguments)},t.resetTosState=function(){return d.apply(this,arguments)},t.updateTosState=function(){return p.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(984330);const u=new s.WapParser("tosNotices",(e=>{e.assertTag("iq"),e.assertFromServer();const t=e.child("tos"),n={refresh:t.attrInt("refresh"),notice:[]};return t.forEachChildWithTag("notice",(e=>{const t="false"!==e.maybeAttrString("state"),r=e.attrString("id");n.notice.push({id:r,state:t})})),(n.refresh>259200||n.refresh<7200)&&(n.refresh=86400),n}));function c(){return(c=(0,i.default)((function*(e){const t=(0,o.wap)("iq",{xmlns:"tos",id:(0,o.generateId)(),type:"get",to:o.S_WHATSAPP_NET},(0,o.wap)("request",null,e.map((e=>(0,o.wap)("notice",{id:(0,o.CUSTOM_STRING)(e)}))))),n=yield(0,a.deprecatedSendIq)(t,u);if(n.success)return n.result;throw new l.ServerStatusCodeError(n.errorCode,n.errorText)}))).apply(this,arguments)}function d(){return(d=(0,i.default)((function*(){}))).apply(this,arguments)}function p(){return(p=(0,i.default)((function*(e){const t=new s.WapParser("tosNoticesSet",(()=>{})),n=(0,o.wap)("iq",{xmlns:"tos",id:(0,o.generateId)(),type:"set",to:o.S_WHATSAPP_NET},(0,o.wap)("request",{type:"session_update"},e.map((e=>(0,o.wap)("notice",{id:(0,o.CUSTOM_STRING)(e)})))));yield(0,a.deprecatedSendIq)(n,t)}))).apply(this,arguments)}},817600:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseABProps=function(e){const t=new Map;e.forEach((e=>{const{configCode:n,configValue:r,configExpoKey:i}=e;t.set(n,{configValue:r,configExpoKey:i})}));const n=new Map;return Object.keys(r.ABPropConfigs).map((e=>{const i=r.ABPropConfigs[e][0],a=t.get(i),o=null==a?void 0:a.configValue,s=null==a?void 0:a.configExpoKey;n.set(i,{configValue:o,configExpoKey:null==s?null:s.toString()})})),n};var r=n(94728)},266485:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.syncABProps=h,t.syncABPropsTask=function(){return m.apply(this,arguments)};var i=r(n(348926)),a=n(476178),o=n(36530),s=n(287461),l=n(744655),u=n(183660),c=n(817600),d=n(917406),p=n(827012),_=n(780549),f=n(446715);function h(){return g.apply(this,arguments)}function g(){return(g=(0,i.default)((function*(){let e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t&&(e=(0,u.getHash)());const n=yield(0,a.getAbPropsProtocol)(e);if(!n.success)return!1;const{abKey:r,hash:i,refresh:o,props:s}=n.value,d=Date.now();if((0,l.updateGlobalABKey)(null!=r?r:""),(0,u.updateAttributesLocalStorage)(r,e,o,d),null==i)return!1;try{return yield(0,p.updateABPropConfigs)((0,c.parseABProps)(s)),!0}catch(e){__LOG__(4,!0,new Error,!0)`update ABProps config table failed`,SEND_LOGS("update ABProps config table failed when syncing ABProps")}return!1}))).apply(this,arguments)}function m(){return(m=(0,i.default)((function*(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const t=(0,u.isABPropsAfterFirstSync)();let n=3;for(;n-- >0;)try{const n=t?{pnh_cag_upgrade:(0,s.getABPropConfigValue)("pnh_cag_upgrade"),pnh_group_lid:(0,s.getABPropConfigValue)("pnh_group_lid")}:null;if(yield h(t&&e))return yield(0,d.updateABPropsFromStorage)(),void _.Cmd.onAbPropsUpdate(n)}catch(e){0===n&&(__LOG__(4,!0,new Error,!0)`failed to sync ABProps`,SEND_LOGS("failed to sync ABProps")),yield(0,o.delayMs)(1e4*Math.random())}}))).apply(this,arguments)}_.Cmd.on("on_ab_props_update",function(){var e=(0,i.default)((function*(e){yield Promise.all([(0,f.ensureNonCriticaDataSyncIsInitialized)(),(0,f.handlePnhCagUpgradeABPropConfigValueChange)(e),(0,f.handlePnhGroupLidABPropConfigValueChange)(e)])}));return function(){return e.apply(this,arguments)}}())},546927:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getPushServerSettings=function(){return u.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102);const s=new(n(769707).WapParser)("getPushServerSettings",(e=>{if(!e.hasChild("error")){__LOG__(2,void 0,void 0,void 0,["push-notification"])`getPushServerSettings: success`;return e.child("settings").attrString("webserverkey")}const t=e.child("error"),n=t.attrInt("code"),r=t.attrString("text");return __LOG__(3,void 0,void 0,void 0,["push-notification"])`getPushServerSettingsRequest: server response with ${n}, ${r}`,{errorCode:n,errorText:r}})),l=(0,o.wap)("iq",{to:o.S_WHATSAPP_NET,type:"get",xmlns:"urn:xmpp:whatsapp:push",id:(0,o.generateId)()},(0,o.wap)("settings",null));function u(){return(u=(0,i.default)((function*(){const e=yield(0,a.deprecatedSendIq)(l,s);if(!e.success){const{errorCode:t,errorText:n}=e;return{errorCode:t,errorText:n}}return e.result}))).apply(this,arguments)}},215995:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.setPushConfig=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(417405),o=n(911794),s=r(n(132375)),l=n(738102);const u=new(n(769707).WapParser)("setPushConfig",(e=>{if(!e.hasChild("error"))return void __LOG__(2,void 0,void 0,void 0,["push-notification"])`setPushConfig: success`;const t=e.child("error"),n=t.attrInt("code"),r=t.attrString("text");return __LOG__(3,void 0,void 0,void 0,["push-notification"])`setPushConfig: server response with ${n}, ${r}`,{errorCode:n,errorText:r}}));function c(){return(c=(0,i.default)((function*(e){const t=(0,l.wap)("iq",{to:l.S_WHATSAPP_NET,type:"set",xmlns:"urn:xmpp:whatsapp:push",id:(0,l.generateId)()},(0,l.wap)("config",{platform:"web",endpoint:(0,l.CUSTOM_STRING)(e.endpoint),auth:(0,l.CUSTOM_STRING)((0,a.encodeB64)((0,s.default)(e.getKey("auth"),"pushSubscription.getKey('auth')"))),p256dh:(0,l.CUSTOM_STRING)((0,a.encodeB64)((0,s.default)(e.getKey("p256dh"),"pushSubscription.getKey('p256dh')")))})),n=yield(0,o.deprecatedSendIq)(t,u);if(!n.success){const{errorCode:e,errorText:t}=n;return{errorCode:e,errorText:t}}return n.result}))).apply(this,arguments)}},820973:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){const e=(0,i.makeGetV1Request)();return(0,r.deprecatedSendIq)(e,a)};var r=n(911794),i=n(468308);const a=new(n(769707).WapParser)("serverProps",(e=>{e.assertTag("iq"),e.assertAttr("from","s.whatsapp.net");const t=e.child("props"),n={serverPropsVersion:t.attrInt("version")};return t.forEachChildWithTag("prop",(e=>{switch(e.attrString("name")){case"web_ctwa_context_compose_enabled":n.ctwaContextCompose=1===e.attrInt("value");break;case"ctwa_context_enabled":n.ctwaContextRender=1===e.attrInt("value")?1:0;break;case"ephemeral_messages_allowed_values":n.ephemeralMessagesAllowedValues=e.attrString("value");break;case"frequently_forwarded_max":n.frequentlyForwardedMax=e.attrInt("value");break;case"frequently_forwarded_threshold":n.frequentlyForwardedThreshold=e.attrInt("value");break;case"web_gif_search":n.gifSearch=e.attrString("value");break;case"group_call_max_participants":n.groupCallMaxParticipants=e.attrInt("value",0);break;case"group_description_length":n.groupDescLength=e.attrInt("value");break;case"hfm_string_changes":n.hfmStringChanges=e.attrInt("value");break;case"image_max_edge":n.imageMaxEdge=e.attrInt("value");break;case"image_max_kbytes":n.imageMaxKBytes=e.attrInt("value");break;case"image_quality":n.imageQuality=e.attrInt("value")/100;break;case"max_participants":n.maxParticipants=e.attrInt("value");break;case"max_subject":n.maxSubject=e.attrInt("value");break;case"max_keys":n.maxKeys=e.attrInt("value");break;case"media":n.media=e.attrInt("value");break;case"multicast_limit_global":n.multicastLimitGlobal=e.attrInt("value");break;case"mute_always":n.muteAlways=e.attrInt("value");break;case"mms_media_key_ttl":n.mmsMediaKeyTTL=e.attrInt("value");break;case"wallpapers_v2":n.wallpapersV2=e.attrInt("value");break;case"web_shops_chat_header_button_enabled":n.webShopsChatHeaderButtonEnabled=1===e.attrInt("value",0);break;case"shops_hide_catalog_attachment_entrypoint":n.shopsHideCatalogAttachmentEntrypoint=1===e.attrInt("value",0);break;case"shops_header_dropdown_menu_item":n.shopsHeaderDropdownMenuItem=1===e.attrInt("value",0);break;case"shops_product_grid":n.shopsProductGrid=e.attrInt("value",0);break;case"mms_hot_content_timespan_in_seconds":n.mmsHotContentTimespan=e.attrInt("value");break;case"mms_vcache_aggregation_enabled":n.mmsVCacheAggregationEnabled=1===e.attrInt("value");break;case"mms_vcard_autodownload_size_kb":n.mmsVcardAutodownloadSizeKb=e.attrInt("value");break;case"product_media_attachments":n.productMediaAttachments=e.attrInt("value");break;case"status_video_max_duration":n.statusVideoMaxDuration=e.attrInt("value");break;case"syncd_inline_mutations_max_count":n.syncdInlineMutationsMaxCount=e.attrInt("value");break;case"syncd_patch_protobuf_max_size":n.syncdPatchProtobufMaxSize=e.attrInt("value");break;case"syncd_key_max_use_days":n.syncdKeyMaxUseDays=e.attrInt("value");break;case"syncd_wait_for_key_timeout_days":n.syncdWaitForKeyTimeoutDays=e.attrInt("value");break;case"syncd_additional_mutations":n.syncdAdditionalMutations=e.attrInt("value");break;case"syncd_sentinel_timeout_seconds":n.syncdSentinelTimeoutSeconds=e.attrInt("value");break;case"syncd_patch_device_index_included":n.syncdPatchDeviceIndexIncluded=1===e.attrInt("value");break;case"syncd_clear_chat_delete_chat_enabled":n.syncdClearChatDeleteChatEnabled=1===e.attrInt("value");break;case"md_pin_chat_enabled":n.syncdPinChatEnabled=1===e.attrInt("value");break;case"syncd_qpl_logging_enabled":n.syncdQPLLoggingEnabled=1===e.attrInt("value");break;case"template_doc_mime_types":n.templateDocMimeTypes=e.attrInt("value");break;case"web_biz_profile_options":n.webBizProfileOptions=e.attrInt("value");break;case"web_biz_profile_v3":n.webBizProfileV3=1===e.attrInt("value");break;case"vcard_as_document_size_kb":n.vcardAsDocumentSizeKb=e.attrInt("value");break;case"vcard_max_size_kb":n.vcardMaxSizeKb=e.attrInt("value");break;case"web_download_document_thumb_mms_enabled":n.webDownloadDocumentThumbMmsEnabled=1===e.attrInt("value");break;case"web_download_status_thumb_mms_enabled":n.webDownloadStatusThumbMmsEnabled=1===e.attrInt("value");break;case"web_send_document_thumb_in_message_disabled":n.webSendDocumentThumbInMessageDisabled=1===e.attrInt("value");break;case"web_upload_document_thumb_mms_enabled":n.webUploadDocumentThumbMmsEnabled=1===e.attrInt("value");break;case"web_list_message":n.webListMessage=1===e.attrInt("value");break;case"web_voip_mac_os_min_version":n.webVoipMacOsMinVersion=e.attrString("value");break;case"web_voip_windows_os_min_version":n.webVoipWindowsOsMinVersion=e.attrString("value");break;case"mms_cat_v1_forward_hot_override_enabled":n.mmsCatV1ForwardHotOverrideEnabled=1===e.attrInt("value");break;case"web_buttons_message_enabled":n.webButtonsMessage=1===e.attrInt("value");break;case"web_product_list_message_render_kill_switch":n.webProductListMessageRenderKillSwitch=1===e.attrInt("value");break;case"web_smb_upsell_in_biz_profile_enabled":n.webSMBUpsellInBizProfile=1===e.attrInt("value");break;case"ptt_conversation_waveform":n.pttConversationWaveform=1===e.attrInt("value");break;case"ptt_oot_playback":n.pttOotPlayback=1===e.attrInt("value");break;case"ptt_forwarded_features_enabled":n.pttForwardedFeaturesEnabled=1===e.attrInt("value");break;case"ptt_pausable_enabled":n.pttPausableEnabled=1===e.attrInt("value");break;case"ptt_playback_speed_enabled":n.pttPlaybackSpeedEnabled=1===e.attrInt("value");break;case"ptt_playback_speed_hide_delay":n.pttPlaybackSpeedHideDelay=e.attrInt("value");break;case"web_product_list_message_page_size":n.webProductListMessagePageSize=e.attrInt("value");break;case"ptt_remember_play_position":n.pttRememberPlayPosition=1===e.attrInt("value");break;case"ptt_waveform_send":n.pttWaveformSend=1===e.attrInt("value");break;case"web_youtube_player_enhancements":n.webYouTubePlayerEnhancements=1===e.attrInt("value");break;case"web_server_sticker_panel":n.webServerStickerPanel=e.attrInt("value");break;case"web_collections_display_enabled":n.webCollectionsDisplay=1===e.attrInt("value");break;case"web_cart_on_off":n.webCartOnOffToggle=1===e.attrInt("value");break;case"web_product_list_message_enabled":n.webProductListMessage=1===e.attrInt("value");break;case"web_media_auto_download_enabled":n.webMediaAutoDownloadEnabled=1===e.attrInt("value");break;case"download_host_switching_enabled":n.downloadHostSwitchingEnabled=1===e.attrInt("value");break;case"upload_host_switching_enabled":n.uploadHostSwitchingEnabled=1===e.attrInt("value");break;case"web_is_direct_connection_for_plm_transparent":n.isDirectConnectionForPLMTransparent=1===e.attrInt("value");break;case"web_pip_redesign":n.webPipRedesign=1===e.attrInt("value");break;case"max_electron_file_size":n.maxElectronFileSize=e.attrInt("value");break;case"max_file_size":n.maxFileSize=e.attrInt("value");break;case"web_sticker_maker":n.stickerMaker=1===e.attrInt("value");break;case"web_md_migration_experience":n.webMdMigrationExperience=1===e.attrInt("value");break;case"web_log_upload_download_crashes":n.webLogUploadDownloadCrashes=1===e.attrInt("value");break;case"web_graphql_for_catalog_m1":n.webGraphQLForCatalogM1=1===e.attrInt("value");break;case"web_md_mms_sync_deletion_request":n.webMdMmsSyncDeletionRequest=1===e.attrInt("value");break;case"web_payment_background_enabled":n.webPaymentBackgroundEnabled=1===e.attrInt("value");break;case"win_uwp_deprecation_killswitch_enabled":n.winUwpDeprecationKillswitchEnabled=1===e.attrInt("value");break;case"streaming_upload_chunk_size":n.streamingUploadChunkSize=e.attrInt("value");break;case"web_legacy_users_should_update_primary_experience":n.webLegacyUsersShouldUpdatePrimaryExperience=1===e.attrInt("value")}})),n}))},262732:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getToken=function(){return p.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(432921),s=n(990445),l=r(n(571834)),u=n(246961);function c(e){const{result:t,overallStartTime:n,retryStartTime:r,retryAttemptsLeft:i}=e,a=function(e){switch(e){case"success":return l.default.SIGN_CREDENTIAL_RESULT.SUCCESS;case"bad-request":return l.default.SIGN_CREDENTIAL_RESULT.ERROR_BAD_REQUEST;case"internal-server-error":return l.default.SIGN_CREDENTIAL_RESULT.ERROR_SERVER;case"disconnected":return l.default.SIGN_CREDENTIAL_RESULT.ERROR_CLIENT_NETWORK;default:return l.default.SIGN_CREDENTIAL_RESULT.ERROR_OTHER}}(t);new l.default.SignCredential({signCredentialResult:a,overallT:(0,s.monotonicTimeSince)(n),signCredentialT:(0,s.monotonicTimeSince)(r),retryCount:3-i,waConnectedToChatd:"disconnected"!==t,applicationState:"visible"===document.visibilityState?l.default.APPLICATION_STATE.FOREGROUND:l.default.APPLICATION_STATE.BACKGROUND}).commit()}const d=new o.Semaphore(1);function p(){return(p=(0,i.default)((function*(){const e=yield d.acquire();try{const{result:t,metric:n}=yield(0,u.getToken)(a.deprecatedSendIqWithoutRetry);return null!=n&&c(n),t||__LOG__(3)`Couldn't get a private stats token`,t}finally{e.release()}}))).apply(this,arguments)}},864726:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logDailyStatsJob=function(){return(0,i.NonPersistJob)("logDailyStats",(()=>(0,a.logDailyStats)()),{priority:r.JOB_PRIORITY.BEST_EFFORT}).waitUntilCompleted()};var r=n(431012),i=n(797703),a=n(520857)},122596:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return o.apply(this,arguments)};var i=r(n(348926)),a=n(733517);function o(){return(o=(0,i.default)((function*(e,t){__LOG__(2)`fieldStatsUpload:sendSendBufferRPC start`;const n=yield(0,a.sendSendBufferRPC)({addT:t,bufferMixinArgs:{addElementValue:e}});let r;if(__LOG__(2)`fieldStatsUpload:sendSendBufferRPC end`,"SendBufferResponseSuccess"===n.name)return __LOG__(2)`fieldStatsUpload:sendSendBufferRPC SendBufferResponseSuccess`,Promise.resolve();"SendBufferResponseErrorNoRetry"===n.name?r=n.value.errorIQErrorBadRequestOrNotAcceptableOrFeatureNotImplementedMixinGroup.value:(n.name,r=n.value.errorIQErrorServiceUnavailableMixin);const{code:i,text:o}=r;return{errorCode:parseInt(i,10),errorText:o}}))).apply(this,arguments)}},662193:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getSpamMessageProtobuf=S,t.reportSpam=function(){return P.apply(this,arguments)},t.reportStatus=function(){return C.apply(this,arguments)};var i=r(n(348926)),a=r(n(967154)),o=r(n(81109)),s=n(911794),l=n(738102),u=n(769707),c=n(973776),d=n(355813),p=n(21838),_=n(523930),f=n(126506),h=n(373070),g=n(533494),m=n(459857),y=n(208182),E=n(653313);function S(e){var t,n;return null!=(null===(t=e.buttonsMessage)||void 0===t?void 0:t.buttons)&&(e.buttonsMessage=(0,o.default)((0,o.default)({},e.buttonsMessage),{},{buttons:e.buttonsMessage.buttons.map((e=>{if(e.nativeFlowInfo){var t;const n=JSON.parse(null!==(t=e.nativeFlowInfo.paramsJson)&&void 0!==t?t:"{}");return delete n.reference_id,delete n.total_amount,(0,o.default)((0,o.default)({},e),{},{nativeFlowInfo:(0,o.default)((0,o.default)({},e.nativeFlowInfo),{},{paramsJson:JSON.stringify(n)})})}return e}))})),null!=(null===(n=e.messageContextInfo)||void 0===n?void 0:n.messageSecret)&&(e.messageContextInfo=(0,o.default)((0,o.default)({},e.messageContextInfo),{},{messageSecret:null})),e}function T(e){const t=e.t.toString();let n={};if(e.asMms){n=e.isUnsentPhoneMsg()||!e.mediaObject?{type:e.type}:e.avParams()}const r=S((0,p.createMsgProtobuf)(e,n)),i=(0,c.mediaTypeFromProtobuf)(r),o=(0,E.encodeProtobuf)(g.MessageSpec,r).readByteArray(),s=(0,_.typeAttributeFromProtobuf)(r),u=i?(0,l.CUSTOM_STRING)(i):l.DROP_ATTR,f=(0,l.CUSTOM_STRING)(c.CIPHERTEXT_VERSION.toString());return(0,l.wap)("message",(0,a.default)({},{},{t:(0,l.CUSTOM_STRING)(t),from:(0,d.JID)(e.from),to:(0,d.USER_JID)(e.to),participant:(0,d.USER_JID)(e.sender),type:s,id:(0,l.CUSTOM_STRING)(e.id.id)}),e.multicast?(0,l.wap)("multicast",null):null,e.urlNumber?(0,l.wap)("url_number",null):null,e.urlText?(0,l.wap)("url_text",null):null,(0,l.wap)("raw",{v:f,mediatype:u},o))}function v(e,t){const n=[],r=e.isGroup?null:e.id;let i=[];if(null!=t){if(!(0,f.isSpamSupportedForMessageType)(t.type))return[];i=[t]}else i=function(e,t,n){const r=[],i=e.msgs.toArray().reverse();for(let a=0;a<i.length&&!(r.length>=t);a++){const t=i[a];if((0,f.isSpamSupportedForMessageType)(t.type)&&!t.from.equals((0,m.getMaybeMeUser)())){if(n){if(e.isGroup&&!n.equals(t.author))continue;if(e.isUser&&!n.equals(t.from))continue}r.push(t)}}return r}(e,5,r);return i.forEach((t=>{let r,i,o,s;const u=t.t.toString(),f=t.isViewOnce&&!(0,y.isUnviewed)(t.safe());switch(t.type){case h.MSG_TYPE.UNKNOWN:s=null,r=l.DROP_ATTR,o=l.DROP_ATTR,i=(0,l.CUSTOM_STRING)(c.CIPHERTEXT_VERSION.toString());break;case h.MSG_TYPE.CIPHERTEXT:s=null,r=l.DROP_ATTR,o=l.DROP_ATTR,i=l.DROP_ATTR;break;default:let e={};if(t.asMms){e=t.isUnsentPhoneMsg()||f||!t.mediaObject?{type:t.type}:t.avParams()}const n=S((0,p.createMsgProtobuf)(t,e)),a=(0,c.mediaTypeFromProtobuf)(n);s=f?null:(0,E.encodeProtobuf)(g.MessageSpec,n).readByteArray(),r=(0,_.typeAttributeFromProtobuf)(n),o=a?(0,l.CUSTOM_STRING)(a):l.DROP_ATTR,i=(0,l.CUSTOM_STRING)(c.CIPHERTEXT_VERSION.toString())}let m;const T={};if(f&&(T.deleted_reason=(0,y.isViewed)(t.safe())?"view_once_opened":"view_once_expired"),e.isGroup){let n=l.DROP_ATTR;t.author?n=(0,d.USER_JID)(t.author):t.from.isUser()&&(n=(0,d.USER_JID)(t.from)),m=(0,l.wap)("message",(0,a.default)({},T,{t:(0,l.CUSTOM_STRING)(u),from:(0,d.CHAT_JID)(e.id),participant:n,id:(0,l.CUSTOM_STRING)(t.id.id),type:r}),(0,l.wap)("raw",{v:i,mediatype:o},s))}else m=(0,l.wap)("message",(0,a.default)({},T,{t:(0,l.CUSTOM_STRING)(u),from:(0,d.USER_JID)(t.from),to:(0,d.USER_JID)(t.to),type:r,id:(0,l.CUSTOM_STRING)(t.id.id)}),t.multicast?(0,l.wap)("multicast",null):null,t.urlNumber?(0,l.wap)("url_number",null):null,t.urlText?(0,l.wap)("url_text",null):null,(0,l.wap)("raw",{v:i,mediatype:o},s));n.push(m)})),n}const A=new u.WapParser("reportUserSpam",(e=>{if(!e.hasChild("error"))return void __LOG__(2)`reportSpam: success`;const t=e.child("error"),n=t.attrInt("code"),r=t.attrString("text");return __LOG__(3)`reportSpam: sever response with ${n}, ${r}`,{errorCode:n,errorText:r}}));function C(){return(C=(0,i.default)((function*(e,t){const n=T(t),r=(0,l.wap)("iq",{to:l.S_WHATSAPP_NET,type:"set",xmlns:"spam",id:(0,l.generateId)()},(0,l.wap)("spam_list",{jid:(0,d.JID)(t.from),spam_flow:(0,l.CUSTOM_STRING)(String(e))},n)),i=yield(0,s.deprecatedSendIq)(r,A);if(!i.success){const{errorCode:e,errorText:t}=i;return __LOG__(3)`reportSpam: sever response with ${e}, ${t}`,{errorCode:e,errorText:t}}return i.result}))).apply(this,arguments)}function P(){return(P=(0,i.default)((function*(e,t,n){const r=v(e,n);let i;if(null!=n)i=(0,l.wap)("iq",{to:l.S_WHATSAPP_NET,type:"set",xmlns:"spam",id:(0,l.generateId)()},(0,l.wap)("spam_list",{jid:e.isGroup?(0,d.GROUP_JID)(e.id):(0,d.USER_JID)(n.sender),subject:e.isGroup?(0,l.CUSTOM_STRING)(e.formattedTitle):l.DROP_ATTR,spam_flow:(0,l.CUSTOM_STRING)(String(t))},r));else if(!0===e.isParentGroup)i=(0,l.wap)("iq",{to:l.S_WHATSAPP_NET,type:"set",xmlns:"spam",id:(0,l.generateId)()},(0,l.wap)("spam_list",{jid:(0,d.CHAT_JID)(e.id),spam_flow:(0,l.CUSTOM_STRING)(String(t))}));else if(e.isGroup){var a;const n=(null===(a=e.groupMetadata)||void 0===a?void 0:a.owner)&&(0,d.USER_JID)(e.groupMetadata.owner);i=(0,l.wap)("iq",{to:l.S_WHATSAPP_NET,type:"set",xmlns:"spam",id:(0,l.generateId)()},(0,l.wap)("spam_list",{creator:n||l.DROP_ATTR,subject:(0,l.CUSTOM_STRING)(e.formattedTitle),jid:(0,d.CHAT_JID)(e.id),spam_flow:(0,l.CUSTOM_STRING)(String(t))},r))}else i=(0,l.wap)("iq",{to:l.S_WHATSAPP_NET,type:"set",xmlns:"spam",id:(0,l.generateId)()},(0,l.wap)("spam_list",{jid:(0,d.CHAT_JID)(e.id),spam_flow:(0,l.CUSTOM_STRING)(String(t))},r));const o=yield(0,s.deprecatedSendIq)(i,A);if(!o.success){const{errorCode:e,errorText:t}=o;return __LOG__(3)`reportSpam: sever response with ${e}, ${t}`,{errorCode:e,errorText:t}}return o.result}))).apply(this,arguments)}},376651:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getInstance=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=e?_:f(),n=h();let r;if(S[t])return g(y,n)&&(y=n,S[t].updateConfig(n)),S[t];switch(t){case"preemptive":r=new a.WAConcurrentPreemptiveJobQueue;break;case"bucket":r=new i.WAConcurrentBucketJobQueue;break;case"v2":case"v1":default:r=new o.WADefaultJobNoQueue}return r.init(n,E()),S[t]=r,y=n,r};var i=n(855214),a=n(755627),o=n(155722),s=n(990445),l=n(287461),u=r(n(542817)),c=n(148257),d=r(n(571834));const p={maxConcurrency:1,bestEffortWaitTimeoutSec:s.FIVE_MINUTES},_="default";function f(){return(0,l.getABPropConfigValue)("web_orchestrator_enabled_version")}function h(){u.default.getCurrentScenario();return d.default.WEBC_SCENARIO_TYPE.IDLE,p}function g(e,t){var n,r,i,a;return e.maxConcurrency!==t.maxConcurrency||((null===(n=e.jobPrioritiesQuota)||void 0===n?void 0:n.size)!==(null===(r=t.jobPrioritiesQuota)||void 0===r?void 0:r.size)||(Object.keys(null!==(i=e.maxConcurrencyPerJob)&&void 0!==i?i:{}).length!==Object.keys(null!==(a=t.maxConcurrencyPerJob)&&void 0!==a?a:{}).length||JSON.stringify(e)!==JSON.stringify(t)))}let m,y=p;function E(){return m||(m=new c.JobStatsLogger),m}const S={}},533415:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.JobInfoEvent=void 0;n(431012),r(n(571834));t.JobInfoEvent=class{constructor(e,t,n,r){this.jobName=e,this.scenario=r,this.pendingJobsCount=n,this.jobPriority=t}logJobAdded(){this.webcJobAddedT=Date.now()}logJobStarted(){this.webcJobStartedT=Date.now()}logJobCompleted(e){this.webcJobCompletedT=Date.now(),this.jobResultType=e}}},148257:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.JobStatsLogger=void 0;r(n(81109)),r(n(542817)),n(533415);var i=r(n(571834));t.JobStatsLogger=class{constructor(){this._jobEventMap=new Map}logJobCreated(e){}logJobStarted(e){}logJobCompleted(e){this._logJobFinished(e,i.default.WEBC_JOB_RESULT_TYPE_CODE.COMPLETED)}logJobError(e){this._logJobFinished(e,i.default.WEBC_JOB_RESULT_TYPE_CODE.ERROR)}logJobTimeout(e){this._logJobFinished(e,i.default.WEBC_JOB_RESULT_TYPE_CODE.TIMEOUT)}logJobAborted(e){this._logJobFinished(e,i.default.WEBC_JOB_RESULT_TYPE_CODE.ABORTED)}_logJobFinished(e,t){}_maybeCommitJobEvent(e){}}},797703:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NonPersistJob=function(e,t,n){if("function"!=typeof t)throw new Error("NonPersistJob got invalid function param");const a=(0,i.getInstance)((null==n?void 0:n.priority)===r.JOB_PRIORITY.SKIP);return{fireAndForget(){a.enqueue(e,(()=>t.apply(null,arguments)),n)},waitUntilCompleted(){return a.enqueue(e,(()=>t.apply(null,arguments)),n)}}};var r=n(431012),i=n(376651)},354679:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){!function(e,t){Object.keys(t).forEach((n=>{t.hasOwnProperty(n)&&e.addPersistedJobImplementation(n,t[n])}))}(e,{rotateKey:()=>n.e(2266).then(n.bind(n,322266)).then((e=>e.rotateKey)),setAbout:()=>n.e(5346).then(n.bind(n,755346)).then((e=>e.setAbout)),queryProductList:()=>n.e(432).then(n.bind(n,970432)).then((e=>e.QueryProductListCatalog)),getPublicKey:()=>n.e(648).then(n.bind(n,720648)).then((e=>e.QueryGetPublicKey)),getSignedUserInfo:()=>n.e(6086).then(n.bind(n,66086)).then((e=>e.QueryGetSignedUserInfo)),verifyPostcode:()=>n.e(4944).then(n.bind(n,144944)).then((e=>e.VerifyPostcode)),deleteReactions:()=>n.e(73).then(n.bind(n,620073)).then((e=>e.deleteReations)),deleteReactionsV2:()=>n.e(4106).then(n.bind(n,254106)).then((e=>e.deleteReactionsV2)),deleteAddOns:()=>n.e(4106).then(n.bind(n,254106)).then((e=>e.deleteAddOns)),sendRequestedKeyShare:()=>n.e(3498).then(n.bind(n,223498)).then((e=>e.sendRequestedKeyShare))})}},323829:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.jobSerializers=void 0;var r=n(984330),i=n(72696);const a={rotateKey:()=>({type:"rotateKey",args:{},uniqKey:"rotateKey"}),setAbout:e=>({type:"setAbout",args:{content:e},uniqKey:"setAbout"}),queryProductList(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;if((0,i.commerceFeaturesDisabledBySanctions)())throw new r.E451;return{type:"queryProductList",args:{catalogWid:e.toString(),productIds:t,width:a,height:o,directConnectionEncryptedInfo:n},uniqKey:`queryProductList:${t.slice().sort().join(",")}:${a}:${o}`}},getPublicKey:e=>({type:"getPublicKey",args:{businessJid:e.toString()},uniqKey:`getPublicKey:${e.toString()}`}),getSignedUserInfo:e=>({type:"getSignedUserInfo",args:{businessJid:e.toString()},uniqKey:`getSignedUserInfo:${e.toString()}`}),verifyPostcode:(e,t)=>({type:"verifyPostcode",args:{businessJid:e.toString(),directConnectionEncryptedInfo:t},uniqKey:`verifyPostcode:${e.toString()}:${t}`}),deleteReactions:(e,t)=>({type:"deleteReactions",args:{chatId:e,parentMsgKeys:t},uniqKey:`deleteReactions:${e}`}),deleteReactionsV2:(e,t)=>({type:"deleteReactionsV2",args:{chatId:e,parentMsgKeys:t}}),deleteAddOns:(e,t)=>({type:"deleteAddOns",args:{chatId:e,parentMsgKeys:t}}),sendRequestedKeyShare:(e,t,n)=>({type:"sendRequestedKeyShare",args:{keys:e,orphanKeys:t,peerDeviceId:n.toString()}})};t.jobSerializers=a},628905:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getJobManager=function(){if(null==d)throw new Error("jobs manager has not been initialized");return d},t.maybeCreateJob=f,t.startWebPersistedJobManager=function(){return p.apply(this,arguments)};var i=r(n(348926)),a=n(710038),o=n(814271),s=n(990445),l=n(777834),u=r(n(354679)),c=n(314642);let d=null;function p(){return(p=(0,i.default)((function*(){yield(0,l.initialize)();const e=(0,c.getTable)();d=new o.PersistedJobManager({accessors:_(),unfinishedJobEntries:e.all(),isRestartAfterCrash:!1,listeners:{onJobStarted:()=>{},onJobFinished:()=>null},deprecatedJobs:{}}),(0,u.default)(d)}))).apply(this,arguments)}function _(){return{deletePersistedJob:e=>(0,c.getTable)().remove(e),updatePersistedJob:e=>(0,c.getTable)().createOrReplace(e),readPersistedJob:e=>(0,c.getTable)().get(e),loadAllJobs:()=>(0,c.getTable)().all(),maybeCreateJob:f}}function f(){return h.apply(this,arguments)}function h(){return(h=(0,i.default)((function*(e){var t,n;const r=(0,c.getTable)(),i=JSON.stringify([e.type,null!==(t=e.uniqKey)&&void 0!==t?t:(0,a.randomHex)(32)]),l={type:e.type,uniqKey:i,startTime:(0,s.unixTime)(),version:null!==(n=e.version)&&void 0!==n?n:1,original:e.args,current:e.args,step:o.UNSTARTED_JOB,waitUntil:null,stepFirstStartTime:null,stepHardStartCountAfterTimeout:0,stepUnexpectedErrorCount:0,backedOffCount:0};if(null==e.uniqKey)return r.createOrReplace(l).then((e=>({id:e,newlyCreated:!0})));const u=yield r.equals(["uniqKey"],[e.uniqKey]);if(0===u.length)return r.createOrReplace(l).then((e=>({id:e,newlyCreated:!0})));const d=[];let p=null;for(const e of u)e.step!==o.FINISHED_JOB?p=e:d.push(r.remove(e.jobId));return yield Promise.all(d),null!=p?{id:p.jobId,newlyCreated:!1}:r.createOrReplace(l).then((e=>({id:e,newlyCreated:!0})))}))).apply(this,arguments)}},247355:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.createGroup=function(){return g.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(710038),s=n(738102),l=n(769707),u=n(984330),c=n(355813),d=n(529921),p=n(854379),_=r(n(571834)),f=n(669050);const h=new l.WapParser("createGroupReplyParser",(e=>{var t;const n=e.child("group");let r;try{r=(0,f.createWid)(`${n.attrString("id")}@g.us`)}catch(e){}if(!(null===(t=r)||void 0===t?void 0:t.isGroup))throw Error("createGroupReplyParser: invalid group id");return{wid:r,subject:n.attrString("subject"),creator:(0,p.userJidToUserWid)(n.attrUserJid("creator")),ts:n.attrTime("creation"),participants:n.mapChildrenWithTag("participant",(e=>{const t=e.maybeChild("add_request");return{wid:(0,p.userJidToUserWid)(e.attrUserJid("jid")),error:e.hasAttr("error")?e.attrInt("error"):null,invite_code:t&&t.attrString("code"),invite_code_exp:t&&t.attrString("expiration"),type:e.attrEnumOrDefault("type",d.GROUP_PARTICIPANT_TYPES,"participant")}}))}}));function g(){return(g=(0,i.default)((function*(e,t,n,r){const i=(0,o.randomHex)(8),l=t.map((e=>(0,s.wap)("participant",{jid:(0,c.USER_JID)(e)})));null!=n&&0!==n&&l.unshift((0,s.wap)("ephemeral",{expiration:(0,s.INT)(n)})),null!=r&&l.unshift((0,s.wap)("linked_parent",{jid:(0,c.GROUP_JID)(r)}));const d=(0,s.wap)("iq",{to:s.G_US,type:"set",xmlns:"w:g2",id:(0,s.generateId)()},(0,s.wap)("create",{subject:(0,s.CUSTOM_STRING)(e),key:(0,s.CUSTOM_STRING)(i)},l)),p=yield(0,a.deprecatedSendIq)(d,h);return p.success?(new _.default.GroupCreateC({}).commit(),p.result):Promise.reject(new u.ServerStatusCodeError(p.errorCode,p.errorText))}))).apply(this,arguments)}},297031:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getGroupMetadataJob=function(e){return(0,o.NonPersistJob)("getGroupMetadata",(e=>(0,a.getGroupMetadata)(e)),{priority:r.JOB_PRIORITY.SKIP}).waitUntilCompleted({groupWid:e})},t.getGroupParticipantJob=function(e){return(0,o.NonPersistJob)("getGroupParticipant",(e=>(0,i.getGroupParticipant)(e)),{priority:r.JOB_PRIORITY.SKIP}).waitUntilCompleted({groupWid:e})},t.markGroupParticipantStaleJob=function(e){return(0,o.NonPersistJob)("markGroupParticipantStale",(e=>(0,i.markGroupParticipantStale)(e)),{priority:r.JOB_PRIORITY.SKIP}).waitUntilCompleted({group:e})},t.modifyGroupParticipantJob=function(e,t,n,a,s){return(0,o.NonPersistJob)("modifyGroupParticipant",(e=>(0,i.modifyGroupParticipant)(e)),{priority:r.JOB_PRIORITY.SKIP}).waitUntilCompleted({group:e,oldId:t,newId:n,prevVersion:a,newVersion:s})},t.updateGroupMetadataTableJob=function(e){return(0,o.NonPersistJob)("updateGroupMetadataTable",(e=>(0,a.updateGroupMetadataTable)(e)),{priority:r.JOB_PRIORITY.SKIP}).waitUntilCompleted({groupInfos:e})},t.updateGroupParticipantTableWithoutDeviceSyncJob=function(e){return(0,o.NonPersistJob)("updateGroupParticipantTableWithoutDeviceSync",(e=>(0,i.updateGroupParticipantTableWithoutDeviceSync)(e)),{priority:r.JOB_PRIORITY.SKIP}).waitUntilCompleted({groupInfos:e})};var r=n(431012),i=n(608916),a=n(185212),o=n(797703)},150869:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.leaveCommunities=h,t.leaveCommunity=function(e){return h([e]).then((e=>e[0]))},t.leaveGroup=function(e){return _([e]).then((e=>e[0]))},t.leaveGroups=_;var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(984330),u=n(355813),c=n(854379);const d=new s.WapParser("leaveGroupsResultParser",(e=>{e.assertAttr("type","result");return e.child("leave").mapChildren((e=>({id:(0,c.groupJidToWid)(e.attrGroupJid("id")),code:e.hasAttr("error")?e.attrInt("error"):200})))})),p=new s.WapParser("leaveCommunitiesResultParser",(e=>{e.assertAttr("type","result");return e.child("leave").mapChildren((e=>({id:(0,c.groupJidToWid)(e.attrGroupJid("parent_group_jid")),code:e.hasAttr("error")?e.attrInt("error"):200})))}));function _(){return f.apply(this,arguments)}function f(){return(f=(0,i.default)((function*(e){const t=e.map((e=>(0,o.wap)("group",{id:(0,u.GROUP_JID)(e)}))),n=(0,o.wap)("iq",{to:o.G_US,type:"set",xmlns:"w:g2",id:(0,o.generateId)()},(0,o.wap)("leave",null,t)),r=yield(0,a.deprecatedSendIq)(n,d);return r.success?r.result:Promise.reject(new l.ServerStatusCodeError(r.errorCode,r.errorText))}))).apply(this,arguments)}function h(){return g.apply(this,arguments)}function g(){return(g=(0,i.default)((function*(e){const t=e.map((e=>(0,o.wap)("linked_groups",{parent_group_jid:(0,u.GROUP_JID)(e)}))),n=(0,o.wap)("iq",{to:o.G_US,type:"set",xmlns:"w:g2",id:(0,o.generateId)()},(0,o.wap)("leave",null,t)),r=yield(0,a.deprecatedSendIq)(n,p);return r.success?r.result:Promise.reject(new l.ServerStatusCodeError(r.errorCode,r.errorText))}))).apply(this,arguments)}},198111:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.queryMembershipApprovalRequests=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(456201),o=n(984330),s=n(130207),l=n(669050),u=n(574819);function c(){return(c=(0,i.default)((function*(e){const t=yield(0,a.sendGetMembershipApprovalRequestsRPC)({iqTo:(0,u.widToGroupJid)(e)});switch(t.name){case"GetMembershipApprovalRequestsResponseSuccess":return t.value.membershipApprovalRequestsMembershipApprovalRequest.map((e=>{const t=(0,l.createWid)(e.jid);return{id:t,t:e.requestTime,addedBy:t,requestMethod:d(e.requestMethod)}}));case"GetMembershipApprovalRequestsResponseClientError":return p(t.value.getMembershipApprovalRequestsClientErrors.value);default:return t.name,p(t.value.errorServerErrors.value)}}))).apply(this,arguments)}function d(e){switch(e){case"invite_link":return s.RequestMethod.InviteLink;case"linked_group_join":return s.RequestMethod.LinkedGroupJoin}}function p(e){let{code:t,text:n}=e;return __LOG__(2)`queryMembershipApprovalRequests failed: ${t}:${n}`,Promise.reject(new o.ServerStatusCodeError(Number(t),n))}},650572:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getProfilePic=function(){return p.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(984330),u=n(355813);const c={preview:"preview",image:"image"},d=new s.WapParser("profilePicParser",(e=>{const t=e.child("picture");return{id:t.attrInt("id"),type:t.attrEnum("type",c),url:t.attrString("url")}}));function p(){return(p=(0,i.default)((function*(e,t){if(e.isStatusV3()||e.isBroadcast())return __LOG__(4,!0,new Error)`getProfilePic failed with an invalid WID: ${e.toString()}`,Promise.reject(new l.ServerStatusCodeError(401,`getProfilePic failed with an invalid WID: ${e.toString()}`));const{preview:n,invite:r,photoId:i,parentGroupId:s}=t;let c,p,_,f=null;null!=s?(c=(0,u.CHAT_JID)(s),p=o.DROP_ATTR,_="w:g2",f=(0,o.wap)("query_linked",{type:e===s?"parent_group":"sub_group",jid:(0,u.CHAT_JID)(e)})):(c=o.S_WHATSAPP_NET,p=(0,u.CHAT_JID)(e),_="w:profile:picture");const h=(0,o.wap)("iq",{to:c,target:p,type:"get",xmlns:_,id:(0,o.generateId)()},(0,o.wap)("picture",{invite:(0,o.MAYBE_CUSTOM_STRING)(r),type:n?"preview":o.DROP_ATTR,id:null!=i?(0,o.INT)(i):o.DROP_ATTR,query:"url"},f)),g=yield(0,a.deprecatedSendIq)(h,d);if(!g.success)return Promise.reject(new l.ServerStatusCodeError(g.errorCode,g.errorText));const{id:m,url:y,type:E}=g.result;return __LOG__(2)`getProfilePic: ${e.toString()} ${m}, ${E}, ${y}`,{tag:m.toString(),eurl:y,type:E}}))).apply(this,arguments)}},226512:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ProfilePicsTypeEnum=t.ProfilePicsQueryEnum=void 0,t.getProfilePics=function(){return d.apply(this,arguments)};var i=r(n(348926)),a=n(171654),o=n(984330),s=n(669050),l=n(574819);const u=Object.freeze({IMAGE:"image",PREVIEW:"preview"});t.ProfilePicsTypeEnum=u;const c=Object.freeze({BLOB:"blob",URL:"url"});function d(){return(d=(0,i.default)((function*(e,t,n){const{subgroupHintId:r,type:i=u.PREVIEW,query:o=c.URL}=n,d=yield(0,a.sendGetGroupProfilePicturesRPC)({pictureArgs:e.map((e=>({parentOrSubGroupMixinGroupArgs:{subGroup:{anySubGroupJid:(0,l.widToGroupJid)(e)}},profilePictureTypeMixinArgs:{pictureType:i},profilePictureQueryMixinArgs:{pictureQuery:o}}))),subGroupHintMixinArgs:r?{anyLinkedGroupsMembershipHint:(0,l.widToGroupJid)(r)}:void 0,baseGetGroupOrServerMixinGroupArgs:{baseGetGroup:{iqTo:(0,l.widToGroupJid)(t)}}});switch(d.name){case"GetGroupProfilePicturesResponseSuccessGroupPictures":return d.value.picturesPicture.map((e=>{var t,n;let r;switch(r="SubGroup"===e.parentOrSubGroupMixinGroup.name?(0,s.createWid)(e.parentOrSubGroupMixinGroup.value.subGroupJid):(0,s.createWid)(e.parentOrSubGroupMixinGroup.value.parentGroupJid),e.getGroupProfilePicturesSuccessOrGetGroupProfilePicturesPartialProfilePictureResponseMixinGroup.name){case"GetGroupProfilePicturesSuccessProfilePictureResponse":const i=e.getGroupProfilePicturesSuccessOrGetGroupProfilePicturesPartialProfilePictureResponseMixinGroup.value;return{id:r,tag:i.id,eurl:null===(t=i.profilePictureUrlResponseOrProfilePictureBlobResponseOrPictureDidNotChangeMixinGroup)||void 0===t?void 0:t.value.url,type:i.type,updatePicture:!0};case"GetGroupProfilePicturesPartialProfilePictureResponse":let a=!1;return"PictureNotFound"===(null===(n=e.getGroupProfilePicturesSuccessOrGetGroupProfilePicturesPartialProfilePictureResponseMixinGroup.value.pictureNotFoundOrBadServerProfilePictureErrorOrBadLinkedGroupProfilePictureErrorMixinGroup)||void 0===n?void 0:n.name)&&(a=!0),{id:r,tag:null,eurl:null,type:null,updatePicture:a}}}));case"GetGroupProfilePicturesResponseClientError":return p(d.value.getGroupProfilePictureClientErrors.value.code,d.value.getGroupProfilePictureClientErrors.value.text);case"GetGroupProfilePicturesResponseServerError":return p(d.value.errorServerErrors.value.code,d.value.errorServerErrors.value.text)}}))).apply(this,arguments)}function p(e,t){return __LOG__(4,void 0,new Error,!0)`getGroupProfilePics failed: ${e}:${t}`,SEND_LOGS("pictures-error"),Promise.reject(new o.ServerStatusCodeError(Number(e),t))}t.ProfilePicsQueryEnum=c},290542:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MembershipApprovalRequestAction=void 0,t.membershipApprovalRequestAction=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(337245),o=n(984330),s=n(669050),l=n(574819);const u=n(76672).Mirrored(["Approve","Reject"]);function c(){return(c=(0,i.default)((function*(e,t,n){const r=t.map((e=>({participantJid:(0,l.widToUserJid)(e)})));let i,o;n===u.Approve?i={participantArgs:r}:o={participantArgs:r};const c=yield(0,a.sendMembershipRequestsActionRPC)({iqTo:(0,l.widToGroupJid)(e),approveArgs:i,rejectArgs:o});switch(c.name){case"MembershipRequestsActionResponseSuccess":{var p,_;const e=n===u.Approve?c.value.membershipRequestsActionApprove:c.value.membershipRequestsActionReject;return null!==(p=null==e||null===(_=e.participant)||void 0===_?void 0:_.map((e=>{const t=n===u.Approve?e.membershipRequestsActionAcceptParticipantMixins:e.membershipRequestsActionRejectParticipantMixins;return{wid:(0,s.createWid)(e.jid),error:t}})))&&void 0!==p?p:[]}case"MembershipRequestsActionResponseClientError":return d(c.value.membershipRequestsActionClientErrors.value);default:return c.name,d(c.value.errorServerErrors.value)}}))).apply(this,arguments)}function d(e){let{code:t,text:n}=e;return __LOG__(2)`membershipApprovalRequestAction failed: ${t}:${n}`,Promise.reject(new o.ServerStatusCodeError(Number(t),n))}t.MembershipApprovalRequestAction=u},660913:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addParticipantsJob=function(e,t,n,o,s){return(0,a.NonPersistJob)("addParticipants",(e=>(0,i.addParticipants)(e)),{priority:r.JOB_PRIORITY.SKIP}).waitUntilCompleted({group:e,participants:t,version:n,prevVersion:o,isOffline:s})},t.demoteCommunityParticipantsJob=function(e,t,n){return(0,a.NonPersistJob)("demoteCommunityParticipants",(e=>(0,i.demoteCommmunityParticipants)(e)),{priority:r.JOB_PRIORITY.SKIP}).waitUntilCompleted({group:e,participants:t,isOffline:n})},t.demoteParticipantsJob=function(e,t,n,o,s){return(0,a.NonPersistJob)("demoteParticipants",(e=>(0,i.demoteParticipants)(e)),{priority:r.JOB_PRIORITY.SKIP}).waitUntilCompleted({group:e,participants:t,version:n,prevVersion:o,isOffline:s})},t.promoteCommunityParticipantsJob=function(e,t,n){return(0,a.NonPersistJob)("promoteCommunityParticipants",(e=>(0,i.promoteCommmunityParticipants)(e)),{priority:r.JOB_PRIORITY.SKIP}).waitUntilCompleted({group:e,participants:t,isOffline:n})},t.promoteParticipantsJob=function(e,t,n,o,s){return(0,a.NonPersistJob)("promoteParticipants",(e=>(0,i.promoteParticipants)(e)),{priority:r.JOB_PRIORITY.SKIP}).waitUntilCompleted({group:e,participants:t,version:n,prevVersion:o,isOffline:s})},t.removeParticipantsJob=function(e,t,n,o,s,l,u,c){return(0,a.NonPersistJob)("removeParticipants",(e=>(0,i.removeParticipants)(e)),{priority:r.JOB_PRIORITY.SKIP}).waitUntilCompleted({group:e,participants:t,timestamp:n,author:o,version:s,prevVersion:l,reason:u,isOffline:c})},t.updateParticipantsJob=function(e,t,n,o){return(0,a.NonPersistJob)("updateParticipants",(e=>(0,i.updateParticipants)(e)),{priority:r.JOB_PRIORITY.SKIP}).waitUntilCompleted({group:e,participants:t,version:n,isOffline:o})};var r=n(431012),i=n(242382),a=(n(862159),n(797703))},945176:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.queryGroupJob=function(e,t,n){return(0,u.NonPersistJob)("queryGroup",function(){var e=(0,i.default)((function*(e){const t=yield(0,l.queryGroup)(e);return t.id&&(yield Promise.all([(0,o.updateGroupMetadataTable)({groupInfos:[t]}),(0,s.updateParticipants)({group:t.id,participants:t.participants,version:t.pvId,isOffline:null})]),(0,a.clearAdminshipCache)(t.id.toString())),t}));return function(){return e.apply(this,arguments)}}()).waitUntilCompleted({groupWid:e,request:t,phash:n})};var i=r(n(348926)),a=n(565583),o=n(185212),s=n(242382),l=n(429267),u=n(797703)},113269:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.queryAllGroups=function(){return _.apply(this,arguments)},t.queryGroupInvite=function(){return f.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(565583),u=n(984330),c=n(429267);const d=new s.WapParser("queryGroupParser",(e=>e.hasChild("group")?(0,c.parseGroupNode)(e.child("group")):{phashMatch:!0})),p=new s.WapParser("queryAllGroupsParser",(e=>e.child("groups").mapChildren(c.parseGroupNode)));function _(){return(_=(0,i.default)((function*(){const e=(0,o.wap)("iq",{to:o.G_US,type:"get",xmlns:"w:g2",id:(0,o.generateId)()},(0,o.wap)("participating",null,(0,o.wap)("participants",null),(0,o.wap)("description",null)));(0,l.clearAdminshipCache)();const t=yield(0,a.deprecatedSendIq)(e,p);return t.success?t.result:(__LOG__(2)`queryAllGroups failed: ${t.errorCode}:${t.errorType}`,Promise.reject(new u.ServerStatusCodeError(t.errorCode,t.errorText)))}))).apply(this,arguments)}function f(){return(f=(0,i.default)((function*(e){const t=(0,o.wap)("iq",{to:o.G_US,type:"get",xmlns:"w:g2",id:(0,o.generateId)()},(0,o.wap)("invite",{code:(0,o.CUSTOM_STRING)(e)})),n=yield(0,a.deprecatedSendIq)(t,d);return n.success?n.result:(__LOG__(2)`queryGroupInvite failed: ${n.errorCode}:${n.errorType}`,Promise.reject(new u.ServerStatusCodeError(n.errorCode,n.errorText)))}))).apply(this,arguments)}},430599:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cleanUnjoinedSubgroupsJob=function(e,t){return(0,a.NonPersistJob)("cleanUnjoinedSubgroups",(e=>(0,i.cleanUnjoinedSubgroups)(e)),{priority:r.JOB_PRIORITY.UI_ACTION}).waitUntilCompleted({unjoinedSubgroupIds:e,parentGroupId:t})},t.updateUnjoinedSubgroupsJob=function(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,a.NonPersistJob)("updateUnjoinedSubgroups",(e=>(0,i.updateUnjoinedSubgroups)(e)),{priority:r.JOB_PRIORITY.UI_ACTION}).waitUntilCompleted({unjoinedSubgroups:e,parentGroupId:t,link:n})};var r=n(431012),i=n(699612),a=n(797703)},613247:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.joinGroupViaInviteV4=function(){return h.apply(this,arguments)},t.queryGroupInviteV4=function(){return p.apply(this,arguments)},t.revokeGroupInviteV4=function(){return g.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(911794),s=n(738102),l=n(769707),u=n(429267),c=n(854379);const d=new l.WapParser("queryGroupInviteV4Parser",(e=>{if(e.hasChild("error")){const t=e.child("error");return{errorCode:t.attrInt("code"),errorText:t.attrString("text")}}return e.hasChild("group")?{groupMetadata:(0,u.parseGroupNode)(e.child("group"))}:{phashMatch:!0}}));function p(){return(p=(0,a.default)((function*(e,t,n,r,a){const l=(0,s.wap)("iq",{to:(0,s.JID)(n),type:"get",xmlns:"w:g2",id:(0,s.generateId)()},(0,s.wap)("query",{phash:(0,s.MAYBE_CUSTOM_STRING)(a)},(0,s.wap)("add_request",{code:(0,s.CUSTOM_STRING)(e),expiration:(0,s.CUSTOM_STRING)(t),admin:(0,s.CUSTOM_STRING)(r)}))),u=yield(0,o.deprecatedSendIq)(l,d);if(!u.success)return __LOG__(2)`queryGroupInviteV4: failed ${u.errorCode}:${u.errorType}`,{status:u.errorCode};const c=u.result,p={status:200};return c.phashMatch?(0,i.default)((0,i.default)({},p),{},{phashMatch:!0}):c.groupMetadata?(0,i.default)((0,i.default)({},p),{},{groupMetadata:c.groupMetadata}):p}))).apply(this,arguments)}const _=new l.WapParser("joinGroupViaInviteV4Parser",(e=>{if(e.hasChild("error")){const t=e.child("error");return{errorCode:t.attrInt("code"),errorText:t.attrString("text"),groupId:(0,c.groupJidToWid)(t.attrGroupJid("from"))}}return{groupId:(0,c.groupJidToWid)(e.attrGroupJid("from"))}})),f=new l.WapParser("revokeGroupsV4Parser",(e=>{if(e.hasChild("error")){const t=e.child("error");return{errorCode:t.attrInt("code"),errorText:t.attrString("text")}}const t=e.child("revoke"),n=[];return t.mapChildrenWithTag("participant",(e=>{e.hasAttr("error")||n.push((0,c.userJidToUserWid)(e.attrUserJid("jid")))})),{revokedUsers:n}}));function h(){return(h=(0,a.default)((function*(e,t,n,r){const i=(0,s.wap)("iq",{to:(0,s.JID)(n),type:"set",xmlns:"w:g2",id:(0,s.generateId)()},(0,s.wap)("accept",{code:(0,s.CUSTOM_STRING)(e),expiration:(0,s.CUSTOM_STRING)(t),admin:(0,s.CUSTOM_STRING)(r)})),a=yield(0,o.deprecatedSendIq)(i,_);if(!a.success)return __LOG__(2)`joinGroupViaInviteV4: failed ${a.errorCode}:${a.errorType}`,{status:a.errorCode};return{status:200,gid:a.result.groupId}}))).apply(this,arguments)}function g(){return(g=(0,a.default)((function*(e,t){const n=(0,s.wap)("iq",{to:(0,s.JID)(t),type:"set",xmlns:"w:g2",id:(0,s.generateId)()},(0,s.wap)("revoke",null,e.map((e=>(0,s.wap)("participant",{jid:(0,s.CUSTOM_STRING)(e)}))))),r=yield(0,o.deprecatedSendIq)(n,f);return r.success?{status:200}:(__LOG__(2)`revokeGroupInviteV4: failed ${r.errorCode}:${r.errorType}`,{status:r.errorCode})}))).apply(this,arguments)}},9210:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.digestKey=function(){return p.apply(this,arguments)};var i=r(n(348926)),a=n(417405),o=n(911794),s=n(738102),l=n(769707),u=n(326314),c=n(41517);const d=new l.WapParser("digestResponseParser",(e=>{const t=e.child("digest"),n=t.child("skey");return{regId:t.child("registration").contentUint(4),type:t.child("type").contentUint(1),identity:t.child("identity").contentBytes(32),skey:{id:n.child("id").contentUint(3),pubkey:n.child("value").contentBytes(32),signature:n.child("signature").contentBytes(64)},keys:t.child("list").mapChildren((e=>e.contentUint(3))),hash:t.child("hash").contentBytes(20)}}));function p(){return(p=(0,i.default)((function*(){const e=(0,s.wap)("iq",{xmlns:"encrypt",type:"get",to:s.S_WHATSAPP_NET,id:(0,s.generateId)()},(0,s.wap)("digest",null)),t=yield(0,o.deprecatedSendIq)(e,d);let n=null;if(t.success)try{yield _(t.result),n=!1}catch(e){n=!1}else{const e=t.errorCode;404===e?(__LOG__(3)`digestKey: no record found for current user`,n=!0):406===e?(__LOG__(3)`digestKey: malformed request`,n=!1):503===e?(__LOG__(3)`digestKey: service unavailable`,n=!1):(__LOG__(3)`digestKey: server error ${e}`,n=!1)}if(null!=n&&n)return __LOG__(2)`digestKey: validate key bundle failed, upload prekeys again`,(0,c.uploadPreKeys)()}))).apply(this,arguments)}function _(){return f.apply(this,arguments)}function f(){return(f=(0,i.default)((function*(e){const[t,n]=yield Promise.all([u.waSignalStore.getRegistrationInfo(),u.waSignalStore.getSignedPreKey()]);if(!t||!n)throw new Error("validateLocalKeyBundle: No registration info is available");if(e.regId!==t.registrationId)throw new Error("validateLocalKeyBundle: registation id mismatch");const r=t.identityKeyPair.pubKey,o=n.keyPair.pubKey,s=r.byteLength+o.byteLength+n.signature.byteLength+32*e.keys.length,l=new Uint8Array(s);let c=0;[r,o,n.signature].forEach((e=>{l.set(new Uint8Array(e),c),c+=e.byteLength}));const d=e.keys.map(function(){var e=(0,i.default)((function*(e){const t=yield u.waSignalStore.getPreKeyById(e);if(!t)throw Error(`validateLocalKeyBundle: missing prekey record for id ${e}`);return t.keyPair.pubKey}));return function(){return e.apply(this,arguments)}}());(yield Promise.all(d)).forEach((e=>{l.set(new Uint8Array(e),c),c+=e.byteLength}));const p=yield self.crypto.subtle.digest("SHA-1",l),_=(0,a.encodeB64)(p),f=(0,a.encodeB64)(e.hash);if(_!==f)throw Error(`validateLocalKeyBundle: hash mismatch remote:${f} local:${_}`);__LOG__(2)`validateLocalKeyBundle: success`}))).apply(this,arguments)}},271221:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.fetchResendMissingKeys=function(){return S.apply(this,arguments)};var i=r(n(348926)),a=n(802792),o=n(316860),s=n(854030),l=n(738102),u=n(866729),c=n(984330),d=n(476462),p=r(n(797137)),_=n(76833),f=n(999821),h=n(76256),g=n(459857),m=n(669050),y=n(574819);const E=new o.PromiseQueueMap;function S(){return(S=(0,i.default)((function*(e){yield(0,p.default)();const t=Array.from(new Set(e.map((e=>(0,m.toUserWid)(e).toString())))).map((e=>(0,m.createUserWid)(e))),n=t.map((e=>e.toString())).join();__LOG__(2)`fetchResendMissingKeys ${n}`;const r=E.waitIfPending(n);return r?(__LOG__(2)`fetchResendMissingKeys deduped ${n}`,r):E.enqueueHandlers(n,T(t))}))).apply(this,arguments)}function T(){return v.apply(this,arguments)}function v(){return(v=(0,i.default)((function*(e){__LOG__(2)`fetchResendMissingKeys: start fetching key for ${e.length} wids`;const t=yield A(e),n=yield P(t),r=new Map;t.forEach(((e,t)=>{const i=n[t],a=(0,m.toUserWid)(e).toString(),o=r.get(a)||[];var s;null!=i&&o.push({id:null!==(s=e.device)&&void 0!==s?s:0,regId:i});r.set(a,o)}));const i=[];r.forEach(((e,t)=>{const n={userJid:(0,y.widToUserJid)((0,m.createUserWid)(t)),hasUserReasonIdentity:!1,deviceArgs:e.map((e=>({deviceId:e.id,registrationElementValue:(0,l.BIG_ENDIAN_CONTENT)(e.regId)})))};i.push(n)})),__LOG__(2)`fetchResendMissingKeys: start sending fetching iq for ${e.length} wids`;const a=yield(0,s.sendFetchMissingPreKeysRPC)({userArgs:i});switch(a.name){case"FetchMissingPreKeysResponseSuccess":return __LOG__(2)`fetchResendMissingKeys: start processing keys for ${e.length} wids`,O(a.value);case"FetchMissingPreKeysResponseServerError":{const e=a.value.errorServerErrors.value;return __LOG__(2)`fetchResendMissingKeys failed: ${e.code}:${e.text}`,Promise.reject(new c.ServerStatusCodeError(Number(e.code),e.text))}case"FetchMissingPreKeysResponseRequestError":{const e=a.value.errorRequestErrorsFetch.value;return __LOG__(2)`fetchResendMissingKeys failed: ${e.code}:${e.text}`,Promise.reject(new c.ServerStatusCodeError(Number(e.code),e.text))}}}))).apply(this,arguments)}function A(){return C.apply(this,arguments)}function C(){return(C=(0,i.default)((function*(e){__LOG__(2)`fetchResendMissingKeys: find ${e.length} users`;const t=yield(0,u.getDeviceIds)(e),n=new Map;return t.forEach(((t,r)=>{if(t){const{devices:e}=t;e.forEach((e=>{if(0!==e){const r=(0,m.createDeviceWidFromDeviceListPk)(t.id,e);n.set(r.toString(),r)}}))}const i=(0,m.toUserWid)(e[r]);n.set(i.toString(),i)})),Array.from(n.values())}))).apply(this,arguments)}function P(e){const t=e.map((e=>(0,g.isMeDevice)(e)?(0,h.getSignalProtocolStore)().getLocalRegistrationId():(0,h.getSignalProtocolStore)().loadSession(String((0,f.createSignalAddress)(e))).then((e=>{const t=null==e?void 0:e.sessions;if(t)for(const e in t)if(-1===t[e].indexInfo.closed)return t[e].registrationId;return null}))));return Promise.all(t)}function O(){return I.apply(this,arguments)}function I(){return(I=(0,i.default)((function*(e){const t=[];if(e.listUser.forEach((e=>{const n=e.userFetchMissingPreKeysSuccessOrFetchMissingPreKeysErrorOrFetchMissingPreKeysErrorFallbackMixinGroup;switch(n.name){case"FetchMissingPreKeysUserSuccess":const{jid:r,device:i}=n.value,o=(0,m.createWid)(r);return void i.forEach((e=>{var n,r;const i=e.preKeyMixin;t.push({identity:e.elementValue,deviceIdentity:null!==(n=null===(r=e.deviceIdentityMixin)||void 0===r?void 0:r.deviceIdentityElementValue)&&void 0!==n?n:null,skey:{id:(0,a.convertBytesToUint)(e.skeyIdKeyIDMixin.elementValue,3),pubkey:e.skeyValueKeyDataMixin.elementValue,signature:e.skeySignatureElementValue},key:i&&{id:(0,a.convertBytesToUint)(i.keyIdKeyIDMixin.elementValue,3),pubkey:i.keyValueKeyDataMixin.elementValue},regId:(0,a.convertBytesToUint)(e.registrationElementValue,4),wid:(0,m.createDeviceWidFromDeviceListPk)((0,d.createDeviceListPK)(o),e.id)})}));case"FetchMissingPreKeysUserErrorFallback":case"FetchMissingPreKeysUserError":const s=n.value;__LOG__(3,void 0,void 0,!0)`fetchResendMissingKeys failed for user ${e.jid}: ${s.errorCode}:${s.errorText}`,SEND_LOGS("fetchResendMissingKeys-user-error")}})),__LOG__(2)`fetchResendMissingKeys: parsed ${t.length} keys`,t.length>0)try{const{processedPrekeyCount:e}=yield(0,_.processKeyBundles)(t);__LOG__(2)`fetchResendMissingKeys: successfully established ${e} E2E sessions out of ${t.length} requested`}catch(e){__LOG__(3,void 0,void 0,!0)`fetchResendMissingKeys: failed to build session with error ${e}`,SEND_LOGS("fetchResendMissingKeys-session-error")}}))).apply(this,arguments)}},369489:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getAndStoreIdentityKeys=function(){return f.apply(this,arguments)},t.getIdentityKeys=h;var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(355813),u=n(403206),c=n(854379),d=n(999821),p=r(n(9705));const _=new s.WapParser("identityKeysParser",(e=>e.child("list").mapChildren((e=>{if(e.hasChild("error")){const t=e.child("error"),n=t.attrInt("code"),r=t.attrString("text");throw new Error(`identityKeysParser bad response: ${n} ${r}`)}return{type:e.child("type").contentBytes(1),identity:e.child("identity").contentBytes(32),user:(0,c.deviceJidToDeviceWid)(e.attrDeviceJid("jid"))}}))));function f(){return(f=(0,i.default)((function*(e){const t=yield p.default.bulkLoadIdentityKey(e.map((e=>String((0,d.createSignalAddress)(e))))),n=e.filter(((e,n)=>null==t[n]));if(0===n.length)return void __LOG__(2)`getAndStoreIdentityKeys: got 0 missing keys`;__LOG__(2)`getAndStoreIdentityKeys: query ${n.length} missing keys for ${e.length} contacts`;const r=(yield h(n)).map((e=>{const t=e.identity,n=(0,u.toSignalCurvePubKey)(t.buffer.slice(t.byteOffset,t.byteLength+t.byteOffset));return{identityKey:(0,d.bufferToStr)(n),identifier:(0,d.createSignalAddress)(e.user).toString()}}));return p.default.bulkCreateIdentity(r)}))).apply(this,arguments)}function h(){return g.apply(this,arguments)}function g(){return(g=(0,i.default)((function*(e){const t=e.map((e=>(0,o.wap)("user",{jid:(0,l.DEVICE_JID)(e)}))),n=(0,o.wap)("iq",{xmlns:"encrypt",type:"get",to:o.S_WHATSAPP_NET,id:(0,o.generateId)()},(0,o.wap)("identity",null,t)),r=yield(0,a.deprecatedSendIq)(n,_);if(!r.success)throw new Error(`getIdentityKeys bad response ${String(r)}`);return r.result}))).apply(this,arguments)}},917504:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ensureE2ESessions=y,t.ensureE2ESessionsWithDelay=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=new s.ShiftTimer((()=>{y(e,n)}));e.forEach((e=>{g.set(String(e),r)})),r.onOrAfter(1e3*t)},t.establishE2ESession=T;var i=r(n(348926)),a=n(911794),o=n(316860),s=n(201063),l=n(738102),u=n(769707),c=n(984330),d=n(355813),p=r(n(797137)),_=n(854379),f=n(76833),h=n(138706);const g=new Map,m=new o.PromiseQueueMap;function y(){return E.apply(this,arguments)}function E(){return(E=(0,i.default)((function*(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];yield(0,p.default)();const n=e.map((e=>e.toString())).join();e.forEach((e=>{const t=g.get(e.toString());t&&(t.cancel(),g.delete(e.toString()))})),__LOG__(2)`ensureE2ESession ${n}`;const r=m.waitIfPending(n);if(r)return __LOG__(2)`ensureE2ESession deduped ${n}`,r;const a=h.Session.hasSignalSessions(e).then(function(){var n=(0,i.default)((function*(n){const r=e.filter(((e,t)=>!n[t]));if(r.length>0){const{depletedPrekeyCount:e}=yield T(r,t);return{missedPrekeyCount:r.length,depletedPrekeyCount:e}}return{missedPrekeyCount:0,depletedPrekeyCount:0}}));return function(){return n.apply(this,arguments)}}());return m.enqueueHandlers(n,a)}))).apply(this,arguments)}const S=new u.WapParser("e2eSessionParser",(e=>e.child("list").mapChildren((e=>{if(e.hasChild("error")){const t=e.child("error"),n=t.attrInt("code"),r=t.attrString("text");return new Error(`establishE2ESessionParser: list item error: ${n} ${r}`)}const t=e.child("skey"),n=e.hasChild("key")?e.child("key"):null,r=e.hasChild("device-identity")?e.child("device-identity").contentBytes():null;return{wid:(0,_.deviceJidToDeviceWid)(e.attrDeviceJid("jid")),regId:e.child("registration").contentUint(4),identity:e.child("identity").contentBytes(32),deviceIdentity:r,skey:{id:t.child("id").contentUint(3),pubkey:t.child("value").contentBytes(32),signature:t.child("signature").contentBytes(64)},key:n&&{id:n.child("id").contentUint(3),pubkey:n.child("value").contentBytes(32)}}}))));function T(){return v.apply(this,arguments)}function v(){return(v=(0,i.default)((function*(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=e.map((e=>(0,l.wap)("user",{jid:(0,d.DEVICE_JID)(e),reason:t?"identity":l.DROP_ATTR}))),r=(0,l.wap)("iq",{id:(0,l.generateId)(),xmlns:"encrypt",type:"get",to:l.S_WHATSAPP_NET},(0,l.wap)("key",null,n)),i=yield(0,a.deprecatedSendIq)(r,S);if(!i.success)throw new c.ServerStatusCodeError(i.errorCode,`establishE2ESession: server error: ${i.errorCode} ${i.errorText}`);const o=i.result;if(!o||o.length<=0)throw new Error("establishE2ESession: empty key info");const{depletedPrekeyCount:s,processedPrekeyCount:u}=yield(0,f.processKeyBundles)(o);return __LOG__(2)`establishE2ESession: successfully established ${u} E2E sessions out of ${e.length} requested`,{depletedPrekeyCount:s}}))).apply(this,arguments)}},41517:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.uploadPreKeys=function(){const e=new o.PromiseRetryLoop({name:"uploadPreKeys",timer:y,code:e=>(0,i.default)((function*(){__LOG__(2)`uploadPreKeys: running`;const t=yield function(){return m.apply(this,arguments)}();!0===(null==t?void 0:t.success)?(__LOG__(2)`uploadPreKeys: done`,e()):__LOG__(2)`uploadPreKeys: retrying (after delay)`}))()});return e.start(),e.promise()};var i=r(n(348926)),a=n(911794),o=n(583433),s=n(738102),l=n(769707),u=r(n(846870)),c=n(431028),d=n(326314),p=n(732974),_=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(241588));function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}const h={error:!1,result:!0},g=new l.WapParser("uploadPreKeyResParser",(e=>{e.assertTag("iq"),e.assertFromServer();if(e.attrEnum("type",h))return{success:!0};const t=e.child("error");return{errorCode:t.attrInt("code"),errorText:t.hasAttr("text")?t.attrString("text"):""}}));function m(){return(m=(0,i.default)((function*(){const e=_.ServerProps.maxKeys,[t,n]=yield Promise.all([d.waSignalStore.getRegistrationInfo(),d.waSignalStore.getSignedPreKey()]);if(!t||!n)throw new Error("No signal info is available");const{registrationId:r,identityKeyPair:i}=t,[o,l]=yield d.waSignalStore.getOrGenPreKeys(e,c.generatePreKeyPair).then((e=>{if(0===e.length)throw new Error("No preKey is available");return[(0,s.wap)("iq",{id:(0,s.generateId)(),xmlns:"encrypt",type:"set",to:s.S_WHATSAPP_NET},(0,s.wap)("registration",null,(0,s.BIG_ENDIAN_CONTENT)(r)),(0,s.wap)("type",null,u.default.KEY_BUNDLE_TYPE),(0,s.wap)("identity",null,i.pubKey),(0,s.wap)("list",null,e.map(p.xmppPreKey)),(0,p.xmppSignedPreKey)(n)),e[e.length-1].keyId]}));try{const t=yield(0,a.waitForConnection)().then((()=>d.waSignalStore.markKeyAsUploaded(l))).then((()=>(0,a.deprecatedSendIqWithoutRetry)(o,g)));if(t.success)return d.waSignalStore.setServerHasPreKeys(!0),__LOG__(2)`_uploadPreKeys: ${e} keys uploaded, raw stanza size: ${o.toString().length}b`,{success:!0};const n=t.errorCode;return n>=500?__LOG__(3)`_uploadPreKeys: server requested backoff ${n} (count: ${e}, size: ${o.toString().length}b)`:406===n?__LOG__(3)`_uploadPreKeys: uploaded invalid keys (count: ${e}, size: ${o.toString().length}b)`:__LOG__(3)`_uploadPreKeys: unrecognized error ${n} (count: ${e}, size: ${o.toString().length}b)`,{errorCode:t.errorCode,errorText:t.errorText}}catch(t){__LOG__(3)`_uploadPreKeys: disconnected, unclear if on server: ${t} (count: ${e}, size: ${o.toString().length}b)`}}))).apply(this,arguments)}const y={algo:{type:"fibonacci",first:1e3,second:2e3},max:61e4}},949241:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.mapParsedMediaConn=_,t.queryMediaConn=function(e){const t=new Date,n=(0,l.unixTime)(),r=(0,u.wap)("iq",{to:u.S_WHATSAPP_NET,xmlns:"w:m",type:"set",id:(0,u.generateId)()},(0,u.wap)("media_conn",null)),d=(0,a.deprecatedSendIq)(r,o.mediaConnParser).then((e=>{if(e.success){__LOG__(2)`backend:queryMediaConn: got ${e.result.hosts.length} hosts`;const{auth:r,authTTL:a,ttl:o,hosts:s,maxBuckets:l}=_(e.result);if(!r||null==o||!s||0===s.length)throw __LOG__(2)`backend:queryMediaConnections: auth exists ${String(!!r)}`,__LOG__(2)`backend:queryMediaConnections: ttl exists ${String(!!o)}`,__LOG__(2)`backend:queryMediaConnections: hosts exists ${String(!!s)}`,s&&__LOG__(2)`backend:queryMediaConnections: hosts.length ${s.length}`,__LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("backend:queryMediaConnections unexpected mediaConn"),new Error("Invalid mediaConn");return(0,i.default)({queryStartTime:t,auth:r,hosts:s,ttl:o-n,maxBuckets:l},null!=a?{authTTL:a-n}:null)}if(__LOG__(4,void 0,new Error,!0)`response: ${e.errorCode} ${e.errorText}`,SEND_LOGS("backend:queryMediaConn: fail"),507===e.errorCode)throw new c.E507(e.errorText,e.errorBackoff);throw new c.ServerStatusCodeError(e.errorCode,e.errorText)}));return(0,s.default)(d,e)};var i=r(n(81109)),a=n(911794),o=n(66722),s=r(n(589970)),l=n(990445),u=n(738102),c=n(984330);function d(e){switch(e){case"kyc-id":case"novi-image":case"novi-video":case"thumbnail-gif":case"ppic":case"xma-image":return null;default:return e}}function p(e){return{hostname:e.domain,class:e.class,ips:[{ip4:e.ip4,ip6:e.ip6}]}}function _(e){var t,n;const r=e=>{const t=[],n=e.downloadable.map(d).filter(Boolean);n.length>0&&t.push({download:n});const r=e.uploadable.map(d).filter(Boolean);r.length>0&&t.push({upload:r});const i=e.downloadBuckets.map((e=>e.toString()));return null!=i&&i.length>0&&t.push({downloadBuckets:i}),t};return{hosts:e.hosts.map((e=>(0,i.default)((0,i.default)({},p(e)),{},{fallback:null!=e.fallback?p(e.fallback):void 0,type:e.isFallback?"fallback":"primary",rules:r(e)}))),auth:e.authToken,authTTL:null!==(t=e.authTTL)&&void 0!==t?t:void 0,ttl:e.authExpires,maxBuckets:null!==(n=e.maxBuckets)&&void 0!==n?n:void 0}}},124240:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.sendDeliveryReceiptsAfterDecryption=function(){return m.apply(this,arguments)},t.sendDeliveryReceiptsAfterPresence=function(){return(0,p.getInactiveReceiptTable)().all().then(function(){var e=(0,i.default)((function*(e){const t=new Map,n=Date.now().toString();return e.forEach((e=>{const{msgId:n,chatId:r,participantId:i}=e,a=(0,h.createWid)(r),o=(i?(0,h.createWid)(i):null)||a;let s=t.get(a);s||(s=new Map,t.set(a,s));let l=s.get(o);l||(l=[],s.set(o,l)),l.push(n)})),yield Promise.all(Array.from(t.keys()).map((e=>{const r=t.get(e);if(r)return(0,_.sendAggregateReceipts)(e,_.RECEIPT_TYPE.DELIVERY,n,r)}))),(0,p.getInactiveReceiptTable)().bulkRemove(e.map((e=>e.msgId)))}));return function(){return e.apply(this,arguments)}}())};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(359987),l=n(355813),u=n(883310),c=n(714443),d=n(97858),p=n(76469),_=(n(755985),n(259377)),f=n(459857),h=n(669050),g=n(574819);function m(){return(m=(0,i.default)((function*(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5?arguments[5]:void 0;const o=yield E(),s=(0,f.assertGetMe)(),l=!s.getDeviceId(),c=t.isUser()&&(0,h.toUserWid)(s).equals((0,h.toUserWid)(t))||null!=r&&(0,h.toUserWid)(s).equals((0,h.toUserWid)(r)),_=a===u.STANZA_MSG_TYPES.reaction&&!c,g=!_&&((0,d.sendOnlyActiveReceiptsEnabled)()||c||o||l);let m=Promise.resolve();if(!g){const n={msgId:e,chatId:t.toString(),participantId:r?r.toString():null};m=(0,p.getInactiveReceiptTable)().createOrReplace(n)}return m.then((()=>{if(y(e,t,n,r,g,c,i),g)return(0,p.getInactiveReceiptTable)().remove(e)}))}))).apply(this,arguments)}function y(e,t,n,r,i,s,u){let d=o.DROP_ATTR;u?d=(0,o.CUSTOM_STRING)(_.RECEIPT_TYPE.PEER_MSG):s?d=(0,o.CUSTOM_STRING)(_.RECEIPT_TYPE.SENDER):i||(d=(0,o.CUSTOM_STRING)(_.RECEIPT_TYPE.INACTIVE));const p=(0,c.extractJidFromJidWithType)((0,g.widToJidWithType)(t)),f=(0,o.wap)("receipt",{id:(0,o.CUSTOM_STRING)(e),to:(0,o.JID)(p),participant:(t.isGroup()||t.isBroadcast())&&r?(0,l.DEVICE_JID)(r):o.DROP_ATTR,recipient:!u&&s&&n?(0,l.USER_JID)(n):o.DROP_ATTR,type:d});(0,a.deprecatedCastStanza)(f)}function E(){return(0,s.frontendSendAndReceive)("getUserAvailability",{})}},74082:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return d.apply(this,arguments)};var i=r(n(348926)),a=n(417405),o=n(911794),s=n(738102),l=n(707065),u=n(355813),c=n(912384);function d(){return(d=(0,i.default)((function*(e,t,n){const r=(0,a.decodeB64)(n),{ciphertext:i,iv:d}=yield(0,c.encryptServerErrorReceipt)(r,t),p=(0,s.wap)("receipt",{type:"server-error",to:(0,u.USER_JID)(e),id:(0,s.CUSTOM_STRING)(t),category:"peer"},(0,s.wap)("encrypt",null,(0,s.wap)("enc_p",null,i),(0,s.wap)("enc_iv",null,d)));return(0,o.deprecatedSendStanzaAndWaitForAck)(p,(0,l.toCoreAckTemplate)({id:t,class:"receipt",type:"server-error",from:e,participant:null}))}))).apply(this,arguments)}},257235:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.sendAggregateOfflineReceipts=function(){return d.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(990445),s=n(665894),l=n(259377),u=n(459857),c=n(669050);function d(){return(d=(0,i.default)((function*(e){const t=new Map,n=[];e.forEach((e=>{const r=e.msg,i=e.receiptInfo;if(!i)return;const a=i.externalId||(null==r?void 0:r.id.id);if(!a)return;const{from:o,author:s}=i;let l=t.get(o);l||(l=new Map,t.set(o,l));let u=l.get(s);u||(u=[],l.set(s,u)),u.push(a),n.push({from:String(o),author:String(s),externalId:a})}));const r=(0,u.getMeUser)(),i=String((0,o.unixTime)());Promise.all(Array.from(t.keys()).map((e=>{const n=t.get(e);if(!n)return;const a=e.isUser()&&r.equals((0,c.toUserWid)(e));return(0,l.sendAggregateReceipts)(e,a?l.RECEIPT_TYPE.SENDER:l.RECEIPT_TYPE.DELIVERY,i,n,a?r:null)}))),(0,a.cancelDeadSocketTimer)(),yield(0,s.getTable)().createOrReplace({receipts:n})}))).apply(this,arguments)}},203146:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getReadReceiptType=v,t.markChatRead=function(){return A.apply(this,arguments)},t.markStatusRead=function(){return C.apply(this,arguments)},t.sendReactionReadReceipts=function(){return P.apply(this,arguments)};var i=r(n(348926)),a=n(616310),o=r(n(132375)),s=n(990445),l=n(402994),u=n(697588),c=n(359987),d=r(n(565754)),p=n(373070),_=n(997772),f=n(121260),h=n(259377),g=n(757453),m=n(459857),y=n(369084),E=r(n(124928)),S=n(669050);const T=(0,S.createWid)(a.STATUS_JID);function v(e,t){return e.isStatusV3()&&null!=t&&t.isPSA()||E.default.isPSA(e)?h.RECEIPT_TYPE.READ_SELF:e.isGroup()?h.RECEIPT_TYPE.READ:(0,g.getUserPrivacySettings)().readReceipts===_.ALL_NONE.none?h.RECEIPT_TYPE.READ_SELF:h.RECEIPT_TYPE.READ}function A(){return(A=(0,i.default)((function*(e,t){const n=Date.now().toString(),r=String(e.id),i=yield(0,f.getTable)().equals(["from","pendingReadReceipt"],[r,1],{shouldDecrypt:!1});i.sort(((e,t)=>(e.rowId||0)-(t.rowId||0)));const a=t?String(t):null;let o=i.length-1;if(a){for(;o>=0&&i[o].id!==a;o--);o<0&&(o=i.length-1)}let s=null;const l=[];for(;o>=0;o--){const t=i[o],n=e.msgs.get(t.id);n&&E.default.isPSA(e.id)&&(0,y.logChatPSARead)(n),null!=t.rowId&&(null==s||t.rowId>s)&&(s=t.rowId);const r=d.default.fromString(t.id);if(t.type===p.MSG_TYPE.CIPHERTEXT){(0,c.frontendFireAndForget)("viewPlaceholderWamAction",{msgRow:t});continue}t.type===p.MSG_TYPE.UNKNOWN&&"fanout"===t.subtype&&(0,c.frontendFireAndForget)("viewPlaceholderWamAction",{msgRow:t});const a=t.broadcastId||t.from,u=t.author||t.from;l.push({id:r.id,sender:(0,S.createWidFromWidLike)(u),chat:(0,S.createWidFromWidLike)(a)})}const _=O(l);return yield Promise.all(Array.from(_.keys()).map((t=>{const r=_.get(t);if(!r)return;const i=v(e.id);return(0,h.sendAggregateReceipts)(t,i,n,r)}))),(0,u.markMessageAndChatAsRead)(s,r,!1)}))).apply(this,arguments)}function C(){return(C=(0,i.default)((function*(e,t){if("status"!==e.remote.user)return void __LOG__(3)`markStatusRead: message is not a status.`;if(e.fromMe)return;yield(0,h.sendAggregateReceipts)(T,v(T,(0,o.default)(e.participant,"msgKey.participant")),String(t),new Map([[(0,o.default)(e.participant,"msgKey.participant"),[e.id]]]));const n={ack:l.ACK.READ};e.participant&&e.participant.isPSA()&&(n.statusPSAReadTimestamp=t),yield(0,f.getTable)().merge(e.toString(),n)}))).apply(this,arguments)}function P(){return(P=(0,i.default)((function*(e){const t=String((0,s.unixTime)()),n=O(e.filter((e=>!(0,m.isSerializedWidMe)(e.senderUserJid))).map((e=>({chat:e.msgKey.remote,sender:(0,S.createWidFromWidLike)(e.senderUserJid),id:e.msgKey.id}))));yield Promise.all(Array.from(n.keys()).map((e=>{const r=n.get(e);if(r)return(0,h.sendAggregateReceipts)(e,h.RECEIPT_TYPE.READ_SELF,t,r)})))}))).apply(this,arguments)}function O(e){const t=new Map;return e.forEach((e=>{var n,r;let{chat:i,sender:a,id:o}=e;const s=null!==(n=t.get(i))&&void 0!==n?n:new Map,l=null!==(r=s.get(a))&&void 0!==r?r:[];l.push(o),s.set(a,l),t.set(i,s)})),t}},259377:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.RECEIPT_TYPE=void 0,t.sendAggregateReceipts=function(){return h.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(911794),s=n(738102),l=n(769707),u=n(707065),c=n(355813),d=n(997772),p=n(757453);const _=Object.freeze({INACTIVE:"inactive",SENDER:"sender",DELIVERY:"delivery",READ:"read",READ_SELF:"read-self",PLAYED:"played",PLAYED_SELF:"played-self",HISTORY_SYNC_COMPLETION:"hist_sync",SERVER_ERROR:"server-error",PEER_MSG:"peer_msg"});t.RECEIPT_TYPE=_;Object.freeze({PEER:"peer"});const f=new l.WapParser("readReceiptAckParser",(e=>(e.assertTag("ack"),{readReceipts:e.hasAttr("readreceipts")?e.attrEnum("readreceipts",d.ALL_NONE):null})));function h(){return(h=(0,a.default)((function*(e,t,n,r,l,d){const h=t===_.READ||t===_.PLAYED||t===_.READ_SELF||t===_.PLAYED_SELF||t===_.HISTORY_SYNC_COMPLETION;yield Promise.all(Array.from(r.keys()).map((g=>{const m=r.get(g);if(!m||0===m.length)return;const y=e.isUser()?null:g,E=[];for(;m.length>0;){const r=m.splice(0,256);let g=null;r.length>1&&(g=(0,s.wap)("list",null,r.slice(1).map((e=>(0,s.wap)("item",{id:(0,s.CUSTOM_STRING)(e)})))));const S=(0,s.wap)("receipt",{to:(0,c.JID)(e),type:t===_.DELIVERY?s.DROP_ATTR:(0,s.CUSTOM_STRING)(t),msgtype:d?(0,s.CUSTOM_STRING)(d):s.DROP_ATTR,id:(0,s.CUSTOM_STRING)(r[0]),t:null!=n?(0,s.CUSTOM_STRING)(n):s.DROP_ATTR,participant:y?(0,c.DEVICE_JID)(y):s.DROP_ATTR,recipient:l?(0,c.USER_JID)(l):s.DROP_ATTR},g);if(h){const n=function(){var n=(0,a.default)((function*(){const n={id:r[0],from:e,class:"receipt",type:t,participant:y};if(t!==_.READ&&t!==_.READ_SELF)return(0,o.deprecatedSendStanzaAndWaitForAck)(S,(0,u.toCoreAckTemplate)(n));{const e=yield(0,o.deprecatedSendStanzaAndReturnAck)(S,(0,u.toCoreAckTemplate)(n)),t=f.parse(e);if(t.error)__LOG__(4,void 0,new Error,!0)`[messaging] sendAggregateReceipts: Invalid ack from server`,SEND_LOGS("Invalid-Receipt-Ack");else{const{readReceipts:e}=t.success;null!=e&&(0,p.setUserPrivacySettings)((0,i.default)((0,i.default)({},(0,p.getUserPrivacySettings)()),{},{readReceipts:e}))}}}));return function(){return n.apply(this,arguments)}}();E.push(n())}else E.push((0,o.deprecatedCastStanza)(S))}return Promise.all(E)})))}))).apply(this,arguments)}},525773:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.prepareKeysForRetry=E,t.sendRetryReceipt=function(){return y.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(678002),l=n(707065),u=n(355813),c=r(n(846870)),d=n(403206),p=n(431028),_=n(76256),f=n(326314),h=n(732974),g=n(459857),m=n(669050);function y(){return(y=(0,i.default)((function*(e,t,n,r,i,s){let c=arguments.length>6&&void 0!==arguments[6]&&arguments[6];try{const p=(0,_.getSignalProtocolStore)(),[f,h]=yield Promise.all([p.getLocalRegistrationId(),p.getIdentityKeyPair()]);if(null==f||null==h)throw new Error("No registration info found");const y=yield E(e,(0,d.toCurveKeyPair)(h));let S,T,v=o.DROP_ATTR,A=o.DROP_ATTR;if(t.isUser()){if(T=o.DROP_ATTR,S=(0,u.DEVICE_JID)(t),(0,g.getMeUser)().equals((0,m.toUserWid)(t)))if(c)v=(0,o.CUSTOM_STRING)("peer"),A=o.DROP_ATTR;else{if(!r)return Promise.reject(new Error("sendRetryReceipt: send retry to peer device without receipient"));A=(0,u.USER_JID)(r)}}else S=(0,u.CHAT_JID)(t),T=n?(0,u.DEVICE_JID)(n):o.DROP_ATTR;const C=(0,o.wap)("receipt",{id:(0,o.CUSTOM_STRING)(i),to:S,participant:T,recipient:A,type:"retry",category:v},(0,o.wap)("retry",{v:"1",count:(0,o.INT)(e),id:(0,o.CUSTOM_STRING)(i),t:(0,o.CUSTOM_STRING)(s)}),(0,o.wap)("registration",null,(0,o.BIG_ENDIAN_CONTENT)(f)),y);return(0,a.deprecatedSendStanzaAndWaitForAck)(C,(0,l.toCoreAckTemplate)({id:i,class:"receipt",from:t,participant:n,type:"retry"}))}catch(e){__LOG__(4,void 0,new Error,!0)`error: ${e}`,SEND_LOGS("sendRetryReceipt: error while creating or sending the retry message")}}))).apply(this,arguments)}function E(){return S.apply(this,arguments)}function S(){return(S=(0,i.default)((function*(e,t){const[n,r]=yield T(e,t);return r&&(yield f.waSignalStore.markKeyAsUploaded(r.keyId),yield f.waSignalStore.markPreKeyAsDirectDistribution(r.keyId)),n}))).apply(this,arguments)}function T(){return v.apply(this,arguments)}function v(){return(v=(0,i.default)((function*(e,t){if(e<2)return Promise.resolve([null,null]);try{const[e,n,r]=yield Promise.all([f.waSignalStore.getSignedPreKey(),f.waSignalStore.getOrGenSinglePreKey(p.generatePreKeyPair),(0,s.getADVEncodedIdentity)().then((e=>(0,o.wap)("device-identity",null,e)))]);if(!e)throw new Error("Signed pre key is not available");return[(0,o.wap)("keys",null,(0,o.wap)("type",null,c.default.KEY_BUNDLE_TYPE),(0,o.wap)("identity",null,t.pubKey),(0,h.xmppPreKey)(n),(0,h.xmppSignedPreKey)(e),r),n]}catch(e){throw Error("Could not create keys section for retry")}}))).apply(this,arguments)}},808279:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return p.apply(this,arguments)};var i=r(n(348926)),a=n(417405),o=n(911794),s=n(738102),l=n(707065),u=n(355813),c=n(912384),d=n(459857);function p(){return(p=(0,i.default)((function*(e){const t=e.id.id,n=(0,a.decodeB64)(e.mediaKey),{ciphertext:r,iv:i}=yield(0,c.encryptServerErrorReceipt)(n,t),{chat:p}=e,_=(0,s.CUSTOM_STRING)(p.id.toString({legacy:!0})),f=p.isGroup||p.isBroadcast?(0,s.CUSTOM_STRING)(e.sender.toString({legacy:!0})):s.DROP_ATTR,h=(0,d.getMeUser)(),g=(0,s.wap)("receipt",{type:"server-error",to:(0,u.USER_JID)(h),id:(0,s.CUSTOM_STRING)(t)},(0,s.wap)("encrypt",null,(0,s.wap)("enc_p",null,r),(0,s.wap)("enc_iv",null,i)),(0,s.wap)("rmr",{jid:_,from_me:(0,s.CUSTOM_STRING)(String(e.isSentByMe)),participant:f}));return(0,o.deprecatedSendStanzaAndWaitForAck)(g,(0,l.toCoreAckTemplate)({id:t,class:"receipt",type:"server-error",from:h,participant:null}))}))).apply(this,arguments)}},309029:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.encryptMsgProtobuf=function(){return _.apply(this,arguments)},t.encryptMsgSenderKey=function(){return f.apply(this,arguments)};var i=r(n(348926)),a=n(303754),o=n(973776),s=n(492917),l=n(608182),u=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(138706)),c=n(459857),d=r(n(571834));function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}function _(){return(_=(0,i.default)((function*(e,t,n){(0,s.isCryptoLibraryEnabled)();const r=(0,o.mediaTypeFromProtobuf)(n),i=new d.default.E2eMessageSend({e2eSuccessful:!0,e2eCiphertextVersion:o.CIPHERTEXT_VERSION,e2eDestination:(0,o.getMetricE2eDestination)(e),isLid:e.isLid(),messageMediaType:r?(0,o.metricsMediaType)(r):d.default.MEDIA_TYPE.NONE,retryCount:t});try{const{type:t,ciphertext:r}=yield u.Cipher.encryptSignalProto(e,(0,l.encodeAndPad)(n));return i.e2eCiphertextType=(0,o.getMetricE2eCiphertextType)(t),{type:t,ciphertext:r}}catch(t){return i.e2eSuccessful=!1,i.weight=1,__LOG__(3,void 0,void 0,void 0,["messaging"])`encryptMsgProtobuf: encryption fail for ${e.toString()}, ${t}`,Promise.reject(new Error(`[messaging] encryptMsgProtobuf: encryption fail for ${e.toString()}, ${t}`))}finally{i.commit()}}))).apply(this,arguments)}function f(){return(f=(0,i.default)((function*(e,t,n,r,i){var s,l;let p=null;p=e.isReaction()?e.getWamMediaType():null!=r?(0,o.metricsMediaType)(r):d.default.MEDIA_TYPE.NONE;const _=new d.default.E2eMessageSend({e2eSuccessful:!0,e2eCiphertextType:(0,o.getMetricE2eCiphertextType)(a.CiphertextType.Skmsg),e2eCiphertextVersion:o.CIPHERTEXT_VERSION,e2eDestination:d.default.E2E_DESTINATION.GROUP,messageMediaType:p,retryCount:0,isLid:null!==(s=i.isLid)&&void 0!==s?s:void 0,typeOfGroup:null!==(l=i.wamTypeOfGroup)&&void 0!==l?l:void 0}),f=(0,c.getMaybeMeLid)(),h=(null==e?void 0:e.isCagAddon())&&null!=f?f:(0,c.assertGetMe)();try{return yield u.Cipher.encryptSenderKeyMsgSignalProto(t,h,n)}catch(e){return _.e2eSuccessful=!1,_.weight=1,__LOG__(3,void 0,void 0,void 0,["messaging"])`encryptMsgSenderKey: encryption fail for ${t.toString()}, ${e}`,Promise.reject(new Error(`[messaging] encryptMsgSenderKey: encryption fail for ${t.toString()}, ${e}`))}finally{_.commit()}}))).apply(this,arguments)}},635881:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.encryptAndSendKeyMsg=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(707065),s=n(21838),l=r(n(797137)),u=n(974382);function c(){return(c=(0,i.default)((function*(e){yield(0,l.default)(),__LOG__(2,void 0,void 0,void 0,["messaging"])`encryptAndSendKeyMsg: sending ${e.id.toString()}`;const t=e.to,n=(0,s.createPeerMsgProtobuf)(e),r=yield(0,u.createUserDeviceMsgStanza)(t,null,e,n,{type:u.MsgType.AppStateSync});return(0,a.deprecatedSendStanzaAndWaitForAck)(r,(0,o.toCoreAckTemplate)({id:e.id.id,class:"message",from:t,participant:null}))}))).apply(this,arguments)}},974382:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MsgType=void 0,t.createGroupDeviceMsgStanza=function(){return T.apply(this,arguments)},t.createUserDeviceMsgStanza=function(){return S.apply(this,arguments)};var i=r(n(348926)),a=n(738102),o=n(678002),s=n(303754),l=n(973776),u=n(355813),c=n(588733),d=n(523930),p=n(309029),_=n(917504),f=n(608182),h=n(76256),g=n(459857),m=n(669050),y=r(n(441143));const E=n(76672).Mirrored(["Retry","AppStateSync"]);function S(){return(S=(0,i.default)((function*(e,t,n,r,i){let a=r;return yield(0,_.ensureE2ESessions)([e]),(0,g.isMeAccount)(e)&&i.type!==E.AppStateSync?((0,y.default)(null!=t,"[messaging] createDeviceMsgStanza: no recipient for peer device message"),a=(0,c.wrapDeviceSentMessage)(r,t),yield(0,f.populateICDCMeta)((0,m.toUserWid)(t),a)):yield(0,f.populateICDCMeta)((0,m.toUserWid)(e),a),v(e,null,t,n,a,i)}))).apply(this,arguments)}function T(){return(T=(0,i.default)((function*(e,t,n,r,i){if(yield(0,_.ensureE2ESessions)([t]),i.type===E.AppStateSync)return Promise.reject(new Error("[messaging] createGroupDeviceMsgStanza: not expect for App State Sync message"));const a=(0,g.isMeAccount)(t)?(0,c.wrapDeviceSentMessage)(r,e):r;return yield(0,f.populateICDCMeta)((0,m.toUserWid)(t),a),v(e,t,null,n,a,i)}))).apply(this,arguments)}function v(){return A.apply(this,arguments)}function A(){return(A=(0,i.default)((function*(e,t,n,r,i,c){var _;const g=t||e,m=null!==(_=c.retryCount)&&void 0!==_?_:0,y=(0,l.mediaTypeFromProtobuf)(i),S=r.id,{type:T,ciphertext:v}=yield(0,p.encryptMsgProtobuf)(g,m,i);let A=null;if(T===s.CiphertextType.Pkmsg){const e=yield(0,o.getADVEncodedIdentity)();A=(0,a.wap)("device-identity",null,e)}c.type!==E.Retry&&(yield(0,f.updateIdentityRange)(S,[g])),yield(0,h.getSignalProtocolStore)().flushBufferToDiskIfNotMemOnlyMode();const C=(0,d.pollTypeAttributeFromProtobuf)(i),P=null==C?null:(0,a.wap)("meta",{polltype:C});return(0,a.wap)("message",{id:(0,a.CUSTOM_STRING)(S.id),to:(0,u.JID)(e),participant:t?(0,u.DEVICE_JID)(t):a.DROP_ATTR,recipient:n?(0,u.USER_JID)(n):a.DROP_ATTR,type:(0,d.typeAttributeFromProtobuf)(i),edit:(0,f.editAttribute)(i,r.subtype),category:c.type===E.AppStateSync?(0,a.CUSTOM_STRING)("peer"):a.DROP_ATTR,push_priority:c.type===E.AppStateSync?(0,a.CUSTOM_STRING)("high"):a.DROP_ATTR},(0,a.wap)("enc",{v:(0,a.CUSTOM_STRING)(l.CIPHERTEXT_VERSION.toString()),type:(0,a.CUSTOM_STRING)(T),count:0===m?a.DROP_ATTR:(0,a.INT)(m),mediatype:(0,l.encodeMaybeMediaType)(y),"decrypt-fail":(0,l.encodeMaybeDecryptFail)((0,d.decryptFailAttributeFromProtobuf)(i))},v),A,P)}))).apply(this,arguments)}t.MsgType=E},312469:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.FANOUT_TYPE=void 0,t.createFanoutMsgStanza=function(){return O.apply(this,arguments)};var i=r(n(348926)),a=n(738102),o=n(678002),s=n(486492),l=n(303754),u=n(973776),c=n(355813),d=n(121977),p=n(588733),_=n(523930),f=n(309029),h=n(917504),g=n(311110),m=n(608182),y=n(76256),E=n(459857),S=r(n(571834)),T=r(n(342310)),v=n(669050);const A=Object.freeze({CHAT:"chat",GROUP_DIRECT:"groupDirect"});function C(){return P.apply(this,arguments)}function P(){return(P=(0,i.default)((function*(e,t,n,r){const o=(0,u.mediaTypeFromProtobuf)(n),s=(0,u.nativeFlowNameTypeFromProtobuf)(n);if(r.fanoutType===A.CHAT&&1===t.length&&(0,m.isPrimaryDevice)(t[0])){const r=t[0],i=(0,E.isMeAccount)(r)?(0,p.wrapDeviceSentMessage)(n,e):n,{type:c,ciphertext:d}=yield(0,f.encryptMsgProtobuf)(r,0,i);return{shouldHaveIdentity:c===l.CiphertextType.Pkmsg,body:(0,a.wap)("enc",{v:(0,a.CUSTOM_STRING)(u.CIPHERTEXT_VERSION.toString()),type:(0,a.CUSTOM_STRING)(c),mediatype:(0,u.encodeMaybeMediaType)(o),"decrypt-fail":(0,u.encodeMaybeDecryptFail)((0,_.decryptFailAttributeFromProtobuf)(n)),native_flow_name:(0,u.encodeMaybeNativeFlowName)(s)},d)}}let d=!1;const h=t.map(function(){var t=(0,i.default)((function*(t){const i=(0,E.isMeAccount)(t)?(0,p.wrapDeviceSentMessage)(n,e):n,h=r.fanoutType===A.GROUP_DIRECT?(0,v.toUserWid)(t):(0,v.toUserWid)(e);yield(0,m.populateICDCMeta)(h,i);try{const{type:e,ciphertext:r}=yield(0,f.encryptMsgProtobuf)(t,0,i);return e===l.CiphertextType.Pkmsg&&(d=!0),(0,a.wap)("to",{jid:(0,c.DEVICE_JID)(t)},(0,a.wap)("enc",{v:(0,a.CUSTOM_STRING)(u.CIPHERTEXT_VERSION.toString()),type:(0,a.CUSTOM_STRING)(e),mediatype:(0,u.encodeMaybeMediaType)(o),"decrypt-fail":(0,u.encodeMaybeDecryptFail)((0,_.decryptFailAttributeFromProtobuf)(n)),native_flow_name:(0,u.encodeMaybeNativeFlowName)(s)},r))}catch(e){return __LOG__(3)`encryptAndSendUserMsg: encryption fail for ${String(t)}: ${e}`,(0,m.isPrimaryDevice)(t)&&(__LOG__(4,void 0,new Error,!0,["messaging"])`encryptAndSendUserMsg: encryption fail for primary device ${String(t)}`,SEND_LOGS("encryption-fail-for-primary-device")),null}}));return function(){return t.apply(this,arguments)}}()),g=(yield Promise.all(h)).filter((e=>null!=e));return g.length>0?{body:(0,a.wap)("participants",null,g),shouldHaveIdentity:d}:Promise.reject(new Error("[messaging] encryptAndSendUserMsg: encryption fail for all devices"))}))).apply(this,arguments)}function O(){return(O=(0,i.default)((function*(e,t,n,r){var i,p;const f=e.to;try{var E,v;null===(E=e.wamMessageSendPerfReporter)||void 0===E||E.startPrekeysFetchStage();const t=yield(0,h.ensureE2ESessions)(n),i=null==t?void 0:t.missedPrekeyCount;var P;if(null!=i)null===(P=e.wamMessageSendPerfReporter)||void 0===P||P.setFetchedPrekeyCount(i);null===(v=e.wamMessageSendPerfReporter)||void 0===v||v.postPrekeysFetchStage(),(0,g.maybePostPrekeysDepletionMetric)({count:null==t?void 0:t.depletedPrekeyCount,prekeysFetchReason:S.default.PREKEYS_FETCH_CONTEXT.SEND_MESSAGE,messageType:r.fanoutType===A.GROUP_DIRECT?S.default.MESSAGE_TYPE.GROUP:S.default.MESSAGE_TYPE.INDIVIDUAL,deviceSizeBucket:r.fanoutType===A.GROUP_DIRECT?(0,T.default)(n.length):null})}catch(e){__LOG__(4,void 0,new Error,void 0,["messaging"])`ensureE2ESessions with error`}const O=e.id;let I=n;r.isResendingMsg&&(I=yield(0,m.filterDeviceWithChangedIdentity)(O,n));const M=I.map((e=>({msgKey:O,receiverId:e})));yield(0,s.createOrMergeReceiptRecords)(M),null===(i=e.wamMessageSendPerfReporter)||void 0===i||i.startClientEncryptStage();const b=yield C(f,I,t,r);null===(p=e.wamMessageSendPerfReporter)||void 0===p||p.postClientEncryptStage();let R=null;if(r.fanoutType===A.GROUP_DIRECT){const e=(0,u.mediaTypeFromProtobuf)(t);R=(0,a.wap)("enc",{v:(0,a.CUSTOM_STRING)(u.CIPHERTEXT_VERSION.toString()),type:(0,a.CUSTOM_STRING)(l.CiphertextType.Skmsg),mediatype:(0,u.encodeMaybeMediaType)(e)})}let N=null;if(b.shouldHaveIdentity){const e=yield(0,o.getADVEncodedIdentity)();N=(0,a.wap)("device-identity",null,e)}const w=(0,_.getBizNativeFlowName)(t);let L;const D=d.ContactCollection.get(f),k=null==D?void 0:D.privacyMode;let U;null!=k&&(L=(0,a.wap)("biz",{host_storage:(0,a.INT)(k.hostStorage),actual_actors:(0,a.INT)(k.actualActors),privacy_mode_ts:(0,a.INT)(k.privacyModeTs),native_flow_name:(0,a.MAYBE_CUSTOM_STRING)(w)})),f.isLid()&&!0!==(null==D?void 0:D.shareOwnPn)&&null!=(null==D?void 0:D.phoneJid)&&(U=D.phoneJid),null==L&&null!=w&&(L=(0,a.wap)("biz",{native_flow_name:(0,a.CUSTOM_STRING)(w)})),r.isResendingMsg||(yield(0,m.updateIdentityRange)(O,I)),yield(0,y.getSignalProtocolStore)().flushBufferToDiskIfNotMemOnlyMode();const G=(0,_.pollTypeAttributeFromProtobuf)(t),x=null==G?null:(0,a.wap)("meta",{polltype:G}),{id:B}=O;return(0,a.wap)("message",{id:(0,a.CUSTOM_STRING)(B),to:(0,c.CHAT_JID)(f),type:(0,_.typeAttributeFromProtobuf)(t),edit:(0,m.editAttribute)(t,e.subtype),device_fanout:r.isResendingMsg?(0,a.CUSTOM_STRING)("false"):a.DROP_ATTR,recipient_pn:U?(0,c.USER_JID)(U):a.DROP_ATTR},b.body,R,N,L,x)}))).apply(this,arguments)}t.FANOUT_TYPE=A},919820:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.encryptAndSendKeyDistributionMsg=function(){return g.apply(this,arguments)},t.encryptAndSendMsg=function(){return h.apply(this,arguments)};var i=r(n(348926)),a=n(21838),o=r(n(797137)),s=n(566509),l=n(373070),u=n(178777),c=n(342223),d=n(94187),p=n(784399),_=r(n(571834));const f="https://web.whatsapp.net";function h(){return(h=(0,i.default)((function*(e){yield(0,o.default)();const t=e.id,n=e.to;if(!t||!t.id)return Promise.reject(new Error("[messaging] sending message without an id"));if(!n)return Promise.reject(new Error("[messaging] sending message without an remote id"));let r;if(e.type===l.MSG_TYPE.STICKER&&null==e.deprecatedMms3Url&&(e.deprecatedMms3Url=f),e.asMms){const t=e.isUnsentPhoneMsg();r=t?{type:e.type}:e.avParams(),e.type!==l.MSG_TYPE.STICKER||t||null!=r.url||(r.url=f)}const i=(0,a.createMsgProtobuf)(e,r||{});if(n.isUser()){const t=(0,p.encryptAndSendUserMsg)(e,i);return(0,d.sendTcToken)(n),t}return n.isGroup()?(0,c.encryptAndSendGroupMsg)(e,i):Promise.reject(new Error("[messaging] unsupported remote jid type"))}))).apply(this,arguments)}function g(){return(g=(0,i.default)((function*(e){if(yield(0,o.default)(),!e.id)return Promise.reject(new Error("[messaging] sending message without an id"));if(!e.remote)return Promise.reject(new Error("[messaging] sending message without an remote id"));if(e.remote.isGroup()){const t=new s.MessageSendPerfReporter({chatWid:e.remote,mediaType:_.default.MEDIA_TYPE.NONE,messageType:_.default.MESSAGE_TYPE.GROUP});return t.setMessageIsInvisible(!0),(0,u.encryptAndSendGroupKeyDistributionMsg)(e).then((()=>{t.postWrittenWireStage()}))}return Promise.reject(new Error("[messaging] unsupported remote jid type"))}))).apply(this,arguments)}},739172:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendMsgQueueMap=void 0;const r=new(n(316860).PromiseQueueMap);t.sendMsgQueueMap=r},105461:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.logLinkPreviewResponse=function(e,t){let n;const r=(0,a.unixTimeMs)();if(null!=e){const t=h.get(e);null!=t&&(n=r-t)}var i;__LOG__(2)`link preview: session id: ${e}, is success: ${t}, durationMs: ${n}`,(0,o.getABPropConfigValue)("non_message_data_request_logging_enabled")&&new _.default.WebcLinkPreviewResponseHandle({previewSessionId:e,isPreviewSuccess:t,previewDurationMs:null!==(i=n)&&void 0!==i?i:void 0}).commit();null!=e&&h.delete(e)},t.logNonMessagePeerDataRequest=E,t.sendPeerDataOperationRequest=function(){return g.apply(this,arguments)};var i=r(n(348926)),a=n(990445),o=n(287461),s=n(118487),l=r(n(565754)),u=n(734173),c=n(533494),d=n(635881),p=n(459857),_=r(n(571834)),f=n(669050);const h=new Map;function g(){return(g=(0,i.default)((function*(e,t,n,r){const i=m(e,t,n,r);if(null!=i)return y(e,i),E(e,i),yield(0,s.storePeerMessages)([i]),h.set(i.id.id,(0,a.unixTimeMs)()),(0,d.encryptAndSendKeyMsg)(i);__LOG__(3)`peer message: the constructed peer data operation request message is null`}))).apply(this,arguments)}function m(e,t,n,r){let i=null;switch(e){case c.Message$PeerDataOperationRequestType.SEND_RECENT_STICKER_BOOTSTRAP:i={peerDataOperationRequestType:c.Message$PeerDataOperationRequestType.SEND_RECENT_STICKER_BOOTSTRAP,requestStickerReupload:[],requestUrlPreview:[]};break;case c.Message$PeerDataOperationRequestType.UPLOAD_STICKER:i=function(e){var t;const n=null==e||null===(t=e.filter((e=>!u.inFlightStickerRequests.has(e))))||void 0===t?void 0:t.map((e=>((0,u.cleanRequestAfterTimeout)(e),{fileSha256:e})));if(0===(null==n?void 0:n.length))return null;return{peerDataOperationRequestType:c.Message$PeerDataOperationRequestType.UPLOAD_STICKER,requestStickerReupload:null!=n?n:[],requestUrlPreview:[]}}(t);break;case c.Message$PeerDataOperationRequestType.GENERATE_LINK_PREVIEW:i=function(e){const t=null==e?void 0:e.map((e=>({url:e})));return{peerDataOperationRequestType:c.Message$PeerDataOperationRequestType.GENERATE_LINK_PREVIEW,requestUrlPreview:null!=t?t:[],requestStickerReupload:[]}}(n)}if(null==i)return null;return{id:new l.default({fromMe:!0,remote:(0,p.getMeUser)(),id:null!=r?r:l.default.newId()}),to:(0,f.createDeviceWidFromUserAndDevice)((0,p.assertGetMe)().user,(0,p.assertGetMe)().server,0),type:"protocol",subtype:"peer_data_operation_request_message",peerDataOperationRequestMessage:i}}function y(e,t){if(e===c.Message$PeerDataOperationRequestType.UPLOAD_STICKER){var n;const e=null===(n=t.peerDataOperationRequestMessage)||void 0===n?void 0:n.requestStickerReupload;null!=e&&e.forEach((e=>{const t=e.fileSha256;var n;null!=t&&(u.inFlightStickerRequests.add(t),u.mediaReuploadRequestCountMap.set(t,(null!==(n=u.mediaReuploadRequestCountMap.get(t))&&void 0!==n?n:0)+1))}))}}function E(e,t){if(!(0,o.getABPropConfigValue)("non_message_data_request_logging_enabled"))return;const n=(0,u.convertRequestTypeEnumForLogging)(e);new _.default.NonMessagePeerDataRequest({peerDataRequestCount:S(e,t),peerDataRequestType:n,peerDataRequestSessionId:t.id.id}).commit()}function S(e,t){var n,r,i,a;switch(e){case c.Message$PeerDataOperationRequestType.SEND_RECENT_STICKER_BOOTSTRAP:return 1;case c.Message$PeerDataOperationRequestType.UPLOAD_STICKER:const e=null===(n=t.peerDataOperationRequestMessage)||void 0===n?void 0:n.requestStickerReupload;return null!==(r=null==e?void 0:e.length)&&void 0!==r?r:0;case c.Message$PeerDataOperationRequestType.GENERATE_LINK_PREVIEW:const o=null===(i=t.peerDataOperationRequestMessage)||void 0===i?void 0:i.requestStickerReupload;return null!==(a=null==o?void 0:o.length)&&void 0!==a?a:0}}},152413:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.sendPeerDataOperationRequestResponseMessage=function(){return d.apply(this,arguments)};var i=r(n(348926)),a=n(118487),o=r(n(565754)),s=n(533494),l=n(635881),u=n(459857),c=n(669050);function d(){return(d=(0,i.default)((function*(e,t,n){const r=p(e,t,n);return null==r?(__LOG__(3)`peer message: the constructed peer data operation request response message is null`,Promise.resolve()):(yield(0,a.storePeerMessages)([r]),(0,l.encryptAndSendKeyMsg)(r))}))).apply(this,arguments)}function p(e,t,n){let r=null;switch(t){case s.Message$PeerDataOperationRequestType.UPLOAD_STICKER:r=function(e,t){if(null==t)return null;return{stanzaId:e,peerDataOperationRequestType:s.Message$PeerDataOperationRequestType.UPLOAD_STICKER,peerDataOperationResult:t}}(e,n)}if(null==r)return null;return{id:new o.default({fromMe:!0,remote:(0,u.getMeUser)(),id:o.default.newId()}),to:(0,c.createDeviceWidFromUserAndDevice)((0,u.assertGetMe)().user,(0,u.assertGetMe)().server,0),type:"protocol",subtype:"peer_data_operation_request_response_message",peerDataOperationRequestResponseMessage:r}}},723406:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.sendRetry=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(707065),s=n(21838),l=n(974382),u=r(n(441143));function c(){return(c=(0,i.default)((function*(e,t,n,r,i){const c=r.id.id;let d;__LOG__(2,void 0,void 0,void 0,["messaging"])`sendRetry: id ${c} to ${e.toString()}, requester: ${(t||e).toString()}, count: ${i}`,r.asMms&&(d=r.isUnsentPhoneMsg()?{type:r.type}:r.avParams());const p=(0,s.createMsgProtobuf)(r,d||{}),_={type:l.MsgType.Retry,retryCount:i};let f;return e.isUser()?f=yield(0,l.createUserDeviceMsgStanza)(e,n,r,p,_):((0,u.default)(null!=t,"[messaging] sendRetry: no participant for group retry message"),f=yield(0,l.createGroupDeviceMsgStanza)(e,t,r,p,_)),__LOG__(2,void 0,void 0,void 0,["messaging"])`sendRetry: sending ${c} to ${e.toString()}`,(0,a.deprecatedSendStanzaAndWaitForAck)(f,(0,o.toCoreAckTemplate)({id:c,class:"message",from:e,participant:t}))}))).apply(this,arguments)}},784399:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.encryptAndSendUserMsg=function(){return S.apply(this,arguments)};var i=r(n(348926)),a=r(n(170735)),o=n(911794),s=n(990445),l=n(707065),u=n(83672),c=n(271221),d=n(141797),p=n(97858),_=n(204412),f=n(608182),h=n(312469),g=n(510607),m=n(459857),y=r(n(571834)),E=n(643011);function S(){return(S=(0,i.default)((function*(e,t){var n;const{id:r,to:i}=e;__LOG__(2,void 0,void 0,void 0,["messaging"])`encryptAndSendUserMsg: sending ${r}`;const a=i.isLid()&&null!==(n=(0,m.getMaybeMeLid)())&&void 0!==n?n:(0,m.assertGetMe)(),o=yield(0,u.getFanOutList)({wids:[i,a]}),l=yield A(e,t,o,{fanoutType:h.FANOUT_TYPE.CHAT}),{phash:f}=l;if(f){__LOG__(2,void 0,void 0,void 0,["messaging"])`encryptAndSendUserMsg: phash mismatch, got server phash ${f}`;const n=(0,s.unixTime)();(0,_.postMdDeviceSyncAckMetric)(i,t),e.wamMessageSendReporter=new d.MessageSendReporter(e,{isResend:!0}),Promise.resolve().then((()=>{if((0,p.prekeyFetchForMessageResendEnabled)()&&!i.isLid())return(0,c.fetchResendMissingKeys)([i,a]).catch((()=>{__LOG__(3,void 0,void 0,!0)`fetchResendMissingKeys: failed`,SEND_LOGS("fetchResendMissingKeys-sync-error")}))})).then((()=>(0,g.syncDeviceListJob)([i,a],"message",f))).then((()=>T(e,t,o,n)))}return l}))).apply(this,arguments)}function T(){return v.apply(this,arguments)}function v(){return(v=(0,i.default)((function*(e,t,n,r){const{to:i}=e,o=e.id.id;var l;if(__LOG__(2,void 0,void 0,void 0,["messaging"])`resendUserMsg: ${o} to ${e.to.toString()}`,(0,s.unixTime)()-r>f.RESEND_TIMEOUT_IN_SECONDS)return __LOG__(2,void 0,void 0,void 0,["messaging"])`resendUserMsg: ${o}: skip resending due to ${f.RESEND_TIMEOUT_IN_SECONDS/60} min timeout`,null===(l=e.wamMessageSendReporter)||void 0===l||l.postFailure({result:y.default.MESSAGE_SEND_RESULT_TYPE.ERROR_EXPIRED,isTerminal:!1}),void(e.wamMessageSendReporter=null);try{var c;const r=i.isLid()&&null!==(c=(0,m.getMaybeMeLid)())&&void 0!==c?c:(0,m.assertGetMe)(),s=yield(0,u.getFanOutList)({wids:[i,r]}),l=(0,a.default)(s,n,String);var d;if(0===l.length)return __LOG__(2,void 0,void 0,void 0,["messaging"])`resendUserMsg: ${o}: skip resending to the empty list`,null===(d=e.wamMessageSendReporter)||void 0===d||d.postFailure({result:y.default.MESSAGE_SEND_RESULT_TYPE.ERROR_BACKFILL_USYNC_FAILED,isTerminal:!1}),void(e.wamMessageSendReporter=null);__LOG__(2,void 0,void 0,void 0,["messaging"])`resendUserMsg: ${o}: resending to devices: ${l.join(",")}`;const{phash:p}=yield A(e,t,l,{fanoutType:h.FANOUT_TYPE.CHAT,isResendingMsg:!0});p&&(0,g.syncDeviceListJob)([i,r],"message",p)}catch(t){var p;throw __LOG__(2,void 0,void 0,void 0,["messaging"])`resendUserMsg: failed to resend ${o} message: ${t}`,null===(p=e.wamMessageSendReporter)||void 0===p||p.postFailure({result:y.default.MESSAGE_SEND_RESULT_TYPE.ERROR_UNKNOWN,isTerminal:!1}),e.wamMessageSendReporter=null,t}(0,E.logMessageSendForChatThreadLogging)(e)}))).apply(this,arguments)}function A(){return C.apply(this,arguments)}function C(){return(C=(0,i.default)((function*(e,t,n,r){var i,a,s,u,c;null===(i=e.wamMessageSendPerfReporter)||void 0===i||i.startReadyToSendStage();const{id:d,to:p}=e,_=yield(0,h.createFanoutMsgStanza)(e,t,n,r);null===(a=e.wamMessageSendPerfReporter)||void 0===a||a.postReadyToSendStage(),null===(s=e.wamMessageSendPerfReporter)||void 0===s||s.startWrittenWireStage();const g=yield(0,o.deprecatedSendStanzaAndReturnAck)(_,(0,l.toCoreAckTemplate)({id:d.id,class:"message",from:p,participant:null})),m=f.sendMsgAckSyncParser.parse(g);if(m.error)throw new Error("[messaging] sendMsgToDeviceList: Invalid ack from server");return null===(u=e.wamMessageSendPerfReporter)||void 0===u||u.postWrittenWireStage(),e.wamMessageSendPerfReporter=null,null===(c=e.wamMessageSendReporter)||void 0===c||c.postSuccess(),e.wamMessageSendReporter=null,m.success}))).apply(this,arguments)}},747350:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getKeyDistributionMsg=function(){return m.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(287461),s=n(866729),l=(n(303754),n(21838)),u=n(309029),c=n(358891),d=n(608182),p=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=g(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(138706)),_=n(459857),f=r(n(571834)),h=n(669050);function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(g=function(e){return e?n:t})(e)}function m(){return(m=(0,a.default)((function*(e,t,n){const r=(0,_.getMaybeMeLid)(),l=(null==e?void 0:e.isCagAddon())&&null!=r?r:(0,_.assertGetMe)(),c=yield p.Session.getGroupSenderKeyInfo(t,l),f={senderKeyDistributionMessage:{groupId:t.toString({legacy:!0}),axolotlSenderKeyDistributionMessage:c}},g=(0,o.getABPropConfigValue)("web_message_send_precalculate_icdc");let m=null;if(g&&(__LOG__(2,void 0,void 0,void 0,["messaging"])`getKeyDistributionMsg: precalculate ICDC for ${null==e?void 0:e.id.toString()}`,m=yield y(f,n)),!g)try{yield(0,s.bulkGetDeviceRecord)([(0,_.getMeUser)(),...n.map(h.toUserWid)])}catch(e){__LOG__(3)`getKeyDistributionMsg: failed to warm up device cache: ${e}`}const E=n.map(function(){var e=(0,a.default)((function*(e){try{let n=(0,i.default)({},f);var t;if(null!=m)n=null!==(t=m.get((0,h.toUserWid)(e).toString()))&&void 0!==t?t:n;else yield(0,d.populateICDCMeta)((0,h.toUserWid)(e),n);const r=yield(0,u.encryptMsgProtobuf)(e,0,n);return{type:r.type,ciphertext:r.ciphertext,participant:e}}catch(t){if(__LOG__(2,void 0,void 0,void 0,["messaging"])`encryptAndSendUserMsg: encryption fail for ${e.toString()}, ${t}`,(0,d.isPrimaryDevice)(e))return Promise.reject(new Error(`[messaging] encryptAndSendUserMsg: encryption fail for primary device ${String(e)}`))}}));return function(){return e.apply(this,arguments)}}());return(yield Promise.all(E)).filter(Boolean)}))).apply(this,arguments)}function y(){return E.apply(this,arguments)}function E(){return(E=(0,a.default)((function*(e,t){const n=(0,_.getMeUser)(),r=[...Array.from(new Set(t.map(h.toUserWid)))],[o,...u]=yield(0,s.bulkGetDeviceRecord)([n,...r]);let d=null;try{d=yield(0,c.getICDCMetaFromDeviceRecord)(n,o)}catch(e){throw new f.default.AdvMetadataCreationFailure({advMetadataIsMe:!0}).commit(),e}const p=new Map;return yield Promise.all(u.map(function(){var t=(0,a.default)((function*(t,a){const o=r[a];let s=null;if(!o.equals(n))try{s=yield(0,c.getICDCMetaFromDeviceRecord)(o,t)}catch(e){throw new f.default.AdvMetadataCreationFailure({advMetadataIsMe:!1}).commit(),e}const u=(0,i.default)({},e);(0,l.populateMessageContextInfo)(u,d,s),p.set(o.toString(),u)}));return function(){return t.apply(this,arguments)}}())),p}))).apply(this,arguments)}},878395:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.encryptAndSendGroupDirectMsg=function(){return T.apply(this,arguments)},t.resendGroupMsg=v;var i=r(n(348926)),a=r(n(170735)),o=n(911794),s=n(990445),l=n(707065),u=n(83672),c=n(271221),d=n(141797),p=n(97858),_=n(204412),f=n(608182),h=n(312469),g=n(76256),m=n(510607),y=r(n(571834)),E=n(669050),S=n(643011);function T(){return(T=(0,i.default)((function*(e,t,n,r){const i=e.to;__LOG__(2,void 0,void 0,void 0,["messaging"])`encryptAndSendGroupDirectMsg: sending ${e.id} with group ${i.toString()}`;const a=yield C(e,t,n,{fanoutType:h.FANOUT_TYPE.GROUP_DIRECT}),{phash:o}=a;if(o){__LOG__(2,void 0,void 0,void 0,["messaging"])`encryptAndSendGroupDirectMsg: phash mismatch, got server phash ${o}`;const a=(0,s.unixTime)();(0,_.postMdDeviceSyncAckMetric)(i,t,r),e.wamMessageSendReporter=new d.MessageSendReporter(e,{isResend:!0,groupData:r}),Promise.resolve().then((()=>{if((0,p.prekeyFetchForMessageResendEnabled)())return(0,c.fetchResendMissingKeys)(n).catch((()=>{__LOG__(3,void 0,void 0,!0)`fetchResendMissingKeys: failed`,SEND_LOGS("fetchResendMissingKeys-sync-error")}))})).then((()=>(0,m.syncDeviceListJob)(n,"message",o))).then((()=>v(e,t,n,a)))}return a}))).apply(this,arguments)}function v(){return A.apply(this,arguments)}function A(){return(A=(0,i.default)((function*(e,t,n,r){const i=e.id.id;var o;if(__LOG__(2,void 0,void 0,void 0,["messaging"])`resendGroupMsg: ${i} to ${e.to.toString()}`,(0,s.unixTime)()-r>f.RESEND_TIMEOUT_IN_SECONDS)return __LOG__(2,void 0,void 0,void 0,["messaging"])`resendUserMsg: ${i}: skip group resending due to ${f.RESEND_TIMEOUT_IN_SECONDS/60} min timeout`,null===(o=e.wamMessageSendReporter)||void 0===o||o.postFailure({result:y.default.MESSAGE_SEND_RESULT_TYPE.ERROR_EXPIRED,isTerminal:!1}),void(e.wamMessageSendReporter=null);try{const r=Array.from(new Set(n.map((e=>(0,E.toUserWid)(e).toString())))).map((e=>(0,E.createUserWid)(e))),o=yield(0,u.getFanOutList)({wids:r}),s=(0,a.default)(o,n,String);if(0===s.length)return void __LOG__(2,void 0,void 0,void 0,["messaging"])`resendGroupMsg: ${i}: skip resending to the empty list`;__LOG__(2,void 0,void 0,void 0,["messaging"])`resendGroupMsg: ${i}: resending to devices: ${s.join(",")}`,yield C(e,t,s,{fanoutType:h.FANOUT_TYPE.GROUP_DIRECT,isResendingMsg:!0})}catch(t){var l;throw __LOG__(2,void 0,void 0,void 0,["messaging"])`resendGroupMsg: failed to resend ${i} message: ${t}`,null===(l=e.wamMessageSendReporter)||void 0===l||l.postFailure({result:y.default.MESSAGE_SEND_RESULT_TYPE.ERROR_UNKNOWN,isTerminal:!1}),e.wamMessageSendReporter=null,t}(0,S.logMessageSendForChatThreadLogging)(e)}))).apply(this,arguments)}function C(){return P.apply(this,arguments)}function P(){return(P=(0,i.default)((function*(e,t,n,r){var i,a,s,u;const{id:c,to:d}=e,p=yield(0,h.createFanoutMsgStanza)(e,t,n,r);yield(0,g.getSignalProtocolStore)().flushBufferToDiskIfNotMemOnlyMode(),null===(i=e.wamMessageSendPerfReporter)||void 0===i||i.postReadyToSendStage(),null===(a=e.wamMessageSendPerfReporter)||void 0===a||a.startWrittenWireStage();const _=yield(0,o.deprecatedSendStanzaAndReturnAck)(p,(0,l.toCoreAckTemplate)({id:c.id,class:"message",from:d,participant:null})),m=f.sendMsgAckSyncParser.parse(_);return m.error?Promise.reject(new Error("[messaging] encryptAndSendGroupDirectMsg: Invalid ack from server")):(null===(s=e.wamMessageSendPerfReporter)||void 0===s||s.postWrittenWireStage(),e.wamMessageSendPerfReporter=null,null===(u=e.wamMessageSendReporter)||void 0===u||u.postSuccess(),e.wamMessageSendReporter=null,m.success)}))).apply(this,arguments)}},178777:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.encryptAndSendGroupKeyDistributionMsg=function(e){__LOG__(2,void 0,void 0,void 0,["messaging"])`encryptAndSendGroupKeyDistributionMsg: sending ${e}`;const t=e.remote;return m.sendMsgQueueMap.enqueue(t.toString(),(()=>function(){return v.apply(this,arguments)}(e)))};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(678002),l=n(486492),u=n(565583),c=n(303754),d=n(973776),p=n(707065),_=n(355813),f=n(747350),h=n(848624),g=n(608182),m=n(739172),y=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=T(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(138706)),E=n(76256),S=n(459857);function T(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(T=function(e){return e?n:t})(e)}function v(){return(v=(0,i.default)((function*(e){const{id:t}=e,n=e.remote,{skDistribList:r,skList:i,rotateKey:s}=yield(0,u.getGroupSenderKeyList)(n),[f,m]=yield A(n,r,s),y=i.concat(r);yield(0,g.updateIdentityRange)(e,y),yield(0,l.createOrMergeReceiptRecords)(y.map((t=>({msgKey:e,receiverId:t})))),yield(0,E.getSignalProtocolStore)().flushBufferToDiskIfNotMemOnlyMode();const T=yield(0,h.phashV2)([...y,(0,S.assertGetMe)()]),v=(0,o.wap)("message",{id:(0,o.CUSTOM_STRING)(t),to:(0,_.CHAT_JID)(n),phash:(0,o.CUSTOM_STRING)(T),type:"text",device_fanout:(0,o.CUSTOM_STRING)("false")},(0,o.wap)("enc",{v:(0,o.CUSTOM_STRING)(d.CIPHERTEXT_VERSION.toString()),type:(0,o.CUSTOM_STRING)(c.CiphertextType.Skmsg),"decrypt-fail":(0,o.CUSTOM_STRING)("hide")}),f,m),C=yield(0,a.deprecatedSendStanzaAndReturnAck)(v,(0,p.toCoreAckTemplate)({id:t,class:"message",from:n,participant:null})),P=g.sendMsgAckSyncParser.parse(C);return P.error?(__LOG__(3,void 0,void 0,void 0,["messaging"])`encryptAndSendSenderKeyMsg: Invalid ack from server`,Promise.reject(new Error("[messaging] encryptAndSendSenderKeyMsg: Invalid ack from server"))):(yield(0,u.markHasSenderKey)(n,r),P.success)}))).apply(this,arguments)}function A(){return C.apply(this,arguments)}function C(){return(C=(0,i.default)((function*(e,t,n){if(n){const t=(0,S.assertGetMe)();yield y.Session.deleteGroupSenderKeyInfo(e,t)}const r=yield(0,f.getKeyDistributionMsg)(null,e,t);let i=null,a=!1;r&&r.length>0&&(i=(0,o.wap)("participants",null,r.map((e=>{let{type:t,ciphertext:n,participant:r}=e;return t===c.CiphertextType.Pkmsg&&(a=!0),(0,o.wap)("to",{jid:(0,_.DEVICE_JID)(r)},(0,o.wap)("enc",{v:(0,o.CUSTOM_STRING)(d.CIPHERTEXT_VERSION.toString()),"decrypt-fail":(0,o.CUSTOM_STRING)("hide"),type:(0,o.CUSTOM_STRING)(t)},n))}))));let l=null;if(a){const e=yield(0,s.getADVEncodedIdentity)();l=(0,o.wap)("device-identity",null,e)}return[i,l]}))).apply(this,arguments)}},342223:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.SendCagListMsgType=void 0,t._getGroupData=I,t.encryptAndSendGroupMsg=function(e,t){var n;const{id:r,to:a}=e;return __LOG__(2,void 0,void 0,void 0,["messaging"])`encryptAndSendGroupMsg: queued ${r}`,null===(n=e.wamMessageSendPerfReporter)||void 0===n||n.startWaitingToEncryptStage(),f.sendMsgQueueMap.enqueue(a.toString(),(0,i.default)((function*(){var n,i,o,s,l;__LOG__(2,void 0,void 0,void 0,["messaging"])`encryptAndSendGroupMsg: sending ${r}`,null===(n=e.wamMessageSendPerfReporter)||void 0===n||n.postWaitingToEncryptStage(),null===(i=e.wamMessageSendPerfReporter)||void 0===i||i.startReadyToSendStage();const{protocolMessage:f}=t;let h=null;if((null==f?void 0:f.type)===d.Message$ProtocolMessage$Type.REVOKE&&(null==f?void 0:f.key)){const{remoteJid:e,id:t,participant:n}=f.key;e&&t&&n&&(h=new u.default({remote:(0,m.createWid)(e),fromMe:!0,id:t,participant:(0,m.createWid)(n)}))}const g=yield function(){return b.apply(this,arguments)}(a.toString()),S=yield I(a.toString(),g,e);let T;if(null===(o=e.wamMessageSendReporter)||void 0===o||o.setGroupData(S),null===(s=e.wamMessageSendPerfReporter)||void 0===s||s.setGroupData(S),!0===S.isCag&&!0===S.isIncognito){let t=null;e.type===c.MSG_TYPE.REACTION_ENC?t=E.REACTION:e.keepType===d.KeepType.UNDO_KEEP_FOR_ALL?t=E.UNKEEP:"sender_revoke"===e.subtype&&(t=E.REVOKE);const n=Boolean(S.amIAdmin);T=yield v(a,h,t,n,g)}else T=yield function(){return C.apply(this,arguments)}(a,h,g);if(T.type===y.DIRECT){var A,P;const{deviceList:n}=T;return null===(A=e.wamMessageSendReporter)||void 0===A||A.setDeviceCount(n.length),null===(P=e.wamMessageSendPerfReporter)||void 0===P||P.setIsDirectedMessage(!0),(0,p.encryptAndSendGroupDirectMsg)(e,t,n,S)}const{senderKeyList:O}=T;return null===(l=e.wamMessageSendReporter)||void 0===l||l.setDeviceCount(O.skList.length+O.skDistribList.length),(0,_.encryptAndSendSenderKeyMsg)(e,t,O,S)})))},t.getCagMessageSendList=v;var i=r(n(348926)),a=n(565583),o=n(83672),s=n(862159),l=n(76469),u=r(n(565754)),c=n(373070),d=n(533494),p=n(878395),_=n(627249),f=n(739172),h=n(459857),g=n(869513),m=(r(n(571834)),n(669050));const y=Object.freeze({SKMSG:"skmsg",DIRECT:"direct"}),E=n(76672).Mirrored(["REACTION","REVOKE","UNKEEP"]);function S(e){return e.isLid()}function T(e){return!e.isLid()}function v(){return A.apply(this,arguments)}function A(){return(A=(0,i.default)((function*(e,t,n,r,i){const{skDistribList:o,skList:s}=yield(0,a.getGroupSenderKeyListFromParticipantRecord)(e,i);if(n===E.REACTION)return{type:y.SKMSG,senderKeyList:{skList:s.filter(S),skDistribList:o.filter(S),rotateKey:!1}};if(r||n===E.UNKEEP||n===E.REVOKE){const e={type:y.SKMSG,senderKeyList:{skList:s.filter(T),skDistribList:o.filter(T),rotateKey:!1}};if(n===E.REVOKE&&null!=t){const n=yield P(t,e.senderKeyList);return null!=n?n:e}return e}throw new Error("CAG - non-admin tryng to send a regular message")}))).apply(this,arguments)}function C(){return(C=(0,i.default)((function*(e,t,n){const r=yield(0,a.getGroupSenderKeyListFromParticipantRecord)(e,n),i={senderKeyList:r,type:y.SKMSG};if(t){const e=yield P(t,r);return null!=e?e:i}return i}))).apply(this,arguments)}function P(){return O.apply(this,arguments)}function O(){return(O=(0,i.default)((function*(e,t){const n=yield(0,l.getMsgInfoTable)().equals(["msgKey"],String(e));if(0===n.length)return null;const{skDistribList:r,skList:i}=t,a=new Set(r.concat(i).map((e=>String((0,m.toUserWid)(e))))),s=n.filter((e=>!a.has(e.receiverUserJid))).map((e=>(0,m.createWid)(e.receiverUserJid)));if(0===s.length)return null;const u=[...yield(0,o.getFanOutList)({wids:s}),...i,...r];return{type:y.DIRECT,deviceList:u}}))).apply(this,arguments)}function I(){return M.apply(this,arguments)}function M(){return(M=(0,i.default)((function*(e,t,n){const r=yield(0,l.getGroupMetadataTable)().get(e);null==r&&__LOG__(3)`_getGroupData: no group metadata record found for: ${e}`;const i={isIncognito:null,amIAdmin:null,isCag:null,isLid:null,wamTypeOfGroup:null,participantCount:null,deviceCount:null,deviceSizeBucket:null};if(null!=r){const e=(0,s.getGroupTypeFromGroupMetadata)(r);i.wamTypeOfGroup=(0,s.groupTypeToWamEnum)(e);const t=e===s.GroupType.DEFAULT_ANNOUNCEMENT_GROUP,a=!0===r.incognito,o=n.isReaction();i.isLid=t&&a&&o,i.isCag=t,i.isIncognito=a}if(null!=t){const e=(0,h.assertGetMeUser)(),n=t.admins.includes(e.toString());i.amIAdmin=n,Object.assign(i,(0,g.getGroupMetricsFromDbRecord)(t))}return i}))).apply(this,arguments)}function b(){return(b=(0,i.default)((function*(e){const t=yield(0,l.getParticipantTable)().get(e);return null==t&&__LOG__(3)`_getParticipantRecord: no participants record found for: ${e}`,t}))).apply(this,arguments)}t.SendCagListMsgType=E},627249:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.encryptAndSendSenderKeyMsg=function(){return F.apply(this,arguments)};var i=r(n(348926)),a=(n(215373),n(911794)),o=n(990445),s=n(738102),l=n(678002),u=n(486492),c=n(565583),d=n(303754),p=n(973776),_=n(707065),f=n(355813),h=n(492917),g=n(523930),m=n(309029),y=n(271221),E=n(747350),S=n(917504),T=n(141797),v=n(97858),A=n(848624),C=n(204412),P=n(311110),O=n(121260),I=n(878395),M=n(608182),b=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=k(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(138706)),R=n(76256),N=n(757453),w=n(459857),L=r(n(571834)),D=n(926209);function k(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(k=function(e){return e?n:t})(e)}function U(){return G.apply(this,arguments)}function G(){return(G=(0,i.default)((function*(e,t,n){var r,i,a;if(null==e||null===(r=e.wamMessageSendPerfReporter)||void 0===r||r.startPrekeysFetchStage(),null==e||null===(i=e.wamMessageSendPerfReporter)||void 0===i||i.setFetchedPrekeyCount(0),t.length>0)try{var o;const r=yield(0,S.ensureE2ESessions)(t);null==e||null===(o=e.wamMessageSendPerfReporter)||void 0===o||o.setFetchedPrekeyCount(null==r?void 0:r.missedPrekeyCount),(0,P.maybePostPrekeysDepletionMetric)({count:null==r?void 0:r.depletedPrekeyCount,prekeysFetchReason:L.default.PREKEYS_FETCH_CONTEXT.SEND_MESSAGE,messageType:L.default.MESSAGE_TYPE.GROUP,deviceSizeBucket:n.deviceSizeBucket})}catch(e){__LOG__(4,void 0,new Error,void 0,["messaging"])`ensureE2ESessions: failed for ${t.length} devices: ${e}`}null==e||null===(a=e.wamMessageSendPerfReporter)||void 0===a||a.postPrekeysFetchStage()}))).apply(this,arguments)}function x(){return B.apply(this,arguments)}function B(){return(B=(0,i.default)((function*(e,t,n,r,i){var a,o;null==e||null===(a=e.wamMessageSendPerfReporter)||void 0===a||a.startClientEncryptStage();const u=(0,M.encodeAndPad)(r),c=(0,p.mediaTypeFromProtobuf)(r);let _,y;(0,h.isCryptoLibraryEnabled)(),n.length>0&&(y=yield(0,E.getKeyDistributionMsg)(e,t,n)),_=yield(0,m.encryptMsgSenderKey)(e,t,u,c,i),null===(o=e.wamMessageSendPerfReporter)||void 0===o||o.postClientEncryptStage();let S=null,T=!1;y&&y.length>0&&(S=(0,s.wap)("participants",null,y.map((e=>{let{type:t,ciphertext:n,participant:i}=e;return t===d.CiphertextType.Pkmsg&&(T=!0),(0,s.wap)("to",{jid:(0,f.DEVICE_JID)(i)},(0,s.wap)("enc",{v:(0,s.CUSTOM_STRING)(p.CIPHERTEXT_VERSION.toString()),type:(0,s.CUSTOM_STRING)(t),"decrypt-fail":(0,p.encodeMaybeDecryptFail)((0,g.decryptFailAttributeFromProtobuf)(r))},n))}))));const v=(0,s.wap)("enc",{v:(0,s.CUSTOM_STRING)(p.CIPHERTEXT_VERSION.toString()),type:(0,s.CUSTOM_STRING)(d.CiphertextType.Skmsg),mediatype:(0,p.encodeMaybeMediaType)(c),"decrypt-fail":(0,p.encodeMaybeDecryptFail)((0,g.decryptFailAttributeFromProtobuf)(r))},_.ciphertext);let A=null;if(T){const e=yield(0,l.getADVEncodedIdentity)();A=(0,s.wap)("device-identity",null,e)}return[S,v,A]}))).apply(this,arguments)}function F(){return(F=(0,i.default)((function*(e,t,n,r){var i,l,d,p,h;const{id:m,to:E}=e;__LOG__(2,void 0,void 0,void 0,["messaging"])`encryptAndSendSenderKeyMsg: sending ${m}`;const{id:S}=m,{skDistribList:P,skList:N,rotateKey:L}=n;j(e),null==e||null===(i=e.wamMessageSendPerfReporter)||void 0===i||i.setSenderKeyDistributionCount(P.length);const k=N.concat(P),G=(0,w.getMaybeMeLid)(),B=e.isCagAddon()&&null!=G?G:(0,w.assertGetMe)(),F=yield(0,A.phashV2)([...k,B]);yield(0,u.createOrMergeReceiptRecords)(k.map((e=>({msgKey:m,receiverId:e})))),L&&(yield b.Session.deleteGroupSenderKeyInfo(E,B)),yield U(e,P,r);const[K,H,W]=yield x(e,E,P,t,r),V=(0,g.pollTypeAttributeFromProtobuf)(t),$=null==V?null:(0,s.wap)("meta",{polltype:V}),z=(0,s.wap)("message",{id:(0,s.CUSTOM_STRING)(S),to:(0,f.CHAT_JID)(E),phash:(0,s.CUSTOM_STRING)(F),type:(0,g.typeAttributeFromProtobuf)(t),edit:(0,M.editAttribute)(t,e.subtype)},K,H,W,$);yield(0,M.updateIdentityRange)(m,k),yield(0,R.getSignalProtocolStore)().flushBufferToDiskIfNotMemOnlyMode(),null===(l=e.wamMessageSendPerfReporter)||void 0===l||l.postReadyToSendStage(),null===(d=e.wamMessageSendPerfReporter)||void 0===d||d.startWrittenWireStage();const q=yield(0,a.deprecatedSendStanzaAndReturnAck)(z,(0,_.toCoreAckTemplate)({id:S,class:"message",from:E,participant:null}));null===(p=e.wamMessageSendPerfReporter)||void 0===p||p.postWrittenWireStage(),e.wamMessageSendPerfReporter=null,null===(h=e.wamMessageSendReporter)||void 0===h||h.postSuccess(),e.wamMessageSendReporter=null;const J=M.sendMsgAckSyncParser.parse(q);if(J.error)return __LOG__(3,void 0,void 0,void 0,["messaging"])`encryptAndSendSenderKeyMsg: invalid ack from server for ${e.id}`,Promise.reject(new Error("[messaging] encryptAndSendSenderKeyMsg: Invalid ack from server"));yield(0,c.markHasSenderKey)(E,P);const{phash:Q,count:X}=J.success;if(Q&&Q!==F){__LOG__(2,void 0,void 0,void 0,["messaging"])`encryptAndSendSenderKeyMsg: phash mismatch for ${e.id}, got server phash ${Q}`;const n=(0,o.unixTime)();(0,C.postMdDeviceSyncAckMetric)(E,t,r),e.wamMessageSendReporter=new T.MessageSendReporter(e,{isResend:!0,groupData:r}),Promise.resolve().then((()=>{if((0,v.prekeyFetchForMessageResendEnabled)()&&!e.isCagAddon())return(0,y.fetchResendMissingKeys)(k).catch((()=>{__LOG__(3,void 0,void 0,!0)`fetchResendMissingKeys: failed`,SEND_LOGS("fetchResendMissingKeys-sync-error")}))})).then((()=>(0,D.sendQueryGroup)(E))).catch((t=>{throw __LOG__(3,void 0,void 0,void 0,["messaging"])`encryptAndSendSenderKeyMsg: ${e.id}: sendQueryGroup failed for message resend: ${t}`,Y(e),t})).then((()=>(0,I.resendGroupMsg)(e,t,k,n)))}return null!=X&&(0,O.getTable)().merge(String(m),{count:X}),J.success}))).apply(this,arguments)}function j(e){var t;(0,N.markUserSentMessageToChat)(e.chat.id)&&(null===(t=e.wamMessageSendPerfReporter)||void 0===t||t.setMessageIsFirstUserMessage(!0))}function Y(e){var t;null===(t=e.wamMessageSendReporter)||void 0===t||t.postFailure({result:L.default.MESSAGE_SEND_RESULT_TYPE.ERROR_BACKFILL_USYNC_FAILED,isTerminal:!1}),e.wamMessageSendReporter=null}},795139:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQlPerfTracker=void 0;var i=n(287461),a=r(n(571834));class o{constructor(e){this._isMex=!1,this._operation="not provided",this._startTime=-1,this._endTime=-1,this._errorCode=-1,this._iqResponseStatus=-1,this._gqlResponseStatus=-1,this._operation=e,this._isMex=o.isGraphQLenabled()}toUseGraphQL(){return this._isMex}start(){this._startTime=Date.now()}stop(){this._endTime=Date.now()}logEvent(e){let{envelopeResponseStatus:t,payloadResponseStatus:n}=e;o.isExperimentEnabled()&&new a.default.MexEvent({isMex:this._isMex,mexEventOperation:this._operation,mexEventStartTime:this._startTime,mexEventEndTime:this._endTime,mexEventPayloadResponseStatus:n,mexEventEnvelopeResponseStatus:t,mexEventRequestSize:1}).commit()}static isExperimentEnabled(){return(0,i.getABPropConfigValue)("mex_phase3_enabled")}static isGraphQLenabled(){return o.isExperimentEnabled()&&o.isGraphQLFlagSet()}static isGraphQLFlagSet(){return o.isFlagSet(1)}static isFlagSet(e){return((0,i.getABPropConfigValue)("mex_phase3_status_flags")&e)===e}}t.GraphQlPerfTracker=o},345176:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.mexGetAbout=function(){return u.apply(this,arguments)};var i,a=r(n(348926)),o=n(550866),s=n(258269),l=r(n(124928));function u(){return(u=(0,a.default)((function*(e){if(!l.default.isWid(e)||!e.isUser())return __LOG__(2)`[MEX][STATUS] this method should only take user wid, instead it received: ${e}`,Promise.resolve({id:e});const t=void 0!==i?i:i=n(181673),r={users:[{user_id:e.user}],updates:["STATUS"]};try{var a,u,c,d;const n=yield(0,s.fetchQuery)(t,r);__LOG__(2)`[MEX][STATUS] response`;const i=null===(a=n.xwa2_users_updates_since)||void 0===a||null===(u=a[0])||void 0===u||null===(c=u.updates)||void 0===c||null===(d=c[0])||void 0===d?void 0:d.text;return __LOG__(2,void 0,void 0,void 0,["GQL","MEX"])`[MEX][STATUS] fetched status for ${e}`,{id:e,status:i}}catch(t){if(t instanceof o.GraphQLServerError){var p;const n=t.source.errors[0];401!==n.code?__LOG__(4,void 0,new Error,void 0,["GQL","MEX"])`[MEX][STATUS] status error for ${e}`:__LOG__(2,void 0,void 0,void 0,["GQL","MEX"])`[MEX][STATUS] status fetch not allowed for ${e}`;return{id:e,error:{errorCode:n.code,errorText:null!==(p=n.message)&&void 0!==p?p:"Unknown MEX error"},isIQError:n.isIQError}}throw t}}))).apply(this,arguments)}},181673:e=>{"use strict";const t={fragment:{argumentDefinitions:[n={defaultValue:null,kind:"LocalArgument",name:"updates"},r={defaultValue:null,kind:"LocalArgument",name:"users"}],kind:"Fragment",metadata:null,name:"WAWebMexFetchStatusJobQuery",selections:i=[{alias:null,args:[{kind:"Variable",name:"updates",variableName:"updates"},{kind:"Variable",name:"users",variableName:"users"}],concreteType:"XWA2UserUpdate",kind:"LinkedField",name:"xwa2_users_updates_since",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"jid",storageKey:null},{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"updates",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"dhash",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"text",storageKey:null}],type:"XWA2UserStatusUpdate",abstractKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[r,n],kind:"Operation",name:"WAWebMexFetchStatusJobQuery",selections:i},params:{cacheID:"41c1984e8ecc4a530c9e6a81cd71001b",id:null,metadata:{},name:"WAWebMexFetchStatusJobQuery",operationKind:"query",text:"query WAWebMexFetchStatusJobQuery(\n $users: [XWA2UserUpdateVersions!]!\n $updates: [XWA2UserUpdateCategory!]!\n) {\n xwa2_users_updates_since(users: $users, updates: $updates) {\n jid\n updates {\n __typename\n ... on XWA2UserStatusUpdate {\n dhash\n text\n }\n }\n }\n}\n"}};var n,r,i;t.hash="fe2e0cf4482f88b84289866feb0c37c1",e.exports=t},208016:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.blockUser=function(e,t,n){if(e.isPSA())return d(e,!0);return f(e,!0,t,n)},t.unblockUser=function(e,t){if(e.isPSA())return d(e,!1);return f(e,!1,t)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(355813),u=n(673168);const c=new s.WapParser("blockUseResponseParser",(e=>{if(e.hasChild("error")){const t=e.child("error"),n=t.attrInt("code"),r=t.attrString("text");return __LOG__(3)`blockUserResponseParser: server response with ${n}, ${r}`,{errorCode:n,errorText:r}}return __LOG__(2)`block/unblock user: success`,null}));function d(){return p.apply(this,arguments)}function p(){return(p=(0,i.default)((function*(e,t){const n=(0,o.wap)("iq",{xmlns:"w:comms:chat",to:o.S_WHATSAPP_NET,type:"set",id:(0,o.generateId)()},(0,o.wap)("blocking",{action:(0,o.CUSTOM_STRING)(t?"block":"unblock")})),r=yield(0,a.deprecatedSendIq)(n,c);if(!r.success){const{errorCode:e,errorText:t}=r;return __LOG__(3)`blockUnblockPSAUser: server response with ${e}, ${t}`,{errorCode:e,errorText:t}}}))).apply(this,arguments)}function _(e){if(null==e)return null;const{reason:t,reasonDescription:n,entryPoint:r,firstMessage:i,businessDiscoveryEntryPoint:a,businessDiscoveryTimestamp:s,businessDiscoveryId:l}=e;return(0,o.wap)("biz_opt_out",{reason:null!=t?(0,o.CUSTOM_STRING)(String(t)):o.DROP_ATTR,reason_description:null!=n?(0,o.CUSTOM_STRING)(String(n)):o.DROP_ATTR,entry_point:null!=r?(0,o.CUSTOM_STRING)(String(r)):o.DROP_ATTR,first_message:null!=i?(0,o.CUSTOM_STRING)(String(i)):o.DROP_ATTR,business_discovery_entry_point:null!=a?(0,o.CUSTOM_STRING)(String(a)):o.DROP_ATTR,business_discovery_timestamp:null!=s?(0,o.CUSTOM_STRING)(String(s)):o.DROP_ATTR,business_discovery_id:null!=l?(0,o.CUSTOM_STRING)(String(l)):o.DROP_ATTR})}function f(){return h.apply(this,arguments)}function h(){return(h=(0,i.default)((function*(e,t,n,r){const i=yield(0,u.getBlocklistHash)(),s=!e.isLid(),d=_(r),p=(0,o.wap)("iq",{xmlns:"blocklist",to:o.S_WHATSAPP_NET,type:"set",id:(0,o.generateId)()},(0,o.wap)("item",{dhash:null!=i?(0,o.CUSTOM_STRING)(i):o.DROP_ATTR,lid_notify:!1===n&&s?(0,o.CUSTOM_STRING)("true"):o.DROP_ATTR,action:(0,o.CUSTOM_STRING)(t?"block":"unblock"),jid:(0,l.JID)(e)},d)),f=yield(0,a.deprecatedSendIq)(p,c);if(!f.success){const{errorCode:e,errorText:t}=f;return __LOG__(3)`blockUnblockUser: server response with ${e}, ${t}`,{errorCode:e,errorText:t}}}))).apply(this,arguments)}},291179:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getBlocklist=function(){return d.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(854379),u=n(673168);const c=new s.WapParser("blocklistParser",(e=>{const t={wids:[]};if(e.hasChild("error"))return function(e){const t=e&&e.maybeAttrString("code"),n=e&&e.maybeAttrString("text");__LOG__(3,void 0,void 0,!0)`getBlocklist error: code ${t} text ${n}`,SEND_LOGS("getBlocklist")}(e.child("error")),t;e.assertAttr("type","result");const n=e.maybeChild("list");if(n){const e=n.maybeAttrString("dhash");e&&(t.dhash=e),n.hasChild("item")&&(t.wids=n.mapChildrenWithTag("item",(e=>({wid:(0,l.deviceJidToUserWid)(e.attrDeviceJid("jid")),displayName:e.maybeAttrString("display_name")})))||[])}return t}));function d(){return(d=(0,i.default)((function*(){const e=yield(0,u.getBlocklistHash)(),t=(0,o.wap)("iq",{xmlns:"blocklist",to:o.S_WHATSAPP_NET,type:"get",id:(0,o.generateId)()},e?(0,o.wap)("item",{dhash:(0,o.CUSTOM_STRING)(e)}):null),n=yield(0,a.deprecatedSendIq)(t,c);if(!n.success){const{errorCode:e,errorText:t}=n;return __LOG__(3)`fetchBlocklist: failed ${e}, ${t}`,{errorCode:e,errorText:t}}return n.result?n.result:Promise.reject(new Error("response does not have blocked list"))}))).apply(this,arguments)}},394190:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.fetchAndUpdateBlocklist=function(){return p.apply(this,arguments)},t.getBlockingStatusForPSAUser=function(){return f.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(718785),u=n(450491),c=n(291179),d=n(673168);function p(){return(p=(0,i.default)((function*(){__LOG__(2)`[blocklist] fetch blocklist using blocklist`;const e=yield(0,c.getBlocklist)();if(null!=e.errorCode)return e;if(e.dhash){__LOG__(2)`[blocklist] updating blocklist with ${e.wids.length||0} contact(s)`,yield(0,d.setBlocklistHash)(e.dhash),yield(0,l.updateBlocklist)(e.wids.map((e=>e.wid)));const t=e.wids.map((e=>{let{wid:t,displayName:n}=e;return null!=n&&t.isLid()?{lid:t.user,displayName:n}:null})).filter(Boolean);yield(0,u.createOrReplaceDisplayNames)(t)}else __LOG__(2)`[blocklist] no change in blocklist, skip update`;return e}))).apply(this,arguments)}const _=new s.WapParser("blockingStatusPSAUserResponseParser",(e=>{if(e.hasChild("error")){const t=e.child("error"),n=t.attrInt("code"),r=t.attrString("text");return __LOG__(3)`blockingStatusPSAUserResponseParser: server response with ${n}, ${r}`,{errorCode:n,errorText:r}}e.assertAttr("type","result");return"blocked"===e.child("blocking").attrString("status")}));function f(){return(f=(0,i.default)((function*(){const e=(0,o.wap)("iq",{xmlns:"w:comms:chat",to:o.S_WHATSAPP_NET,type:"get",id:(0,o.generateId)()},(0,o.wap)("query",null,(0,o.wap)("blocking_status",null))),t=yield(0,a.deprecatedSendIq)(e,_);if(!t.success){const{errorCode:e,errorText:n}=t;return __LOG__(3)`getBlockingStatusForPSAUser: server response with ${e}, ${n}`,{errorCode:e,errorText:n}}return t.result}))).apply(this,arguments)}},256905:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getDisappearingMode=function(){return l.apply(this,arguments)};var i=r(n(348926)),a=n(692269),o=n(328606),s=r(n(124928));function l(){return(l=(0,i.default)((function*(e){if(!s.default.isWid(e)||!e.isUser())return __LOG__(3)`getDisappearingMode: this method should only take user wid, instead it received: ${e}`,Promise.resolve({id:e});const t=(new a.USyncQuery).withContext("interactive").withMode("query").withDisappearingModeProtocol().withUser((new o.USyncUser).withId(e)),n=yield t.execute();if(n.error.all||n.error.status){const t=n.error.all||n.error.status;return __LOG__(3)`getDisappearingMode: failed ${t.errorCode} : ${t.errorText}`,{id:e,error:t}}const r=n.list;0!==r.length&&null!=r[0].disappearing_mode||Promise.reject(new Error("no disappearing_mode data returned for user"));const{duration:i,t:l}=r[0].disappearing_mode;return{id:e,disappearingModeDuration:i,disappearingModeSettingTimestamp:l}}))).apply(this,arguments)}},202506:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.queryDisappearingMode=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(984330);const u=new s.WapParser("dmParser",(e=>{const t=e.child("disappearing_mode");return{duration:t.attrInt("duration"),t:t.attrInt("t")}}));function c(){return(c=(0,i.default)((function*(){const e=(0,o.wap)("iq",{xmlns:"disappearing_mode",to:o.S_WHATSAPP_NET,type:"get",id:(0,o.generateId)()}),t=yield(0,a.deprecatedSendIq)(e,u);if(!t.success)throw new l.ServerStatusCodeError(t.errorCode);return t.result}))).apply(this,arguments)}},921311:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){let n;switch(t){case"paused":n=(0,i.wap)("paused",null);break;case"composing":n=(0,i.wap)("composing",null);break;case"recording":n=(0,i.wap)("composing",{media:"audio"});break;default:throw new Error(`Impossible value, the default statement should never be reached for value: ${t}`)}return(0,r.deprecatedCastStanza)((0,i.wap)("chatstate",{to:(0,a.CHAT_JID)(e)},n))};var r=n(911794),i=n(738102),a=n(355813)},263354:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,r.deprecatedCastStanza)((0,i.wap)("presence",{type:e,name:(0,i.MAYBE_CUSTOM_STRING)(a.Conn.pushname)}))};var r=n(911794),i=n(738102),a=n(266888)},196506:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const n=e.isUser()&&null!=t;return(0,r.deprecatedCastStanza)((0,i.wap)("presence",{id:(0,i.generateId)(),to:(0,a.CHAT_JID)(e),type:"subscribe"},n?(0,i.wap)("tctoken",null,t):null))};var r=n(911794),i=n(738102),a=n(355813)},696155:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ACCOUNT_SYNC_TYPE=void 0,t.getAndUpdateProfilePicture=function(){const e=(0,a.default)(u.ProfilePicThumbCollection.get((0,y.getMeUser)()),"ProfilePicThumbCollection.get(getMeUser())");return u.ProfilePicThumbCollection.resyncPictures([e])},t.getDevices=function(e){return(0,f.syncDeviceListJob)((0,y.getMePNandLIDWids)(),e,null)},t.updateBlocklist=function(){return v.apply(this,arguments)},t.updateDefaultDisappearingMode=function(){return A.apply(this,arguments)},t.updatePrivacySettings=function(){return T.apply(this,arguments)},t.updateTosState=function(e){return e.forEach((e=>{g.TosManager.setState(e.id,e.state?"ACCEPTED":"NOT_ACCEPTED")})),Promise.resolve()};var i=r(n(348926)),a=r(n(132375)),o=n(157211),s=n(824668),l=n(997772),u=n(292390),c=n(394190),d=n(202506),p=n(964907),_=n(572768),f=n(510607),h=n(313687),g=n(87429),m=n(757453),y=n(459857);const E=n(76672)({BLOCKLIST:"blocklist",DEVICES:"devices",DISAPPEARING_MODE:"disappearing_mode",PICTURE:"picture",PRIVACY:"privacy",STATUS:"status",TOS:"tos"});function S(e,t){switch(t){case _.PrivacyDisallowedListType.About:return e.about===l.VISIBILITY.contact_blacklist;case _.PrivacyDisallowedListType.GroupAdd:return e.groupAdd===l.VISIBILITY.contact_blacklist;case _.PrivacyDisallowedListType.LastSeen:return e.lastSeen===l.VISIBILITY.contact_blacklist;case _.PrivacyDisallowedListType.ProfilePicture:return e.profilePicture===l.VISIBILITY.contact_blacklist}}function T(){return(T=(0,i.default)((function*(){const e=yield(0,p.getPrivacy)();(0,m.setUserPrivacySettings)(e);const t=[_.PrivacyDisallowedListType.About,_.PrivacyDisallowedListType.GroupAdd,_.PrivacyDisallowedListType.LastSeen,_.PrivacyDisallowedListType.ProfilePicture].filter((t=>S(e,t))),n=yield(0,h.syncPrivacyDisallowedLists)(t);return{privacySettings:e,privacyDisallowedRows:n}}))).apply(this,arguments)}function v(){return(v=(0,i.default)((function*(){const e=yield(0,c.fetchAndUpdateBlocklist)();e.dhash&&(o.BlocklistCollection.toArray().forEach((e=>o.BlocklistCollection.remove(e))),e.wids&&e.wids.forEach((e=>{o.BlocklistCollection.gadd(e.wid)})))}))).apply(this,arguments)}function A(){return(A=(0,i.default)((function*(){const e=yield(0,d.queryDisappearingMode)();yield(0,s.updateDisappearingMode)((0,y.getMaybeMeUser)(),e.duration,e.t)}))).apply(this,arguments)}t.ACCOUNT_SYNC_TYPE=E},578300:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.queryPrivacyDisallowedList=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(854379);n(572768);const u=new s.WapParser("getPrivacyDisallowedListParser",(e=>{const t=e.child("privacy").maybeChild("list");if(null==t)return{status:"match"};return{status:"mismatch",users:t.mapChildren((e=>(0,l.deviceJidToUserWid)(e.attrDeviceJid("jid")))),dhash:t.attrString("dhash")}}));function c(){return(c=(0,i.default)((function*(e){const t=(0,o.wap)("iq",{to:o.S_WHATSAPP_NET,type:"get",id:(0,o.generateId)(),xmlns:"privacy"},(0,o.wap)("privacy",null,(0,o.wap)("list",{name:(0,o.CUSTOM_STRING)(e),value:(0,o.CUSTOM_STRING)("contact_blacklist")}))),n=yield(0,a.deprecatedSendIq)(t,u);if(n.success)return n.result;throw new Error("invalid response")}))).apply(this,arguments)}},964907:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getPrivacy=function(){return d.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(997772);function u(e,t){const n=t.maybeChild("error"),r=n&&n.maybeAttrString("code"),i=n&&n.maybeAttrString("text");__LOG__(3,void 0,void 0,!0)`getPrivacy error: ${e} - code ${r} text ${i}`,SEND_LOGS("getPrivacy")}const c=new s.WapParser("privacyParser",(e=>{e.assertAttr("type","result");const t={};return e.child("privacy").forEachChildWithTag("category",(e=>{const n=e.attrString("name");switch(n){case"readreceipts":{const n=e.attrEnum("value",l.ALL_NONE_WITH_ERROR);"error"!==n?t.readReceipts=n:u("readreceipts",e);break}case"last":{const n=e.attrEnum("value",l.VISIBILITY_WITH_ERROR);"error"!==n?t.lastSeen=n:u("last",e);break}case"online":{const n=e.attrEnum("value",l.ONLINE_VISIBILITY_WITH_ERROR);"error"!==n?t.online=n:u("online",e);break}case"profile":{const n=e.attrEnum("value",l.VISIBILITY_WITH_ERROR);"error"!==n?t.profilePicture=n:u("profile",e);break}case"status":{const n=e.attrEnum("value",l.VISIBILITY_WITH_ERROR);"error"!==n?t.about=n:u("status",e);break}case"groupadd":{const n=e.attrEnum("value",l.VISIBILITY_WITH_ERROR);"error"!==n?t.groupAdd=n:u("groupadd",e);break}default:u(`${n} is unknown type`,e)}})),t}));function d(){return(d=(0,i.default)((function*(){const e=(0,o.wap)("iq",{xmlns:"privacy",to:o.S_WHATSAPP_NET,type:"get",id:(0,o.generateId)()},(0,o.wap)("privacy",null)),t=yield(0,a.deprecatedSendIq)(e,c);if(t.success)return t.result;throw new Error("invalid response")}))).apply(this,arguments)}},67081:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.TokenType=void 0,t.setPrivacyTokens=function(){return p.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(984330),u=n(355813);const c=new s.WapParser("setPrivacyTokensParser",(e=>({stanzaId:e.attrString("id")}))),d=n(76672)({TrustedContact:"trusted_contact"});function p(){return(p=(0,i.default)((function*(e,t,n){const r=t.map((t=>(0,o.wap)("token",{jid:(0,u.USER_JID)(e),t:(0,o.CUSTOM_STRING)(String(n)),type:(0,o.CUSTOM_STRING)(t)}))),i=yield(0,a.deprecatedSendIq)((0,o.wap)("iq",{to:o.S_WHATSAPP_NET,type:"set",xmlns:"privacy",id:(0,o.generateId)()},(0,o.wap)("tokens",null,r)),c);if(!i.success)throw new l.ServerStatusCodeError(i.errorCode,i.errorText)}))).apply(this,arguments)}t.TokenType=d},273500:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.clearDirtyBits=function(){return l.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102);const s=new(n(769707).WapParser)("cleanDirtyReplyParser",(e=>(e.assertAttr("type","result"),{})));function l(){return(l=(0,i.default)((function*(e){if(0===e.length)return;const t=e.map((e=>(0,o.wap)("clean",{type:(0,o.CUSTOM_STRING)(e.type),timestamp:(0,o.INT)(e.timestamp)}))),n=(0,o.wap)("iq",{to:o.S_WHATSAPP_NET,type:"set",xmlns:"urn:xmpp:whatsapp:dirty",id:(0,o.generateId)()},t);try{yield(0,a.deprecatedSendIq)(n,s),__LOG__(2)`clearDirtyBits: success for type: ${e.map((e=>e.type)).join(",")}`}catch(e){__LOG__(3)`clearDirtyBits: failed with error`}}))).apply(this,arguments)}},515309:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getAbout=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(795139),o=n(345176),s=n(692269),l=n(328606),u=r(n(124928));function c(){return(c=(0,i.default)((function*(e){const t=new a.GraphQlPerfTracker("status");let n,r;t.start();let i=200,s=200,l=null;var u,c,p;!e.isLid()&&t.toUseGraphQL()?(l="mexd",n=yield(0,o.mexGetAbout)(e),r=n.error,null!=r&&(!0===n.isIQError?(i=r.errorCode,s=-1):(i=200,s=r.errorCode)),401===(null===(u=n.error)||void 0===u?void 0:u.errorCode)&&(n={id:e,status:null})):(l="usync",n=yield d(e),r=null==n.status&&null==n.error?{errorCode:401}:n.error,i=200,s=null!==(c=null===(p=r)||void 0===p?void 0:p.errorCode)&&void 0!==c?c:200);return t.stop(),t.logEvent({envelopeResponseStatus:i,payloadResponseStatus:s}),__LOG__(2)`getAbout:${l}:${e.toString()}`,n}))).apply(this,arguments)}function d(){return p.apply(this,arguments)}function p(){return(p=(0,i.default)((function*(e){if(!u.default.isWid(e)||!e.isUser())return __LOG__(3)`getAbout: this method should only take user wid, instead it received: ${e}`,Promise.resolve({id:e});const t=(new s.USyncQuery).withContext("interactive").withMode("query").withStatusProtocol().withUser((new l.USyncUser).withId(e)),n=yield t.execute();if(n.error.all||n.error.status){const t=n.error.all||n.error.status;return __LOG__(3)`getAbout: failed ${t.errorCode} : ${t.errorText}`,{id:e,error:t}}const r=n.list;return r.length?{id:e,status:r[0].status}:Promise.reject(new Error("no status data returned for user"))}))).apply(this,arguments)}},180019:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getAllContactsFromChatCollectionIntoChunks=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500;const t=[],n=[],r=new Set;let i=new Set;for(const a of o.ChatCollection.toArray())i.size===e&&(t.push(i),i=new Set),a.isBroadcast||(a.isGroup?n.push(a.id):r.has(a.id)||(i.add(a.id),r.add(a.id)));for(const l of n){var a,s;const n=o.ChatCollection.get(l)||{},u=null!==(a=null===(s=n.groupMetadata)||void 0===s?void 0:s.participants.toArray())&&void 0!==a?a:[];for(const n of u)i.size===e&&(t.push(i),i=new Set),r.has(n.id)||(i.add(n.id),r.add(n.id))}0!==i.size&&t.push(i);return __LOG__(2,void 0,void 0,void 0,["contact-sync"])`get ${t.length} chunks of contacts from chat collection, chunk size: ${e}`,t},t.getAndUpdateNonAddressBookContacts=function(){return m.apply(this,arguments)},t.getNonAddressBookContactsAndMarkAllContactsDirty=function(){return g.apply(this,arguments)};var i=r(n(348926)),a=n(469475),o=n(965012),s=n(714443),l=n(76469),u=n(605316),c=r(n(124928)),d=n(669050);function p(){return _.apply(this,arguments)}function _(){return(_=(0,i.default)((function*(){const e=new Set;return yield(0,l.getParticipantTable)().forEach((t=>{t.participants.forEach((t=>{c.default.isLid(t)?e.add((0,s.toLidUserJid)((0,d.createWid)(t).user)):e.add((0,s.toPhoneUserJid)((0,d.createWid)(t).user))}))})),yield(0,l.getChatTable)().forEach((t=>{c.default.isUser(t.id)&&(c.default.isLid(t.id)?e.add((0,s.toLidUserJid)((0,d.createWid)(t.id).user)):e.add((0,s.toPhoneUserJid)((0,d.createWid)(t.id).user)))})),__LOG__(2,void 0,void 0,void 0,["contact-sync"])`found ${e.size} contacts from chat and group participant tables`,Array.from(e)}))).apply(this,arguments)}function f(){return h.apply(this,arguments)}function h(){return(h=(0,i.default)((function*(e){const t=yield e.anyOf(["isAddressBookContact"],[1,0]),n=new Set(t.map((e=>e.id)));return __LOG__(2,void 0,void 0,void 0,["contact-sync"])`found ${n.size} contacts with set isAddressBookContact value from contact table`,n}))).apply(this,arguments)}function g(){return(g=(0,i.default)((function*(){const e=yield p();return(0,u.getStorage)().lock(["contact"],function(){var t=(0,i.default)((function*(t){let[n]=t;const r=yield f(n),i=Array.from(e).map((e=>r.has(e)?{id:e,isContactSyncCompleted:0}:{id:e,isAddressBookContact:0,isContactSyncCompleted:0,contactHash:(0,a.getContactHash)(e)}));return __LOG__(2,void 0,void 0,void 0,["contact-sync"])`mark ${i.length} contacts dirty during the regular sync`,n.bulkCreateOrMerge(i)}));return function(){return t.apply(this,arguments)}}())}))).apply(this,arguments)}function m(){return(m=(0,i.default)((function*(){const e=yield p();return(0,u.getStorage)().lock(["contact"],function(){var t=(0,i.default)((function*(t){let[n]=t;const r=yield f(n),i=e.filter((e=>!r.has(e))).map((e=>({id:e,isAddressBookContact:0,isContactSyncCompleted:0,contactHash:(0,a.getContactHash)(e)})));return __LOG__(2,void 0,void 0,void 0,["contact-sync"])`get ${i.length} non-address book contacts, mark dirty, and update the contact table during the inital sync`,n.bulkCreateOrMerge(i)}));return function(){return t.apply(this,arguments)}}())}))).apply(this,arguments)}},803737:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.queryExist=function(){return p.apply(this,arguments)};var i=r(n(348926)),a=n(493928),o=n(450491),s=n(984330),l=n(692269),u=n(328606),c=n(669050),d=n(71870);function p(){return(p=(0,i.default)((function*(e){if("lid"===e.type&&!e.wid.isLid())throw new Error("queryExist is provided with invalid lid");const t=new u.USyncUser,n=new l.USyncQuery;if("phone"===e.type?(n.withContactProtocol(),t.withPhone(e.phone)):t.withId(e.wid),(0,d.lidUsyncEnabled)()&&(n.withLidProtocol(),"phone"===e.type)){const n=(0,c.createUserWid)(e.phone.split("+")[1]),r=yield(0,o.getCurrentLid)(n.user);r&&t.withLid(r)}n.withUser(t),n.withBusinessProtocol(),(0,a.isDisappearingModeEnabled)()&&n.withDisappearingModeProtocol();const r=yield n.execute(),i=r.error.all||r.error.contact;if(i)throw new s.ServerStatusCodeError(i.errorCode,i.errorText);const{list:p}=r;if(1!==p.length)return null;const{id:_,contact:f,business:h,disappearing_mode:g,lid:m}=p[0];if("phone"===e.type&&"in"!==(null==f?void 0:f.type))return null;const y={wid:_,biz:null!=h,bizInfo:h};return g&&(y.disappearingMode={duration:g.duration,settingTimestamp:g.t}),null!=m&&(yield(0,o.createOrReplaceLidPnMappings)([{pn:_.user,lid:(0,c.createUserWid)(m).user}])),y}))).apply(this,arguments)}},921733:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return p.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(984330),u=n(355813),c=r(n(124928));const d=new s.WapParser("photoResponseParser",(e=>{if(e.assertAttr("type","result"),e.hasChild("picture")){return{id:e.child("picture").attrInt("id")}}return{id:null}}));function p(){return(p=(0,i.default)((function*(e,t){const n=yield(0,a.deprecatedSendIq)((0,o.wap)("iq",{to:o.S_WHATSAPP_NET,target:c.default.isGroup(e)?(0,u.CHAT_JID)(e):o.DROP_ATTR,type:"set",xmlns:"w:profile:picture",id:(0,o.generateId)()},t?(0,o.wap)("picture",{type:"image"},t):null),d);return n.success?{id:n.result.id}:Promise.reject(new l.ServerStatusCodeError(n.errorCode,n.errorText))}))).apply(this,arguments)}},92010:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,r.deprecatedCastStanza)((0,i.wap)("presence",{name:(0,i.MAYBE_CUSTOM_STRING)(e)}))};var r=n(911794),i=n(738102)},978538:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.syncContactListInChunksJob=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(0,a.NonPersistJob)("syncContactListInChunks",(e=>(0,i.syncContactListInChunks)(e)),{priority:r.JOB_PRIORITY.SKIP}).waitUntilCompleted({contactIds:e,shouldDelayBetweenChunks:t})},t.syncContactListJob=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(0,a.NonPersistJob)("syncContactList",(e=>(0,i.syncContactList)(e)),{priority:r.JOB_PRIORITY.SKIP}).waitUntilCompleted({contactIds:e,shouldSyncDevice:t})};var r=n(431012),i=n(588251),a=n(797703)},416911:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getContactSyncRefreshSeconds=function(){var e;const t=null!==(e=(0,a.default)(l.default,"localStorage").getItem(c.KEYS.CONTACT_SYNC_REFRESH))&&void 0!==e?e:86400;return parseInt(t,10)},t.runSyncDirtyContactsJob=function(){return m.apply(this,arguments)},t.syncNewContact=function(e){f.push(e),_?_.debounce(1e3):(_=new o.ShiftTimer((()=>{if(!(0,d.isRegistered)())return;const e=f;f=[],_=null,__LOG__(2,void 0,void 0,void 0,["contact-sync"])`start new contact sync for ${e.length} contacts`,(0,s.syncContactListInChunks)({contactIds:e,shouldDelayBetweenChunks:!0}).catch((e=>{__LOG__(4,!0,new Error,!0,["non-sad","contact-sync"])`syncNewContact: contact sync failed, error: ${e}`,SEND_LOGS("syncNewContact: contact sync failed")}))})),_.onOrBefore(2e4))};var i=r(n(348926)),a=r(n(132375)),o=n(201063),s=n(588251),l=r(n(174285)),u=n(76469),c=n(94872),d=n(673168),p=n(669050);let _=null,f=[];function h(){return g.apply(this,arguments)}function g(){return(g=(0,i.default)((function*(){const e=(yield(0,u.getContactTable)().equals(["isContactSyncCompleted"],0)).map((e=>(0,p.createWid)(e.id)));return __LOG__(2,void 0,void 0,void 0,["contact-sync"])`sync dirty contacts, found ${e.length} contacts to sync`,(0,s.syncContactListInChunks)({contactIds:e,shouldDelayBetweenChunks:!0})}))).apply(this,arguments)}function m(){return(m=(0,i.default)((function*(){(yield(0,d.getShouldCheckContactSyncStatus)())&&setTimeout((function(){h()}),6e4),yield(0,d.setShouldCheckContactSyncStatus)()}))).apply(this,arguments)}},854718:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.AdvToSystemBridgeImpl=void 0,t.runAdvDeviceInfoCheck=I,t.scheduleAdvDeviceInfoCheck=P;var i=r(n(348926)),a=n(616310),o=n(990445),s=n(287461),l=n(866729),u=n(277330),c=n(948425),d=n(359987),p=n(715118),_=n(681349),f=n(332108),h=n(459857),g=r(n(571834)),m=n(669050);const y=25*o.HOUR_SECONDS;class E{constructor(e){this.advToSystemBridge=e}run(e){var t=this;return(0,i.default)((function*(){const n=t.advToSystemBridge,r=yield n.getUsersForExpiration(e),{usersExpired:i,usersCloseToExpiration:a}=r;n.removeCompanions(i),n.sendADVStoredTimestampExpiredEvents(i,e);const o=Array.from(i.keys()).concat(Array.from(a.keys())).filter((e=>!n.canRemoveUserDevices(e)));return n.sendOrQueueDeviceUsyncQuery(o).catch((()=>{})),n.recordLocalTimestamp()}))()}}class S{getNumDaysKeyIndexListExpiration(){return(0,s.getABPropConfigValue)("num_days_key_index_list_expiration")}getNumDaysBeforeDeviceExpiryCheck(){return(0,s.getABPropConfigValue)("num_days_before_device_expiry_check")}getUsersForExpiration(e){var t=this;return(0,i.default)((function*(){const n=yield(0,l.getAllDeviceLists)(),r=yield(0,_.getLastADVDeviceInfoCheckTime)(),i=t.getNumDaysKeyIndexListExpiration()*o.DAY_SECONDS,s=new Map,u=new Map;return n.forEach((n=>{n.deleted||function(e){return 1===e.devices.length&&e.devices[0].id===a.DEFAULT_DEVICE_ID}(n)||(!function(e,t,n,r){if(e-n.timestamp>=t)return!0;if(null!=n.expectedTsUpdateTs)return e-n.expectedTsUpdateTs>=y&&n.expectedTsLastDeviceJobTs!==r;return!1}(e,i,n,r)?function(e,t,n){if(e-n.timestamp>=t)return!0;if(null!=n.expectedTs)return n.expectedTs>n.timestamp;return!1}(e,i-t.getNumDaysBeforeDeviceExpiryCheck()*o.DAY_SECONDS,n)&&u.set((0,m.createUserWid)(n.id),n):s.set((0,m.createUserWid)(n.id),n))})),{usersExpired:s,usersCloseToExpiration:u}}))()}sendADVStoredTimestampExpiredEvents(e,t){e.forEach((e=>{const n=t-(e.timestamp+this.getNumDaysKeyIndexListExpiration()*o.DAY_SECONDS);if(n<0)return;const r=Math.round(n/o.HOUR_SECONDS);new g.default.AdvStoredTimestampExpired({advExpireTimeInHours:r}).commit()}))}sendOrQueueDeviceUsyncQuery(e){return(0,i.default)((function*(){return yield(0,u.addUserToPendingDeviceSync)(e.map((e=>e.toString()))),(0,u.doPendingDeviceSync)()}))()}canRemoveUserDevices(){return!1}removeCompanions(e){return Array.from(e.entries()).some((e=>{let[t,n]=e;t.user,(0,h.getMeUser)().user}))?(__LOG__(2)`Logging out due to own expired device`,(0,d.frontendFireAndForget)("socketLogout",{forcePost:!1,reason:f.LogoutReason.InvalidAdvStatus}),Promise.resolve()):Promise.all(Array.from(e.entries()).map((e=>{let[t,n]=e;return(0,p.clearDeviceRecord)(t,n.devices)})))}recordLocalTimestamp(){return Promise.resolve()}}t.AdvToSystemBridgeImpl=S;const T=o.DAY_SECONDS,v="advDeviceInfoCheck";let A,C;function P(){return O.apply(this,arguments)}function O(){return(O=(0,i.default)((function*(){null!=A&&(clearTimeout(A),A=null);const e=(0,o.unixTimeWithoutClockSkewCorrection)(),t=yield(0,_.getLastADVDeviceInfoCheckTime)();let n=0,r=()=>Promise.resolve();null!=t&&(n=Math.max(T-(e-t),0),r=()=>(0,s.getABPropConfigValue)("adv_v2_m4_m5")?I():Promise.resolve()),A=setTimeout((0,i.default)((function*(){try{yield r()}catch(e){__LOG__(4,void 0,new Error,void 0,["adv_device_info_check"])`error running the adv device check job`}A=null;const e=(0,o.unixTimeWithoutClockSkewCorrection)();(0,_.setLastADVDeviceInfoCheckTime)(e),(0,c.updateTaskScheduledTime)(v,(0,o.castToUnixTime)(e)),P()})),1e3*n)}))).apply(this,arguments)}function I(){return null==C&&(C=new E(new S)),C.run((0,o.unixTimeWithoutClockSkewCorrection)())}},510607:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.syncDeviceListJob=function(e,t,n){return(0,i.NonPersistJob)("syncDeviceList",(e=>(0,a.syncDeviceList)(e))).waitUntilCompleted({wids:e,context:t,phash:n})},t.syncMyDeviceListJob=function(){return(0,i.NonPersistJob)("syncMyDeviceList",(()=>(0,a.syncMyDeviceList)()),{priority:r.JOB_PRIORITY.SKIP}).waitUntilCompleted()};var r=n(431012),i=n(797703),a=n(914343)},77767:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.unpairDevice=function(){return d.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(355813),u=n(459857);const c=new s.WapParser("unpairResponse",(e=>{e.assertTag("iq"),e.assertFromServer();let t=200;return"error"===e.attrString("type")&&(t=e.child("error").attrInt("code")),{status:t}}));function d(){return(d=(0,i.default)((function*(e){const t=(0,o.wap)("iq",{to:o.S_WHATSAPP_NET,type:"set",id:(0,o.generateId)(),xmlns:"md"},(0,o.wap)("remove-companion-device",{jid:(0,l.DEVICE_JID)((0,u.assertGetMe)()),reason:(0,o.CUSTOM_STRING)(e)})),n=yield(0,a.deprecatedSendIq)(t,c);return n.success?{status:n.result.status}:{status:n.errorCode}}))).apply(this,arguments)}},580890:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.reportSyncdStatsJob=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(431012),o=n(287461),s=n(797703),l=n(830389),u=r(n(571834));function c(){return(c=(0,i.default)((function*(){if(yield(0,o.getABPropConfigValue)("md_app_state_report_md_sync_mutation_stats"))return new s.NonPersistJob("reportSyncdStats",(0,i.default)((function*(){const e=yield(0,l.generateActionStatCounts)();for(const t of e.values())new u.default.MdAppStateSyncMutationStats({syncdAction:t.action,applied:(0,l.convertToBucket)(t.applied),invalid:(0,l.convertToBucket)(t.invalid),orphan:(0,l.convertToBucket)(t.orphan),unsupported:(0,l.convertToBucket)(t.unsupported),failed:(0,l.convertToBucket)(t.failed)}).commit()})),{priority:a.JOB_PRIORITY.LOW}).waitUntilCompleted()}))).apply(this,arguments)}},30937:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.requestAllSyncdMissingKeysJob=function(){return new l.NonPersistJob("requestAllSyncdMissingKeys",(0,i.default)((function*(){yield(0,o.requestAllMissingKeys)(),setTimeout(s.setMissingKeyTimeoutInTransaction,2e4)})),{priority:a.JOB_PRIORITY.LOW}).waitUntilCompleted()};var i=r(n(348926)),a=n(431012),o=n(558608),s=n(525178),l=n(797703)},632084:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.syncdSyncAllCollectionsJob=function(){return new u.NonPersistJob("syncdSyncAllCollections",(0,i.default)((function*(){__LOG__(2)`syncd: periodic sync for all collection`,yield(0,o.markCollectionsForSync)([s.CollectionName.CriticalBlock,s.CollectionName.CriticalUnblockLow,s.CollectionName.Regular,s.CollectionName.RegularLow,s.CollectionName.RegularHigh]),yield(0,c.setLastPeriodicAppStateSyncTs)((0,l.unixTime)())})),{priority:a.JOB_PRIORITY.LOW}).waitUntilCompleted()};var i=r(n(348926)),a=n(431012),o=n(279385),s=n(155172),l=n(990445),u=n(797703),c=n(673168)},303754:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediaType=t.DecryptFailType=t.CiphertextType=void 0;const r=n(76672)({Skmsg:"skmsg",Pkmsg:"pkmsg",Msg:"msg"});t.CiphertextType=r;const i=n(76672)({Photo:"photo",Video:"video",Audio:"audio",Ptt:"ptt",Location:"location",Contact:"contact",Document:"document",Url:"url",Call:"call",Gif:"gif",Future:"future",ContactArray:"contact_array",LiveLocation:"live_location",ProfilePic:"profile_pic",Sticker:"sticker",Hsm:"hsm",ProductImage:"product_image",Template:"template",MdAppState:"md_app_state",MdHistorySync:"md_history_sync",List:"list",ListResponse:"list_response",Button:"button",ButtonResponse:"button_response",Order:"order",Product:"product",NativeFlowResponse:"native_flow_response"});t.MediaType=i;const a=n(76672)({Hide:"hide",Show:"show"});t.DecryptFailType=a},973776:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.CIPHERTEXT_VERSION=void 0,t.encodeMaybeDecryptFail=function(e){switch(e){case a.DecryptFailType.Show:return i.DROP_ATTR;case a.DecryptFailType.Hide:return(0,i.CUSTOM_STRING)("hide")}},t.encodeMaybeNativeFlowName=t.encodeMaybeMediaType=void 0,t.getMetricE2eCiphertextType=function(e){switch(e){case a.CiphertextType.Skmsg:return o.default.E2E_CIPHERTEXT_TYPE.SENDER_KEY_MESSAGE;case a.CiphertextType.Pkmsg:return o.default.E2E_CIPHERTEXT_TYPE.PREKEY_MESSAGE;case a.CiphertextType.Msg:return o.default.E2E_CIPHERTEXT_TYPE.MESSAGE}},t.getMetricE2eDestination=function(e){if(e.isUser())return o.default.E2E_DESTINATION.INDIVIDUAL;if(e.isGroup())return o.default.E2E_DESTINATION.GROUP;if(e.isStatusV3())return o.default.E2E_DESTINATION.STATUS;if(e.isBroadcast())return o.default.E2E_DESTINATION.LIST;throw new Error},t.mediaTypeFromProtobuf=function e(t){if(t.deviceSentMessage){const{message:n}=t.deviceSentMessage;return n?e(n):null}if(t.ephemeralMessage){const{message:n}=t.ephemeralMessage;return n?e(n):null}if(t.viewOnceMessage){const{message:n}=t.viewOnceMessage;return n?e(n):null}if(t.documentWithCaptionMessage){const{message:n}=t.documentWithCaptionMessage;return n?e(n):null}if(t.imageMessage)return a.MediaType.Photo;if(t.stickerMessage)return a.MediaType.Sticker;if(t.locationMessage)return a.MediaType.LiveLocation;if(t.contactMessage)return a.MediaType.Contact;if(t.contactsArrayMessage)return a.MediaType.ContactArray;if(t.documentMessage)return a.MediaType.Document;if(t.audioMessage)return t.audioMessage.ptt?a.MediaType.Ptt:a.MediaType.Audio;if(t.videoMessage)return t.videoMessage.gifPlayback?a.MediaType.Gif:a.MediaType.Video;if(t.buttonsMessage)return a.MediaType.Button;if(t.buttonsResponseMessage)return a.MediaType.ButtonResponse;if(t.listMessage)return a.MediaType.List;if(t.listResponseMessage)return a.MediaType.ListResponse;if(t.orderMessage)return a.MediaType.Order;if(t.productMessage)return a.MediaType.Product;if(t.groupInviteMessage)return a.MediaType.Url;if(t.interactiveResponseMessage)return a.MediaType.NativeFlowResponse;return null},t.metricsMediaType=function(e){switch(e){case a.MediaType.Photo:return o.default.MEDIA_TYPE.PHOTO;case a.MediaType.Video:return o.default.MEDIA_TYPE.VIDEO;case a.MediaType.Audio:return o.default.MEDIA_TYPE.AUDIO;case a.MediaType.Ptt:return o.default.MEDIA_TYPE.PTT;case a.MediaType.Location:return o.default.MEDIA_TYPE.LOCATION;case a.MediaType.Contact:return o.default.MEDIA_TYPE.CONTACT;case a.MediaType.Document:return o.default.MEDIA_TYPE.DOCUMENT;case a.MediaType.Url:return o.default.MEDIA_TYPE.URL;case a.MediaType.Call:return o.default.MEDIA_TYPE.CALL;case a.MediaType.Gif:return o.default.MEDIA_TYPE.GIF;case a.MediaType.Future:return o.default.MEDIA_TYPE.FUTURE;case a.MediaType.ContactArray:return o.default.MEDIA_TYPE.CONTACT_ARRAY;case a.MediaType.LiveLocation:return o.default.MEDIA_TYPE.LIVE_LOCATION;case a.MediaType.ProfilePic:return o.default.MEDIA_TYPE.PROFILE_PIC;case a.MediaType.Sticker:return o.default.MEDIA_TYPE.STICKER;case a.MediaType.Hsm:return o.default.MEDIA_TYPE.HSM;case a.MediaType.ProductImage:return o.default.MEDIA_TYPE.PRODUCT_IMAGE;case a.MediaType.Template:return o.default.MEDIA_TYPE.TEMPLATE;case a.MediaType.MdAppState:return o.default.MEDIA_TYPE.MD_APP_STATE;case a.MediaType.MdHistorySync:return o.default.MEDIA_TYPE.MD_HISTORY_SYNC;case a.MediaType.List:return o.default.MEDIA_TYPE.LIST;case a.MediaType.ListResponse:return o.default.MEDIA_TYPE.LIST_REPLY;case a.MediaType.Button:return o.default.MEDIA_TYPE.BUTTON_MESSAGE;case a.MediaType.ButtonResponse:return o.default.MEDIA_TYPE.BUTTON_RESPONSE_MESSAGE;case a.MediaType.Order:return o.default.MEDIA_TYPE.ORDER;case a.MediaType.Product:return o.default.MEDIA_TYPE.PRODUCT_IMAGE;case a.MediaType.NativeFlowResponse:return o.default.MEDIA_TYPE.INTERACTIVE_RESPONSE_NFM}},t.nativeFlowNameTypeFromProtobuf=function(e){var t;return e.interactiveResponseMessage?null===(t=e.interactiveResponseMessage.nativeFlowResponseMessage)||void 0===t?void 0:t.name:null};var i=n(738102),a=n(303754),o=r(n(571834));function s(e){return t=>null==t?i.DROP_ATTR:e(t)}t.CIPHERTEXT_VERSION=2;const l=s((function(e){const t=(()=>{switch(e){case a.MediaType.Photo:return"image";case a.MediaType.Video:return"video";case a.MediaType.Audio:return"audio";case a.MediaType.Ptt:return"ptt";case a.MediaType.Contact:return"vcard";case a.MediaType.Document:return"document";case a.MediaType.Gif:return"gif";case a.MediaType.ContactArray:return"contact_array";case a.MediaType.LiveLocation:return"livelocation";case a.MediaType.Sticker:return"sticker";case a.MediaType.List:return"list";case a.MediaType.ListResponse:return"list_response";case a.MediaType.ButtonResponse:return"buttons_response";case a.MediaType.Order:return"order";case a.MediaType.Product:return"product";case a.MediaType.Url:return"url";case a.MediaType.NativeFlowResponse:return"native_flow_response";default:return null}})();if(t)return(0,i.CUSTOM_STRING)(t);throw new Error("Unsupported type")}));t.encodeMaybeMediaType=l;const u=s((e=>(0,i.CUSTOM_STRING)(e)));t.encodeMaybeNativeFlowName=u},412985:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t._online=void 0,t.handleMessage=function(){return f.apply(this,arguments)},t.waitForOfflineMsgThread=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(e)return _.chatQueue.wait(e);return _.allChatQueue.wait()},t.waitForOnlineMsgThread=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(e)return p.chatQueue.wait(e);return p.allChatQueue.wait()};var i=r(n(348926)),a=n(643930),o=n(316860),s=n(975175),l=r(n(797137)),u=r(n(254028)),c=n(359484);const d=2e4,p={allChatQueue:new o.PromiseQueue,chatQueue:new o.PromiseQueueMap};t._online=p;const _={allChatQueue:new o.PromiseQueue,chatQueue:new o.PromiseQueueMap};function f(){return(f=(0,i.default)((function*(e,t,n){return t&&!c.OfflineMessageHandler.isResumeFromRestartComplete()?_.allChatQueue.enqueue((()=>_.chatQueue.enqueue(e,(0,i.default)((function*(){return yield(0,u.default)(),(0,s.promiseTimeout)(n(),d).catch((e=>{if(!(e instanceof a.TimeoutError))throw e;__LOG__(2,void 0,void 0,void 0,["messaging"])`Offline chat queue MAX_MESSAGE_DELAY exceeded`}))}))))):(yield(0,l.default)(),p.allChatQueue.enqueue((()=>p.chatQueue.enqueue(e,(()=>(0,s.promiseTimeout)(n(),d).catch((e=>{if(!(e instanceof a.TimeoutError))throw e;__LOG__(2,void 0,void 0,void 0,["messaging"])`Online chat queue MAX_MESSAGE_DELAY exceeded`})))))))}))).apply(this,arguments)}},734173:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MEDIA_REUPLOAD_REQUEST_LIMIT=void 0,t.cleanRequestAfterTimeout=function(e){new o.ShiftTimer((()=>{f.delete(e)})).onOrAfter(3e3)},t.convertRequestTypeEnumForLogging=function(e){switch(e){case c.Message$PeerDataOperationRequestType.UPLOAD_STICKER:return _.default.PEER_DATA_REQUEST_TYPE.UPLOAD_STICKER;case c.Message$PeerDataOperationRequestType.SEND_RECENT_STICKER_BOOTSTRAP:return _.default.PEER_DATA_REQUEST_TYPE.SEND_RECENT_STICKER_BOOTSTRAP;case c.Message$PeerDataOperationRequestType.GENERATE_LINK_PREVIEW:return _.default.PEER_DATA_REQUEST_TYPE.GENERAL_LINK_PREVIEW}},t.inFlightStickerRequests=void 0,t.initializeMediaUploadResultFromStroage=function(e){h.clear(),e.forEach((e=>{e.operationType===d.DataRequestUploadOperationType.MEIDA_UPLOAD&&h.set(e.id,e)}))},t.insertMediaUploadResult=function(e,t){const n=[];e.forEach(((e,r)=>{var i;const a=y(r,c.Message$PeerDataOperationRequestType.UPLOAD_STICKER,d.DataRequestUploadOperationType.MEIDA_UPLOAD),o=h.get(a),s=!E(t,null==o?void 0:o.lastMediaUploadTimeStampSec),u=e===l.UploadMediaResultKind.SUCCESS,p=(s?0:null!==(i=null==o?void 0:o.mediaUploadFailureCount)&&void 0!==i?i:0)+(u?0:1),_={id:a,fileKey:r,requestType:c.Message$PeerDataOperationRequestType.UPLOAD_STICKER,operationType:d.DataRequestUploadOperationType.MEIDA_UPLOAD,lastMediaUploadTimeStampSec:t,lastMediaUploadSuccess:u,mediaUploadFailureCount:p};h.set(a,_),n.push(_)}));(0,d.getTable)().bulkCreateOrReplace(n)},t.insertResponseError=function(){return m.apply(this,arguments)},t.mediaUploadResultMap=t.mediaReuploadRequestCountMap=void 0,t.retryNonMessageDataRequestJob=function(){return g.clear(),new u.NonPersistJob("requestAllSyncdMissingKeys",(0,i.default)((function*(){const e=(0,s.unixTime)(),t=(0,d.getTable)(),n=yield t.all();n.filter((t=>t.operationType===d.DataRequestUploadOperationType.MEIDA_UPLOAD&&(t.requestType===c.Message$PeerDataOperationRequestType.UPLOAD_STICKER&&(!(null!=t.lastRequestTimeStampSec&&e-t.lastRequestTimeStampSec>48*s.HOUR_SECONDS)&&!(null!=t.requestRetryCount&&t.requestRetryCount>=3))))),(0,p.sendPeerDataOperationRequest)(c.Message$PeerDataOperationRequestType.UPLOAD_STICKER,n.map((e=>e.fileKey)))})),{priority:a.JOB_PRIORITY.LOW}).waitUntilCompleted()},t.shouldSkipMediaUploadWithCancellation=function(e,t,n){const r=y(e,t,d.DataRequestUploadOperationType.MEIDA_UPLOAD),i=h.get(r),a=E(n,null==i?void 0:i.lastRequestTimeStampSec);return null!=i&&!1===i.lastMediaUploadSuccess&&a&&null!=i.mediaUploadFailureCount&&i.mediaUploadFailureCount>=15},t.shouldSkipMediaUploadWithSuccess=function(e,t,n){const r=y(e,t,d.DataRequestUploadOperationType.MEIDA_UPLOAD),i=h.get(r);return null!=i&&!0===i.lastMediaUploadSuccess&&null!=i.lastMediaUploadTimeStampSec&&n-i.lastMediaUploadTimeStampSec<=s.DAY_SECONDS};var i=r(n(348926)),a=n(431012),o=n(201063),s=n(990445),l=n(709089),u=n(797703),c=n(533494),d=n(320493),p=n(105461),_=r(n(571834));t.MEDIA_REUPLOAD_REQUEST_LIMIT=15;const f=new Set;t.inFlightStickerRequests=f;const h=new Map;t.mediaUploadResultMap=h;const g=new Map;function m(){return(m=(0,i.default)((function*(e,t){const n=(0,d.getTable)(),r=Array.from(e.keys()),a=(0,s.unixTime)(),o=[];yield Promise.all(r.map(function(){var r=(0,i.default)((function*(r){var i;const s=y(r,t,d.DataRequestUploadOperationType.SEND_REQUEST),l=yield n.get(s);o.push({id:s,fileKey:r,requestType:t,operationType:d.DataRequestUploadOperationType.SEND_REQUEST,lastRequestTimeStampSec:a,requestRetryCount:(null!==(i=null==l?void 0:l.requestRetryCount)&&void 0!==i?i:0)+1,responseError:e.get(r)})}));return function(){return r.apply(this,arguments)}}())).then((()=>{n.bulkCreateOrReplace(o)}))}))).apply(this,arguments)}function y(e,t,n){return e+"_"+String(t)+"_"+String(n)}function E(e,t){const n=new Date(1e3*e).toDateString();return n===(null!=t?new Date(1e3*t).toDateString():n)}t.mediaReuploadRequestCountMap=g},658046:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getMetricHistorySyncPayloadType=function(e){switch(e){case 0:return i.default.MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE.INITIAL;case 1:return i.default.MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE.STATUS_V3;case 2:return i.default.MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE.FULL_HISTORY;case 3:return i.default.MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE.RECENT_HISTORY;default:return i.default.MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE.PUSHNAME}};var i=r(n(571834))},519106:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.parseWebMsgInfoReaction=function(e,t){const n=[];try{if(null==e||null==e.reactions)return n;if(null==t||null==t.reactions)return n;t.reactions.forEach((e=>{const{key:r,senderTimestampMs:l,text:u,unread:c}=e,d=(0,i.convertToTextWithoutSpecialEmojis)(null!=u?u:""),p=!!r.fromMe,_=(0,i.decodeJid)(r.remoteJid);let f;r.fromMe?_.isUser()||(f=(0,o.getMeUser)()):f=(0,i.decodeJid)(r.participant);const h=new a.default({id:r.id,fromMe:p,remote:_,participant:f}),g=(0,o.getMeUser)(),m=!0===p?g:f||_;null!=m&&m instanceof s.default?null==d?__LOG__(4,void 0,new Error)`parseWebMsgInfoReaction:convertToTextWithoutSpecialEmojis reaction text is null.`:n.push({id:h,reactionTimestamp:l,reactionText:d,reactionParentKey:t.id,sender:m,unread:Boolean(c)}):__LOG__(4,void 0,new Error)`parseWebMsgInfoReaction: reaction sender should be a wid.`}))}catch(e){__LOG__(4,void 0,new Error)`[history sync] parseWebMsgInfoReaction failed with error ${null==e?void 0:e.name} and stack ${null==e?void 0:e.stack}`}return n};var i=n(523930),a=r(n(565754)),o=n(459857),s=r(n(124928))},635606:(e,t,n)=>{"use strict";var r=n(595318);t.Z=function(){return C.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(616310),s=n(738102),l=n(678002),u=n(303754),c=n(973776),d=n(707065),p=n(355813),_=r(n(846870)),f=n(917504),h=n(608182),g=v(n(138706)),m=n(76256),y=v(n(549227)),E=r(n(124928)),S=n(669050);function T(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(T=function(e){return e?n:t})(e)}function v(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=T(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}const{VOIP_LOG_COLOR:A}=_.default;function C(){return(C=(0,i.default)((function*(e,t){const n=e.common,r=(0,S.createWid)(n.peer_jid);if(E.default.isGroupCall(r))return P((0,s.CUSTOM_STRING)(n.peer_jid),r,e);try{return P(yield I(e,r,t),r,e)}catch(e){__LOG__(3)`voip:encryptAndSendSignalingMsg: Failed to encrypt and send msg`}}))).apply(this,arguments)}function P(){return O.apply(this,arguments)}function O(){return(O=(0,i.default)((function*(e,t,n){const r=(0,p.voipXmlToWapNode)(n.payload),i=(0,s.generateId)(),o=(0,s.wap)("call",{to:e,id:i},r);yield(0,m.getSignalProtocolStore)().flushBufferToDiskIfNotMemOnlyMode();const l=yield(0,a.deprecatedSendStanzaAndReturnAck)(o,(0,d.toCoreAckTemplate)({id:String(i),class:"call",from:t,participant:null}));return{payload:(0,p.wapNodeToVoipXml)(l),status:200}}))).apply(this,arguments)}function I(){return M.apply(this,arguments)}function M(){return(M=(0,i.default)((function*(e,t,n){const r=e.payload[2].findIndex((e=>"destination"===e[0])),a=e.payload[2][r];if(a){e.payload[0]!==y.TYPE_STR.OFFER&&(__LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("call offer check"));const n=a[2].map((e=>{const t=e[1].jid;return(0,S.createDeviceWidFromUserAndDevice)(t.user,"c.us",t.device)}));try{yield(0,f.ensureE2ESessions)(n)}catch(e){__LOG__(3)`voip:encryptMsgCallKey: Could not establish E2E session with all deviceWids`}let r=!1,o=!1;return yield Promise.all(a[2].map(function(){var t=(0,i.default)((function*(t,i){if(b(t[2])){const a=L(t[2]),s=n[i];try{const{encNode:n,shouldHaveIdentity:r}=yield D(a,s,w(e.payload[2]));o=o||r,N(t[2],n)}catch(e){__LOG__(3)`voip:encryptMsgCallKey: Signal encryption failed for ${s.toString()}, ${e}`,r=!0}}}));return function(){return t.apply(this,arguments)}}())),r?(__LOG__(3)`voip:encryptMsgCallKey: Removing all enc nodes due to encryption failure`,a[2].forEach((e=>R(e)))):o&&(yield U(e.payload[2])),(0,p.USER_JID)(t)}if(!b(e.payload[2]))return(0,p.DEVICE_JID)(t);try{const e=[t];if(t.isCompanion()){const n=(0,S.createDeviceWidFromUserAndDevice)(t.user,t.server,o.DEFAULT_DEVICE_ID);e.unshift(n)}yield(0,f.ensureE2ESessions)(e)}catch(e){__LOG__(3)`voip:encryptAndSendSignalingMsg: Could not establish E2E session with deviceWid`}const s=L(e.payload[2]);let l,u;try{const n=yield D(s,t,w(e.payload[2]));l=n.encNode,u=n.shouldHaveIdentity}catch(e){if(n!==y.TYPE.OFFER)throw e;l=null,u=!1,__LOG__(3)`voip:encryptAndSendSignalingMsg: Sending offer without enc`}return N(e.payload[2],l),u&&(yield U(e.payload[2])),(0,p.DEVICE_JID)(t)}))).apply(this,arguments)}function b(e){if(null==e)return!1;return e.findIndex((e=>"enc"===e[0]))>=0}function R(e){if(null==e)return;const t=e.findIndex((e=>"enc"===e[0]));e.splice(t,1)}function N(e,t){const n=e.findIndex((e=>"enc"===e[0]));n>=0&&(e[n]=t)}function w(e){var t;const n=e.find((e=>"enc"===e[0])),r=null==n||null===(t=n[1])||void 0===t?void 0:t.count;return null!=r?r:0}function L(e){const t=e.find((e=>"enc"===e[0])),n=null==t?void 0:t[2];return{call:{callKey:null!=n?new Uint8Array(n):null}}}function D(){return k.apply(this,arguments)}function k(){return(k=(0,i.default)((function*(e,t,n){const{type:r,ciphertext:i}=yield g.Cipher.encryptSignalProto(t,(0,h.encodeAndPad)(e));return{encNode:(0,s.wap)("enc",{v:(0,s.CUSTOM_STRING)(c.CIPHERTEXT_VERSION.toString()),type:(0,s.CUSTOM_STRING)(r),count:(0,s.INT)(n)},i),shouldHaveIdentity:r===u.CiphertextType.Pkmsg}}))).apply(this,arguments)}function U(){return G.apply(this,arguments)}function G(){return(G=(0,i.default)((function*(e){const t=yield(0,l.getADVEncodedIdentity)();e.push((0,s.wap)("device-identity",null,t))}))).apply(this,arguments)}},45681:(e,t,n)=>{"use strict";var r=n(595318);t.Z=function(){return s.apply(this,arguments)};var i=r(n(348926)),a=n(525773),o=n(326314);function s(){return(s=(0,i.default)((function*(e){var t;const n=yield o.waSignalStore.getRegistrationInfo();if(!n)throw Error("No registration info found");const{identityKeyPair:r}=n,i=null!==(t=e[1]&&parseInt(e[1].count,10))&&void 0!==t?t:0,s=yield(0,a.prepareKeysForRetry)(i,r);return s&&e[2]&&Array.isArray(e[2])&&e[2].push(s),e}))).apply(this,arguments)}},155602:(e,t,n)=>{"use strict";var r=n(595318);t.Z=function(){return d.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(707065),l=n(355813),u=n(917504),c=n(669050);function d(){return(d=(0,i.default)((function*(e){const t=e.common,n=(0,c.createWid)(t.peer_jid);let r,i;n.isGroupCall()?(r=(0,l.GROUP_CALL_JID)(n),i=Promise.resolve()):(r=(0,l.DEVICE_JID)(n),i=(0,u.ensureE2ESessions)([n])),yield i;const d=(0,l.voipXmlToWapNode)(e.payload),p=(0,o.generateId)(),_=(0,o.wap)("call",{to:r,id:p},d),f=yield(0,a.deprecatedSendStanzaAndReturnAck)(_,(0,s.toCoreAckTemplate)({id:String(p),class:"call",from:n,participant:null}));return{payload:(0,l.wapNodeToVoipXml)(f),status:200}}))).apply(this,arguments)}},109037:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(911794),o=n(738102),s=n(355813),l=n(326314),u=n(549227);function c(){return(c=(0,i.default)((function*(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=yield l.waSignalStore.getRegistrationInfo();if(!r)throw Error("No registration info found");const i=(0,o.wap)("receipt",{to:(0,s.DEVICE_JID)(t.peer_jid),id:(0,o.CUSTOM_STRING)(e),type:(0,o.CUSTOM_STRING)(u.ENC_RETRY_RECEIPT_ATTRS.GROUP_CALL)},(0,o.wap)("enc_rekey",{"call-creator":(0,s.DEVICE_JID)(t.call_creator),"call-id":(0,o.CUSTOM_STRING)(t.call_id),count:(0,o.INT)(n+1)}),(0,o.wap)("registration",null,(0,o.BIG_ENDIAN_CONTENT)(r.registrationId)));(0,a.deprecatedCastStanza)(i)}))).apply(this,arguments)}},471815:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return y.apply(this,arguments)};var i=r(n(348926)),a=n(620430),o=n(924583),s=n(616310),l=r(n(132375)),u=n(678002),c=n(303754),d=n(257845),p=n(533494),_=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=m(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(138706)),f=n(91923),h=n(309512),g=r(n(441143));function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(m=function(e){return e?n:t})(e)}function y(){return(y=(0,i.default)((function*(e,t){var n;const r=t.payload[2]&&t.payload[2].find((e=>"enc"===e[0])),i=e.peer_jid;if(!r||!i)return{result:d.E2EProcessResult.SUCCESS};let a=0;(null===(n=r[1])||void 0===n?void 0:n.count)&&(a=parseInt(r[1].count,10)||0);const o={e2eType:r[1].type,mediaType:null,ciphertext:new Uint8Array(r[2]),retryCount:a,hideFail:!1};try{const e=t.payload[2].find((e=>"device-identity"===e[0]));if(null!=i.device&&i.device!==s.DEFAULT_DEVICE_ID&&o.e2eType===c.CiphertextType.Pkmsg&&!e)return __LOG__(2)`voip:validateAndDecryptEnc: expected device-identity with pkmsg enc`,{result:d.E2EProcessResult.PARSE_ERROR};if(e){const t=new Uint8Array(e[2]);if(!(yield(0,u.validateADVwithEncs)(i,t,[o])))return{result:d.E2EProcessResult.PARSE_ERROR};__LOG__(2)`voip:validateAndDecryptEnc: successfully validated ADV device-identity`}const{result:n,decrypted:p}=yield E(o,i);return n===d.E2EProcessResult.SUCCESS&&(r[2]=Array.prototype.slice.call(new Uint8Array((0,l.default)(p,"decrypted")))),{result:n,retryCount:a}}catch(e){return __LOG__(3)`voip:validateAndDecryptEnc error`,{result:d.E2EProcessResult.PARSE_ERROR}}}))).apply(this,arguments)}function E(e,t){return(0,g.default)(e.e2eType!==c.CiphertextType.Skmsg,"VoIP enc type should not be skmsg"),_.Cipher.decryptSignalProto(t,e.e2eType,e.ciphertext).then((e=>{var t;const n=(0,a.unpadPkcs7)(new Uint8Array(e)),r=(0,h.decodeProtobuf)(p.MessageSpec,n);return(null===(t=r.call)||void 0===t?void 0:t.callKey)?{result:d.E2EProcessResult.SUCCESS,decrypted:r.call.callKey}:{result:d.E2EProcessResult.PARSE_ERROR}})).catch((0,o.filteredCatch)(f.SignalDecryptionError,(e=>(__LOG__(3)`voip:decryptSignalProto failed with decryption error; ${e}`,{result:d.E2EProcessResult.RETRY})))).catch((e=>(__LOG__(3)`voip:decryptSignalProto failed with unexpected error; ${e}`,{result:d.E2EProcessResult.PARSE_ERROR})))}},302947:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.maybeUpdateAddOnAcks=function(){return c.apply(this,arguments)},t.updateAddOnAcks=function(){return u.apply(this,arguments)};var i=r(n(348926)),a=n(376344),o=r(n(132375)),s=n(425315),l=n(359987);n(564121);function u(){return(u=(0,i.default)((function*(e){const{getProviderForAddOnType:t}=n(577721),r=yield Promise.allSettled(Array.from(e.entries()).map((e=>{var n;let[r,i]=e;const a=(0,o.default)(t(r),"getProviderForAddOnType(addOnType)");return null===(n=a.updateAcks)||void 0===n?void 0:n.call(a,i,(()=>!0))})));for(const e of r)if("rejected"===e.status)throw e.reason}))).apply(this,arguments)}function c(){return(c=(0,i.default)((function*(e){const{getProviderForAddOnType:t}=n(577721),r=yield Promise.allSettled(Array.from(e).map(function(){var e=(0,i.default)((function*(e){var n;let[r,i]=e;const a=(0,o.default)(t(r),"getProviderForAddOnType(addOnType)"),s=yield null===(n=a.updateAcks)||void 0===n?void 0:n.call(a,i,((e,t)=>d(e.ack,t.ack)));if(null!=s&&0!==s.length)return[r,s]}));return function(){return e.apply(this,arguments)}}())),a=new Map(r.map((e=>e.value)).filter(Boolean));(0,l.frontendFireAndForget)("updateAddOnCollectionAcks",{updatesByType:a});for(const e of r)if("rejected"===e.status)throw e.reason}))).apply(this,arguments)}function d(e,t){return(0,s.isNumber)(t)&&(null==e||t>e||t===a.ACK.FAILED)}},52866:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.bulkGenerateDeviceNotifications=function(){return g.apply(this,arguments)},t.createAndStoreDeviceNotifications=function(){return h.apply(this,arguments)},t.generateDeviceNotifications=_;var i=r(n(348926)),a=n(616310),o=n(287461),s=n(482388),l=n(389293),u=n(76469),c=n(459857),d=n(117429),p=n(669050);function _(){return f.apply(this,arguments)}function f(){return(f=(0,i.default)((function*(e,t,n){const r={notifications:[],chatIds:[]};if(!(0,d.getGlobalSecurityNotifications)())return r;if((0,o.getABPropConfigValue)("adv_v2_m6"))return r;if(!(t.length>0||n.length>0))return r;let i=[];if(e.equals((0,c.getMeUser)()))try{(yield(0,u.getChatTable)().all()).forEach((e=>{e.id!==a.STATUS_JID&&i.push((0,p.createWid)(e.id))}))}catch(e){throw __LOG__(4,!0,new Error,!0)`get all from chat table failed`,SEND_LOGS("get all from chat table failed when creating device notification"),new Error("get all from chat table failed")}else try{const t=yield(0,u.getChatTable)().get(String(e)),n=yield(0,u.getParticipantTable)().equals(["participants"],String(e));i=n.map((e=>(0,p.createWid)(e.groupId))),t&&i.push((0,p.createWid)(t.id))}catch(e){throw __LOG__(4,!0,new Error,!0)`get chats failed`,SEND_LOGS("get chats failed when creating device notification"),new Error("get chays failed")}const s=i.map((r=>(0,l.genDeviceNotificationMsg)(r,e,t,n)));return r.notifications=s,r.chatIds=i.map(String),r}))).apply(this,arguments)}function h(){return(h=(0,i.default)((function*(e,t,n){const{notifications:r}=yield _(e,t,n);yield Promise.all(r.map((e=>(0,s.storeMessageInTransaction)([e]))))}))).apply(this,arguments)}function g(){return(g=(0,i.default)((function*(e){let t=[];const n=new Set;if((0,d.getGlobalSecurityNotifications)()){(yield Promise.all(e.map((e=>{let{wid:t,added:n,removed:r,isNewRecord:i}=e;return i?Promise.resolve(null):_(t,n,r)})))).forEach((e=>{e&&(t=t.concat(e.notifications),e.chatIds.forEach((e=>n.add(e))))}))}return t.length>0?{notifications:t,chatIds:Array.from(n)}:{notifications:[],chatIds:[]}}))).apply(this,arguments)}},798440:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleADVDeviceNotification=function(e){let{wid:t,devices:n,type:r}=e;if(null==r)return Promise.reject(new Error("handleADVDeviceNotification: notification without type"));return function(){return h.apply(this,arguments)}(t,n,r)},t.handleADVDeviceSyncResult=function(e){return function(){return g.apply(this,arguments)}(e)},t.handleADVDeviceUpdateForMessage=function(){return f.apply(this,arguments)};var i=r(n(348926)),a=n(287461),o=n(866729),s=n(403206),l=n(476462),u=n(313062),c=n(715118),d=n(681349),p=n(999821),_=r(n(9705));function f(){return(f=(0,i.default)((function*(e,t,n,r,i){let o,s=arguments.length>5&&void 0!==arguments[5]&&arguments[5];return(0,a.getABPropConfigValue)("adv_v2_m4_m5")&&(o=yield(0,d.getLastADVDeviceInfoCheckTime)()),(0,u.handleADVDeviceUpdateForMessage)(e,t,n,r,i,s,o)}))).apply(this,arguments)}function h(){return(h=(0,i.default)((function*(e,t,r){let i=null;if("add"===r){const t=yield _.default.loadIdentityKey((0,p.createSignalAddress)(e).toString());i=t?(0,s.toCurveKeyPubKey)((0,p.strToBuffer)(t)):null}const l=yield(0,o.getDeviceRecord)(e);let u;(0,a.getABPropConfigValue)("adv_v2_m4_m5")&&(u=yield(0,d.getLastADVDeviceInfoCheckTime)());const f=(0,n(644753).handleDeviceNotification)(e,r,t,i,l,u);if(f)return f.clearRecord&&(yield(0,c.clearDeviceRecord)(e,(null==l?void 0:l.devices)||[])),(0,c.bulkApplyDeviceUpdate)([{wid:e,update:f.update,currentRecord:l}])}))).apply(this,arguments)}function g(){return(g=(0,i.default)((function*(e){__LOG__(2)`handleADVDeviceSyncResultImpl: start to handling ${e.length} updates`;const t=e.map((e=>e.wid)),r=e.filter((e=>{var t;return null===(t=e.devices.keyIndex)||void 0===t?void 0:t.signedKeyIndexBytes})),i=yield _.default.bulkLoadIdentityKey(r.map((e=>(0,p.createSignalAddress)(e.wid).toString()))),a=new Map;r.forEach(((e,t)=>{a.set((0,l.createDeviceListPK)(e.wid),i[t])}));const u=yield(0,o.bulkGetDeviceRecord)(t),d=[],f=[],h=n(644753).handleADVSyncResult;e.forEach(((e,t)=>{const n=a.get((0,l.createDeviceListPK)(e.wid)),r=n?(0,s.toCurveKeyPubKey)((0,p.strToBuffer)(n)):null,i=u[t],o=h(e.wid,e.devices,r,i);null!=o&&(o.clearRecord?(d.push({wid:e.wid,currentList:(null==i?void 0:i.devices)||[]}),f.push({wid:e.wid,currentRecord:{id:(0,l.createDeviceListPK)(e.wid),deleted:!0},update:o.update})):f.push({wid:e.wid,currentRecord:i,update:o.update}))})),yield Promise.all(d.map((e=>{let{wid:t,currentList:n}=e;return(0,c.clearDeviceRecord)(t,n)}))),yield(0,c.bulkApplyDeviceUpdate)(f)}))).apply(this,arguments)}},678002:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.clearADVSecretKey=function(){return L.apply(this,arguments)},t.generateADVSecretKey=function(){return M.apply(this,arguments)},t.generateDeviceSignature=function(e,t,n){const r=e.details,i=o.Binary.build(O,r,t.pubKey,n).readByteArray().buffer;return(0,u.calculateSignature)(t,i)},t.getADVEncodedIdentity=function(){return R.apply(this,arguments)},t.getADVSecretKey=function(){return b.apply(this,arguments)},t.setADVSignedIdentity=function(e){if(null==e)return Promise.reject(new Error("MD advSignedDeviceIdentity is null or undefined"));if(null==e.deviceSignature)return Promise.reject(new Error("MD advSignedDeviceIdentity is missing deviceSignature"));return _.waSignalStore.putADVSignedIdentity(e)},t.validateADVwithEncs=function(){return C.apply(this,arguments)},t.validateADVwithIdentityKey=v,t.verifyDeviceIdentityAccountSignature=N,t.verifyKeyIndexListAccountSignature=function(e,t){const n=e.details,r=e.accountSignature;(0,E.default)(null!=r,"accountSignature should not be null");const i=o.Binary.build(I,n).readByteArray();return(0,u.verifySignature)(new Uint8Array(t),i,new Uint8Array(r))};var i=r(n(348926)),a=n(417405),o=n(551168),s=n(215373),l=n(303754),u=n(403206),c=n(962559),d=n(999821),p=n(76256),_=n(326314),f=n(732974),h=n(673168),g=n(669050),m=n(309512),y=n(653313),E=r(n(441143)),S=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=T(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(798440));function T(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(T=function(e){return e?n:t})(e)}function v(){return A.apply(this,arguments)}function A(){return(A=(0,i.default)((function*(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{const i=(0,s.uint8ArrayToBuffer)(n),a=yield(0,p.getSignalProtocolStore)().loadIdentityKey((0,d.createSignalAddress)(e).toString());if(a){const e=(0,u.toCurveKeyPubKey)((0,d.strToBuffer)(a));if((0,d.bufferEqual)(e,i))return!0}const o=(0,m.decodeProtobuf)(c.ADVSignedDeviceIdentitySpec,t);(0,E.default)(null!=o,"advSignedDeviceIdentity should not be null");const l=yield(0,p.getSignalProtocolStore)().loadIdentityKey((0,d.createSignalAddress)((0,g.toUserWid)(e)).toString()),_=l?(0,u.toCurveKeyPubKey)((0,d.strToBuffer)(l)):null;if(!N(o,i,_))return __LOG__(3)`validateADVIdentity: invalid account signature`,!1;if(!w(o,i,_))return __LOG__(3)`validateADVIdentity: invalid device signature`,!1;const f=(0,m.decodeProtobuf)(c.ADVDeviceIdentitySpec,o.details);(0,E.default)(null!=f,"advDeviceIdentity should not be null");try{yield null==S?void 0:S.handleADVDeviceUpdateForMessage(e,f,_,o.accountSignatureKey,i,r)}catch(e){return __LOG__(3)`validateADVIdentity: process adv device identity failed`,!1}return __LOG__(2)`validateADVIdentity: successfully verified accountSignature and deviceSignature`,!0}catch(e){return __LOG__(3)`validateADVIdentity: failed`,!1}}))).apply(this,arguments)}function C(){return(C=(0,i.default)((function*(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=n.find((e=>e.e2eType===l.CiphertextType.Pkmsg));if(!i)return!0;__LOG__(2)`validateADVwithEncs: start validate prekey msg `;try{(0,E.default)(null!=e,"author should not be null");const n=(0,f.extractIdentityKey)(i.ciphertext);(0,E.default)(null!=n,"identityKey should not be null");const a=yield v(e,t,new Uint8Array(n),r);return yield(0,p.getSignalProtocolStore)().flushBufferToDiskIfNotMemOnlyMode(),a}catch(e){return __LOG__(3)`validateADVwithEncs: failed ${e}`,!1}}))).apply(this,arguments)}const P=new Uint8Array([6,0]),O=new Uint8Array([6,1]),I=new Uint8Array([6,2]);function M(){return(M=(0,i.default)((function*(){const e=new Uint8Array(32);self.crypto.getRandomValues(e);const t=(0,a.encodeB64)(e);return yield(0,h.setADVSecretKey)(t),t}))).apply(this,arguments)}function b(){return(b=(0,i.default)((function*(){const e=yield(0,h.getADVSecretKey)();if(null==e)throw new Error("MD secretKey is null or undefined");return e}))).apply(this,arguments)}function R(){return(R=(0,i.default)((function*(){const e=yield _.waSignalStore.getADVSignedIdentity();if(null==e)throw new Error("MD advSignedDeviceIdentity is null or undefined");if(null==e.deviceSignature)throw new Error("MD advSignedDeviceIdentity is missing deviceSignature");return(0,y.encodeProtobuf)(c.ADVSignedDeviceIdentitySpec,e).readByteArray()}))).apply(this,arguments)}function N(e,t,n){const r=e.details,i=e.accountSignatureKey||n;(0,E.default)(null!=i,"accountSignatureKey should not be null");const a=e.accountSignature;(0,E.default)(null!=a,"accountSignature should not be null");const s=o.Binary.build(P,r,t).readByteArray();return(0,u.verifySignature)(new Uint8Array(i),s,new Uint8Array(a))}function w(e,t,n){const r=e.details,i=e.deviceSignature;(0,E.default)(null!=i,"deviceSignature should not be null");const a=e.accountSignatureKey||n;(0,E.default)(null!=a,"accountSignatureKey should not be null");const s=o.Binary.build(O,r,t,a).readByteArray();return(0,u.verifySignature)(new Uint8Array(t),s,new Uint8Array(i))}function L(){return(L=(0,i.default)((function*(){yield(0,h.setADVSecretKey)(void 0)}))).apply(this,arguments)}},308772:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.bulkUpdateGroupParticipantsInTransaction=function(){return f.apply(this,arguments)},t.updateGroupParticipantsInTransaction=function(){return _.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(616310),s=n(97858),l=n(76469),u=n(437695),c=n(459857),d=r(n(571834)),p=n(669050);function _(){return(_=(0,a.default)((function*(e,t,n){const r=(yield(0,l.getParticipantTable)().equals(["participants"],String(e))).map((r=>{let a=r.rotateKey;const o=new Map(r.senderKey);return(0,s.rotateSenderKeyIfSentEnabled)()?(n.forEach((t=>{var n;const r=String((0,p.createDeviceWidFromUserAndDevice)(e.user,e.server,t));a=a||null!==(n=o.get(r))&&void 0!==n&&n,o.delete(r)})),a&&o.forEach(((e,t)=>o.set(t,!1)))):(n.forEach((t=>{o.delete(String((0,p.createDeviceWidFromUserAndDevice)(e.user,e.server,t)))})),n.length>0&&(a=!0)),t.forEach((t=>{o.set(String((0,p.createDeviceWidFromUserAndDevice)(e.user,e.server,t)),!1)})),h(e,a,r,t,n),(0,i.default)((0,i.default)({},r),{},{senderKey:o,rotateKey:a})}));return(0,l.getParticipantTable)().bulkCreateOrReplace(r)}))).apply(this,arguments)}function f(){return(f=(0,a.default)((function*(e){if(0===e.length)return;const t=yield(0,l.getParticipantTable)().anyOf(["participants"],e.map((e=>String(e.wid))));if(0===t.length)return;const n=new Map;e.forEach((e=>{n.set(String(e.wid),e)}));const r=t.map((e=>{let t=e.rotateKey;const r=new Map(e.senderKey);return e.participants.forEach((i=>{const a=n.get(i);if(!a)return;const{wid:o,added:l,removed:u}=a;(0,s.rotateSenderKeyIfSentEnabled)()?(u.forEach((e=>{var n;const i=String((0,p.createDeviceWidFromUserAndDevice)(a.wid.user,a.wid.server,e));t=t||null!==(n=r.get(i))&&void 0!==n&&n,r.delete(i)})),t&&r.forEach(((e,t)=>r.set(t,!1)))):(u.forEach((e=>{r.delete(String((0,p.createDeviceWidFromUserAndDevice)(a.wid.user,a.wid.server,e)))})),u.length>0&&(t=!0)),l.forEach((e=>{r.set(String((0,p.createDeviceWidFromUserAndDevice)(a.wid.user,a.wid.server,e)),!1)})),h(o,t,e,l,u)})),(0,i.default)((0,i.default)({},e),{},{senderKey:r,rotateKey:t})}));return(0,l.getParticipantTable)().bulkCreateOrReplace(r)}))).apply(this,arguments)}function h(e,t,n,r,i){if(t&&!n.rotateKey){var a;let t;t=i.includes(o.DEFAULT_DEVICE_ID)&&r.includes(o.DEFAULT_DEVICE_ID)?d.default.EXPIRY_REASON.IDENTITY_CHANGE:(null===(a=(0,c.getMaybeMeUser)())||void 0===a?void 0:a.equals(e))?d.default.EXPIRY_REASON.PEER_COMPANION_UNPAIR:d.default.EXPIRY_REASON.OTHER_DEVICE_UNPAIR,(0,u.postSenderKeyExpiredMetric)({chatId:n.groupId,deviceCount:n.senderKey.size,expiryReason:t})}}},681349:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getLastADVDeviceInfoCheckTime=function(){return s.apply(this,arguments)},t.setLastADVDeviceInfoCheckTime=function(e){o=e};var i=r(n(348926)),a=n(948425);let o;function s(){return(s=(0,i.default)((function*(){if(null==o){yield(0,a.getTaskScheduledTime)("advDeviceInfoCheck")}return o}))).apply(this,arguments)}},232262:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.computeExpectedTsForDeviceRecord=function(e,t,n){const r=null==t?void 0:t.timestamp;if(null==r)return{expectedTs:void 0,expectedTsLastDeviceJobTs:void 0,expectedTsUpdateTs:void 0};let i,o,s;null==t||t.deleted||(i=t.expectedTs,o=t.expectedTsLastDeviceJobTs,s=t.expectedTsUpdateTs);return a(e,r,n,i,o,s)},t.computeNewExpectedTs=a,t.shouldClearExpectedTs=function(e,t,n,r){if(!(0,i.getABPropConfigValue)("adv_v2_m4_m5"))return!1;if(null==n||n.deleted)return!1;if(null==n.expectedTs)return!1;if(e>=n.expectedTs)return!0;if(e<n.expectedTs&&t===n.expectedTs&&null!=r&&(null==n.expectedTsLastDeviceJobTs||r>n.expectedTsLastDeviceJobTs))return!0;return!1};var r=n(990445),i=n(287461);function a(e,t,n,a,o,s){if(!(0,i.getABPropConfigValue)("adv_v2_m4_m5"))return{expectedTs:void 0,expectedTsLastDeviceJobTs:void 0,expectedTsUpdateTs:void 0};const l={expectedTs:a,expectedTsLastDeviceJobTs:o,expectedTsUpdateTs:s};return t>=e||null!=a&&a>=e||(l.expectedTs=e,l.expectedTsLastDeviceJobTs=n,(null==a||t>=a)&&(l.expectedTsUpdateTs=(0,r.unixTimeWithoutClockSkewCorrection)())),l}},833476:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleICDCData=function(e,t,n){if(null==n||!(0,c.getABPropConfigValue)("adv_v2_m4_m5"))return Promise.resolve();return g.enqueue((()=>function(){return m.apply(this,arguments)}(e,t,n)))};var i=r(n(81109)),a=r(n(348926)),o=n(616310),s=n(478337),l=n(316860),u=n(990445),c=n(287461),d=n(232262),p=n(866729),_=n(644753),f=n(681349),h=n(459857);const g=new l.PromiseQueue;function m(){return(m=(0,a.default)((function*(e,t,n){const{deviceListMetadata:r}=n;if(null==r)return void __LOG__(2,void 0,void 0,void 0,["handleICDCData"])`get empty device list metadata`;if((null==e.device||e.device===o.DEFAULT_DEVICE_ID)&&null!=r.senderTimestamp&&null==r.senderKeyHash){const t=(0,s.numberOrThrowIfTooLarge)(r.senderTimestamp)+1;return void(0,_.handleADVSyncResult)(e,{deviceList:[{id:o.DEFAULT_DEVICE_ID,keyIndex:0}],keyIndex:{ts:(0,u.castToUnixTime)(t),signedKeyIndexBytes:null}},null,null)}const a=[],l=e.user===(0,h.getMeUser)().user;a.push({id:e,ts:r.senderTimestamp}),l&&null!=t&&a.push({id:t,ts:r.recipientTimestamp});const c=yield(0,f.getLastADVDeviceInfoCheckTime)(),g=yield(0,p.bulkGetDeviceRecord)(a.map((e=>e.id))),m=[];return g.forEach(((e,t)=>{const n=a[t].ts;if(null==e||e.deleted||null==n)return;const r=(0,d.computeExpectedTsForDeviceRecord)((0,s.numberOrThrowIfTooLarge)(n),e,c);r.expectedTs===e.expectedTs&&r.expectedTsLastDeviceJobTs===e.expectedTsLastDeviceJobTs&&e.expectedTsUpdateTs==e.expectedTsUpdateTs||(__LOG__(2)`handleICDCData: update expectd timestamp for ${e.id}`,m.push((0,i.default)((0,i.default)({},e),r)))})),m.length>0?(0,p.bulkCreateOrReplaceDeviceRecord)(m):void 0}))).apply(this,arguments)}},313062:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleADVDeviceUpdateForMessage=function(){return p.apply(this,arguments)};var i=r(n(348926)),a=n(616310),o=n(866729),s=n(475002),l=n(322939),u=n(999821),c=n(669050),d=r(n(441143));function p(){return(p=(0,i.default)((function*(e,t,n,r,i){let p=arguments.length>5&&void 0!==arguments[5]&&arguments[5],_=arguments.length>6?arguments[6]:void 0;const{rawId:f,timestamp:h,keyIndex:g}=t;(0,d.default)(null!=f,"handleADVDeviceIdentity: rawId of deviceIdentity should not be null"),(0,d.default)(null!=h,"handleADVDeviceIdentity: timestamp of deviceIdentity should not be null"),(0,d.default)(null!=g,"handleADVDeviceIdentity: keyIndex of deviceIdentity should not be null");const m={rawId:f,timestamp:h,keyIndex:g},y=e.device;(0,d.default)(null!=y&&y!==a.DEFAULT_DEVICE_ID,"handleADVDeviceIdentity: called for primary device");const E=(0,c.toUserWid)(e),S=yield(0,o.getDeviceRecord)(E),T=null==n||null!=r&&!(0,u.bufferEqual)(n,r);return!S||S.deleted||S.rawId!==f||T?(0,s.handleListReset)(e,m,T?r:null,i,S,p,_):(0,l.handleNoListReset)(e,m,i,S,p,_)}))).apply(this,arguments)}},475002:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleListReset=function(){return m.apply(this,arguments)};var i=r(n(348926)),a=n(616310),o=n(478337),s=n(990445),l=n(287461),u=n(232262),c=n(403206),d=n(476462),p=n(715118),_=n(999821),f=n(76256),h=n(669050),g=r(n(441143));function m(){return(m=(0,i.default)((function*(e,t,n,r,i){let m=arguments.length>5&&void 0!==arguments[5]&&arguments[5],y=arguments.length>6?arguments[6]:void 0;const{rawId:E,timestamp:S,keyIndex:T}=t,v=(0,o.numberOrThrowIfTooLarge)(S),A=(0,l.getABPropConfigValue)("adv_v2_m4_m5"),C=e.device;(0,g.default)(null!=C&&C!==a.DEFAULT_DEVICE_ID,"handleADVDeviceIdentity: called for primary device");const P=(0,h.toUserWid)(e);let O=0;if(A&&(O=(null==i?void 0:i.timestamp)||(0,s.pastUnixTime)(((0,l.getABPropConfigValue)("num_days_key_index_list_expiration")-1)*s.DAY_SECONDS)),null!=i&&!i.deleted){if(i.timestamp>v)throw new Error("handleADVDeviceIdentity: out-of-order timestamp detected");yield(0,p.clearDeviceRecord)(P,i.devices,m)}n&&(yield(0,f.getSignalProtocolStore)().saveIdentity((0,_.createSignalAddress)(P).toString(),(0,c.toSignalCurvePubKey)(n)));const I={id:(0,d.createDeviceListPK)(e),rawId:E,timestamp:O,devices:[{id:C,keyIndex:T},{id:a.DEFAULT_DEVICE_ID,keyIndex:0}],validIndexes:null,currentIndex:null,deleted:!1};if(A){const e=(0,u.computeExpectedTsForDeviceRecord)(v,I,y);I.expectedTs=e.expectedTs,I.expectedTsLastDeviceJobTs=e.expectedTsLastDeviceJobTs,I.expectedTsUpdateTs=e.expectedTsUpdateTs}yield(0,p.bulkApplyDeviceUpdate)([{wid:P,update:I,currentRecord:null}],m),yield(0,f.getSignalProtocolStore)().saveIdentity((0,_.createSignalAddress)(e).toString(),(0,c.toSignalCurvePubKey)(r))}))).apply(this,arguments)}},322939:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleNoListReset=function(){return g.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(616310),s=n(478337),l=n(287461),u=n(232262),c=n(403206),d=n(715118),p=n(999821),_=n(76256),f=n(669050),h=r(n(441143));function g(){return(g=(0,a.default)((function*(e,t,n,r){let a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],g=arguments.length>5?arguments[5]:void 0;const{timestamp:m,keyIndex:y}=t,E=(0,s.numberOrThrowIfTooLarge)(m),S=e.device;if((0,h.default)(null!=S&&S!==o.DEFAULT_DEVICE_ID,"handleADVDeviceIdentity: called for primary device"),r.timestamp>=E&&r.validIndexes&&!r.validIndexes.includes(y))throw new Error("handleADVDeviceIdentity: out-of-order timestamp detected");const T=new Map(r.devices.map((e=>[e.id,e.keyIndex])));if(!T.has(S)||T.get(S)!==y){T.set(S,y);const t=Array.from(T.entries()).map((e=>{let[t,n]=e;return{id:t,keyIndex:n}})),o=(0,i.default)((0,i.default)({},r),{},{devices:t,deleted:!1});if((0,l.getABPropConfigValue)("adv_v2_m4_m5")){const e=(0,u.computeExpectedTsForDeviceRecord)(E,o,g);o.expectedTs=e.expectedTs,o.expectedTsLastDeviceJobTs=e.expectedTsLastDeviceJobTs,o.expectedTsUpdateTs=e.expectedTsUpdateTs}yield(0,d.bulkApplyDeviceUpdate)([{wid:(0,f.toUserWid)(e),update:o,currentRecord:r}],a),yield(0,_.getSignalProtocolStore)().saveIdentity((0,p.createSignalAddress)(e).toString(),(0,c.toSignalCurvePubKey)(n))}}))).apply(this,arguments)}},947226:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleDeviceAddNotification=function(e,t,n,r,i,d,p){if(!d||d.deleted)return null;if(n<d.timestamp)return null;if(null==i)return null;const _=(0,c.decodeSignedKeyIndexBytes)(i,r);if(!_)return null;const f=_.rawId,h=(0,o.numberOrThrowIfTooLarge)(_.timestamp);if(h!==n)return null;let g=!1,m=null;const y=d.timestamp;d.rawId!==f?g=!0:m=d.devices;const E=new Set(_.validIndexes),S=_.currentIndex||0,T=null==m?[]:m.filter((e=>e.id!==a.DEFAULT_DEVICE_ID&&(E.has(e.keyIndex)||e.keyIndex>S)));t.forEach((e=>{const{id:t,keyIndex:n}=e;t!==a.DEFAULT_DEVICE_ID&&null!=n&&E.has(n)&&T.push({id:t,keyIndex:n})})),T.push({id:a.DEFAULT_DEVICE_ID,keyIndex:0});const v={id:(0,u.createDeviceListPK)(e),rawId:f,timestamp:y,validIndexes:Array.from(E),devices:T,currentIndex:_.currentIndex,deleted:!1};if((0,s.getABPropConfigValue)("adv_v2_m4_m5")){const e=(0,l.computeExpectedTsForDeviceRecord)(h,v,p);v.expectedTs=e.expectedTs,v.expectedTsLastDeviceJobTs=e.expectedTsLastDeviceJobTs,v.expectedTsUpdateTs=e.expectedTsUpdateTs}return{update:v,clearRecord:g}},t.handleDeviceRemoveNotification=function(e,t,n){if(null==n||n.deleted)return null;if(t<n.timestamp)return null;const r=new Map(e.map((e=>[e.id,e.keyIndex]))),o=n.devices.filter((e=>{if(e.id!==a.DEFAULT_DEVICE_ID){const t=r.get(e.id);return null==t||t!==e.keyIndex}return!1}));return o.push({id:a.DEFAULT_DEVICE_ID,keyIndex:0}),{update:(0,i.default)((0,i.default)({},n),{},{devices:o}),clearRecord:!1}};var i=r(n(81109)),a=n(616310),o=n(478337),s=n(287461),l=n(232262),u=n(476462),c=n(716151)},716151:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeSignedKeyIndexBytes=function(e,t){let n,o;try{n=(0,a.decodeProtobuf)(i.ADVSignedKeyIndexListSpec,t)}catch(e){return null}if(!(0,r.verifyKeyIndexListAccountSignature)(n,e))return null;try{o=(0,a.decodeProtobuf)(i.ADVKeyIndexListSpec,n.details)}catch(e){return null}const{timestamp:s,rawId:l,validIndexes:u,currentIndex:c}=o;if(null==s)return null;if(null==l)return null;return{timestamp:s,rawId:l,validIndexes:u,currentIndex:c}};var r=n(678002),i=n(962559),a=n(309512)},644753:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleADVSyncResult=function(e,t,n,r,a){const{deviceList:l,keyIndex:u}=t;if(null==u||null==u.signedKeyIndexBytes)return null!=l&&l.some((e=>e.id!==i.DEFAULT_DEVICE_ID))?void __LOG__(2)`processADVSyncResult: drop response with companion device but no keyIndexbytes`:(0,s.handleOmittedResult)(null==u?void 0:u.ts,r,null==u?void 0:u.expectedTs,a);const{ts:c,expectedTs:d,signedKeyIndexBytes:p}=u;return(0,o.handleKeyIndexResult)(e,l,c,p,n,r,a,d)},t.handleDeviceNotification=function(e,t,n,r,i,o){const{deviceList:s,keyIndex:u}=n;(0,l.default)(null!=s,`handleDeviceNotification: device list should not be none for device ${t} notification`),(0,l.default)(null!=u,`handleDeviceNotification: keyIndex should not be none for device ${t} notification`);const{ts:c,signedKeyIndexBytes:d}=u;if("add"===t)return(0,l.default)(null!=d,`handleDeviceNotification: signedKeyIndexBytes should not be none for device ${t} notification`),(0,a.handleDeviceAddNotification)(e,s,c,d,r,i,o);if("remove"===t)return(0,a.handleDeviceRemoveNotification)(s,u.ts,i)};var i=n(616310),a=n(947226),o=n(161744),s=n(44991),l=r(n(441143))},161744:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.handleKeyIndexResult=function(e,t,n,l,u,c,d,p){if(null!=(null==c?void 0:c.timestamp)&&n<c.timestamp)return null;if(null==u)return null;const _=(0,s.decodeSignedKeyIndexBytes)(u,l);if(!_)return null;const f=_.rawId,h=(0,i.numberOrThrowIfTooLarge)(_.timestamp);if(h!==n)return null;let g=!1,m=null,y=t;c&&!c.deleted&&(null==y&&(y=c.devices),c.rawId!==f?g=!0:m=c.devices);const E=new Map,S=new Set(_.validIndexes),T=_.currentIndex||0;y&&y.forEach((e=>{null!=e.keyIndex&&S.has(e.keyIndex)&&E.set(e.id,e.keyIndex)}));null!=m&&m.forEach((e=>{e.keyIndex>T&&E.set(e.id,e.keyIndex)}));E.set(r.DEFAULT_DEVICE_ID,0);const v=Array.from(E.entries()).map((e=>{let[t,n]=e;return{id:t,keyIndex:n}})),A={id:(0,o.createDeviceListPK)(e),rawId:f,timestamp:h,validIndexes:Array.from(S),devices:v,currentIndex:_.currentIndex,deleted:!1};g||(0,a.shouldClearExpectedTs)(h,p,c,d)||c&&!c.deleted&&(A.expectedTs=c.expectedTs,A.expectedTsLastDeviceJobTs=c.expectedTsLastDeviceJobTs,A.expectedTsUpdateTs=c.expectedTsUpdateTs);return{update:A,clearRecord:g}};var r=n(616310),i=n(478337),a=n(232262),o=n(476462),s=n(716151)},44991:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleOmittedResult=function(e,t,n,r){if(!t||t.deleted)return null;if(null!=e&&e<t.timestamp)return null;const s=(0,i.default)({},t);null!=e&&(s.timestamp=e,(0,o.shouldClearExpectedTs)(e,n,t,r)&&(s.expectedTs=void 0,s.expectedTsLastDeviceJobTs=void 0,s.expectedTsUpdateTs=void 0));return s.devices=[{id:a.DEFAULT_DEVICE_ID,keyIndex:0}],{update:s,clearRecord:!1}};var i=r(n(81109)),a=n(616310),o=n(232262)},811670:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.setArchive=function(){return l.apply(this,arguments)};var i=r(n(348926)),a=n(359987),o=n(76469),s=n(669050);function l(){return(l=(0,i.default)((function*(e){yield(0,o.getChatTable)().bulkCreateOrMerge(e);const t=e.map((e=>({id:(0,s.createWid)(e.id),archive:e.archive})));(0,a.frontendFireAndForget)("chatCollectionUpdate",{updates:t})}))).apply(this,arguments)}},588251:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.syncContactList=I,t.syncContactListInChunks=function(){return O.apply(this,arguments)};var i=r(n(348926)),a=r(n(132375)),o=n(36530),s=n(990445),l=n(493928),u=n(798440),c=n(866729),d=n(450491),p=n(314005),_=n(233358),f=n(824668),h=n(369489),g=n(714443),m=r(n(174285)),y=n(76469),E=n(848624),S=(n(476314),n(346702),n(600445)),T=n(94872),v=n(692269),A=n(328606),C=n(669050),P=n(71870);function O(){return(O=(0,i.default)((function*(e){let{contactIds:t,shouldDelayBetweenChunks:n}=e;const r=_.CONTACT_SYNC_CHUNK_SIZE;__LOG__(2,void 0,void 0,void 0,["contact-sync"])`start contact sync for ${t.length} contacts in ${Math.ceil(t.length/r)} chunks, each chunk size: ${r}`;for(let e=0;e<t.length;e+=r){const i=t.slice(e,e+r);n&&(yield(0,o.delayMs)(1e3*_.SYNC_CONTACT_CHUNK_INTERVAL_SECONDS)),yield I({contactIds:i,shouldSyncDevice:!0})}}))).apply(this,arguments)}function I(){return M.apply(this,arguments)}function M(){return(M=(0,i.default)((function*(e){let{contactIds:t,shouldSyncDevice:n}=e;if(0===t.length)return;const r=yield F(t),a=(new v.USyncQuery).withContext("background").withMode("full").withBusinessProtocol().withStatusProtocol().withPictureProtocol();n&&a.withDeviceProtocol(),(0,l.isDisappearingModeEnabled)()&&a.withDisappearingModeProtocol(),(0,P.lidUsyncEnabled)()&&a.withLidProtocol(),yield Promise.all(r.map(function(){var e=(0,i.default)((function*(e){const t=(new A.USyncUser).withId(e.id).withDeviceHash(String(e.hash));if((0,P.lidUsyncEnabled)()&&!e.id.isLid()){const n=yield(0,d.getCurrentLid)(e.id.user);n&&t.withLid(n)}a.withUser(t)}));return function(){return e.apply(this,arguments)}}()));let s=null,u=3,c=10*Math.random();for(;u-- >0;)try{s=yield a.execute();const e=s.error.all;var p;if(e)throw c=null!==(p=e.errorBackoff)&&void 0!==p?p:10*Math.random(),new Error(`syncContactList: error ${e.errorCode}: ${e.errorText}`);u=0}catch(e){0===u&&(__LOG__(4,!0,new Error,!0)`failed to execute usync query`,SEND_LOGS("failed to execute usync query: "+e)),yield(0,o.delayMs)(1e3*c)}if(null==s||s.error.all)return;const _=s.refresh,f=[];for(const e of Object.keys(_))f.push(_[e]);if(f.length>0){Y(Math.min(...f))}yield Promise.all([n?x(s):Promise.resolve(),(0,l.isDisappearingModeEnabled)()?R(s):Promise.resolve(),(0,P.lidUsyncEnabled)()?w(s):Promise.resolve(),b(s),D(s),U(s)]),yield G(t)}))).apply(this,arguments)}function b(e){const t=e.error.status;t?__LOG__(3)`handleSyncStatus: failed ${t.errorCode} : ${t.errorText}`:e.list.map((e=>{const t=S.StatusCollection.get(e.id);t&&e.status&&t.set({status:e.status})}))}function R(){return N.apply(this,arguments)}function N(){return(N=(0,i.default)((function*(e){const t=e.error.status;t?__LOG__(3)`handleDisappearingMode: failed ${t.errorCode} : ${t.errorText}`:yield Promise.all(e.list.map(function(){var e=(0,i.default)((function*(e){e.disappearing_mode&&(yield(0,f.updateDisappearingMode)(e.id,e.disappearing_mode.duration,e.disappearing_mode.t))}));return function(){return e.apply(this,arguments)}}()))}))).apply(this,arguments)}function w(){return L.apply(this,arguments)}function L(){return(L=(0,i.default)((function*(e){var t;const n=e.error.lid;n&&__LOG__(3)`handleLidSync: error ${n.errorCode}: ${n.errorText}`;const r=[...e.list,...null!==(t=e.sideList)&&void 0!==t?t:[]].filter((e=>{let{lid:t}=e;return"string"==typeof t}));yield(0,d.createOrReplaceLidPnMappings)(r.map((e=>{let{id:t,lid:n}=e;return{pn:t.user,lid:(0,C.createUserWid)(n).user}})))}))).apply(this,arguments)}function D(){return k.apply(this,arguments)}function k(){return(k=(0,i.default)((function*(e){const t=e.list.filter((e=>{let{business:t}=e;return Boolean(t)}));yield(0,p.handleVerifiedNameSync)(t.map((e=>{let{id:t,business:{verifiedName:n}}=e;return{id:t,verifiedName:n}})))}))).apply(this,arguments)}function U(e){const t=e.error.picture;t&&__LOG__(3)`handleSyncProfilePictures: failed ${t.errorCode} : ${t.errorText}`}function G(e){const t=e.map((e=>({id:(0,g.toPhoneUserJid)(e.user),isContactSyncCompleted:1})));return __LOG__(2,void 0,void 0,void 0,["contact-sync"])`mark ${t.length} contacts completed for contact sync`,(0,y.getContactTable)().bulkCreateOrMerge(t)}function x(){return B.apply(this,arguments)}function B(){return(B=(0,i.default)((function*(e){const t=e.error.devices;t&&__LOG__(3)`handleSyncDevice: error ${t.errorCode}: ${t.errorText}`;const n=e.list.filter((e=>e.devices&&null!=e.devices.deviceList&&null!=e.devices.keyIndex&&!("errorCode"in e.devices))).map((e=>({wid:e.id,devices:e.devices})));return __LOG__(2)`handleSyncDevice: skipping ${e.list.length-n.length} out of ${e.list.length} records`,yield(0,h.getAndStoreIdentityKeys)(n.map((e=>e.wid))),(0,u.handleADVDeviceSyncResult)(n)}))).apply(this,arguments)}function F(){return j.apply(this,arguments)}function j(){return(j=(0,i.default)((function*(e){const t=(yield(0,c.getDeviceIds)(e)).map((e=>null==e?[]:e.devices.map((t=>(0,C.createDeviceWidFromDeviceListPk)(e.id,t))))),n=yield Promise.all(t.map((e=>0===e.length?"":(0,E.phashV2)(e))));return e.map(((e,t)=>({id:e,hash:n[t]})))}))).apply(this,arguments)}function Y(e){Number.isNaN(e)||e<=s.HOUR_SECONDS?__LOG__(3,void 0,void 0,void 0,["contact-sync"])`invalid contact sync refresh period: ${e}`:(__LOG__(2,void 0,void 0,void 0,["contact-sync"])`set contact sync refresh period: ${e}`,(0,a.default)(m.default,"localStorage").setItem(T.KEYS.CONTACT_SYNC_REFRESH,String(e)))}},233358:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SYNC_CONTACT_CHUNK_INTERVAL_SECONDS=t.CONTACT_SYNC_CHUNK_SIZE=void 0;t.CONTACT_SYNC_CHUNK_SIZE=500;t.SYNC_CONTACT_CHUNK_INTERVAL_SECONDS=20},107737:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.STORAGE_ALERT_TYPE=void 0;const r=n(76672)({LOW_QUOTA_EXCEEDED:"low_quota_exceed",HIGH_QUOTA_EXCEEDED:"high_quota_exceed",NO_ALERT:"no_alert"});t.STORAGE_ALERT_TYPE=r},899414:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.convertToMBToString=function(e){if(null!=e&&0!==e)return Math.round(e/1e6).toString();return"0"},t.getAllDatabases=function(){return o.apply(this,arguments)},t.getDatabase=function(){return s.apply(this,arguments)},t.objectStoreIterator=function(e,t){return new Promise(((n,r)=>{const i=e.openCursor(null,"prev");i.onsuccess=e=>{const r=e.target.result;r&&t(r.value)?r.continue():n()},i.onerror=e=>{r(e.target.result)}}))},t.promisifyRequest=a;var i=r(n(348926));function a(e){return new Promise(((t,n)=>{e.onsuccess=e=>{t(e.target.result)},e.onerror=e=>{n(e.target.result)}}))}function o(){return(o=(0,i.default)((function*(e){const t=yield a(e.open("__dbnames")),n=t.transaction(t.objectStoreNames,"readonly"),r=n.objectStore(n.objectStoreNames[0]);return yield a(r.getAll())}))).apply(this,arguments)}function s(){return(s=(0,i.default)((function*(e,t){return yield a(e.open(t))}))).apply(this,arguments)}},339316:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getEstimatedFTSDbSize=function(){return d.apply(this,arguments)};var i=r(n(348926)),a=r(n(132375)),o=n(899414),s=r(n(422660)),l=n(126151);const u="fts-storage",c=15e3;function d(){return(d=(0,i.default)((function*(){let{sampleRows:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{sampleRows:c};Date.now();const t=(0,a.default)(s.default,"indexedDB_"),n=yield(0,o.getDatabase)(t,u),r=n.transaction(n.objectStoreNames,"readonly");let i=0,d=0;for(const t of r.objectStoreNames){const n=r.objectStore(t),a=yield(0,o.promisifyRequest)(n.count());if(0===a)continue;const s=Math.min(e,a);d=s;let u=0;yield(0,o.objectStoreIterator)(n,(e=>(u+=(0,l.estimateSize)(e,t),d--,d>0)));i+=Math.round(u*(a/(s-d)))}return Date.now(),Promise.resolve(i)}))).apply(this,arguments)}},495976:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return a.apply(this,arguments)};var i=r(n(348926));function a(){return(a=(0,i.default)((function*(){const e=navigator.storage;if(null==(null==e?void 0:e.estimate))return null;const t=yield e.estimate();let{usage:n,quota:r,usageDetails:i}=t;Number.isFinite(n)||(n=0),Number.isFinite(r)||(r=0);return{usage:n,quota:r,available:r-n,caches:null==i?void 0:i.caches}}))).apply(this,arguments)}},126151:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.estimateSize=function(e,t){if("lru-media-meta-info"===t){let t=0;return e.size&&"number"==typeof e.size&&(t+=e.size),t+=a(e),t}return a(e)},t.getSampleRateOverride=function(e,t,n){if("lru-media-meta-info"===t&&"lru-media-storage-idb"===n)return 1;return e},t.skipRow=function(e,t){if("message"===t&&!i.has(e.type))return!0;return!1};var r=n(373070);const i=new Set([r.MSG_TYPE.AUDIO,r.MSG_TYPE.CHAT,r.MSG_TYPE.DOCUMENT,r.MSG_TYPE.GROUPS_V4_INVITE,r.MSG_TYPE.HSM,r.MSG_TYPE.IMAGE,r.MSG_TYPE.INTERACTIVE,r.MSG_TYPE.LIST,r.MSG_TYPE.LOCATION,r.MSG_TYPE.MULTI_VCARD,r.MSG_TYPE.ORDER,r.MSG_TYPE.PAYMENT,r.MSG_TYPE.PRODUCT,r.MSG_TYPE.PTT,r.MSG_TYPE.STICKER,r.MSG_TYPE.TEMPLATE_BUTTON_REPLY,r.MSG_TYPE.VCARD,r.MSG_TYPE.VIDEO]);function a(e){let t=0;return JSON.stringify(e,((e,n)=>{if("string"==typeof e&&(t+=2*e.length),n instanceof ArrayBuffer)t+=n.byteLength;else if(n instanceof Blob)t+=n.size;else if("number"==typeof n)t+=8;else if("boolean"==typeof n)t+=1;else{if("string"!=typeof n)return n;t+=2*n.length}})),t}},529921:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GROUP_PARTICIPANT_TYPES=void 0;t.GROUP_PARTICIPANT_TYPES={superadmin:"superadmin",admin:"admin",participant:"participant"}},242382:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addParticipants=function(){return g.apply(this,arguments)},t.demoteCommmunityParticipants=function(e){let{group:t,participants:n,isOffline:r}=e;return(0,o.updateCommunityParticipants)(t,{action:s.PARTICIPANT_OPERATION.LINKED_GROUP_DEMOTE,participants:n},r)},t.demoteParticipants=function(e){let{group:t,participants:n,version:r,prevVersion:i,isOffline:a}=e;if(null==r)return Promise.reject(new Error("demoteParticipants: incoming change missing version id"));return(0,o.updateParticipants)(t,{action:s.PARTICIPANT_OPERATION.DEMOTE,participants:n,version:r,prevVersion:i},a)},t.promoteCommmunityParticipants=function(e){let{group:t,participants:n,isOffline:r}=e;return(0,o.updateCommunityParticipants)(t,{action:s.PARTICIPANT_OPERATION.LINKED_GROUP_PROMOTE,participants:n},r)},t.promoteParticipants=function(e){let{group:t,participants:n,version:r,prevVersion:i,isOffline:a}=e;if(null==r)return Promise.reject(new Error("promoteParticipants: incoming change missing version id"));return(0,o.updateParticipants)(t,{action:s.PARTICIPANT_OPERATION.PROMOTE,participants:n,version:r,prevVersion:i},a)},t.removeParticipants=function(e){let{group:t,participants:n,timestamp:r,author:i,version:a,prevVersion:l,reason:u,isOffline:c}=e;if(null==a)return Promise.reject(new Error("removeParticipants: incoming change missing version id"));return(0,o.updateParticipants)(t,{action:s.PARTICIPANT_OPERATION.REMOVE,participants:n,timestamp:r,author:i,version:a,prevVersion:l,reason:u},c)},t.updateParticipants=function(){return h.apply(this,arguments)};var i=r(n(348926)),a=n(287461),o=n(608916),s=n(209639),l=n(76469),u=n(280464),c=n(126092),d=n(459857),p=n(669050),_=n(914343),f=n(511448);function h(){return(h=(0,i.default)((function*(e){let{group:t,participants:n,version:r,isOffline:i}=e;const s=[];n.forEach((e=>{e.isAdmin&&s.push(e.id)}));const l=(0,d.getMaybeMeUser)(),u=s.some((e=>l&&l.equals(e)));let p,_=!1;(0,a.getABPropConfigValue)("cag_reactions_receive")&&(p=yield(0,c.getTable)().get(t.toString())),null!=p&&(_=Boolean(p.incognito)&&Boolean(p.defaultSubgroup));const h=_?(0,f.augmentedCagGroupParticipantList)(u,n):n.map((e=>{let{id:t}=e;return t})),g=yield m(h,i);return(0,o.replaceParticipants)({group:t,participants:n,admins:s,deviceIds:g,version:r})}))).apply(this,arguments)}function g(){return(g=(0,i.default)((function*(e){let{group:t,participants:n,version:r,prevVersion:i,isOffline:u}=e;if(null==r)throw new Error("addParticipants: incoming change missing version id");let _=!1,h=!1;const g=t.toString();let y,E;if((0,a.getABPropConfigValue)("cag_reactions_receive")&&(y=yield(0,l.getParticipantTable)().get(g),E=yield(0,c.getTable)().get(g)),y&&E){_=Boolean(E.incognito)&&Boolean(E.defaultSubgroup);const e=(0,d.getMaybeMeUser)();h=y.admins.map((e=>(0,p.createWid)(e))).some((t=>e&&e.equals(t)))}const S=_?(0,f.augmentedCagGroupParticipantList)(h,n):n.map((e=>{let{id:t}=e;return t})),T=yield m(S,u);return(0,o.updateParticipants)(t,{action:s.PARTICIPANT_OPERATION.ADD,participants:n,deviceIds:T,version:r,prevVersion:i},u)}))).apply(this,arguments)}function m(){return y.apply(this,arguments)}function y(){return(y=(0,i.default)((function*(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];if(t)return e.forEach((e=>{u.OfflinePendingDeviceCache.addOfflinePendingDevice(String(e))})),e;n=yield(0,_.syncAndGetDeviceList)(e);let r=[];return n.forEach(((t,n)=>{if(t){const{id:e,devices:n}=t;r=r.concat(n.map((t=>(0,p.createDeviceWidFromDeviceListPk)(e,t))))}else r.push(e[n])})),r}))).apply(this,arguments)}},429267:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.extractDescription=f,t.extractLinkedParent=h,t.parseGroupNode=g,t.queryGroup=function(){return y.apply(this,arguments)};var i=r(n(348926)),a=r(n(81109)),o=n(911794),s=n(738102),l=n(769707),u=n(984330),c=n(355813),d=n(529921),p=n(854379),_=n(669050);function f(e){if(e.hasChild("description")){const t=e.child("description");if(t.hasChild("body")){const e=t.child("body");if(e.hasContent()){const n={desc:e.contentString(),descId:t.attrString("id")};return t.hasAttr("participant")&&(n.descOwner=(0,p.userJidToUserWid)(t.attrUserJid("participant"))),t.hasAttr("t")&&(n.descTime=t.attrTime("t")),n}}}return null}function h(e){const t=e.maybeChild("linked_parent"),n=null==t?void 0:t.maybeAttrGroupJid("jid");return null==n?null:{parentGroup:(0,p.groupJidToWid)(n),parentGroupSubject:null==t?void 0:t.maybeAttrString("subject")}}function g(e){var t,n,r,i,o,s,l,u;const c=f(e),g=function(e){const t={subject:e.attrString("subject")};return e.hasAttr("s_o")&&(t.subjectOwner=(0,p.userJidToUserWid)(e.attrUserJid("s_o"))),e.hasAttr("s_t")&&(t.subjectTime=e.attrTime("s_t")),t}(e),m=function(e){if(e.hasChild("ephemeral")){const t=e.child("ephemeral");if(t.hasAttr("expiration"))return{ephemeralDuration:t.attrInt("expiration")}}return null}(e),y=function(e){const t=e.maybeChild("growth_locked"),n=null==t?void 0:t.maybeAttrInt("expiration"),r=null==t?void 0:t.maybeAttrString("type");return null==n||null==r?null:{growthLockExpiration:n,growthLockType:r}}(e),E=h(e);let S;try{S=(0,_.createWid)(`${e.attrString("id")}@g.us`)}catch(e){}if(!(null===(t=S)||void 0===t?void 0:t.isGroup))throw Error("createGroupReplyParser: invalid group id");const T=e.mapChildrenWithTag("participant",(e=>{const t=e.attrEnumOrDefault("type",d.GROUP_PARTICIPANT_TYPES,d.GROUP_PARTICIPANT_TYPES.participant),n=e.maybeAttrLidUserJid("lid");return{displayName:e.maybeAttrString("display_name"),id:(0,p.userJidToUserWid)(e.attrUserJid("jid")),isSuperAdmin:t===d.GROUP_PARTICIPANT_TYPES.superadmin,isAdmin:t===d.GROUP_PARTICIPANT_TYPES.admin||t===d.GROUP_PARTICIPANT_TYPES.superadmin,lid:null!=n?(0,p.userJidToUserWid)(n):null}}));return(0,a.default)((0,a.default)((0,a.default)((0,a.default)((0,a.default)({id:S,owner:e.hasAttr("creator")?(0,p.userJidToUserWid)(e.attrUserJid("creator")):void 0,creation:e.attrTime("creation"),restrict:e.hasChild("locked"),announce:e.hasChild("announcement"),noFrequentlyForwarded:e.hasChild("no_frequently_forwarded"),participants:T,pvId:e.hasAttr("p_v_id")?e.attrInt("p_v_id"):void 0,support:e.hasChild("support"),size:e.hasAttr("size")?e.attrInt("size"):void 0,suspended:e.hasChild("suspended"),isParentGroup:null!==(n=e.hasChild("parent"))&&void 0!==n?n:void 0,isParentGroupClosed:"request_required"===(null===(r=e.maybeChild("parent"))||void 0===r?void 0:r.maybeAttrString("default_membership_approval_mode")),numSubgroups:null!==(i=null===(o=e.maybeChild("parent"))||void 0===o?void 0:o.maybeAttrInt("num_sub_groups"))&&void 0!==i?i:0,defaultSubgroup:null!==(s=e.hasChild("default_sub_group"))&&void 0!==s?s:void 0,incognito:e.hasChild("incognito"),membershipApprovalMode:"on"===(null==e||null===(l=e.maybeChild("membership_approval_mode"))||void 0===l||null===(u=l.maybeChild("group_join"))||void 0===u?void 0:u.maybeAttrString("state")),membershipApprovalRequest:e.hasChild("membership_approval_request")},c),m),y),g),E)}const m=new l.WapParser("queryGroupParser",(e=>e.hasChild("group")?g(e.child("group")):{phashMatch:!0}));function y(){return(y=(0,i.default)((function*(e){const{groupWid:t,request:n,phash:r}=e,i=(0,s.wap)("iq",{to:(0,c.GROUP_JID)(t),type:"get",xmlns:"w:g2",id:(0,s.generateId)()},(0,s.wap)("query",{request:n||s.DROP_ATTR,phash:(0,s.MAYBE_CUSTOM_STRING)(r)})),a=yield(0,o.deprecatedSendIq)(i,m);if(!a.success)return __LOG__(2)`queryGroup failed: ${a.errorCode}:${a.errorType}`,Promise.reject(new u.ServerStatusCodeError(a.errorCode,a.errorText));const{result:l}=a;return l.phashMatch?Promise.reject(new Error("queryGroup: phash match case is not implemented!")):l}))).apply(this,arguments)}},193970:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.updateDBForGroupAction=function(){return I.apply(this,arguments)};var i=r(n(348926)),a=n(924583),o=r(n(132375)),s=n(990445),l=n(287461),u=n(426717),c=n(565583),d=n(937720),p=n(35665),_=n(667662),f=n(185212),h=n(209639),g=n(297031),m=n(660913),y=n(862159),E=n(789375),S=n(97858),T=n(95589),v=n(44925),A=n(757453),C=n(459857),P=n(824737),O=n(926209);function I(){return(I=(0,i.default)((function*(e,t){var r,i,O,I;let b=arguments.length>2&&void 0!==arguments[2]&&arguments[2];__LOG__(2,void 0,void 0,void 0,["groups"])`inside _handleGroupActionMD`;const{chatId:R,author:N,pushname:w,ts:L=Date.now()/1e3}=e;N&&w&&(0,E.updatePushname)(N,w,b);const D=[],k=n(965012).ChatCollection.get(R);function U(e){return(0,f.persistGroupMetadata)(R,e,b)}switch(t.actionType){case y.GROUP_ACTIONS.ADD:D.push((0,m.addParticipantsJob)(R,t.participants,t.version,t.prevVersion,b).catch((0,a.filteredCatch)(h.GroupUnSyncedError,(()=>{__LOG__(3)`addParticipants: out-of-sync group notification`,M(R,b)})))),(0,l.getABPropConfigValue)("group_join_request_m2")&&D.push((0,u.removeMembershipApprovalRequests)(e.chatId,t.participants.map((e=>e.id))));break;case y.GROUP_ACTIONS.REMOVE:D.push((0,m.removeParticipantsJob)(R,t.participants,L,e.author,t.version,t.prevVersion,t.reason,b).catch((0,a.filteredCatch)(h.GroupUnSyncedError,(()=>{__LOG__(3)`removeParticipants: out-of-sync group notification`,M(R,b)}))));const n=(0,C.getMaybeMeUser)();var G;if(n&&t.participants.find((e=>{let{id:t}=e;return t.equals(n)}))&&((0,A.removeUserSentMessageToChat)(R),(0,c.setAdminshipCache)(R.toString(),!1)),k&&(null===(r=k.groupMetadata)||void 0===r?void 0:r.isLastSubgroup()))D.push(...(0,d.databaseUpdatesForExitedCommunity)(null===(G=k.groupMetadata)||void 0===G?void 0:G.parentGroup));break;case y.GROUP_ACTIONS.DEMOTE:{const e=(0,C.getMaybeMeUser)();e&&t.participants.find((t=>{let{id:n}=t;return n.equals(e)}))&&((0,c.setAdminshipCache)(R.toString(),!1),(0,l.getABPropConfigValue)("group_join_request_m2")&&D.push((0,u.removeAllMembershipApprovalRequests)(R))),D.push((0,m.demoteParticipantsJob)(R,t.participants,t.version,t.prevVersion,b).catch((0,a.filteredCatch)(h.GroupUnSyncedError,(()=>{__LOG__(3)`removeParticipants: out-of-sync group notification`,M(R,b)}))));break}case y.GROUP_ACTIONS.PROMOTE:{const e=(0,C.getMaybeMeUser)();if(e&&t.participants.find((t=>{let{id:n}=t;return n.equals(e)}))){var x;if((0,S.communityAdminPromotionOneTimePromptEnabled)()&&null!=(null==k?void 0:k.groupMetadata)&&(null==k||null===(x=k.groupMetadata)||void 0===x?void 0:x.groupType)===y.GroupType.COMMUNITY){const e=(0,T.getCommunityAdminPromotionNuxKey)(k.groupMetadata.id.toString());(0,v.resetNux)(e)}(0,c.setAdminshipCache)(R.toString(),!0)}D.push((0,m.promoteParticipantsJob)(R,t.participants,t.version,t.prevVersion,b).catch((0,a.filteredCatch)(h.GroupUnSyncedError,(()=>{__LOG__(3)`removeParticipants: out-of-sync group notification`,M(R,b)}))));break}case y.GROUP_ACTIONS.LINKED_GROUP_PROMOTE:{if(!t.jid)break;const e=t.jid;(yield(0,c.isCurrentUserGroupAdmin)(e.toString()))||D.push((0,m.promoteCommunityParticipantsJob)(e,t.participants,b).catch((0,a.filteredCatch)(h.GroupUnSyncedError,(()=>{__LOG__(3)`linkedGroupPromote: out-of-sync group notification`,M(e,b)}))));break}case y.GROUP_ACTIONS.LINKED_GROUP_DEMOTE:{if(!t.jid)break;const e=t.jid;(yield(0,c.isCurrentUserGroupAdmin)(e.toString()))||D.push((0,m.demoteCommunityParticipantsJob)(e,t.participants,b).catch((0,a.filteredCatch)(h.GroupUnSyncedError,(()=>{__LOG__(3)`linkedGroupDemote: out-of-sync group notification`,M(e,b)}))));break}case y.GROUP_ACTIONS.REVOKE_INVITE:const f=null===(i=(0,C.getMaybeMeUser)())||void 0===i?void 0:i.toString();if(!f)return void __LOG__(3)`getMaybeMeUser returned null, can't process action ${t}`;const E=null==N?void 0:N.toString();let w=[];if(null==E)return void __LOG__(3)`Received revoke without an admin jid ${t}`;if(E===f)w=t.participants.map((e=>({from:f,to:e.id.toString(),groupId:R.toString(),expiration:e.expiration})));else{const e=t.participants.find((e=>e.id.toString()===f));if(!e)return __LOG__(4,void 0,new Error,!0)`Received group invite revokation from ${E}, but user not in participants list`,void SEND_LOGS("bad-revoke");w=[{from:E,to:f,groupId:R.toString(),expiration:e.expiration}]}yield Promise.all(w.map((e=>(0,P.revokeGroupInvitesV4)(e.from,e.to,e.groupId,e.expiration))));break;case y.GROUP_ACTIONS.MODIFY:if(1!==t.participants.length){__LOG__(3)`_handleGroupActionMD: participants length should be 1, but is ${t.participants.length}`;break}D.push((0,g.modifyGroupParticipantJob)(R,(0,o.default)(N,"author"),t.participants[0].id,null!==(O=t.prevVersion)&&void 0!==O?O:-1,null!==(I=t.version)&&void 0!==I?I:-1).catch((0,a.filteredCatch)(h.GroupUnSyncedError,(()=>{__LOG__(3)`modifyGroupParticipant: out-of-sync group notification`,M(R,b)}))));break;case y.GROUP_ACTIONS.SUBJECT:D.push(U({subject:t.subject}));break;case y.GROUP_ACTIONS.DESC_ADD:D.push(U({desc:t.desc,descId:t.descId,descTime:t.descTime,descOwner:null==N?void 0:N.toString()}));break;case y.GROUP_ACTIONS.DESC_REMOVE:D.push(U({desc:void 0,descId:void 0,descTime:void 0,descOwner:void 0}));break;case y.GROUP_ACTIONS.RESTRICT:D.push(U({restrict:!!t.value}));break;case y.GROUP_ACTIONS.SUSPEND:D.push(U({suspended:!!t.value}));break;case y.GROUP_ACTIONS.ANNOUNCE:D.push(U({announce:!!t.value}));break;case y.GROUP_ACTIONS.NO_FORWARD:D.push(U({noFrequentlyForwarded:!!t.value}));break;case y.GROUP_ACTIONS.EPHEMERAL:D.push(U({ephemeralDuration:t.duration}));break;case y.GROUP_ACTIONS.INVITE_CODE:case y.GROUP_ACTIONS.DELETE_PARENT_GROUP_UNLINK:break;case y.GROUP_ACTIONS.DELETE:t.reason===y.DELETE_REASON.INTEGRITY_DELETE_PARENT?D.push(...(0,d.databaseUpdatesForIntegrityDeactivateCommunity)(R,b)):t.reason===y.DELETE_REASON.DELETE_PARENT?D.push(...(0,d.databaseUpdatesForDeactivateCommunity)(R,b)):D.push(U({terminated:!0}));break;case y.GROUP_ACTIONS.GROWTH_UNLOCKED:D.push(U({growthLockExpiration:void 0,growthLockType:void 0}));break;case y.GROUP_ACTIONS.GROWTH_LOCKED:"invite"===t.type&&D.push(U({growthLockExpiration:t.expiration,growthLockType:t.type}));break;case y.GROUP_ACTIONS.PARENT_GROUP_LINK:const B=t.groupDatas[0].id;D.push(U({parentGroup:B.toString()}));break;case y.GROUP_ACTIONS.SUB_GROUP_LINK:D.push((0,p.persistCommunityLink)(R,t.groupDatas,_.CommunityLinkOperation.SubGroupLink,b),U({lastActivityTimestamp:(0,s.unixTime)()}));break;case y.GROUP_ACTIONS.SIBLING_GROUP_LINK:D.push((0,p.persistCommunityLink)(R,t.groupDatas,_.CommunityLinkOperation.SiblingGroupLink,b));break;case y.GROUP_ACTIONS.PARENT_GROUP_UNLINK:D.push(U({parentGroup:void 0}));break;case y.GROUP_ACTIONS.SUB_GROUP_UNLINK:D.push((0,p.persistCommunityLink)(R,t.groupDatas,_.CommunityLinkOperation.SubGroupUnlink,b));break;case y.GROUP_ACTIONS.SIBLING_GROUP_UNLINK:D.push((0,p.persistCommunityLink)(R,t.groupDatas,_.CommunityLinkOperation.SiblingGroupUnlink,b));break;case y.GROUP_ACTIONS.MEMBERSHIP_APPROVAL_MODE:(0,l.getABPropConfigValue)("group_join_request_m2")&&(D.push(U({membershipApprovalMode:t.value})),t.value||D.push((0,u.removeAllMembershipApprovalRequests)(R)));break;case y.GROUP_ACTIONS.MEMBERSHIP_APPROVAL_REQUEST:if((0,l.getABPropConfigValue)("group_join_request_m2")){D.push((0,u.addMembershipApprovalRequests)(e.chatId,[{id:(0,o.default)(N,"author"),t:L,addedBy:(0,o.default)(N,"author"),requestMethod:t.requestMethod}]));const n=(0,T.getMembershipApprovalRequestsBannerNuxKey)(e.chatId.toString());(0,v.resetNux)(n)}break;case y.GROUP_ACTIONS.REVOKED_MEMBERSHIP_REQUESTS:(0,l.getABPropConfigValue)("group_join_request_m2")&&D.push((0,u.removeMembershipApprovalRequests)(e.chatId,t.requests));break;default:__LOG__(4,void 0,new Error,void 0,["groups"])`unhandled group notif action in handleGroupActionMD for action ${JSON.stringify(t)}`}yield Promise.all(D),__LOG__(2,void 0,void 0,void 0,["groups"])`finished all storageTasks`}))).apply(this,arguments)}function M(e,t){return t?(0,g.markGroupParticipantStaleJob)(e):(0,O.sendQueryGroup)(e)}},75540:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.parseMsgStubProto=y,t.parseMsgStubTemplate=E,t.parseWebMessageInfo=function(e,t){var n,r;const c=e.key,_=(0,u.decodeJid)(c.remoteJid),E=(0,f.getMaybeMeUser)(),S=c.fromMe?_:E,T=c.fromMe?E:_;let v=(0,u.decodeJid)(c.participant);null==v&&null!=_&&h.default.isWid(_)&&_===(0,g.createWid)(i.PSA_JID)&&(v=(0,g.createWid)(i.PSA_JID));let A=(0,u.decodeJid)(e.participant);(h.default.isGroup(_)||h.default.isStatusV3(_))&&(null==v&&(null!=e.participant?v=(0,u.decodeJid)(e.participant):c.fromMe&&(v=E)),A=A||v);let C,P="in";E.equals(_)&&(P=c.fromMe?"out":"in");if("broadcast"===S)return void __LOG__(3)`drop: broadcast`;try{C=new d.default({fromMe:(0,a.default)(c.fromMe,"key.fromMe"),remote:_,id:(0,a.default)(c.id,"key.id"),participant:v})}catch(e){return void __LOG__(3)`drop: cannot create MsgKey: ${e.stack}`}let O=!1;O=e.reactions.some((e=>null!=e.text));const I={id:C,from:T,to:S,self:P,participant:v,type:"unknown",t:e.messageTimestamp||0,ack:"fresh"===t?o.ACK.SENT:e.status-1,author:A,invis:!!e.ignore,star:!!e.starred,broadcast:c.fromMe&&e.broadcast,notifyName:e.pushName||"",encFilehash:(0,l.decodeBytes)(e.mediaCiphertextSha256),shareDuration:e.duration,labels:e.labels,ephemeralStartTimestamp:e.ephemeralStartTimestamp,ephemeralOutOfSync:e.ephemeralOutOfSync,bizPrivacyStatus:e.bizPrivacyStatus,verifiedBizName:e.verifiedBizName,reactions:e.reactions,hasReaction:O,agentId:e.agentId,revokeTimestamp:e.revokeMessageTimestamp,kicKey:void 0,kicState:void 0,pollInvalidated:null!==(n=(0,p.isPollsReceivingEnabled)()&&!0===(null===(r=e.pollAdditionalMetadata)||void 0===r?void 0:r.pollInvalidated))&&void 0!==n?n:void 0,originalSelfAuthor:(0,u.decodeJid)(e.originalSelfAuthorUserJidString),kicTimestampMs:void 0};if(null!=e.keepInChat)try{const t=(0,m.parseKeepInChatHistorySyncMessage)(e);null!=t&&Object.assign(I,t)}catch(e){__LOG__(3)`parseWebMessageInfo: KIC fields are malformed`}if(e.message)return(0,s.parseMsgProto)(e.message,I,t,e.paymentInfo,e.finalLiveLocation,e.quotedPaymentInfo);return y(e,I)};var i=n(616310),a=r(n(132375)),o=n(402994),s=n(740293),l=n(21094),u=n(523930),c=n(97858),d=r(n(565754)),p=n(671598),_=n(968923),f=n(459857),h=r(n(124928)),g=n(669050),m=n(30287);function y(e,t){if(null==e.messageStubType)return;const n=_.WebMessageInfo$StubType;switch(e.messageStubType){case n.REVOKE:return t.type="revoked",t.subtype="sender",t;case n.CIPHERTEXT:return t.type="ciphertext",t;case n.OVERSIZED:return t.type="oversized",t;case n.FUTUREPROOF:return t.subtype="phone",t;default:return E(e,t)}}function E(e,t){var n;if(null==e.messageStubType)return;const r=_.WebMessageInfo$StubType;switch(t.type="notification_template",t.templateParams=Array.isArray(e.messageStubParameters)?e.messageStubParameters.map((t=>e.messageStubType===r.GROUP_CREATE||e.messageStubType===r.GROUP_CHANGE_SUBJECT?t:(0,u.decodeJid)(t))):void 0,e.messageStubType){case r.NON_VERIFIED_TRANSITION:t.subtype="non_verified_transition";break;case r.UNVERIFIED_TRANSITION:t.subtype="unverified_transition";break;case r.VERIFIED_TRANSITION:t.subtype="verified_transition";break;case r.VERIFIED_LOW_UNKNOWN:t.subtype="verified_low_unknown";break;case r.VERIFIED_HIGH:t.subtype="verified_high";break;case r.VERIFIED_INITIAL_UNKNOWN:t.subtype="verified_initial_unknown";break;case r.VERIFIED_INITIAL_LOW:t.subtype="verified_initial_low";break;case r.VERIFIED_INITIAL_HIGH:t.subtype="verified_initial_high";break;case r.VERIFIED_TRANSITION_ANY_TO_NONE:t.subtype="verified_transition_any_to_none";break;case r.VERIFIED_TRANSITION_ANY_TO_HIGH:t.subtype="verified_transition_any_to_high";break;case r.VERIFIED_TRANSITION_HIGH_TO_LOW:t.subtype="verified_transition_high_to_low";break;case r.VERIFIED_TRANSITION_HIGH_TO_UNKNOWN:t.subtype="verified_transition_high_to_unknown";break;case r.VERIFIED_TRANSITION_UNKNOWN_TO_LOW:t.subtype="verified_transition_unknown_to_low";break;case r.VERIFIED_TRANSITION_LOW_TO_UNKNOWN:t.subtype="verified_transition_low_to_unknown";break;case r.VERIFIED_TRANSITION_NONE_TO_LOW:t.subtype="verified_transition_none_to_low";break;case r.VERIFIED_TRANSITION_NONE_TO_UNKNOWN:t.subtype="verified_transition_none_to_unknown";break;case r.GROUP_CREATE:t.type="gp2",t.subtype="create",t.body=t.templateParams[0],t.templateParams=void 0;break;case r.GROUP_DELETE:t.type="gp2",t.subtype="delete",t.templateParams=void 0;break;case r.GROUP_CHANGE_SUBJECT:t.type="gp2",t.subtype="subject",t.body=t.templateParams[0],t.templateParams=void 0;break;case r.GROUP_CHANGE_ICON:t.type="gp2",t.subtype="picture",t.body=t.templateParams[0],t.templateParams=void 0;break;case r.GROUP_CHANGE_INVITE_LINK:t.type="gp2",t.subtype="revoke_invite";break;case r.GROUP_CHANGE_DESCRIPTION:t.type="gp2",t.subtype="description";break;case r.GROUP_CHANGE_RESTRICT:t.type="gp2",t.subtype="restrict",t.body=t.templateParams[0];break;case r.GROUP_CHANGE_ANNOUNCE:t.type="gp2",t.subtype="announce",t.body=t.templateParams[0];break;case r.GROUP_CHANGE_NO_FREQUENTLY_FORWARDED:t.type="gp2",t.subtype="no_frequently_forwarded",t.body=t.templateParams[0];break;case r.GROUP_ANNOUNCE_MODE_MESSAGE_BOUNCE:t.type="gp2",t.subtype="announce_msg_bounce",t.templateParams=void 0;break;case r.GROUP_PARTICIPANT_ADD:t.type="gp2",t.subtype="add",t.recipients=t.templateParams,t.templateParams=void 0,t.author===t.participant&&(t.author=void 0);break;case r.GROUP_PARTICIPANT_REMOVE:t.type="gp2",t.subtype="remove",t.recipients=t.templateParams,t.templateParams=void 0;break;case r.GROUP_PARTICIPANT_PROMOTE:t.type="gp2",t.subtype="promote",t.recipients=t.templateParams,t.templateParams=void 0;break;case r.GROUP_PARTICIPANT_DEMOTE:t.type="gp2",t.subtype="demote",t.recipients=t.templateParams,t.templateParams=void 0;break;case r.GROUP_PARTICIPANT_INVITE:t.type="gp2",t.subtype="invite",t.recipients=t.templateParams,t.templateParams=void 0;break;case r.GROUP_PARTICIPANT_LEAVE:t.type="gp2",t.subtype="leave",t.recipients=t.templateParams;const i=(null!==(n=t.recipients)&&void 0!==n?n:[]).find((e=>h.default.isLid(e)));null!=i&&(__LOG__(4,void 0,new Error,!0,["pnh-cag"])`Found lid ${(0,g.createWidFromWidLike)(i).getUserPartForLog()} in group participant leave msg`,SEND_LOGS("Found lid in group participant leave msg during history sync")),t.templateParams=void 0;break;case r.GROUP_PARTICIPANT_CHANGE_NUMBER:t.type="gp2",t.subtype="modify",t.recipients=t.templateParams,t.templateParams=void 0;break;case r.GROUP_V4_ADD_INVITE_SENT:t.type="gp2",t.subtype="v4_add_invite_sent",t.recipients=t.templateParams,t.templateParams=void 0;break;case r.GROUP_PARTICIPANT_ADD_REQUEST_JOIN:t.type="gp2",t.subtype="v4_add_invite_join",t.recipients=t.templateParams,t.templateParams=void 0;break;case r.GROUP_INVITE_LINK_GROWTH_LOCKED:t.type="gp2",t.subtype="true"===t.templateParams[0]?"growth_locked":"growth_unlocked",t.body="invite",t.templateParams=void 0;break;case r.GROUP_PARTICIPANT_LINKED_GROUP_JOIN:t.type="gp2",t.subtype="linked_group_join",t.recipients=t.templateParams,t.templateParams=void 0;break;case r.BROADCAST_CREATE:t.type="broadcast_notification",t.subtype="create",t.body=t.templateParams[0]||"0",t.templateParams=void 0;break;case r.BROADCAST_ADD:t.type="broadcast_notification",t.subtype="add",t.recipients=t.templateParams,t.templateParams=void 0;break;case r.BROADCAST_REMOVE:t.type="broadcast_notification",t.subtype="remove",t.recipients=t.templateParams,t.templateParams=void 0;break;case r.GENERIC_NOTIFICATION:t.type="notification",t.body=t.templateParams[0],t.templateParams=void 0;break;case r.E2E_IDENTITY_CHANGED:t.type="e2e_notification",t.subtype="identity",t.body=t.templateParams[0]instanceof h.default?t.templateParams[0].toString():t.templateParams[0],t.templateParams=void 0;break;case r.E2E_IDENTITY_UNAVAILABLE:t.type="e2e_notification",t.subtype="e2e_identity_unavailable";break;case r.CHAT_PSA:t.type="e2e_notification",t.subtype="chat_psa";break;case r.E2E_DEVICE_CHANGED:t.type="e2e_notification",t.subtype="device",t.body=t.templateParams[0]instanceof h.default?t.templateParams[0].toString():t.templateParams[0],t.devicesAdded=parseInt(t.templateParams[1],10),t.devicesRemoved=parseInt(t.templateParams[2],10),t.templateParams=void 0;break;case r.E2E_ENCRYPTED:t.type="e2e_notification",t.subtype="encrypt";break;case r.E2E_ENCRYPTED_NOW:t.type="e2e_notification",t.subtype="encrypt_now";break;case r.CALL_MISSED_VOICE:t.type="call_log",t.subtype="miss";break;case r.CALL_MISSED_VIDEO:t.type="call_log",t.subtype="miss_video";break;case r.CALL_MISSED_GROUP_VOICE:t.type="call_log",t.subtype="miss_group";break;case r.CALL_MISSED_GROUP_VIDEO:t.type="call_log",t.subtype="miss_group_video";break;case r.INDIVIDUAL_CHANGE_NUMBER:t.subtype="change_number";break;case r.MASKED_THREAD_CREATED:t.subtype="masked_thread_created";break;case r.CAG_MASKED_THREAD_CREATED:t.subtype="cag_masked_thread_created";break;case r.CHANGE_EPHEMERAL_SETTING:t.type="gp2",t.subtype="ephemeral",t.author=t.templateParams[1];break;case r.PAYMENT_CIPHERTEXT:t.type="payment",t.subtype="ciphertext",(0,u.parseMsgPaymentInfo)(t,e.paymentInfo);break;case r.PAYMENT_FUTUREPROOF:t.type="payment",t.subtype="futureproof",(0,u.parseMsgPaymentInfo)(t,e.paymentInfo);break;case r.PAYMENT_ACTION_REQUEST_CANCELLED:t.subtype="payment_transaction_request_cancelled";break;case r.PAYMENT_TRANSACTION_STATUS_UPDATE_FAILED:t.subtype="payment_transaction_status_update_failed";break;case r.PAYMENT_TRANSACTION_STATUS_UPDATE_REFUNDED:t.subtype="payment_transaction_status_update_refunded";break;case r.PAYMENT_TRANSACTION_STATUS_UPDATE_REFUND_FAILED:t.subtype="payment_transaction_status_update_refund_failed";break;case r.PAYMENT_TRANSACTION_STATUS_RECEIVER_PENDING_SETUP:t.subtype="payment_transaction_status_receiver_pending_setup";break;case r.PAYMENT_TRANSACTION_STATUS_RECEIVER_SUCCESS_AFTER_HICCUP:t.subtype="payment_transaction_status_receiver_success_after_hiccup";break;case r.PAYMENT_ACTION_ACCOUNT_SETUP_REMINDER:t.subtype="payment_action_account_setup_reminder";break;case r.PAYMENT_ACTION_SEND_PAYMENT_REMINDER:t.subtype="payment_action_send_payment_reminder";break;case r.PAYMENT_ACTION_SEND_PAYMENT_INVITATION:t.subtype="payment_action_send_payment_invitation";break;case r.PAYMENT_ACTION_REQUEST_DECLINED:t.subtype="payment_action_request_declined";break;case r.PAYMENT_ACTION_REQUEST_EXPIRED:t.subtype="payment_action_request_expired";break;case r.BIZ_VERIFIED_TRANSITION_TOP_TO_BOTTOM:t.subtype="biz_verified_transition_top_to_bottom";break;case r.BIZ_VERIFIED_TRANSITION_BOTTOM_TO_TOP:t.subtype="biz_verified_transition_bottom_to_top";break;case r.BIZ_INTRO_TOP:t.subtype="biz_intro_top";break;case r.BIZ_INTRO_BOTTOM:t.subtype="biz_intro_bottom";break;case r.BIZ_NAME_CHANGE:t.subtype="biz_name_change";break;case r.BIZ_MOVE_TO_CONSUMER_APP:t.subtype="biz_move_to_consumer_app";break;case r.BIZ_TWO_TIER_MIGRATION_TOP:t.subtype="biz_two_tier_migration_top";break;case r.BIZ_TWO_TIER_MIGRATION_BOTTOM:t.subtype="biz_two_tier_migration_bottom";break;case r.BLUE_MSG_BSP_FB_TO_BSP_PREMISE:t.subtype="blue_msg_bsp_fb_to_bsp_premise";break;case r.BLUE_MSG_BSP_FB_TO_SELF_FB:t.subtype="blue_msg_bsp_fb_to_self_fb";break;case r.BLUE_MSG_BSP_FB_TO_SELF_PREMISE:t.subtype="blue_msg_bsp_fb_to_self_premise";break;case r.BLUE_MSG_BSP_FB_UNVERIFIED:t.subtype="blue_msg_bsp_fb_unverified";break;case r.BLUE_MSG_BSP_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED:t.subtype="blue_msg_bsp_fb_unverified_to_bsp_premise_verified";break;case r.BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_FB_VERIFIED:t.subtype="blue_msg_bsp_fb_unverified_to_self_fb_verified";break;case r.BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED:t.subtype="blue_msg_bsp_fb_unverified_to_self_premise_verified";break;case r.BLUE_MSG_BSP_FB_VERIFIED:t.subtype="blue_msg_bsp_fb_verified";break;case r.BLUE_MSG_BSP_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED:t.subtype="blue_msg_bsp_fb_verified_to_bsp_premise_unverified";break;case r.BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_FB_UNVERIFIED:t.subtype="blue_msg_bsp_fb_verified_to_self_fb_unverified";break;case r.BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED:t.subtype="blue_msg_bsp_fb_verified_to_self_premise_unverified";break;case r.BLUE_MSG_BSP_PREMISE_TO_SELF_PREMISE:t.subtype="blue_msg_bsp_premise_to_self_premise";break;case r.BLUE_MSG_BSP_PREMISE_UNVERIFIED:t.subtype="blue_msg_bsp_premise_unverified";break;case r.BLUE_MSG_BSP_PREMISE_UNVERIFIED_TO_SELF_PREMISE_VERIFIED:t.subtype="blue_msg_bsp_premise_unverified_to_self_premise_verified";break;case r.BLUE_MSG_BSP_PREMISE_VERIFIED:t.subtype="blue_msg_bsp_premise_verified";break;case r.BLUE_MSG_BSP_PREMISE_VERIFIED_TO_SELF_PREMISE_UNVERIFIED:t.subtype="blue_msg_bsp_premise_verified_to_self_premise_unverified";break;case r.BLUE_MSG_CONSUMER_TO_BSP_FB_UNVERIFIED:t.subtype="blue_msg_consumer_to_bsp_fb_unverified";break;case r.BLUE_MSG_CONSUMER_TO_BSP_PREMISE_UNVERIFIED:t.subtype="blue_msg_consumer_to_bsp_premise_unverified";break;case r.BLUE_MSG_CONSUMER_TO_SELF_FB_UNVERIFIED:t.subtype="blue_msg_consumer_to_self_fb_unverified";break;case r.BLUE_MSG_CONSUMER_TO_SELF_PREMISE_UNVERIFIED:t.subtype="blue_msg_consumer_to_self_premise_unverified";break;case r.BLUE_MSG_SELF_FB_TO_BSP_PREMISE:t.subtype="blue_msg_self_fb_to_bsp_premise";break;case r.BLUE_MSG_SELF_FB_TO_SELF_PREMISE:t.subtype="blue_msg_self_fb_to_self_premise";break;case r.BLUE_MSG_SELF_FB_UNVERIFIED:t.subtype="blue_msg_self_fb_unverified";break;case r.BLUE_MSG_SELF_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED:t.subtype="blue_msg_self_fb_unverified_to_bsp_premise_verified";break;case r.BLUE_MSG_SELF_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED:t.subtype="blue_msg_self_fb_unverified_to_self_premise_verified";break;case r.BLUE_MSG_SELF_FB_VERIFIED:t.subtype="blue_msg_self_fb_verified";break;case r.BLUE_MSG_SELF_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED:t.subtype="blue_msg_self_fb_verified_to_bsp_premise_unverified";break;case r.BLUE_MSG_SELF_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED:t.subtype="blue_msg_self_fb_verified_to_self_premise_unverified";break;case r.BLUE_MSG_SELF_PREMISE_TO_BSP_PREMISE:t.subtype="blue_msg_self_premise_to_bsp_premise";break;case r.BLUE_MSG_SELF_PREMISE_UNVERIFIED:t.subtype="blue_msg_self_premise_unverified";break;case r.BLUE_MSG_SELF_PREMISE_VERIFIED:t.subtype="blue_msg_self_premise_verified";break;case r.BLUE_MSG_TO_BSP_FB:t.subtype="blue_msg_to_bsp_fb";break;case r.BLUE_MSG_TO_CONSUMER:t.subtype="blue_msg_to_consumer";break;case r.BLUE_MSG_TO_SELF_FB:t.subtype="blue_msg_to_self_fb";break;case r.BLUE_MSG_UNVERIFIED_TO_BSP_FB_VERIFIED:t.subtype="blue_msg_unverified_to_bsp_fb_verified";break;case r.BLUE_MSG_UNVERIFIED_TO_BSP_PREMISE_VERIFIED:t.subtype="blue_msg_unverified_to_bsp_premise_verified";break;case r.BLUE_MSG_UNVERIFIED_TO_SELF_FB_VERIFIED:t.subtype="blue_msg_unverified_to_self_fb_verified";break;case r.BLUE_MSG_UNVERIFIED_TO_VERIFIED:t.subtype="blue_msg_unverified_to_verified";break;case r.BLUE_MSG_VERIFIED_TO_BSP_FB_UNVERIFIED:t.subtype="blue_msg_verified_to_bsp_fb_unverified";break;case r.BLUE_MSG_VERIFIED_TO_BSP_PREMISE_UNVERIFIED:t.subtype="blue_msg_verified_to_bsp_premise_unverified";break;case r.BLUE_MSG_VERIFIED_TO_SELF_FB_UNVERIFIED:t.subtype="blue_msg_verified_to_self_fb_unverified";break;case r.BLUE_MSG_VERIFIED_TO_UNVERIFIED:t.subtype="blue_msg_verified_to_unverified";break;case r.BIZ_PRIVACY_MODE_INIT_FB:t.subtype="biz_privacy_mode_init_fb";break;case r.BIZ_PRIVACY_MODE_INIT_BSP:t.subtype="biz_privacy_mode_init_bsp";break;case r.BIZ_PRIVACY_MODE_TO_FB:t.subtype="biz_privacy_mode_to_fb";break;case r.BIZ_PRIVACY_MODE_TO_BSP:t.subtype="biz_privacy_mode_to_bsp";break;case r.DISAPPEARING_MODE:t.subtype="disappearing_mode";break;case r.BLOCK_CONTACT:t.subtype="block_contact";break;case r.ADMIN_REVOKE:(0,c.adminRevokeHistorySyncConsumerEnabled)()&&(t.type="revoked",t.subtype="admin",t.revokeSender=t.templateParams[1]instanceof h.default?t.templateParams[1]:void 0,t.revokeSender||__LOG__(2)`ProtocolParser: admin revoke came without admin JID`),t.templateParams=void 0;break;case r.COMMUNITY_LINK_PARENT_GROUP:t.type="gp2",t.subtype="parent_group_link";break;case r.COMMUNITY_LINK_SIBLING_GROUP:t.type="gp2",t.subtype="sibling_group_link";break;case r.COMMUNITY_LINK_SUB_GROUP:t.type="gp2",t.subtype="sub_group_link";break;case r.COMMUNITY_CREATE:t.type="gp2",t.subtype="community_create";break;case r.COMMUNITY_UNLINK_PARENT_GROUP:t.type="gp2",t.subtype="parent_group_unlink";break;case r.INTEGRITY_UNLINK_PARENT_GROUP:t.type="gp2",t.subtype="integrity_parent_group_unlink";break;case r.COMMUNITY_UNLINK_SIBLING_GROUP:t.type="gp2",t.subtype="sibling_group_unlink";break;case r.COMMUNITY_UNLINK_SUB_GROUP:t.type="gp2",t.subtype="sub_group_unlink";break;case r.COMMUNITY_PARTICIPANT_PROMOTE:t.type="gp2",t.subtype="linked_group_promote",t.recipients=t.templateParams,t.templateParams=void 0;break;case r.COMMUNITY_PARTICIPANT_DEMOTE:t.type="gp2",t.subtype="linked_group_demote",t.recipients=t.templateParams,t.templateParams=void 0;break;case r.EPHEMERAL_KEEP_IN_CHAT:t.type="gp2",t.subtype="ephemeral_keep_in_chat";break;case r.GROUP_MEMBERSHIP_JOIN_APPROVAL_MODE:t.type="gp2",t.subtype="membership_approval_mode";break;case r.GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST:t.type="gp2",t.subtype="membership_approval_request";break;case r.COMMUNITY_LINK_PARENT_GROUP_MEMBERSHIP_APPROVAL:t.type="gp2",t.subtype="parent_group_link_membership_approval";break;case r.GROUP_PARTICIPANT_JOINED_GROUP_AND_PARENT_GROUP:t.type="gp2",t.subtype="auto_add";break;case r.COMMUNITY_PARENT_GROUP_DELETED:t.type="gp2",t.subtype="delete_parent_group";break;case r.BIZ_CHAT_ASSIGNMENT:t.subtype="chat_assignment";break;case r.BIZ_CHAT_ASSIGNMENT_UNASSIGN:t.subtype="chat_assignment_unassign";break;case r.COMMUNITY_PARENT_GROUP_SUBJECT_CHANGED:t.type="gp2",t.subtype="subject",t.body=t.templateParams[1];break;case r.CAG_INVITE_AUTO_ADD:t.type="gp2",t.subtype="invite_auto_add",t.recipients=[(0,f.getMaybeMeUser)()];break;case r.CAG_INVITE_AUTO_JOINED:t.type="gp2",t.subtype="invite_auto_add",t.recipients=t.templateParams,t.templateParams=void 0;break;default:t.templateParams=void 0}return t}},469422:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getAllIdentityKeysBytes=c,t.getAllIdentityKeysBytesOrThrow=function(){return u.apply(this,arguments)},t.identityKeysToBinary=function(e){const t=new a.Binary;return e.sort(l).forEach((e=>{t.writeByteArray(e)})),t.readByteArray()};var i=r(n(348926)),a=n(551168),o=n(999821),s=r(n(9705));function l(e,t){for(let n=0;n<e.length&&n<t.length;++n)if(e[n]!==t[n])return e[n]-t[n];return e.length-t.length}function u(){return(u=(0,i.default)((function*(e){return(yield c(e)).map(((t,n)=>{if(null==t)throw new Error(`getAllIdentityKeys: missing identity key for device ${String(e[n])}`);return t}))}))).apply(this,arguments)}function c(){return d.apply(this,arguments)}function d(){return(d=(0,i.default)((function*(e){return(yield s.default.bulkLoadIdentityKey(e.map((e=>(0,o.createSignalAddress)(e).toString())))).map((e=>null==e?null:new Uint8Array((0,o.strToBuffer)(e))))}))).apply(this,arguments)}},74869:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.clearDeviceRecordForIdentityChange=y,t.handleNewIdentity=function(){return m.apply(this,arguments)};var i=r(n(348926)),a=n(616310),o=n(52866),s=n(308772),l=n(866729),u=n(359987),c=n(476462),d=n(714443),p=n(605316),_=r(n(124928)),f=n(669050),h=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=g(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(280464));function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(g=function(e){return e?n:t})(e)}function m(){return(m=(0,i.default)((function*(e){var t;const r=self.libsignal.SignalProtocolAddress.fromString(e).getName(),i=_.default.isLid(r)?(0,f.createWid)(r):(0,f.createWid)((0,d.toPhoneUserJid)(r)),s=null!==(t=i.device)&&void 0!==t?t:a.DEFAULT_DEVICE_ID,l=(0,f.toUserWid)(i);if(s===a.DEFAULT_DEVICE_ID){{const{Voip:e}=yield Promise.resolve().then(n.bind(n,961745));e.notifyDeviceIdentityChangedOrDeleted(i,!0)}const e=n(944641).addSecurityCodeChangedNotifications;yield y(l),yield e(l),(0,u.frontendFireAndForget)("sendTcTokenWhenDeviceIdentityChange",{chatId:l})}else yield(0,o.createAndStoreDeviceNotifications)(l,[s],[s])}))).apply(this,arguments)}function y(){return E.apply(this,arguments)}function E(){return(E=(0,i.default)((function*(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=[a.DEFAULT_DEVICE_ID],i=[a.DEFAULT_DEVICE_ID];if(t)null==h||h.OfflinePendingDeviceCache.addOfflinePendingDevice(String(e),null),yield(0,p.getStorage)().lock(["participant"],(()=>(0,s.updateGroupParticipantsInTransaction)(e,i,r)));else{const t=yield(0,l.getDeviceRecord)(e);t&&!t.deleted&&t.devices.forEach((e=>{e.id!==a.DEFAULT_DEVICE_ID&&r.push(e.id)}));const o=n(138706).Session;Promise.all(r.map((t=>t===a.DEFAULT_DEVICE_ID?Promise.resolve():o.deleteRemoteInfo((0,f.createDeviceWidFromUserAndDevice)(e.user,e.server,t))))),yield Promise.all([(0,p.getStorage)().lock(["participant"],(()=>(0,s.updateGroupParticipantsInTransaction)(e,i,r))),(0,l.createOrReplaceDeviceRecord)({id:(0,c.createDeviceListPK)(e),deleted:!0})])}}))).apply(this,arguments)}},358891:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.computeIdentityHash=S,t.getICDCMeta=function(){return m.apply(this,arguments)},t.getICDCMetaFromDeviceRecord=y;var i=r(n(348926)),a=n(638778),o=n(616310),s=r(n(132375)),l=n(350856),u=n(990445),c=n(287461),d=n(866729),p=n(403206),_=n(469422),f=r(n(9705)),h=n(459857),g=n(669050);function m(){return(m=(0,i.default)((function*(e){const t=yield(0,d.getDeviceRecord)(e);return!t||t.deleted?null:y(e,t)}))).apply(this,arguments)}function y(){return E.apply(this,arguments)}function E(){return(E=(0,i.default)((function*(e,t){if(!t||t.deleted)return null;const n={keyHash:void 0,timestamp:void 0},{timestamp:r,devices:i,id:a}=t,l=i.some((e=>e.id!==o.DEFAULT_DEVICE_ID));if(l){const t=i.map((e=>[e.keyIndex,(0,g.createDeviceWidFromDeviceListPk)(a,e.id)])),r=[];let o=null;t.forEach((e=>{let[t,n]=e;(0,h.isMeDevice)(n)?o=t:r.push([t,n])}));const l=yield(0,_.getAllIdentityKeysBytes)(r.map((e=>{let[,t]=e;return t}))),u=[],c=[];if(l.forEach(((e,t)=>{null!=e&&(u.push(e),c.push(r[t][0]))})),(0,h.isMeAccount)(e)){const e=yield f.default.getIdentityKeyPair();if(!e)return null;u.push(new Uint8Array(e.pubKey)),c.push((0,s.default)(o,"myKeyIndex"))}const d=v();n.keyHash=yield S(u.map((e=>new Uint8Array((0,p.toCurveKeyPubKey)(e.buffer)))),d),c.length!==i.length&&(n.keyIndexes=c)}return(l||A(r))&&(n.timestamp=r),n}))).apply(this,arguments)}function S(){return T.apply(this,arguments)}function T(){return(T=(0,i.default)((function*(e,t){const n=(0,_.identityKeysToBinary)(e),r=yield(0,a.sha256)(n),i=new Uint8Array(r);return(0,l.sliceBytes)(i,0,t)}))).apply(this,arguments)}function v(){const e=(0,c.getABPropConfigValue)("md_icdc_hash_length");return Math.max(e,8)}function A(e){return(0,u.unixTime)()-e<2592e3}},715118:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.bulkApplyDeviceUpdate=function(){return S.apply(this,arguments)},t.clearDeviceRecord=function(){return E.apply(this,arguments)};var i=r(n(348926)),a=r(n(291966)),o=n(616310),s=n(525178),l=n(52866),u=n(308772),c=n(866729),d=n(653076),p=n(359987),_=n(890490),f=n(6007),h=n(476462),g=n(800321),m=n(459857),y=n(669050);function E(){return(E=(0,i.default)((function*(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];yield Promise.all(t.filter((e=>e.id!==o.DEFAULT_DEVICE_ID)).map((t=>A((0,y.createDeviceWidFromUserAndDevice)(e.user,e.server,t.id)))));const r=[],a=t.map((e=>e.id)).filter((e=>e!==o.DEFAULT_DEVICE_ID)),{encryptedNotifications:s,chatIds:l}=yield T([{wid:e,added:r,removed:a,isNewRecord:!1}],n);yield(0,d.getDeviceUpdateLock)((0,i.default)((function*(){const t=s.length>0?(0,f.storeEncryptedDBMessages)(s,l,!1):Promise.resolve(),n=(0,u.updateGroupParticipantsInTransaction)(e,r,a),i=(0,c.createOrReplaceDeviceRecord)({id:(0,h.createDeviceListPK)(e),deleted:!0}).catch((()=>{throw __LOG__(4,!0,new Error,!0)`remove from device list table failed`,SEND_LOGS("remove from device list table failed when clearing device record"),new Error("remove from device list table failed")}));yield Promise.all([t,n,i])})),s.length>0)}))).apply(this,arguments)}function S(){return(S=(0,i.default)((function*(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=[],r=[];let l=!1;e.forEach((e=>{let{wid:t,update:i,currentRecord:s}=e;const{devices:u}=i,c=u.map((e=>e.id)),d=s&&!s.deleted?s.devices.map((e=>e.id)):[],p=(0,a.default)(c,d).filter((e=>e!==o.DEFAULT_DEVICE_ID)),_=(0,a.default)(d,c).filter((e=>e!==o.DEFAULT_DEVICE_ID));n.push({wid:t,added:p,removed:_,isNewRecord:null==s}),_.forEach((e=>{r.push((0,y.createDeviceWidFromUserAndDevice)(t.user,t.server,e))})),(0,h.createDeviceListPK)(t)===(0,h.createDeviceListPK)((0,m.getMeUser)())&&_.length>0&&(l=!0)}));const{encryptedNotifications:p,chatIds:_}=yield T(n,t);Promise.all(r.map((e=>A(e)))),yield(0,d.getDeviceUpdateLock)((0,i.default)((function*(){const t=p.length>0?(0,f.storeEncryptedDBMessages)(p,_,!1):Promise.resolve(),r=(0,u.bulkUpdateGroupParticipantsInTransaction)(n),i=(0,c.bulkCreateOrReplaceDeviceRecord)(e.map((e=>e.update))).catch((()=>{throw __LOG__(4,!0,new Error,!0)`bulkCreateOrReplace into device list table failed`,SEND_LOGS("bulkCreateOrReplace into device list table failed when applying device update"),new Error("bulkCreateOrReplace into device list table failed")})),a=l?i.then((()=>(0,s.updateMissingKeyDevices)().catch((e=>{__LOG__(3)`syncd: updateMissingKeyDevices failed with error:
${e}`})))):Promise.resolve();yield Promise.all([t,r,i,a])})),p.length>0,l)}))).apply(this,arguments)}function T(){return v.apply(this,arguments)}function v(){return(v=(0,i.default)((function*(e,t){const{notifications:n,chatIds:r}=yield(0,l.bulkGenerateDeviceNotifications)(e);if(!t){const e=yield(0,_.encryptMultipleDBMsgs)(n);return P(n),{chatIds:r,encryptedNotifications:e}}return(0,g.getMessageCache)().addMessages(n.map((e=>({msg:e}))),!1),{chatIds:[],encryptedNotifications:[]}}))).apply(this,arguments)}function A(){return C.apply(this,arguments)}function C(){return(C=(0,i.default)((function*(e){const{deleteDeviceSenderKey:t,deleteRemoteInfo:r}=n(743275);try{yield Promise.all([r(e),t(e)])}catch(t){__LOG__(2)`handleDevicesNotification: failed to clean the signal info for ${e.user}`}}))).apply(this,arguments)}function P(e){return Promise.all(e.map((e=>(e.recvFresh=!0,e.isNewMsg=!0,(0,p.frontendSendAndReceive)("processMultipleMessages",{chatId:e.from,msgObjs:[e],meta:{add:"after",isHistory:!1}})))))}},76833:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.processKeyBundles=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(616310),o=n(316860),s=n(138706),l=n(999821),u=r(n(9705));function c(){return(c=(0,i.default)((function*(e){let t=null,n=0,r=0;const c=new o.PromiseQueue;if(c.enqueue((0,i.default)((function*(){const i=[],o=[];if(e.forEach((e=>{e instanceof Error?(__LOG__(3)`establishE2ESession: error: ${e}`,t=e):(null!=e.wid.device&&e.wid.device!==a.DEFAULT_DEVICE_ID?o.push(e):i.push(e),e.key||n++)})),0===i.length&&0===o.length)throw new Error("establishE2ESession: no keys in the response");try{const e=[...i,...o].map((e=>(0,l.createSignalAddress)(e.wid).toString()));yield u.default.bulkLoadIdentityKey(e),__LOG__(2)`establishE2ESession: warmed up identity cache: ${e.length} records`}catch(e){__LOG__(3)`establishE2ESession: failed to warm up identity cache: ${e}`}const c=e=>s.Session.createSignalSession(e).then((()=>{r++})).catch((t=>{__LOG__(4,void 0,new Error,!0)`createSignalSession: failed for device ${e.wid} with error ${t}`,SEND_LOGS("createSignalSession-fail")}));yield Promise.all(i.map((e=>c(e)))),yield Promise.all(o.map((e=>c(e))))}))).catch((e=>{__LOG__(3)`createSignalSession: error: ${e}`,t=e})),yield c.wait(),null!=t)throw t;return{depletedPrekeyCount:n,processedPrekeyCount:r}}))).apply(this,arguments)}},944641:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addSecurityCodeChangedNotifications=function(){return _.apply(this,arguments)};var i=r(n(348926)),a=n(359987),o=n(389293),s=n(890490),l=n(6007),u=n(800321),c=n(76469),d=n(117429),p=n(669050);function _(){return(_=(0,i.default)((function*(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{notifications:n,chatIds:r}=yield f(e);if(0!==n.length){if(!t){Promise.all(n.map((e=>(e.recvFresh=!0,e.isNewMsg=!0,(0,a.frontendSendAndReceive)("processMultipleMessages",{chatId:e.from,msgObjs:[e],meta:{add:"after",isHistory:!1}})))));const e=yield(0,s.encryptMultipleDBMsgs)(n);return(0,l.storeEncryptedDBMessages)(e,r,!1)}(0,u.getMessageCache)().addMessages(n.map((e=>({msg:e}))),!1)}}))).apply(this,arguments)}function f(){return h.apply(this,arguments)}function h(){return(h=(0,i.default)((function*(e){const t={notifications:[],chatIds:[]};if(!(0,d.getGlobalSecurityNotifications)())return t;let n=[];try{const t=yield(0,c.getChatTable)().get(String(e));n=(yield(0,c.getParticipantTable)().equals(["participants"],String(e))).map((e=>(0,p.createWid)(e.groupId))),t&&n.push((0,p.createWid)(t.id))}catch(e){throw __LOG__(4,!0,new Error,!0)`get chats failed`,SEND_LOGS("get chats failed when creating device notification"),new Error("get chats failed")}const r=n.map((t=>(0,o.genSecurityCodeNotificationMsg)(t,e)));return t.notifications=r,t.chatIds=n.map(String),t}))).apply(this,arguments)}},267420:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.deprecatedGenerateBaseInfoParamsFutureproofReparsing=function(e){let t;const n=e.id.remote,r={externalId:e.id.id,ts:(0,l.castToUnixTime)(e.t),edit:-1,isHsm:!1,count:null,chat:n,pushname:null};var i;t=E.default.isGroup(n)?(0,a.default)((0,a.default)({},r),{},{type:f.MESSAGE_TYPE.GROUP,author:null!==(i=e.author)&&void 0!==i?i:(0,m.getMeUser)(),isDirect:!1}):(0,a.default)((0,a.default)({},r),{},{author:e.from,type:f.MESSAGE_TYPE.CHAT});const o={e2eType:c.CiphertextType.Msg,hideFail:!1,retryCount:0,mediaType:null};return{info:t,e2eInfo:o,bizInfo:{nativeFlowName:null,verifiedNameSerial:null,verifiedLevel:null,verifiedNameCert:null,privacyMode:null}}},t.genPlaceholderMsg=function(){return U.apply(this,arguments)},t.getDeviceType=j,t.getFrom=function(e){return e.type===f.MESSAGE_TYPE.CHAT?e.author:e.chat},t.messageInfoToKey=F,t.parseMessage=function(){return P.apply(this,arguments)},t.parseProtocolMessage=C,t.placeholderCheck=k;var i=r(n(506479)),a=r(n(81109)),o=r(n(348926)),s=n(616310),l=n(990445),u=n(402994),c=n(303754),d=n(588733),p=n(740293),_=n(177205),f=n(257845),h=r(n(565754)),g=n(373070),m=n(459857),y=r(n(571834)),E=r(n(124928)),S=n(669050),T=n(766187),v=n(467057);const A=["decrypted"];function C(e){var t,n,r,i,a,o;let s,{info:l,msgProtobuf:u,paymentInfo:c,bizInfo:d}=e;if(null!=(null===(t=u.protocolMessage)||void 0===t?void 0:t.historySyncNotification)){s={history:(0,p.parseMsgProto)(u,G(l),"relay",c,void 0,void 0,d).historySyncMetaData}}else if(null!=(null===(n=u.protocolMessage)||void 0===n?void 0:n.initialSecurityNotificationSettingSync)){var _;s={securityNotificationEnabled:{isEnabled:null===(_=u.protocolMessage.initialSecurityNotificationSettingSync.securityNotificationEnabled)||void 0===_||_}}}else if(null!=(null===(r=u.protocolMessage)||void 0===r?void 0:r.appStateSyncKeyShare))s={appStateSyncKeyShare:u.protocolMessage.appStateSyncKeyShare};else if(null!=(null===(i=u.protocolMessage)||void 0===i?void 0:i.appStateSyncKeyRequest))s={appStateSyncKeyRequest:u.protocolMessage.appStateSyncKeyRequest};else if(null!=(null===(a=u.protocolMessage)||void 0===a?void 0:a.peerDataOperationRequestResponseMessage)){var f;s={peerDataOperationRequestResponseMessage:null===(f=u.protocolMessage)||void 0===f?void 0:f.peerDataOperationRequestResponseMessage}}else if(null!=(null===(o=u.protocolMessage)||void 0===o?void 0:o.peerDataOperationRequestMessage)){var h;s={peerDataOperationRequestMessage:null===(h=u.protocolMessage)||void 0===h?void 0:h.peerDataOperationRequestMessage}}return s}function P(){return(P=(0,o.default)((function*(e){var t,n,r,i,a,o;let s,{info:l,ciphertextType:u,msgProtobuf:d,paymentInfo:p,bizInfo:_,hidePlaceholder:h=!1,processDecryptedProtoParams:g}=e;if(null==(null===(t=d.protocolMessage)||void 0===t?void 0:t.historySyncNotification)&&null==(null===(n=d.protocolMessage)||void 0===n?void 0:n.initialSecurityNotificationSettingSync)&&null==(null===(r=d.protocolMessage)||void 0===r?void 0:r.appStateSyncKeyShare)&&null==(null===(i=d.protocolMessage)||void 0===i?void 0:i.appStateSyncKeyRequest)&&null==(null===(a=d.protocolMessage)||void 0===a?void 0:a.peerDataOperationRequestResponseMessage)&&null==(null===(o=d.protocolMessage)||void 0===o?void 0:o.peerDataOperationRequestMessage)||(s=C({info:l,msgProtobuf:d,paymentInfo:p,bizInfo:_})),!s)switch(l.type){case f.MESSAGE_TYPE.CHAT:s=(0,m.isMeAccount)(l.author)?yield O(l,d,p,_,h,g):yield R(l,d,p,_,h,g);break;case f.MESSAGE_TYPE.GROUP:s=(0,m.isMeAccount)(l.author)&&l.isDirect?yield O(l,d,p,_,h,g):yield R(l,d,p,_,h,g);break;case f.MESSAGE_TYPE.PEER_BROADCAST:if(u===c.CiphertextType.Skmsg){if(!l.bclHashValidated)throw new Error("parseMessage: participants for peer broadcast message is not validated");s=yield R(l,d,p,_,h,g)}else s=yield M(l,d,p,_,h,g);break;case f.MESSAGE_TYPE.OTHER_BROADCAST:s=yield R(l,d,p,_,h,g);break;case f.MESSAGE_TYPE.DIRECT_PEER_STATUS:s=l.isDirect?yield O(l,d,p,_,h,g):yield M(l,d,p,_,h,g);break;case f.MESSAGE_TYPE.OTHER_STATUS:s=yield R(l,d,p,_,h,g);break;default:throw new Error("Unrecognized MESSAGE_TYPE")}return s}))).apply(this,arguments)}function O(){return I.apply(this,arguments)}function I(){return(I=(0,o.default)((function*(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5?arguments[5]:void 0;const{deviceSentMessage:s}=t;if(null==s)throw new _.DeviceSentMessageError(j(e.author),y.default.DSM_ERROR.MISSING_DSM);if(null==s.destinationJid)throw new _.DeviceSentMessageError(j(e.author),y.default.DSM_ERROR.INVALID_DSM);const{destinationJid:l}=s,u=yield w(e,(0,d.unwrapDeviceSentMessage)(t),n,r,i,o);return(0,a.default)({deviceSent:{destination:(0,S.createWid)(l)}},u)}))).apply(this,arguments)}function M(){return b.apply(this,arguments)}function b(){return(b=(0,o.default)((function*(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5?arguments[5]:void 0;const{deviceSentMessage:s}=t;if(null==s)throw new _.DeviceSentMessageError(j(e.author),y.default.DSM_ERROR.MISSING_DSM);if(null==s.phash)throw new _.DeviceSentMessageError(j(e.author),y.default.DSM_ERROR.INVALID_DSM);const{phash:l}=s,u=yield w(e,(0,d.unwrapDeviceSentMessage)(t),n,r,i,o);return(0,a.default)({deviceSent:{phash:l,info:e}},u)}))).apply(this,arguments)}function R(){return N.apply(this,arguments)}function N(){return(N=(0,o.default)((function*(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5?arguments[5]:void 0;if(null!=t.deviceSentMessage)throw new _.DeviceSentMessageError(j(e.author),y.default.DSM_ERROR.INVALID_SENDER);const s=yield w(e,t,n,r,i,o);return(0,a.default)({deviceSent:null},s)}))).apply(this,arguments)}function w(){return L.apply(this,arguments)}function L(){return(L=(0,o.default)((function*(e,t,n,r){var o,s;let l=arguments.length>4&&void 0!==arguments[4]&&arguments[4],u=arguments.length>5?arguments[5]:void 0;if(null==t)return{senderKey:null,storeMsg:null,renderableMsgs:[]};let c=(0,p.parseMsgProto)(t,G(e),"relay",n,void 0,void 0,r,e.edit);c=(0,a.default)((0,a.default)({},c),yield(0,T.workerSafeSendAndReceive)("genDirectConnectionMessageModifiers",{msgType:c.type,msgListType:null===(o=c.list)||void 0===o?void 0:o.listType,businessJid:c.businessOwnerJid}));const d=null!=t.senderKeyDistributionMessage?D(e,t.senderKeyDistributionMessage):null,_=c.type===g.MSG_TYPE.UNKNOWN&&null==d,h=c.type===g.MSG_TYPE.UNKNOWN&&null!=d;let y=null;if(_&&null!=u){const{decrypted:e}=u,t=(0,i.default)(u,A);c.futureproofParams=t,c.futureproofBuffer=e}if(e.type===f.MESSAGE_TYPE.OTHER_STATUS&&(c.campaignId=e.campaignId,c.campaignDuration=e.campaignDuration),e.type===f.MESSAGE_TYPE.PEER_BROADCAST&&(c.broadcastId=e.chat,c.broadcastParticipants=e.bclParticipants,c.broadcastEphSettings=e.bclEphSettings,y=c),e.type===f.MESSAGE_TYPE.OTHER_BROADCAST){c.broadcastId=e.chat;const t=e.ephSetting,n=c.ephemeralSharedSecret;if(null!=t&&null!=n){const{ephemeralDuration:r,ephemeralSettingTimestamp:i}=yield(0,v.decodeBroadcastEphemeralSetting)(e.chat,(0,m.getMeUser)(),e.author,t,n);c.ephemeralDuration=r,c.ephemeralSettingTimestamp=i}}const E=!h&&c.type===g.MSG_TYPE.UNKNOWN&&null==c.subtype&&!0===l&&"text"===(null==u||null===(s=u.msgMeta)||void 0===s?void 0:s.type)&&null!=t.messageContextInfo;let S=[];return h||E?E&&(__LOG__(3,void 0,void 0,!0,["messaging"])`parseContentMessage: msgId::${e.externalId}: hide placeholder for invalid sender key distribution message`,SEND_LOGS("invalid-sender-key-distribution-message")):e.type===f.MESSAGE_TYPE.PEER_BROADCAST?S=yield x(c,e.bclParticipants,e.bclEphSettings):("payment_transaction_request_cancelled"!==c.subtype&&"payment_action_request_declined"!==c.subtype||null!=c.paymentRequestMessageKey)&&"non_renderable"!==c.subtype&&(S=[c]),{senderKey:d,storeMsg:y,renderableMsgs:S}}))).apply(this,arguments)}function D(e,t){if(!e.chat.isGroup()&&!e.chat.isBroadcast())throw new Error("should not have senderkey");const{groupId:n,axolotlSenderKeyDistributionMessage:r}=t;if(null==n||e.chat.toString({legacy:!0})!==n)throw new Error(`senderKeyDistributionMessage: from ${e.chat.toString()} mismatched to ${n||"null"}`);if(!r)throw new Error(`senderKeyDistributionMessage: from ${e.author.toString()} has no content`);return{groupId:n,key:r}}function k(e){return e.edit!==u.EDIT_ATTR.SENDER_REVOKE||e.type===f.MESSAGE_TYPE.PEER_BROADCAST}function U(){return(U=(0,o.default)((function*(e,t){if(!k(e))return[];const n=G(e);return t===f.PlaceholderType.E2E?n.type=g.MSG_TYPE.CIPHERTEXT:(n.type=g.MSG_TYPE.CIPHERTEXT,n.subtype="fanout"),e.type===f.MESSAGE_TYPE.PEER_BROADCAST?(n.broadcastParticipants=e.bclParticipants,n.broadcastEphSettings=e.bclEphSettings,(0,T.workerSafeFireAndForget)("storeMessages",{messages:[n],chat:n.id.remote}),e.edit===u.EDIT_ATTR.SENDER_REVOKE?[]:x(n,e.bclParticipants)):[n]}))).apply(this,arguments)}function G(e){const t=F(e),n=(0,m.getMeUser)(),r=(0,m.getMaybeMeLidUser)();let i;i=t.fromMe&&E.default.isGroup(t.remote)&&e.author.isLid()&&null!=r?r:n;const a=t.fromMe&&n.equals(e.chat),o={id:t,from:t.fromMe?i:t.remote,to:t.fromMe?t.remote:n,type:g.MSG_TYPE.UNKNOWN,t:e.ts||0,ack:a?u.ACK.READ:u.ACK.SENT,author:!t.fromMe&&E.default.isGroup(t.remote)||E.default.isStatusV3(t.remote)?t.participant:void 0,broadcast:!1,notifyName:e.pushname||""};return null!=e.count&&(o.count=e.count),o}function x(){return B.apply(this,arguments)}function B(){return(B=(0,o.default)((function*(e,t,n){return(yield Promise.all(t.map(function(){var t=(0,o.default)((function*(t){let r,i,o;try{r=new h.default({remote:t,fromMe:!0,id:e.id.id})}catch(e){return __LOG__(3)`drop: cannot create MsgKey: ${e.stack}`,null}const s=n?n[t.toString()]:null,l=e.ephemeralSharedSecret,u=e.broadcastId;null!=u&&null!=s&&null!=l&&({ephemeralDuration:i,ephemeralSettingTimestamp:o}=yield(0,v.decodeBroadcastEphemeralSetting)(u,t,(0,m.getMeUser)(),s,l));const c=(0,a.default)((0,a.default)({},e),{},{id:r,from:(0,m.getMeUser)(),to:t,broadcast:!0,ephemeralDuration:i,ephemeralSettingTimestamp:o});return e.protocolMessageKey&&(c.protocolMessageKey=new h.default({remote:t,fromMe:!0,id:e.protocolMessageKey.id})),c}));return function(){return t.apply(this,arguments)}}()))).filter(Boolean)}))).apply(this,arguments)}function F(e){return e.type===f.MESSAGE_TYPE.OTHER_BROADCAST?new h.default({remote:(0,S.toUserWid)(e.author),fromMe:!1,id:e.externalId}):e.type===f.MESSAGE_TYPE.CHAT?new h.default({remote:e.chat,fromMe:(0,m.isMeAccount)(e.author),id:e.externalId}):new h.default({remote:e.chat,fromMe:(0,m.isMeAccount)(e.author),participant:(0,S.toUserWid)(e.author),id:e.externalId})}function j(e){return null==e.device||e.device===s.DEFAULT_DEVICE_ID?y.default.DEVICE_TYPE.PRIMARY:y.default.DEVICE_TYPE.COMPANION}},881077:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.decryptE2EPayload=function(){return I.apply(this,arguments)};var i=r(n(348926)),a=n(215373),o=n(924583),s=n(652568),l=n(678002),u=n(359987),c=n(303754),d=n(973776),p=n(492917),_=n(862159),f=n(883310),h=n(177205),g=n(257845),m=n(267420),y=O(n(138706)),E=n(91923),S=n(76256),T=n(869513),v=r(n(571834)),A=n(574819),C=O(n(143130));function P(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(P=function(e){return e?n:t})(e)}function O(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=P(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function I(){return(I=(0,i.default)((function*(e){const{bizInfo:t,msgInfo:n,paymentInfo:r,deviceIdentity:a,encs:u,msgMeta:c}=e;if(null!=n.author.device&&0!==n.author.device){if(!(yield(0,l.validateADVwithEncs)(n.author,a,u,!!n.offline)))return __LOG__(3,void 0,void 0,void 0,["messaging"])`decryptE2EPayload: msgId::${n.externalId}, validateADVIdentity failed`,{result:g.E2EProcessResult.RETRY,retryCount:u[0].retryCount}}const p=c.type===f.STANZA_MSG_TYPES.reaction,_=yield(0,s.promiseReduce)(e.encs,((e,a)=>{if(e.result!==g.E2EProcessResult.SUCCESS)return Promise.resolve(e);let s=v.default.MEDIA_TYPE.NONE;null!=a.mediaType?s=(0,d.metricsMediaType)(a.mediaType):p&&(s=v.default.MEDIA_TYPE.REACTION);const l=(0,m.getFrom)(n),u=new v.default.E2eMessageRecv({e2eCiphertextType:(0,d.getMetricE2eCiphertextType)(a.e2eType),e2eCiphertextVersion:d.CIPHERTEXT_VERSION,e2eDestination:(0,d.getMetricE2eDestination)(l),e2eSuccessful:!1,messageMediaType:s,retryCount:a.retryCount});return M(a,l,n.author).then(function(){var e=(0,i.default)((function*(e){u.e2eSuccessful=!0,u.weight=1e3,N(n.chat,u,p);const i={retryCount:a.retryCount,e2eType:a.e2eType,mediaType:a.mediaType,hideFail:a.hideFail};return __LOG__(2,void 0,void 0,void 0,["messaging"])`decryptE2EPayload: msgId::${n.externalId} e2eType:${a.e2eType} done`,yield C.processDecryptedProto({decrypted:e,info:n,paymentInfo:r,e2eInfo:i,bizInfo:t,msgMeta:c}),__LOG__(2,void 0,void 0,void 0,["messaging"])`processDecryptedProto: msgId::${n.externalId} e2eType:${a.e2eType} done`,{result:g.E2EProcessResult.SUCCESS}}));return function(){return e.apply(this,arguments)}}()).catch((0,o.filteredCatch)([E.SignalDecryptionError,h.UnknownMessageError],function(){var e=(0,i.default)((function*(e){return __LOG__(3,void 0,void 0,void 0,["messaging"])`decryptE2EPayload: msgId::${n.externalId} e2eType:${a.e2eType}, ${e.toString()}`,u.weight=1,N(n.chat,u,p),a.hideFail||(yield C.processPlaceholderMsg(n,g.PlaceholderType.E2E)),{result:g.E2EProcessResult.RETRY,retryCount:a.retryCount}}));return function(){return e.apply(this,arguments)}}())).catch((0,o.filteredCatch)(E.SignalMessageCounterError,(e=>(__LOG__(3,void 0,void 0,void 0,["messaging"])`decryptE2EPayload: msgId::${n.externalId} e2eType:${a.e2eType}, signal counter error: ${e}`,{result:g.E2EProcessResult.SUCCESS})))).catch((0,o.filteredCatch)(f.HsmMismatchError,(e=>(__LOG__(3,void 0,void 0,!0,["messaging"])`decryptE2EPayload: msgId::${n.externalId} e2eType:${a.e2eType}, error: ${null==e?void 0:e.name}, stack: ${null==e?void 0:e.stack}`,SEND_LOGS("handleMsg: hsm mismatch error"),u.weight=1,N(n.chat,u,p),{result:g.E2EProcessResult.HSM_MISMATCH})))).catch((0,o.filteredCatch)(h.ReactionValidationError,(e=>(__LOG__(3,void 0,void 0,!0,["messaging"])`decryptE2EPayload: msgId::${n.externalId}, error: ${null==e?void 0:e.name}, stack: ${null==e?void 0:e.stack}`,SEND_LOGS("handleMsg: ReactionValidationError"),{result:g.E2EProcessResult.PARSE_VALIDATION_ERROR})))).catch((0,o.filteredCatch)(h.EncReactionDisabledValidationError,(e=>(__LOG__(3,void 0,void 0,!0,["messaging"])`decryptE2EPayload: msgId::${n.externalId}, error: ${null==e?void 0:e.name}, stack: ${null==e?void 0:e.stack}`,SEND_LOGS("handleMsg: EncReactionDisabledValidationError"),{result:g.E2EProcessResult.PARSE_VALIDATION_ERROR})))).catch((0,o.filteredCatch)(h.PollCreationValidationError,(e=>(__LOG__(3,void 0,void 0,!0,["messaging","polls"])`decryptE2EPayload: msgId::${n.externalId}, error: ${null==e?void 0:e.name}, code: ${e.code}, stack: ${null==e?void 0:e.stack}`,SEND_LOGS("handleMsg: PollCreationValidationError"),{result:g.E2EProcessResult.PARSE_VALIDATION_ERROR})))).catch((0,o.filteredCatch)(h.PollUpdateValidationError,(e=>(__LOG__(3,void 0,void 0,!0,["messaging","polls"])`decryptE2EPayload: msgId::${n.externalId}, error: ${null==e?void 0:e.name}, code: ${e.code}, stack: ${null==e?void 0:e.stack}`,SEND_LOGS("handleMsg: PollUpdateValidationError"),{result:g.E2EProcessResult.PARSE_VALIDATION_ERROR})))).catch((e=>(__LOG__(3,void 0,void 0,!0,["messaging"])`decryptE2EPayload: msgId::${n.externalId}, error: ${null==e?void 0:e.name}, stack: ${null==e?void 0:e.stack}`,SEND_LOGS("handleMsg: parse decrypted message error"),u.weight=1,N(n.chat,u,p),{result:g.E2EProcessResult.PARSE_ERROR})))}),{result:g.E2EProcessResult.SUCCESS});return yield(0,S.getSignalProtocolStore)().flushBufferToDiskIfNotMemOnlyMode(),_}))).apply(this,arguments)}function M(e,t,n){const{e2eType:r,ciphertext:i}=e;switch(r){case c.CiphertextType.Skmsg:return t.isGroup()||t.isBroadcast()?n?(0,p.isCryptoLibraryEnabled)()?y.CryptoLibrary.decryptGroupMessage((0,A.widToGroupJid)(t),(0,A.widToPhoneDeviceJid)(n),i,{onSuccess:e=>Promise.resolve((0,a.uint8ArrayToBuffer)(e))}):y.Cipher.decryptGroupSignalProto(t,n,i):Promise.reject(new Error(`['messaging'] decryptEnc: receive msg from ${t.toString()} without participant`)):Promise.reject(new Error(`['messaging'] decryptEnc: Can not do skmsg for non group ${t.toString()}`));case c.CiphertextType.Pkmsg:case c.CiphertextType.Msg:const e=t.isUser()?t:n;return e?(0,p.isCryptoLibraryEnabled)()?y.CryptoLibrary.decryptMessage((0,A.widToPhoneDeviceJid)(e),r,i,{onSuccess:e=>Promise.resolve((0,a.uint8ArrayToBuffer)(e))}):y.Cipher.decryptSignalProto(e,r,i):Promise.reject(new Error(`['messaging'] decryptEnc: receive msg from ${t.toString()} without participant`))}}function b(){return R.apply(this,arguments)}function R(){return(R=(0,i.default)((function*(e,t,n){if(e.isGroup()){const r=yield(0,u.frontendSendAndReceive)("getGroupMetadata",{groupWid:e});if(null!=r){const e=(0,T.isCagIncognitoFromGroupMetadata)(r);null!=e&&(t.isLid=e&&n);const i=(0,_.groupTypeToWamEnum)((0,_.getGroupTypeFromGroupMetadata)(r));t.typeOfGroup=i}}else t.isLid=e.isLid()}))).apply(this,arguments)}function N(){return w.apply(this,arguments)}function w(){return(w=(0,i.default)((function*(e,t,n){yield b(e,t,n),t.commit()}))).apply(this,arguments)}},608040:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.OfflineBlockingResumeStageManager=void 0;var i=r(n(348926)),a=n(201063),o=n(277330),s=n(359987),l=n(698867),u=n(780549),c=n(257845),d=n(150204),p=n(332108),_=n(412985),f=n(92268),h=n(928621),g=n(538222),m=n(889263),y=n(755985),E=n(76256),S=n(209983),T=n(766187);function v(){return(v=(0,i.default)((function*(){try{__LOG__(2)`[offline-resume][blocking] restoreDataFromStorage.`,yield Promise.all([(0,f.updatePeerReceipts)().then((()=>(0,T.workerSafeSendAndReceive)("restoreChatsAndMessages",{threadMeta:null}))),(0,T.workerSafeSendAndReceive)("restoreGroupsAndContacts"),(0,T.workerSafeSendAndReceive)("restoreProfilePictures")])}catch(e){__LOG__(4,!0,new Error,!0)`[offline-resume][blocking] restoreDataFromStorage failed with error ${e}.`,SEND_LOGS("offline-resume-fatal-error"),(0,s.frontendFireAndForget)("socketLogout",{forcePost:!1,reason:p.LogoutReason.ClientFatalError})}}))).apply(this,arguments)}t.OfflineBlockingResumeStageManager=class{constructor(){this._offlineCompleteTimer=null,this._progressBarTimer=new a.ShiftTimer((()=>{u.Cmd.handleOfflineProgressUpdate(),this._progressBarTimer.onOrAfter(h.UI_UPDATE_TIME_MS)})),this._initState()}_initState(){this._offlineMessagePreviewCounter=-1,this._decryptedMessageCount=0,this._decryptionErrorCount=0,this._finishedDownloading=!1,this._hasMessagesToDownload=null,this._status=h.ResumeStatus.INIT}_setStatus(e){__LOG__(2)`[offline-resume][blocking] offline resume stage: ${this._status} -> ${e}`,this._status=e}processOfflinePreview(e){if(S.OfflineResumeReporter.logOfflinePreviewT(),this.isResumeFromRestartComplete())__LOG__(2)`[offline-resume][blocking] Offline session is complete when receiving offline preview ib.`,(0,g.exceedResumeWithOpenTabLimit)(e.message,e.receipt)&&(__LOG__(2)`[offline-resume][blocking] restart client due to exceed the LIMIT, message: ${e.message}, receipt: ${e.receipt}`,(0,g.refreshWindow)()),d.jsHaltDetector.restartDetection(),this._setStatus(h.ResumeStatus.RESUME_WITH_OPEN_TAB),(0,s.frontendFireAndForget)("updateChatSortListener",{enable:!1}),setTimeout((()=>{(0,s.frontendFireAndForget)("updateChatSortListener",{enable:!0})}),7e3);else if(this._status===h.ResumeStatus.INIT)S.OfflineResumeReporter.logOfflineCount(e),this._hasMessagesToDownload=e.message>0,this._finishedDownloading=0===e.message,this._offlineMessagePreviewCounter=e.message,this._decryptedMessageCount=0,this._firstPreviewReceivedT=Date.now(),(0,E.enableMemSignalStore)(),u.Cmd.handleOfflineProgressUpdate(),d.jsHaltDetector.restartDetection(),this._setStatus(h.ResumeStatus.RESUME_ON_RESTART),this._startOfflineCompleteTimer(e.message,e.receipt),this._progressBarTimer.onOrAfter(h.UI_UPDATE_TIME_MS),u.Cmd.readyForProcessOffline(),__LOG__(2)`[offline-resume][non-blocking] start handling offline stanza`;else{const t=this._firstPreviewReceivedT;if(null!=t){const n=Date.now()-t;n<h.OFFLINE_PREVIEW_PERIOD_MS?(__LOG__(2)`[offline-resume][blocking] Accept multiple offline preview ibs during offline resume, delay ${n}.`,this._offlineMessagePreviewCounter+=e.message,this._hasMessagesToDownload=this._offlineMessagePreviewCounter>0,this._finishedDownloading=0===this._offlineMessagePreviewCounter,S.OfflineResumeReporter.logOfflineCount(e),u.Cmd.handleOfflineProgressUpdate()):__LOG__(2)`[offline-resume][blocking] Reject multiple offline preview ib during offline resume, delay ${n}.`}this._refreshOfflineCompleteTimer()}}processOfflineThreadMeta(){}getOfflineDeliveryProgress(){return this._finishedDownloading?100:-1===this._offlineMessagePreviewCounter?0:0===this._offlineMessagePreviewCounter?100:Math.min(Math.ceil(100*this._decryptedMessageCount/this._offlineMessagePreviewCounter),100)}processOfflineSessionComplete(e){var t=this;return(0,i.default)((function*(){var n;if(setTimeout((()=>{(0,s.frontendFireAndForget)("updateChatSortListener",{enable:!0})}),3e3),null===(n=t._offlineCompleteTimer)||void 0===n||n.cancel(),t._offlineCompleteTimer=null,u.Cmd.readyForProcessOffline(),t._status!==h.ResumeStatus.COMPLETE)return t._status===h.ResumeStatus.RESUME_WITH_OPEN_TAB?(yield(0,_.waitForOnlineMsgThread)(),yield(0,o.doPendingDeviceSync)(),void t._setStatus(h.ResumeStatus.COMPLETE)):(t._hasMessagesToDownload=e>0,t._finishedDownloading=0===e,t._setStatus(h.ResumeStatus.COMPLETE),t._offlineStanzaCountAfterOfflineMarker=0,setTimeout((()=>{t._offlineStanzaCountAfterOfflineMarker>h.OFFLINE_STANZA_COUNT_LIMIT&&(__LOG__(3)`[offline-resume][blocking] ${t._offlineStanzaCountAfterOfflineMarker} received after offline completion marker. Refreshing window due to potential server issue.`,(0,g.refreshWindow)())}),h.OFFLINE_STANZA_COUNT_CHECK_TIMEOUT_MS),u.Cmd.handleOfflineProgressUpdate(),t._handleOfflineComplete())}))()}isResumeFromRestartComplete(){return this._status!==h.ResumeStatus.RESUME_ON_RESTART&&this._status!==h.ResumeStatus.INIT}isResumeOnSocketDisconnectInProgress(){return this._status===h.ResumeStatus.RESUME_WITH_OPEN_TAB}isResumeFromRestartInProgress(){return this._status!==h.ResumeStatus.INIT&&!u.Cmd.isOfflineDeliveryEnd}getHasMessagesToDownload(){return this._hasMessagesToDownload}getFinishedDownloading(){return 100===this.getOfflineDeliveryProgress()}shouldUseOfflineResumeScreen(){return this._offlineMessagePreviewCounter>this._decryptedMessageCount}processDecryptResult(e){this._decryptedMessageCount=this._decryptedMessageCount+1,e===c.E2EProcessResult.RETRY&&(this._decryptionErrorCount=this._decryptionErrorCount+1)}offlineStanzaReceivedAfterCompelete(){this.isResumeFromRestartComplete()&&(this._offlineStanzaCountAfterOfflineMarker=this._offlineStanzaCountAfterOfflineMarker+1)}newOfflineStanza(e,t){this._refreshOfflineCompleteTimer(),S.OfflineResumeReporter.logAddOfflineSizeBytes(t),S.OfflineResumeReporter.logOldestStanzaTime(e)}shouldShowResumeButterBar(){return!1}_refreshOfflineCompleteTimer(){this._offlineCompleteTimer&&this._offlineCompleteTimer.onOrAfter(h.OFFLINE_STANZA_TIMEOUT_MS)}_startOfflineCompleteTimer(e,t){var n;null===(n=this._offlineCompleteTimer)||void 0===n||n.cancel(),this._offlineCompleteTimer=new a.ShiftTimer((()=>{this._status!==h.ResumeStatus.COMPLETE&&(__LOG__(2)`[offline-resume][blocking]: offline session completed by timeout`,this.processOfflineSessionComplete(e+t),this._offlineCompleteTimer=null,S.OfflineResumeReporter.logMissedOfflineComplete())})),this._offlineCompleteTimer.onOrAfter(h.OFFLINE_STANZA_TIMEOUT_MS)}_handleOfflineComplete(){var e=this;return(0,i.default)((function*(){yield(0,_.waitForOfflineMsgThread)(),e._finishedDownloading=!0,u.Cmd.handleOfflineProgressUpdate(),S.OfflineResumeReporter.logOfflineDecryptionErrorCount(e._decryptionErrorCount),__LOG__(2)`[offline-resume][blocking] _onOfflineComplete: waitForOfflineMsgThread done, total decryption error: ${e._decryptionErrorCount}`,e._decryptionErrorCount=0,yield(0,g.clearOfflineSnapShot)(),__LOG__(2)`[offline-resume][blocking] _onOfflineComplete: clearOfflineSnapShot done.`,(0,E.enablePersistSignalStore)(),(0,g.runReceiptCleanUpLoop)();try{yield(0,m.pruneExpiredMessagesWithAddOns)()}catch(e){throw __LOG__(4,void 0,new Error)`[offline-resume][blocking] _onOfflineComplete: pruneExpiredMessages message failed with error: ${e}`,e}S.OfflineResumeReporter.logLastStanzaT(),(0,y.isWorker)()||(yield function(){return v.apply(this,arguments)}(),(0,g.readyForMainScreen)(),u.Cmd.offlineDeliveryEnd(),S.OfflineResumeReporter.commit(),(0,T.workerSafeFireAndForget)("processAllOrphanPaymentNotifications"),(0,l.uploadChatThreadLoggingEvents)(),setTimeout((()=>{(0,o.doPendingDeviceSync)()}),h.OFFLINE_DEVICE_SYNC_DELAY))}))()}}},800321:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageCache=function(){null==r&&(r=n(390053).messageProcessorCache);return r};let r=null},654082:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.OfflineNonBlockingResumeStageManager=void 0;var i=r(n(348926)),a=n(201063),o=n(277330),s=n(359987),l=n(698867),u=n(780549),c=n(257845),d=n(150204),p=n(332108),_=n(412985),f=n(92268),h=n(928621),g=n(538222),m=n(889263),y=n(755985),E=n(76256),S=n(209983),T=n(766187);function v(){return(v=(0,i.default)((function*(e){try{__LOG__(2)`[offline-resume][non-blocking] restoreDataFromStorage.`,yield Promise.all([(0,T.workerSafeSendAndReceive)("restoreChatsAndMessages",{threadMeta:e}),(0,T.workerSafeSendAndReceive)("restoreGroupsAndContacts"),(0,T.workerSafeSendAndReceive)("restoreProfilePictures")])}catch(e){__LOG__(4,!0,new Error,!0)`[offline-resume][non-blocking] restoreDataFromStorage failed with error ${e}.`,SEND_LOGS("offline-resume-fatal-error"),(0,s.frontendFireAndForget)("socketLogout",{forcePost:!1,reason:p.LogoutReason.ClientFatalError})}}))).apply(this,arguments)}t.OfflineNonBlockingResumeStageManager=class{constructor(){this._offlineCompleteTimer=null,this._progressBarTimer=new a.ShiftTimer((()=>{u.Cmd.handleOfflineProgressUpdate(),this._progressBarTimer.onOrAfter(h.UI_UPDATE_TIME_MS)})),this._maxProgress=95,this._threadMeta=null,this._initState()}_initState(){this._offlineMessagePreviewCounter=-1,this._decryptedMessageCount=0,this._decryptionErrorCount=0,this._finishedDownloading=!1,this._hasMessagesToDownload=null,this._status=h.ResumeStatus.INIT}_setStatus(e){__LOG__(2)`[offline-resume][non-blocking] offline resume stage: ${this._status} -> ${e}`,this._status=e}processOfflinePreview(e){if(S.OfflineResumeReporter.logOfflinePreviewT(),this.isResumeFromRestartComplete())__LOG__(2)`[offline-resume][non-blocking] Offline session is complete when receiving offline preview ib.`,(0,g.exceedResumeWithOpenTabLimit)(e.message,e.receipt)&&(__LOG__(2)`[offline-resume][non-blocking] restart client due to exceed the LIMIT, message: ${e.message}, receipt: ${e.receipt}`,(0,g.refreshWindow)()),d.jsHaltDetector.restartDetection(),this._setStatus(h.ResumeStatus.RESUME_WITH_OPEN_TAB),(0,s.frontendFireAndForget)("updateChatSortListener",{enable:!1}),setTimeout((()=>{(0,s.frontendFireAndForget)("updateChatSortListener",{enable:!0})}),7e3);else if(this._status===h.ResumeStatus.INIT)S.OfflineResumeReporter.logOfflineCount(e),this._offlineMessagePreviewCounter=e.message,this._hasMessagesToDownload=!1,this._finishedDownloading=!0,this._decryptedMessageCount=0,this._firstPreviewReceivedT=Date.now(),(0,E.enableMemSignalStore)(),u.Cmd.handleOfflineProgressUpdate(),d.jsHaltDetector.restartDetection(),this._progressBarTimer.onOrAfter(h.UI_UPDATE_TIME_MS),this._setStatus(h.ResumeStatus.RESUME_ON_RESTART),this._startOfflineCompleteTimer(e.message,e.receipt),this._loadMainScreen();else{const t=this._firstPreviewReceivedT;if(null!=t){const n=Date.now()-t;n<h.OFFLINE_PREVIEW_PERIOD_MS?(__LOG__(2)`[offline-resume][non-blocking] Accept multiple offline preview ibs during offline resume, delay ${n}.`,this._offlineMessagePreviewCounter+=e.message,this._hasMessagesToDownload=!1,this._finishedDownloading=!0,S.OfflineResumeReporter.logOfflineCount(e)):__LOG__(2)`[offline-resume][non-blocking] Reject multiple offline preview ib during offline resume, delay ${n}.`}this._refreshOfflineCompleteTimer()}}processOfflineThreadMeta(e){this._threadMeta=e}getOfflineDeliveryProgress(){return 0===this._offlineMessagePreviewCounter?this._maxProgress:Math.min(Math.ceil(100*this._decryptedMessageCount/this._offlineMessagePreviewCounter),this._maxProgress)}processOfflineSessionComplete(){var e=this;return(0,i.default)((function*(){var t;if(setTimeout((()=>{(0,s.frontendFireAndForget)("updateChatSortListener",{enable:!0})}),3e3),null===(t=e._offlineCompleteTimer)||void 0===t||t.cancel(),e._offlineCompleteTimer=null,e._status!==h.ResumeStatus.COMPLETE)return e._status===h.ResumeStatus.RESUME_WITH_OPEN_TAB?(yield(0,_.waitForOnlineMsgThread)(),yield(0,o.doPendingDeviceSync)(),void e._setStatus(h.ResumeStatus.COMPLETE)):(e._status===h.ResumeStatus.INIT&&(e._hasMessagesToDownload=!1,e._finishedDownloading=!0,u.Cmd.handleOfflineProgressUpdate(),yield e._loadMainScreen()),e._setStatus(h.ResumeStatus.COMPLETE),e._offlineStanzaCountAfterOfflineMarker=0,setTimeout((()=>{e._offlineStanzaCountAfterOfflineMarker>h.OFFLINE_STANZA_COUNT_LIMIT&&(__LOG__(3)`[offline-resume][non-blocking] ${e._offlineStanzaCountAfterOfflineMarker} received after offline completion marker. Refreshing window due to potential server issue.`,(0,g.refreshWindow)())}),h.OFFLINE_STANZA_COUNT_CHECK_TIMEOUT_MS),e._handleOfflineComplete())}))()}isResumeFromRestartComplete(){return this._status!==h.ResumeStatus.RESUME_ON_RESTART&&this._status!==h.ResumeStatus.INIT}isResumeFromRestartInProgress(){return this._status!==h.ResumeStatus.INIT&&!u.Cmd.isOfflineDeliveryEnd}isResumeOnSocketDisconnectInProgress(){return this._status===h.ResumeStatus.RESUME_WITH_OPEN_TAB}getHasMessagesToDownload(){return this._hasMessagesToDownload}getFinishedDownloading(){return 100===this.getOfflineDeliveryProgress()}shouldUseOfflineResumeScreen(){return this._offlineMessagePreviewCounter>this._decryptedMessageCount}processDecryptResult(e){this._decryptedMessageCount=this._decryptedMessageCount+1,e===c.E2EProcessResult.RETRY&&(this._decryptionErrorCount=this._decryptionErrorCount+1)}offlineStanzaReceivedAfterCompelete(){this.isResumeFromRestartComplete()&&(this._offlineStanzaCountAfterOfflineMarker=this._offlineStanzaCountAfterOfflineMarker+1)}newOfflineStanza(e,t){S.OfflineResumeReporter.logAddOfflineSizeBytes(t),S.OfflineResumeReporter.logOldestStanzaTime(e),this._refreshOfflineCompleteTimer()}shouldShowResumeButterBar(){return!u.Cmd.isOfflineDeliveryEnd&&this._offlineMessagePreviewCounter>=100}_refreshOfflineCompleteTimer(){this._offlineCompleteTimer&&this._offlineCompleteTimer.onOrAfter(h.OFFLINE_STANZA_TIMEOUT_MS)}_loadMainScreen(){var e=this;return(0,i.default)((function*(){try{yield(0,m.pruneExpiredMessagesWithAddOns)()}catch(e){throw __LOG__(4,void 0,new Error)`[offline-resume][non-blocking] _onOfflineComplete: pruneExpiredMessages message failed with error: ${e}`,e}(0,y.isWorker)()||(yield function(){return v.apply(this,arguments)}(e._threadMeta),(0,g.readyForMainScreen)()),u.Cmd.readyForProcessOffline(),__LOG__(2)`[offline-resume][non-blocking] start handling offline stanza`}))()}_startOfflineCompleteTimer(e,t){var n;null===(n=this._offlineCompleteTimer)||void 0===n||n.cancel(),this._offlineCompleteTimer=new a.ShiftTimer((()=>{this._status!==h.ResumeStatus.COMPLETE&&(__LOG__(2)`[offline-resume][non-blocking]: offline session completed by timeout`,this.processOfflineSessionComplete(e+t),this._offlineCompleteTimer=null,S.OfflineResumeReporter.logMissedOfflineComplete())})),this._offlineCompleteTimer.onOrAfter(h.OFFLINE_STANZA_TIMEOUT_MS)}_handleOfflineComplete(){var e=this;return(0,i.default)((function*(){yield(0,_.waitForOfflineMsgThread)(),S.OfflineResumeReporter.logOfflineDecryptionErrorCount(e._decryptionErrorCount),S.OfflineResumeReporter.logLastStanzaT(),__LOG__(2)`[offline-resume][non-blocking] _onOfflineComplete: waitForOfflineMsgThread done, total decryption error: ${e._decryptionErrorCount}`,e._decryptionErrorCount=0,yield(0,g.clearOfflineSnapShot)(),e._maxProgress=97,yield(0,f.updatePeerReceipts)(),e._maxProgress=99,__LOG__(2)`[offline-resume][non-blocking] _onOfflineComplete: clearOfflineSnapShot done.`,u.Cmd.offlineDeliveryEnd(),e._progressBarTimer.cancel(),(0,y.isWorker)()||S.OfflineResumeReporter.commit(),(0,E.enablePersistSignalStore)(),(0,g.runReceiptCleanUpLoop)(),(0,y.isWorker)()||((0,T.workerSafeFireAndForget)("processAllOrphanPaymentNotifications"),(0,l.uploadChatThreadLoggingEvents)(),setTimeout((()=>{(0,o.doPendingDeviceSync)()}),h.OFFLINE_DEVICE_SYNC_DELAY))}))()}}},928621:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UI_UPDATE_TIME_MS=t.ResumeStatus=t.OFFLINE_STANZA_TIMEOUT_MS=t.OFFLINE_STANZA_COUNT_LIMIT=t.OFFLINE_STANZA_COUNT_CHECK_TIMEOUT_MS=t.OFFLINE_PREVIEW_PERIOD_MS=t.OFFLINE_DEVICE_SYNC_DELAY=void 0;const r=n(76672)({INIT:"INIT",RESUME_ON_RESTART:"RESUME_ON_RESTART",RESUME_WITH_OPEN_TAB:"RESUME_WITH_OPEN_TAB",COMPLETE:"COMPLETE"});t.ResumeStatus=r;t.OFFLINE_STANZA_COUNT_CHECK_TIMEOUT_MS=2e4;t.OFFLINE_STANZA_COUNT_LIMIT=100;t.OFFLINE_DEVICE_SYNC_DELAY=2e3;t.OFFLINE_STANZA_TIMEOUT_MS=6e4;t.OFFLINE_PREVIEW_PERIOD_MS=1e3;t.UI_UPDATE_TIME_MS=1e3},538222:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.clearOfflineSnapShot=function(){return E.apply(this,arguments)},t.exceedResumeWithOpenTabLimit=function(e,t){return e+t>y||e>g&&e+t>m},t.readyForMainScreen=function(){u.Cmd.readyForMainStreamMode(),f.OfflineResumeReporter.logMainScreenLoadT(),_.setMainStreamModeReadyT()},t.refreshWindow=function(){var e;(null===(e=window.location)||void 0===e?void 0:e.reload)&&window.location.reload()},t.runReceiptCleanUpLoop=function(){return(0,s.promiseLoop)(function(){var e=(0,i.default)((function*(e,t,n){const r=(0,o.delayMs)((0,a.expBackoff)(n,12e4,1e3,.1));try{return yield(0,l.clearDanglingReceipts)(),__LOG__(2)`[offline-resume][utils] runReceiptCleanUpLoop: done.`,e()}catch(t){return __LOG__(2)`[offline-resume][utils] runReceiptCleanUpLoop: failed with error ${t}.`,n>3?(__LOG__(3)`[offline-resume][utils] runReceiptCleanUpLoop: Gave up clean up receipts ${n} tries`,e()):r}}));return function(){return e.apply(this,arguments)}}())};var i=r(n(348926)),a=n(989211),o=n(36530),s=n(962833),l=n(822017),u=n(780549),c=n(800321),d=(n(724469),n(319169)),p=n(280464),_=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=h(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(218925)),f=n(209983);function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(h=function(e){return e?n:t})(e)}const g=20,m=50,y=200;function E(){return(E=(0,i.default)((function*(){(0,c.getMessageCache)().createSnapshot(),p.OfflinePendingDeviceCache.createSnapshot();const e=[(0,c.getMessageCache)().checkpointQueue.wait(),p.OfflinePendingDeviceCache.checkpointQueue.wait()];e.push(d.receiptBatcher.runActiveBatches()),yield Promise.all(e)}))).apply(this,arguments)}},889263:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.pruneExpiredMessagesWithAddOns=function(){return u.apply(this,arguments)};var i=r(n(348926)),a=n(599459),o=n(359987),s=r(n(565754)),l=n(323829);function u(){return(u=(0,i.default)((function*(){const e=yield(0,a.pruneExpiredMessages)(),t=e.length;if(t>0){const r=n(628905).getJobManager,i=[],a=new Set;e.forEach((e=>{const t=e.id.toString();a.add(s.default.fromString(t).remote.toString()),i.push(t)}));const u=Array.from(a.values()).join(",").toString();(0,o.frontendFireAndForget)("deleteModelsForLastAddOnPreview",{messagesIds:i}),yield r().waitUntilPersisted(l.jobSerializers.deleteAddOns(u,i)),__LOG__(2)`[offline-resume][utils] pruneExpiredMessagesWithAddOns: pruneExpiredMessages pruned ${t} msg(s)`}}))).apply(this,arguments)}},21094:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.decodeBytes=u,t.decodeUrl=function(e){return e&&!e.includes("/u/")?e:void 0},t.parseContactMessageProto=function(e,t){e.type=o.MSG_TYPE.VCARD,e.vcardFormattedName=t.displayName,e.body=t.vcard},t.parseContactsArrayMessageProto=function(e,t){const n=t.contacts;e.type=o.MSG_TYPE.MULTI_VCARD,e.vcardFormattedName=t.displayName,e.vcardList=Array.isArray(n)?n.map((e=>({displayName:e.displayName,vcard:e.vcard}))):[]},t.parseInviteGrpType=function(e){switch(e){case s.Message$ExtendedTextMessage$InviteLinkGroupType.PARENT:return a.GroupType.COMMUNITY;case s.Message$ExtendedTextMessage$InviteLinkGroupType.SUB:return a.GroupType.SUBGROUP;case s.Message$ExtendedTextMessage$InviteLinkGroupType.DEFAULT_SUB:return a.GroupType.DEFAULT_ANNOUNCEMENT_GROUP;default:return a.GroupType.DEFAULT}},t.parseLocationMessageProto=function(e,t){const n=t.name&&t.address?`${t.name}\n${t.address}`:t.name||t.address||"";e.type=o.MSG_TYPE.LOCATION,e.lat=void 0!==t.degreesLatitude?t.degreesLatitude:void 0,e.lng=void 0!==t.degreesLongitude?t.degreesLongitude:void 0,e.loc=n,e.body=u(t.jpegThumbnail)||"",e.clientUrl=t.url},t.validateRequiredMediaProperties=function(e,t){var n;if(Math.random()>.001)return;if(!e.id)return;if("status"===(null===(n=e.id.remote)||void 0===n?void 0:n.user)&&l.default.isPSA(e.author)&&!t.staticUrl)return;if(e.id.fromMe)return;const r=e.type;null==t.directPath&&null==t.fileEncSha256?(__LOG__(2,void 0,void 0,!0)`directPath and fileEncSha256 missing from msg type ${r}`,SEND_LOGS(`${r}-message-missing-direct-path-and-file-enc`)):null==t.directPath?(__LOG__(2,void 0,void 0,!0)`directPath missing from msg type ${r}`,SEND_LOGS(`${r}-message-missing-direct-path`)):null==t.fileEncSha256&&(__LOG__(2,void 0,void 0,!0)`fileEncSha256 missing from msg type ${r}`,SEND_LOGS(`${r}-message-missing-file-enc`));null==t.url&&(__LOG__(2,void 0,void 0,!0)`url(deprecatedMms3Url) is missing from msg type ${r}`,SEND_LOGS(`${r}-message-missing-mms3-url`));null==t.mediaKey&&(__LOG__(2,void 0,void 0,!0)`mediaKey is missing from msg type ${r}`,SEND_LOGS(`${r}-message-missing-media-key`))};var i=n(417405),a=n(862159),o=n(373070),s=n(533494),l=r(n(124928));function u(e){return e?(0,i.encodeB64)(e):void 0}},218925:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setMainStreamModeReadyT=function(){},t.setStartCommsT=function(){};n(117429)},608182:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.RESEND_TIMEOUT_IN_SECONDS=void 0,t.createMessageResendMetric=function(e,t){const n={e2eBackfill:!0,messageType:e.getWamMessageType(),messageIsRevoke:t,messageSendResultIsTerminal:!1,isViewOnce:Boolean(e.isViewOnce),isAReply:(0,p.isReplyMsg)(e),isLid:e.to.isLid()};return new E.default.MessageSend(n)},t.editAttribute=function(e,t){if(v(e)){const e="admin_revoke"===t?l.EDIT_ATTR.ADMIN_REVOKE:l.EDIT_ATTR.SENDER_REVOKE;return(0,o.CUSTOM_STRING)(String(e))}if(function(e){return null!=e.reactionMessage&&e.reactionMessage.text===f.REVOKED_REACTION_TEXT}(e))return(0,o.CUSTOM_STRING)(String(l.EDIT_ATTR.SENDER_REVOKE));if(function(e){return null!=e.keepInChatMessage&&null!=e.keepInChatMessage.key&&!0===e.keepInChatMessage.key.fromMe&&e.keepInChatMessage.keepType===_.KeepType.UNDO_KEEP_FOR_ALL}(e))return(0,o.CUSTOM_STRING)(String(l.EDIT_ATTR.SENDER_REVOKE));if(function(e){var t,n,r,i,a;return(null!==(t=null===(n=e.protocolMessage)||void 0===n?void 0:n.type)&&void 0!==t?t:null===(r=e.editedMessage)||void 0===r||null===(i=r.message)||void 0===i||null===(a=i.protocolMessage)||void 0===a?void 0:a.type)===_.Message$ProtocolMessage$Type.MESSAGE_EDIT}(e))return(0,o.CUSTOM_STRING)(String(l.EDIT_ATTR.MESSAGE_EDIT));return o.DROP_ATTR},t.encodeAndPad=function(e){const t=(0,T.encodeProtobuf)(_.MessageSpec,e);return(0,g.writeRandomPadMax16)(t),t.readByteArray()},t.filterDeviceWithChangedIdentity=function(){return O.apply(this,arguments)},t.isPrimaryDevice=function(e){return null==e.device||e.device===a.DEFAULT_DEVICE_ID},t.isRevokeMsg=v,t.populateICDCMeta=function(){return C.apply(this,arguments)},t.sendMsgAckSyncParser=void 0,t.updateIdentityRange=function(){return P.apply(this,arguments)};var i=r(n(348926)),a=n(616310),o=n(738102),s=n(769707),l=n(402994),u=n(476462),c=n(21838),d=n(358891),p=n(973480),_=n(533494),f=n(403385),h=n(121260),g=n(999821),m=r(n(9705)),y=n(459857),E=r(n(571834)),S=n(669050),T=n(653313);function v(e){return null!=e.protocolMessage&&e.protocolMessage.type===_.Message$ProtocolMessage$Type.REVOKE}t.RESEND_TIMEOUT_IN_SECONDS=300;const A=new s.WapParser("sendMsgAckSyncParser",(e=>(e.assertTag("ack"),{t:e.attrTime("t"),sync:e.hasAttr("sync")?e.attrString("sync"):null,phash:e.hasAttr("phash")?e.attrString("phash"):null,count:e.hasAttr("count")?e.attrInt("count"):null})));function C(){return(C=(0,i.default)((function*(e,t){const n=(0,y.getMeUser)();let r,i;try{r=yield(0,d.getICDCMeta)(n)}catch(e){throw new E.default.AdvMetadataCreationFailure({advMetadataIsMe:!0}).commit(),e}try{i=e.equals(n)?null:yield(0,d.getICDCMeta)(e)}catch(e){throw new E.default.AdvMetadataCreationFailure({advMetadataIsMe:!1}).commit(),e}(0,c.populateMessageContextInfo)(t,r,i)}))).apply(this,arguments)}function P(){return(P=(0,i.default)((function*(e,t){const n=yield(0,h.getTable)().get(String(e),!1);null!=(null==n?void 0:n.rowId)&&(yield m.default.updateIdentityRangeAfterEncryption(n.rowId,t.map((e=>(0,g.createSignalAddress)(e).toString()))))}))).apply(this,arguments)}function O(){return(O=(0,i.default)((function*(e,t){const n=yield(0,h.getTable)().get(String(e),!1),r=null==n?void 0:n.rowId;if(null==r)return __LOG__(2)`filterDeviceWithChangedIdentity: get message with empty rowId`,[];const i=new Map;t.forEach((e=>{i.set((0,u.createDeviceListPK)(e),e)}));const o=Array.from(i.values()).map((e=>(0,S.createDeviceWidFromUserAndDevice)(e.user,e.server,a.DEFAULT_DEVICE_ID))),s=yield m.default.bulkGetIdentityRowId(o.map((e=>(0,g.createSignalAddress)(e).toString()))),l=new Set;return s.forEach(((e,t)=>{const n=o[t];(null==e||e>r)&&l.add((0,u.createDeviceListPK)(n))})),t.filter((e=>!l.has((0,u.createDeviceListPK)(e))))}))).apply(this,arguments)}t.sendMsgAckSyncParser=A},138706:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Session=t.CryptoLibrary=t.Cipher=void 0;var r=o(n(697416)),i=o(n(743275));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}function o(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}const s=r;t.Cipher=s;const l=i;t.Session=l;t.CryptoLibrary=null},697416:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.decryptGroupSignalProto=function(){return d.apply(this,arguments)},t.decryptSignalProto=function(){return u.apply(this,arguments)},t.encryptSenderKeyMsgSignalProto=function(){return p.apply(this,arguments)},t.encryptSignalProto=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(303754),o=n(91923),s=n(999821),l=n(76256);function u(){return(u=(0,i.default)((function*(e,t,n){const r=new self.libsignal.SessionCipher((0,l.getSignalProtocolStore)(),(0,s.createSignalAddress)(e));try{const e=yield Promise.resolve(r);let i;switch(t){case a.CiphertextType.Pkmsg:i=yield e.decryptPreKeyWhisperMessage(n);break;case a.CiphertextType.Msg:i=yield e.decryptWhisperMessage(n);break;default:return Promise.reject(new Error(`decryptSignalProto: Received unsupported msg type ${t}`))}return i}catch(e){if(e&&"call_failure"===e.reason&&e.value&&"number"==typeof e.value.result)__LOG__(3)`decryptSignalProto error code ${e.value.result}`;else{if(e&&"MessageCounterError"===e.name)return Promise.reject(new o.SignalMessageCounterError(e));__LOG__(3)`decryptSignalProto js error ${e}`}return Promise.reject(new o.SignalDecryptionError(e))}}))).apply(this,arguments)}function c(){return(c=(0,i.default)((function*(e,t){const n=yield new self.libsignal.SessionCipher((0,l.getSignalProtocolStore)(),(0,s.createSignalAddress)(e)),{type:r,body:i}=yield n.encrypt(t);return __LOG__(2)`encryptSignalProto complete, type=${r}`,{type:3===r?a.CiphertextType.Pkmsg:a.CiphertextType.Msg,ciphertext:(0,s.strToBuffer)(i)}}))).apply(this,arguments)}function d(){return(d=(0,i.default)((function*(e,t,n){try{const r=yield new self.libsignal.GroupCipher((0,l.getSignalProtocolStore)(),e.toString({legacy:!0}),(0,s.createSignalAddress)(t));return yield r.decryptSenderKeyMessage(n)}catch(e){if(e&&"MessageCounterError"===e.name)throw new o.SignalMessageCounterError(e);throw new o.SignalDecryptionError(e)}}))).apply(this,arguments)}function p(){return(p=(0,i.default)((function*(e,t,n){const r=new self.libsignal.GroupCipher((0,l.getSignalProtocolStore)(),e.toString({legacy:!0}),(0,s.createSignalAddress)(t)),i=yield Promise.resolve(r).then((e=>e.encrypt(n)));return{ciphertext:(0,s.strToBuffer)(i)}}))).apply(this,arguments)}},351173:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.maybeConvertSession=function(){return a.apply(this,arguments)};var i=r(n(348926));n(403206),n(492917),n(76256);function a(){return(a=(0,i.default)((function*(e){return e}))).apply(this,arguments)}},431028:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.generateIdentityKeyPair=function(){return u.apply(this,arguments)},t.generatePreKeyPair=function(){return s.apply(this,arguments)},t.generateSignedKeyPair=function(){return l.apply(this,arguments)};var i=r(n(348926)),a=n(403206),o=n(492917);function s(){return(s=(0,i.default)((function*(e){(0,o.isCryptoLibraryEnabled)();const t=yield self.libsignal.KeyHelper.generatePreKey(e),{keyId:n,keyPair:r}=t;return{keyId:n,keyPair:(0,a.toCurveKeyPair)(r),isDirectDistribution:0}}))).apply(this,arguments)}function l(){return(l=(0,i.default)((function*(e,t){(0,o.isCryptoLibraryEnabled)();const n=yield self.libsignal.KeyHelper.generateSignedPreKey(e,t),{keyId:r,keyPair:i,signature:s}=n;return{keyId:r,keyPair:(0,a.toCurveKeyPair)(i),signature:s}}))).apply(this,arguments)}function u(){return(u=(0,i.default)((function*(){(0,o.isCryptoLibraryEnabled)();const e=yield self.libsignal.KeyHelper.generateIdentityKeyPair();return(0,a.toCurveKeyPair)(e)}))).apply(this,arguments)}},743275:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.createGroupSignalSession=function(){return T.apply(this,arguments)},t.createSignalSession=function(){return f.apply(this,arguments)},t.deleteDeviceSenderKey=function(e){const t=String((0,c.createSignalAddress)(e));return _.waSignalStore.removeSenderKeyBySenderId(t)},t.deleteGroupSenderKeyInfo=function(e,t){const n=(0,c.createSignalAddress)(t),r=`${e.toString({legacy:!0})}::${n.toString()}`;return _.waSignalStore.removeSenderKey(r)},t.deleteRemoteInfo=function(){return g.apply(this,arguments)},t.deleteRemoteSession=function(e){const t=(0,c.createSignalAddress)(e).toString();return(0,d.getSignalProtocolStore)().removeSession(t)},t.getGroupSenderKeyInfo=function(){return v.apply(this,arguments)},t.getRemoteRegId=function(){return h.apply(this,arguments)},t.hasSameBaseKey=function(){return S.apply(this,arguments)},t.hasSignalSessions=function(e){return p.default.containSessions(e.map((e=>(0,c.createSignalAddress)(e).toString())))},t.saveSessionBaseKey=function(){return E.apply(this,arguments)};var i=r(n(348926)),a=n(551168),o=n(616310),s=n(678002),l=n(403206),u=n(492917),c=n(999821),d=n(76256),p=r(n(9705)),_=n(326314);n(574819);function f(){return(f=(0,i.default)((function*(e){const{wid:t,identity:n,deviceIdentity:r}=e;if(__LOG__(2)`Signal::createSignalSession with `,null!=t.device&&t.device!==o.DEFAULT_DEVICE_ID){if(!r)throw new Error("Signal::createSignalSession: expected device-identity in keyBundle for companion device");if(!(yield(0,s.validateADVwithIdentityKey)(t,r,n)))throw new Error("Signal::createSignalSession: invalid identityKey fetched")}let i,d,_;try{i=(0,l.toSignalCurvePubKey)(new a.Binary(e.identity).readBuffer())}catch(e){throw __LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("Signal::createSignalSession: invalid identityKey fetched"),e}try{d=(0,l.toSignalCurvePubKey)(new a.Binary(e.skey.pubkey).readBuffer())}catch(e){throw __LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("Signal::createSignalSession: invalid signedPreKey fetched"),e}if(e.key)try{_=(0,l.toSignalCurvePubKey)(new a.Binary(e.key.pubkey).readBuffer())}catch(e){__LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("Signal::createSignalSession: invalid preKey fetched")}const f={registrationId:e.regId,identityKey:i,signedPreKey:{keyId:e.skey.id,publicKey:d,signature:new a.Binary(e.skey.signature).readBuffer()}};return e.key&&_&&(f.preKey={keyId:e.key.id,publicKey:_}),(0,u.isCryptoLibraryEnabled)(),new self.libsignal.SessionBuilder(p.default,(0,c.createSignalAddress)(t)).processPreKey(f)}))).apply(this,arguments)}function h(){return(h=(0,i.default)((function*(e){(0,u.isCryptoLibraryEnabled)();const t=new self.libsignal.SessionCipher(p.default,(0,c.createSignalAddress)(e));return(yield Promise.resolve(t)).getRemoteRegistrationId()}))).apply(this,arguments)}function g(){return(g=(0,i.default)((function*(e){const t=(0,c.createSignalAddress)(e).toString();yield Promise.all([(0,d.getSignalProtocolStore)().removeIdentity(t),(0,d.getSignalProtocolStore)().removeSession(t)])}))).apply(this,arguments)}function m(){return y.apply(this,arguments)}function y(){return(y=(0,i.default)((function*(e,t){return(0,u.isCryptoLibraryEnabled)(),e.getSessionBaseKey()}))).apply(this,arguments)}function E(){return(E=(0,i.default)((function*(e,t){const n=(0,c.createSignalAddress)(e),r=new self.libsignal.SessionInfo(p.default,n),i=yield m(r,e);i?yield _.waSignalStore.saveBaseKey(n.toString(),t,i):__LOG__(2)`saveSessionBaseKey: for ${t}, no basekey provided`}))).apply(this,arguments)}function S(){return(S=(0,i.default)((function*(e,t){const n=(0,c.createSignalAddress)(e),r=new self.libsignal.SessionInfo(p.default,(0,c.createSignalAddress)(e)),[i,a]=yield Promise.all([m(r,e),_.waSignalStore.loadBaseKey(n.toString(),t)]);return a?i?(0,c.bufferEqual)(a,i)?(__LOG__(2)`hasSameBaseKey: MsgId: ${t}, savedBaseKey and sessionBaseKey is same`,!0):(__LOG__(2)`hasSameBaseKey: MsgId: ${t}, savedBaseKey and sessionBaseKey is different `,!1):(__LOG__(2)`hasSameBaseKey: MsgId: ${t}, no session has been saved locally `,!1):(__LOG__(2)`hasSameBaseKey: MsgId: ${t}, no base key has been saved locally `,!1)}))).apply(this,arguments)}function T(){return(T=(0,i.default)((function*(e,t,n){(0,u.isCryptoLibraryEnabled)();const r=new self.libsignal.GroupCipher((0,d.getSignalProtocolStore)(),t,(0,c.createSignalAddress)(e));return(yield Promise.resolve(r)).decryptSenderKeyDistributionMessage(n)}))).apply(this,arguments)}function v(){return(v=(0,i.default)((function*(e,t){const n=new self.libsignal.GroupCipher(p.default,e.toString({legacy:!0}),(0,c.createSignalAddress)(t)),r=yield n.createSenderKeyDistributionMsg();return(0,c.strToBuffer)(r)}))).apply(this,arguments)}},732974:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractIdentityKey=function(e){(0,a.isCryptoLibraryEnabled)(),0;const t=self.dcodeIO.ByteBuffer.wrap(e);t.readUint8();try{const e=self.libsignal.Protobuf.PreKeyWhisperMessage.decode(t);return(0,i.toCurveKeyPubKey)(e.identityKey.toArrayBuffer())}catch(e){return __LOG__(3)`extractIdentityKey: parse proto failed`,null}},t.xmppPreKey=function(e){return(0,r.wap)("key",null,(0,r.wap)("id",null,(0,r.BIG_ENDIAN_CONTENT)(e.keyId,3)),(0,r.wap)("value",null,e.keyPair.pubKey))},t.xmppSignedPreKey=function(e){return(0,r.wap)("skey",null,(0,r.wap)("id",null,(0,r.BIG_ENDIAN_CONTENT)(e.keyId,3)),(0,r.wap)("value",null,e.keyPair.pubKey),(0,r.wap)("signature",null,e.signature))};var r=n(738102),i=n(403206),a=n(492917)},91923:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SignalMessageCounterError=t.SignalDecryptionError=void 0;var r=n(643930);class i extends((0,r.customError)("SignalDecryptionError")){}t.SignalDecryptionError=i;class a extends((0,r.customError)("SignalMessageCounterError")){}t.SignalMessageCounterError=a},999821:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bufferEqual=function(e,t){if(!e||!t)return!1;if(e.byteLength!==t.byteLength)return!1;const n=new DataView(e),r=new DataView(t);for(let e=0;e<n.byteLength;e++)if(n.getUint8(e)!==r.getUint8(e))return!1;return!0},t.bufferToStr=function(e){return new self.dcodeIO.ByteBuffer.wrap(e).toString("binary")},t.createSignalAddress=function(e){if(!(e.isUser()||e.isServer()||e.isPSA()))throw new Error(`Jid ${e.toString({legacy:!0})} is not fully qualified, jid.server should be "s.whatsapp.net"`);return new self.libsignal.SignalProtocolAddress(e.getSignalAddress(),0)},t.strToBuffer=function(e){return new self.dcodeIO.ByteBuffer.wrap(e,"binary").toArrayBuffer()},t.writeRandomPadMax16=function(e){const t=new Uint8Array(1);self.crypto.getRandomValues(t),function(e,t){for(let n=0;n<t;n++)e.writeUint8(t)}(e,1+(15&t[0]))}},437174:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.META_KEYS=void 0;t.META_KEYS={REG_ID:"signal_reg_id",STATIC_PUBKEY:"signal_static_pubkey",STATIC_PRIVKEY:"signal_static_privkey",NEXT_PK_ID:"signal_next_pk_id",LAST_SPK_ID:"signal_last_spk_id",FIRST_UNUPLOAD_PK_ID:"signal_first_unupload_pk_id",SERVER_HAS_KEY:"signal_sever_has_pre_keys",ADV_SIGNED_IDENTIY:"adv_signed_identity"}},326314:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.waSignalStore=void 0;var i=r(n(348926)),a=n(437174),o=n(704548),s=n(397981);const l={name:"AES-CTR",length:128,counter:new Uint8Array(16)};function u(e){return self.crypto.subtle.generateKey({name:l.name,length:l.length},!1,["encrypt","decrypt"]).then((t=>self.crypto.subtle.encrypt(l,t,e).then((e=>({encKey:t,value:e})))))}function c(e){return self.crypto.subtle.decrypt(l,e.encKey,e.value)}const d=new class{constructor(){this.idToSignedPreKey=new Map}getMeta(e){return(0,o.getMetaTable)().get(e).then((e=>e?e.value:null))}putMeta(e){return(0,i.default)((function*(){const t=(0,o.getMetaTable)(),n=e.map((e=>t.createOrReplace(e)));yield Promise.all(n)}))()}setServerHasPreKeys(e){this.putMeta([{key:a.META_KEYS.SERVER_HAS_KEY,value:e}])}getServerHasPreKeys(){return this.getMeta(a.META_KEYS.SERVER_HAS_KEY)}putADVSignedIdentity(e){return this.putMeta([{key:a.META_KEYS.ADV_SIGNED_IDENTIY,value:e}])}getADVSignedIdentity(){return this.getMeta(a.META_KEYS.ADV_SIGNED_IDENTIY)}getPreKeysByRange(e,t){return(0,o.getPreKeyTable)().greaterThan(["keyId"],e-1,{limit:t})}getPreKeyById(e){return(0,o.getPreKeyTable)().get(e)}removePreKeyById(e){return(0,o.getPreKeyTable)().remove(e)}bulkRemovePreKey(e){return(0,o.getPreKeyTable)().bulkRemove(e)}putPreKeys(e){return(0,o.getPreKeyTable)().bulkCreateOrReplace(e)}markPreKeyAsDirectDistribution(e){return(0,o.getPreKeyTable)().merge(e,{isDirectDistribution:1})}getSignedPreKey(){return this.getMeta(a.META_KEYS.LAST_SPK_ID).then((e=>this.getSignedPreKeyById(e)))}getSignedPreKeyById(e){if(this.idToSignedPreKey.has(e))return Promise.resolve(this.idToSignedPreKey.get(e));return(0,o.getSignedPreKeyTable)().get(e).then((t=>(this.idToSignedPreKey.set(e,t),t)))}putSignedPreKeys(e){return(0,i.default)((function*(){const t=(0,o.getSignedPreKeyTable)(),n=e.map((e=>{const{keyId:n,keyPair:r,signature:i}=e;return t.get(n).then((e=>{if(e)throw Error(`signed preKey id ${n} already exists`);return t.create({keyId:n,keyPair:r,signature:i})}))}));yield Promise.all(n)}))()}putSession(e,t){return(0,o.getSessionTable)().createOrReplace({address:e,session:t})}bulkPutSession(e){return(0,o.getSessionTable)().bulkCreateOrReplace(e)}removeSession(e){return(0,o.getSessionTable)().remove(e)}bulkRemoveSession(e){return(0,o.getSessionTable)().bulkRemove(e)}getSession(e){return(0,o.getSessionTable)().get(e).then((e=>e?e.session:null))}bulkGetSession(e){return(0,o.getSessionTable)().bulkGet(e).then((e=>e.map((e=>e?e.session:null))))}putIdentity(e,t){return(0,o.getIdentityTable)().createOrReplace({identifier:e,identityKey:t})}bulkPutIdentity(e){return(0,o.getIdentityTable)().bulkCreateOrReplace(e)}bulkGetIdentity(e){return(0,o.getIdentityTable)().bulkGet(e).then((e=>e.map((e=>e?e.identityKey:null))))}getIdentity(e){return(0,o.getIdentityTable)().get(e).then((e=>e?e.identityKey:null))}removeIdentity(e){return(0,o.getIdentityTable)().remove(e)}bulkRemoveIdentity(e){return(0,o.getIdentityTable)().bulkRemove(e)}getIdentityKeyWithRowId(e){return(0,o.getIdentityTable)().get(e).then((e=>e?{identityKey:e.identityKey,rowId:e.rowId}:null))}bulkGetIdentityKeyWithRowId(e){return(0,o.getIdentityTable)().bulkGet(e).then((e=>e.map((e=>e?{identityKey:e.identityKey,rowId:e.rowId}:null))))}bulkPutIdentityKeyWithRowId(e){return(0,o.getIdentityTable)().bulkCreateOrReplace(e)}saveBaseKey(e,t,n){return(0,o.getBaseKeyTable)().createOrReplace({address:e,originalMsgId:t,baseKey:n})}loadBaseKey(e,t){return(0,o.getBaseKeyTable)().equals(["address","originalMsgId"],[e,t]).then((e=>e&&0!==e.length?e[0].baseKey:null))}deleteBaseKey(e,t){const n=(0,o.getBaseKeyTable)();return n.equals(["address","originalMsgId"],[e,t]).then((e=>{if(e&&0!==e.length)return n.remove(e[0].id)}))}putSenderKey(e,t,n){return(0,o.getSenderKeyTable)().createOrReplace({senderKeyName:e,senderId:t,senderKey:n})}bulkPutSenderKey(e){return(0,o.getSenderKeyTable)().bulkCreateOrReplace(e)}removeSenderKey(e){return(0,o.getSenderKeyTable)().remove(e)}getSenderKey(e){return(0,o.getSenderKeyTable)().get(e).then((e=>e?e.senderKey:null))}removeSenderKeyBySenderId(e){const t=(0,o.getSenderKeyTable)();return t.equals(["senderId"],e).then((e=>t.bulkRemove(e.map((e=>e.senderKeyName)))))}clearCredential(){const e=[(0,o.getIdentityTable)(),(0,o.getMetaTable)(),(0,o.getPreKeyTable)(),(0,o.getSessionTable)(),(0,o.getSignedPreKeyTable)()];return Promise.all(e.map((e=>e.clear()))).then((()=>{}))}getRegistrationInfo(){return null!=this.registrationInfo?Promise.resolve(this.registrationInfo):Promise.all([this.getMeta(a.META_KEYS.REG_ID),this.getMeta(a.META_KEYS.STATIC_PUBKEY),this.getMeta(a.META_KEYS.STATIC_PRIVKEY)]).then((e=>{let[t,n,r]=e;if(t&&n&&r)return Promise.all([c(n),c(r)]).then((e=>{let[n,r]=e;return this.registrationInfo={registrationId:t,identityKeyPair:{pubKey:n,privKey:r}},this.registrationInfo}))}))}setRegistrationInfo(e){var t=this;return(0,i.default)((function*(){yield Promise.all([u(e.identityKeyPair.pubKey),u(e.identityKeyPair.privKey)]).then((n=>{let[r,i]=n;return Promise.all([t.putMeta([{key:a.META_KEYS.REG_ID,value:e.registrationId},{key:a.META_KEYS.STATIC_PUBKEY,value:r},{key:a.META_KEYS.STATIC_PRIVKEY,value:i}])])}))}))()}getOrGenPreKeys(e,t){return(0,s.getStorage)().lock(["signal-meta-store","prekey-store"],(()=>Promise.all([this.getMeta(a.META_KEYS.FIRST_UNUPLOAD_PK_ID),this.getMeta(a.META_KEYS.NEXT_PK_ID)]).then((n=>{let[r,i]=n;const a=r||1,o=i||1,s=o-a,l=e-s;if(l<=0)return __LOG__(2)`getPreKeys: no prekey needs to be generated, avaliable: ${s}, need: ${e}`,this.getPreKeysByRange(a,e);const u=function(e,t){const n=[];for(let r=e;r<t;r++)n.push(r);return n}(o,o+l).map((e=>t(e)));return Promise.all(u).then((e=>this.savePreKeys(e))).then((()=>this.getPreKeysByRange(a,e)))}))))}getOrGenSinglePreKey(e){return this.getOrGenPreKeys(1,e).then((e=>{if(1!==e.length)throw Error("Expected to get exactly one key but got ${keys.length}");return e[0]}))}savePreKeys(e){var t=this;return(0,i.default)((function*(){if(0===e.length)return;const n=e[e.length-1];yield Promise.all([t.putMeta([{key:a.META_KEYS.NEXT_PK_ID,value:n.keyId+1}]),t.putPreKeys(e)])}))()}markKeyAsUploaded(e){return Promise.all([this.getMeta(a.META_KEYS.FIRST_UNUPLOAD_PK_ID),this.getMeta(a.META_KEYS.NEXT_PK_ID)]).then((t=>{let[n,r]=t;if(e<0||!r||e>=r)throw Error(`markKeyAsUploaded: key ${e} is out of boundary.`);const i=n?Math.max(n,e+1):e+1;return this.putMeta([{key:a.META_KEYS.FIRST_UNUPLOAD_PK_ID,value:i}])}))}rotateSignedPreKey(e,t){return(0,s.getStorage)().lock(["signal-meta-store","signed-prekey-store"],(()=>this.getMeta(a.META_KEYS.LAST_SPK_ID).then((n=>{const r=null==n?1:n+1;return t(e,r).then((e=>(this.putSignedPreKeys([e]),this.putMeta([{key:a.META_KEYS.LAST_SPK_ID,value:r}]),e)))}))))}};t.waSignalStore=d},492917:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isCryptoLibraryEnabled=function(){return!1};n(287461)},33746:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringifyIdentityKey=function(e){if(e instanceof ArrayBuffer)return(0,r.bufferToStr)(e);return e};var r=n(999821)},76256:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.enableMemSignalStore=function(){a=n(509677).Z},t.enablePersistSignalStore=function(){a=i.default},t.getSignalProtocolStore=function(){return a};var i=r(n(9705));let a=i.default},426122:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.SignalStoreCache=void 0;var i=r(n(150361)),a=n(432921);t.SignalStoreCache=class{constructor(){this.RegistrationInfo=null,this.SignedPreKeyStore=new Map,this.PrekeyStore=new Map,this.SessionStore=new Map,this.IdentityStore=new Map,this.SenderKeyStore=new Map,this.Mutex={session:new a.Semaphore,identity:new a.Semaphore,senderKey:new a.Semaphore,preKey:new a.Semaphore},this.Dirty={session:new Set,identity:new Set,senderKey:new Set,preKey:new Set}}_generateSessionUpdate(){const e=[],t=[];return this.Dirty.session.forEach((n=>{const r=this.SessionStore.get(n);r&&(r.deleted?t.push(n):e.push({address:n,session:(0,i.default)(r.session)}))})),{update:e,remove:t}}_generateSenderKeyUpdate(){const e=[];return this.Dirty.senderKey.forEach((t=>{const n=this.SenderKeyStore.get(t);if(n){const r=t.split("::");2===r.length&&e.push({senderKeyName:t,senderId:r[1],senderKey:(0,i.default)(n)})}})),e}_generateIdentityUpdate(){const e=[],t=[];return this.Dirty.identity.forEach((n=>{const r=this.IdentityStore.get(n);r&&(r.deleted?t.push(n):e.push({identifier:n,identityKey:r.identityKey,rowId:r.rowId}))})),{update:e,remove:t}}_generatePreKeyUpdate(){const e=[];return this.Dirty.preKey.forEach((t=>{const n=this.PrekeyStore.get(t);(null==n?void 0:n.deleted)&&e.push(parseInt(t,10))})),e}generateCacheUpdate(){const e=this._generateIdentityUpdate(),t=this._generateSessionUpdate();return{sessionUpdate:t.update,sessionRemove:t.remove,identityUpdate:e.update,identityRemove:e.remove,senderKeyUpdate:this._generateSenderKeyUpdate(),preKeyRemove:this._generatePreKeyUpdate()}}clearDirty(){this.Dirty={session:new Set,identity:new Set,senderKey:new Set,preKey:new Set}}}},9705:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=r(n(348926)),o=n(432921),s=n(359987),l=n(403206),u=n(74869),c=n(33746),d=n(999821),p=n(351173),_=n(397981),f=n(326314),h=n(459857);var g=new class{constructor(){this.Direction={SENDING:1,RECEIVING:2},this.RegistrationInfoReadThruCache=null,this.SignedPreKeyStoreReadThruCache=new Map,this.SessionCache=new Map,this.SessionCacheDirtySet=new Set,this._sessionMutex=new o.Semaphore(1),this.IdentityCache=new Map,this.IdentityCacheDirtySet=new Set,this._identityMutex=new o.Semaphore(1)}getIdentityKeyPair(){var e=this;return(0,a.default)((function*(){var t;return e.RegistrationInfoReadThruCache||(e.RegistrationInfoReadThruCache=yield f.waSignalStore.getRegistrationInfo()),(null===(t=e.RegistrationInfoReadThruCache)||void 0===t?void 0:t.identityKeyPair)?(0,l.toSignalCurveKeyPair)(e.RegistrationInfoReadThruCache.identityKeyPair):void 0}))()}getLocalRegistrationId(){var e=this;return(0,a.default)((function*(){var t;return e.RegistrationInfoReadThruCache||(e.RegistrationInfoReadThruCache=yield f.waSignalStore.getRegistrationInfo()),(null===(t=e.RegistrationInfoReadThruCache)||void 0===t?void 0:t.registrationId)||void 0}))()}isTrustedIdentity(){return Promise.resolve(!0)}saveIdentity(e,t){var n=this;return(0,a.default)((function*(){if(null==e)throw new Error("Tried to put identity key for undefined/null key");const r=(0,c.stringifyIdentityKey)(t),i=yield n.loadIdentityKey(e);if(!i||i!==r){if(i){if(e===(0,d.createSignalAddress)((0,h.getMeUser)()).toString())return void(0,s.frontendFireAndForget)("handleSelfPrimaryIdentityChange",{});yield(0,u.handleNewIdentity)(e)}yield n.putIdentity(e,r)}}))()}_putIdentityImpl(e,t){const n=this.IdentityCache.get(e);this.IdentityCache.set(e,(0,i.default)((0,i.default)({},n),{},{identityKey:t})),this.IdentityCacheDirtySet.add(e)}putIdentity(e,t){var n=this;return(0,a.default)((function*(){const r=yield n._identityMutex.acquire();try{n._putIdentityImpl(e,t)}finally{r.release()}}))()}_loadIdentityKeyImpl(e){var t=this;return(0,a.default)((function*(){var n;if(null==e)throw new Error("Tried to get identity key for undefined/null key");if(!t.IdentityCache.has(e)){const n=yield f.waSignalStore.getIdentityKeyWithRowId(e);t.IdentityCache.set(e,n)}return(null===(n=t.IdentityCache.get(e))||void 0===n?void 0:n.identityKey)||void 0}))()}loadIdentityKey(e){var t=this;return(0,a.default)((function*(){const n=yield t._identityMutex.acquire();try{return yield t._loadIdentityKeyImpl(e)}finally{n.release()}}))()}getIdentityRowId(e){var t=this;return(0,a.default)((function*(){var n;if(null==e)throw new Error("Tried to get identity key for undefined/null key");return yield t.loadIdentityKey(e),(null===(n=t.IdentityCache.get(e))||void 0===n?void 0:n.rowId)||void 0}))()}bulkGetIdentityRowId(e){var t=this;return(0,a.default)((function*(){if(null==e)throw new Error("Tried to get identity key for undefined/null key");return 0===e.length?[]:(yield t.bulkLoadIdentityKey(e),e.map((e=>{var n;return(null===(n=t.IdentityCache.get(e))||void 0===n?void 0:n.rowId)||void 0})))}))()}_bulkLoadIdentityKeyImpl(e){var t=this;return(0,a.default)((function*(){if(null==e)throw new Error("Tried to get identity key for undefined/null key");if(0===e.length)return[];const n=new Array(e.length),r=[];if(e.forEach(((e,i)=>{var a;t.IdentityCache.has(e)?n[i]=null===(a=t.IdentityCache.get(e))||void 0===a?void 0:a.identityKey:r.push({id:e,pos:i})})),r.length>0){(yield f.waSignalStore.bulkGetIdentityKeyWithRowId(r.map((e=>e.id)))).forEach(((e,i)=>{const a=r[i];t.IdentityCache.set(a.id,e),n[a.pos]=null==e?void 0:e.identityKey}))}return n}))()}bulkLoadIdentityKey(e){var t=this;return(0,a.default)((function*(){const n=yield t._identityMutex.acquire();try{return yield t._bulkLoadIdentityKeyImpl(e)}finally{n.release()}}))()}_bulkCreateIdentityImpl(e){var t=this;return(0,a.default)((function*(){if(null==e)throw new Error("Tried to bulk put identity key with undefined/null");__LOG__(2,void 0,void 0,void 0,["Persist protocol store"])`bulkCreateIdentity: store ${e.length} value(s): start`,yield(0,_.getStorage)().lock(["identity-store"],(0,a.default)((function*(){const n=e.map((e=>e.identifier)),r=yield t._bulkLoadIdentityKeyImpl(n),i=e.filter(((e,t)=>!r[t]));i.length>0&&(yield f.waSignalStore.bulkPutIdentity(i),i.forEach((e=>{let{identifier:n,identityKey:r}=e;t.IdentityCache.set(n,{identityKey:r})}))),__LOG__(2,void 0,void 0,void 0,["Persist protocol store"])`bulkCreateIdentity: store ${e.length} value(s) (new: ${i.length}): end`})))}))()}bulkCreateIdentity(e){var t=this;return(0,a.default)((function*(){const n=yield t._identityMutex.acquire();try{yield t._bulkCreateIdentityImpl(e)}finally{n.release()}}))()}_removeIdentityImpl(e){var t=this;return(0,a.default)((function*(){if(null==e)return Promise.reject(new Error("Tried to remove identity key for undefined/null key"));yield f.waSignalStore.removeIdentity(e),t.IdentityCache.delete(e),t.IdentityCacheDirtySet.delete(e)}))()}removeIdentity(e){var t=this;return(0,a.default)((function*(){const n=yield t._identityMutex.acquire();try{yield t._removeIdentityImpl(e)}finally{n.release()}}))()}loadPreKey(e){return(0,a.default)((function*(){if(null==e)return Promise.resolve(void 0);const t=yield f.waSignalStore.getPreKeyById(e);return(null==t?void 0:t.keyPair)||void 0}))()}removePreKey(e){return null==e?Promise.reject(new Error("Tried to remove pre key without keyId")):f.waSignalStore.removePreKeyById(e)}loadSignedPreKey(e){var t=this;return(0,a.default)((function*(){if(null!=e){if(!t.SignedPreKeyStoreReadThruCache.has(e)){const n=yield f.waSignalStore.getSignedPreKeyById(e),r=n?{pubKey:n.keyPair.pubKey,privKey:n.keyPair.privKey,signature:n.signature}:null;t.SignedPreKeyStoreReadThruCache.set(e,r)}return t.SignedPreKeyStoreReadThruCache.get(e)||void 0}}))()}_loadSessionImpl(e){var t=this;return(0,a.default)((function*(){if(null!=e){if(!t.SessionCache.has(e)){const n=yield f.waSignalStore.getSession(e);t.SessionCache.set(e,n)}return(yield(0,p.maybeConvertSession)(t.SessionCache.get(e)))||void 0}}))()}loadSession(e){var t=this;return(0,a.default)((function*(){const n=yield t._sessionMutex.acquire();try{return yield t._loadSessionImpl(e)}finally{n.release()}}))()}_storeSessionImpl(e,t){if(null==e)throw new Error("Tried to put session without identifier");this.SessionCache.set(e,t),this.SessionCacheDirtySet.add(e)}storeSession(e,t){var n=this;return(0,a.default)((function*(){const r=yield n._sessionMutex.acquire();try{n._storeSessionImpl(e,t)}finally{r.release()}}))()}removeSession(e){var t=this;return(0,a.default)((function*(){if(null==e)return Promise.reject(new Error("Tried to remove session without identifier"));yield f.waSignalStore.removeSession(e),t.SessionCache.delete(e),t.SessionCacheDirtySet.delete(e)}))()}_containSessionsImpl(e){var t=this;return(0,a.default)((function*(){const n=[];for(const r of e)t.SessionCache.has(r)||n.push(r);if(n.length>0){(yield f.waSignalStore.bulkGetSession(n)).forEach(((e,r)=>{const i=n[r];t.SessionCache.set(i,e)}))}return e.map((e=>!!t.SessionCache.get(e)))}))()}containSessions(e){var t=this;return(0,a.default)((function*(){const n=yield t._sessionMutex.acquire();try{return yield t._containSessionsImpl(e)}finally{n.release()}}))()}storeSenderKey(e,t){if(null==e)return Promise.reject(new Error("Tried to put senderKey without senderKeyName"));const n=e.split("::");if(n.length<2)return Promise.reject(new Error("Tried to put senderKey with invalid senderKeyName"));const r=n[1];return f.waSignalStore.putSenderKey(e,r,t)}loadSenderKey(e){return(0,a.default)((function*(){if(null==e)return Promise.resolve(void 0);return(yield f.waSignalStore.getSenderKey(e))||void 0}))()}deleteAllCache(){__LOG__(2,void 0,void 0,void 0,["Persist protocol store"])`deleteAllCache`,this.RegistrationInfoReadThruCache=null,this.SignedPreKeyStoreReadThruCache.clear(),this.SessionCache.clear(),this.IdentityCache.clear(),this.SessionCacheDirtySet.clear(),this.IdentityCacheDirtySet.clear()}_flushSessions(){var e=this;return(0,a.default)((function*(){if(0===e.SessionCacheDirtySet.size)return void __LOG__(2,void 0,void 0,void 0,["Persist protocol store"])`flushSessions: no updates`;__LOG__(2,void 0,void 0,void 0,["Persist protocol store"])`flushSessions: get dirty updates for ${Array.from(e.SessionCacheDirtySet).join(",")}`;const t=[];e.SessionCacheDirtySet.forEach((n=>{const r=e.SessionCache.get(n);r&&t.push({address:n,session:r})})),t.length>0&&(yield f.waSignalStore.bulkPutSession(t)),e.SessionCacheDirtySet.clear(),__LOG__(2,void 0,void 0,void 0,["Persist protocol store"])`flushSessions: ${t.length} flushed`}))()}_flushIdentities(){var e=this;return(0,a.default)((function*(){if(0===e.IdentityCacheDirtySet.size)return void __LOG__(2,void 0,void 0,void 0,["Persist protocol store"])`flushIdentities: no updates`;__LOG__(2,void 0,void 0,void 0,["Persist protocol store"])`flushIdentities: get dirty updates for ${Array.from(e.IdentityCacheDirtySet).join(",")}`;const t=[];e.IdentityCacheDirtySet.forEach((n=>{const r=e.IdentityCache.get(n);r&&t.push((0,i.default)((0,i.default)({},r),{},{identifier:n}))})),t.length>0&&(yield f.waSignalStore.bulkPutIdentityKeyWithRowId(t)),e.IdentityCacheDirtySet.clear(),__LOG__(2,void 0,void 0,void 0,["Persist protocol store"])`flushIdentities: ${t.length} flushed`}))()}flushBufferToDiskIfNotMemOnlyMode(){var e=this;return(0,a.default)((function*(){const t=yield e._sessionMutex.acquire(),n=yield e._identityMutex.acquire();try{yield(0,_.getStorage)().lock(["identity-store","session-store"],(()=>Promise.all([e._flushSessions(),e._flushIdentities()])))}finally{n.release(),t.release()}}))()}_updateIdentityRangeAfterEncryptionImpl(e,t){var n=this;return(0,a.default)((function*(){__LOG__(2,void 0,void 0,void 0,["Persist protocol store"])`updateIdentityRangeAfterEncryption: start`,yield n._bulkLoadIdentityKeyImpl(t);const r=[];t.forEach((t=>{const i=n.IdentityCache.get(t);i&&(null==i.rowId||i.rowId>e)&&(n.IdentityCache.set(t,{identityKey:i.identityKey,rowId:e}),n.IdentityCacheDirtySet.add(t),r.push(t))})),__LOG__(2,void 0,void 0,void 0,["Persist protocol store"])`updateIdentityRangeAfterEncryption: ${r.length} updated`}))()}updateIdentityRangeAfterEncryption(e,t){var n=this;return(0,a.default)((function*(){const r=yield n._identityMutex.acquire();try{yield n._updateIdentityRangeAfterEncryptionImpl(e,t)}finally{r.release()}}))()}generateSnapshot(){return null}};t.default=g},509677:(e,t,n)=>{"use strict";var r=n(595318);t.Z=void 0;var i=r(n(348926)),a=n(359987),o=n(403206),s=n(74869),l=n(33746),u=n(999821),c=n(351173),d=n(426122),p=n(397981),_=n(326314),f=n(459857);var h=new class{constructor(){this.Direction={SENDING:1,RECEIVING:2},this._cache=new d.SignalStoreCache}getIdentityKeyPair(){var e=this;return(0,i.default)((function*(){var t;return e._cache.RegistrationInfo||(e._cache.RegistrationInfo=yield _.waSignalStore.getRegistrationInfo()),(null===(t=e._cache.RegistrationInfo)||void 0===t?void 0:t.identityKeyPair)?(0,o.toSignalCurveKeyPair)(e._cache.RegistrationInfo.identityKeyPair):void 0}))()}getLocalRegistrationId(){var e=this;return(0,i.default)((function*(){var t;return e._cache.RegistrationInfo||(e._cache.RegistrationInfo=yield _.waSignalStore.getRegistrationInfo()),(null===(t=e._cache.RegistrationInfo)||void 0===t?void 0:t.registrationId)||void 0}))()}isTrustedIdentity(){return Promise.resolve(!0)}_loadIdentityKeyImpl(e){var t=this;return(0,i.default)((function*(){var n;if(null==e)throw new Error("Tried to get identity key for undefined/null key");if(!t._cache.IdentityStore.has(e)){const n=yield _.waSignalStore.getIdentityKeyWithRowId(e);t._cache.IdentityStore.set(e,n)}return(null===(n=t._cache.IdentityStore.get(e))||void 0===n?void 0:n.identityKey)||void 0}))()}loadIdentityKey(e){var t=this;return(0,i.default)((function*(){const n=yield t._cache.Mutex.identity.acquire();try{return yield t._loadIdentityKeyImpl(e)}finally{n.release()}}))()}_putIdentityImpl(e,t){this._cache.IdentityStore.set(e,{identityKey:t}),this._cache.Dirty.identity.add(e)}putIdentity(e,t){var n=this;return(0,i.default)((function*(){const r=yield n._cache.Mutex.identity.acquire();try{n._putIdentityImpl(e,t)}finally{r.release()}}))()}saveIdentity(e,t){var n=this;return(0,i.default)((function*(){if(null==e)throw new Error("Tried to put identity key for undefined/null key");const r=(0,l.stringifyIdentityKey)(t),i=yield n.loadIdentityKey(e);if(!i||i!==r){if(i){if(e===(0,u.createSignalAddress)((0,f.getMeUser)()).toString())return void(0,a.frontendFireAndForget)("handleSelfPrimaryIdentityChange",{});yield(0,s.handleNewIdentity)(e)}yield n.putIdentity(e,r)}}))()}getIdentityRowId(e){var t=this;return(0,i.default)((function*(){var n;if(null==e)throw new Error("Tried to get identity key for undefined/null key");return yield t.loadIdentityKey(e),(null===(n=t._cache.IdentityStore.get(e))||void 0===n?void 0:n.rowId)||void 0}))()}bulkGetIdentityRowId(e){var t=this;return(0,i.default)((function*(){if(null==e)throw new Error("Tried to get identity key for undefined/null key");return 0===e.length?[]:(yield t.bulkLoadIdentityKey(e),e.map((e=>{var n;return(null===(n=t._cache.IdentityStore.get(e))||void 0===n?void 0:n.rowId)||void 0})))}))()}_bulkLoadIdentityKeyImpl(e){var t=this;return(0,i.default)((function*(){if(null==e)throw new Error("Tried to get identity key for undefined/null key");if(0===e.length)return[];const n=new Array(e.length),r=[];if(e.forEach(((e,i)=>{var a;t._cache.IdentityStore.has(e)?n[i]=null===(a=t._cache.IdentityStore.get(e))||void 0===a?void 0:a.identityKey:r.push({id:e,pos:i})})),r.length>0){(yield _.waSignalStore.bulkGetIdentityKeyWithRowId(r.map((e=>e.id)))).forEach(((e,i)=>{const a=r[i];t._cache.IdentityStore.set(a.id,e),n[a.pos]=null==e?void 0:e.identityKey}))}return n}))()}bulkLoadIdentityKey(e){var t=this;return(0,i.default)((function*(){const n=yield t._cache.Mutex.identity.acquire();try{return yield t._bulkLoadIdentityKeyImpl(e)}finally{n.release()}}))()}_bulkCreateIdentityImpl(e){var t=this;return(0,i.default)((function*(){if(null==e)throw new Error("Tried to bulk put identity key with undefined/null");__LOG__(2,void 0,void 0,void 0,["Persist protocol store"])`[Signal][Identity][unified]bulkCreateIdentity: store ${e.length} value(s): start`,yield(0,p.getStorage)().lock(["identity-store"],(0,i.default)((function*(){const n=e.map((e=>e.identifier)),r=yield t._bulkLoadIdentityKeyImpl(n),i=e.filter(((e,t)=>!r[t]));i.length>0&&(yield _.waSignalStore.bulkPutIdentity(i),i.forEach((e=>{let{identifier:n,identityKey:r}=e;t._cache.IdentityStore.set(n,{identityKey:r})}))),__LOG__(2,void 0,void 0,void 0,["Persist protocol store"])`bulkCreateIdentity: store ${e.length} value(s) (new: ${i.length}): end`})))}))()}bulkCreateIdentity(e){var t=this;return(0,i.default)((function*(){const n=yield t._cache.Mutex.identity.acquire();try{yield t._bulkCreateIdentityImpl(e)}finally{n.release()}}))()}_removeIdentityImpl(e){this._cache.IdentityStore.set(e,{deleted:!0}),this._cache.Dirty.identity.add(e)}removeIdentity(e){var t=this;return(0,i.default)((function*(){if(null==e)return Promise.reject(new Error("Tried to remove identity key for undefined/null key"));const n=yield t._cache.Mutex.identity.acquire();try{yield t._removeIdentityImpl(e)}finally{n.release()}}))()}_loadPreKeyImpl(e){var t=this;return(0,i.default)((function*(){if(null==e)return;if(!t._cache.PrekeyStore.has(e)){var n;const r=null===(n=yield _.waSignalStore.getPreKeyById(e))||void 0===n?void 0:n.keyPair;t._cache.PrekeyStore.set(e,{keyPair:r})}const r=t._cache.PrekeyStore.get(e);return(null==r?void 0:r.keyPair)||void 0}))()}loadPreKey(e){var t=this;return(0,i.default)((function*(){const n=yield t._cache.Mutex.preKey.acquire();try{return yield t._loadPreKeyImpl(e)}finally{n.release()}}))()}_removePreKeyImpl(e){return null==e?Promise.reject(new Error("Tried to remove pre key without keyId")):(this._cache.PrekeyStore.set(e,{deleted:!0}),this._cache.Dirty.preKey.add(e),Promise.resolve())}removePreKey(e){var t=this;return(0,i.default)((function*(){const n=yield t._cache.Mutex.preKey.acquire();try{yield t._removePreKeyImpl(e)}finally{n.release()}}))()}loadSignedPreKey(e){var t=this;return(0,i.default)((function*(){if(null!=e){if(!t._cache.SignedPreKeyStore.has(e)){const n=yield _.waSignalStore.getSignedPreKeyById(e),r=n?{pubKey:n.keyPair.pubKey,privKey:n.keyPair.privKey,signature:n.signature}:null;t._cache.SignedPreKeyStore.set(e,r)}return t._cache.SignedPreKeyStore.get(e)||void 0}}))()}_loadSessionImpl(e){var t=this;return(0,i.default)((function*(){var n;if(null!=e){if(!t._cache.SessionStore.has(e)){const n=yield _.waSignalStore.getSession(e);t._cache.SessionStore.set(e,n?{session:n}:void 0)}return(yield(0,c.maybeConvertSession)(null===(n=t._cache.SessionStore.get(e))||void 0===n?void 0:n.session))||void 0}}))()}loadSession(e){var t=this;return(0,i.default)((function*(){const n=yield t._cache.Mutex.session.acquire();try{return yield t._loadSessionImpl(e)}finally{n.release()}}))()}_storeSessionImpl(e,t){if(null==e)throw new Error("Tried to put session without identifier");this._cache.SessionStore.set(e,{session:t}),this._cache.Dirty.session.add(e)}storeSession(e,t){var n=this;return(0,i.default)((function*(){const r=yield n._cache.Mutex.session.acquire();try{n._storeSessionImpl(e,t)}finally{r.release()}}))()}_removeSessionImpl(e){if(null==e)throw new Error("Tried to remove session without identifier");this._cache.SessionStore.set(e,{deleted:!0}),this._cache.Dirty.session.add(e)}removeSession(e){var t=this;return(0,i.default)((function*(){const n=yield t._cache.Mutex.session.acquire();try{t._removeSessionImpl(e)}finally{n.release()}}))()}_containSessionsImpl(e){var t=this;return(0,i.default)((function*(){const n=[];for(const r of e)t._cache.SessionStore.has(r)||n.push(r);if(n.length>0){(yield _.waSignalStore.bulkGetSession(n)).forEach(((e,r)=>{const i=n[r];t._cache.SessionStore.set(i,e?{session:e}:void 0)}))}return e.map((e=>{const n=t._cache.SessionStore.get(e);return!(null!=n&&!(null==n?void 0:n.deleted))}))}))()}containSessions(e){var t=this;return(0,i.default)((function*(){const n=yield t._cache.Mutex.session.acquire();try{return yield t._containSessionsImpl(e)}finally{n.release()}}))()}_storeSenderKeyImpl(e,t){return null==e?Promise.reject(new Error("Tried to put session without identifier")):(this._cache.SenderKeyStore.set(e,t),this._cache.Dirty.senderKey.add(e),Promise.resolve())}storeSenderKey(e,t){var n=this;return(0,i.default)((function*(){const r=yield n._cache.Mutex.senderKey.acquire();try{yield n._storeSenderKeyImpl(e,t)}finally{r.release()}}))()}_loadSenderKeyImpl(e){var t=this;return(0,i.default)((function*(){if(null!=e){if(!t._cache.SenderKeyStore.has(e)){const n=yield _.waSignalStore.getSenderKey(e);t._cache.SenderKeyStore.set(e,n)}return t._cache.SenderKeyStore.get(e)||void 0}}))()}loadSenderKey(e){var t=this;return(0,i.default)((function*(){const n=yield t._cache.Mutex.senderKey.acquire();try{return yield t._loadSenderKeyImpl(e)}finally{n.release()}}))()}generateSnapshot(){return this._cache.generateCacheUpdate()}flushBufferToDiskIfNotMemOnlyMode(){return Promise.resolve()}};t.Z=h},914343:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.syncAndGetDeviceList=function(){return T.apply(this,arguments)},t.syncDeviceList=g,t.syncMyDeviceList=function(){return S.apply(this,arguments)};var i=r(n(348926)),a=r(n(594654)),o=n(798440),s=n(866729),l=n(476462),u=n(369489),c=n(848624),d=n(459857),p=n(692269),_=n(328606),f=n(669050);const h=new Map;function g(){return m.apply(this,arguments)}function m(){return(m=(0,i.default)((function*(e){let{wids:t,context:n,phash:r}=e;if(null!=r){const e=(yield(0,s.getDeviceIds)(t)).map((e=>null==e?[]:e.devices.map((t=>(0,f.createDeviceWidFromDeviceListPk)(e.id,t))))),n=(0,a.default)(e,(e=>e));if(r===(yield(0,c.phashV2)(n)))return}const i=new Set,o=[];if(t.forEach((e=>{const t=h.get((0,l.createDeviceListPK)(e));t?i.add(t):o.push(e)})),0===o.length)return void(yield Promise.all(Array.from(i)));const u=y(o.map((e=>(0,l.createDeviceListPK)(e))),o,n);o.map((e=>{h.set((0,l.createDeviceListPK)(e),u)})),yield Promise.all([u,...Array.from(i)])}))).apply(this,arguments)}function y(){return E.apply(this,arguments)}function E(){return(E=(0,i.default)((function*(e,t,n){try{const e=yield(0,s.getDeviceInfoForSync)(t),r=e.map((e=>null==e?[]:e.devices.map((t=>(0,f.createDeviceWidFromDeviceListPk)(e.id,t))))),i=yield Promise.all(r.map((e=>0===e.length?"":(0,c.phashV2)(e))));return v(t.map(((t,n)=>{var r,a;return{id:t,hash:i[n],ts:null===(r=e[n])||void 0===r?void 0:r.timestamp,expectedTs:null===(a=e[n])||void 0===a?void 0:a.expectedTs}})),n)}catch(e){__LOG__(4,void 0,new Error)`Failed to sync device list with error: ${e}`}finally{t.map((e=>{h.delete((0,l.createDeviceListPK)(e))}))}}))).apply(this,arguments)}function S(){return(S=(0,i.default)((function*(){yield g({wids:(0,d.getMePNandLIDWids)(),context:null,phash:null})}))).apply(this,arguments)}function T(){return(T=(0,i.default)((function*(e){return yield g({wids:e,context:null,phash:null}),(0,s.getDeviceIds)(e)}))).apply(this,arguments)}function v(){return A.apply(this,arguments)}function A(){return(A=(0,i.default)((function*(e,t){if(0===e.length)return;const n=(new p.USyncQuery).withContext(t||"interactive").withDeviceProtocol();e.forEach((e=>{0!==e.id.user&&n.withUser((new _.USyncUser).withId(e.id).withDeviceHash(String(e.hash)).withTs(e.ts).withExpectedTs(e.expectedTs))}));const r=yield n.execute();if(r.error.all)throw new Error(`syncDeviceList: error ${r.error.all.errorCode}: ${r.error.all.errorText}`);r.error.devices&&__LOG__(3)`syncDeviceList: error ${r.error.devices.errorCode}: ${r.error.devices.errorText}`;let i=r.list.filter((e=>!("errorCode"in e.devices)));i=i.map((e=>({wid:e.id,devices:e.devices})));const a=i.filter((e=>{var t;return null===(t=e.devices.keyIndex)||void 0===t?void 0:t.signedKeyIndexBytes})).map((e=>e.wid));return __LOG__(2)`syncDeviceList: skipping ${r.list.length-a.length} out of ${r.list.length} records`,yield(0,u.getAndStoreIdentityKeys)(a),(0,o.handleADVDeviceSyncResult)(i)}))).apply(this,arguments)}},6066:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.checkUpdateForOrphanReactions=function(){return s.apply(this,arguments)};var i=r(n(348926)),a=n(889392),o=n(359987);function s(){return(s=(0,i.default)((function*(e){try{const t=yield(0,a.changeOrphanStateReactions)(e);(0,o.frontendFireAndForget)("checkUpdateForOrphanReactions",{updatedRecords:t})}catch(e){__LOG__(3)`checkUpdateForOrphanReactions: error ${e}`}}))).apply(this,arguments)}},812266:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.postprocessRenderableMessages=function(){return u.apply(this,arguments)};var i=r(n(348926)),a=n(359987),o=n(373070),s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(638669));function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}function u(){return(u=(0,i.default)((function*(e){const{msgInfo:t,shouldOverwriteMsg:n,preprocessedMessages:r,handlePrivacyModeChangeAfterMsgProcessing:l}=e;return yield Promise.all(r.map(function(){var e=(0,i.default)((function*(e){yield(0,a.frontendSendAndReceive)("updateMessageUI",{chatId:e.id.remote,msg:e,shouldOverwriteMsg:n}),(0,a.frontendFireAndForget)("processOrphanAck",{msgId:e.id}),e.type===o.MSG_TYPE.PAYMENT&&"send"===e.subtype&&(null==s||s.processOrphanPaymentNotifications([e]))}));return function(){return e.apply(this,arguments)}}())),l&&l(),(0,a.frontendSendAndReceive)("updateUnattributedMessages",{messageInfo:t,messages:r})}))).apply(this,arguments)}},958820:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.processPlaceholderMessage=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(359987),o=n(780549),s=n(883310),l=n(390053),u=n(267420);function c(){return(c=(0,i.default)((function*(e,t){if(e.category===s.CATEGORY_PEER)return void __LOG__(2,void 0,void 0,void 0,["messaging"])`processPlaceHolderMessage: msgId:${e.externalId}, skip placeholder for peer message`;const n=null!=e.offline;try{const r=yield(0,u.genPlaceholderMsg)(e,t),s=l.messageProcessorCache.addMessages(r.map((e=>({msg:e}))),!n);o.Cmd.isMainStreamReadyMd&&(o.Cmd.isOfflineDeliveryEnd&&(yield s),yield Promise.all(r.map(function(){var e=(0,i.default)((function*(e){const t=e.id.remote;yield(0,a.frontendSendAndReceive)("updateMessageUI",{chatId:t,msg:e})}));return function(){return e.apply(this,arguments)}}())))}catch(t){__LOG__(4,void 0,new Error,!0,["messaging"])`processPlaceholderMsg: msgId::${e.externalId}, failed with error: ${t}`,SEND_LOGS("handle_msg: error storing/processing single message")}}))).apply(this,arguments)}},474852:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.processReactionMessage=function(){return u.apply(this,arguments)};var i=r(n(348926)),a=n(359987),o=n(780549),s=n(522841),l=n(390053);function u(){return(u=(0,i.default)((function*(e,t,n){try{const r=null!=t.offline&&!n,i=l.messageProcessorCache.addMessages([{msg:e,receiptInfo:{from:e.from,author:t.author}}],!r).then((()=>{if(!r)return(0,s.processReactionOrphanPeerReceipt)(e.id)}));(o.Cmd.isMainStreamReadyMd||n)&&(o.Cmd.isOfflineDeliveryEnd&&(yield i),yield(0,a.frontendSendAndReceive)("updateReactionUI",{msg:e,msgInfo:t,reparsing:n}))}catch(e){__LOG__(4,void 0,new Error,!0,["messaging"])`processReactionMessage: msgId:${t.externalId}, failed with error: ${e}`,SEND_LOGS("handle_msg: error storing/processing single message")}return Promise.resolve()}))).apply(this,arguments)}},992321:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.processRenderableMessages=function(){return h.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(260071),s=n(280085),l=n(780549),u=n(812266),c=n(390053),d=n(89812),p=n(766187);function _(){return f.apply(this,arguments)}function f(){return(f=(0,a.default)((function*(e,t,n){const r=yield(0,p.workerSafeSendAndReceive)("getPrivacyModeWhenSent",{msgInfo:t,bizInfo:n}),a=null==r?e:e.map((e=>(0,i.default)((0,i.default)({},e),{},{privacyModeWhenSent:r})));return(0,o.applyOrphanRevokes)(a)}))).apply(this,arguments)}function h(){return(h=(0,a.default)((function*(e,t,n,r,i,a){if(0!==e.length){try{const n=null!=t.offline&&!a,o=yield _(e,t,r),f=yield(0,p.workerSafeSendAndReceive)("handlePrivacyModeChange",{msgs:e,msgInfo:t,bizInfo:r}),h=c.messageProcessorCache.addMessages(o.map((e=>({msg:e}))),!n).then((()=>{if(!n)return Promise.all(o.map(s.processOrphansForNewMsg))})).catch((e=>{__LOG__(4,void 0,new Error,!0,["messaging"])`processRenderableMessages write to DB from cache, failed with error: ${e}`,SEND_LOGS("processRenderableMessages write to DB from cache, failed")}));if((0,d.processPhoneNumberMapping)(t),l.Cmd.isMainStreamReadyMd||a)return l.Cmd.isOfflineDeliveryEnd&&(yield h),(0,u.postprocessRenderableMessages)({msgInfo:t,shouldOverwriteMsg:i,preprocessedMessages:o,handlePrivacyModeChangeAfterMsgProcessing:f})}catch(e){__LOG__(4,void 0,new Error,!0,["messaging"])`processRenderableMessage: msgId:${t.externalId}, failed with error: ${e}`,SEND_LOGS("handle_msg: error storing/processing single message")}return Promise.resolve()}}))).apply(this,arguments)}},593139:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"processPlaceholderMessage",{enumerable:!0,get:function(){return r.processPlaceholderMessage}}),Object.defineProperty(t,"processReactionMessage",{enumerable:!0,get:function(){return a.processReactionMessage}}),Object.defineProperty(t,"processRenderableMessages",{enumerable:!0,get:function(){return i.processRenderableMessages}});var r=n(958820),i=n(992321),a=n(474852)},390053:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.messageProcessorCache=void 0;var i=r(n(348926)),a=r(n(132375)),o=n(316860),s=n(201063),l=n(257235),u=n(76256),c=n(397981),d=n(326314),p=n(971186);const _=new class{constructor(){this.cache=[],this.checkpointQueue=new o.PromiseQueue,this.nextCheckpointIndex=0,this.snapshotTimer=new s.ShiftTimer((()=>{this.createSnapshot()})),this.checkpointPromises=new Map,this.flushImmediately=!1}addMessages(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.cache.push(...e);const n=this._getOrCreateCurrentCheckpointPromise().then((t=>{const n=e.map((e=>{var t;return null===(t=e.msg)||void 0===t?void 0:t.id.toString()})).filter(Boolean);return(0,p.filterStoreMessagesResult)(t,n)}));return t?(this.flushImmediately=!0,this.createSnapshot(),n):(this.flushImmediately=!1,this.cache.length>=400?(this.createSnapshot(),n):n)}_getOrCreateCurrentCheckpointPromise(){if(!this.checkpointPromises.has(this.nextCheckpointIndex)){let e,t=()=>{};this.checkpointPromises.set(this.nextCheckpointIndex,{promise:new Promise(((n,r)=>{e=n,t=r})),markCheckpointDone:n=>{this.checkpointPromises.delete(this.nextCheckpointIndex),null==n.error?e(n.storeMessagesResult):t(n.error)}})}return(0,a.default)(this.checkpointPromises.get(this.nextCheckpointIndex),"this.checkpointPromises.get(this.nextCheckpointIndex)").promise}_addToMessageTable(e){const t=[];return e.forEach((e=>{const n=e.msg;null!=n&&t.push(n)})),(0,p.storeMsgs)(t)}createSnapshot(){var e,t,n=this;const r=this.cache;this.cache=[],this.snapshotTimer.isScheduled()&&this.snapshotTimer.cancel();const a=this.nextCheckpointIndex;if(this.nextCheckpointIndex+=r.length,__LOG__(2)`[unify][message-cache]: creating snapshot for ${a} - ${this.nextCheckpointIndex} messages`,0===r.length)return;const o=null!==(e=null===(t=this.checkpointPromises.get(a))||void 0===t?void 0:t.markCheckpointDone)&&void 0!==e?e:()=>{__LOG__(4,void 0,new Error,!0)`MessageProcessorCache: missing doneFn`,SEND_LOGS("message-cache-missing-doneFn")},s=(0,u.getSignalProtocolStore)().generateSnapshot();this.checkpointQueue.enqueue((0,i.default)((function*(){let e;try{e=yield n._addToMessageTable(r),__LOG__(2)`[unify][message-cache]: messages added to table for ${a} - ${n.nextCheckpointIndex}`,null!=s&&(yield(0,c.getStorage)().lock(["session-store","identity-store","prekey-store","senderkey-store"],(0,i.default)((function*(){yield Promise.all([d.waSignalStore.bulkPutSession(s.sessionUpdate),d.waSignalStore.bulkPutIdentityKeyWithRowId(s.identityUpdate),d.waSignalStore.bulkPutSenderKey(s.senderKeyUpdate),d.waSignalStore.bulkRemovePreKey(s.preKeyRemove),d.waSignalStore.bulkRemoveSession(s.sessionRemove),d.waSignalStore.bulkRemoveIdentity(s.identityRemove)])}))),__LOG__(2)`[unify][message-cache]: siganl key store updated for ${a} - ${n.nextCheckpointIndex}`),yield(0,l.sendAggregateOfflineReceipts)(r),__LOG__(2)`[unify][message-cache]: aggregate receipts sent for ${a} - ${n.nextCheckpointIndex}`}catch(e){return void o({error:e})}o({storeMessagesResult:e})})))}};t.messageProcessorCache=_},319169:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.buildReceiptAckResponse=g,t.receiptBatcher=void 0;var i=r(n(348926)),a=n(282302),o=n(911794),s=n(616310),l=n(738102),u=n(402994),c=n(355813),d=n(605316),p=n(336619),_=n(669050);const f=Object.freeze({[u.ACK.SENT]:u.ACK_STRING.DELIVERY,[u.ACK.RECEIVED]:u.ACK_STRING.DELIVERY,[u.ACK.READ]:u.ACK_STRING.READ,[u.ACK.PLAYED]:u.ACK_STRING.PLAYED,[u.ACK.INACTIVE]:u.ACK_STRING.INACTIVE}),h={delayMs:1e3};function g(e,t,n,r){return(0,l.wap)("ack",{to:(0,c.JID)(e),id:(0,l.CUSTOM_STRING)(t),class:"receipt",type:(0,l.MAYBE_CUSTOM_STRING)(n),participant:r&&r!==e?(0,c.DEVICE_JID)(r):l.DROP_ATTR})}function m(e,t){if(null!=e&&null!=t)return Math.min(e,t);const n=null!=e?e:t;return null!=n?n:void 0}const y=new class{constructor(){this._peerReceiptBatcher=(0,a.createSimpleBatcher)(h,(e=>this._processPeerReceipts(e))),this._otherReceiptBatcher=(0,a.createSimpleBatcher)(h,(e=>this._processOtherReceipts(e))),this._receiptAckBatcher=(0,a.createSimpleBatcher)(h,(e=>this._processReceiptAcks(e)))}acceptPeerReceipt(e){this._peerReceiptBatcher.accept(e)}acceptOtherReceipt(e){this._otherReceiptBatcher.accept(e)}acceptReceiptAck(e){this._receiptAckBatcher.accept(e)}runActiveBatches(){return Promise.all([this._peerReceiptBatcher.runActiveBatch(),this._otherReceiptBatcher.runActiveBatch(),this._receiptAckBatcher.runActiveBatch()]).then((()=>{}))}_flattenAndDedupeOtherReceipts(e){const t=new Map;return e.forEach((e=>{var n;const{ack:r,ts:i,receiverId:a,msgKeys:o}=e,l=(0,_.toUserWid)(a).toString(),c=null!==(n=a.device)&&void 0!==n?n:s.DEFAULT_DEVICE_ID;o.forEach((e=>{const n=f[r];if(null==n)return void __LOG__(3)`[unify][batcher]: receipt has unsupported ack type ${r}`;const a=`${e},${l}`,o=t.get(a);o?(n!==f[u.ACK.INACTIVE]&&(o[n]=m(o[n],i)),o.deviceDelivered.add(c)):t.set(a,{[n]:i,deviceDelivered:new Set([c])})}))})),Array.from(t)}_processOtherReceipts(e){const t=this._flattenAndDedupeOtherReceipts(e);return(0,d.getStorage)().lock(["message-info"],function(){var n=(0,i.default)((function*(n){let[r]=n;const i=(yield r.bulkGet(t.map((e=>e[0].split(","))))).map(((e,n)=>{const[r,i]=t[n];if(!i)return null;if(!e){const[e,t]=r.split(",");return{delivery:i.delivery,read:i.read,played:i.played,msgKey:e,receiverUserJid:t,deviceDelivered:Array.from(i.deviceDelivered),deviceNotDelivered:[]}}const a=i.deviceDelivered;return e.deviceDelivered.forEach((e=>a.add(e))),{delivery:m(e.delivery,i.delivery),read:m(e.read,i.read),played:m(e.played,i.played),msgKey:e.msgKey,receiverUserJid:e.receiverUserJid,deviceDelivered:Array.from(a),deviceNotDelivered:e.deviceNotDelivered.filter((e=>!a.has(e)))}}));return yield r.bulkCreateOrReplace(i),e.map((()=>{}))}));return function(){return n.apply(this,arguments)}}())}_processPeerReceipts(e){return(0,i.default)((function*(){const t=e.map((e=>{const{ts:t,msgKeys:n,ack:r}=e;return{ts:t,msgKeys:n,ack:r}}));return yield(0,p.getTable)().bulkCreate(t),e.map((()=>{}))}))()}_processReceiptAcks(e){return(0,i.default)((function*(){return yield function(e){e.forEach((e=>{let{from:t,stanzaId:n,ackString:r,participant:i}=e;const a=g(t,n,r,i);(0,o.deprecatedCastStanza)(a),(0,o.cancelDeadSocketTimer)()})),__LOG__(2)`[unify][batcher] finish sending ${e.length} acks`}(e),e.map((()=>{}))}))()}};t.receiptBatcher=y},89812:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.processPhoneNumberMapping=function(){return o.apply(this,arguments)};var i=r(n(348926)),a=n(450491);function o(){return(o=(0,i.default)((function*(e){e.author.isLid()&&(null!=e.displayName&&(yield(0,a.createOrReplaceDisplayNames)([{lid:e.author.user,displayName:e.displayName}])),null!=e.senderPn?yield(0,a.createOrReplaceLidPnMappings)([{lid:e.author.user,pn:e.senderPn.user}]):yield(0,a.updateLidChatState)(e.author.user,!0),null!=e.recipientPn&&(yield Promise.all([(0,a.createOrReplaceLidPnMappings)([{lid:e.chat.user,pn:e.recipientPn.user}]),(0,a.updateLidChatState)(e.author.user,!1)])))}))).apply(this,arguments)}},430783:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getBackendPluginRegistry=function(){var e;return a=null!==(e=a)&&void 0!==e?e:new i.default,a};var i=r(n(574787));let a},41730:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initializeBackendPlugins=function(){const e=(0,r.getBackendPluginRegistry)(),t=[n(471293).Z,n(472748).Z];e.registerPlugins(t)};var r=n(430783)},844558:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseProtoPlugins=function(e){const t=(0,r.getBackendPluginRegistry)().getAllPlugins();for(const n of t){const t=n.parseProtobuf(e);if(null!=t)return{msgData:t.msgData,contextInfo:t.contextInfo}}return null};var r=n(430783)},868242:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getClientPayloadForLogin=function(e){const t=(0,f.assertGetMe)(),n=(0,a.default)((0,a.default)({},y(e)),{},{username:parseInt(t.user,10),device:null!=t.device?t.device:0});return(0,g.encodeProtobuf)(d.ClientPayloadSpec,n).readByteArray()},t.getClientPayloadForRegistration=function(){return m.apply(this,arguments)},t.getUserAgent=v,t.getWebSubPlatform=C;var i=r(n(348926)),a=r(n(81109)),o=n(417405),s=n(215373),l=r(n(706223)),u=r(n(524173)),c=n(113259),d=n(614806),p=n(366891),_=n(65410),f=n(459857),h=n(350906),g=n(653313);function m(){return(m=(0,i.default)((function*(e,t,n){const r=E(),i=yield S(),o=(0,a.default)((0,a.default)({},y(n)),{},{devicePairingData:{buildHash:r,deviceProps:i,eRegid:(0,s.intToBytes)(4,e.registrationId),eKeytype:(0,s.intToBytes)(1,5),eIdent:e.identityKeyPair.pubKey,eSkeyId:(0,s.intToBytes)(3,t.keyId),eSkeyVal:t.keyPair.pubKey,eSkeySig:t.signature}});return(0,g.encodeProtobuf)(d.ClientPayloadSpec,o).readByteArray()}))).apply(this,arguments)}function y(e){var t,n;return{passive:null!==(t=null==e?void 0:e.passive)&&void 0!==t&&t,pull:null!==(n=null==e?void 0:e.pull)&&void 0!==n&&n,connectType:d.ClientPayload$ConnectType.WIFI_UNKNOWN,connectReason:d.ClientPayload$ConnectReason.USER_ACTIVATED,userAgent:v(),webInfo:{webSubPlatform:C()}}}function E(){const e=(0,o.decodeB64)((0,l.default)("2.2246.10"));return new Uint8Array(e)}function S(){return T.apply(this,arguments)}function T(){return(T=(0,i.default)((function*(){const e=u.default.info();let t,n;if(e.version&&""!==e.version){const n=e.version.split(".");n.length>0&&e.version&&/^[0-9\.]+$/.test(e.version)&&(t={primary:parseInt(n[0],10),secondary:n.length>1?parseInt(n[1],10):void 0,tertiary:n.length>2?parseInt(n[2],10):void 0})}{const e=yield p.MdSyncFieldStatsMeta.getStorageEstimation();e.mdStorageQuotaBytes!==p.STORAGE_QUOTA_UNAVAILABLE&&(n={storageQuotaMb:Math.trunc(e.mdStorageQuotaBytes/1024/1024)})}const r={os:e.os,version:t,platformType:A(e.name),requireFullSync:!1,historySyncConfig:n};return(0,g.encodeProtobuf)(c.DevicePropsSpec,r).readByteArray()}))).apply(this,arguments)}function v(){const e=_.deviceInfo.get(),t=d.ClientPayload$UserAgent$ReleaseChannel.RELEASE;return{appVersion:{primary:Number("2"),secondary:Number("2246"),tertiary:Number("10")},platform:d.ClientPayload$UserAgent$Platform.WEB,releaseChannel:t,mcc:e.mcc,mnc:e.mnc,osVersion:e.osVersion,manufacturer:e.manufacturer,device:e.device,osBuildNumber:e.osBuild,localeLanguageIso6391:e.lg,localeCountryIso31661Alpha2:e.lc}}function A(e){switch(e){case"Chrome":return c.DeviceProps$PlatformType.CHROME;case"Firefox":return c.DeviceProps$PlatformType.FIREFOX;case"IE":return c.DeviceProps$PlatformType.IE;case"Opera":return c.DeviceProps$PlatformType.OPERA;case"Safari":return c.DeviceProps$PlatformType.SAFARI;case"Edge":return c.DeviceProps$PlatformType.EDGE;case"electron":case"Desktop":return c.DeviceProps$PlatformType.DESKTOP;case"ipad":case"iPad":return c.DeviceProps$PlatformType.IPAD;case"tablet":case"Android tablet":return c.DeviceProps$PlatformType.ANDROID_TABLET;case"Ohana":return c.DeviceProps$PlatformType.OHANA;case"Aloha":return c.DeviceProps$PlatformType.ALOHA;case"Catalina":return c.DeviceProps$PlatformType.CATALINA;default:return c.DeviceProps$PlatformType.UNKNOWN}}function C(){switch(h.WAM_PLATFORM){case"WEB":return d.ClientPayload$WebInfo$WebSubPlatform.WEB_BROWSER;case"DARWIN":case"DARWIN_BETA":return d.ClientPayload$WebInfo$WebSubPlatform.DARWIN;case"WIN32":case"WIN32_BETA":return d.ClientPayload$WebInfo$WebSubPlatform.WIN32;case"MACSTORE":return d.ClientPayload$WebInfo$WebSubPlatform.APP_STORE;case"WINSTORE":return d.ClientPayload$WebInfo$WebSubPlatform.WIN_STORE;default:return}}},62883:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(513218)),a=r(n(616579)),o=r(n(402525)),s=n(425315);function l(e){switch(typeof e){case"object":return null==e?e=>null===e:function(e){const t=[];let n=!1,r=0;(0,o.default)(e,(function(e,i){if(void 0===e)return void(n=!0);r++;const a=l(e);t.push((function(e){return e.hasOwnProperty(i)&&a&&a(e[i])}))}));const i=(0,a.default)(t,(function(e,t){return e?function(n){return t(n)&&e(n)}:t}));return function(e){if("object"!=typeof e||null==e)return!1;const t=Object.keys(e).length;return!(t<r)&&!(!n&&t>r)&&i(e)}}(e);case"function":return e;case"boolean":case"undefined":case"number":case"string":return function(t){return t===e};default:throw new TypeError("Unknown Template type: "+typeof e)}}class u{constructor(e){this.predicate=l(e)}test(e){return this.predicate(e)}}t.default=u,u.ANY=()=>!0,u.OBJECT=i.default,u.STRING=s.isString,u.BOOLEAN=s.isBoolean},10750:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;const n={ROOT:1,THENABLE:2,FINALLY:3,META:4},r={PENDING:1,FULFILLED:2,REJECTED:3};function i(){let e,t;switch(this._parent=null,this._subs=[],this._catchTypes=null,this._onResolve=null,this._onReject=null,this.type=n.ROOT,this.state=r.PENDING,this.value=void 0,this._forceable=!1,this._cancellable=!1,arguments.length){case 0:break;case 1:e=arguments[0];break;case 2:t=arguments[0],e=arguments[1];break;default:throw new Error("TightPromise constructor with "+arguments.length+" arguments")}if(this.context=t,arguments.length>0)try{e.call(t,o.bind(this),s.bind(this))}catch(e){s.call(this,e)}}function a(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const a=new i;return a.type=n.THENABLE,a._onReject=arguments[arguments.length-1],arguments.length>1&&(a._catchTypes=Array.prototype.slice.call(arguments,0,arguments.length-1),a._catchTypes.forEach((function(e){if("function"!=typeof e)throw new Error("expected type, got "+e)}))),this._addChild(a),a}function o(e){var t;this.state===r.PENDING&&("object"!=typeof(t=e)&&"function"!=typeof t||"function"!=typeof t.then?(this.value=e,this.state=r.FULFILLED,this._notifySubs()):e.then(o.bind(this),s.bind(this)))}function s(e){this.state===r.PENDING&&(this.value=e,this.state=r.REJECTED,this._notifySubs())}i.STATE=r,i.TYPE=n,i.prototype={isPending:function(){return this.state===r.PENDING},then:function(e,t){if(!e&&!t)return this;const r=new i;return r.type=n.THENABLE,r._onResolve=e||null,r._onReject=t||null,this._addChild(r),r},catch:a,catchType:a,catchTypes:a,catchTypes3:a,catchEqualTo:a,finally:function(e){const t=new i;return t.type=n.FINALLY,t._onResolve=e,this._addChild(t),t},bind:function(e){const t=new i;return t.type=n.META,this._addChild(t),t.context=e,t},spread:function(e){return this.then((function(t){e.apply(this,t)}))},get:function(e){return this.then((function(t){return t[e]}))},forceable:function(){const e=new i;return e.context=this.context,e.type=n.META,this._addChild(e),e._forceable=!0,e},cancellable:function(){const e=new i;return e.context=this.context,e.type=n.META,this._addChild(e),e._cancellable=!0,e},force:function(e){if(this._forceable){let t=this;for(;t.type===n.META;){const e=t._parent;if(!(null==e?void 0:e._forceable)||e.state!==r.PENDING)break;t=e}o.call(this,e)}},cancel:function(e){let t=e;if(this._cancellable){t=t||new Promise.CancellationError;let e=this,n=!1;do{const t=e._parent;(null==t?void 0:t._cancellable)&&t.state===r.PENDING?e=t:n=!0}while(!n);s.call(e,t)}},loosen:function(){return Promise.resolve(this)},_run:function(e,t){let n;try{n=e.call(this.context,t)}catch(e){return void s.call(this,e)}o.call(this,n)},_handle:function(){if(this.state!==r.PENDING)return;const e=this._parent;switch(this.type){case n.THENABLE:if(e.state===r.FULFILLED){const t=this._onResolve;t?this._run(t,e.value):o.call(this,e.value)}else if(this._onReject){const t=this._catchTypes,n=t?t.length:0,r=e.value;if(0===n)return void this._run(this._onReject,r);for(let e=0;e<n;e++)if(r instanceof t[e])return void this._run(this._onReject,r);s.call(this,r)}else s.call(this,e.value);return;case n.FINALLY:try{this._onResolve.call(this.context)}catch(e){!function(e){setTimeout((function(e){throw e}),0,e)}(e)}default:e.state===r.FULFILLED?o.call(this,e.value):s.call(this,e.value)}},_addChild:function(e){e._parent=this,e.context=this.context,e._cancellable=this._cancellable,e.type===n.META&&(e._forceable=this._forceable),this.state===r.PENDING?this._subs.push(e):e._handle()},_notifySubs:function(){this._subs.forEach((function(e){e._handle()}))}},i.delay=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];let r,a;switch(arguments.length){case 0:r=0;break;case 1:r=arguments[0];break;default:r=arguments[1],a=arguments[0]}return new i((function(e){setTimeout(e.bind(null,a),r)}))},i.resolve=function(e){const t=new i;return o.call(t,e),t},i.reject=function(e){const t=new i;return s.call(t,e),t};var l=i;t.default=l},987009:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=R;var i=r(n(348926)),a=n(911794),o=n(261030),s=n(917406),l=n(359987),u=n(320437),c=r(n(542817)),d=n(780549),p=n(642067),_=r(n(762848)),f=n(188472),h=n(565804),g=n(65889),m=n(76469),y=n(598031),E=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=I(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(218925)),S=n(555622),T=n(282062),v=n(704548),A=n(581263),C=n(673168),P=n(209983),O=n(851460);function I(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(I=function(e){return e?n:t})(e)}function M(){return b.apply(this,arguments)}function b(){return(b=(0,i.default)((function*(){const e=(0,p.getCommsConfig)(void 0);return(0,a.startComms)(_.default,e,(e=>Promise.resolve((0,o.inflate)(e)))),yield(0,a.waitForConnection)(),(0,a.startHandlingRequests)()}))).apply(this,arguments)}function R(){const e=(0,u.makeBridge)();return(0,l.setApi)(e),(0,g.requireSetFrontendHandlers)().then((t=>t(e))),(0,g.requireSetWorkerSafeHandlers)().then((t=>t(e))),S.QPL.throwKillswitch(!1),(0,f.initEncSalt)().then((()=>(0,f.initEncSaltForInvoker)())).then((()=>(0,v.initialize)())).then((()=>(0,m.initialize)().then((()=>(0,y.migrateMDUserPrefsToIndexedDB)())))).then((()=>{})).catch((e=>{__LOG__(4,void 0,new Error,void 0,["launch_socket"])`storageInitializationError triggered logout: ${(null==e?void 0:e.message)||(null==e?void 0:e.name)}.`,d.Cmd.storageInitializationError()})).then((()=>{if(c.default.isLogoutInProgress)throw new Error("aborting launchSocket due to logout");return(0,C.isRegistered)()?(__LOG__(2)`[launch socket] launch socket for loggin`,(0,O.setIsConnectedAsRegistered)(!0),d.Cmd.initialLoadReady(),(0,m.initialize)().catch((()=>d.Cmd.storageInitializationError())).then((()=>(d.Cmd.incrementProgress(),(0,s.updateABPropsFromStorage)()))).then((()=>{d.Cmd.abPropsLoaded(),(0,h.restoreImportantMetaData)()})).then((()=>(0,h.restoreBlocklist)())).then((()=>{d.Cmd.incrementProgress(),E.setStartCommsT(),(0,A.startBackend)()}))):(__LOG__(2)`[launch socket] launch socket for registration`,d.Cmd.incrementProgress(),P.OfflineResumeReporter.setIsInitialSync(),Promise.all([(0,T.refreshNoiseCredentials)(),(0,T.refreshSignalCredentials)()]).then((()=>{d.Cmd.incrementProgress(),M()})))}))}d.Cmd.on("md_refresh_qr",(()=>{(0,a.stopComms)(),M()})),d.Cmd.on("logout",(()=>{R()}))},128296:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if((0,T.isRegistered)())return function(){return w.apply(this,arguments)}(e);return function(){return L.apply(this,arguments)}(e)};var i=r(n(348926)),a=n(417405),o=n(551168),s=n(603211),l=(n(710038),n(642499)),u=r(n(132375)),c=n(452813),d=n(969726),p=n(359987),_=n(868242),f=n(780549),h=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=P(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(403206)),g=r(n(799132)),m=n(614806),y=n(326314),E=r(n(795221)),S=n(65410),T=n(673168),v=n(733662),A=n(309512),C=n(653313);function P(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(P=function(e){return e?n:t})(e)}const O=new Uint8Array([87,65,6,d.DICT_VERSION]),I="Noise_XX_25519_AESGCM_SHA256\0\0\0\0";let M;function b(){return R.apply(this,arguments)}function R(){return(R=(0,i.default)((function*(){const e=yield(0,T.getRoutingInfo)(),t=e?e.edgeRouting:null;let n=t?(0,a.encodeB64UrlSafe)(t):null;const r=new E.default({routingToken:n}),i=h.keyPair(),[u,c,d]=yield(0,g.default)(r,"change:socket").cancellable().then((()=>r.socket)).finally((()=>{r.deactivate()})).then((e=>{let n;if(t){const e=new o.Binary;e.write("ED",0,1),e.writeUint8(t.byteLength>>16),e.writeUint16(65535&t.byteLength),e.writeBuffer(t),n=e.readByteArray()}const r=n?o.Binary.build(n,O).readByteArray():O,a=new s.FrameSocket(e,r);M=new l.NoiseHandshake(a),M.start(I,O),__LOG__(2)`openChatSocket send hello`,M.authenticate(i.pubKey);const u={clientHello:{ephemeral:i.pubKey}};return M.sendAndReceive((0,C.encodeProtobuf)(m.HandshakeMessageSpec,u).readByteArray())})).then((e=>N(M,e,i)));return __LOG__(2)`verifying certificate`,(0,v.verifyChainCertificateWA6)(c,u),d}))).apply(this,arguments)}function N(e,t,n){__LOG__(2)`openChatSocket rcv hello`;const{serverHello:r}=(0,A.decodeProtobuf)(m.HandshakeMessageSpec,t);if(!r)throw new Error("ServerHello payload error");const{ephemeral:i,static:a,payload:o}=r;if(null==i||null==a||null==o)throw new Error("Missing server Ephemeral");e.authenticate(i),e.mixIntoKey(h.sharedSecret(i,n.privKey));const s=e.decrypt(a),l=s.then((e=>h.sharedSecret(e,n.privKey)));return e.mixIntoKey(l),Promise.all([s,e.decrypt(o),i])}function w(){return(w=(0,i.default)((function*(e){try{const t=yield S.waNoiseInfo.get(),n=yield b().then((n=>{f.Cmd.incrementProgress(),null==t&&(__LOG__(2,void 0,void 0,void 0,["Open Chat Socket"])`Unable to decrypt noise data`,(0,p.frontendFireAndForget)("socketLogout",{}),(0,u.default)(t,"noiseData"));const r=(0,u.default)(t,"noiseData").staticKeyPair,i=(0,_.getClientPayloadForLogin)(e);return Promise.all([D(r,M,n),M.encrypt(Promise.resolve(i))])})).then((e=>{let[t,n]=e;return f.Cmd.incrementProgress(),M.send((0,C.encodeProtobuf)(m.HandshakeMessageSpec,{clientFinish:{static:t,payload:n}}).readByteArray()),M.finish()}));return f.Cmd.incrementProgress(),__LOG__(2)`openChatSocketForLogin success, resetting round`,(0,c.makeResult)(n)}catch(e){return __LOG__(3)`openChatSocketForLogin error ${e}`,(0,c.makeError)("disconnected")}}))).apply(this,arguments)}function L(){return(L=(0,i.default)((function*(e){try{const t=yield b().then((e=>Promise.all([y.waSignalStore.getRegistrationInfo(),y.waSignalStore.getSignedPreKey(),e]))).then(function(){var t=(0,i.default)((function*(t){let[n,r,i]=t;if(!r||!n)throw new Error("Invalid signal credentials");const a=yield(0,_.getClientPayloadForRegistration)(n,r,e),o=(0,u.default)(yield S.waNoiseInfo.get(),"yield waNoiseInfo.get()").staticKeyPair;return Promise.all([D(o,M,i),M.encrypt(Promise.resolve(a))])}));return function(){return t.apply(this,arguments)}}()).then((e=>{let[t,n]=e;return M.send((0,C.encodeProtobuf)(m.HandshakeMessageSpec,{clientFinish:{static:t,payload:n}}).readByteArray()),M.finish()}));return __LOG__(2)`openChatSocketForRegistration success, resetting round`,(0,c.makeResult)(t)}catch(e){return __LOG__(3)`openChatSocketForRegistration error ${e}`,(0,c.makeError)("disconnected")}}))).apply(this,arguments)}function D(e,t,n){const r=Promise.resolve(e.pubKey),i=t.encrypt(r);if(!n)return Promise.reject(new Error("staticAgreement called before serverKeys"));const a=h.sharedSecret(n,e.privKey);return t.mixIntoKey(a),i}},925031:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.openSocket=function(e){return new WebSocket(e)};r(n(132375)),n(247451),r(n(174285))},282062:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.refreshNoiseCredentials=function(){const e=(0,o.keyPair)(),t=new Uint8Array(24);return self.crypto.getRandomValues(t),Promise.resolve(c.waNoiseInfo.set({recoveryToken:t.buffer,staticKeyPair:e}))},t.refreshSignalCredentials=function(){return _.apply(this,arguments)},t.setRoutingInfo=function(e,t){const n={domain:e,edgeRouting:t?(0,a.decodeB64)(t):null};return __LOG__(2)`set routingInfo:`,(0,d.setRoutingInfo)(n)};var i=r(n(348926)),a=n(417405),o=n(403206),s=n(492917),l=n(431028),u=n(326314),c=n(65410),d=n(673168);function p(){(0,s.isCryptoLibraryEnabled)();return self.libsignal.KeyHelper.generateRegistrationId()}function _(){return(_=(0,i.default)((function*(){const e=p();yield u.waSignalStore.clearCredential();const t=yield(0,l.generateIdentityKeyPair)();yield Promise.all([u.waSignalStore.setRegistrationInfo({registrationId:e,identityKeyPair:t}),u.waSignalStore.rotateSignedPreKey((0,s.isCryptoLibraryEnabled)()?t:(0,o.toSignalCurveKeyPair)(t),l.generateSignedKeyPair)])}))).apply(this,arguments)}},226562:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WATCHED_SOCKET_STATE=t.SOCKET_STREAM=t.SOCKET_STATE=void 0;t.SOCKET_STATE={OPENING:"OPENING",PAIRING:"PAIRING",UNPAIRED:"UNPAIRED",UNPAIRED_IDLE:"UNPAIRED_IDLE",CONNECTED:"CONNECTED",TIMEOUT:"TIMEOUT",CONFLICT:"CONFLICT",UNLAUNCHED:"UNLAUNCHED",PROXYBLOCK:"PROXYBLOCK",TOS_BLOCK:"TOS_BLOCK",SMB_TOS_BLOCK:"SMB_TOS_BLOCK",DEPRECATED_VERSION:"DEPRECATED_VERSION",SCREEN_LOCKED:"SCREEN_LOCKED"};t.SOCKET_STREAM={DISCONNECTED:"DISCONNECTED",SYNCING:"SYNCING",RESUMING:"RESUMING",CONNECTED:"CONNECTED"};t.WATCHED_SOCKET_STATE={OPEN:"OPEN",CLOSED:"CLOSED"}},296121:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(88237),o=n(551168),s=n(987058),l=n(36530),u=n(14361),c=n(54918),d=i(n(799132)),p=n(689434),_=n(150204),f=i(n(99398)),h=n(61939),g=n(397203),m=i(n(933173));const y=3e5,E=18e4,S=(0,h.fibonacci)(8e3,4e3,3e5);class T extends c.BaseModel{constructor(){super(...arguments),this.active=(0,c.prop)(!0),this.socket=(0,c.prop)(),this.sockets=(0,c.prop)(),this.pendingSocketPromiseCount=(0,c.prop)(0),this.attempts=(0,c.prop)(0),this.startId=(0,c.prop)(0),this.controller=(0,c.prop)(),this.retryTimestamp=(0,c.prop)(),this.tsListener=(0,c.prop)(),this.onerror=(0,c.prop)()}initialize(){this.sockets=[],new Promise(((e,t)=>{this._resolve=e,this._reject=t})).then((e=>{__LOG__(2)`SocketOpener set to socket ${e.id}`,this.set({active:!1,socket:e}),f.default.online=!0})).finally((()=>{this.stopListening(),__LOG__(2)`SocketOpener closing socket opener`,this.active=!1,this.sockets.forEach((e=>{e.cancel()}));const e=this.controller;e&&(e.deactivate(),this.controller=null)})).catch((0,a.catchAbort)((()=>{}))).catch((e=>{if(__LOG__(3)`SocketOpener deadly error! ${String(e)}`,!this.onerror)throw e;this.onerror(e)})),this.tsListener=e=>{this.retryTimestamp=e.ts},this.listenTo(f.default,"change:online",this._handleOnlineChange),this.listenTo(_.jsHaltDetector,u.JS_HALT_EVENT,this._handleJsHalt),this._handleOnlineChange()}attemptOpen(){if(!this.active)return __LOG__(2,void 0,void 0,!0)`attemptOpen called while not active!`,void SEND_LOGS("rogue-opener");const e=(0,g.open)({url:"wss://web.whatsapp.com/ws",msgParser:A});this.attempts=this.sockets.push(e),this.pendingSocketPromiseCount++;let t=!1;const n=function(){if(t)return Promise.resolve();t=!0;const e=(new r).signal;return f.default.checkOnline({signal:e})},i=new r;(0,l.delayMs)(6e3,i.signal).then((()=>n())).catch((()=>{})),e.then(this._resolve).finally((()=>{this.pendingSocketPromiseCount--,i.abort()})).catch((0,a.catchAbort)((()=>{}))).catch((()=>n()))}poke(){this.controller&&this.controller.forceTimeout()}_handleOnlineChange(){if(!this.active)return;const e=this.controller,t=f.default.online?this.onlineController():this.offlineController();e&&(e.off("change:ts",this.tsListener),e.deactivate()),t.on("change:ts",this.tsListener),t.activate(),this.controller=t}onlineController(){return __LOG__(2)`SocketOpener:onlineController activating`,new h.Watchdog({waitAlgorithm:S,jitter:.2,onActivated:()=>{this.attemptOpen()},onTimeout:()=>(this.attemptOpen(),!0)})}offlineController(){__LOG__(2)`SocketOpener:offlineController activating`;let e,t=0;return new h.Watchdog({waitAlgorithm:r=>(e&&e.cancel(),navigator.onLine?t++<2?(__LOG__(2)`SocketOpener:offline... quick poll`,e=null,6e3):(__LOG__(2)`SocketOpener:offline... heuristic poll`,e=v(r,[(0,p.waitForOnlineNaive)(),(0,d.default)(_.jsHaltDetector,u.JS_HALT_EVENT),(0,d.default)(n(841273).Stream,"change:available")]),y):(__LOG__(2)`SocketOpener:offline... wait for navigator`,t=0,e=v(r,[(0,p.waitForOnlineNaive)()]),y)),jitter:.2,onActivated:()=>{0===this.pendingAttempts()&&this.attemptOpen()},onDeactivated:()=>{e&&e.cancel()},onTimeout:()=>(this.attemptOpen(),!0)})}deactivate(){this._reject(new a.AbortError)}pendingAttempts(){return this.pendingSocketPromiseCount}_handleJsHalt(e){const t=this.controller;t&&e>E&&(__LOG__(2)`js halt longer than ${E} ms detected, resetting watchdog fail generation`,t.resetGeneration())}}function v(e,t){return(0,s.promiseAny)(t).cancellable().then((()=>{e.forceTimeout()})).finally((()=>{t.forEach((e=>{e.cancel()}))})).catch((0,a.catchAbort)((()=>{})))}function A(e){const t=e.data;let n,r,i;if(t instanceof ArrayBuffer){let e;const a=[],s=new o.Binary(t);for(;44!==(e=s.readUint8());)a.push(e);n=String.fromCharCode.apply(String,a),r=s.readBuffer(),i=t.byteLength}else{if("string"!=typeof t)throw new Error("Unexpected message event type");{const e=t.indexOf(",");n=t.slice(0,e),r=t.slice(e+1),r=r?JSON.parse(r,m.default):void 0,i=new Blob([t]).size}}return{tag:n,data:r,binarySize:i}}var C=(0,c.defineModel)(T);t.default=C},795221:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(88237),o=n(987058),s=n(36530),l=n(14361),u=n(54918),c=i(n(799132)),d=n(689434),p=n(150204),_=i(n(99398)),f=n(61939),h=n(940494);const g="wss://web.whatsapp.com/ws/chat",m=3e5,y=18e4,E=(0,f.fibonacci)(8e3,4e3,3e5);class S extends u.BaseModel{constructor(){super(...arguments),this.active=(0,u.prop)(!0),this.socket=(0,u.prop)(),this.sockets=(0,u.prop)(),this.pendingSocketPromiseCount=(0,u.prop)(0),this.attempts=(0,u.prop)(0),this.controller=(0,u.prop)(),this.retryTimestamp=(0,u.prop)(),this.tsListener=(0,u.prop)(),this.onerror=(0,u.prop)()}initialize(){this.sockets=[],new Promise(((e,t)=>{this._resolve=e,this._reject=t})).then((e=>{__LOG__(2)`SocketOpenerMD set to socket ${e.id}`,this.set({active:!1,socket:e}),_.default.online=!0})).finally((()=>{this.stopListening(),__LOG__(2)`SocketOpenerMD closing socket opener`,this.active=!1,this.sockets.forEach((e=>{e.cancel()}));const e=this.controller;e&&(e.deactivate(),this.controller=null)})).catch((0,a.catchAbort)((()=>{}))).catch((e=>{if(__LOG__(3)`SocketOpenerMD deadly error! ${String(e)}`,!this.onerror)throw e;this.onerror(e)})),this.tsListener=e=>{this.retryTimestamp=e.ts},this.listenTo(_.default,"change:online",this._handleOnlineChange),this.listenTo(p.jsHaltDetector,l.JS_HALT_EVENT,this._handleJsHalt),self.addEventListener("online",(()=>{this._handleOnlineChange()})),this._handleOnlineChange()}attemptOpen(){if(!this.active)return void __LOG__(2)`attemptOpen called while not active!`;const e=(0,h.open)(this.routingToken?`${g}?ED=${this.routingToken}`:g);this.attempts=this.sockets.push(e),this.pendingSocketPromiseCount++;let t=!1;const n=function(){if(t)return Promise.resolve();t=!0;const e=(new r).signal;return _.default.checkOnline({signal:e})},i=new r;(0,s.delayMs)(6e3,i.signal).then((()=>n())).catch((()=>{})),e.then(this._resolve).finally((()=>{this.pendingSocketPromiseCount--,i.abort()})).catch((0,a.catchAbort)((()=>{}))).catch((()=>n()))}poke(){this.controller&&this.controller.forceTimeout()}_handleOnlineChange(){if(!this.active)return;const e=this.controller,t=_.default.online?this.onlineController():this.offlineController();e&&(e.off("change:ts",this.tsListener),e.deactivate()),t.on("change:ts",this.tsListener),t.activate(),this.controller=t}onlineController(){return __LOG__(2)`SocketOpenerMD:onlineController activating`,new f.Watchdog({waitAlgorithm:E,jitter:.2,onActivated:()=>{this.attemptOpen()},onTimeout:()=>(this.attemptOpen(),!0)})}offlineController(){__LOG__(2)`SocketOpenerMD:offlineController activating`;let e,t=0;return new f.Watchdog({waitAlgorithm:r=>(e&&e.cancel(),navigator.onLine?t++<2?(__LOG__(2)`SocketOpenerMD:offline... quick poll`,e=null,6e3):(__LOG__(2)`SocketOpenerMD:offline... heuristic poll`,e=T(r,[(0,d.waitForOnlineNaive)(),(0,c.default)(p.jsHaltDetector,l.JS_HALT_EVENT),(0,c.default)(n(841273).Stream,"change:available")]),m):(__LOG__(2)`SocketOpenerMD:offline... wait for navigator`,t=0,e=T(r,[(0,d.waitForOnlineNaive)()]),m)),jitter:.2,onActivated:()=>{0===this.pendingAttempts()&&this.attemptOpen()},onDeactivated:()=>{e&&e.cancel()},onTimeout:()=>(this.attemptOpen(),!0)})}deactivate(){this._reject(new a.AbortError)}pendingAttempts(){return this.pendingSocketPromiseCount}_handleJsHalt(e){const t=this.controller;t&&e>y&&(__LOG__(2)`js halt longer than ${y} ms detected, resetting watchdog fail generation`,t.resetGeneration())}}function T(e,t){return(0,o.promiseAny)(t).cancellable().then((()=>{e.forceTimeout()})).finally((()=>{t.forEach((e=>{e.cancel()}))})).catch((0,a.catchAbort)((()=>{})))}var v=(0,u.defineModel)(S);t.default=v},733662:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseCertificateWA6=c,t.verifyCertificateWA6=d,t.verifyChainCertificateWA6=function(e,t){const n=(0,s.decodeProtobuf)(o.CertChainSpec,e);if(!n)throw new Error("verifyCertificateWA6 - Missing Certificate");const i=n.intermediate,a=n.leaf;if(null==i||null==a)throw new Error("verifyCertificateWA6 - Missing Leaf and/or Intermediate Certificate");__LOG__(2)`verifying intermediate certificate`;const l=c(i);if(d(l,u.PUBLIC_KEY),l.issuerSerial!==u.SERIAL)throw new Error("verifyChainCertificateWA6 intermediateCert was not issued by RootCA");__LOG__(2)`verifying leaf certificate`;const p=c(a);if(d(p,l.key),p.issuerSerial!==l.serial)throw new Error("verifyChainCertificateWA6 leafCert was not issued by IntermediateCert");if(!(0,r.arrayBuffersEqual)(p.key,t))throw new Error("verifyChainCertificateWA6 leafCert.key does not match handshake server.hello.static")};var r=n(703177),i=n(710038),a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(403206)),o=n(294075),s=n(309512);function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}const u={SERIAL:0,ISSUER:"WhatsAppLongTerm1",PUBLIC_KEY:(0,i.parseHex)("142375574d0a587166aae71ebe516437c4a28b73e3695c6ce1f7f9545da8ee6b")};function c(e){const t=e.details,n=e.signature;if(!t)throw new Error('parseCertificateWA6 certificate is missing "details"');if(!n)throw new Error('parseCertificateWA6 certificate is missing "signature"');const r=(0,s.decodeProtobuf)(o.CertChain$NoiseCertificate$DetailsSpec,t),{issuerSerial:i,serial:a,key:l,notAfter:u,notBefore:c}=r;if(null==i)throw new Error('parseCertificateWA6 certificate is missing "issuer_serial"');if(null==a)throw new Error('parseCertificateWA6 certificate is missing "serial"');if(null==l)throw new Error('parseCertificateWA6 certificate is missing "key"');return{serial:a,issuerSerial:i,key:l,notBefore:c,notAfter:u,details:t,signature:n}}function d(e,t){if(!a.verifySignature(new Uint8Array(t),new Uint8Array(e.details),new Uint8Array(e.signature)))throw new Error("verifyCertificateWA6 certificate is poorly signed!")}},61939:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Watchdog=void 0,t.fibonacci=function(e,t,n){if("number"==typeof n){const r=n;return function(n){switch(n.failGeneration){case 0:return Math.min(r,t);case 1:return Math.min(r,e+t);default:return Math.min(r,n.waitDuration+n.prevWaitDuration)}}}return function(n){switch(n.failGeneration){case 0:return t;case 1:return e+t;default:return n.waitDuration+n.prevWaitDuration}}};var r=n(201063),i=n(54918);class a extends i.BaseModel{constructor(){super(...arguments),this.failGeneration=(0,i.session)(0),this.ts=(0,i.session)(),this.waitDuration=(0,i.session)(0),this.prevWaitDuration=(0,i.session)(0),this.jitter=(0,i.session)(0),this.shiftTimer=(0,i.session)(),this.waitAlgorithm=(0,i.session)(),this.onActivated=(0,i.session)(),this.onDeactivated=(0,i.session)(),this.onFed=(0,i.session)(),this.onTimeout=(0,i.session)()}initialize(){this.shiftTimer=new r.ShiftTimer((()=>s.call(this)))}activate(){this.shiftTimer.isScheduled()||(this._run(!0),this.onActivated&&this.onActivated(this))}deactivate(){this.shiftTimer.isScheduled()&&(this.shiftTimer.cancel(),this.onDeactivated&&this.onDeactivated(this))}feed(){this.shiftTimer.isScheduled()&&(this._run(!0),this.onFed&&this.onFed(this))}forceTimeout(e){this.shiftTimer.isScheduled()?null!=e&&0!==e?(this.shiftTimer.onOrBefore(e),this.ts=this.shiftTimer.ts):this.shiftTimer.forceRunNow():__LOG__(3)`forced non-running watchdog!`}poke(){this.forceTimeout.apply(this,arguments)}resetGeneration(){this.failGeneration=0}_run(e){e&&this.resetGeneration();const t=this.waitAlgorithm(this),n=this.jitter*Math.random()*t;this.shiftTimer.debounce(t+n),this.set({ts:this.shiftTimer.ts,waitDuration:t,prevWaitDuration:this.waitDuration})}}const o=(0,i.defineModel)(a);function s(){const e=this.onTimeout;if(!e)return __LOG__(3,void 0,void 0,!0)`Watchdog timed-out without handler!`,void SEND_LOGS("watchdog-no-handler");this.failGeneration++,e(this)&&this._run(!1)}t.Watchdog=o},397203:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.WatchedSocketModel=void 0,t.open=function(e){let t;try{t=new T(e)}catch(e){return __LOG__(3)`WatchedSocket error constructing: ${e}`,d.default.reject(e)}return new d.default(t,(function(e,t){this.id=(T.numSocketsAttempted++).toString(),__LOG__(2)`WatchedSocket opening socket ${this.id}`;const n=(0,h.openSocket)(this.url);n.binaryType="arraybuffer",n.onopen=e,n.onclose=n.onerror=function(e){t(new f.SocketError(e))},this.socket=n})).cancellable().catch((function(e){if(__LOG__(2)`WatchedSocket error on open of ${this.id}: ${e}`,this.socket){const e=this.socket;switch(e.readyState){case WebSocket.CONNECTING:e.onopen=null;case WebSocket.OPEN:e.onerror=null,e.onclose=null,e.close();break;case WebSocket.CLOSING:case WebSocket.CLOSED:e.onerror=null,e.onclose=null}}throw e})).then((function(){__LOG__(2)`WatchedSocket opened socket ${this.id}`;const e=this.socket;return e.onmessage=this._handleMessage.bind(this),e.onerror=this._handleCloseOrError.bind(this,!0),e.onclose=this._handleCloseOrError.bind(this,!1),this._offlineListener=(0,p.default)().then(this.close.bind(this,!1,"offline")).catch((0,a.catchAbort)((()=>{}))),this._pingTimer.onOrAfter(v()),this.state=g.WATCHED_SOCKET_STATE.OPEN,this}))};var i=r(n(82569)),a=n(88237),o=n(975175),s=n(201063),l=n(14361),u=n(54918),c=r(n(62883)),d=r(n(10750)),p=r(n(655386)),_=n(150204),f=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=m(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),h=n(925031),g=n(226562);function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(m=function(e){return e?n:t})(e)}const y=18e4;function E(e,t){let n=-1;const r=e.find((e=>(n++,t(e))));return void 0===r?void 0:{index:n,value:r}}class S extends u.BaseModel{constructor(){super(...arguments),this.id=(0,u.session)(),this.url=(0,u.session)(),this.onmessage=(0,u.session)(),this.onactivity=(0,u.session)(),this.timeSkew=(0,u.session)(),this.msgParser=(0,u.session)(),this.state=(0,u.session)(),this.error=(0,u.session)(),this.socket=(0,u.session)(),this.isQueueing=(0,u.session)(!0),this.maxQueueSize=(0,u.session)(),this.messageQueue=(0,u.session)(),this._offlineListener=(0,u.session)(),this._msgListeners=(0,u.session)(),this._pingTimer=(0,u.session)(),this._killTimer=(0,u.session)()}initialize(){this._msgListeners=[],this.messageQueue=[],this._pingTimer=new s.ShiftTimer((()=>this._ping())),this._killTimer=new s.ShiftTimer((()=>this._killSocket())),_.jsHaltDetector.on(l.JS_HALT_EVENT,this._handleJsHalt,this)}_handleJsHalt(e){e>y&&(__LOG__(2)`js halt longer than ${y} ms detected, killing socket`,this._killTimer.cancel(),this._killTimer.onOrBefore(0))}_ping(){this.send("?,,"),this._killTimer.onOrAfter(A())}_killSocket(){__LOG__(3)`WatchedSocket ${this.id} Timeout!`,this.close(!0,"stale")}detachCallbacks(){this.set({onactivity:void 0,onmessage:void 0})}send(e){this.cast(e),this._pingTimer.cancel(),this._killTimer.onOrAfter(A())}cast(e){if(this.state!==g.WATCHED_SOCKET_STATE.OPEN)throw new f.SocketNotOpen(this.state);if("string"==typeof e&&/\[object ArrayBuffer\]/.test(e))throw new TypeError("converted ArrayBuffer to string prematurely");try{this.socket.send(e)}catch(e){__LOG__(3,void 0,void 0,!0)`exception sending: ${e}\n${e.stack}`,SEND_LOGS("send-exception"),this.close(!0,e)}}partingSend(e,t,n){const r=this,i=this.socket,a=new Promise((function(a){function o(){a(void 0)}i.onclose=o,i.onerror=o,i.onmessage=function(e){const t=e.data;n&&!n(t)||a(t)},r.send(t),r._handleCloseOrError(!1,e)}));return(0,o.promiseTimeout)(a,2e4,"paringSendTimeout").catch((()=>{})).finally((function(){i.onclose=void 0,i.onerror=void 0,i.onmessage=void 0,i.readyState===WebSocket.OPEN&&i.close()}))}close(e,t){const n=this.socket;let r;if(this._handleCloseOrError(e,t||"unspecified"),n&&(r=n.readyState,r===WebSocket.CONNECTING||r===WebSocket.OPEN))try{n.close()}catch(e){__LOG__(3)`WatchedSocket:exception closing: ${e}\n${e.stack}`}}_handleMessage(e){this._pingTimer.onOrAfter(v()),this._killTimer.cancel();const t=e.data;if("string"==typeof t&&"!"===t.charAt(0)){const e=parseInt(t.slice(1),10);return e==e&&(this.timeSkew=Date.now()-e),void(this.onactivity&&this.onactivity())}const n=this.msgParser(e);this.onactivity&&this.onactivity(n),this._handleParsedMsg(n)}_handleParsedMsg(e){const t=E(this._msgListeners,(function(t){return!t.filter||t.filter(e)}));t?(this._msgListeners.splice(t.index,1),t.value.removed=!0,t.value.promise.force(e)):this.isQueueing?(__LOG__(3)`watchedSocket:enqueued`,this.messageQueue.push(e),void 0!==this.maxQueueSize&&this.messageQueue.length>this.maxQueueSize&&this.close(!0,"Queue Overflow")):this.onmessage?this.onmessage(e):__LOG__(3)`watchedSocket:dropped!`}_handleCloseOrError(e,t){if(this.state===g.WATCHED_SOCKET_STATE.CLOSED)return;this.socket&&(this.socket.onclose=void 0,this.socket.onerror=void 0,this.socket.onmessage=void 0),this._offlineListener&&this._offlineListener.cancel(),__LOG__(3)`Socket ${this.id} closing: ${t.toString()}`,_.jsHaltDetector.off(l.JS_HALT_EVENT,this._handleJsHalt,this),this._pingTimer.cancel(),this._killTimer.cancel(),this.set({state:g.WATCHED_SOCKET_STATE.CLOSED,error:e?t:void 0});const n=this._msgListeners,r=e?new f.SocketError(t):new f.SocketClosed(t);this._msgListeners=[],n.forEach((function(e){e.removed=!0,e.promise.cancel(r)}))}holdMessages(e){const t=this.isQueueing&&void 0!==e&&this.messageQueue>e;this.set({isQueueing:!0,messageQueue:this.messageQueue||[],maxQueueSize:e}),t&&this.close(!0,"Queue Overflow")}releaseMessages(e){if(!this.isQueueing)return void __LOG__(3)`WatchedSocket:releaseMessages not queued!`;const t=this.messageQueue;this.set({isQueueing:!1,messageQueue:[]}),e?t.length>0&&__LOG__(3)`WatchedSocket:releaseMessages dropping ${t.length} messages.`:t.forEach((e=>{this._handleParsedMsg(e)}))}nextMessage(e){if(this.state!==g.WATCHED_SOCKET_STATE.OPEN)return d.default.reject(new f.SocketNotOpen(this.state)).cancellable();let t;if(t=e instanceof c.default?e.test.bind(e):e,this.isQueueing){let e;if(t){const n=E(this.messageQueue,t);n&&(e=n.value,this.messageQueue.splice(n.index,1))}else this.messageQueue.length>0&&(e=this.messageQueue.shift());if(e)return d.default.resolve(e).cancellable()}const n=(new d.default).cancellable().forceable(),r={removed:!1,filter:t,promise:n};return this._msgListeners.push(r),n.catch((()=>{r.removed||(this._msgListeners=(0,i.default)(this._msgListeners,r))})),n}}const T=(0,u.defineModel)(S);function v(){return 2e4*Math.random()+1e4}function A(){return 7e4*Math.random()+2e4}t.WatchedSocketModel=T,T.numSocketsAttempted=0},940494:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.WatchedSocketMD=void 0,t.open=function(e){let t;try{t=new g(e)}catch(e){return __LOG__(3)`WatchedSocketMD error constructing: ${e}`,l.default.reject(e)}return new l.default(t,(function(e,t){g.numSocketsAttempted++,this.id=g.numSocketsAttempted,__LOG__(2)`WatchedSocketMD opening socket ${this.id}`;const n=(0,p.openSocket)(this.url);n.binaryType="arraybuffer",n.onopen=e,n.onclose=n.onerror=function(e){t(new d.SocketError(e))},this.socket=n})).cancellable().catch((function(e){if(__LOG__(2)`WatchedSocketMD error on open of ${this.id}: ${e}`,this.socket){const e=this.socket;switch(e.readyState){case WebSocket.CONNECTING:e.onopen=null;case WebSocket.OPEN:e.onerror=null,e.onclose=null,e.close();break;case WebSocket.CLOSING:case WebSocket.CLOSED:e.onerror=null,e.onclose=null}}throw e})).then((function(){__LOG__(2)`WatchedSocketMD opened socket ${this.id}`;const e=this.socket;return e.onmessage=this._handleMessage.bind(this),e.onerror=this._handleCloseOrError.bind(this,!0),e.onclose=this._handleCloseOrError.bind(this,!1),this._offlineListener=(0,u.default)().then(this.close.bind(this,!1,"offline")).catch((0,i.catchAbort)((()=>{}))),this.state=_.WATCHED_SOCKET_STATE.OPEN,this}))};var i=n(88237),a=n(551168),o=n(201063),s=n(14361),l=r(n(10750)),u=r(n(655386)),c=n(150204),d=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),p=n(925031),_=n(226562);function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}const h=18e4;class g{constructor(e){this.onError=null,this.dataToSend=new a.Binary,this.url=e,this._killTimer=new o.ShiftTimer((()=>this._killSocket())),c.jsHaltDetector.on(s.JS_HALT_EVENT,this._handleJsHalt,this)}_handleJsHalt(e){e>h&&(__LOG__(2)`js halt longer than ${h} ms detected, killing socket`,this._killTimer.cancel(),this._killTimer.onOrBefore(0))}_killSocket(){__LOG__(3)`WatchedSocketMD ${this.id} Timeout!`,this.close(!0,"stale")}detachCallbacks(){this.socket.onmessage=m}close(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;const n=this.socket;let r;if(this._handleCloseOrError(e,t||"unspecified"),n&&(r=n.readyState,r===WebSocket.CONNECTING||r===WebSocket.OPEN))try{n.close()}catch(e){__LOG__(3)`WatchedSocketMD:exception closing: ${e}\n${e.stack}`}}requestSend(){if(this.state!==_.WATCHED_SOCKET_STATE.OPEN)throw new d.SocketNotOpen(this.state);if(this.dataToSend.size())try{this.socket.send(this.dataToSend.readByteArray())}catch(e){__LOG__(3)`exception sending: ${e}\n${e.stack}`,this.close(!0,e)}}_handleMessage(e){if(!(e.data instanceof ArrayBuffer))throw new TypeError("expected ArrayBuffer from the socket");if(this.onData){(0,this.onData)(new Uint8Array(e.data))}}_handleCloseOrError(e,t){this.state!==_.WATCHED_SOCKET_STATE.CLOSED&&(this.socket&&(this.socket.onclose=m,this.socket.onerror=m,this.socket.onmessage=m),this._offlineListener&&this._offlineListener.cancel(),__LOG__(3)`Socket ${this.id} closing: ${t.toString()}`,c.jsHaltDetector.off(s.JS_HALT_EVENT,this._handleJsHalt,this),this._killTimer.cancel(),this.state=_.WATCHED_SOCKET_STATE.CLOSED,this.error=e?t:void 0,null!=this.onClose&&this.onClose())}}function m(){}t.WatchedSocketMD=g,g.numSocketsAttempted=0},170428:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.applySubscriptions=E,t.runSubscriptionsManager=m;var a=i(n(348926)),o=n(209733),s=n(36530),l=n(984330),u=n(72696),c=n(978751),d=n(651308),p=n(808469),_=n(113150),f=n(459857);const h={minTimeout:1e3,maxTimeout:16e3,retries:5,signal:(new r).signal},g=864e5;function m(){return y.apply(this,arguments)}function y(){return(y=(0,a.default)((function*(){if((0,u.subscriptionFetchEnabled)()){try{yield(0,o.exponentialBackoff)(h,((e,t)=>T().catch((n=>{if(n instanceof l.ServerStatusCodeError)switch(n.statusCode){case 500:return __LOG__(3)`Subscriptions manager query failed, retriable error: ${n.message}, failCount ${t}`,e(n)}throw n}))))}catch(e){if(__LOG__(4,!0,new Error,!0)`Subscriptions manager pull failed, error: ${e}`,SEND_LOGS("Subscriptions manager run failed"),!(e instanceof l.ServerStatusCodeError&&500===e.statusCode))return}yield(0,s.delayMs)(g),(0,f.getMaybeMeUser)()&&m()}}))).apply(this,arguments)}function E(){return S.apply(this,arguments)}function S(){return(S=(0,a.default)((function*(e){if((0,u.subscriptionFetchEnabled)()){const t=["ACTIVE","FREE_TRIAL","IN_GRACE_PERIOD"],n=e.map((e=>{const n={id:e.id,isAutoRenewing:"ACTIVE"===e.status,isDeactivated:!t.includes(e.status),expirationDate:void 0!==e.expirationDate?parseInt(e.expirationDate,10):void 0};return"CANCELED"===e.status&&(n.expirationDate||0)>(new Date).getTime()/1e3&&(n.isDeactivated=!1),n}));yield(0,d.getTable)().bulkCreateOrMerge(n),p.SubscriptionCollection.add(n,{merge:!0});try{(0,c.update)()}catch(e){__LOG__(4,void 0,new Error,!0)`subscription sync: error PremiumAccessEngine ${e}`,SEND_LOGS("PremiumAccessEngine")}}}))).apply(this,arguments)}function T(){return v.apply(this,arguments)}function v(){return(v=(0,a.default)((function*(){if(!(0,f.getMaybeMeUser)())return;const e=yield(0,_.querySubscriptions)();yield E(e)}))).apply(this,arguments)}},588733:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.unwrapDeviceSentMessage=function(e){var t,n,r;const a=null==e||null===(t=e.deviceSentMessage)||void 0===t?void 0:t.message,o=null==e||null===(n=e.messageContextInfo)||void 0===n?void 0:n.messageSecret;if(null==a||null==o||null!=(null===(r=a.messageContextInfo)||void 0===r?void 0:r.messageSecret))return a;return(0,i.default)((0,i.default)({},a),{},{messageContextInfo:(0,i.default)((0,i.default)({},a.messageContextInfo),{},{messageSecret:o})})},t.wrapDeviceSentMessage=function(e,t){var n;const r={deviceSentMessage:{destinationJid:t.toString({legacy:!0}),message:e}},i=null==e||null===(n=e.messageContextInfo)||void 0===n?void 0:n.messageSecret;null!=i&&(r.messageContextInfo={messageSecret:i});return r};var i=r(n(81109))},21838:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.createMsgProtobuf=function(e,t){const n=function(e){const t=e.id,n=e.toJSON();delete n.status,delete n.mimetype,delete n.height,delete n.width,delete n.recipients,delete n.chat,delete n.broadcast,delete n.ack,delete n.invis,delete n.filehash,delete n.recvFresh,delete n.mediaData,g.default.isHttp(e.clientUrl)||delete n.clientUrl;g.default.isHttp(e.deprecatedMms3Url)||delete n.deprecatedMms3Url;for(const e in n)null==n[e]&&delete n[e];const r=y.default.get(t.remote);r&&(n.conversionTuple=r.serialize());return n}(e),r={};if(n.quotedMsg){const e=n.quotedMsg.mentionedJidList,t=Array.isArray(e)&&e.length>0?{mentionedJid:e.map(l.encodeJid)}:void 0;r.stanzaId=n.quotedStanzaID,r.remoteJid=(0,l.encodeJid)(n.quotedRemoteJid),r.participant=(0,l.encodeJid)(n.quotedParticipant),r.quotedMessage=N(n.quotedMsg,{duration:n.quotedMsg.duration,directPath:n.quotedMsg.directPath,encFilehash:n.quotedMsg.encFilehash,filehash:n.quotedMsg.filehash,height:n.quotedMsg.height,mediaKey:n.quotedMsg.mediaKey,mediaKeyTimestamp:(0,o.isNumber)(n.quotedMsg.mediaKeyTimestamp)?n.quotedMsg.mediaKeyTimestamp:void 0,mimetype:n.quotedMsg.mimetype,url:n.quotedMsg.clientUrl||n.quotedMsg.deprecatedMms3Url,width:n.quotedMsg.width},t,void 0,"quoted")}else n.quotedRemoteJid&&n.quotedGroupSubject&&n.quotedParentGroupJid?(r.remoteJid=(0,l.encodeJid)(n.quotedRemoteJid),r.groupSubject=n.quotedGroupSubject,r.parentGroupJid=(0,l.encodeJid)(n.quotedParentGroupJid)):n.quotedRemoteJid&&(r.remoteJid=(0,l.encodeJid)(n.quotedRemoteJid));if(n.mentionedJidList&&n.mentionedJidList.length>0){const e=n.mentionedJidList;r.mentionedJid=e.map(l.encodeJid)}n.conversionTuple&&Object.assign(r,n.conversionTuple);n.isForwarded&&(r.isForwarded=n.isForwarded);n.forwardingScore&&(r.forwardingScore=n.forwardingScore);n.ephemeralDuration&&(r.expiration=n.ephemeralDuration);n.ephemeralSettingTimestamp&&(r.ephemeralSettingTimestamp=n.ephemeralSettingTimestamp);n.disappearingModeInitiator&&(r.disappearingMode=P(n.disappearingModeInitiator));n.ctwaContext&&(r.externalAdReply={sourceUrl:n.ctwaContext.sourceUrl,sourceId:n.ctwaContext.sourceId,sourceType:n.ctwaContext.sourceType,body:n.ctwaContext.description,title:n.ctwaContext.title,thumbnailUrl:n.ctwaContext.thumbnailUrl,thumbnail:n.ctwaContext.thumbnail?(0,l.encodeBytes)(n.ctwaContext.thumbnail):void 0,mediaType:n.ctwaContext.mediaType,mediaUrl:n.ctwaContext.mediaUrl});return N(n,t,Object.keys(r).length>0?r:void 0)},t.createPeerMsgProtobuf=function(e){const t={};return N(e,[],Object.keys(t).length>0?t:void 0)},t.populateMessageContextInfo=function(e,t,n){if(!t&&!n)return;e.messageContextInfo=(0,a.default)((0,a.default)({},e.messageContextInfo),{},{deviceListMetadata:{senderKeyHash:null==t?void 0:t.keyHash,senderTimestamp:null==t?void 0:t.timestamp,senderKeyIndexes:null==t?void 0:t.keyIndexes,recipientKeyHash:null==n?void 0:n.keyHash,recipientTimestamp:null==n?void 0:n.timestamp,recipientKeyIndexes:null==n?void 0:n.keyIndexes},deviceListMetadataVersion:2})};var i=r(n(506479)),a=r(n(81109)),o=n(425315),s=n(430783),l=n(523930),u=n(862159),c=n(943914),d=r(n(753110)),p=n(97858),_=n(373070),f=n(471751),h=n(533494),g=r(n(79291)),m=n(808639),y=r(n(774719)),E=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=T(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(241588));const S=["type"];function T(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(T=function(e){return e?n:t})(e)}function v(e){return{viewOnceMessage:{message:e}}}function A(e){return{documentWithCaptionMessage:{message:e}}}function C(e){return{editedMessage:{message:e}}}function P(e){let t;switch(e){case m.DisappearingModeInitiator.ChangedInChat:t=h.DisappearingMode$Initiator.CHANGED_IN_CHAT;break;case m.DisappearingModeInitiator.InitiatedByMe:t=h.DisappearingMode$Initiator.INITIATED_BY_ME;break;case m.DisappearingModeInitiator.InitiatedByOther:t=h.DisappearingMode$Initiator.INITIATED_BY_OTHER}return{initiator:t}}function O(e,t,n){const{documentMessage:r,imageMessage:i,locationMessage:a,videoMessage:o}=e;if(t.isForwarded&&(r||i||a||o))return e;const s={buttons:!0===t.isForwarded?void 0:t.dynamicReplyButtons,footerText:t.footer,contextInfo:n};return r?(s.documentMessage=r,s.headerType=h.Message$ButtonsMessage$HeaderType.DOCUMENT,s.contentText=t.caption):i?(s.imageMessage=i,s.headerType=h.Message$ButtonsMessage$HeaderType.IMAGE,s.contentText=t.caption):a?(s.locationMessage=a,s.headerType=h.Message$ButtonsMessage$HeaderType.LOCATION,s.contentText=t.caption):o?(s.videoMessage=o,s.headerType=h.Message$ButtonsMessage$HeaderType.VIDEO,s.contentText=t.caption):t.title?(s.text=t.title,s.headerType=h.Message$ButtonsMessage$HeaderType.TEXT,s.contentText=t.body):(s.contentText=t.body,s.headerType=h.Message$ButtonsMessage$HeaderType.EMPTY),{buttonsMessage:s}}function I(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const i={url:t.url,mimetype:r,caption:e.caption,directPath:t.directPath||void 0,fileSha256:(0,l.encodeBytes)(t.filehash),fileEncSha256:(0,l.encodeBytes)(t.encFilehash),height:t.height,width:t.width,fileLength:(0,o.isNumber)(e.size)?e.size:void 0,mediaKey:(0,l.encodeBytes)(t.mediaKey),mediaKeyTimestamp:(0,o.isNumber)(t.mediaKeyTimestamp)?t.mediaKeyTimestamp:void 0,jpegThumbnail:e.isViewOnce?void 0:(0,l.encodeBytes)(e.body),contextInfo:n,viewOnce:e.isViewOnce};return L(e.type,i),i}function M(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=t.duration;i=(0,o.isString)(i)?parseInt(i,10):i;const a=e.type===_.MSG_TYPE.INTERACTIVE?void 0:e.caption,s={url:t.url,mimetype:r,directPath:t.directPath||void 0,fileSha256:(0,l.encodeBytes)(t.filehash),fileEncSha256:(0,l.encodeBytes)(t.encFilehash),height:t.height,width:t.width,seconds:i,caption:a,fileLength:(0,o.isNumber)(e.size)?e.size:void 0,mediaKey:(0,l.encodeBytes)(t.mediaKey),mediaKeyTimestamp:(0,o.isNumber)(t.mediaKeyTimestamp)?t.mediaKeyTimestamp:void 0,jpegThumbnail:e.isViewOnce?void 0:(0,l.encodeBytes)(e.body),gifPlayback:e.isGif,gifAttribution:e.gifAttribution,contextInfo:n,streamingSidecar:e.streamingSidecar,viewOnce:e.isViewOnce};return L(e.type,s),s}function b(e){let t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0;e.type!==_.MSG_TYPE.INTERACTIVE&&(t=e.caption,(0,p.documentWithCaptionsSendEnabled)()&&(n=e.caption,t=r.filename));const s={url:r.url,mimetype:a,title:t,caption:n,directPath:r.directPath||void 0,fileSha256:(0,l.encodeBytes)(r.filehash),fileEncSha256:(0,l.encodeBytes)(r.encFilehash),fileName:r.filename,fileLength:(0,o.isNumber)(e.size)?e.size:void 0,mediaKey:(0,l.encodeBytes)(r.mediaKey),mediaKeyTimestamp:(0,o.isNumber)(r.mediaKeyTimestamp)?r.mediaKeyTimestamp:void 0,jpegThumbnail:(0,l.encodeBytes)(e.body),contextInfo:i,contactVcard:e.isVcardOverMmsDocument,thumbnailDirectPath:r.thumbnailDirectPath,thumbnailSha256:(0,l.encodeBytes)(r.thumbnailSha256),thumbnailEncSha256:(0,l.encodeBytes)(r.thumbnailEncSha256),thumbnailHeight:r.thumbnailHeight,thumbnailWidth:r.thumbnailWidth};return Number.isFinite(e.pageCount)&&!Number.isNaN(e.pageCount)&&(s.pageCount=e.pageCount),L(e.type,s),s}function R(e){switch(e){case u.GroupType.COMMUNITY:return h.Message$ExtendedTextMessage$InviteLinkGroupType.PARENT;case u.GroupType.SUBGROUP:return h.Message$ExtendedTextMessage$InviteLinkGroupType.SUB;case u.GroupType.DEFAULT_ANNOUNCEMENT_GROUP:return h.Message$ExtendedTextMessage$InviteLinkGroupType.DEFAULT_SUB;default:return h.Message$ExtendedTextMessage$InviteLinkGroupType.DEFAULT}}function N(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0,l=w(e,r,i,o,s);return!0===e.isDynamicReplyButtonsMsg&&(l=O(l,e,i)),e.isViewOnce&&(l=v(l)),e.messageSecret&&(l.messageContextInfo=(0,a.default)((0,a.default)({},l.messageContextInfo),{},{messageSecret:e.messageSecret})),e.type===_.MSG_TYPE.DOCUMENT&&Boolean(null===(t=l.documentMessage)||void 0===t?void 0:t.caption)?A(l):(null===(n=l.protocolMessage)||void 0===n?void 0:n.type)===h.Message$ProtocolMessage$Type.MESSAGE_EDIT?C(l):l}function w(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,u=arguments.length>4?arguments[4]:void 0,g=r||{};const m=e.mimetype||t.mimetype||void 0;let y=t.duration;if((0,p.messagePluginBackendRegistrationEnabled)()){const r=(0,s.getBackendPluginRegistry)().getPlugin(e.type,e.subtype);if(r)return r.generateProtobuf({message:g,msgContext:u,contextInfo:n,json:e,mediaMetadata:t})}switch(e.type){case _.MSG_TYPE.CHAT:"url"===e.subtype||e.quotedMsg||e.quotedRemoteJid||Array.isArray(e.mentionedJidList)&&e.mentionedJidList.length>0||e.conversionTuple||e.isForwarded||e.forwardingScore||e._isPaymentNoteMsg||e.ephemeralDuration||e.ephemeralSettingTimestamp||e.ctwaContext?g.extendedTextMessage={text:e.body,matchedText:e.matchedText,canonicalUrl:e.canonicalUrl,description:e.description,title:e.title,jpegThumbnail:(0,l.encodeBytes)(e.thumbnail),previewType:e.richPreviewType,contextInfo:n,mediaKey:(0,l.encodeBytes)(e.mediaKey),mediaKeyTimestamp:(0,o.isNumber)(e.mediaKeyTimestamp)?e.mediaKeyTimestamp:void 0,thumbnailDirectPath:e.thumbnailDirectPath,thumbnailSha256:(0,l.encodeBytes)(e.thumbnailSha256),thumbnailEncSha256:(0,l.encodeBytes)(e.thumbnailEncSha256),thumbnailHeight:e.thumbnailHeight,thumbnailWidth:e.thumbnailWidth,inviteLinkGroupTypeV2:R(e.inviteGrpType)}:g.conversation=e.body;break;case _.MSG_TYPE.GROUPS_V4_INVITE:g.groupInviteMessage={inviteCode:e.inviteCode,inviteExpiration:parseInt(e.inviteCodeExp,10),groupJid:e.inviteGrp,groupName:e.inviteGrpName,caption:e.comment,jpegThumbnail:(0,l.encodeBytes)(e.inviteGrpJpegThum)};break;case _.MSG_TYPE.STICKER:if("image/webp"!==t.mimetype)throw __LOG__(3)`invalid sticker mimetype: ${t.mimetype}`,new Error("invalid sticker mimetype");g.stickerMessage={url:t.url,mimetype:t.mimetype,directPath:t.directPath||void 0,fileSha256:(0,l.encodeBytes)(t.filehash),fileEncSha256:(0,l.encodeBytes)(t.encFilehash),mediaKey:(0,l.encodeBytes)(t.mediaKey),mediaKeyTimestamp:(0,o.isNumber)(t.mediaKeyTimestamp)?t.mediaKeyTimestamp:void 0,fileLength:(0,o.isNumber)(e.size)?e.size:void 0,height:e.height,width:e.width,firstFrameLength:t.firstFrameLength||void 0,firstFrameSidecar:e.firstFrameSidecar||void 0,isAnimated:t.isAnimated,stickerSentTs:e.stickerSentTs,contextInfo:n},L(e.type,g.stickerMessage);break;case _.MSG_TYPE.LOCATION:const r={degreesLatitude:parseFloat(e.lat)||void 0,degreesLongitude:parseFloat(e.lng)||void 0,jpegThumbnail:(0,l.encodeBytes)(e.body),contextInfo:n};if(e.loc&&(0,o.isString)(e.loc)){const t=e.loc.split("\n");r.name=t[0],r.address=t[1],r.url=e.clientUrl}g.locationMessage=r;break;case _.MSG_TYPE.VCARD:g.contactMessage={displayName:e.vcardFormattedName,vcard:e.body,contextInfo:n};break;case _.MSG_TYPE.MULTI_VCARD:g.contactsArrayMessage={displayName:e.subtype,contacts:e.vcardList.map((e=>e)),contextInfo:n};break;case _.MSG_TYPE.IMAGE:g.imageMessage=I(e,t,n,m);break;case _.MSG_TYPE.PRODUCT:g.productMessage={product:{productImage:{url:t.url,mimetype:m,caption:e.caption,directPath:t.directPath||void 0,fileSha256:(0,l.encodeBytes)(t.filehash),fileEncSha256:(0,l.encodeBytes)(t.encFilehash),height:t.height,width:t.width,fileLength:(0,o.isNumber)(e.size)?e.size:void 0,mediaKey:(0,l.encodeBytes)(t.mediaKey),mediaKeyTimestamp:(0,o.isNumber)(t.mediaKeyTimestamp)?t.mediaKeyTimestamp:void 0,jpegThumbnail:(0,l.encodeBytes)(e.body)},productId:e.productId,title:e.title,description:e.description,currencyCode:e.currencyCode,priceAmount1000:e.priceAmount1000||void 0,salePriceAmount1000:e.salePriceAmount1000||void 0,retailerId:e.retailerId,url:e.url,productImageCount:e.productImageCount},businessOwnerJid:e.businessOwnerJid,contextInfo:n,body:e.caption,footer:e.footer};break;case _.MSG_TYPE.DOCUMENT:g.documentMessage=b(e,t,n,m);break;case _.MSG_TYPE.PTT:case _.MSG_TYPE.AUDIO:y=(0,o.isString)(y)?parseInt(y,10):y;const s={url:t.url,mimetype:m,directPath:t.directPath||void 0,fileSha256:(0,l.encodeBytes)(t.filehash),fileEncSha256:(0,l.encodeBytes)(t.encFilehash),seconds:y,ptt:"ptt"===e.type,fileLength:(0,o.isNumber)(e.size)?e.size:void 0,mediaKey:(0,l.encodeBytes)(t.mediaKey),mediaKeyTimestamp:(0,o.isNumber)(t.mediaKeyTimestamp)?t.mediaKeyTimestamp:void 0,contextInfo:n,streamingSidecar:e.streamingSidecar};E.ServerProps.pttWaveformSend&&e.waveform&&((0,l.validateWaveform)(e.waveform)?s.waveform=e.waveform.buffer:(__LOG__(4,void 0,new Error,!0)`Outgoing waveform with invalid size: ${e.waveform.byteLength}`,SEND_LOGS("outgoing-waveform-invalid-size"))),g.audioMessage=s,L(e.type?"ptt":"audio",g.audioMessage);break;case _.MSG_TYPE.VIDEO:g.videoMessage=M(e,t,n,m);break;case _.MSG_TYPE.PROTOCOL:let T;switch(e.subtype){case"admin_revoke":case"sender_revoke":T={key:(0,l.encodeKey)(e.protocolMessageKey),type:h.Message$ProtocolMessage$Type.REVOKE};break;case"ephemeral_setting":T={type:h.Message$ProtocolMessage$Type.EPHEMERAL_SETTING,ephemeralExpiration:e.ephemeralDuration};break;case"ephemeral_sync_response":T={type:h.Message$ProtocolMessage$Type.EPHEMERAL_SYNC_RESPONSE,ephemeralExpiration:e.ephemeralDuration,ephemeralSettingTimestamp:e.ephemeralSettingTimestamp,disappearingMode:P(e.disappearingModeInitiator)};break;case"app_state_sync_key_share":T={type:h.Message$ProtocolMessage$Type.APP_STATE_SYNC_KEY_SHARE,appStateSyncKeyShare:e.appStateSyncKeyShare};break;case"app_state_sync_key_request":T={type:h.Message$ProtocolMessage$Type.APP_STATE_SYNC_KEY_REQUEST,appStateSyncKeyRequest:e.appStateSyncKeyRequest};break;case"app_state_fatal_exception_notification":T={type:h.Message$ProtocolMessage$Type.APP_STATE_FATAL_EXCEPTION_NOTIFICATION,appStateFatalExceptionNotification:e.appStateFatalExceptionNotification};break;case"share_phone_number":T={type:h.Message$ProtocolMessage$Type.SHARE_PHONE_NUMBER};break;case"message_edit":const t=Boolean(e.matchedText||e.canonicalUrl||e.description||e.title),r=(0,a.default)((0,a.default)({},e),{},{type:_.MSG_TYPE.CHAT,subtype:t?"url":void 0});T={key:(0,l.encodeKey)(e.protocolMessageKey),type:h.Message$ProtocolMessage$Type.MESSAGE_EDIT,timestampMs:e.latestEditSenderTimestampMs,editedMessage:N(r,void 0,n)};break;case"peer_data_operation_request_message":T={type:h.Message$ProtocolMessage$Type.PEER_DATA_OPERATION_REQUEST_MESSAGE,peerDataOperationRequestMessage:e.peerDataOperationRequestMessage};break;case"peer_data_operation_request_response_message":T={type:h.Message$ProtocolMessage$Type.PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE,peerDataOperationRequestResponseMessage:e.peerDataOperationRequestResponseMessage}}T&&(g.protocolMessage=T);break;case _.MSG_TYPE.INTERACTIVE:let v={};if((e.caption||e.nativeFlowName===d.default.ORDER_STATUS)&&(v={body:{text:e.caption}}),e.interactiveHeader){const r={title:e.interactiveHeader.title,subtitle:e.interactiveHeader.subtitle,hasMediaAttachment:e.interactiveHeader.hasMediaAttachment};if(e.interactiveHeader.thumbnail)r.jpegThumbnail=(0,l.encodeBytes)(e.interactiveHeader.thumbnail);else if(e.interactiveHeader.mediaType)switch(e.interactiveHeader.mediaType){case c.InteractiveMessageHeaderMediaType.VIDEO:r.videoMessage=M(e,t,n,m);break;case c.InteractiveMessageHeaderMediaType.DOCUMENT:r.documentMessage=b(e,t,n,m);break;case c.InteractiveMessageHeaderMediaType.IMAGE:r.imageMessage=I(e,t,n,m)}v.header=r}e.footer&&(v.footer={text:e.footer});const A=(0,l.getInteractiveMessageFieldNameForType)(e.interactiveType);A&&(v[A]=e.interactivePayload),n&&(v.contextInfo=n),g.interactiveMessage=v;break;case _.MSG_TYPE.INTERACTIVE_RESPONSE:{const t=e.interactivePayload,{type:r}=t,a=(0,i.default)(t,S),o=(0,l.getInteractiveResponseMessageFieldNameForType)(r);g.interactiveResponseMessage={body:{text:e.body},[o]:a,contextInfo:n};break}case _.MSG_TYPE.PAYMENT:const C={};C.stanzaId=e.quotedStanzaID,C.mentionedJid=e.mentionedJidList&&e.mentionedJidList.map(l.encodeJid),C.isForwarded=e.isForwarded,C.forwardingScore=e.forwardingScore,C.participant=(0,l.encodeJid)(e.quotedParticipant),e.quotedMsg&&(C.quotedMessage=N(e.quotedMsg,void 0,void 0,void 0,"quoted"));const w=e.paymentNoteMsg?N(Object.assign(e.paymentNoteMsg,{_isPaymentNoteMsg:!0}),C):void 0;switch(e.subtype){case"send":const t=e.paymentRequestMessageKey?{fromMe:e.paymentRequestMessageKey.fromMe,remoteJid:(0,l.encodeJid)(e.paymentRequestMessageKey.remote),id:e.paymentRequestMessageKey.id,participant:(0,l.encodeJid)(e.paymentRequestMessageKey.participant)}:void 0;g.sendPaymentMessage={requestMessageKey:t,noteMessage:w};break;case"request":g.requestPaymentMessage={amount1000:e.amount1000,expiryTimestamp:e._paymentExpiryTimestamp,requestFrom:e._paymentRequestFrom,currencyCodeIso4217:e._currencyCodeIso4217,noteMessage:w}}break;case _.MSG_TYPE.TEMPLATE_BUTTON_REPLY:g.templateButtonReplyMessage={selectedId:e.selectedId,selectedIndex:e.selectedIndex,selectedDisplayText:e.body,contextInfo:n};break;case"template":return"text"===e.subtype?(e.type="chat",e.title&&(e.body="*"+e.title+"*\n"+e.body)):e.type=e.subtype,N(e,t,n,g);case _.MSG_TYPE.LIST:g.listMessage=e.list,g.listMessage.contextInfo=n;break;case _.MSG_TYPE.LIST_RESPONSE:g.listResponseMessage=e.listResponse,g.listResponseMessage.contextInfo=n;break;case _.MSG_TYPE.BUTTONS_RESPONSE:g.buttonsResponseMessage=e.buttonsResponse,g.buttonsResponseMessage.contextInfo=n;break;case _.MSG_TYPE.ORDER:e.itemCount||e.message||e.orderId||e.orderTitle||e.sellerJid||e.status||e.surface||e.thumbnail||e.token||e.totalAmount1000||e.totalCurrencyCode?g.orderMessage={itemCount:e.itemCount,message:e.message,orderId:e.orderId,orderTitle:e.orderTitle,sellerJid:e.sellerJid,status:e.status,surface:e.surface,thumbnail:(0,l.encodeBytes)(e.thumbnail),token:e.token,totalAmount1000:e.totalAmount1000,totalCurrencyCode:e.totalCurrencyCode}:g.conversation=e.body;break;case _.MSG_TYPE.NATIVE_FLOW:e.headerType===h.Message$ButtonsMessage$HeaderType.IMAGE&&(g.imageMessage=I(e,t,void 0,m)),g=O(g,e,n),g.buttonsMessage=(0,a.default)((0,a.default)({},g.buttonsMessage),{},{buttons:e.nativeFlowButtons});break;case _.MSG_TYPE.REACTION:g.reactionMessage={key:(0,l.encodeKey)(e.reactionParentKey),text:e.reactionText,senderTimestampMs:e.reactionTimestamp};break;case _.MSG_TYPE.REACTION_ENC:if(!(0,p.cagReactionsSend)())break;g.encReactionMessage={targetMessageKey:(0,l.encodeKey)(e.encReactionTargetMessageKey),encIv:e.encReactionEncIv,encPayload:e.encReactionEncPayload};break;case _.MSG_TYPE.REQUEST_PHONE_NUMBER:g.requestPhoneNumberMessage={contextInfo:n};break;case _.MSG_TYPE.POLL_CREATION:g=(0,f.generatePollCreationMessageProto)({json:e,msgContext:u,contextInfo:n});break;case _.MSG_TYPE.POLL_UPDATE:g=(0,f.generatePollUpdateMessageProto)({json:e,contextInfo:n});break;case _.MSG_TYPE.KEEP_IN_CHAT:g.keepInChatMessage={key:(0,l.encodeKey)(e.keptMessageKey),keepType:e.keepType,timestampMs:e.senderTimestampMs}}return g}function L(e,t){t.viewOnce||(null==t.directPath&&null==t.staticUrl&&(__LOG__(2,void 0,void 0,!0)`directPath missing from msg type ${e}`,SEND_LOGS(`outgoing-${e}-message-missing-direct-path`)),null==t.fileSha256&&(__LOG__(2,void 0,void 0,!0)`fileSha256 missing from msg type ${e}`,SEND_LOGS(`outgoing-${e}-message-missing-file-sha`)),null==t.fileEncSha256&&(__LOG__(2,void 0,void 0,!0)`fileEncSha256 missing from msg type ${e}`,SEND_LOGS(`outgoing-${e}-message-missing-file-enc-sha`)),null==t.url&&null==t.staticUrl&&(__LOG__(2,void 0,void 0,!0)`url(deprecatedMms3Url) missing from msg type ${e}`,SEND_LOGS(`outgoing-${e}-message-missing-mms3-url`)))}},740293:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.parseAudioMessageProto=K,t.parseButtons=z,t.parseButtonsMessageProto=ae,t.parseButtonsResponseMessageProto=re,t.parseContextInfoProto=W,t.parseDisappearingModeProto=oe,t.parseDocumentMessageProto=Y,t.parseEncReactionMessageProto=ce,t.parseExtendedTextMessageProto=j,t.parseGroupInviteMessageProto=ee,t.parseHighlyStructuredMessageProto=_e,t.parseImageMessageProto=B,t.parseInteractiveMessageProto=se,t.parseInteractiveResponseMessageProto=le,t.parseListMessageProto=ne,t.parseLiveLocationMessageProto=J,t.parseMessageContextInfoProto=pe,t.parseMsgProto=x,t.parseOrderMessageProto=te,t.parsePaymentInviteMessageProto=Z,t.parseProductMessageProto=q,t.parseProtocolMessageProto=V,t.parseReactionMessageProto=ue,t.parseRequestPaymentMessageProto=X,t.parseRequestPhoneNumberMessageProto=de,t.parseSendPaymentMessageProto=Q,t.parseStickerMessageProto=F,t.parseTemplateMessage=$,t.parseVideoMessageProto=H;var i=r(n(81109)),a=r(n(288306)),o=r(n(82236)),s=r(n(132375)),l=n(990445),u=n(425315),c=n(402994),d=n(72696),p=r(n(846870)),_=n(21094),f=n(523930),h=n(177205),g=n(943914),m=r(n(753110)),y=r(n(182394)),E=U(n(446303)),S=n(920733),T=n(97858),v=r(n(565754)),A=n(373070),C=n(844558),P=n(929660),O=n(533494),I=n(968923),M=r(n(79291)),b=n(459857),R=n(808639),N=n(84461),w=n(890344),L=n(357118),D=U(n(241588));function k(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(k=function(e){return e?n:t})(e)}function U(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=k(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}const G=(0,a.default)((function(e){return M.default.hostname(e)}));function x(e,t,n,r,a,o,l,c){if(!e)return __LOG__(4,void 0,new Error,!0)`drop: not Message`,SEND_LOGS("null-message"),t;const{messageContextInfo:d}=e,p=function(e,t,n,r,a,o,l,c){let d;const{conversation:p,imageMessage:h,contactMessage:g,locationMessage:m,liveLocationMessage:y,extendedTextMessage:E,documentMessage:S,audioMessage:I,videoMessage:M,stickerMessage:R,contactsArrayMessage:w,sendPaymentMessage:L,requestPaymentMessage:k,productMessage:U,groupInviteMessage:G,viewOnceMessage:W,viewOnceMessageV2:z,ephemeralMessage:oe,documentWithCaptionMessage:pe,orderMessage:fe,listMessage:he,listResponseMessage:ge,protocolMessage:me,declinePaymentRequestMessage:ye,cancelPaymentRequestMessage:Ee,paymentInviteMessage:Se,templateMessage:Te,templateButtonReplyMessage:ve,buttonsResponseMessage:Ae,buttonsMessage:Ce,interactiveMessage:Pe,interactiveResponseMessage:Oe,reactionMessage:Ie,keepInChatMessage:Me,requestPhoneNumberMessage:be,messageContextInfo:Re,editedMessage:Ne,encReactionMessage:we}=e;if((0,T.messagePluginBackendRegistrationEnabled)()){const r=(0,C.parseProtoPlugins)({message:e,baseMessage:t,messageContextInfo:Re,msgContext:n});if(r)return Object.assign(t,r.msgData),r.contextInfo}(0,u.isString)(p)&&function(e,t){e.type=A.MSG_TYPE.CHAT,e.body=(0,f.convertToTextWithoutSpecialEmojis)(t)}(t,p);G&&ee(t,G);h&&(B(t,h),d=h.contextInfo);R&&(F(t,R),d=R.contextInfo);g&&((0,_.parseContactMessageProto)(t,g),d=g.contextInfo);w&&((0,_.parseContactsArrayMessageProto)(t,w),d=w.contextInfo);m&&((0,_.parseLocationMessageProto)(t,m),d=m.contextInfo);y&&(J(t,y,a),d=y.contextInfo);if(L){var Le,De;d=null===(Le=L.noteMessage)||void 0===Le||null===(De=Le.extendedTextMessage)||void 0===De?void 0:De.contextInfo,Q(t,L,r)}if(k){var ke,Ue;d=null===(ke=k.noteMessage)||void 0===ke||null===(Ue=ke.extendedTextMessage)||void 0===Ue?void 0:Ue.contextInfo,X(t,k,r)}ye&&function(e,t){const n=function(e,t){if(!e)throw new Error("parseProtocolMessageProto: no message key is defined for decline payment request message");const{id:n}=e;if(!n)throw new Error("parseProtocolMessageProto: no message id is defined for decline payment request message");let r;var i;if(t.id.remote.isGroup()){if(!t.id.fromMe&&!(null===(i=(0,f.decodeJid)(e.participant))||void 0===i?void 0:i.equals((0,b.getMeUser)()))&&"send"!==t.subtype)return null;r=(0,f.decodeJid)(e.participant)}return new v.default({fromMe:!t.id.fromMe,remote:t.id.remote,id:n,participant:r})}(t.key,e);e.paymentRequestMessageKey=n,e.subtype="payment_action_request_declined"}(t,ye);Ee&&function(e,t){const n=t.key;if(n){const t=function(e,t){if(!e)throw new Error("parseProtocolMessageProto: no message key is defined for cancel payment request message");const{id:n}=e;if(!n)throw new Error("parseProtocolMessageProto: no message id is defined for cancel payment request message");let r;if(t.id.remote.isGroup()){var i;if(r=t.id.participant,t.id.fromMe)r=(0,f.decodeJid)(t.from);else if(!(null===(i=(0,f.decodeJid)(e.participant))||void 0===i?void 0:i.equals((0,b.getMeUser)())))return null}return new v.default({id:n,fromMe:t.id.fromMe,remote:t.id.remote,participant:r})}(n,e);e.paymentRequestMessageKey=t,e.subtype="payment_transaction_request_cancelled"}}(t,Ee);Se&&Z(t,Se);E&&(j(t,E),d=E.contextInfo);S&&(Y(t,S),d=S.contextInfo);pe&&function(e,t){x((0,s.default)(t.message,"futureproofMessage.message"),e)}(t,pe);I&&(K(t,I),d=I.contextInfo);M&&(H(t,M),d=M.contextInfo);me&&V(t,me,n,c);U&&(q(t,U),d=U.contextInfo);fe&&(te(t,fe),d=fe.contextInfo);he&&(ne(t,he),d=he.contextInfo);ge&&(!function(e,t){if(D.ServerProps.webListMessage&&t.listType===O.Message$ListResponseMessage$ListType.SINGLE_SELECT){e.type=A.MSG_TYPE.LIST_RESPONSE,e.listResponse=(0,i.default)((0,i.default)({},t),{},{contextInfo:void 0});let n=t.title||"";t.description&&(n+="\n"+t.description),e.body=(0,f.convertToTextWithoutSpecialEmojis)(n)}}(t,ge),d=ge.contextInfo);W&&ie(t,W);z&&(0,T.isViewOnceSunsetEnabled)()&&ie(t,z);oe&&function(e,t,n){x(t.message,e,n)}(t,oe,n);Ce&&(ae(t,Ce,l),d=Ce.contextInfo);Ae&&(re(t,Ae),d=Ae.contextInfo);Pe&&(se(t,Pe,l),d=Pe.contextInfo);Oe&&(le(t,Oe,l),d=Oe.contextInfo);Ie&&ue(t,Ie);we&&ce(t,we);const Ge=(0,P.parsePollCreationMessageProto)({baseMessage:{},message:e,messageContextInfo:Re,msgContext:n});Ge&&(Ge.contextInfo&&(d=Ge.contextInfo),Object.assign(t,Ge.msgData));be&&(de(t),d=be.contextInfo);const xe=(0,P.parsePollUpdateVoteMessageProto)({message:e,baseMessage:t});xe&&Object.assign(t,xe.msgData);const{deviceSentMessage:Be,highlyStructuredMessage:Fe}=e;Be&&function(e,t,n){const r=(0,f.decodeJid)(t.destinationJid);e.id.remote=r,e.to=r,x(t.message,e,n)}(t,Be,n);Fe&&_e(t,Fe);Te&&(Te.hydratedTemplate?$(t,Te.hydratedTemplate):$(t,(0,s.default)(Te.hydratedFourRowTemplate,"templateMessage.hydratedFourRowTemplate")));ve&&(!function(e,t){e.body=(0,f.convertToTextWithoutSpecialEmojis)(t.selectedDisplayText),e.selectedIndex=t.selectedIndex,e.selectedId=t.selectedId}(t,ve),d=ve.contextInfo,t.type=A.MSG_TYPE.TEMPLATE_BUTTON_REPLY);Me&&function(e,t){if(e.keptMessageKey=(0,f.getMsgKey)(t.key,e),!(0,N.isKeepInChatReadEnabled)())return e.type=A.MSG_TYPE.UNKNOWN,e.subtype=A.MSG_TYPE.KEEP_IN_CHAT,void(e.futureproofType=A.MSG_TYPE.KEEP_IN_CHAT);e.type=A.MSG_TYPE.KEEP_IN_CHAT,e.keepType=t.keepType,e.senderTimestampMs=t.timestampMs}(t,Me);Ne&&function(e,t,n){if(!(0,T.receiveMessageEditEnabled)())return e.type=A.MSG_TYPE.UNKNOWN,e.subtype="message_edit",e.futureproofType=A.MSG_TYPE.PROTOCOL,void(e.futureproofSubtype="message_edit");x((0,s.default)(t.message,"futureproofMessage.message"),e,n)}(t,Ne,n);return d}(e,t,n,r,a,0,l,c);return function(e,t,n){if(!t)return;W(e,t,n),function(e,t){const n=t.externalAdReply;if(!n||!D.ServerProps.ctwaContextRender)return;const r=E.findLink(n.sourceUrl||"",!1,e.from);e.ctwaContext={conversionSource:t.conversionSource,conversionData:t.conversionData,sourceUrl:n.sourceUrl,description:n.body,title:n.title,thumbnail:n.thumbnail?(0,_.decodeBytes)(n.thumbnail):null,thumbnailUrl:n.thumbnailUrl,mediaType:n.mediaType,mediaUrl:n.mediaUrl,isSuspiciousLink:(null==r?void 0:r.suspiciousCharacters)&&r.suspiciousCharacters.size>0}}(e,t)}(t,p,o),pe(t,d),t}function B(e,t){e.type=A.MSG_TYPE.IMAGE,e.deprecatedMms3Url=(0,_.decodeUrl)(t.url),e.directPath=t.directPath||"",e.staticUrl=t.staticUrl||"",e.mimetype=t.mimetype||"",e.caption=(0,f.convertToTextWithoutSpecialEmojis)(t.caption),e.filehash=(0,_.decodeBytes)(t.fileSha256),e.encFilehash=(0,_.decodeBytes)(t.fileEncSha256),e.size=t.fileLength||0,e.height=t.height||0,e.width=t.width||0,e.mediaKey=(0,_.decodeBytes)(t.mediaKey),e.mediaKeyTimestamp=null!=t.mediaKeyTimestamp?t.mediaKeyTimestamp:(0,l.unixTime)(),e.body=(0,_.decodeBytes)(t.jpegThumbnail)||"",e.interactiveAnnotations=t.interactiveAnnotations,e.scanLengths=t.scanLengths,e.scansSidecar=t.scansSidecar,e.isViewOnce=!0===t.viewOnce,e.thumbnailDirectPath=t.thumbnailDirectPath,e.thumbnailSha256=(0,_.decodeBytes)(t.thumbnailSha256),e.thumbnailEncSha256=(0,_.decodeBytes)(t.thumbnailEncSha256),(0,_.validateRequiredMediaProperties)(e,t)}function F(e,t){e.type=A.MSG_TYPE.STICKER,e.deprecatedMms3Url=(0,_.decodeUrl)(t.url),e.directPath=t.directPath||"",e.mimetype=t.mimetype||"",e.filehash=(0,_.decodeBytes)(t.fileSha256),e.encFilehash=(0,_.decodeBytes)(t.fileEncSha256),e.mediaKey=(0,o.default)((0,_.decodeBytes)(t.mediaKey)),e.mediaKeyTimestamp=null!=t.mediaKeyTimestamp?t.mediaKeyTimestamp:(0,l.unixTime)(),e.height=t.height||0,e.width=t.width||0,e.firstFrameLength=t.firstFrameLength,e.firstFrameSidecar=t.firstFrameSidecar,e.isAnimated=t.isAnimated,e.stickerSentTs=t.stickerSentTs,e.isAvatar=t.isAvatar,(0,_.validateRequiredMediaProperties)(e,t)}function j(e,t){const n=t.matchedText||t.canonicalUrl||t.description||t.title;if(n){const n=G(t.canonicalUrl||""),r=G(t.matchedText||"");e.canonicalUrl=n===r||""===n?t.canonicalUrl:r}e.type=A.MSG_TYPE.CHAT,e.subtype=n?"url":void 0,e.body=(0,f.convertToTextWithoutSpecialEmojis)(t.text||""),e.matchedText=t.matchedText,e.description=t.description,e.title=t.title,e.thumbnail=(0,_.decodeBytes)(t.jpegThumbnail)||"",e.richPreviewType=t.previewType,e.doNotPlayInline=t.doNotPlayInline,e.textColor=t.textArgb,e.backgroundColor=t.backgroundArgb,e.mediaKey=(0,_.decodeBytes)(t.mediaKey),e.mediaKeyTimestamp=t.mediaKeyTimestamp,e.thumbnailDirectPath=t.thumbnailDirectPath,e.thumbnailSha256=(0,_.decodeBytes)(t.thumbnailSha256),e.thumbnailEncSha256=(0,_.decodeBytes)(t.thumbnailEncSha256),e.thumbnailHeight=t.thumbnailHeight,e.thumbnailWidth=t.thumbnailWidth;const r=O.Message$ExtendedTextMessage$FontType;if(null!=t.font)switch(t.font){case r.SANS_SERIF:case r.SERIF:case r.NORICAN_REGULAR:case r.BRYNDAN_WRITE:case r.BEBASNEUE_REGULAR:case r.OSWALD_HEAVY:e.font=t.font}null!=t.inviteLinkGroupTypeV2&&(e.inviteGrpType=(0,_.parseInviteGrpType)(t.inviteLinkGroupTypeV2))}function Y(e,t){e.type=A.MSG_TYPE.DOCUMENT,e.deprecatedMms3Url=(0,_.decodeUrl)(t.url),e.directPath=t.directPath,e.mimetype=t.mimetype,e.filehash=(0,_.decodeBytes)(t.fileSha256),e.encFilehash=(0,_.decodeBytes)(t.fileEncSha256),e.size=t.fileLength||0,e.pageCount=t.pageCount||0,e.mediaKey=(0,_.decodeBytes)(t.mediaKey),e.mediaKeyTimestamp=null!=t.mediaKeyTimestamp?t.mediaKeyTimestamp:(0,l.unixTime)(),e.filename=(0,S.cleanIncomingFilename)(t.fileName||t.title),e.isCaptionByUser=null!=t.caption&&""!==t.caption,e.caption=e.filename,e.isCaptionByUser&&(e.caption=(0,f.convertToTextWithoutSpecialEmojis)(t.caption)),e.body=(0,_.decodeBytes)(t.jpegThumbnail)||"",e.isVcardOverMmsDocument=Boolean(t.contactVcard)&&e.size<=1024*D.ServerProps.vcardMaxSizeKb,e.thumbnailDirectPath=t.thumbnailDirectPath,e.thumbnailSha256=(0,_.decodeBytes)(t.thumbnailSha256),e.thumbnailEncSha256=(0,_.decodeBytes)(t.thumbnailEncSha256),e.thumbnailHeight=t.thumbnailHeight,e.thumbnailWidth=t.thumbnailWidth,(0,_.validateRequiredMediaProperties)(e,t)}function K(e,t){e.type=t.ptt?A.MSG_TYPE.PTT:A.MSG_TYPE.AUDIO,e.deprecatedMms3Url=(0,_.decodeUrl)(t.url),e.directPath=t.directPath,e.mimetype=t.mimetype,e.filehash=(0,_.decodeBytes)(t.fileSha256),e.encFilehash=(0,_.decodeBytes)(t.fileEncSha256),e.size=t.fileLength||0,e.duration=`${t.seconds||0}`,e.mediaKey=(0,_.decodeBytes)(t.mediaKey),e.mediaKeyTimestamp=null!=t.mediaKeyTimestamp?t.mediaKeyTimestamp:(0,l.unixTime)(),e.streamingSidecar=t.streamingSidecar,e.waveform=t.waveform&&(0,f.validateWaveform)(t.waveform)?new Uint8Array(t.waveform):void 0,e.backgroundColor=t.backgroundArgb,(0,_.validateRequiredMediaProperties)(e,t)}function H(e,t){e.type=A.MSG_TYPE.VIDEO,e.deprecatedMms3Url=(0,_.decodeUrl)(t.url),e.directPath=t.directPath,e.staticUrl=t.staticUrl||"",e.mimetype=t.mimetype,e.filehash=(0,_.decodeBytes)(t.fileSha256),e.encFilehash=(0,_.decodeBytes)(t.fileEncSha256),e.size=t.fileLength||0,e.height=t.height,e.width=t.width,e.duration=`${t.seconds||0}`,e.mediaKey=(0,_.decodeBytes)(t.mediaKey),e.mediaKeyTimestamp=null!=t.mediaKeyTimestamp?t.mediaKeyTimestamp:(0,l.unixTime)(),e.caption=(0,f.convertToTextWithoutSpecialEmojis)(t.caption),e.body=(0,_.decodeBytes)(t.jpegThumbnail)||"",e.isGif=t.gifPlayback,e.gifAttribution=t.gifAttribution,e.streamingSidecar=t.streamingSidecar,e.interactiveAnnotations=t.interactiveAnnotations,e.isViewOnce=!0===t.viewOnce,e.thumbnailDirectPath=t.thumbnailDirectPath,e.thumbnailSha256=(0,_.decodeBytes)(t.thumbnailSha256),e.thumbnailEncSha256=(0,_.decodeBytes)(t.thumbnailEncSha256),(0,_.validateRequiredMediaProperties)(e,t)}function W(e,t,n){const r=t.quotedMessage,i=t.mentionedJid;null!=r&&(0,f.isQuotedSupported)(r)&&(e.quotedMsg=x(r,{type:A.MSG_TYPE.UNKNOWN},"quoted")),e.quotedMsg&&"payment"===e.quotedMsg.type&&n&&__LOG__(2)`parseContextInfoProto: payment not supported`,e.quotedStanzaID=t.stanzaId,e.quotedParticipant=(0,f.decodeJid)(t.participant),e.quotedRemoteJid=(0,f.decodeJid)(t.remoteJid),e.quotedGroupSubject=(0,f.decodeJid)(t.groupSubject),e.quotedParentGroupJid=(0,f.decodeJid)(t.parentGroupJid),e.mentionedJidList=Array.isArray(i)?i.map(f.decodeJid):i,e.isForwarded=t.isForwarded,e.forwardingScore=t.forwardingScore,null!=t.expiration&&(e.ephemeralDuration=t.expiration),null!=t.ephemeralSettingTimestamp&&(e.ephemeralSettingTimestamp=t.ephemeralSettingTimestamp),null!=t.ephemeralSharedSecret&&(e.ephemeralSharedSecret=t.ephemeralSharedSecret),null!=t.disappearingMode&&oe(e,t.disappearingMode),null!=t.actionLink&&(e.actionLink=t.actionLink)}function V(e,t,n,r){if("relay"!==n&&t.type!==O.Message$ProtocolMessage$Type.EPHEMERAL_SETTING)return;const{key:i,type:a}=t;let o=null;if(e.type=A.MSG_TYPE.PROTOCOL,null!=a)switch(a){case O.Message$ProtocolMessage$Type.REVOKE:try{o=(0,f.getMsgKey)(i,e),e.protocolMessageKey=o,e.subtype=r===c.EDIT_ATTR.ADMIN_REVOKE?"admin_revoke":"sender_revoke"}catch(e){throw __LOG__(3,void 0,void 0,!0,["messaging"])`parseProtocolMessageProto: error:${null==e?void 0:e.name}, stack: ${null==e?void 0:e.stack}`,SEND_LOGS("parseProtocolMessageProto: RevokeParseError"),e}break;case O.Message$ProtocolMessage$Type.EPHEMERAL_SETTING:e.subtype="ephemeral_setting",e.ephemeralDuration=t.ephemeralExpiration;break;case O.Message$ProtocolMessage$Type.EPHEMERAL_SYNC_RESPONSE:e.subtype="ephemeral_sync_response",e.ephemeralDuration=t.ephemeralExpiration,e.ephemeralSettingTimestamp=t.ephemeralSettingTimestamp,null!=t.disappearingMode&&oe(e,t.disappearingMode);break;case O.Message$ProtocolMessage$Type.SHARE_PHONE_NUMBER:e.subtype="share_phone_number";break;case O.Message$ProtocolMessage$Type.HISTORY_SYNC_NOTIFICATION:e.subtype="history_sync_notification";const{historySyncNotification:n}=t;if(n){var l;const r={directPath:n.directPath,encFilehash:(0,_.decodeBytes)(n.fileEncSha256),filehash:(0,_.decodeBytes)(n.fileSha256),mediaKey:(0,_.decodeBytes)(n.mediaKey),type:"md-msg-hist"};e.historySyncMetaData={historySyncNotification:t.historySyncNotification,downloadOptions:r,progress:(null==t||null===(l=t.historySyncNotification)||void 0===l?void 0:l.progress)||0}}break;case O.Message$ProtocolMessage$Type.MESSAGE_EDIT:try{x((0,s.default)(t.editedMessage,"protocolMessage.editedMessage"),e),e.type=A.MSG_TYPE.PROTOCOL,e.subtype="message_edit",e.protocolMessageKey=(0,f.getMsgKey)(i,e),e.latestEditMsgKey=e.id,e.latestEditSenderTimestampMs=t.timestampMs}catch(e){throw __LOG__(3,void 0,void 0,!0,["messaging"])`parseProtocolMessageProto: error:${null==e?void 0:e.name}, stack: ${null==e?void 0:e.stack}`,SEND_LOGS("parseProtocolMessageProto: EditParseError"),e}break;case O.Message$ProtocolMessage$Type.APP_STATE_SYNC_KEY_REQUEST:case O.Message$ProtocolMessage$Type.APP_STATE_SYNC_KEY_SHARE:case O.Message$ProtocolMessage$Type.MSG_FANOUT_BACKFILL_REQUEST:case O.Message$ProtocolMessage$Type.INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC:case O.Message$ProtocolMessage$Type.APP_STATE_FATAL_EXCEPTION_NOTIFICATION:case O.Message$ProtocolMessage$Type.PEER_DATA_OPERATION_REQUEST_MESSAGE:case O.Message$ProtocolMessage$Type.PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE:e.subtype="unknown"}}function $(e,t){const{documentMessage:n,imageMessage:r,locationMessage:i,videoMessage:a}=t;e.isFromTemplate=!0,n?Y(e,n):r?B(e,r):i?(0,_.parseLocationMessageProto)(e,i):a?H(e,a):(e.type=A.MSG_TYPE.CHAT,t.hydratedContentText&&(e.body=(0,f.convertToTextWithoutSpecialEmojis)(t.hydratedContentText))),t.hydratedButtons&&z(e,t),t.hydratedContentText&&(e.caption=(0,f.convertToTextWithoutSpecialEmojis)(t.hydratedContentText)),t.hydratedFooterText&&(e.footer=(0,f.convertToTextWithoutSpecialEmojis)(t.hydratedFooterText)),t.hydratedTitleText&&(e.title=(0,f.convertToTextWithoutSpecialEmojis)(t.hydratedTitleText))}function z(e,t){const{hydratedButtons:n}=t;n.length&&(e.hydratedButtons=n)}function q(e,t){const{product:n,body:r,footer:i}=t;n&&(n.productImage&&B(e,n.productImage),e.type=A.MSG_TYPE.PRODUCT,e.businessOwnerJid=t.businessOwnerJid,e.productId=n.productId,e.currencyCode=n.currencyCode,e.priceAmount1000=n.priceAmount1000,e.salePriceAmount1000=n.salePriceAmount1000,e.retailerId=n.retailerId,e.url=n.url,e.productImageCount=n.productImageCount,e.title=n.title,e.description=n.description,e.caption=r,e.footer=i)}function J(e,t,n){e.type="location",e.isLive=!0,e.lat=t.degreesLatitude,e.lng=t.degreesLongitude,e.body=(0,_.decodeBytes)(t.jpegThumbnail)||"",e.accuracy=t.accuracyInMeters,e.speed=t.speedInMps,e.degrees=t.degreesClockwiseFromMagneticNorth,e.comment=(0,f.convertToTextWithoutSpecialEmojis)(t.caption),e.sequence=t.sequenceNumber,n&&(e.finalLat=n.degreesLatitude,e.finalLng=n.degreesLongitude,e.finalThumbnail=(0,_.decodeBytes)(n.jpegThumbnail)||"",e.finalAccuracy=n.accuracyInMeters,e.finalSpeed=n.speedInMps,e.finalDegrees=n.degreesClockwiseFromMagneticNorth,e.finalTimeOffset=n.timeOffset)}function Q(e,t,n){if((null==n?void 0:n.futureproofed)||(0,f.hasUnsupportedCurrency)(n))e.type="unknown",e.subtype="phone_only_feature",__LOG__(2)`parseSendPaymentMessageProto: does not support novi transactions`;else{var r,i,a;e.type=A.MSG_TYPE.PAYMENT,e.subtype="send",t.background&&(e.paymentBackground=t.background),(null===(r=t.noteMessage)||void 0===r?void 0:r.extendedTextMessage)||null!=(null===(i=t.noteMessage)||void 0===i?void 0:i.conversation)||(null===(a=t.noteMessage)||void 0===a?void 0:a.stickerMessage)?(e.paymentNoteMsg={},t.noteMessage=x(t.noteMessage,e.paymentNoteMsg)):e.subtype="futureproof",(0,f.parseMsgPaymentInfo)(e,n);const o=t.requestMessageKey;o&&(e.paymentRequestMessageKey=function(e,t){if(!e)throw new Error("_getPaymentRequestMessageKey: no message key is defined");const{id:n}=e;if(!n)throw new Error("_getPaymentRequestMessageKey: no key id is defined");if(!t.id)return __LOG__(3)`_getPaymentRequestMessageKey: no message id is defined`,null;let r;if(t.id.remote.isGroup()){var i;if(!t.id.fromMe&&!(null===(i=(0,f.decodeJid)(e.participant))||void 0===i?void 0:i.equals((0,b.getMeUser)()))&&"send"!==t.subtype)return null;r=(0,f.decodeJid)(e.participant)}return new v.default({fromMe:!t.id.fromMe,remote:t.id.remote,id:n,participant:r})}(o,e))}}function X(e,t,n){if((null==n?void 0:n.futureproofed)||(0,f.hasUnsupportedCurrency)(n))e.subtype="phone_only_feature",__LOG__(2)`parseRequestPaymentMessageProto: does not support novi transactions`;else{var r,i,a;if(e.type=A.MSG_TYPE.PAYMENT,(0,f.parseMsgPaymentInfo)(e,n),e.subtype="request",t.background&&(e.paymentBackground=t.background),(null===(r=t.noteMessage)||void 0===r?void 0:r.extendedTextMessage)||null!=(null===(i=t.noteMessage)||void 0===i?void 0:i.conversation)||(null===(a=t.noteMessage)||void 0===a?void 0:a.stickerMessage)?(e.paymentNoteMsg={},t.noteMessage=x(t.noteMessage,e.paymentNoteMsg)):e.subtype="futureproof",null!=t.amount){if(t.amount.currencyCode&&!e.paymentCurrency&&(e.paymentCurrency=t.amount.currencyCode),null!=t.amount.value&&!e.paymentAmount1000){const n=t.amount,r=null==n.offset||0===n.offset?1e3:n.offset;e.paymentAmount1000=1e3*parseFloat(n.value)/r}}else t.currencyCodeIso4217&&!e.paymentCurrency&&(e.paymentCurrency=t.currencyCodeIso4217),null==t.amount1000||e.paymentAmount1000||(e.paymentAmount1000=t.amount1000);t.requestFrom&&!e.paymentMessageReceiverJid&&(e.paymentMessageReceiverJid=(0,f.decodeJid)(t.requestFrom)),e.paymentStatus&&e.paymentTxnStatus||(0,f.isEitherSenderOrReceiverOfPaymentMessage)(e)&&(e.paymentStatus=I.PaymentInfo$Status.WAITING,e.paymentTxnStatus=I.PaymentInfo$TxnStatus.COLLECT_INIT),null==t.expiryTimestamp||e.paymentExpiryTimestamp||(e.paymentExpiryTimestamp=t.expiryTimestamp)}}function Z(e,t){t.serviceType===O.Message$PaymentInviteMessage$ServiceType.NOVI?(e.subtype="phone_only_feature",__LOG__(2)`[payment-invite] parsePaymentInviteMessageProto: does not support novi transactions`):(e.type=A.MSG_TYPE.PAYMENT,e.subtype="invite",e.paymentExpiryTimestamp=t.expiryTimestamp,e.paymentInviteServiceType=t.serviceType,__LOG__(2)`[payment-invite] render payment invite of type ${t.serviceType}`)}function ee(e,t){e.comment=t.caption,e.inviteCode=t.inviteCode,e.inviteCodeExp=t.inviteExpiration,e.inviteGrp=t.groupJid,e.inviteGrpName=t.groupName,e.type=A.MSG_TYPE.GROUPS_V4_INVITE}function te(e,t){e.type=A.MSG_TYPE.ORDER,e.thumbnail=(0,_.decodeBytes)(t.thumbnail),e.message=t.message||"",e.orderId=t.orderId,e.itemCount=t.itemCount||0,e.status=t.status,e.surface=t.surface,e.sellerJid=t.sellerJid,e.orderTitle=t.orderTitle||"",e.token=t.token||"",e.totalAmount1000=t.totalAmount1000,e.totalCurrencyCode=t.totalCurrencyCode,e.body=""}function ne(e,t){var n,r;D.ServerProps.webListMessage&&t.listType===O.Message$ListMessage$ListType.SINGLE_SELECT||(0,d.productListMessagesEnabled)()&&t.listType===O.Message$ListMessage$ListType.PRODUCT_LIST?(e.type=A.MSG_TYPE.LIST,e.list=t,e.footer=t.footerText,t.listType===O.Message$ListMessage$ListType.PRODUCT_LIST&&(e.businessOwnerJid=null===(n=t.productListInfo)||void 0===n?void 0:n.businessOwnerJid,e.productListItemCount=null===(r=t.productListInfo)||void 0===r?void 0:r.productSections.reduce(((e,t)=>e+t.products.length),0))):(t.listType===O.Message$ListMessage$ListType.PRODUCT_LIST&&(e.subtype="phone_only_feature"),e.type=A.MSG_TYPE.UNKNOWN)}function re(e,t){let{selectedDisplayText:n,selectedButtonId:r,type:i}=t;(0,d.buttonsMessagesEnabled)()&&i===O.Message$ButtonsResponseMessage$Type.DISPLAY_TEXT?(e.type=A.MSG_TYPE.BUTTONS_RESPONSE,e.selectedButtonId=r,e.body=(0,f.convertToTextWithoutSpecialEmojis)(n)):e.type=A.MSG_TYPE.UNKNOWN}function ie(e,t){x(t.message,e)}function ae(e,t,n){if(!(0,d.buttonsMessagesEnabled)())return void(e.type=A.MSG_TYPE.UNKNOWN);const{documentMessage:r,imageMessage:a,locationMessage:o,videoMessage:s,contentText:l,footerText:u,text:c,buttons:p=[],headerType:h}=t,g=m.default.cast((0,f.getBizNativeFlowName)({buttonsMessage:t}));if(!(0,f.shouldParseNFM)(g,n)||(0,f.hasUnsupportedButtons)(p))return e.type=A.MSG_TYPE.UNKNOWN,void(e.subtype="phone_only_feature");if(h!==O.Message$ButtonsMessage$HeaderType.UNKNOWN&&new Set(O.Message$ButtonsMessage$HeaderType.members()).has(h)){if(e.type=A.MSG_TYPE.CHAT,e.headerType=h,a?B(e,a):r?Y(e,r):o?(0,_.parseLocationMessageProto)(e,(0,i.default)((0,i.default)({},o),{},{name:void 0,address:void 0})):s?H(e,s):(c&&(e.title=(0,f.convertToTextWithoutSpecialEmojis)(c)),l&&(e.body=(0,f.convertToTextWithoutSpecialEmojis)(l))),null==g)p.length&&(e.isDynamicReplyButtonsMsg=!0,e.dynamicReplyButtons=p);else{if(e.type=A.MSG_TYPE.NATIVE_FLOW,e.nativeFlowName=m.default.cast(g),e.nativeFlowButtons=p,!e.nativeFlowName||!(0,w.isValidNativeFlowMessage)(e))return e.type=A.MSG_TYPE.UNKNOWN,void(e.subtype="phone_only_feature");if(e.nativeFlowName===m.default.ORDER_STATUS&&!(0,L.validateOrderAndSendReceipt)(e.id,e))return void(e.subtype="non_renderable")}l&&(e.caption=(0,f.convertToTextWithoutSpecialEmojis)(l)),u&&(e.footer=(0,f.convertToTextWithoutSpecialEmojis)(u))}else e.type=A.MSG_TYPE.UNKNOWN}function oe(e,t){if(null==e.from)return;const n=e.from.equals((0,b.getMeUser)());if(null!=t.initiator)switch(t.initiator){case O.DisappearingMode$Initiator.CHANGED_IN_CHAT:e.disappearingModeInitiator=R.DisappearingModeInitiator.ChangedInChat;break;case O.DisappearingMode$Initiator.INITIATED_BY_ME:e.disappearingModeInitiator=n?R.DisappearingModeInitiator.InitiatedByMe:R.DisappearingModeInitiator.InitiatedByOther;break;case O.DisappearingMode$Initiator.INITIATED_BY_OTHER:e.disappearingModeInitiator=n?R.DisappearingModeInitiator.InitiatedByOther:R.DisappearingModeInitiator.InitiatedByMe}}function se(e,t,n){var r;const i=(0,f.getInteractiveMessageTypeForProto)(t);if(!i||!(0,f.isInteractiveMessageTypeEnabled)(i))return e.type=A.MSG_TYPE.UNKNOWN,void(e.subtype="phone_only_feature");const{body:a,footer:o}=t,s=(0,f.getInteractiveMessageFieldNameForType)(i),l={type:A.MSG_TYPE.INTERACTIVE,caption:null!==(r=(0,f.convertToTextWithoutSpecialEmojis)(null==a?void 0:a.text))&&void 0!==r?r:"",interactiveType:i,interactivePayload:t[s]};if(!(0,f.isSupportedInteractiveMessageVersion)(l))return e.type=A.MSG_TYPE.UNKNOWN,void(e.subtype="phone_only_feature");if(i===y.default.NATIVE_FLOW){if(l.nativeFlowName=m.default.cast((0,f.getBizNativeFlowName)({interactiveMessage:t})),!(0,f.isValidNativeFlowName)(l.nativeFlowName,n)||!(0,w.isValidNativeFlowMessage)(l))return e.type=A.MSG_TYPE.UNKNOWN,void(e.subtype="phone_only_feature");if(l.nativeFlowName===m.default.ORDER_STATUS&&!(0,L.validateOrderAndSendReceipt)(e.id,l))return void(e.subtype="non_renderable")}o&&(l.footer=(0,f.convertToTextWithoutSpecialEmojis)(o.text)),function(e,t){let{header:n}=t;if(!n)return;const r={title:(0,f.convertToTextWithoutSpecialEmojis)(n.title),subtitle:(0,f.convertToTextWithoutSpecialEmojis)(n.subtitle),thumbnail:(0,_.decodeBytes)(n.jpegThumbnail),mediaType:void 0,hasMediaAttachment:Boolean(n.hasMediaAttachment)};r.hasMediaAttachment&&(n.documentMessage?(Y(e,n.documentMessage),r.mediaType=g.InteractiveMessageHeaderMediaType.DOCUMENT):n.videoMessage?(H(e,n.videoMessage),r.mediaType=g.InteractiveMessageHeaderMediaType.VIDEO):n.imageMessage&&(B(e,n.imageMessage),r.mediaType=g.InteractiveMessageHeaderMediaType.IMAGE)),e.interactiveHeader=r}(e,t),Object.assign(e,l)}function le(e,t,n){const r=(0,f.getInteractiveResponseMessageTypeForProto)(t);if(!(0,d.interactiveNativeFlowResponseMessagesEnabled)()||!r||!(0,f.isInteractiveResponseMessageTypeEnabled)(r))return e.type=A.MSG_TYPE.UNKNOWN,void(e.subtype="phone_only_feature");try{var i,a;const o={type:A.MSG_TYPE.INTERACTIVE_RESPONSE,body:null!==(i=(0,f.convertToTextWithoutSpecialEmojis)(null===(a=t.body)||void 0===a?void 0:a.text))&&void 0!==i?i:"",interactivePayload:(0,f.getInteractiveResponsePayload)(r,t,n)};Object.assign(e,o)}catch(t){e.type=A.MSG_TYPE.UNKNOWN,e.subtype="phone_only_feature"}}function ue(e,t){if(!function(e){const t=e.text;return null==t||t.length<=p.default.REACTION_CONTENT_MAX_LENGTH}(t))throw new h.ReactionValidationError("[messaging] Reaction failed validation");const n=(0,f.convertToTextWithoutSpecialEmojis)(t.text);e.type=A.MSG_TYPE.REACTION,e.reactionParentKey=(0,f.getMsgKey)(t.key,e),e.reactionText=n,e.reactionTimestamp=t.senderTimestampMs}function ce(e,t){if(!(0,T.cagReactionsReceive)())throw new h.EncReactionDisabledValidationError;if(t){e.type=A.MSG_TYPE.REACTION_ENC;const n=t.targetMessageKey;e.encReactionEncIv=t.encIv,e.encReactionEncPayload=t.encPayload,e.encReactionTargetMessageKey=(0,f.getMsgKey)(n,e)}}function de(e){e.type=A.MSG_TYPE.REQUEST_PHONE_NUMBER}function pe(e,t){t&&null!=t.messageSecret&&(e.messageSecret=new Uint8Array(t.messageSecret))}function _e(e,t){var n;e.type=A.MSG_TYPE.HSM,(null===(n=t.hydratedHsm)||void 0===n?void 0:n.hydratedTemplate)&&(e.body=(0,f.convertToTextWithoutSpecialEmojis)(t.hydratedHsm.hydratedTemplate.hydratedContentText))}},523930:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.convertToTextWithoutSpecialEmojis=function(e){return e?(0,g.getMobilePlatform)()===g.PLATFORMS.ANDROID?e:(0,v.convertToTextWithoutSpecialEmojis)(e):e},t.createMessageKey=function(e){const t=R(e.to),n={fromMe:!0,id:e.id.id};(0,s.isString)(t)&&(n.remoteJid=t);return n},t.decodeJid=b,t.decryptFailAttributeFromProtobuf=function(e){var t;if(null!=e.reactionMessage||null!=e.encReactionMessage||null!=(null===(t=e.pollUpdateMessage)||void 0===t?void 0:t.vote)||null!=e.keepInChatMessage)return u.DecryptFailType.Hide;return u.DecryptFailType.Show},t.encodeBytes=function(e){return e?(0,i.decodeB64)(e):void 0},t.encodeJid=R,t.encodeKey=function(e){const t={fromMe:e.fromMe,id:e.id},n=R(e.remote),r=R(e.participant);(0,s.isString)(n)&&(t.remoteJid=n);(0,s.isString)(r)&&(t.participant=r);return t},t.getBizNativeFlowName=function(e){var t,n,r,i,a,o;if(1===(null===(t=e.interactiveMessage)||void 0===t||null===(n=t.nativeFlowMessage)||void 0===n||null===(r=n.buttons)||void 0===r?void 0:r.length))return(0,A.getNativeFlowNameByButtonName)(e.interactiveMessage.nativeFlowMessage.buttons[0].name);if(1===(null===(i=e.buttonsMessage)||void 0===i||null===(a=i.buttons)||void 0===a?void 0:a.length))return(0,A.getNativeFlowNameByButtonName)(null===(o=e.buttonsMessage.buttons[0].nativeFlowInfo)||void 0===o?void 0:o.name)},t.getInteractiveMessageFieldNameForType=I,t.getInteractiveMessageTypeForProto=function(e){for(const t of _.default.members())if(I(t)in e)return t;return null},t.getInteractiveResponseMessageFieldNameForType=M,t.getInteractiveResponseMessageTypeForProto=function(e){for(const t of f.default.members())if(M(t)in e)return t;return null},t.getInteractiveResponsePayload=function(e,t,n){switch(e){case f.default.NATIVE_FLOW:const r=(0,o.default)(t.nativeFlowResponseMessage,"message.nativeFlowResponseMessage"),i=(0,o.default)(p.default.cast(r.name),"NativeFlowName.cast(payload.name)"),a=(0,o.default)(r.version,"payload.version");if(a>1||!P(i,n))throw new Error("Invalid message");return{name:i,version:a,type:e,paramsJson:(0,o.default)(r.paramsJson,"payload.paramsJson")}}},t.getMsgKey=function(e,t){if(!e)throw new Error("parseProtocolMessageProto: no message key is defined for protocol message");const{id:n}=e;if(!n)throw new Error("parseProtocolMessageProto: no message id is defined for protocol message");return function(e,t,n){var r;let i,a,o;if(null==n||null===(r=n.id)||void 0===r?void 0:r.fromMe)i=Boolean(t.fromMe),o=b(t.remoteJid),t.fromMe?o.isUser()||(a=(0,E.getMeUser)()):a=b(t.participant);else if(o=n.id.remote,t.fromMe){var s;if(i=!1,a=n.author,null===(s=a)||void 0===s?void 0:s.isLid()){const e=(0,l.getCurrentPn)(n.author.user);null!=e&&(a=e)}}else{const e=b(t.participant);e?e.equals((0,E.getMeUser)())?(i=!0,o.isUser()||(a=(0,E.getMeUser)())):(i=!1,o.isUser()||(a=e)):i=!0}n.type===y.MSG_TYPE.REACTION&&null!=o&&(o instanceof S.default&&o.isBroadcast()&&!o.isStatusV3()||"broadcast"===(0,h.interpretAndValidateJid)(o.toString()).jidType)&&(o=b(t.participant),a=void 0);return new m.default({id:e,fromMe:i,remote:o,participant:a})}(n,e,t)},t.hasUnsupportedButtons=function(e){return e.some((e=>e.nativeFlowInfo&&O.includes(e.nativeFlowInfo.name)||O.includes(e.buttonId)))},t.hasUnsupportedCurrency=function(e){var t;const n=(null==e||null===(t=e.primaryAmount)||void 0===t?void 0:t.currencyCode)||(null==e?void 0:e.currency);if(["XUS","XDX","USDP"].includes(null==n?void 0:n.toUpperCase()))return!0;return!1},t.isEitherSenderOrReceiverOfPaymentMessage=function(e){var t,n;if((null===(t=e.id)||void 0===t?void 0:t.remote.isGroup())&&!(null===(n=e.id)||void 0===n?void 0:n.participant.equals((0,E.getMeUser)()))&&!e.paymentMessageReceiverJid.equals((0,E.getMeUser)()))return!1;return!0},t.isInteractiveMessageTypeEnabled=function(e){switch(e){case _.default.NATIVE_FLOW:return(0,c.interactiveNativeFlowMessagesEnabled)();case _.default.SHOPS_STOREFRONT:return(0,c.shopsInteractiveMessageEnabled)()}},t.isInteractiveResponseMessageTypeEnabled=function(e){switch(e){case f.default.NATIVE_FLOW:return(0,c.interactiveNativeFlowResponseMessagesEnabled)()}},t.isQuotedSupported=function(e){return null==e.reactionMessage},t.isSupportedInteractiveMessageVersion=function(e){let{interactivePayload:t,interactiveType:n}=e;const r=null==t?void 0:t.messageVersion;if(null==r||null==n)return!1;switch(n){case _.default.NATIVE_FLOW:case _.default.SHOPS_STOREFRONT:return r<=1}},t.isValidNativeFlowName=P,t.msgKeyToProtobuf=function(e){var t;return{fromMe:e.fromMe,id:e.id,participant:e.fromMe||null===(t=e.participant)||void 0===t?void 0:t.toString({legacy:!0}),remoteJid:e.remote.toString({legacy:!0})}},t.parseMsgPaymentInfo=function(e,t){t&&(e.paymentStatus=t.status,e.paymentTxnStatus=t.txnStatus,e.paymentCurrency=t.currency||"",e.paymentAmount1000=(0,o.default)((0,a.maybeNumberOrThrowIfTooLarge)(t.amount1000),"maybeNumberOrThrowIfTooLarge(paymentInfo.amount1000)"),e.paymentMessageReceiverJid=(0,T.createWid)((0,o.default)(t.receiverJid,"paymentInfo.receiverJid")),e.paymentExpiryTimestamp=(0,a.maybeNumberOrThrowIfTooLarge)(t.expiryTimestamp),e.paymentTransactionTimestamp=(0,o.default)((0,a.maybeNumberOrThrowIfTooLarge)(t.transactionTimestamp),"maybeNumberOrThrowIfTooLarge(paymentInfo.transactionTimestamp)"))},t.pollTypeAttributeFromProtobuf=function(e){var t;if(null!=e.pollCreationMessage)return d.POLL_TYPES.creation;if(null!=(null===(t=e.pollUpdateMessage)||void 0===t?void 0:t.vote))return d.POLL_TYPES.vote;return null},t.protobufToMsgKey=function(e){const{fromMe:t,id:n,participant:r,remoteJid:i}=e;(0,C.default)(null!=t&&null!=i&&null!=n,"fromMe, remoteJid, and id should be set");let a=null!=r&&(0,T.isWidlike)(r)?(0,T.createWid)(r):void 0;const o=(0,T.createWid)(i);(o.isGroup()||o.isBroadcast())&&t&&(a=(0,E.getMaybeMeUser)());return new m.default({fromMe:t,id:n,participant:a,remote:(0,T.createWid)(i)})},t.shouldParseNFM=function(e,t){if(null!=e||null!=(null==t?void 0:t.nativeFlowName))return!!(0,c.nativeFlowMessagesEnabled)()&&P(e,t);return!0},t.strictDecodeJid=function(e){if(null==e)return;return(0,C.default)(S.default.isWid(e),"Provided Jid is not a valid Wid"),(0,T.createWid)(e)},t.typeAttributeFromProtobuf=function e(t){if(t.ephemeralMessage){const{message:n}=t.ephemeralMessage;return n?e(n):d.STANZA_MSG_TYPES.text}if(t.deviceSentMessage){const{message:n}=t.deviceSentMessage;return n?e(n):d.STANZA_MSG_TYPES.text}if(t.reactionMessage||t.encReactionMessage)return d.STANZA_MSG_TYPES.reaction;if(t.pollCreationMessage||t.pollUpdateMessage)return d.STANZA_MSG_TYPES.poll;if(t.conversation||t.extendedTextMessage||t.templateButtonReplyMessage||t.protocolMessage||t.interactiveMessage||t.keepInChatMessage||t.requestPhoneNumberMessage||t.editedMessage)return d.STANZA_MSG_TYPES.text;return d.STANZA_MSG_TYPES.media},t.validateWaveform=function(e){return e.byteLength>=64&&e.byteLength<=192};var i=n(417405),a=n(478337),o=r(n(132375)),s=n(425315),l=n(450491),u=n(303754),c=n(72696),d=n(883310),p=r(n(753110)),_=r(n(182394)),f=r(n(654143)),h=n(714443),g=n(828770),m=r(n(565754)),y=n(373070),E=n(459857),S=r(n(124928)),T=n(669050),v=n(798721),A=n(890344),C=r(n(441143));function P(e,t){return null==e&&null==(null==t?void 0:t.nativeFlowName)||null==(null==t?void 0:t.nativeFlowName)||null!=e&&p.default.cast(t.nativeFlowName)===e}const O=["novi_login","novi_report_transaction","novi_hub","novi_view_code","novi_view_transaction","novi_view_bank_detail","novi_view_card_detail","wa_payment_transaction_details","wa_payment_learn_more","wa_payment_fbpin_reset"];function I(e){switch(e){case _.default.NATIVE_FLOW:return"nativeFlowMessage";case _.default.SHOPS_STOREFRONT:return"shopStorefrontMessage"}}function M(e){switch(e){case f.default.NATIVE_FLOW:return"nativeFlowResponseMessage"}}function b(e){return e&&S.default.isWid(e)?(0,T.createWid)(e):e}function R(e){return e instanceof S.default?e.toString({legacy:!0}):(0,s.isString)(e)?e.replace(/@c.us$/,"@s.whatsapp.net"):void 0}},722882:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(94439),o=n(155172),s=n(522055),l=n(268392),u=n(314350),c=n(301460),d=n(402593),p=n(375672);class _ extends a.SyncActionBase{constructor(){super(...arguments),this.version=7,this.action=o.Actions.Agent}applyMutations(e){return(0,i.default)((function*(){const t=[],n=[],r=e.map((e=>{try{const{indexParts:l}=e,[,c]=l;if(c||(0,s.throwInvalidActionIndex)(),"remove"===e.operation)return n.push(c),{actionState:o.SyncActionState.Success};if("set"===e.operation){var r,i,a;const{agentAction:n}=e.value;if(!n)return{actionState:o.SyncActionState.Malformed};const s=(0,u.getFormattedAgentName)(null!==(r=n.name)&&void 0!==r?r:"",null!==(i=n.deviceID)&&void 0!==i?i:-1);return t.push({id:c,name:s,deviceId:null!==(a=n.deviceID)&&void 0!==a?a:-1,isDeleted:Boolean(n.isDeleted)}),{actionState:o.SyncActionState.Success}}return{actionState:o.SyncActionState.Unsupported}}catch(e){return{actionState:o.SyncActionState.Failed}}}));return yield(0,d.getTable)().bulkCreateOrMerge(t),l.AgentCollection.add(t,{merge:!0}),yield(0,d.getTable)().bulkRemove(n),l.AgentCollection.remove(n),Promise.resolve().then((()=>{p.UnattributedMessageCollection.getModelsArray().forEach((e=>{let{id:t,deviceId:n}=e;const r=c.MsgCollection.get(t);if(null==r)return;const i=l.AgentCollection.getByDeviceId(n);null!=i&&(r.agentId=String(i.id),p.UnattributedMessageCollection.remove(t))}))})),r}))()}}const f=new _;Object.freeze(f);var h=f;t.default=h},991752:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(715739),i=n(94439),a=n(797666),o=n(155172),s=n(990445),l=n(673168);class u extends i.SyncActionBase{constructor(){super(...arguments),this.version=4,this.action=o.Actions.AndroidUnsupportedActions}applyMutations(e){return Promise.all(e.map((e=>{try{if("set"===e.operation){const{value:t}=e,n=t.androidUnsupportedActions;if(!n)return __LOG__(3)`android unsupported actions: malformed mutation`,{actionState:o.SyncActionState.Malformed};return n.allowed&&this.updatePrimaryAllowsAllMutationsFlag("allow_unsupported_mutation"),{actionState:o.SyncActionState.Success}}return __LOG__(3)`locale setting sync: operation not supported`,{actionState:o.SyncActionState.Unsupported}}catch(e){return{actionState:o.SyncActionState.Failed}}})))}getAndroidUnsupportedActionsMutation(){const e=(0,s.unixTimeMs)();return(0,a.buildPendingMutation)({collection:o.CollectionName.RegularLow,indexArgs:[],operation:r.SyncdMutation$SyncdOperation.SET,version:this.version,value:{androidUnsupportedActions:{allowed:!0}},timestamp:e,action:this.action})}updatePrimaryAllowsAllMutationsFlag(e){(0,l.getPrimaryAllowsAllMutations)()||(__LOG__(2)`[syncd] primary allows all mutations flag set: ${e}`,(0,l.setPrimaryAllowsAllMutations)())}}const c=new u;Object.freeze(c);var d=c;t.default=d},819727:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=r(n(348926)),o=r(n(132375)),s=n(715739),l=n(370625),u=n(94439),c=n(797666),d=n(155172),p=n(731189),_=n(522055),f=n(133331),h=n(811670),g=n(97858),m=n(76469),y=r(n(571834)),E=r(n(124928)),S=n(669050),T=n(46167),v=r(n(897215)),A=n(309512),C=n(653313);function P(e,t){switch(t){case p.MessageRangeEncloseType.RangesAreEqual:case p.MessageRangeEncloseType.RangeAEnclosesRangeB:return{actionState:d.SyncActionState.Success};case p.MessageRangeEncloseType.RangeBEnclosesRangeA:case p.MessageRangeEncloseType.RangesNotEnclosing:return{actionState:d.SyncActionState.Orphan,orphanModel:{modelType:d.SyncModelType.Chat,modelId:e.toString()}}}}class O extends u.SyncActionBase{constructor(){super(...arguments),this.version=3,this.action=d.Actions.Archive}getChatJidAndMessageKey(e){const[,t]=e.indexArr;return t||(0,_.throwInvalidActionIndex)(),{chatJid:t,messageKey:null}}validateSyncActionValue(e){const t=e.archiveChatAction;return null!=(null==t?void 0:t.archived)&&(0,p.validateMessageRange)(null==t?void 0:t.messageRange)}applyMutations(e){var t=this;return(0,a.default)((function*(){const n=new Map;yield(0,m.getChatTable)().bulkGet(e.map((e=>{const{indexParts:t}=e,[,n]=t;return n&&E.default.isWid(n)?(0,S.createWid)(n).toString():null})).filter(Boolean)).then((e=>e.forEach((e=>{e&&n.set(e.id,e)}))));const r=[],i=yield Promise.all(e.map(function(){var e=(0,a.default)((function*(e){try{if("set"===e.operation){const{indexParts:i,value:a}=e,[,s]=i;if(s||(0,_.throwInvalidActionIndex)(),!E.default.isWid(s))return(0,T.uploadCriticalEventMetric)(y.default.MD_SYNCD_CRITICAL_EVENT_CODE.ACTION_INVALID_INDEX_DATA),{actionState:d.SyncActionState.Malformed};const l=a.archiveChatAction;if(!t.validateSyncActionValue(a))return __LOG__(3)`[syncd][archive-chat]: malformed mutation`,{actionState:d.SyncActionState.Malformed};const u=(0,o.default)(null==l?void 0:l.archived,"archiveChatAction?.archived"),c=(0,o.default)(null==l?void 0:l.messageRange,"archiveChatAction?.messageRange"),p=(0,S.createWid)(s);if(!n.has(p.toString()))return{actionState:d.SyncActionState.Orphan,orphanModel:{modelType:d.SyncModelType.Chat,modelId:p.toString()}};const f=yield t._applyMutation(p,u,c,a);return f.updates&&r.push(f.updates),f.syncApplyActionResult}return __LOG__(3)`[syncd][archive-chat]: REMOVE operation not supported`,{actionState:d.SyncActionState.Unsupported}}catch(e){return{actionState:d.SyncActionState.Failed}}}));return function(){return e.apply(this,arguments)}}()));return r.length>0&&(yield(0,h.setArchive)(r)),i}))()}_applyMutation(e,t,n,r){return(0,a.default)((function*(){if(yield(0,f.removeActiveMessageRange)(e.toString(),(0,f.getActiveRangeAction)("archive")),!t)return{updates:{id:e.toString(),archive:t},syncApplyActionResult:{actionState:d.SyncActionState.Success}};const i=yield(0,p.constructMessageRange)(e,!1),a=(0,p.compareMessageRanges)(i,n),o=(0,C.encodeProtobuf)(l.SyncActionValueSpec,r).readBuffer(),s=()=>(0,f.addActiveMessageRange)(e.toString(),(0,f.getActiveRangeAction)("archive"),o),u=(0,g.archiveV2Supported)()&&v.default.showArchiveV2;switch(a){case p.MessageRangeEncloseType.RangesAreEqual:case p.MessageRangeEncloseType.RangeBEnclosesRangeA:return yield s(),{updates:{id:e.toString(),archive:t},syncApplyActionResult:P(e,a)};case p.MessageRangeEncloseType.RangeAEnclosesRangeB:case p.MessageRangeEncloseType.RangesNotEnclosing:return u?{updates:{id:e.toString(),archive:t},syncApplyActionResult:P(e,a)}:(yield s(),{updates:void 0,syncApplyActionResult:P(e,a)})}}))()}_constructArchiveChatIndexArgs(e){return[e.toString({legacy:!0})]}getArchiveChatMutation(e,t,n){var r=this;return(0,a.default)((function*(){const i={archiveChatAction:{archived:t,messageRange:yield(0,p.constructMessageRange)(n,!0)}};return(0,c.buildPendingMutation)({collection:d.CollectionName.RegularLow,indexArgs:r._constructArchiveChatIndexArgs(n),value:i,version:r.version,operation:s.SyncdMutation$SyncdOperation.SET,timestamp:e,action:r.action})}))()}getMutationsForArchive(e,t,r){var i=this;return(0,a.default)((function*(){const a=[yield i.getArchiveChatMutation(e,t,r)];if(t&&(0,g.pinChatSyncEnabled)()){const t=n(889355).default;a.push(t.getPinMutation(e,!1,r))}return a}))()}resolveConflicts(e,t){return(0,a.default)((function*(){var n,r;const s=(0,A.decodeProtobuf)(l.SyncActionValueSpec,e.binarySyncAction),u=(0,A.decodeProtobuf)(l.SyncActionDataSpec,t.binarySyncData).value,c=e.timestamp,_=t.timestamp,g=(0,o.default)(s.archiveChatAction,"pendingMutationValue.archiveChatAction"),m=(0,o.default)(null==u?void 0:u.archiveChatAction,"incomingMutationValue?.archiveChatAction");switch((0,p.compareMessageRanges)((0,o.default)(m.messageRange,"incomingArchiveChatAction.messageRange"),(0,o.default)(g.messageRange,"pendingArchiveChatAction.messageRange"))){case p.MessageRangeEncloseType.RangeAEnclosesRangeB:return d.ConflictResolutionState.ApplyRemoteAndDropLocal;case p.MessageRangeEncloseType.RangeBEnclosesRangeA:return d.ConflictResolutionState.SkipRemote;case p.MessageRangeEncloseType.RangesAreEqual:return c<=_?d.ConflictResolutionState.ApplyRemoteAndDropLocal:d.ConflictResolutionState.SkipRemote;case p.MessageRangeEncloseType.RangesNotEnclosing:const t=c<=_?null!==(n=m.archived)&&void 0!==n&&n:null!==(r=g.archived)&&void 0!==r&&r,s=(0,p.mergeMessageRanges)((0,o.default)(m.messageRange,"incomingArchiveChatAction.messageRange"),(0,o.default)(g.messageRange,"pendingArchiveChatAction.messageRange")),y=(0,C.encodeProtobuf)(l.SyncActionValueSpec,(0,i.default)((0,i.default)({},u),{},{archiveChatAction:{archived:t,messageRange:s}})).readBuffer(),E=(0,i.default)((0,i.default)({},e),{},{binarySyncAction:y});return delete E.id,yield(0,p.lockForMessageRangeSync)(["chat"],[E],(0,a.default)((function*(){const n=JSON.parse(e.index),r=(0,S.createWid)(n[1]);return yield(0,f.addActiveMessageRange)(r.toString(),(0,f.getActiveRangeAction)("archive"),y),(0,h.setArchive)([{id:r.toString(),archive:t}])}))),d.ConflictResolutionState.SkipRemoteAndDropLocal}}))()}}const I=new O;Object.freeze(I);var M=I;t.default=M},118594:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=r(n(348926)),o=n(370625),s=n(94439),l=n(155172),u=r(n(991752)),c=n(731189),d=n(133331),p=n(965012),_=n(97858),f=n(76469),h=n(605316),g=n(574017),m=n(673168),y=n(669050),E=r(n(543465)),S=r(n(897215)),T=n(309512);class v extends s.SyncActionBase{constructor(){super(...arguments),this.version=4,this.action=l.Actions.UnarchiveChatsSetting}decodeValue(e){if(!e.binarySyncData){if(!e.binarySyncAction)throw __LOG__(4,void 0,new Error,!0,["syncd"])`binarySyncAction should not be null`,SEND_LOGS("syncd binarySyncAction should not be null"),new Error("binarySyncAction should not be null");return(0,T.decodeProtobuf)(o.SyncActionValueSpec,e.binarySyncAction)}{const t=(0,T.decodeProtobuf)(o.SyncActionDataSpec,e.binarySyncData);if(t.value)return t.value}}applyMutations(e,t){var n=this;return(0,a.default)((function*(){u.default.updatePrimaryAllowsAllMutationsFlag("other mutation");const{setMutationsPendingToPersist:r}=t;if(e.length>0){const t=e[e.length-1];try{let e=[];if(!(0,_.archiveV2Supported)())return __LOG__(3)`archive setting sync: ArchiveV2 not supported yet`,[{actionState:l.SyncActionState.Unsupported}];if("set"===t.operation){const{value:o}=t,s=o.unarchiveChatsSetting;if(null==(null==s?void 0:s.unarchiveChats))return __LOG__(3)`archive setting sync: malformed mutation`,[{actionState:l.SyncActionState.Malformed}];const u=s.unarchiveChats;return(yield(0,m.getArchiveV2EnabledSetting)())||(yield(0,m.setArchiveV2EnabledSetting)(!0),S.default.archive=(0,i.default)((0,i.default)({},S.default.archive),{},{enabled:!0})),yield(0,m.setUnarchiveChatsSetting)(u),S.default.archive=(0,i.default)((0,i.default)({},S.default.archive),{},{classic:u}),yield(0,h.getStorage)().lock(["message","chat","sync-actions","active-message-ranges"],(0,a.default)((function*(){e=yield n.updateSideEffectOnChats(u,r),yield(0,f.getChatTable)().bulkCreateOrMerge(e)}))),e.forEach((e=>{const t=(0,y.createWid)(e.id),n=p.ChatCollection.get(t);n&&(n.archive=e.archive)})),[{actionState:l.SyncActionState.Success}]}return __LOG__(3)`archive setting sync: operation not supported`,[{actionState:l.SyncActionState.Unsupported}]}catch(e){return[{actionState:l.SyncActionState.Failed}]}}return __LOG__(3)`archive setting sync: no mutations`,[{actionState:l.SyncActionState.Failed}]}))()}_handleSettingOn(e){var t=this;return(0,a.default)((function*(){const n=[];performance.now();const r=(yield(0,f.getChatTable)().all()).filter((e=>e.archive)).map((e=>e.id)),i=(yield Promise.all(r.map((e=>(0,d.getActiveMessageRanges)(e))))).flat().filter((e=>e.action===g.ActiveRangeAction.Archive)).map((e=>e.chatId)),a=r.filter((e=>!i.includes(e))),o=(yield Promise.all(a.map((t=>{const n=(0,y.createWid)(t),r=JSON.stringify([l.Actions.Archive,n.toString({legacy:!0})]),i=e.find((e=>e.index===r));return i?Promise.resolve(i):E.default.getSyncAction(r)})))).filter((e=>{if(!e)return!1;const n=t.decodeValue(e).archiveChatAction;return[l.SyncActionState.Success,l.SyncActionState.Orphan].includes(e.actionState)&&(null==n?void 0:n.archived)&&n.messageRange})).map((e=>{const n=e&&t.decodeValue(e).archiveChatAction;return[e?JSON.parse(e.index)[1]:"",null==n?void 0:n.messageRange]})),s=new Map(o),u=Array.from(s.keys()),p=yield Promise.all(u.map((e=>(0,c.constructMessageRange)((0,y.createWid)(e),!1))));return u.forEach(((e,t)=>{const r=p[t],i=s.get(e);if(i){const t=(0,c.compareMessageRanges)(r,i);if(t===c.MessageRangeEncloseType.RangeAEnclosesRangeB||t===c.MessageRangeEncloseType.RangesNotEnclosing){const t=(0,y.createWid)(e);n.push({id:t.toString({legacy:!1}),archive:!1})}else __LOG__(3,void 0,void 0,!0)`Archive_Setting_Sync: Unsupported rangeEnclosedType ${t}`,SEND_LOGS("ArchiveSettingSync setting true rangeEnclosedType unsupported")}})),performance.now(),n.length,n}))()}_handleSettingOff(e){var t=this;return(0,a.default)((function*(){const n=[],r=yield E.default.getSyncActionsRows(["action"],[l.Actions.Archive]),i=e.filter((e=>e.action===l.Actions.Archive)),a=i.map((e=>e.index));return[...r.filter((e=>!a.includes(e.index))),...i].filter((e=>{if(e.actionState===l.SyncActionState.Success){var n;return null===(n=t.decodeValue(e).archiveChatAction)||void 0===n?void 0:n.archived}return!1})).forEach((e=>{const t=JSON.parse(e.index)[1],r=(0,y.createWid)(t);n.push({id:r.toString({legacy:!1}),archive:!0})})),n.length,n}))()}updateSideEffectOnChats(e,t){return e?this._handleSettingOn(t):this._handleSettingOff(t)}}const A=new v;Object.freeze(A);var C=A;t.default=C},82037:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(94439),o=n(155172),s=n(522055),l=n(716671),u=n(387202);class c extends a.SyncActionBase{constructor(){super(...arguments),this.version=o.CHAT_ASSIGNMENT_SYNC_VERSION,this.action=o.Actions.ChatAssignmentOpenedStatus}applyMutations(e){return(0,i.default)((function*(){const t=[],n=e.map((e=>{try{const{indexParts:n}=e,[,r,i]=n;if(null!=r&&null!=i||(0,s.throwInvalidActionIndex)(),"set"===e.operation){const{chatAssignmentOpenedStatus:n}=e.value;if(!n)return{actionState:o.SyncActionState.Malformed};const{chatOpened:a}=n;if(null==a)return{actionState:o.SyncActionState.Malformed};const s=`${r}_${i}`;return null==u.ChatAssignmentCollection.get(s)?{actionState:o.SyncActionState.Orphan,orphanModel:{modelId:s,modelType:o.SyncModelType.ChatAssignment}}:(t.push({id:s,chatId:r,agentId:i,chatOpenedByAgent:a}),{actionState:o.SyncActionState.Success})}return{actionState:o.SyncActionState.Unsupported}}catch(e){return{actionState:o.SyncActionState.Failed}}}));return yield(0,l.updateLocalOpenedState)(t),n}))()}}const d=new c;Object.freeze(d);var p=d;t.default=p},267122:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(94439),o=n(155172),s=n(61314),l=n(522055),u=n(268392),c=n(582523),d=n(387202),p=n(965012),_=n(936771),f=r(n(775410)),h=n(669050);class g extends a.SyncActionBase{constructor(){super(...arguments),this.version=o.CHAT_ASSIGNMENT_SYNC_VERSION,this.action=o.Actions.ChatAssignment}applyMutations(e){return(0,i.default)((function*(){const t=[],n=[],r=[],i=e.map((e=>{try{const{indexParts:a}=e,[,s]=a;if(s||(0,l.throwInvalidActionIndex)(),"set"===e.operation){var i;const{chatAssignment:a}=e.value;if(!a)return{actionState:o.SyncActionState.Malformed};const l=null!==(i=a.deviceAgentID)&&void 0!==i?i:"",c=u.AgentCollection.get(l);if(""!==l&&null==c)return{actionState:o.SyncActionState.Orphan,orphanModel:{modelId:l,modelType:o.SyncModelType.Agent}};const _=(0,h.createWid)(s);return null==p.ChatCollection.get(_.toString())?{actionState:o.SyncActionState.Orphan,orphanModel:{modelType:o.SyncModelType.Chat,modelId:_.toString()}}:(d.ChatAssignmentCollection.getAgentCollectionForChatId(_).filter((e=>e.id!==l)).forEach((e=>n.push(`${s}_${e.id}`))),""!==l&&t.push({id:`${s}_${l}`,chatId:s,agentId:l,chatOpenedByAgent:!1}),f.default.isSyncDBootstrapInProcess()||r.push({chatId:_,agent:c,timestamp:Math.floor(e.timestamp/1e3)}),{actionState:o.SyncActionState.Success})}return{actionState:o.SyncActionState.Unsupported}}catch(e){return{actionState:o.SyncActionState.Failed}}}));yield(0,_.getTable)().bulkCreateOrMerge(t),d.ChatAssignmentCollection.processChatAssignments(t),yield(0,_.getTable)().bulkRemove(n),d.ChatAssignmentCollection.remove(n),(0,c.createChatAssignmentSystemMsgs)(r);const a=t.map((e=>e.id.toString()));return(0,s.checkOrphanChatAssignments)(a),i}))()}}const m=new g;Object.freeze(m);var y=m;t.default=y},822036:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=r(n(348926)),o=r(n(132375)),s=n(715739),l=n(370625),u=n(94439),c=n(797666),d=n(155172),p=r(n(991752)),_=n(731189),f=n(522055),h=n(133331),g=n(274745),m=n(359987),y=n(965012),E=n(97858),S=n(76469),T=n(323829),v=r(n(571834)),A=r(n(124928)),C=n(669050),P=r(n(543465)),O=n(46167),I=n(309512),M=n(653313);class b extends u.SyncActionBase{constructor(){super(...arguments),this.version=6,this.action=d.Actions.ClearChat}getChatJidAndMessageKey(e){const[,t]=e.indexArr;return t||(0,f.throwInvalidActionIndex)(),{chatJid:t,messageKey:null}}_getMessageIdsThatWereUnstarredInCurrentPatch(e,t){const n=new Set;return e.forEach((e=>{if(e.actionName===d.Actions.Star&&e.timestamp>t){const t=(0,f.getMsgKeyFromStarActionIndex)(e.index);n.add(t.toString())}})),n}validateSyncActionValue(e){const t=e.clearChatAction;return(0,_.validateMessageRange)(null==t?void 0:t.messageRange)}applyMutations(e,t){var n=this;p.default.updatePrimaryAllowsAllMutationsFlag("other mutation");const{allSupportedSetMutations:r}=t;return Promise.all(e.map(function(){var e=(0,a.default)((function*(e){try{if(!(0,E.clearOrDeleteChatSyncEnabled)())return __LOG__(3)`[syncd][clear-chat]: not enabled`,Promise.resolve({actionState:d.SyncActionState.Unsupported});if("set"===e.operation){var t;const{indexParts:i,value:a}=e,[,s,l,u]=i;if(s&&l&&u||(0,f.throwInvalidActionIndex)(),!A.default.isWid(s))return(0,O.uploadCriticalEventMetric)(v.default.MD_SYNCD_CRITICAL_EVENT_CODE.ACTION_INVALID_INDEX_DATA),{actionState:d.SyncActionState.Malformed};if(!n.validateSyncActionValue(a))return __LOG__(3)`[syncd][clear-chat]: malformed mutation`,{actionState:d.SyncActionState.Malformed};const c=(0,o.default)(null===(t=a.clearChatAction)||void 0===t?void 0:t.messageRange,"value.clearChatAction?.messageRange"),p=(0,C.createWid)(s),_=p.toString();if(!(yield(0,S.getChatTable)().get(_)))return{actionState:d.SyncActionState.Orphan,orphanModel:{modelType:d.SyncModelType.Chat,modelId:_}};const h=n._getMessageIdsThatWereUnstarredInCurrentPatch(r,e.timestamp);return n._applyMutation(p,c,"1"===l,"0"===u,h,a)}return __LOG__(3)`[syncd][clear-chat]: REMOVE operation not supported`,{actionState:d.SyncActionState.Unsupported}}catch(e){return{actionState:d.SyncActionState.Failed}}}));return function(){return e.apply(this,arguments)}}()))}clearChat(e,t,r,i){return(0,a.default)((function*(){const{queryAndRemoveMessagesInMessageRange:a}=n(599580),o=yield a(e,t,{skipStarred:!r,skipMessages:i});if(o.length>0){(0,m.frontendFireAndForget)("deleteModelsForLastAddOnPreview",{messagesIds:o});const t=n(628905).getJobManager;yield t().waitUntilPersisted(T.jobSerializers.deleteAddOns(e.toString(),o))}const s=y.ChatCollection.get(e);s&&s.deleteMessages(o)}))()}_applyMutation(e,t,n,r,i,o){var s=this;return(0,a.default)((function*(){const a=(0,M.encodeProtobuf)(l.SyncActionValueSpec,o).readBuffer();return yield(0,h.addActiveMessageRange)(e.toString(),(0,h.getActiveRangeAction)("clearChat",{deleteMedia:r,deleteStarred:n}),a),yield s.clearChat(e,t,n,i),{actionState:d.SyncActionState.Success}}))()}getClearChatMutation(e,t,n,r){var i=this;return(0,a.default)((function*(){let a=yield(0,_.constructForwardMovingMessageRange)(t);const o=i._constructClearChatIndexArgs(t,n,r||!1),u=yield P.default.getPendingMutationsRowsByIndex(["index"],(0,c.buildIndex)(i.action,o));if(u.length){var p;const e=u.reduce(((e,t)=>e.timestamp>t.timestamp?e:t)),t=null===(p=(0,I.decodeProtobuf)(l.SyncActionValueSpec,e.binarySyncAction).clearChatAction)||void 0===p?void 0:p.messageRange;t&&(a=(0,_.mergeMessageRanges)(a,t),(0,g.logMaybeMillisecondTimestamp)(a.lastMessageTimestamp,"pendingMutationRange"))}const f={clearChatAction:{messageRange:a}};return(0,c.buildPendingMutation)({collection:d.CollectionName.RegularHigh,indexArgs:o,value:f,version:i.version,operation:s.SyncdMutation$SyncdOperation.SET,timestamp:e,action:i.action})}))()}_constructClearChatIndexArgs(e,t,n){return[e.toString({legacy:!0}),t?"1":"0",n?"1":"0"]}resolveConflicts(e,t){var n=this;return(0,a.default)((function*(){const r=(0,I.decodeProtobuf)(l.SyncActionValueSpec,e.binarySyncAction),s=(0,I.decodeProtobuf)(l.SyncActionDataSpec,t.binarySyncData).value,u=e.timestamp,c=t.timestamp,p=(0,o.default)(r.clearChatAction,"pendingMutationValue.clearChatAction"),f=(0,o.default)(null==s?void 0:s.clearChatAction,"incomingMutationValue?.clearChatAction");switch((0,_.compareMessageRanges)((0,o.default)(f.messageRange,"incomingClearChatAction.messageRange"),(0,o.default)(p.messageRange,"pendingClearChatAction.messageRange"))){case _.MessageRangeEncloseType.RangeAEnclosesRangeB:return d.ConflictResolutionState.ApplyRemoteAndDropLocal;case _.MessageRangeEncloseType.RangeBEnclosesRangeA:return d.ConflictResolutionState.SkipRemote;case _.MessageRangeEncloseType.RangesAreEqual:return u<=c?d.ConflictResolutionState.ApplyRemoteAndDropLocal:d.ConflictResolutionState.SkipRemote;case _.MessageRangeEncloseType.RangesNotEnclosing:const t=(0,_.mergeMessageRanges)((0,o.default)(f.messageRange,"incomingClearChatAction.messageRange"),(0,o.default)(p.messageRange,"pendingClearChatAction.messageRange")),r=(0,M.encodeProtobuf)(l.SyncActionValueSpec,(0,i.default)((0,i.default)({},s),{},{clearChatAction:{messageRange:t}})).readBuffer(),g=(0,i.default)((0,i.default)({},e),{},{binarySyncAction:r});return delete g.id,yield(0,_.lockForMessageRangeSync)([],[g],(0,a.default)((function*(){const i=JSON.parse(e.index),a=(0,C.createWid)(i[1]),o="1"===i[2],s="1"===i[3];return yield(0,h.addActiveMessageRange)(a.toString(),(0,h.getActiveRangeAction)("clearChat",{deleteStarred:o,deleteMedia:s}),r),n.clearChat(a,t,o)}))),d.ConflictResolutionState.SkipRemoteAndDropLocal}}))()}}const R=new b;Object.freeze(R);var N=R;t.default=N},377909:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=r(n(348926)),o=n(94439),s=n(155172),l=n(61314),u=n(522055),c=n(469475),d=n(121977),p=n(914404),_=n(714443),f=n(76469),h=n(416911),g=n(669050);class m extends o.SyncActionBase{constructor(){super(...arguments),this.version=2,this.action=s.Actions.Contact}applyMutations(e){return(0,a.default)((function*(){const t=[],n=[],r=yield Promise.all(e.map((e=>{try{const a=e.indexParts,[,o]=a;o||(0,u.throwInvalidActionIndex)();const l=(0,g.createUserWid)(o);if("set"===e.operation){var r;const n=e.value.contactAction;if(!n)return __LOG__(3)`contact sync: malformed mutation`,{actionState:s.SyncActionState.Malformed};const a={id:o,name:n.fullName||"",shortName:n.firstName||(null!==(r=(0,p.getShortName)(n.fullName))&&void 0!==r?r:""),type:"in",isAddressBookContact:1,isContactSyncCompleted:0};return t.push(a),d.ContactCollection.add((0,i.default)((0,i.default)({},a),{},{id:l}),{merge:!0}),(0,h.syncNewContact)(l),{actionState:s.SyncActionState.Success}}if("remove"===e.operation){const e=d.ContactCollection.get(l);return null!=e&&e.setNotMyContact(),n.push(l),{actionState:s.SyncActionState.Success}}return __LOG__(3)`contact sync: operation not supported`,{actionState:s.SyncActionState.Unsupported}}catch(e){return{actionState:s.SyncActionState.Failed}}})));if(yield(0,f.getContactTable)().bulkCreateOrMerge(t),(0,l.checkOrphanUserStatusMutes)(t.map((e=>e.id))),n.length>0){const e=n.map((e=>(0,_.toPhoneUserJid)(e.user)));yield(0,c.setNotAddressBookContacts)(e)}return r}))()}}const y=new m;Object.freeze(y);var E=y;t.default=E},421571:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=r(n(348926)),o=n(297227),s=r(n(132375)),l=n(370625),u=n(797666),c=n(155172),d=r(n(991752)),p=n(731189),_=n(522055),f=n(133331),h=n(274745),g=n(599580),m=n(359987),y=n(965012),E=n(97858),S=n(76469),T=n(323829),v=r(n(571834)),A=r(n(124928)),C=n(669050),P=n(574819),O=r(n(543465)),I=n(46167),M=n(268824),b=n(309512),R=n(653313);class N extends o.DeleteChatSyncBase{validateSyncActionValue(e){const t=e.deleteChatAction;return(0,p.validateMessageRange)(null==t?void 0:t.messageRange)}applyMutations(e){var t=this;return d.default.updatePrimaryAllowsAllMutationsFlag("other mutation"),Promise.all(e.map(function(){var e=(0,a.default)((function*(e){try{if(!(0,E.clearOrDeleteChatSyncEnabled)())return __LOG__(3)`[syncd][delete-chat]: not enabled`,Promise.resolve({actionState:c.SyncActionState.Unsupported});if("set"===e.operation){var n;const{indexParts:r,value:i}=e,[,a,o]=r;if(a&&o||(0,_.throwInvalidActionIndex)(),!A.default.isWid(a))return(0,I.uploadCriticalEventMetric)(v.default.MD_SYNCD_CRITICAL_EVENT_CODE.ACTION_INVALID_INDEX_DATA),{actionState:c.SyncActionState.Malformed};if(!t.validateSyncActionValue(i))return __LOG__(3)`[syncd][delete-chat]: malformed mutation`,{actionState:c.SyncActionState.Malformed};const l=(0,s.default)(null===(n=i.deleteChatAction)||void 0===n?void 0:n.messageRange,"value.deleteChatAction?.messageRange"),u=(0,C.createWid)(a),d=u.toString();return(yield(0,S.getChatTable)().get(d))?t._applyMutation(u,l,"0"===o,i):{actionState:c.SyncActionState.Orphan,orphanModel:{modelType:c.SyncModelType.Chat,modelId:d}}}return __LOG__(3)`[syncd][delete-chat]: REMOVE operation not supported`,{actionState:c.SyncActionState.Unsupported}}catch(e){return{actionState:c.SyncActionState.Failed}}}));return function(){return e.apply(this,arguments)}}()))}deleteChat(e,t){return(0,a.default)((function*(){const r=y.ChatCollection.get(e);if(t){const i=yield(0,g.queryAndRemoveMessagesInMessageRange)(e,t,{forceDeleteAllMessages:!0});if(i.length>0){(0,m.frontendFireAndForget)("deleteModelsForLastAddOnPreview",{messagesIds:i});const t=n(628905).getJobManager;yield t().waitUntilPersisted(T.jobSerializers.deleteAddOns(e.toString(),i))}r&&r.deleteMessages(i)}else yield(0,M.deleteFromStorage)(e),r&&r.delete()}))()}_applyMutation(e,t,n,r){var i=this;return(0,a.default)((function*(){const a=(0,R.encodeProtobuf)(l.SyncActionValueSpec,r).readBuffer();yield(0,f.addActiveMessageRange)(e.toString(),(0,f.getActiveRangeAction)("deleteChat",{deleteMedia:n}),a);const o=yield(0,p.constructMessageRange)(e,!1);switch((0,p.compareMessageRanges)(o,t)){case p.MessageRangeEncloseType.RangeAEnclosesRangeB:case p.MessageRangeEncloseType.RangesNotEnclosing:yield i.deleteChat(e,t);break;default:yield i.deleteChat(e)}return{actionState:c.SyncActionState.Success}}))()}getDeleteChatMutation(e,t,n){var r=this;return(0,a.default)((function*(){const i=(0,P.widToChatJid)(t);let a=yield(0,p.constructForwardMovingMessageRange)(t);const o=(0,u.buildIndex)(r.action,r.buildDeleteChatIndexArgs(i,n||!1)),s=yield O.default.getPendingMutationsRowsByIndex(["index"],o);if(s.length){var c;const e=s.reduce(((e,t)=>e.timestamp>t.timestamp?e:t)),t=null===(c=(0,b.decodeProtobuf)(l.SyncActionValueSpec,e.binarySyncAction).deleteChatAction)||void 0===c?void 0:c.messageRange;t&&(a=(0,p.mergeMessageRanges)(a,t),(0,h.logMaybeMillisecondTimestamp)(a.lastMessageTimestamp,"pendingMutationRange"))}return r.buildDeleteChatMutation({timestamp:e,chatId:i,mergedRange:a,deleteMediaFiles:n||!1})}))()}resolveConflicts(e,t){var n=this;return(0,a.default)((function*(){const r=(0,b.decodeProtobuf)(l.SyncActionValueSpec,e.binarySyncAction),o=(0,b.decodeProtobuf)(l.SyncActionDataSpec,t.binarySyncData).value,u=e.timestamp,d=t.timestamp,_=(0,s.default)(r.deleteChatAction,"pendingMutationValue.deleteChatAction"),h=(0,s.default)(null==o?void 0:o.deleteChatAction,"incomingMutationValue?.deleteChatAction");switch((0,p.compareMessageRanges)((0,s.default)(h.messageRange,"incomingDeleteChatAction.messageRange"),(0,s.default)(_.messageRange,"pendingDeleteChatAction.messageRange"))){case p.MessageRangeEncloseType.RangeAEnclosesRangeB:return c.ConflictResolutionState.ApplyRemoteAndDropLocal;case p.MessageRangeEncloseType.RangeBEnclosesRangeA:return c.ConflictResolutionState.SkipRemote;case p.MessageRangeEncloseType.RangesAreEqual:return u<=d?c.ConflictResolutionState.ApplyRemoteAndDropLocal:c.ConflictResolutionState.SkipRemote;case p.MessageRangeEncloseType.RangesNotEnclosing:const t=(0,p.mergeMessageRanges)((0,s.default)(h.messageRange,"incomingDeleteChatAction.messageRange"),(0,s.default)(_.messageRange,"pendingDeleteChatAction.messageRange")),r=(0,R.encodeProtobuf)(l.SyncActionValueSpec,(0,i.default)((0,i.default)({},o),{},{deleteChatAction:{messageRange:t}})).readBuffer(),g=(0,i.default)((0,i.default)({},e),{},{binarySyncAction:r});return delete g.id,yield(0,p.lockForMessageRangeSync)([],[g],(0,a.default)((function*(){const i=JSON.parse(e.index),a=(0,C.createWid)(i[1]);return yield(0,f.addActiveMessageRange)(a.toString(),(0,f.getActiveRangeAction)("deleteChat",{deleteMedia:"1"===i[2]}),r),n.deleteChat(a,t)}))),c.ConflictResolutionState.SkipRemoteAndDropLocal}}))()}}const w=new N;Object.freeze(w);var L=w;t.default=L},460263:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(545493),o=r(n(132375)),s=n(370625),l=n(155172),u=n(990445),c=n(522055),d=n(359987),p=n(987561),_=n(74927),f=n(76469),h=n(301460),g=r(n(565754)),m=n(323829),y=r(n(571834)),E=r(n(124928)),S=n(574819),T=n(46167),v=n(309512);class A extends a.DeleteMessageForMeSyncBase{applyMutations(e){return(0,i.default)((function*(){const t=[],r=new Map;yield(0,f.getMessageTable)().bulkGet(e.map((e=>{var t;const[,n,r,i,a]=e.indexParts;return n&&r&&i&&a&&E.default.isWid(n)?null===(t=(0,c.syncKeyToMsgKey)(n,r,i,a))||void 0===t?void 0:t.toString():null})).filter(Boolean)).then((e=>e.forEach((e=>{e&&r.set(e.id,e)}))));const a=yield Promise.all(e.map(function(){var e=(0,i.default)((function*(e){try{if("set"===e.operation){const[,n,i,a,o]=e.indexParts;n&&i&&a&&o||(0,c.throwInvalidActionIndex)();const s=(0,c.syncKeyToMsgKey)(n,i,a,o);if(!s)return(0,T.uploadCriticalEventMetric)(y.default.MD_SYNCD_CRITICAL_EVENT_CODE.ACTION_INVALID_INDEX_DATA),{actionState:l.SyncActionState.Malformed};const u=r.get(s.toString());if(!u)return{actionState:l.SyncActionState.Orphan,orphanModel:{modelId:s.toString(),modelType:l.SyncModelType.Msg}};t.push(u.id);const d=h.MsgCollection.get(s);return d?(1===d.chat.msgs.length&&(yield(0,p.loadEarlierMsgs)(d.chat)),d.delete()):__LOG__(3)`delete_message_for_me_sync: msg ${s} found in storage but not in collection`,{actionState:l.SyncActionState.Success}}return __LOG__(3)`delete_message_for_me_sync: operation not supported`,{actionState:l.SyncActionState.Unsupported}}catch(e){return{actionState:l.SyncActionState.Failed}}}));return function(){return e.apply(this,arguments)}}()));if(t.length>0){yield(0,_.removeMessagesFromHistory)(t);const e=new Set;t.forEach((t=>e.add(g.default.fromString(t).remote.toString())));const r=Array.from(e.values()).join(",").toString();(0,d.frontendFireAndForget)("deleteModelsForLastAddOnPreview",{messagesIds:t});const i=n(628905).getJobManager;yield i().waitUntilPersisted(m.jobSerializers.deleteAddOns(r,t))}return a}))()}resolveConflicts(e,t){var n,r;const i=(0,v.decodeProtobuf)(s.SyncActionValueSpec,e.binarySyncAction),a=(0,v.decodeProtobuf)(s.SyncActionDataSpec,t.binarySyncData).value,u=(0,o.default)(null===(n=i.deleteMessageForMeAction)||void 0===n?void 0:n.deleteMedia,"pendingMutationValue.deleteMessageForMeAction?.deleteMedia");return!(0,o.default)(null==a||null===(r=a.deleteMessageForMeAction)||void 0===r?void 0:r.deleteMedia,"incomingMutationValue?.deleteMessageForMeAction?.deleteMedia")&&u?Promise.resolve(l.ConflictResolutionState.SkipRemote):Promise.resolve(l.ConflictResolutionState.SkipRemoteAndDropLocal)}getDeleteForMeMutations(e,t){const n=(0,u.unixTimeMs)();return e.map((e=>this.buildDeleteForMeMutation({timestamp:n,deleteMedia:t,messageTimestamp:e.t,remoteJid:(0,S.widToChatJid)(e.id.remote),id:e.id.id,fromMe:e.id.fromMe,participant:e.isGroupMsg&&!e.id.fromMe?(0,S.widToUserJid)(e.sender):null})))}}const C=new A;Object.freeze(C);var P=C;t.default=P},541957:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=r(n(348926)),o=n(94439),s=n(155172),l=n(522055),u=n(454794),c=n(388536),d=n(76085),p=n(294715),_=r(n(571834)),f=r(n(124928)),h=n(669050),g=n(46167);class m extends o.SyncActionBase{constructor(){super(...arguments),this.version=s.LABEL_ASSOCIATION_SYNC_VERSION,this.action=s.Actions.LabelJid}applyMutations(e){return(0,a.default)((function*(){const t=new Set,r=[],o=[],m=yield Promise.all(e.map(function(){var e=(0,a.default)((function*(e){try{if("set"===e.operation){var a;const{indexParts:m,value:y}=e,[,E,S]=m;E&&S||(0,l.throwInvalidActionIndex)();const T=null===(a=y.labelAssociationAction)||void 0===a?void 0:a.labeled;if(null==T)return __LOG__(3)`label jid sync: malformed mutation`,{actionState:s.SyncActionState.Malformed};if(!f.default.isWid(S))return(0,g.uploadCriticalEventMetric)(_.default.MD_SYNCD_CRITICAL_EVENT_CODE.ACTION_INVALID_INDEX_DATA),{actionState:s.SyncActionState.Malformed};const v=(0,h.createWid)(S),A=v.toString(),C={labelId:E,associationId:A,type:p.LabelAssociationType.Jid};if(T){let e=t.has(A);if(!e){(yield(0,d.getTable)().get(A))&&(t.add(A),e=!0)}const a=n(413497).Chat,o=e?null:new a({id:v});r.push(C),o&&((0,d.getTable)().create((0,i.default)((0,i.default)({},o.toJSON()),{},{id:A})),t.add(A)),o&&n(965012).ChatCollection.add(o),(0,c.addToLabelCollection)(A,[E],u.LabelItemParentType.Chat)}else o.push(C),(0,c.removeLabelFromCollection)(A,E,u.LabelItemParentType.Chat);return{actionState:s.SyncActionState.Success}}return __LOG__(3)`label jid sync: unsupported operation`,{actionState:s.SyncActionState.Unsupported}}catch(e){return{actionState:s.SyncActionState.Failed}}}));return function(){return e.apply(this,arguments)}}()));return yield(0,p.getTable)().bulkRemove(o.map((e=>[e.labelId,e.associationId,e.type]))),yield(0,p.getTable)().bulkCreateOrReplace(r),m}))()}}const y=new m;Object.freeze(y);var E=y;t.default=E},79758:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(94439),o=n(155172),s=n(522055),l=n(454794),u=n(388536),c=n(76469),d=n(294715),p=r(n(571834)),_=r(n(124928)),f=n(46167);function h(){return(h=(0,i.default)((function*(e){const t=new Set;return yield(0,c.getMessageTable)().bulkGet(e.map((e=>{var t;const[,,n,r,i,a]=e.indexParts;return n&&r&&i&&a&&_.default.isWid(n)?null===(t=(0,s.syncKeyToMsgKey)(n,r,i,a))||void 0===t?void 0:t.toString():null})).filter(Boolean)).then((e=>e.forEach((e=>{e&&t.add(e.id)})))),t}))).apply(this,arguments)}class g extends a.SyncActionBase{constructor(){super(...arguments),this.version=o.LABEL_ASSOCIATION_SYNC_VERSION,this.action=o.Actions.LabelMessage}applyMutations(e){return(0,i.default)((function*(){const t=[],n=[],r=yield function(){return h.apply(this,arguments)}(e),i=yield Promise.all(e.map((e=>{try{if("set"===e.operation){var i;const{indexParts:a,value:c}=e,[,_,h,g,m,y]=a;_&&h&&g&&m&&y||(0,s.throwInvalidActionIndex)();const E=null===(i=c.labelAssociationAction)||void 0===i?void 0:i.labeled;if(null==E)return __LOG__(3)`label message sync: malformed mutation`,{actionState:o.SyncActionState.Malformed};const S=(0,s.syncKeyToMsgKey)(h,g,m,y);if(!S)return(0,f.uploadCriticalEventMetric)(p.default.MD_SYNCD_CRITICAL_EVENT_CODE.ACTION_INVALID_INDEX_DATA),{actionState:o.SyncActionState.Malformed};if(!r.has(S.toString()))return{actionState:o.SyncActionState.Orphan,orphanModel:{modelId:S.toString(),modelType:o.SyncModelType.Msg}};const T={labelId:_,associationId:S.toString(),type:d.LabelAssociationType.Message};return E?(t.push(T),(0,u.addToLabelCollection)(S.toString(),[_],l.LabelItemParentType.Msg)):(n.push(T),(0,u.removeLabelFromCollection)(S.toString(),_,l.LabelItemParentType.Msg)),{actionState:o.SyncActionState.Success}}return __LOG__(3)`label message sync: operation not supported`,{actionState:o.SyncActionState.Unsupported}}catch(e){return{actionState:o.SyncActionState.Failed}}})));return yield(0,d.getTable)().bulkRemove(n.map((e=>[e.labelId,e.associationId,e.type]))),yield(0,d.getTable)().bulkCreateOrReplace(t),i}))()}}const m=new g;Object.freeze(m);var y=m;t.default=y},34321:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=r(n(348926)),o=n(94439),s=n(155172),l=n(522055),u=n(478353),c=n(187411);class d extends o.SyncActionBase{constructor(){super(...arguments),this.version=3,this.action=s.Actions.LabelEdit}applyMutations(e){return Promise.all(e.map(function(){var e=(0,a.default)((function*(e){try{if("set"===e.operation){var t;const{indexParts:n,value:r}=e,[,a]=n;a||(0,l.throwInvalidActionIndex)();const o=r.labelEditAction;if(!o)return __LOG__(3)`label sync: malformed mutation`,{actionState:s.SyncActionState.Malformed};if(o.deleted)return yield(0,c.getTable)().remove(a),u.LabelCollection.remove(a),{actionState:s.SyncActionState.Success};const{color:d,predefinedId:p}=o,_=null!==(t=o.name)&&void 0!==t?t:"";""===_&&__LOG__(3)`labelEditAction.name is empty`,null==d&&__LOG__(3)`labelEditAction.color is empty`;const f={id:a,name:_,colorIndex:d,predefinedId:p};return yield(0,c.getTable)().createOrReplace(f),u.LabelCollection.add((0,i.default)({},f),{merge:!0}),{actionState:s.SyncActionState.Success}}return __LOG__(3)`label sync: operation not supported`,{actionState:s.SyncActionState.Unsupported}}catch(e){return{actionState:s.SyncActionState.Failed}}}));return function(){return e.apply(this,arguments)}}()))}}const p=new d;Object.freeze(p);var _=p;t.default=_},278332:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(94439),o=n(155172),s=r(n(932325)),l=n(256354);class u extends a.SyncActionBase{constructor(){super(...arguments),this.version=3,this.action=o.Actions.LocaleSetting}applyMutations(e){return Promise.all(e.map(function(){var e=(0,i.default)((function*(e){try{if("set"===e.operation){const{value:t}=e,n=t.localeSetting;if(!n)return __LOG__(3)`locale setting sync: malformed mutation`,{actionState:o.SyncActionState.Malformed};const r=n.locale;return yield s.default.setLocale(r,l.L10N_PRIORITY.PHONE),{actionState:o.SyncActionState.Success}}return __LOG__(3)`locale setting sync: operation not supported`,{actionState:o.SyncActionState.Unsupported}}catch(e){return{actionState:o.SyncActionState.Failed}}}));return function(){return e.apply(this,arguments)}}()))}}const c=new u;Object.freeze(c);var d=c;t.default=d},164404:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=r(n(348926)),o=r(n(132375)),s=n(715739),l=n(370625),u=n(94439),c=n(797666),d=n(155172),p=n(731189),_=n(522055),f=n(133331),h=n(965012),g=r(n(846870)),m=n(76469),y=r(n(571834)),E=r(n(124928)),S=n(669050),T=n(46167),v=n(309512),A=n(653313);function C(e,t){switch(t){case p.MessageRangeEncloseType.RangesAreEqual:case p.MessageRangeEncloseType.RangeAEnclosesRangeB:return{actionState:d.SyncActionState.Success};case p.MessageRangeEncloseType.RangeBEnclosesRangeA:case p.MessageRangeEncloseType.RangesNotEnclosing:return{actionState:d.SyncActionState.Orphan,orphanModel:{modelType:d.SyncModelType.Chat,modelId:e.toString()}}}}class P extends u.SyncActionBase{constructor(){super(...arguments),this.version=3,this.action=d.Actions.MarkChatAsRead}_setRead(e,t){const r=h.ChatCollection.get(e);if(r){const e=n(187148);t?e.markSeen(r):e.markUnseen(r)}}_isChatMarkedUnreadByUser(e){return(0,a.default)((function*(){const t=yield(0,m.getChatTable)().get(e.toString());return(null==t?void 0:t.unreadCount)===g.default.MARKED_AS_UNREAD}))()}validateSyncActionValue(e){const t=e.markChatAsReadAction;return null!=(null==t?void 0:t.read)&&(0,p.validateMessageRange)(null==t?void 0:t.messageRange)}applyMutations(e){var t=this;return Promise.all(e.map(function(){var e=(0,a.default)((function*(e){try{if("set"===e.operation){var n,r;const{indexParts:i,value:a}=e,[,s]=i;if(s||(0,_.throwInvalidActionIndex)(),!t.validateSyncActionValue(a))return __LOG__(3)`[syncd][mark-chat-as-read]: malformed mutation`,{actionState:d.SyncActionState.Malformed};if(!E.default.isWid(s))return(0,T.uploadCriticalEventMetric)(y.default.MD_SYNCD_CRITICAL_EVENT_CODE.ACTION_INVALID_INDEX_DATA),{actionState:d.SyncActionState.Malformed};const l=(0,o.default)(null===(n=a.markChatAsReadAction)||void 0===n?void 0:n.read,"value.markChatAsReadAction?.read"),u=(0,o.default)(null===(r=a.markChatAsReadAction)||void 0===r?void 0:r.messageRange,"value.markChatAsReadAction?.messageRange"),c=(0,S.createWid)(s),p=c.toString();return(yield(0,m.getChatTable)().get(p))?t._applyMutation(c,l,u,a):{actionState:d.SyncActionState.Orphan,orphanModel:{modelType:d.SyncModelType.Chat,modelId:p}}}return __LOG__(3)`[syncd][mark-chat-as-read]: operation not supported`,{actionState:d.SyncActionState.Unsupported}}catch(e){return{actionState:d.SyncActionState.Failed}}}));return function(){return e.apply(this,arguments)}}()))}_applyMutation(e,t,n,r){var i=this;return(0,a.default)((function*(){yield(0,f.removeActiveMessageRange)(e.toString(),(0,f.getActiveRangeAction)("markChatAsRead"));const a=yield(0,p.constructMessageRange)(e,!1),o=(0,p.compareMessageRanges)(a,n),s=(0,A.encodeProtobuf)(l.SyncActionValueSpec,r).readBuffer();switch(o){case p.MessageRangeEncloseType.RangesAreEqual:case p.MessageRangeEncloseType.RangeBEnclosesRangeA:return yield(0,f.addActiveMessageRange)(e.toString(),(0,f.getActiveRangeAction)("markChatAsRead"),s),i._setRead(e,t),Promise.resolve(C(e,o));case p.MessageRangeEncloseType.RangesNotEnclosing:case p.MessageRangeEncloseType.RangeAEnclosesRangeB:return t&&(yield i._isChatMarkedUnreadByUser(e))&&i._setRead(e,t),Promise.resolve(C(e,o))}}))()}_constructMarkChatAsReadIndexArgs(e){return[e.toString({legacy:!0})]}getMarkChatAsReadMutation(e,t,n){var r=this;return(0,a.default)((function*(){const i={markChatAsReadAction:{read:t,messageRange:yield(0,p.constructMessageRange)(n,!0)}};return(0,c.buildPendingMutation)({collection:d.CollectionName.RegularLow,indexArgs:r._constructMarkChatAsReadIndexArgs(n),value:i,version:r.version,operation:s.SyncdMutation$SyncdOperation.SET,timestamp:e,action:r.action})}))()}resolveConflicts(e,t){var n=this;return(0,a.default)((function*(){var r,s;const u=(0,v.decodeProtobuf)(l.SyncActionValueSpec,e.binarySyncAction),c=(0,v.decodeProtobuf)(l.SyncActionDataSpec,t.binarySyncData).value,_=e.timestamp,h=t.timestamp,g=(0,o.default)(u.markChatAsReadAction,"pendingMutationValue.markChatAsReadAction"),m=(0,o.default)(null==c?void 0:c.markChatAsReadAction,"incomingMutationValue?.markChatAsReadAction");switch((0,p.compareMessageRanges)((0,o.default)(m.messageRange,"incomingMarkChatAsReadAction.messageRange"),(0,o.default)(g.messageRange,"pendingMarkChatAsReadAction.messageRange"))){case p.MessageRangeEncloseType.RangeAEnclosesRangeB:return d.ConflictResolutionState.ApplyRemoteAndDropLocal;case p.MessageRangeEncloseType.RangeBEnclosesRangeA:return d.ConflictResolutionState.SkipRemote;case p.MessageRangeEncloseType.RangesAreEqual:return _<=h?d.ConflictResolutionState.ApplyRemoteAndDropLocal:d.ConflictResolutionState.SkipRemote;case p.MessageRangeEncloseType.RangesNotEnclosing:const t=_<=h?null!==(r=m.read)&&void 0!==r&&r:null!==(s=g.read)&&void 0!==s&&s,u=(0,p.mergeMessageRanges)((0,o.default)(m.messageRange,"incomingMarkChatAsReadAction.messageRange"),(0,o.default)(g.messageRange,"pendingMarkChatAsReadAction.messageRange")),y=(0,A.encodeProtobuf)(l.SyncActionValueSpec,(0,i.default)((0,i.default)({},c),{},{markChatAsReadAction:{read:t,messageRange:u}})).readBuffer(),E=(0,i.default)((0,i.default)({},e),{},{binarySyncAction:y});return delete E.id,yield(0,p.lockForMessageRangeSync)(["chat"],[E],(0,a.default)((function*(){const r=JSON.parse(e.index),i=(0,S.createWid)(r[1]);return yield(0,f.addActiveMessageRange)(i.toString(),(0,f.getActiveRangeAction)("markChatAsRead"),y),n._setRead(i,t)}))),d.ConflictResolutionState.SkipRemoteAndDropLocal}}))()}}const O=new P;Object.freeze(O);var I=O;t.default=I},731189:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MessageRangeEncloseType=void 0,t.compareMessageRanges=function(e,t){const n=S(e,t),r=S(t,e);if(n&&r)return E.RangesAreEqual;if(n)return E.RangeAEnclosesRangeB;if(r)return E.RangeBEnclosesRangeA;return E.RangesNotEnclosing},t.constructForwardMovingMessageRange=function(){return I.apply(this,arguments)},t.constructMessageRange=T,t.lockForMessageRangeSync=void 0,t.mergeMessageRanges=C,t.validateMessageRange=function(e){if(null==e)return(0,m.uploadCriticalEventMetric)(p.default.MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_UNSET),!1;for(const[t,n]of P)if(n(e))return(0,m.uploadCriticalEventMetric)(t),!1;for(const t of e.messages)for(const[e,n]of O)if(n(t))return(0,m.uploadCriticalEventMetric)(e),!1;return!0};var i=r(n(348926)),a=n(478337),o=n(370625),s=n(155172),l=n(133331),u=n(274745),c=n(574017),d=n(374740),p=r(n(571834)),_=r(n(124928)),f=n(669050),h=r(n(543465)),g=n(924439),m=n(46167),y=n(309512);const E=n(76672).Mirrored(["RangeAEnclosesRangeB","RangeBEnclosesRangeA","RangesAreEqual","RangesNotEnclosing"]);function S(e,t){const n=new Set(e.messages.map((e=>{var t;return null===(t=e.key)||void 0===t?void 0:t.id})));for(let e=0;e<t.messages.length;e++){var r;if(null==t.messages[e].timestamp)if(!n.has(null===(r=t.messages[e].key)||void 0===r?void 0:r.id))return!1}for(let r=0;r<t.messages.length;r++){var i,o,s;if(!n.has(null===(i=t.messages[r].key)||void 0===i?void 0:i.id)&&(0,a.numberOrThrowIfTooLarge)(null!==(o=e.lastMessageTimestamp)&&void 0!==o?o:0)<=(0,a.numberOrThrowIfTooLarge)(null!==(s=t.messages[r].timestamp)&&void 0!==s?s:0))return!1}return!0}function T(){return v.apply(this,arguments)}function v(){return(v=(0,i.default)((function*(e,t,n){let r=yield(0,u.getLastMessageTimestamp)(e);(0,u.logMaybeMillisecondTimestamp)(r,"getLastMessageTimestamp");const i=yield(0,u.getLastSystemMessageTimestamp)(e);(0,u.logMaybeMillisecondTimestamp)(i,"lastSystemMessageTimestamp");const{messages:o,newLastMessageTimestamp:s}=yield(0,u.getAdditionalMessages)(e,r,n);if(null!=s&&(r=s,(0,u.logMaybeMillisecondTimestamp)(s,"newLastMessageTimestamp")),null==r){var l;r=null===(l=o.sort(u.timestampComparison)[o.length-1])||void 0===l?void 0:l.timestamp,(0,u.logMaybeMillisecondTimestamp)(r,"sorting")}const c={messages:o};if(null!=r&&(c.lastMessageTimestamp=r),null!=i&&(null==r||i>(0,a.numberOrThrowIfTooLarge)(r))&&(c.lastSystemMessageTimestamp=i,(0,u.logMaybeMillisecondTimestamp)(c.lastSystemMessageTimestamp,"lastSystemMessageTimestamp")),t&&null==c.lastMessageTimestamp){const t=yield(0,u.getFirstSystemMessageTimestamp)(e);null!=t&&(c.lastMessageTimestamp=t,(0,u.logMaybeMillisecondTimestamp)(c.lastMessageTimestamp,"firstSystemMessageTimestamp"),t===i&&(c.lastSystemMessageTimestamp=void 0))}return c}))).apply(this,arguments)}function A(e,t,n){const r=new Map;return e.concat(t).forEach((e=>{var t,i,o;const s=null!==(t=null===(i=e.key)||void 0===i?void 0:i.id)&&void 0!==t?t:"";if((0,a.numberOrThrowIfTooLarge)(null!==(o=e.timestamp)&&void 0!==o?o:0)>=n){const t=r.get(s);var l,u;if(t)r.set(s,(0,a.numberOrThrowIfTooLarge)(null!==(l=t.timestamp)&&void 0!==l?l:0)<(0,a.numberOrThrowIfTooLarge)(null!==(u=e.timestamp)&&void 0!==u?u:0)?e:t);else r.set(s,e)}})),Array.from(r.values())}function C(e,t){var n,r;const i=(0,a.numberOrThrowIfTooLarge)(null!==(n=e.lastMessageTimestamp)&&void 0!==n?n:0),o=(0,a.numberOrThrowIfTooLarge)(null!==(r=t.lastMessageTimestamp)&&void 0!==r?r:0),s=Math.max(i,o),l={messages:A(e.messages,t.messages,s)};if(0!==s&&(l.lastMessageTimestamp=s),null!=e.lastSystemMessageTimestamp||null!=t.lastSystemMessageTimestamp){var u,c;const n=Math.max((0,a.numberOrThrowIfTooLarge)(null!==(u=e.lastSystemMessageTimestamp)&&void 0!==u?u:0),(0,a.numberOrThrowIfTooLarge)(null!==(c=t.lastSystemMessageTimestamp)&&void 0!==c?c:0));(null==s||n>s)&&(l.lastSystemMessageTimestamp=n)}return l}t.MessageRangeEncloseType=E;const P=[[p.default.MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_LAST_SYSTEM_MESSAGE_TIMESTAMP_SET,e=>{let{lastSystemMessageTimestamp:t,lastMessageTimestamp:n}=e;return null!=t&&null!=n&&(0,a.numberOrThrowIfTooLarge)(t)<(0,a.numberOrThrowIfTooLarge)(n)}],[p.default.MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_MESSAGES_CROSS_LIMIT,e=>e.messages.filter((e=>null!=e.timestamp)).length>1e3]],O=[[p.default.MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_MESSAGE_KEY_UNSET,e=>null==e.key],[p.default.MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_MESSAGE_KEY_REMOTE_JID_UNSET,e=>{var t;return null==(null===(t=e.key)||void 0===t?void 0:t.remoteJid)}],[p.default.MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_MESSAGE_KEY_FROM_ME_UNSET,e=>{var t;return null==(null===(t=e.key)||void 0===t?void 0:t.fromMe)}],[p.default.MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_MESSAGE_KEY_STANZA_ID_UNSET,e=>{var t;return null==(null===(t=e.key)||void 0===t?void 0:t.id)}],[p.default.MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_MESSAGE_KEY_REMOTE_JID_INVALID,e=>{var t;return!(0,f.isWidlike)(null===(t=e.key)||void 0===t?void 0:t.remoteJid)}],[p.default.MD_SYNCD_CRITICAL_EVENT_CODE.MESSAGE_RANGE_MESSAGE_KEY_PARTICIPANT_UNSET,e=>{var t,n,r;return _.default.isGroup(null===(t=e.key)||void 0===t?void 0:t.remoteJid)&&!(null===(n=e.key)||void 0===n?void 0:n.fromMe)&&null==(null===(r=e.key)||void 0===r?void 0:r.participant)}]];function I(){return(I=(0,i.default)((function*(e,t){var n;let r=yield T(e,!0,t);(yield(0,l.getActiveMessageRanges)(e.toString())).forEach((e=>{const t=e.actionValue.messageRange;switch(t&&((0,u.logMaybeMillisecondTimestamp)(t.lastMessageTimestamp,"activeRanges"),(0,u.logMaybeMillisecondTimestamp)(t.lastSystemMessageTimestamp,"activeRangesSystem")),e.action){case c.ActiveRangeAction.ClearChatDeleteStarredDeleteMedia:case c.ActiveRangeAction.ClearChatDeleteStarredKeepMedia:case c.ActiveRangeAction.ClearChatKeepStarredDeleteMedia:case c.ActiveRangeAction.ClearChatKeepStarredKeepMedia:case c.ActiveRangeAction.DeleteChatDeleteMedia:case c.ActiveRangeAction.DeleteChatKeepMedia:const t=e.actionValue.messageRange;t&&(r=C(r,t));break;case c.ActiveRangeAction.Archive:case c.ActiveRangeAction.MarkChatAsRead:}})),(0,u.logMaybeMillisecondTimestamp)(r.lastMessageTimestamp,"intermediaForwardMovingRange");const i=yield M(e);return r.messages=A(r.messages,i,(0,a.numberOrThrowIfTooLarge)(null!==(n=r.lastMessageTimestamp)&&void 0!==n?n:0)),r=(0,u.fixMessageRange)(r),(0,u.logMaybeMillisecondTimestamp)(r.lastMessageTimestamp,"forwardMovingRange"),r}))).apply(this,arguments)}function M(){return b.apply(this,arguments)}function b(){return(b=(0,i.default)((function*(e){const t=[],n=yield h.default.getSyncActionsRows(["action"],[s.Actions.DeleteMessageForMe]);return __LOG__(2)`syncd: deleteForMeSyncActions length: ${n.length}`,n.forEach((n=>{const r=e.toString({legacy:!0}),i=JSON.parse(n.index);if(5!==i.length)__LOG__(2)`constructForwardMovingMessageRange: delete for me mutation index malformed ${n.index}`;else if(r===i[1]&&n.actionState===s.SyncActionState.Success){var a;const e=(0,y.decodeProtobuf)(o.SyncActionDataSpec,n.binarySyncData).value,r=null==e||null===(a=e.deleteMessageForMeAction)||void 0===a?void 0:a.messageTimestamp;if(null==r)__LOG__(2)`constructForwardMovingMessageRange: deleteMessageForMeAction malformed`;else{const e={remoteJid:i[1],id:i[2],fromMe:"1"===i[3],participant:"0"!==i[4]?i[4]:void 0};t.push({key:e,timestamp:(0,d.maybeMillisecondsToSeconds)(r)})}}})),t}))).apply(this,arguments)}t.lockForMessageRangeSync=(e,t,n)=>(0,g.lockForSync)([...e,"message","active-message-ranges"],t,n)},737633:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(478337),o=n(715739),s=n(94439),l=n(797666),u=n(155172),c=n(990445),d=n(522055),p=n(97858),_=n(76469),f=r(n(571834)),h=r(n(124928)),g=n(669050),m=n(46167);class y extends s.SyncActionBase{constructor(){super(...arguments),this.version=2,this.action=u.Actions.Mute}getChatJidAndMessageKey(e){const[,t]=e.indexArr;return{chatJid:t,messageKey:null}}applyMutations(e){return Promise.all(e.map(function(){var e=(0,i.default)((function*(e){try{if("set"===e.operation){var t,r;const{indexParts:i,value:o}=e,[,s]=i;if(s||(0,d.throwInvalidActionIndex)(),!h.default.isWid(s))return(0,m.uploadCriticalEventMetric)(f.default.MD_SYNCD_CRITICAL_EVENT_CODE.ACTION_INVALID_INDEX_DATA),{actionState:u.SyncActionState.Malformed};const l=o.muteAction,y=null===(t=o.muteAction)||void 0===t?void 0:t.muted,E=(0,a.maybeNumberOrThrowIfTooLarge)(null==l?void 0:l.muteEndTimestamp),S=!!(null===(r=o.muteAction)||void 0===r?void 0:r.autoMuted);if(null==y||y&&null==E)return __LOG__(3)`mute chat sync: malformed mutation`,{actionState:u.SyncActionState.Malformed};const T=(0,g.createWid)(s);if(!(yield(0,_.getChatTable)().get(T.toString())))return{actionState:u.SyncActionState.Orphan,orphanModel:{modelType:u.SyncModelType.Chat,modelId:T.toString()}};const v=null!=E?E:0,A=v>0&&v<(0,c.unixTimeMs)()?0:Math.floor(v/1e3);let C;return(0,p.isAutoMuteConfirmationDialogEnabled)()?(yield(0,_.getChatTable)().merge(T.toString(),{muteExpiration:A,isAutoMuted:S}),C={id:T,expiration:A,isAutoMuted:S}):(yield(0,_.getChatTable)().merge(T.toString(),{muteExpiration:A}),C={id:T,expiration:A}),n(52136).MuteCollection.add(C,{merge:!0}),(0,p.isAutoMuteConfirmationDialogEnabled)(),{actionState:u.SyncActionState.Success}}return __LOG__(3)`mute chat sync: operation not supported`,{actionState:u.SyncActionState.Unsupported}}catch(e){return{actionState:u.SyncActionState.Failed}}}));return function(){return e.apply(this,arguments)}}()))}generateMuteMutation(e,t,n){const r=void 0!==t&&0!==t,i=(0,c.unixTimeMs)();let a,s=t;-1!==s&&(s*=1e3),a=(0,p.isAutoMuteConfirmationDialogEnabled)()?{muted:r,muteEndTimestamp:s,autoMuted:n}:{muted:r,muteEndTimestamp:s};const d={muteAction:a};return(0,l.buildPendingMutation)({collection:u.CollectionName.RegularHigh,indexArgs:[e.toString({legacy:!0})],operation:o.SyncdMutation$SyncdOperation.SET,version:this.version,value:d,timestamp:i,action:this.action})}}const E=new y;Object.freeze(E);var S=E;t.default=S},617909:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(715739),o=n(94439),s=n(797666),l=n(155172),u=n(990445),c=n(425315),d=n(377773),p=n(924439),_=n(655822);class f extends o.SyncActionBase{constructor(){super(...arguments),this.version=7,this.action=l.Actions.Nux}applyMutations(e){return(0,i.default)((function*(){if(!(0,_.enableNuxSync)())return __LOG__(3)`NuxSync: nux_sync ab prop required`,e.map((()=>({actionState:l.SyncActionState.Unsupported})));const t=[],n=e.map((e=>{var n;if("set"!==e.operation)return __LOG__(3)`NuxSync: operation not supported ${e}`,{actionState:l.SyncActionState.Malformed};const r=e.indexParts[1];return(0,c.isString)(r)?(t.push({nuxKey:r,acknowledged:!0===(null===(n=e.value.nuxAction)||void 0===n?void 0:n.acknowledged)}),{actionState:l.SyncActionState.Success}):(__LOG__(3)`NuxSync: malformed mutation ${e}`,{actionState:l.SyncActionState.Malformed})}));return 0!==t.length&&(__LOG__(2)`NuxSync: update nux to local store`,(0,d.updateNuxSyncList)(t)),n}))()}_createNuxMutation(e,t,n){return(0,s.buildPendingMutation)({collection:l.CollectionName.RegularLow,indexArgs:[e],value:{nuxAction:{acknowledged:n}},version:this.version,operation:a.SyncdMutation$SyncdOperation.SET,timestamp:t,action:this.action})}acknowledgeNux(e){var t=this;return(0,i.default)((function*(){yield t._changeNuxState(e,!0)}))()}unAcknowledgeNux(e){var t=this;return(0,i.default)((function*(){yield t._changeNuxState(e,!1)}))()}_changeNuxState(e,t){var n=this;return(0,i.default)((function*(){if(!(0,_.enableNuxSync)())return;(0,d.updateNuxSyncList)([{nuxKey:e,acknowledged:t}]);const r=n._createNuxMutation(e,(0,u.unixTimeMs)(),t);yield(0,p.lockForSync)([],[r],(()=>Promise.resolve()))}))()}}const h=new f;Object.freeze(h);var g=h;t.default=g},889355:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(478337),o=r(n(132375)),s=n(715739),l=n(370625),u=n(94439),c=n(797666),d=n(155172),p=n(990445),_=r(n(991752)),f=r(n(819727)),h=n(522055),g=n(97858),m=n(76469),y=r(n(571834)),E=r(n(124928)),S=n(669050),T=r(n(543465)),v=n(924439),A=n(46167),C=n(485330),P=n(309512);class O extends u.SyncActionBase{constructor(){super(...arguments),this.version=5,this.action=d.Actions.Pin}applyMutations(e){var t=this;return(0,i.default)((function*(){_.default.updatePrimaryAllowsAllMutationsFlag("other mutation");const n=[];for(let r=0;r<e.length;r++)n.push(yield t.applyMutation(e[r]));return n}))()}applyMutation(e){var t=this;return(0,i.default)((function*(){if("remove"===e.operation)return __LOG__(3)`syncd: pin_chat_sync: REMOVE not supported`,Promise.resolve({actionState:d.SyncActionState.Unsupported});if(!(0,g.pinChatSyncEnabled)())return __LOG__(3)`syncd: pin_chat_sync: not enabled`,Promise.resolve({actionState:d.SyncActionState.Unsupported});const{indexParts:n,value:r,timestamp:i}=e,[,a]=n;try{if(a||(__LOG__(3)`syncd: pin_chat_sync: missing chatId in index`,(0,h.throwInvalidActionIndex)()),!E.default.isWid(a))return(0,A.uploadCriticalEventMetric)(y.default.MD_SYNCD_CRITICAL_EVENT_CODE.ACTION_INVALID_INDEX_DATA),{actionState:d.SyncActionState.Malformed};const e=(0,S.createWid)(a),{pinAction:n}=r;if(null==n)return __LOG__(3)`syncd: pin_chat_sync: missing pinAction`,Promise.resolve({actionState:d.SyncActionState.Malformed});const{pinned:o}=n;if(null==o)return __LOG__(3)`syncd: pin_chat_sync: missing pinned field`,Promise.resolve({actionState:d.SyncActionState.Malformed});if(null==(yield(0,m.getChatTable)().get(e.toString())))return{actionState:d.SyncActionState.Orphan,orphanModel:{modelType:d.SyncModelType.Chat,modelId:e.toString()}};if(!o)return yield t.applyUpdates([{wid:e,pinned:!1,timestamp:i}]),{actionState:d.SyncActionState.Success};const s=yield t.getLocalPins();if(s.some((t=>t.chatId.toString()===e.toString())))return yield t.applyUpdates([{wid:e,pinned:o,timestamp:i}]),{actionState:d.SyncActionState.Success};if(s.length<3)return yield t.applyUpdates([{wid:e,pinned:o,timestamp:i}]),{actionState:d.SyncActionState.Success};const l=s.reduce(((e,t)=>t.timestamp<e.timestamp?t:e)),u=[],c=l.timestamp<i?l.chatId:e;return c===l.chatId&&u.push({wid:l.chatId,pinned:!1,timestamp:i},{wid:e,pinned:!0,timestamp:i}),yield Promise.all([t.applyUpdates(u),t.createPendingUnpin(c,i)]),Promise.resolve({actionState:d.SyncActionState.Success})}catch(e){return{actionState:d.SyncActionState.Failed}}}))()}applyUpdates(e){return(0,i.default)((function*(){if(0===e.length)return;const t=e.map((e=>{let{wid:t,pinned:n,timestamp:r}=e;const i={id:t.toString(),pin:n?r:0};return n&&(i.archive=!1),i}));yield Promise.all(t.map((e=>(0,m.getChatTable)().merge(e.id,e)))),yield Promise.all(e.map(function(){var e=(0,i.default)((function*(e){const t=yield(0,C.getExisting)(e.wid);null!=t&&(t.pin=e.pinned?e.timestamp:0,e.pinned&&(t.archive=!1))}));return function(){return e.apply(this,arguments)}}()))}))()}createPendingUnpin(e,t){var n=this;return(0,i.default)((function*(){yield T.default.appendPendingMutationsRows([n.getPinMutation(t,!1,e)])}))()}getLocalPins(){return(0,i.default)((function*(){const e=(0,m.getChatTable)().all().then((e=>e.filter((e=>null!=e.pin&&e.pin>0)).map((e=>[e.id,(0,o.default)(e.pin,"chatRow.pin")])))),t=T.default.getSyncActionsRows(["action"],[d.Actions.Pin]).then((e=>e.filter((e=>e.actionState===d.SyncActionState.Orphan)).map((e=>{var t;const n=JSON.parse(e.index);if(n.length<2)return null;const r=n[1],i=(0,P.decodeProtobuf)(l.SyncActionDataSpec,e.binarySyncData).value;return null!=(null==i?void 0:i.pinAction)&&(null==i?void 0:i.pinAction.pinned)?[r,(0,a.numberOrThrowIfTooLarge)(null!==(t=i.timestamp)&&void 0!==t?t:0)]:null})).filter(Boolean))),[n,r]=yield Promise.all([e,t]);return[...n,...r].map((e=>{let[t,n]=e;return{chatId:(0,S.createWid)(t),timestamp:n}}))}))()}unpinAll(){var e=this;return(0,i.default)((function*(){const t=yield e.getLocalPins(),n=(0,p.unixTimeMs)(),r=t.map((t=>{let{chatId:r}=t;return e.getPinMutation(n,!1,r)}));return(0,v.lockForSync)(["chat"],r,(()=>Promise.resolve())).then((()=>e.applyUpdates(t.map((e=>{let{chatId:t}=e;return{wid:t,pinned:!1,timestamp:n}})))))}))()}getMutationsForPin(e,t,n){var r=this;return(0,i.default)((function*(){const i=[r.getPinMutation(e,t,n)];return t&&i.push(yield f.default.getArchiveChatMutation(e,!1,n)),i}))()}getChatJidAndMessageKey(e){const[,t]=e.indexArr;return{chatJid:t,messageKey:null}}getPinMutation(e,t,n){return(0,c.buildPendingMutation)({collection:d.CollectionName.RegularLow,indexArgs:[n.toString({legacy:!0})],value:{pinAction:{pinned:t}},version:this.version,operation:s.SyncdMutation$SyncdOperation.SET,timestamp:e,action:this.action})}}const I=new O;Object.freeze(I);var M=I;t.default=M},331538:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=r(n(132375)),o=n(94439),s=n(155172),l=n(287461),u=n(736751);class c extends o.SyncActionBase{constructor(){super(...arguments),this.version=7,this.action=s.Actions.PrimaryFeature}applyMutations(e){return(0,i.default)((function*(){if(!0!==(0,l.getABPropConfigValue)("primary_feature_sync"))return __LOG__(3)`primary feature sync: operation not supported`,e.map((()=>({actionState:s.SyncActionState.Unsupported})));let t;const n=e.map((e=>{var n;if("set"!==e.operation)return __LOG__(3)`primary feature sync: operation not supported`,{actionState:s.SyncActionState.Malformed};return null==(null===(n=e.value.primaryFeature)||void 0===n?void 0:n.flags)?(__LOG__(3)`primary feature sync: malformed mutation`,{actionState:s.SyncActionState.Malformed}):((null==t||e.timestamp>t.timestamp)&&(t=e),{actionState:s.SyncActionState.Success})}));if(null!=t){var r;const e=(0,a.default)(null===(r=t.value.primaryFeature)||void 0===r?void 0:r.flags,"latestMutation.value.primaryFeature?.flags");u.PrimaryFeatures.setPrimaryFeatures(e)}return n}))()}}const d=new c;Object.freeze(d);var p=d;t.default=p},372877:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(94439),o=n(155172),s=n(522055);const l="current",u="session_start";class c extends a.SyncActionBase{constructor(){super(...arguments),this.version=7,this.action=o.Actions.PrimaryVersion}applyMutations(e){return(0,i.default)((function*(){return e.map((e=>{var t;if("set"!==e.operation)return __LOG__(3)`syncd: primary version sync, operation not supported`,{actionState:o.SyncActionState.Unsupported};const{indexParts:n,value:r}=e,[,i]=n;(!i||i!==l&&i!==u)&&(0,s.throwInvalidActionIndex)();return null==(null===(t=r.primaryVersionAction)||void 0===t?void 0:t.version)?(__LOG__(3)`syncd: primary version sync, malformed mutation`,{actionState:o.SyncActionState.Malformed}):{actionState:o.SyncActionState.Success}}))}))()}}const d=new c;Object.freeze(d);var p=d;t.default=p},143874:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(715739),o=n(94439),s=n(797666),l=n(155172),u=r(n(92010)),c=n(404643),d=r(n(571834)),p=n(398384);class _ extends o.SyncActionBase{constructor(){super(...arguments),this.version=1,this.action=l.Actions.SettingPushName}applyMutations(e){return(0,i.default)((function*(){return yield Promise.all(e.map(function(){var e=(0,i.default)((function*(e){try{if("set"===e.operation){var t;const{value:r}=e;let i=null===(t=r.pushNameSetting)||void 0===t?void 0:t.name;i||(__LOG__(3)`push name sync: empty pushname`,(0,p.logCriticalBootstrapStageIfNecessary)(d.default.BOOTSTRAP_APP_STATE_DATA_STAGE_CODE.PUSHNAME_INVALID),i=""),(0,u.default)(i),(0,c.setPushnameLocally)(i),yield(0,p.logCriticalBootstrapStageIfNecessary)(d.default.BOOTSTRAP_APP_STATE_DATA_STAGE_CODE.PUSHNAME_APPLIED);const a=n(775410).default;return a.isSyncDCriticalDataSyncInProcess()&&(yield a.setSyncDCriticalSynced(),yield a.setSyncDCriticalDataSyncCompleted()),Promise.resolve({actionState:l.SyncActionState.Success})}return __LOG__(3)`push name sync: operation not supported`,Promise.resolve({actionState:l.SyncActionState.Unsupported})}catch(e){return(0,p.logCriticalBootstrapStageIfNecessary)(d.default.BOOTSTRAP_APP_STATE_DATA_STAGE_CODE.PUSHNAME_INVALID),{actionState:l.SyncActionState.Failed}}}));return function(){return e.apply(this,arguments)}}()))}))()}getPushnameMutation(e,t){return(0,s.buildPendingMutation)({collection:l.CollectionName.CriticalBlock,indexArgs:[],value:{pushNameSetting:{name:t}},version:this.version,operation:a.SyncdMutation$SyncdOperation.SET,timestamp:e,action:this.action})}}const f=new _;Object.freeze(f);var h=f;t.default=h},325014:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(94439),o=n(155172),s=n(522055),l=n(76469),u=n(319022);class c extends a.SyncActionBase{constructor(){super(...arguments),this.version=2,this.action=o.Actions.QuickReply}applyMutations(e){return Promise.all(e.map(function(){var e=(0,i.default)((function*(e){try{if("set"===e.operation){const{indexParts:t,value:n}=e,[,r]=t;r||(0,s.throwInvalidActionIndex)();const i=n.quickReplyAction;if(!i)return __LOG__(3)`quick replies sync: malformed mutation`,{actionState:o.SyncActionState.Malformed};if(i.deleted)return yield(0,l.getQuickReplyTable)().remove(r),u.QuickReplyCollection.remove(r),{actionState:o.SyncActionState.Success};const{shortcut:a,message:c}=i;if(!a||!c)return __LOG__(3)`quick replies sync: malformed mutation`,{actionState:o.SyncActionState.Malformed};const d=i.keywords||[],p=i.count||0;return yield(0,l.getQuickReplyTable)().createOrReplace({id:r,shortcut:a,count:p,message:c,keywords:d}),u.QuickReplyCollection.add({id:r,shortcut:a,message:c,keywords:d,count:p},{merge:!0}),{actionState:o.SyncActionState.Success}}return __LOG__(3)`quick replies sync: operation not supported`,{actionState:o.SyncActionState.Unsupported}}catch(e){return{actionState:o.SyncActionState.Failed}}}));return function(){return e.apply(this,arguments)}}()))}}const d=new c;Object.freeze(d);var p=d;t.default=p},904117:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(715739),o=n(94439),s=n(797666),l=n(155172),u=n(990445),c=n(522055),d=n(74927),p=n(76469),_=n(301460),f=r(n(571834)),h=r(n(124928)),g=n(46167),m=n(986632);class y extends o.SyncActionBase{constructor(){super(...arguments),this.version=2,this.action=l.Actions.Star}getChatJidAndMessageKey(e){const[,t,n,r,i]=e.indexArr;t&&n&&r&&i||(0,c.throwInvalidActionIndex)();const a=(0,c.syncKeyToMsgKey)(t,n,r,i);return{chatJid:t,messageKey:null==a?void 0:a.toString()}}applyMutations(e){return(0,i.default)((function*(){const t=[],n=[],r=new Set;yield(0,p.getMessageTable)().bulkGet(e.map((e=>{var t;const[,n,r,i,a]=e.indexParts;return n&&r&&i&&a&&h.default.isWid(n)?null===(t=(0,c.syncKeyToMsgKey)(n,r,i,a))||void 0===t?void 0:t.toString():null})).filter(Boolean)).then((e=>e.forEach((e=>{e&&r.add(e.id)}))));const i=yield Promise.all(e.map((e=>{try{if("set"===e.operation){var i;const{indexParts:a,value:o}=e,[,s,u,d,p]=a;s&&u&&d&&p||(0,c.throwInvalidActionIndex)();const h=null===(i=o.starAction)||void 0===i?void 0:i.starred;if(null==h)return __LOG__(3)`star message sync: malformed mutation`,{actionState:l.SyncActionState.Malformed};const y=(0,c.syncKeyToMsgKey)(s,u,d,p);if(!y)return(0,g.uploadCriticalEventMetric)(f.default.MD_SYNCD_CRITICAL_EVENT_CODE.ACTION_INVALID_INDEX_DATA),{actionState:l.SyncActionState.Malformed};if(!r.has(y.toString()))return{actionState:l.SyncActionState.Orphan,orphanModel:{modelId:y.toString(),modelType:l.SyncModelType.Msg}};h?t.push(y.toString()):n.push(y.toString());const E=_.MsgCollection.get(y);return E?(E.star=h,E.star?(0,m.addStarredMsgs)([E]):(0,m.removeStarredMsgs)([E])):__LOG__(3)`star_message_sync: msg ${y} found in storage but not in collection`,{actionState:l.SyncActionState.Success}}return __LOG__(3)`star message sync: operation not supported`,{actionState:l.SyncActionState.Unsupported}}catch(e){return{actionState:l.SyncActionState.Failed}}})));return yield Promise.all([(0,d.starMessages)(t),(0,d.unstarMessages)(n)]),i}))()}getStarMessageMutations(e,t){const n=(0,u.unixTimeMs)();return e.map((e=>(0,s.buildPendingMutation)({collection:l.CollectionName.RegularHigh,indexArgs:(0,g.constructMsgKeySegments)(e),operation:a.SyncdMutation$SyncdOperation.SET,version:this.version,value:{starAction:{starred:t}},timestamp:n,action:this.action})))}}const E=new y;Object.freeze(E);var S=E;t.default=S},522055:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getMsgKeyFromStarActionIndex=function(e){const t=JSON.parse(e);if(t.length<5)throw new Error("[sync-action] star action index malformed, cannot create MsgKey");const n=p(t[1],t[2],t[3],t[4]);if(!n)throw __LOG__(3)`[sync-action] star action index data is malformed, , cannot create MsgKey`,new Error("[sync-action] star action index data is malformed, , cannot create MsgKey");return n},t.syncKeyToMsgKey=p,t.throwInvalidActionIndex=function(){throw(0,o.uploadFatalErrorMetric)(l.default.MD_SYNCD_FATAL_ERROR_CODE.INVALID_ACTION_INDEX,null),new i.SyncdFatalError("invalid action index")};var i=n(958177),a=r(n(565754)),o=n(22383),s=n(459857),l=r(n(571834)),u=r(n(124928)),c=n(669050);const d=/\d(?=)/gm;function p(e,t,n,r){let i;if(!u.default.isWid(e))return __LOG__(3)`syncKeyToMsgKey: invalid remote value: ${e.replace(d,"#")}`,null;if(!(0,c.createWid)(e).isUser()){if("0"===n&&!u.default.isWid(r))return __LOG__(3)`syncKeyToMsgKey: invalid participant value: ${r.replace(d,"#")}`,null;i="1"===n?(0,s.getMeUser)():(0,c.createWid)(r)}return new a.default({fromMe:"1"===n,remote:(0,c.createWid)(e),id:t,participant:i})}},721378:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(94439),o=n(155172),s=n(287461),l=n(63014);class u extends a.SyncActionBase{constructor(){super(...arguments),this.version=7,this.action=o.Actions.TimeFormat}applyMutations(e){return(0,i.default)((function*(){return!0!==(0,s.getABPropConfigValue)("md_syncd_24_hour_time_format_sync_enabled")?(__LOG__(3)`time format sync: operation not supported`,e.map((()=>({actionState:o.SyncActionState.Unsupported})))):e.map((e=>{var t;if("set"!==e.operation)return __LOG__(3)`time format sync: operation not supported`,{actionState:o.SyncActionState.Unsupported};const n=null===(t=e.value.timeFormatAction)||void 0===t?void 0:t.isTwentyFourHourFormatEnabled;return null==n?(__LOG__(3)`time format sync: malformed mutation`,{actionState:o.SyncActionState.Malformed}):(l.Clock.setIs24Hour(n),{actionState:o.SyncActionState.Success})}))}))()}}const c=new u;Object.freeze(c);var d=c;t.default=d},447262:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(94439),o=n(155172),s=n(522055),l=n(121977),u=n(76469),c=r(n(571834)),d=r(n(124928)),p=n(669050),_=n(46167);function f(){return(f=(0,i.default)((function*(e){const t=new Set;return yield(0,u.getContactTable)().bulkGet(e.map((e=>{const[,t]=e.indexParts;return t&&d.default.isWid(t)?t:null})).filter(Boolean)).then((e=>e.forEach((e=>{e&&t.add(e.id)})))),t}))).apply(this,arguments)}class h extends a.SyncActionBase{constructor(){super(...arguments),this.version=7,this.action=o.Actions.UserStatusMute}applyMutations(e){return(0,i.default)((function*(){const t=yield function(){return f.apply(this,arguments)}(e),n=[],r=yield Promise.all(e.map((e=>{try{if("set"===e.operation){var r;const{indexParts:i,value:a}=e,[,l]=i;if(l||(0,s.throwInvalidActionIndex)(),!d.default.isWid(l))return(0,_.uploadCriticalEventMetric)(c.default.MD_SYNCD_CRITICAL_EVENT_CODE.ACTION_INVALID_INDEX_DATA),{actionState:o.SyncActionState.Malformed};const u=null===(r=a.userStatusMuteAction)||void 0===r?void 0:r.muted;return void 0===u?(__LOG__(3)`UserStatusMuteSyncd: malformed mutation ${e}`,{actionState:o.SyncActionState.Malformed}):t.has(l)?(n.push({id:l,statusMute:u}),{actionState:o.SyncActionState.Success}):{actionState:o.SyncActionState.Orphan,orphanModel:{modelId:l,modelType:o.SyncModelType.UserStatusMute}}}return __LOG__(3)`status user mute chat sync: operation not supported`,{actionState:o.SyncActionState.Unsupported}}catch(e){return{actionState:o.SyncActionState.Failed}}})));yield(0,u.getContactTable)().bulkCreateOrMerge(n);const i=n.map((e=>{const t=(0,p.createUserWid)(e.id),n=l.ContactCollection.get(t);return{id:t,pushname:(null==n?void 0:n.pushname)||"",type:(null==n?void 0:n.type)||"out",name:null==n?void 0:n.name,statusMute:e.statusMute}}));return l.ContactCollection.add(i,{merge:!0}),r}))()}}const g=new h;Object.freeze(g);var m=g;t.default=m},398384:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.logCriticalBootstrapStageIfNecessary=function(){return u.apply(this,arguments)};var i=r(n(348926)),a=n(990445),o=n(287461),s=n(366891),l=r(n(571834));function u(){return(u=(0,i.default)((function*(e){(yield(0,o.getABPropConfigValue)("md_app_state_critical_data_processing_logging"))&&n(775410).default.isSyncDCriticalDataSyncInProcess()&&new l.default.MdBootstrapAppStateCriticalDataProcessing({bootstrapAppStateDataStage:e,mdSessionId:yield s.MdSyncFieldStatsMeta.getMdSessionId(),mdTimestamp:(0,a.unixTimeMs)()}).commit()}))).apply(this,arguments)}},543465:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(192920),o=(n(370625),n(682661)),s=n(76469),l=n(605316),u=n(536884),c=n(732367);n(309512);const d=new ArrayBuffer(a.KEY_LENGTH_BYTES);t.default=class{static getAllPendingMutationsRows(){return(0,s.getPendingMutationsTable)().all()}static performTransaction(e){return(0,l.getStorage)().lock(["collection-version","pending-mutations","sync-actions"],e)}static getPendingMutationsRows(e,t){return(0,s.getPendingMutationsTable)().equals(e,t)}static getPendingMutationsRowsById(e){return(0,i.default)((function*(){return(yield(0,s.getPendingMutationsTable)().bulkGet(e)).filter(Boolean)}))()}static getPendingMutationsRowsByIndex(e,t){return(0,s.getPendingMutationsTable)().equals(e,t)}static appendPendingMutationsRows(e){return(0,s.getPendingMutationsTable)().bulkCreate(e)}static bulkUpdatePendingMutationsKeyId(e){return(0,s.getPendingMutationsTable)().bulkCreateOrMerge(e)}static bulkRemovePendingMutations(e){return(0,s.getPendingMutationsTable)().bulkRemove(e)}static hasPendingMutationForCollection(e){return(0,s.getPendingMutationsTable)().equals(["collection"],e).then((e=>e.length>0))}static getCollectionVersion(e){return(0,i.default)((function*(){const t=yield(0,s.getCollectionVersionTable)().get(e);return null==t?void 0:t.version}))()}static getCollectionVersions(e){return(0,i.default)((function*(){const t=yield(0,s.getCollectionVersionTable)().bulkGet(e);return new Map(e.map(((e,n)=>{var r;return[e,null===(r=t[n])||void 0===r?void 0:r.version]})))}))()}static setCollectionVersion(e,t,n){return(0,s.getCollectionVersionTable)().createOrMerge(e,{collection:e,version:t,ltHash:n})}static getLtHash(e){return(0,i.default)((function*(){const t=yield(0,s.getCollectionVersionTable)().get(e);return(null==t?void 0:t.ltHash)||d}))()}static getAllCollectionLtHashes(){return(0,i.default)((function*(){return(yield(0,s.getCollectionVersionTable)().all()).map((e=>({collection:e.collection,ltHash:e.ltHash})))}))()}static getSyncAction(e){return(0,s.getSyncActionsTable)().get(e)}static getSyncActionsRows(e,t){return(0,s.getSyncActionsTable)().anyOf(e,t)}static setSyncAction(e){return(0,s.getSyncActionsTable)().createOrReplace(e)}static setSyncActionRows(e){return(0,s.getSyncActionsTable)().bulkCreateOrReplace(e)}static updateSyncActionRows(e){return(0,s.getSyncActionsTable)().bulkCreateOrMerge(e)}static deleteSyncActionRows(e){return(0,s.getSyncActionsTable)().bulkRemove(e)}static getSyncKey(e){return(0,i.default)((function*(){const t=yield(0,s.getSyncKeysTable)().get(new Uint8Array((0,o.fromSyncKeyId)(e)));return null==t?t:(0,c.convertToSyncKeyFromRow)(t)}))()}static getAllSyncKeys(){return(0,s.getSyncKeysTable)().all().then((e=>e.map(c.convertToSyncKeyFromRow)))}static createSyncKey(e){return(0,s.getSyncKeysTable)().create((0,c.convertFromSyncKeyToRow)(e)).then((e=>(0,o.toSyncKeyId)(e.buffer)))}static expireSyncKey(e){return(0,i.default)((function*(){(yield(0,s.getSyncKeysTable)().equals(["keyEpoch"],e)).forEach((e=>(0,s.getSyncKeysTable)().merge(e.keyId,{keyId:e.keyId,timestamp:0})))}))()}static getMissingKey(e){return(0,i.default)((function*(){const t=yield(0,s.getMissingKeysTable)().get(e);return null==t?t:(0,u.convertToMissingKeyFromRow)(t)}))()}static getMissingKeyCount(){return(0,s.getMissingKeysTable)().count()}static bulkGetMissingKeys(e){return(0,s.getMissingKeysTable)().bulkGet(e).then((e=>e.map((e=>null==e?null:(0,u.convertToMissingKeyFromRow)(e)))))}static getAllMissingKeys(){return(0,s.getMissingKeysTable)().all().then((e=>e.map(u.convertToMissingKeyFromRow)))}static bulkRemoveMissingKeys(e){return(0,s.getMissingKeysTable)().bulkRemove(e)}static createOrUpdateMissingKeys(e){return(0,s.getMissingKeysTable)().bulkCreateOrMerge(e.map(u.convertFromMissingKeyToRow))}}},310790:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleSyncdFatal=t.handleSyncDelayApplyingPatchUntilUIUnblocks=t.handleSyncCompleted=t.handleSyncBeforeApplyPatch=void 0;var i=r(n(991752)),a=n(780549),o=r(n(797137)),s=n(387159);t.handleSyncBeforeApplyPatch=e=>(0===e.deviceIndex&&i.default.updatePrimaryAllowsAllMutationsFlag("device index"),Promise.resolve());t.handleSyncCompleted=e=>(a.Cmd.trigger(a.APP_STATE_SYNC_COMPLETED,e),Promise.resolve());t.handleSyncDelayApplyingPatchUntilUIUnblocks=()=>(0,o.default)().then((()=>{}));t.handleSyncdFatal=e=>(0,s.handleFatalError)(null==e?void 0:e.collections)},304528:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ActionHandlers=void 0;var i=r(n(345410)),a=r(n(722882)),o=r(n(991752)),s=r(n(819727)),l=r(n(118594)),u=r(n(82037)),c=r(n(267122)),d=r(n(822036)),p=r(n(377909)),_=r(n(421571)),f=r(n(460263)),h=r(n(541957)),g=r(n(79758)),m=r(n(34321)),y=r(n(278332)),E=r(n(164404)),S=r(n(737633)),T=r(n(617909)),v=r(n(889355)),A=r(n(331538)),C=r(n(372877)),P=r(n(143874)),O=r(n(325014)),I=r(n(904117)),M=r(n(721378)),b=r(n(447262)),R=r(n(932444)),N=r(n(102997));const w=[I.default,p.default,S.default,m.default,a.default,g.default,h.default,O.default,y.default,P.default,s.default,E.default,d.default,f.default,i.default,l.default,v.default,_.default,o.default,A.default,T.default,M.default,b.default,C.default,N.default,c.default,u.default,R.default];t.ActionHandlers=w},372088:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.logMetricsForDataApplied=function(){return c.apply(this,arguments)},t.logMetricsForMutationLength=function(e){new l.default.MdAppStateMessageRange({additionalMessagesCount:e}).commit()};var i=r(n(348926)),a=n(637463),o=n(990445),s=n(366891),l=r(n(571834)),u=n(46167);function c(){return(c=(0,i.default)((function*(e,t,n){new l.default.MdBootstrapDataApplied({mdBootstrapPayloadType:l.default.MD_BOOTSTRAP_PAYLOAD_TYPE.NON_CRITICAL,mdBootstrapSource:l.default.MD_BOOTSTRAP_SOURCE.APP_STATE,mdSessionId:yield s.MdSyncFieldStatsMeta.getMdSessionId(),mdTimestamp:(0,o.unixTimeMs)(),mdBootstrapStepDuration:n,collection:(0,u.collectionNameToMetric)(e),usedSnapshot:t===a.SyncdBootstrapDataAppliedSnapshotUsed.SNAPSHOT_USED}).commit()}))).apply(this,arguments)}},230591:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.commitBootstrapAppStateDownloadMetric=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(478337),o=n(155172),s=n(990445),l=n(366891),u=r(n(571834));function c(){return(c=(0,i.default)((function*(e,t,n,r){const i=new u.default.MdBootstrapAppStateDataDownloaded({mdBootstrapPayloadType:[o.CollectionName.CriticalBlock,o.CollectionName.CriticalUnblockLow].includes(e)?u.default.MD_BOOTSTRAP_PAYLOAD_TYPE.CRITICAL:u.default.MD_BOOTSTRAP_PAYLOAD_TYPE.NON_CRITICAL,mdTimestamp:(0,s.unixTimeMs)(),mdBootstrapStepDuration:(0,s.unixTimeMs)()-t,mdBootstrapStepResult:"success"===r?u.default.MD_BOOTSTRAP_STEP_RESULT.SUCCESS:u.default.MD_BOOTSTRAP_STEP_RESULT.FAILURE,mdSessionId:yield l.MdSyncFieldStatsMeta.getMdSessionId()}),c=yield l.MdSyncFieldStatsMeta.getStorageEstimation();c.mdStorageQuotaBytes!==l.STORAGE_QUOTA_UNAVAILABLE&&(i.mdStorageQuotaUsedBytes=c.mdStorageQuotaUsedBytes,i.mdStorageQuotaBytes=c.mdStorageQuotaBytes);try{const e=(0,a.maybeNumberOrThrowIfTooLarge)(n);null!=e&&(i.mdBootstrapPayloadSize=e)}catch(e){}i.commit()}))).apply(this,arguments)}},704630:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleAppStateSyncKeyRequest=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(284642),o=n(531478),s=n(682661),l=n(323829),u=n(628905);function c(){return(c=(0,i.default)((function*(e,t){const n=e.keyIds;if(n){const e=n.map((e=>e.keyId)).filter(Boolean).map(s.toSyncKeyId);if(__LOG__(2)`syncd: handleAppStateSyncKeyRequest from device ${t.getDeviceId()}
\t for keyIds: [${e.map(a.syncKeyIdToHex)}]`,e){const{keys:n,orphanKeys:r}=yield(0,o.getKeysForKeyRequest)(e);return __LOG__(2)`syncd: handleAppStateSyncKeyRequest from device ${t.getDeviceId()}: about to send key share
\t keys with keydata: [${n.map((e=>(0,a.syncKeyIdToHex)(e.keyId)))}]
\t keys without keydata: [${r.map((e=>(0,a.syncKeyIdToHex)(e)))}]`,(0,u.getJobManager)().waitUntilPersisted(l.jobSerializers.sendRequestedKeyShare(n,r,t))}}}))).apply(this,arguments)}},104144:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleAppStateSyncKeyShare=function(e,t){return h(e,t)},t.setAppStateSyncKeyShareHandler=function(e){};var i=r(n(348926)),a=n(616310),o=n(478337),s=n(284642),l=n(371303),u=n(577392),c=n(682661),d=n(22383),p=r(n(571834)),_=n(398384),f=n(387159);let h=function(){var e=(0,i.default)((function*(e,t){(0,_.logCriticalBootstrapStageIfNecessary)(p.default.BOOTSTRAP_APP_STATE_DATA_STAGE_CODE.MISSING_KEYS_RECEIVED);const n=t.getDeviceId();__LOG__(2)`syncd: handling key share from device ${n} with ${e.keys.length} keys`;const r=[],i=e.keys;return i?(yield Promise.all(i.map((e=>{var t;const i=null===(t=e.keyId)||void 0===t?void 0:t.keyId,a=e.keyData,l=null==a?void 0:a.keyData,_=null==l?null:(0,c.toSyncKeyData)(l);if(!i)return void __LOG__(2)`syncd: received key with missing keyID from device ${n}`;const h=(0,c.toSyncKeyId)(i),g=(0,s.syncKeyIdToHex)(h);if(__LOG__(2)`syncd: received key share key id ${g} from device ${n} ${null!=l?"with":"without"} keyData`,6!==i.byteLength)return(0,d.uploadFatalErrorMetric)(p.default.MD_SYNCD_FATAL_ERROR_CODE.INVALID_KEY_SHARE_KEY_ID,null),__LOG__(4,void 0,new Error,!0)`syncd: fatal error: key share key id has invalid bytelength of ${i.byteLength}`,SEND_LOGS(`syncd: fatal error: key share key id has invalid bytelength of ${i.byteLength}`),(0,f.handleFatalError)();if(a){var m,y,E;const e=a.timestamp,t=null===(m=a.fingerprint)||void 0===m?void 0:m.currentIndex,n=null===(y=a.fingerprint)||void 0===y?void 0:y.rawId,i=null===(E=a.fingerprint)||void 0===E?void 0:E.deviceIndexes;if(!_||null==e||null==t||null==n||!i)return(0,d.uploadFatalErrorMetric)(p.default.MD_SYNCD_FATAL_ERROR_CODE.INVALID_KEY_SHARE_KEY_DATA,null),__LOG__(4,void 0,new Error,!0)`syncd: fatal error: invalid key share key data`,SEND_LOGS("syncd: fatal error: invalid key share key data"),(0,f.handleFatalError)();const s={keyId:h,keyEpoch:(0,u.getKeyEpoch)(h),keyData:_,timestamp:(0,o.numberOrThrowIfTooLarge)(e),fingerprint:{rawId:n,currentIndex:t,deviceIndexes:i}};r.push({keyId:h,fullKey:s})}else r.push({keyId:h,fullKey:null})}))),(0,l.handleKeyShare)((0,a.interpretAsDeviceId)(n),r)):Promise.resolve()}));return function(){return e.apply(this,arguments)}}()},456794:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getPeerDevices=function(){return l.apply(this,arguments)};var i=r(n(348926)),a=n(866729),o=n(459857),s=n(669050);function l(){return(l=(0,i.default)((function*(){const e=[],t=(0,o.assertGetMe)();try{(yield(0,a.getMyDeviceList)()).devices.forEach((n=>{n.id!==t.getDeviceId()&&e.push((0,s.createDeviceWidFromUserAndDevice)(t.user,t.server,n.id))}))}catch(e){return __LOG__(3,void 0,void 0,!0)`syncd: getPeerDevices: error ${e}. Future key requests will only be sent to primary device.`,SEND_LOGS(e.toString()),[(0,s.createDeviceWidFromUserAndDevice)(t.user,t.server,0)]}return e}))).apply(this,arguments)}},491192:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.sendAppStateSyncKeyRequest=function(){return f.apply(this,arguments)};var i=r(n(348926)),a=n(284642),o=n(682661),s=n(118487),l=r(n(565754)),u=n(635881),c=n(459857),d=r(n(571834)),p=n(456794),_=n(398384);function f(){return(f=(0,i.default)((function*(e){const t=yield(0,p.getPeerDevices)(),n={keyIds:e.map((e=>({keyId:(0,o.fromSyncKeyId)(e)})))},r=t.map((e=>({id:new l.default({fromMe:!0,remote:(0,c.assertGetMeUser)(),id:l.default.newId()}),to:e,type:"protocol",subtype:"app_state_sync_key_request",appStateSyncKeyRequest:n}))),i=t.map((e=>e.getDeviceId())),f=e.map((e=>(0,a.syncKeyIdToHex)(e)));return __LOG__(2)`syncd: send key request key id ${f} to peer deviceIds ${i}`,yield(0,s.storePeerMessages)(r),yield Promise.all(r.map(u.encryptAndSendKeyMsg)),(0,_.logCriticalBootstrapStageIfNecessary)(d.default.BOOTSTRAP_APP_STATE_DATA_STAGE_CODE.MISSING_KEYS_REQUESTED),i}))).apply(this,arguments)}},729587:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.sendAppStateSyncKeyShare=function(){return p.apply(this,arguments)};var i=r(n(348926)),a=n(284642),o=n(682661),s=n(118487),l=r(n(565754)),u=n(635881),c=n(459857),d=n(456794);function p(){return(p=(0,i.default)((function*(e){let t,n;if("key_rotation"===e.type?(t=_(e.keys),n=yield(0,d.getPeerDevices)()):"missing_key"===e.type&&(t=_(e.keys,e.orphanKeys),n=[e.peerDeviceId]),null==n)return Promise.resolve();const r=n,i=r.map((e=>({id:new l.default({fromMe:!0,remote:(0,c.assertGetMeUser)(),id:l.default.newId()}),to:e,type:"protocol",subtype:"app_state_sync_key_share",appStateSyncKeyShare:t}))),o=r.map((e=>e.getDeviceId())),p=e.keys.map((e=>(0,a.syncKeyIdToHex)(e.keyId)));__LOG__(2)`syncd: send key share key id ${p} to peer deviceIds ${o} due to ${e.type}`,yield(0,s.storePeerMessages)(i),yield Promise.all(i.map(u.encryptAndSendKeyMsg))}))).apply(this,arguments)}function _(e,t){let n=e.map((e=>({keyId:{keyId:(0,o.fromSyncKeyId)(e.keyId)},keyData:{keyData:(0,o.fromSyncKeyData)(e.keyData),fingerprint:{rawId:e.fingerprint.rawId,currentIndex:e.fingerprint.currentIndex,deviceIndexes:e.fingerprint.deviceIndexes},timestamp:e.timestamp}})));if(t){const e=t.map((e=>({keyId:{keyId:(0,o.fromSyncKeyId)(e)},keyData:void 0})));n=n.concat(e)}return{keys:n}}},387159:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleFatalError=function(){return p.apply(this,arguments)};var i=r(n(348926)),a=n(583159),o=(n(155172),n(287461)),s=n(359987),l=n(780549),u=n(332108),c=n(413309),d=n(589719);function p(){return(p=(0,i.default)((function*(e){__LOG__(2)`syncd: starting fatal flow for ${e}`;const t=(0,o.getABPropConfigValue)("should_deregister_on_syncd_fatal"),r=n(775410).default;let i=[];null!=e&&(i=e.map((e=>String(e)))),yield(0,a.asyncSleep)(5e3),__LOG__(2)`syncd: start notifying primary on fatal error`;try{yield(0,c.sendAppStateFatalExceptionNotification)(i)}catch(e){__LOG__(4,void 0,new Error,!0)`syncd: error when sending fatal message to primary: ${e}`,SEND_LOGS("syncd: could not send fatal to primary")}__LOG__(2)`syncd: end notifying primary on fatal error`,!1!==t?(__LOG__(4,!0,new Error)`syncd: Received fatal error and logged out`,(0,s.frontendFireAndForget)("socketLogout",{forcePost:!1,reason:u.LogoutReason.SyncdFailure})):r.isSyncDCriticalDataSyncInProcess()?(__LOG__(4,!0,new Error,!0)`syncd: critical sync failed during bootstrap`,SEND_LOGS("syncd: critical sync failed during bootstrap"),(0,s.frontendFireAndForget)("socketLogout",{forcePost:!1,reason:u.LogoutReason.SyncdErrorDuringBootstrap})):(__LOG__(4,!0,new Error)`syncd: Received fatal error and showed fatal flag`,(0,d.updateSyncdDisabledDueToFatalFlag)(!0),l.Cmd.handleFatalError())}))).apply(this,arguments)}},413309:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.sendAppStateFatalExceptionNotification=function(){return d.apply(this,arguments)};var i=r(n(348926)),a=n(990445),o=n(118487),s=r(n(565754)),l=n(635881),u=n(459857),c=n(669050);function d(){return(d=(0,i.default)((function*(e){const t={collectionNames:e,timestamp:(0,a.unixTimeMs)()},n={id:new s.default({fromMe:!0,remote:(0,u.getMeUser)(),id:s.default.newId()}),to:(0,c.createDeviceWidFromUserAndDevice)((0,u.assertGetMe)().user,(0,u.assertGetMe)().server,0),type:"protocol",subtype:"app_state_fatal_exception_notification",appStateFatalExceptionNotification:t};return yield(0,o.storePeerMessages)([n]),(0,l.encryptAndSendKeyMsg)(n)}))).apply(this,arguments)}},475222:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.sendSyncdKeyRotation=t.sendSyncdKeyRequest=t.getDeviceFingerprint=void 0;var i=r(n(348926)),a=n(866729),o=n(491192),s=n(729587);const l=function(){var e=(0,i.default)((function*(){const{currentIndex:e,devices:t,rawId:n}=yield(0,a.getMyDeviceList)();if(null==e)throw new Error("syncd: missing current index for own device");return{currentIndex:e,deviceIndexes:t.map((e=>e.keyIndex)),rawId:n}}));return function(){return e.apply(this,arguments)}}();t.getDeviceFingerprint=l;const u=o.sendAppStateSyncKeyRequest;t.sendSyncdKeyRequest=u;t.sendSyncdKeyRotation=e=>(0,s.sendAppStateSyncKeyShare)({type:"key_rotation",keys:e})},403509:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.uploadSyncExternalPatch=t.downloadSyncBlob=void 0;var a=i(n(81109)),o=i(n(348926)),s=n(417405),l=n(958177),u=n(941555),c=n(263958),d=n(22383),p=i(n(92577)),_=i(n(571834));t.uploadSyncExternalPatch=e=>p.default.encryptAndUpload({blob:e,signal:(new r).signal,type:"md-app-state",uploadOrigin:_.default.UPLOAD_ORIGIN_TYPE.UNKNOWN,userUploadAttemptCount:0,forwardedFromWeb:!1,isViewOnce:!1}).then((e=>{let{mediaKey:t,directPath:n,encFilehash:r,handle:i}=e;if(null==i)throw new Error("Missing handle after uploading external patch to mms4");return{mediaKey:(0,s.decodeB64)(t),directPath:n,encFilehash:(0,s.decodeB64)(r),handle:i}}));const f=function(){var e=(0,o.default)((function*(e,t,n){const{mediaKey:i,directPath:o,fileSha256:p,fileEncSha256:f}=e,h={directPath:o,encFilehash:(0,s.encodeB64)(f),filehash:(0,s.encodeB64)(p),mediaKey:(0,s.encodeB64)(i),type:"md-app-state",userDownloadAttemptCount:0};try{return yield u.downloadManager.downloadAndDecrypt((0,a.default)({signal:(new r).signal},h))}catch(r){if(__LOG__(2)`syncd: error downloading ${t} of expected size ${e.fileSizeBytes} with expected hash b64 length of ${(0,s.encodeB64)(e.fileEncSha256).length} for collection ${n}`,r instanceof c.MediaNotFoundError)throw(0,d.uploadFatalErrorMetric)("patch"===t?_.default.MD_SYNCD_FATAL_ERROR_CODE.EXTERNAL_PATCH_EXPIRED:_.default.MD_SYNCD_FATAL_ERROR_CODE.SNAPSHOT_EXPIRED,n),new l.SyncdFatalError("external patch expired");throw r}}));return function(){return e.apply(this,arguments)}}();t.downloadSyncBlob=f},924439:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.initialize=function(){if((0,u.isSyncdDisabled)())return Promise.resolve();return function(){const e=(0,o.default)(s.reportWam,6e4,{maxWait:18e4});c.Cmd.on(c.APP_STATE_SYNC_COMPLETED,e)}(),m(),(0,s.initializeStateMachine)()},t.lockForSync=function(e,t,n){const r=(0,_.getStorage)().lock([...e,...g],(e=>Promise.all([h.default.appendPendingMutationsRows(t),n(e)]))).then((()=>{const e=t.map((e=>e.collection));(0,s.markCollectionsForSync)(e)}));return Promise.resolve(r)},t.sanitizeActionInSyncActionsRow=m;var i=r(n(81109)),a=r(n(348926)),o=r(n(23279)),s=n(279385),l=n(155172),u=n(28900),c=n(780549),d=r(n(797137)),p=n(76469),_=n(605316),f=n(673168),h=r(n(543465));const g=["pending-mutations"];function m(){return y.apply(this,arguments)}function y(){return(y=(0,a.default)((function*(){if(!(yield(0,f.getMdSyncActionsActionSanitized)())){__LOG__(2)`syncd: sanitizing null 'action' property in sync-actions table`;const e=(yield(0,p.getSyncActionsTable)().all()).filter((e=>null==e.action)).map((e=>{const t=JSON.parse(e.index)[0];return l.Actions.cast(t)?(0,i.default)((0,i.default)({},e),{},{action:t}):(__LOG__(2)`syncd: invalid action ${t}`,(0,i.default)({},e))}));yield h.default.updateSyncActionRows(e),yield(0,f.setMdSyncActionsActionSanitized)(!0)}}))).apply(this,arguments)}(0,d.default)().then((()=>{(0,u.isSyncdDisabled)()||(0,s.processOnAppResume)()}))},589719:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.updateSyncdDisabledDueToFatalFlag=function(e){(0,i.default)(a.default,"localStorage").setItem(o.KEYS.SYNCD_DISABLED_DUE_TO_FATAL,e.toString())};var i=r(n(132375)),a=r(n(174285)),o=n(94872)},971277:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.SyncdQPL=void 0;var i=r(n(81109)),a=n(819416),o=n(15842),s=n(637463),l=n(316348),u=n(555622);const c=["source"];function d(e){if(null==(null==e?void 0:e.string))return;const t=e.string,n={};Object.keys(e.string).forEach((e=>{c.includes(e)||(n[e]=t[e])})),e.string=n}t.SyncdQPL=class{constructor(){this._when=n(775410).default.isSyncDBootstrapInProcess()?"bootstrap":n(359484).OfflineMessageHandler.isResumeFromRestartComplete()?"online":"offline_resume",this._loggingEnabled=(0,a.getConfig)().syncdQPLLoggingEnabled()&&("bootstrap"===this._when||"offline_resume"===this._when),this._loggingEnabled&&(this._instanceKey=u.QPL.getNextMarkerInstanceValue(l.QuickLogMarkerId.SYNCD))}_validate(){if(!this._loggingEnabled)return!1;if(!this._started)throw new Error("QPL instance ${this._instanceKey} is not started");return!0}start(){this._loggingEnabled&&(u.QPL.markerStart(l.QuickLogMarkerId.SYNCD,{instanceKey:this._instanceKey}),this._started=!0,this.annotate({when:this._when}))}annotate(e){if(!this._validate())return;const t=(0,s.constructAnnotationsFromContext)(e);d(t),t&&u.QPL.markerAnnotate(l.QuickLogMarkerId.SYNCD,t,{instanceKey:this._instanceKey})}mark(e,t){if(!this._validate())return;const n=(0,s.constructAnnotationsFromContext)(t);this._markInternal(e,n)}markAnnotations(e,t){this._validate()&&this._markInternal(e,t)}_markInternal(e,t){const n=function(e,t){var n;if(null==(null==t||null===(n=t.string)||void 0===n?void 0:n.source))return e;const r=t.string;return[Object.keys(r).filter((e=>c.includes(e))).map((e=>r[e])),e].join("_")}(e,t);d(t),u.QPL.markerPoint(l.QuickLogMarkerId.SYNCD,n,(0,i.default)((0,i.default)({},t&&{data:t}),{},{instanceKey:this._instanceKey}))}end(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._validate()&&(this._started=!1,u.QPL.markerEnd(l.QuickLogMarkerId.SYNCD,e?o.QuickLogActionType.FAIL:o.QuickLogActionType.SUCCESS,{instanceKey:this._instanceKey}))}}},46167:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.collectionNameToMetric=u,t.constructMsgKeySegments=function(e){return s(e.id)},t.constructStarMsgKeyFromMsgKey=function(e){return(0,i.buildIndex)(a.Actions.Star,s(e))},t.extractParticipantForSync=l,t.uploadCriticalEventMetric=function(e,t){const n=new o.default.MdCriticalEvent({mdCriticalEventCode:e});null!=t&&(n.collection=u(t));n.commit()};var i=n(797666),a=n(155172),o=r(n(571834));function s(e){const t=l(e);return[e.remote.toString({legacy:!0}),e.id,e.fromMe?"1":"0",t]}function l(e){let t="0";return!e.participant||e.remote.isUser()||e.fromMe||(t=e.participant.toString({legacy:!0})),t}function u(e){switch(e){case a.CollectionName.CriticalBlock:return o.default.COLLECTION.CRITICAL_BLOCK;case a.CollectionName.CriticalUnblockLow:return o.default.COLLECTION.CRITICAL_UNBLOCK_LOW;case a.CollectionName.Regular:return o.default.COLLECTION.REGULAR;case a.CollectionName.RegularHigh:return o.default.COLLECTION.REGULAR_HIGH;case a.CollectionName.RegularLow:return o.default.COLLECTION.REGULAR_LOW}}},162371:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.genCurrentSessionId=function(){return p.apply(this,arguments)},t.genSessionId=_;var i=r(n(348926)),a=n(551168),o=n(638778),s=r(n(132375)),l=n(403206),u=n(999821),c=r(n(9705)),d=n(459857);function p(){return(p=(0,i.default)((function*(){const e=(0,u.createSignalAddress)((0,d.getMeUser)()).toString(),t=(0,s.default)(yield c.default.loadIdentityKey(e),"yield PersistSignalProtocolStore.loadIdentityKey(primaryDeviceIdentifier)"),n=(0,l.toCurveKeyPubKey)((0,u.strToBuffer)(t)),r=(0,s.default)(yield c.default.getIdentityKeyPair(),"yield SignalProtocolStore.getIdentityKeyPair()");return _(n,(0,l.toCurveKeyPubKey)(r.pubKey))}))).apply(this,arguments)}function _(){return f.apply(this,arguments)}function f(){return(f=(0,i.default)((function*(e,t){if(32!==e.byteLength)throw new Error(`genSessionId: primary identity public key is ${e.byteLength} bytes, should be 32!`);if(32!==t.byteLength)throw new Error(`genSessionId: companion identity public key is ${e.byteLength} bytes, should be 32!`);const n=new a.Binary;n.writeBuffer(e),n.write("_".charCodeAt(0)),n.writeBuffer(t);const r=n.readByteArray();return yield(0,o.sha256Base64)(r)}))).apply(this,arguments)}},366891:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.STORAGE_QUOTA_UNAVAILABLE=t.MdSyncFieldStatsMeta=void 0;var i=r(n(348926)),a=r(n(495976)),o=n(162371);t.STORAGE_QUOTA_UNAVAILABLE=-1;const s=new class{constructor(){this._storageEstimation={mdStorageQuotaBytes:-2,mdStorageQuotaUsedBytes:-2},this._mdSessionId=null}getStorageEstimation(){var e=this;return(0,i.default)((function*(){if(-2!==e._storageEstimation.mdStorageQuotaBytes)return Promise.resolve(e._storageEstimation);const t=yield(0,a.default)();return e._storageEstimation={mdStorageQuotaBytes:t?t.quota:-1,mdStorageQuotaUsedBytes:t?t.usage:-1},e._storageEstimation}))()}getMdSessionId(){var e=this;return(0,i.default)((function*(){return null!=e._mdSessionId||(e._mdSessionId=yield(0,o.genCurrentSessionId)()),e._mdSessionId}))()}};t.MdSyncFieldStatsMeta=s},22383:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.uploadFatalErrorMetric=function(){return g.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(370625),s=r(n(157926)),l=(n(155172),n(990445)),u=n(287461),c=n(516934),d=n(673168),p=r(n(571834)),_=n(46167),f=n(309512);const h=(0,l.unixTime)();function g(){return(g=(0,a.default)((function*(e,t,r,a,g){const m=n(775410).default;let y={mdFatalErrorCode:e,collection:t?(0,_.collectionNameToMetric)(t):void 0,isBootstrap:m.isSyncDCriticalDataSyncInProcess()};if((0,u.getABPropConfigValue)("md_app_state_gate_D34336913")){const e=(0,d.getPairingTimestamp)(),t=null!=e?1e3*((0,l.unixTime)()-e):void 0;y=(0,i.default)((0,i.default)({},y),{},{timeSinceRefreshMs:1e3*((0,l.unixTime)()-h),timeSincePairingMs:t,patchSnapshotMutationCount:r,patchVersion:a,isFatal:g})}if((0,u.getABPropConfigValue)("web_syncd_fatal_fields_from_L1104589PRV2")){const e=yield(0,d.getRecentMailboxAgeDays)(),t=yield(0,d.getLastPeriodicAppStateSyncTs)(),n=s.default.getCollectionMinFailureTime();y=(0,i.default)((0,i.default)({},y),{},{mailboxAgeDays:null==e?void 0:e,daysSinceLastPeriodicSync:null==t?void 0:Math.trunc(((0,l.unixTime)()-t)/60/60/24),hoursSinceFirstFiniteFailure:null==n?void 0:Math.trunc(((0,l.unixTimeMs)()-n)/1e3/60/60)});const r=yield(0,c.getTable)().get('["primary_version","current"]'),a=yield(0,c.getTable)().get('["primary_version","session_start"]');if(r||a){var E,S,T,v;const e=(0,f.decodeProtobuf)(o.SyncActionDataSpec,null==r?void 0:r.binarySyncData).value,t=(0,f.decodeProtobuf)(o.SyncActionDataSpec,null==a?void 0:a.binarySyncData).value;y=(0,i.default)((0,i.default)({},y),{},{currentPrimaryAppVersion:null!==(E=null==e||null===(S=e.primaryVersionAction)||void 0===S?void 0:S.version)&&void 0!==E?E:void 0,sessionStartPrimaryAppVersion:null!==(T=null==t||null===(v=t.primaryVersionAction)||void 0===v?void 0:v.version)&&void 0!==T?T:void 0})}}new p.default.MdFatalError(y).commit(!0)}))).apply(this,arguments)}},830389:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.convertToBucket=function(e){if(e<0)throw new Error("cannot convert negative number to a bucket");return 0===e?s.default.MUTATION_COUNT_BUCKET.ZERO:1===e?s.default.MUTATION_COUNT_BUCKET.ONE:e<10?s.default.MUTATION_COUNT_BUCKET.LT10:e<100?s.default.MUTATION_COUNT_BUCKET.LT100:e<500?s.default.MUTATION_COUNT_BUCKET.LT500:e<1e3?s.default.MUTATION_COUNT_BUCKET.LT1K:e<5e3?s.default.MUTATION_COUNT_BUCKET.LT5K:s.default.MUTATION_COUNT_BUCKET.GTE5K},t.generateActionStatCounts=function(){return l.apply(this,arguments)};var i=r(n(348926)),a=n(155172),o=n(516934),s=r(n(571834));function l(){return(l=(0,i.default)((function*(){const e=new Map;return(yield(0,o.getTable)().all()).map((t=>{var n;const r=JSON.parse(t.index)[0],i=null!==(n=e.get(r))&&void 0!==n?n:{action:r,applied:0,invalid:0,orphan:0,unsupported:0,failed:0};switch(t.actionState){case a.SyncActionState.Success:case a.SyncActionState.Skipped:i.applied++;break;case a.SyncActionState.Malformed:i.invalid++;break;case a.SyncActionState.Orphan:i.orphan++;break;case a.SyncActionState.Unsupported:i.unsupported++;break;case a.SyncActionState.Failed:i.failed++}e.set(r,i)})),e}))).apply(this,arguments)}},374740:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.maybeMillisecondsToSeconds=function(e){let t=e;try{(0,r.numberOrThrowIfTooLarge)(e)/(0,i.unixTime)()>10?(t=(0,r.numberOrThrowIfTooLarge)(e)/1e3,__LOG__(2)`syncd: maybeMillisecondsToSeconds: adjusting future timestamp`):__LOG__(2)`syncd: maybeMillisecondsToSeconds: no need to adjust timestamp`}catch(t){__LOG__(3)`syncd: maybeMillisecondsToSeconds: messageTimestamp: ${e} too large to cast`}return t};var r=n(478337),i=n(990445)},254665:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkAndRemoveActiveMessageRanges=function(e,t){(0,i.getActiveMessageRanges)(e.remote.toString()).then((n=>{n.forEach((n=>{if([o.ActiveRangeAction.Archive,o.ActiveRangeAction.MarkChatAsRead].includes(n.action)&&l(n.actionValue.messageRange,{id:e,t})===a.RangeContain.DOES_NOT_CONTAIN)return(0,i.removeActiveMessageRange)(e.remote.toString(),n.action)}))}))},t.rangeContainsMessage=l;var r=n(478337),i=n(133331),a=n(989),o=n(574017),s=n(374740);function l(e,t){if(null==e)return __LOG__(3)`syncd: missing message range from row.`,a.RangeContain.DOES_NOT_CONTAIN;const{messages:n,lastMessageTimestamp:i}=e,o=(0,s.maybeMillisecondsToSeconds)(null!=i?i:0);if(o!==(null!=i?i:0)&&(__LOG__(2,void 0,void 0,!0)`syncd: last message timestamp was converted to seconds from ${i}`,SEND_LOGS("syncd: last message timestamp was converted to seconds",.1)),null!=t.t&&t.t<(0,r.numberOrThrowIfTooLarge)(o))return a.RangeContain.CONTAINS_BY_TIMESTAMP;const l=t.id;for(const{key:e}of n)if(null!=e&&null!=l&&e.id===l.id)return a.RangeContain.CONTAINS_BY_ADDITIONAL;return a.RangeContain.DOES_NOT_CONTAIN}},641473:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleForActiveMessageRange=A,t.handleOfflineForMessageRange=function(){return P.apply(this,arguments)};var i=r(n(348926)),a=n(370625),o=n(254665),s=n(133331),l=n(989),u=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=g(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(939378)),c=n(373070),d=n(574017),p=n(669050),_=r(n(543465)),f=n(46167),h=n(309512);function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(g=function(e){return e?n:t})(e)}const m=new Set,y=e=>e.reduce(((e,t)=>new Set([...Array.from(e),...Array.from(t)])),new Set);function E(){return S.apply(this,arguments)}function S(){return(S=(0,i.default)((function*(e,t,n){let r=null;switch(e.action){case d.ActiveRangeAction.Archive:return e.actionValue.archived?yield u.handleForArchive(e,n):yield u.handleForUnarchive(e,n),m;case d.ActiveRangeAction.MarkChatAsRead:return yield u.handleForMarkAsReadUnread(e,n,!!e.actionValue.read),m;case d.ActiveRangeAction.ClearChatDeleteStarredDeleteMedia:case d.ActiveRangeAction.ClearChatDeleteStarredKeepMedia:return r=u.handleForClearChat(e,n),r?new Set([r]):m;case d.ActiveRangeAction.ClearChatKeepStarredDeleteMedia:case d.ActiveRangeAction.ClearChatKeepStarredKeepMedia:return(yield T(t.id))?m:(r=u.handleForClearChat(e,n),r?new Set([r]):m);case d.ActiveRangeAction.DeleteChatDeleteMedia:case d.ActiveRangeAction.DeleteChatKeepMedia:return r=u.handleForDeleteChat(e,n),r?new Set([r]):m}return __LOG__(3)`handleMessageContainment called with unknwon message range action action: ${e.action}`,m}))).apply(this,arguments)}function T(){return v.apply(this,arguments)}function v(){return(v=(0,i.default)((function*(e){const t=(0,f.constructStarMsgKeyFromMsgKey)(e),n=yield _.default.getSyncAction(t);if(n){var r;const e=(0,h.decodeProtobuf)(a.SyncActionDataSpec,n.binarySyncData).value;return(null==e||null===(r=e.starAction)||void 0===r?void 0:r.starred)||!1}return!1}))).apply(this,arguments)}function A(){return C.apply(this,arguments)}function C(){return(C=(0,i.default)((function*(e,t){if(c.SYSTEM_MESSAGE_TYPES.includes(t.type))return m;const n=(yield(0,s.getActiveMessageRanges)(e.toString())).map((e=>[e,(0,o.rangeContainsMessage)(e.actionValue.messageRange,t)])),r=n.filter((e=>{let[,t]=e;return t===l.RangeContain.CONTAINS_BY_ADDITIONAL})).map((e=>{let[t]=e;return t}));r.forEach((e=>{e.remainingMessages--})),yield(0,s.bulkUpdateActiveMessageRanges)(r);const i=n.map((e=>{let[n,r]=e;return E(n,t,r)})),a=yield Promise.all(i);return y(a)}))).apply(this,arguments)}function P(){return(P=(0,i.default)((function*(e){const t=new Map;e.forEach((e=>{if(c.SYSTEM_MESSAGE_TYPES.includes(e.type)||c.ADDON_MESSAGE_TYPES.includes(e.type))return;const n=t.get(e.id.remote.toString());(null==n||n.t<e.t)&&t.set(e.id.remote.toString(),e)})),yield Promise.all(Array.from(t.entries()).map((e=>{let[t,n]=e;return A((0,p.createWid)(t),n)})))}))).apply(this,arguments)}},989:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RangeContain=t.ActiveRangeHandlerAction=void 0;const r=n(76672).Mirrored(["DropMessage","SkipUI"]);t.ActiveRangeHandlerAction=r;const i=n(76672).Mirrored(["DOES_NOT_CONTAIN","CONTAINS_BY_TIMESTAMP","CONTAINS_BY_ADDITIONAL"]);t.RangeContain=i},939378:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleForArchive=function(){return d.apply(this,arguments)},t.handleForClearChat=function(e,t){switch(t){case l.RangeContain.CONTAINS_BY_TIMESTAMP:case l.RangeContain.CONTAINS_BY_ADDITIONAL:return l.ActiveRangeHandlerAction.DropMessage;case l.RangeContain.DOES_NOT_CONTAIN:}},t.handleForDeleteChat=function(e,t){switch(t){case l.RangeContain.CONTAINS_BY_TIMESTAMP:case l.RangeContain.CONTAINS_BY_ADDITIONAL:return l.ActiveRangeHandlerAction.DropMessage;case l.RangeContain.DOES_NOT_CONTAIN:}},t.handleForMarkAsReadUnread=function(){return _.apply(this,arguments)},t.handleForUnarchive=function(){return p.apply(this,arguments)};var i=r(n(348926)),a=n(133331),o=n(359987),s=n(811670),l=n(989),u=n(673168),c=n(669050);function d(){return(d=(0,i.default)((function*(e,t){if(t===l.RangeContain.DOES_NOT_CONTAIN){const t=yield(0,u.getArchiveV2EnabledSetting)(),n=yield(0,u.getUnarchiveChatsSetting)();t&&!n||(0,s.setArchive)([{id:e.chatId,archive:!1}]),yield(0,a.removeActiveMessageRange)(e.chatId,e.action)}}))).apply(this,arguments)}function p(){return(p=(0,i.default)((function*(e,t){t!==l.RangeContain.DOES_NOT_CONTAIN&&0!==e.remainingMessages||(yield(0,a.removeActiveMessageRange)(e.chatId,e.action))}))).apply(this,arguments)}function _(){return(_=(0,i.default)((function*(e,t,n){t===l.RangeContain.DOES_NOT_CONTAIN?yield(0,a.removeActiveMessageRange)(e.chatId,e.action):0===e.remainingMessages&&((0,o.frontendFireAndForget)("updateChatReadStatus",{id:(0,c.createWid)(e.chatId),read:n}),yield(0,a.removeActiveMessageRange)(e.chatId,e.action))}))).apply(this,arguments)}},520857:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.logDailyStats=function(){return v.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(493928),s=n(618396),l=n(469867),u=n(339316),c=r(n(495976)),d=n(719621),p=(n(97858),n(76469)),_=n(955562),f=n(757453),h=n(65410),g=n(459857),m=(n(673168),r(n(571834))),y=n(818674),E=r(n(124928)),S=n(298592);function T(e){const t=e.getEndTime();(e.goldenBoxContactNarrativeAppearCount>0||e.goldenBoxContactDialogAppearCount>0||e.goldenBoxContactDialogSelectCount>0)&&new m.default.PrivacyHighlightDaily({eventTime:t,privacyHighlightCategory:m.default.PRIVACY_HIGHLIGHT_CATEGORY_ENUM.E2EE,privacyHighlightSurface:m.default.PRIVACY_HIGHLIGHT_SURFACE_ENUM.GOLDEN_BOX_CONTACT,narrativeAppearCount:e.goldenBoxContactNarrativeAppearCount,dialogAppearCount:e.goldenBoxContactDialogAppearCount,dialogSelectCount:e.goldenBoxContactDialogSelectCount}).commit(),(e.goldenBoxGroupNarrativeAppearCount>0||e.goldenBoxGroupDialogAppearCount>0||e.goldenBoxGroupDialogSelectCount>0)&&new m.default.PrivacyHighlightDaily({eventTime:t,privacyHighlightCategory:m.default.PRIVACY_HIGHLIGHT_CATEGORY_ENUM.E2EE,privacyHighlightSurface:m.default.PRIVACY_HIGHLIGHT_SURFACE_ENUM.GOLDEN_BOX_GROUP,narrativeAppearCount:e.goldenBoxGroupNarrativeAppearCount,dialogAppearCount:e.goldenBoxGroupDialogAppearCount,dialogSelectCount:e.goldenBoxGroupDialogSelectCount}).commit(),(e.infoScreenContactNarrativeAppearCount>0||e.infoScreenContactDialogAppearCount>0||e.infoScreenContactDialogSelectCount>0)&&new m.default.PrivacyHighlightDaily({eventTime:t,privacyHighlightCategory:m.default.PRIVACY_HIGHLIGHT_CATEGORY_ENUM.E2EE,privacyHighlightSurface:m.default.PRIVACY_HIGHLIGHT_SURFACE_ENUM.INFO_SCREEN_CONTACT,narrativeAppearCount:e.infoScreenContactNarrativeAppearCount,dialogAppearCount:e.infoScreenContactDialogAppearCount,dialogSelectCount:e.infoScreenContactDialogSelectCount}).commit(),(e.infoScreenGroupNarrativeAppearCount>0||e.infoScreenGroupDialogAppearCount>0||e.infoScreenGroupDialogSelectCount>0)&&new m.default.PrivacyHighlightDaily({eventTime:t,privacyHighlightCategory:m.default.PRIVACY_HIGHLIGHT_CATEGORY_ENUM.E2EE,privacyHighlightSurface:m.default.PRIVACY_HIGHLIGHT_SURFACE_ENUM.INFO_SCREEN_GROUP,narrativeAppearCount:e.infoScreenGroupNarrativeAppearCount,dialogAppearCount:e.infoScreenGroupDialogAppearCount,dialogSelectCount:e.infoScreenGroupDialogSelectCount}).commit(),(e.chatsListNarrativeAppearCount>0||e.chatsListDialogAppearCount>0||e.chatsListDialogSelectCount>0)&&new m.default.PrivacyHighlightDaily({eventTime:t,privacyHighlightCategory:m.default.PRIVACY_HIGHLIGHT_CATEGORY_ENUM.E2EE,privacyHighlightSurface:m.default.PRIVACY_HIGHLIGHT_SURFACE_ENUM.CHATS_LIST,narrativeAppearCount:e.chatsListNarrativeAppearCount,dialogAppearCount:e.chatsListDialogAppearCount,dialogSelectCount:e.chatsListDialogSelectCount}).commit(),(e.statusListNarrativeAppearCount>0||e.statusListDialogAppearCount>0||e.statusListDialogSelectCount>0)&&new m.default.PrivacyHighlightDaily({eventTime:t,privacyHighlightCategory:m.default.PRIVACY_HIGHLIGHT_CATEGORY_ENUM.E2EE,privacyHighlightSurface:m.default.PRIVACY_HIGHLIGHT_SURFACE_ENUM.STATUS_LIST,narrativeAppearCount:e.statusListNarrativeAppearCount,dialogAppearCount:e.statusListDialogAppearCount,dialogSelectCount:e.statusListDialogSelectCount}).commit(),(e.callingScreenAudioNarrativeAppearCount>0||e.callingScreenAudioDialogAppearCount>0||e.callingScreenAudioDialogSelectCount>0)&&new m.default.PrivacyHighlightDaily({eventTime:t,privacyHighlightCategory:m.default.PRIVACY_HIGHLIGHT_CATEGORY_ENUM.E2EE,privacyHighlightSurface:m.default.PRIVACY_HIGHLIGHT_SURFACE_ENUM.CALLING_SCREEN_AUDIO,narrativeAppearCount:e.callingScreenAudioNarrativeAppearCount,dialogAppearCount:e.callingScreenAudioDialogAppearCount,dialogSelectCount:e.callingScreenAudioDialogSelectCount}).commit()}function v(){return(v=(0,a.default)((function*(){const e=A(),t=yield C(),n=yield M(),r=yield R(),a=N(),o=(0,i.default)((0,i.default)((0,i.default)((0,i.default)({},e),t),n),a),s=new m.default.Daily;s.set(o),s.commit();const u=new m.default.WebcFtsStorage;u.set({ftsTotalSize:r}),u.commit();const c=new m.default.ScreenLockSettings,d=void 0;c.commit(),(0,y.logDailyPrivateStatsTestEvents)();const p=l.DailyAggregatedStatsCollection.toArray().filter((e=>e.shouldBeSubmitted()));l.DailyAggregatedStatsCollection.remove(p),p.forEach((e=>{new m.default.PttDaily({eventTime:e.getEndTime(),pttCancelBroadcast:e.pttCancelBroadcast,pttCancelGroup:e.pttCancelGroup,pttCancelIndividual:e.pttCancelIndividual,pttDraftReviewBroadcast:e.pttDraftReviewBroadcast,pttDraftReviewGroup:e.pttDraftReviewGroup,pttDraftReviewIndividual:e.pttDraftReviewIndividual,pttFastplaybackBroadcast:e.pttFastplaybackBroadcast,pttFastplaybackGroup:e.pttFastplaybackGroup,pttFastplaybackIndividual:e.pttFastplaybackIndividual,pttLockBroadcast:e.pttLockBroadcast,pttLockGroup:e.pttLockGroup,pttLockIndividual:e.pttLockIndividual,pttOutOfChatBroadcast:e.pttOutOfChatBroadcast,pttOutOfChatGroup:e.pttOutOfChatGroup,pttOutOfChatIndividual:e.pttOutOfChatIndividual,pttPlaybackBroadcast:e.pttPlaybackBroadcast,pttPlaybackGroup:e.pttPlaybackGroup,pttPlaybackIndividual:e.pttPlaybackIndividual,pttRecordBroadcast:e.pttRecordBroadcast,pttRecordGroup:e.pttRecordGroup,pttRecordIndividual:e.pttRecordIndividual,pttSendBroadcast:e.pttSendBroadcast,pttSendGroup:e.pttSendGroup,pttSendIndividual:e.pttSendIndividual,pttPausedRecordBroadcast:e.pttPausedRecordBroadcast,pttPausedRecordGroup:e.pttPausedRecordGroup,pttPausedRecordIndividual:e.pttPausedRecordIndividual,pttStopTapBroadcast:e.pttStopTapBroadcast,pttStopTapGroup:e.pttStopTapGroup,pttStopTapIndividual:e.pttStopTapIndividual}).commit(),T(e),new m.default.CommunityTabAction({communityTabGroupNavigations:e.communityTabGroupNavigations,communityTabToHomeViews:e.communityTabToHomeViews,communityTabViews:e.communityTabViews}).commit(),null!=e.communityHome&&Object.keys(e.communityHome).forEach((t=>{const n=E.default.user(t);if(null==n)return;const{communityHomeGroupDiscoveries:r,communityHomeGroupJoins:i,communityHomeGroupNavigations:a,communityHomeViews:o}=e.communityHome[t];new m.default.CommunityHomeAction({communityHomeId:n,communityHomeGroupDiscoveries:r,communityHomeGroupJoins:i,communityHomeGroupNavigations:a,communityHomeViews:o}).commit()})),null!=e.pnhCagActions&&Object.keys(e.pnhCagActions).forEach((t=>{const{pnhIndicatorClicksChat:n,pnhIndicatorClicksInfoScreen:r,reactionDeleteCount:i,reactionOpenTrayCount:a}=e.pnhCagActions[t];new m.default.PnhDaily({communityId:t,pnhIndicatorClicksChat:n,pnhIndicatorClicksInfoScreen:r,reactionDeleteCount:i,reactionOpenTrayCount:a,typeOfGroup:m.default.TYPE_OF_GROUP_ENUM.DEFAULT_SUBGROUP}).commit()})),new m.default.KeepInChatNotif({eventTime:e.getEndTime(),kicGroupNotificationTaps:e.kicGroupNotificationTaps,kicGroupNotifications:e.kicGroupNotifications,kicNotificationTaps:e.kicNotificationTaps,kicNotifications:e.kicNotifications}).commit()}))}))).apply(this,arguments)}function A(){const e=h.deviceInfo.get();return{languageCode:e.lg,locationCode:e.lc,osBuildNumber:e.osBuild,simMcc:parseInt(e.mcc,10),simMnc:parseInt(e.mnc,10)}}function C(){return P.apply(this,arguments)}function P(){return(P=(0,a.default)((function*(){var e,t,n,r;const i=(0,f.getUserPrivacySettings)(),a={receiptsEnabled:"none"!==i.readReceipts},l=yield(0,s.queryDisallowedLists)();if(a.privacySettingsAbout=O(i.about),a.privacySettingsAboutExceptNum="contact_blacklist"===i.about?I(null===(e=l.status)||void 0===e?void 0:e.disallowedList.length):null,a.privacySettingsGroups=O(i.groupAdd),a.privacySettingsGroupsExceptNum="contact_blacklist"===i.groupAdd?I(null===(t=l.groupadd)||void 0===t?void 0:t.disallowedList.length):null,a.privacySettingsLastSeen=O(i.lastSeen),a.privacySettingsLastSeenExceptNum="contact_blacklist"===i.lastSeen?I(null===(n=l.last)||void 0===n?void 0:n.disallowedList.length):null,a.privacySettingsProfilePhoto=O(i.profilePicture),a.privacySettingsProfilePhotoExceptNum="contact_blacklist"===i.profilePicture?I(null===(r=l.profile)||void 0===r?void 0:r.disallowedList.length):null,(0,o.isDisappearingModeEnabled)()){var u;const e=(0,g.getMaybeMeUser)(),t=(0,S.getDisappearingModeSettingForUser)(e);a.defaultDisappearingDuration=null!==(u=null==t?void 0:t.duration)&&void 0!==u?u:0}return a}))).apply(this,arguments)}function O(e){if(null==e)return null;switch(e){case"all":return m.default.PRIVACY_SETTINGS_VALUE_TYPE.EVERYONE;case"contacts":return m.default.PRIVACY_SETTINGS_VALUE_TYPE.MY_CONTACTS;case"contact_blacklist":return m.default.PRIVACY_SETTINGS_VALUE_TYPE.MY_CONTACTS_EXCEPT;case"none":return m.default.PRIVACY_SETTINGS_VALUE_TYPE.NOBODY}}function I(e){return null==e?null:0===e?m.default.PRIVACY_SETTINGS_CONTACTS_BUCKETS.B0:e<5?m.default.PRIVACY_SETTINGS_CONTACTS_BUCKETS.B1:e<10?m.default.PRIVACY_SETTINGS_CONTACTS_BUCKETS.B5:e<15?m.default.PRIVACY_SETTINGS_CONTACTS_BUCKETS.B10:e<20?m.default.PRIVACY_SETTINGS_CONTACTS_BUCKETS.B15:e<30?m.default.PRIVACY_SETTINGS_CONTACTS_BUCKETS.B20:e<40?m.default.PRIVACY_SETTINGS_CONTACTS_BUCKETS.B30:e<50?m.default.PRIVACY_SETTINGS_CONTACTS_BUCKETS.B40:e<60?m.default.PRIVACY_SETTINGS_CONTACTS_BUCKETS.B50:e<70?m.default.PRIVACY_SETTINGS_CONTACTS_BUCKETS.B60:e<80?m.default.PRIVACY_SETTINGS_CONTACTS_BUCKETS.B70:e<90?m.default.PRIVACY_SETTINGS_CONTACTS_BUCKETS.B80:e<100?m.default.PRIVACY_SETTINGS_CONTACTS_BUCKETS.B90:m.default.PRIVACY_SETTINGS_CONTACTS_BUCKETS.B100}function M(){return b.apply(this,arguments)}function b(){return(b=(0,a.default)((function*(){const e=yield(0,p.getContactTable)().equals(["isAddressBookContact"],1).then((e=>e.length)),t=yield(0,c.default)(),n=yield d.LruMediaStore.count(),r=yield Promise.all([t,e,n]);let i=0,a=0;const o=r[0];return null!=o&&(i=o.available,a=o.quota),{addressbookWhatsappSize:w(r[1],10),storageAvailSize:w(i,100),storageTotalSize:w(a,100),mediaFolderFileCount:r[2]}}))).apply(this,arguments)}function R(){return(0,u.getEstimatedFTSDbSize)()}function N(){let e=m.default.NOTIFICATION_SETTING_TYPE.UNKNOWN;if(null!=window.Notification)switch(window.Notification.permission){case _.PERMISSION_ALLOWED:e=m.default.NOTIFICATION_SETTING_TYPE.ALLOWED;break;case _.PERMISSION_DENIED:e=m.default.NOTIFICATION_SETTING_TYPE.BLOCKED;break;default:e=m.default.NOTIFICATION_SETTING_TYPE.UNKNOWN}return{osNotificationSetting:e}}function w(e,t){return Math.round(e/t)*t}},702627:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.registerTasks=function(){(0,o.startScheduler)({scheduledTimeResolver:{get:e=>(0,h.getTaskScheduledTime)(String(e)),set:(e,t)=>(0,h.updateTaskScheduledTime)(String(e),t)}}),R.filter((e=>e!==b.LOG_DB_ROW_COUNTS||!1)).forEach((e=>{const t=function(e){switch(e){case b.MONITOR_DB_STORAGE:return function(){var e=(0,i.default)((function*(){return o.DO_NOT_RESCHEDULE}));return function(){return e.apply(this,arguments)}}();case b.CLEAN_TC_TOKENS:return function(){var e=(0,i.default)((function*(e){if(e)__LOG__(2)`CleanTcToken skip first run`;else try{yield(0,d.pruneExpiredTcTokens)(),yield(0,d.pruneExpiredOrphanTcTokens)()}catch(e){__LOG__(4,!0,new Error)`Failed to delete the expired TcTokens with error: ${e}`}return s.DAY_SECONDS}));return function(){return e.apply(this,arguments)}}();case b.LOG_DAILY_STATS:return()=>(0,g.logDailyStatsJob)().catch((e=>{__LOG__(4,!0,new Error)`Failed to log daily stats: ${e}`})).then((()=>s.DAY_SECONDS));case b.LOG_DB_ROW_COUNTS:break;case b.ROTATE_KEY:return function(){var e=(0,i.default)((function*(e){return e?__LOG__(2)`RotateKeyTask skip first run`:yield(0,S.getJobManager)().waitUntilCompleted(E.jobSerializers.rotateKey()),27*s.DAY_SECONDS}));return function(){return e.apply(this,arguments)}}();case b.SYNC_AB_PROPS:return function(){var e=(0,i.default)((function*(e){return e||(yield(0,c.syncABPropsTask)()),(0,u.getRefresh)()}));return function(){return e.apply(this,arguments)}}();case b.SYNC_CONTACTS:return function(){var e=(0,i.default)((function*(e){if(!e){try{yield(0,m.getNonAddressBookContactsAndMarkAllContactsDirty)()}catch(e){__LOG__(4,!0,new Error)`Failed to sync non-address book contacts with error: ${e}`}try{yield(0,I.contactSync)()}catch(e){__LOG__(4,!0,new Error,!0,["non-sad","contact-sync"])`syncContacts: contact sync failed, error: ${e}`,SEND_LOGS("syncContacts: contact sync failed")}}return(0,A.getContactSyncRefreshSeconds)()}));return function(){return e.apply(this,arguments)}}();case b.REPORT_SYNCD_ACTION_STAT:return function(){var e=(0,i.default)((function*(e){return e||(yield(0,C.reportSyncdStatsJob)()),s.DAY_SECONDS}));return function(){return e.apply(this,arguments)}}();case b.LT_HASH_CHECK:return function(){var e=(0,i.default)((function*(e){const t=(0,l.getABPropConfigValue)("lthash_check_hours");return 0===t?24*s.HOUR_SECONDS:(e||(yield(0,a.checkLtHash)()),t*s.HOUR_SECONDS)}));return function(){return e.apply(this,arguments)}}();case b.REQUEST_ALL_SYNCD_MISSING_KEYS:return function(){var e=(0,i.default)((function*(e){return e||(yield(0,P.requestAllSyncdMissingKeysJob)()),6*s.HOUR_SECONDS}));return function(){return e.apply(this,arguments)}}();case b.SYNCD_SYNC_ALL_COLLECTIONS:return function(){var e=(0,i.default)((function*(e){const t=(0,l.getABPropConfigValue)("syncd_periodic_sync_days");return 0===t?(__LOG__(2)`syncd: syncdPeriodicSyncDays is 0, skipping sync`,s.DAY_SECONDS):(e||(yield(0,O.syncdSyncAllCollectionsJob)()),s.DAY_SECONDS*t)}));return function(){return e.apply(this,arguments)}}();case b.CLEAN_ORPHAN_REACTIONS:return(0,i.default)((function*(){try{yield(0,_.pruneExpiredOrphanReactions)()}catch(e){__LOG__(4,!0,new Error)`Failed to delete the expired orphan reactions with error: ${e}`}return s.DAY_SECONDS}));case b.CLEAN_ORPHAN_ADD_ONS:return(0,i.default)((function*(){if(!(0,T.isPollsReceivingEnabled)())return s.DAY_SECONDS;try{yield(0,f.purgeExpiredOrphanRecords)(30,90)}catch(e){__LOG__(4,!0,new Error)`Failed to delete the expired orphan add-on messages with error: ${e}`}return s.DAY_SECONDS}));case b.CLEAN_PAST_PARTICIPANTS:return(0,i.default)((function*(){if(!(0,v.pastParticipantsDbEnabled)())return s.DAY_SECONDS;try{yield(0,p.pruneExpiredPastParticipants)()}catch(e){__LOG__(4,!0,new Error)`Failed to delete the expired orphan reactions with error: ${e}`}return s.DAY_SECONDS}));case b.SEND_REGULAR_WAM_EVENTS:case b.SEND_PRIVATE_WAM_EVENTS:return(0,i.default)((function*(){return o.DO_NOT_RESCHEDULE}));case b.SEND_NON_MESSAGE_DATA_REQUEST:return(0,i.default)((function*(){return yield(0,y.retryNonMessageDataRequestJob)(),23*s.HOUR_SECONDS}))}}(e);null!=t&&(0,o.registerTask)(e,t)}))};var i=r(n(348926)),a=n(778005),o=n(558553),s=n(990445),l=n(287461),u=n(183660),c=n(266485),d=n(697588),p=n(565583),_=n(963381),f=n(777658),h=n(948425),g=(n(323321),n(864726)),m=n(180019),y=n(734173),E=n(323829),S=n(628905),T=n(671598),v=n(556078),A=n(416911),C=n(580890),P=n(30937),O=n(632084),I=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=M(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r)}(n(173077)),n(26074));function M(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(M=function(e){return e?n:t})(e)}const b=n(76672)({CLEAN_TC_TOKENS:"cleanTcTokens",LOG_DAILY_STATS:"logDailyStats",LOG_DB_ROW_COUNTS:"logDbRowCounts",ROTATE_KEY:"rotateKey",SYNC_AB_PROPS:"syncAbProps",SYNC_CONTACTS:"syncContacts",MONITOR_DB_STORAGE:"monitorDbStorage",REPORT_SYNCD_ACTION_STAT:"reportSyncdActionStat",LT_HASH_CHECK:"ltHashCheck",REQUEST_ALL_SYNCD_MISSING_KEYS:"requestAllSyncdMissingKeys",SYNCD_SYNC_ALL_COLLECTIONS:"syncdSyncAllCollections",CLEAN_ORPHAN_REACTIONS:"cleanOrphanReactions",CLEAN_ORPHAN_ADD_ONS:"cleanOrphanAddOns",CLEAN_PAST_PARTICIPANTS:"cleanPastParticipants",SEND_REGULAR_WAM_EVENTS:"sendCoreWamRegularMetrics",SEND_PRIVATE_WAM_EVENTS:"sendCoreWamPrivateMetrics",SEND_NON_MESSAGE_DATA_REQUEST:"sendNonMessageDataRequest"}),R=[b.CLEAN_TC_TOKENS,b.LOG_DAILY_STATS,b.LOG_DB_ROW_COUNTS,b.ROTATE_KEY,b.SYNC_AB_PROPS,b.SYNC_CONTACTS,b.MONITOR_DB_STORAGE,b.REPORT_SYNCD_ACTION_STAT,b.LT_HASH_CHECK,b.REQUEST_ALL_SYNCD_MISSING_KEYS,b.SYNCD_SYNC_ALL_COLLECTIONS,b.CLEAN_ORPHAN_REACTIONS,b.CLEAN_ORPHAN_ADD_ONS,b.SEND_REGULAR_WAM_EVENTS,b.SEND_PRIVATE_WAM_EVENTS,b.SEND_NON_MESSAGE_DATA_REQUEST]},87429:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.TosManager=t.TOS_3_ID=void 0;var a=i(n(348926)),o=n(209733),s=n(36530),l=n(984330),u=n(72696),c=i(n(395654)),d=n(912513),p=n(94872),_=n(459857),f=n(53575);const h="20210210";t.TOS_3_ID=h;const g={minTimeout:1e3,maxTimeout:16e3,retries:5,signal:(new r).signal};class m extends c.default{constructor(){super(...arguments),this._noticeIds=[h],this._refreshInterval=864e5}getState(e){const t=this._getStoreKey(e);return f.userPreferencesStore.getUser(t)||"UNKNOWN"}setState(e,t){if((0,u.tosFetchEnabled)()){new Set(this._noticeIds).has(e)?(f.userPreferencesStore.setUser(this._getStoreKey(e),t),this.trigger("change")):__LOG__(3)`ToS state manager unrecognized user notice id: ${e}`}}run(){var e=this;return(0,a.default)((function*(){if((0,u.tosFetchEnabled)()){try{yield(0,o.exponentialBackoff)(g,((t,n)=>e._query().catch((e=>{if(e instanceof l.ServerStatusCodeError)switch(e.statusCode){case 500:return __LOG__(3)`ToS state manager query failed, retriable error: ${e.message}, failCount ${n}`,t(e)}throw e}))))}catch(e){if(__LOG__(4,!0,new Error,!0)`ToS state manager state pull failed, error: ${e}`,SEND_LOGS("ToS state manager run failed"),!(e instanceof l.ServerStatusCodeError&&500===e.statusCode))return}if(e._getNoticeIdsToRun().length>0){const t=(0,_.getMaybeMeUser)();yield(0,s.delayMs)(e._refreshInterval),(0,_.getMaybeMeUser)()===t&&e.run()}}}))()}_query(){var e=this;return(0,a.default)((function*(){if(!(0,_.getMaybeMeUser)())return;const t=e._getNoticeIdsToRun();if(t.length>0){const n=yield(0,d.queryTosState)(t);e._refreshInterval=1e3*n.refresh;const r=new Set(e._noticeIds);let i=!1;n.notice.filter((e=>r.has(e.id))).forEach((t=>{const n=t.state?"ACCEPTED":"NOT_ACCEPTED",r=e._getStoreKey(t.id);f.userPreferencesStore.getUser(r)!==n&&(f.userPreferencesStore.setUser(r,n),i=!0)})),f.userPreferencesStore.setUser(p.KEYS.TOS_STATE_FETCH_ITERATION,(0,u.tosFetchIteration)()),i&&e.trigger("change")}}))()}_getNoticeIdsToRun(){const e=parseInt(f.userPreferencesStore.getUser(p.KEYS.TOS_STATE_FETCH_ITERATION),10)||0;if((0,u.tosFetchIteration)()>e)return this._noticeIds;const t=this._noticeIds.map((e=>this.getState(e)));return this._noticeIds.filter(((e,n)=>"ACCEPTED"!==t[n]))}_getStoreKey(e){switch(e){case h:return p.KEYS.TOS_3}throw new Error("Unknown user notice id: "+e)}maybeUpdateServer(e){var t=this;return(0,a.default)((function*(){if((0,u.tosFetchEnabled)())try{const n=new Set(e);yield(0,o.exponentialBackoff)(g,((e,r)=>{const i=t._getAcceptedNoticeIds(n);return i.length>0?(0,d.updateTosState)(i).catch((t=>{if(t instanceof l.ServerStatusCodeError&&500===t.statusCode)return __LOG__(3)`ToS state manager server session state update failed, retriable error: ${t.message}, failCount ${r}`,e(t);throw t})):Promise.resolve()}))}catch(e){__LOG__(4,!0,new Error,!0)`ToS state manager server session state update failed, error: ${e}`,SEND_LOGS("ToS state manager server session state update failed")}}))()}_getAcceptedNoticeIds(e){if((0,_.getMaybeMeUser)()){const t=this._noticeIds.map((e=>this.getState(e)));return this._noticeIds.filter(((n,r)=>"ACCEPTED"===t[r]&&e.has(n)))}return[]}resetTosState(){}}const y=new m;t.TosManager=y},168661:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldBlockByCountry=function(e){var t;return!!(0,i.countryGatingEnabled)()&&((null===(t=e.privacyMode)||void 0===t?void 0:t.hostStorage)===a.HostStorageEnumType.Facebook&&!(0,r.getFbBrandedNumber)(e.id.user))};var r=n(513592),i=n(72696),a=n(257845)},227834:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldBlockByTos=l,t.shouldBlockByTosB2C=function(e,t){if((0,i.tos3GatingEnabledB2C)()&&l(e)&&t)return t.type!==o.MSG_TYPE.DEBUG&&t.type!==o.MSG_TYPE.E2E_NOTIFICATION&&t.type!==o.MSG_TYPE.NOTIFICATION_TEMPLATE&&!t.isSentByMe;return!1};var r=n(513592),i=n(72696),a=n(257845),o=n(373070),s=n(87429);function l(e){var t;if((0,i.tos3GatingEnabled)()&&("NOT_ACCEPTED"===s.TosManager.getState(s.TOS_3_ID)&&(null===(t=e.privacyMode)||void 0===t?void 0:t.hostStorage)===a.HostStorageEnumType.Facebook&&!(0,r.getFbBrandedNumber)(e.id.user)))return!0;return!1}},692269:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.USyncQuery=void 0;var i=r(n(348926)),a=n(911794),o=n(738102),s=n(769707),l=n(355813),u=n(854379),c=n(656859),d=n(653176),p=n(278421),_=n(513210),f=n(802557),h=n(737667),g=n(291957),m=n(127981),y=n(349251),E=r(n(124928));const S={FEATURE:"feature",DEVICE:"devices",CONTACT:"contact",PICTURE:"picture",STATUS:"status",BUSINESS:"business",DISAPPEARING_MODE:"disappearing_mode",LID:"lid"},T={feature:h.featureParser,devices:_.deviceParser,contact:p.contactParser,picture:m.pictureParser,status:y.statusParser,business:d.businessParser,disappearing_mode:f.disappearingModeParser,lid:g.lidParser};function v(e){const t=[];return e.forEachChildWithTag("user",(e=>{const n={};e.hasAttr("jid")&&(Object.keys(S).forEach((t=>{const r=S[t],i=e.maybeChild(r);i&&T[r]&&(n[r]=T[r](i))})),n.id=(0,u.deviceJidToUserWid)(e.attrDeviceJid("jid")),t.push(n))})),t}const A=new s.WapParser("usyncParser",(e=>{e.assertAttr("type","result");const t={error:{},refresh:{},list:[],sideList:[]},n=e.child("usync"),r=n.child("result"),i=n.child("list"),a=n.maybeChild("side_list");return Object.keys(S).forEach((e=>{const n=S[e],i=r.maybeChild(n);if(i){const e=i.maybeChild("error");e?t.error[n]={errorCode:e.attrInt("code"),errorText:e.attrString("text"),errorBackoff:e.attrInt("backoff")}:i.hasAttr("refresh")&&(t.refresh[n]=i.attrInt("refresh",0))}})),t.list=v(i),a&&(t.sideList=v(a)),__LOG__(2)`usync query success!`,t}));t.USyncQuery=class{constructor(){this.context="interactive",this.mode="query",this.protocols=[],this.users=[]}withMode(e){return this.mode=e,this}withContext(e){return this.context=e,this}withContactProtocol(){return this.protocols.push(new p.USyncContactProtocol),this}withBusinessProtocol(){return this.protocols.push(new d.USyncBusinessProtocol),this}withDeviceProtocol(){return this.protocols.push(new _.USyncDeviceProtocol),this}withDisappearingModeProtocol(){return this.protocols.push(new f.USyncDisappearingModeProtocol),this}withPictureProtocol(){return this.protocols.push(new m.USyncPictureProtocol),this}withStatusProtocol(){return this.protocols.push(new y.USyncStatusProtocol),this}withFeaturesProtocol(e){return this.protocols.push(new h.USyncFeaturesProtocol(e)),this}withLidProtocol(){return this.protocols.push(new g.USyncLidProtocol),this}withUser(e){return this.users.push(e),this}_buildStanza(){if(0===this.protocols.length)throw new Error("a usync query must have at least one protocol");const e=this.users.filter((e=>{const t=e.getId();return(!t||!E.default.isServer(t))&&e.validate()}));0===e.length&&__LOG__(3)`Usync warning: a usync query must have at least one user`;const t=(0,o.wap)("query",null,this.protocols.map((e=>e.getQueryElement()))),n=e.map((e=>{const t=e.getId();return(0,o.wap)("user",{jid:t?(0,l.USER_JID)(t):o.DROP_ATTR},this.protocols.map((t=>t.getUserElement(e))))})),r=(0,o.wap)("list",null,n);return(0,o.wap)("iq",{to:o.S_WHATSAPP_NET,xmlns:"usync",type:"get",id:(0,o.generateId)()},(0,o.wap)("usync",{sid:(0,o.generateId)(),index:"0",last:"true",mode:(0,o.CUSTOM_STRING)(this.mode),context:(0,o.CUSTOM_STRING)(this.context)},t,r))}execute(){var e=this;return(0,i.default)((function*(){const t=e._buildStanza();yield(0,c.waitForBackoff)(e);const n=yield(0,a.deprecatedSendIq)(t,A);return n.success?(r=n.result,Object.values(S).forEach((e=>{const t=r.error[e];null!=t&&null!=t.errorBackoff&&(0,c.setProtocolBackoffMs)(e,1e3*t.errorBackoff)})),n.result):{error:{all:{errorCode:n.errorCode,errorText:n.errorText,errorType:n.errorType}},refresh:{},list:[]};var r}))()}}},656859:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setProtocolBackoffMs=function(e,t){__LOG__(2)`usync: ${e} protocol: ${t}ms backoff started`,n.set(e,new Promise((e=>setTimeout(e,t))).then((()=>{__LOG__(2)`usync: ${e} protocol: ${t}ms backoff ended`})))},t.waitForBackoff=function(e){if(!function(e){if("interactive"===e.context)return!1;if(e.protocols.map((e=>e.getName())).includes("devices")&&("message"===e.context||"voip"===e.context))return!1;return!0}(e))return Promise.resolve();return Promise.all(e.protocols.map((e=>n.get(e.getName()))))};const n=new Map},653176:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.USyncBusinessProtocol=void 0,t.businessParser=function(e){e.assertTag("business");const t=e.maybeChild("error");if(t)return{errorCode:t.attrInt("code"),errorText:t.attrString("text")};const n=e.maybeChild("verified_name");return{verifiedName:n?(0,a.default)(n):null}};var i=n(738102),a=r(n(65230));t.USyncBusinessProtocol=class{getName(){return"business"}getQueryElement(){return(0,i.wap)("business",null,(0,i.wap)("verified_name",null))}getUserElement(){return null}}},278421:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.USyncContactProtocol=void 0,t.contactParser=function(e){e.assertTag("contact");const t=e.maybeChild("error");if(t)return{errorCode:t.attrInt("code"),errorText:t.attrString("text")};return{type:e.attrString("type")}};var r=n(738102);t.USyncContactProtocol=class{getName(){return"disappearing_mode"}getQueryElement(){return(0,r.wap)("contact",null)}getUserElement(e){const t=e.getPhone();return t?(0,r.wap)("contact",null,t):null}}},513210:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.USyncDeviceProtocol=void 0,t.deviceParser=function(e){e.assertTag("devices");const t=e.maybeChild("error");if(t)return{errorCode:t.attrInt("code"),errorText:t.attrString("text")};const n=e.maybeChild("key-index-list"),r=e.maybeChild("device-list"),i=null==n?null:{ts:n.attrTime("ts"),signedKeyIndexBytes:n.hasContent()?n.contentBytes():null,expectedTs:n.hasAttr("expected_ts")?n.attrTime("expected_ts"):void 0};return{deviceList:null==r?void 0:r.mapChildrenWithTag("device",(e=>({id:e.attrInt("id"),keyIndex:e.hasAttr("key-index")?e.attrInt("key-index"):null}))),keyIndex:i}};var r=n(738102),i=n(287461);t.USyncDeviceProtocol=class{getName(){return"devices"}getQueryElement(){return(0,r.wap)("devices",{version:(0,r.CUSTOM_STRING)(String(2))})}getUserElement(e){const t=e.getDeviceHash(),n=e.getTs(),a=e.getExpectedTs();return t||null!=n||null!=a?(0,r.wap)("devices",{device_hash:t?(0,r.CUSTOM_STRING)(t):r.DROP_ATTR,ts:null!=n?(0,r.INT)(n):r.DROP_ATTR,expected_ts:(0,i.getABPropConfigValue)("adv_v2_m4_m5")&&null!=a?(0,r.INT)(a):r.DROP_ATTR}):null}}},802557:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.USyncDisappearingModeProtocol=void 0,t.disappearingModeParser=function(e){e.assertTag("disappearing_mode");const t=e.maybeChild("error");if(t)return{errorCode:t.attrInt("code"),errorText:t.attrString("text")};const n=e.attrInt("duration",0),r=e.attrInt("t");return{duration:n,t:r}};var r=n(738102);t.USyncDisappearingModeProtocol=class{getName(){return"disappearing_mode"}getQueryElement(){return(0,r.wap)("disappearing_mode",null)}getUserElement(){return null}}},737667:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.USyncFeaturesProtocol=void 0,t.featureParser=function(e){e.assertTag("feature");const t=e.maybeChild("error");if(t)return{errorCode:t.attrInt("code"),errorText:t.attrString("text")};const n={};return Object.keys(i).forEach((t=>{const r=e.maybeChild(t);r&&(n[t]=r.attrString("value"))})),n};var r=n(738102);const i={document:(0,r.wap)("document",null),encrypt:(0,r.wap)("encrypt",null),encrypt_blist:(0,r.wap)("encrypt_blist",null),encrypt_contact:(0,r.wap)("encrypt_contact",null),encrypt_group_gen2:(0,r.wap)("encrypt_group_gen2",null),encrypt_image:(0,r.wap)("encrypt_image",null),encrypt_location:(0,r.wap)("encrypt_location",null),encrypt_url:(0,r.wap)("encrypt_url",null),encrypt_v2:(0,r.wap)("encrypt_v2",null),voip:(0,r.wap)("voip",null),multi_agent:(0,r.wap)("multi_agent",null)};t.USyncFeaturesProtocol=class{getName(){return"picture"}constructor(e){if(this.queries=e,0===e.length)throw new Error("must specify at least one query")}getQueryElement(){return(0,r.wap)("feature",null,this.queries&&this.queries.map((e=>i[e])))}getUserElement(){return null}}},291957:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.USyncLidProtocol=void 0,t.lidParser=function(e){e.assertTag("lid");const t=e.maybeChild("error");if(t)return{errorCode:t.attrInt("code"),errorText:t.attrString("text")};return e.maybeAttrLidUserJid("val")};var r=n(738102),i=n(355813);t.USyncLidProtocol=class{getName(){return"lid"}getQueryElement(){return(0,r.wap)("lid",null)}getUserElement(e){const t=e.getLid();return t?(0,r.wap)("lid",{jid:t?(0,i.USER_JID)(t):r.DROP_ATTR}):null}}},127981:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.USyncPictureProtocol=void 0,t.pictureParser=function(e){e.assertTag("picture");const t=e.maybeChild("error");if(t)return{errorCode:t.attrInt("code"),errorText:t.attrString("text")};return{id:e.attrInt("id")}};var r=n(738102);t.USyncPictureProtocol=class{getName(){return"picture"}getQueryElement(){return(0,r.wap)("picture",null)}getUserElement(){return null}}},349251:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.USyncStatusProtocol=void 0,t.statusParser=function(e){e.assertTag("status");const t=e.maybeChild("error");if(t)return{errorCode:t.attrInt("code"),errorText:t.attrString("text")};if(!e.hasContent())return e.hasAttr("code")&&401===e.attrInt("code")?null:i.fbt._("Hey there! I am using WhatsApp.",null,{hk:"1lXNBq"}).toString();return 0!==e.contentString().length?e.contentString():i.fbt._("Hey there! I am using WhatsApp.",null,{hk:"1lXNBq"}).toString()};var r=n(738102),i=n(548360);t.USyncStatusProtocol=class{getName(){return"status"}getQueryElement(){return(0,r.wap)("status",null)}getUserElement(){return null}}},328606:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.USyncUser=void 0;var r=n(323389);t.USyncUser=class{withId(e){return this._id=e,this}withLid(e){return this._lid=e,this}withDeviceHash(e){return this._deviceHash=e,this}withTs(e){return this._ts=e,this}withExpectedTs(e){return this._expectedTs=e,this}withPhone(e){return this._phone=e,this}getDeviceHash(){return this._deviceHash}getPhone(){return this._phone}getId(){return this._id}getLid(){return this._lid}getTs(){return this._ts}getExpectedTs(){return this._expectedTs}validate(){const{_id:e,_phone:t}=this;if(null==e&&null==t)throw new Error("user must have an id or a phone");if(e){const t=(0,r.validateWid)(e.toString());return t||__LOG__(3)`USync user created with invalid jid: ${e.toString()}`,t}return!0}}},719722:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.attemptWithDirectConnectionRetry=u,t.attemptWithOrderDirectConnectionRetry=function(){return d.apply(this,arguments)};var i=r(n(348926)),a=n(287461),o=r(n(152943)),s=n(895758),l=n(944878);function u(){return c.apply(this,arguments)}function c(){return(c=(0,i.default)((function*(e,t){if(!(yield(0,s.isCypherNeeded)(e)))return t();const n=function(){var n=(0,i.default)((function*(){let n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const r=(yield o.default.getCypher(e,{forceRenew:n})).cypher;return t(r)}));return function(){return n.apply(this,arguments)}}();try{return yield n()}catch(e){return(0,s.errorIsDirectConnectionCypherError421)(e)?(__LOG__(2)`[direct-connection] Received 421 from Direct Connection request. Renewing certificate and retrying.`,n(!0)):Promise.reject(e)}}))).apply(this,arguments)}function d(){return(d=(0,i.default)((function*(e,t){if(!(0,a.getABPropConfigValue)("share_phone_number_on_cart_send_to_direct_connection_biz_enabled"))return u(e,t);if(!(yield(0,s.isCypherNeeded)(e)))return t();const n=function(){var n=(0,i.default)((function*(){var n;const r=null===(n=yield o.default.genNewCypher(e,l.CypherType.PhoneNumberAndPostcode,{forceRenew:!0}))||void 0===n?void 0:n.cypher;return t(r)}));return function(){return n.apply(this,arguments)}}(),r=function(){var r=(0,i.default)((function*(){const r=yield o.default.getCypher(e);return r.cypherType===l.CypherType.PhoneNumberAndPostcode?t(r.cypher):n()}));return function(){return r.apply(this,arguments)}}();try{return yield r()}catch(e){return(0,s.errorIsDirectConnectionCypherError421)(e)?(__LOG__(2)`[direct-connection] Received 421 from Direct Connection request. Renewing certificate and retrying.`,n()):Promise.reject(e)}}))).apply(this,arguments)}},12642:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.queryBusinessPublicKey=function(e){return(0,n(628905).getJobManager)().waitUntilCompleted(a.jobSerializers.getPublicKey(e))},t.queryCustomUrlPaths=function(e){return(0,r.getCustomUrlPaths)(e)},t.querySignedUserInfo=function(e){return(0,n(628905).getJobManager)().waitUntilCompleted(a.jobSerializers.getSignedUserInfo(e))},t.updateCartEnabled=function(e){return(0,i.updateCartEnabled)(e)};var r=n(570103),i=n(761849),a=n(323829)},684057:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.queryBusinessCategories=function(e){(0,r.qplPointProfileCatsView)("datasource_start");const t=(0,i.queryBusinessCategories)(e);return t.then((e=>((0,r.qplPointProfileCatsView)("datasource_end"),e))),t};var r=n(650809),i=n(331923)},771146:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DIRECT_CONNECTION_FLAG=void 0,t.getBusinessProfileQueryVersion=function(){return o(i.ServerProps.webBizProfileOptions)},t.getBusinessProfileQueryVersionWithCustomBizProfileOptions=o;var r=n(72696),i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(241588));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}t.DIRECT_CONNECTION_FLAG=128;function o(e){let t=247;return(0,r.bizLinkedAccountsEnabled)()&&(t|=256),e&t}},149159:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.createLabelAssociationMutations=m,t.editLabelAssociation=function(e,t){t.some((e=>e instanceof c.default))&&(__LOG__(4,void 0,new Error,!0)`contact model is invalid for editLabelAssociation`,SEND_LOGS("contact model is invalid for editLabelAssociation"));return function(e,t){if(!(0,u.canEditLabelAssociation)())return Promise.reject(new Error("editLabelAssociation is not supported"));return(0,_.lockForSync)(["label-association"],m(e,t),(()=>h(e,t)))}(e,t.map((e=>e instanceof d.Msg?{labelAssociationType:p.LabelAssociationType.Message,modelId:e.id.toString(),mutationIndexSegments:(0,f.constructMsgKeySegments)(e)}:{labelAssociationType:p.LabelAssociationType.Jid,modelId:e.id.toString(),mutationIndexSegments:[e.id.toString({legacy:!0})]})))},t.editLocalLabelAssociationMD=h;var i=r(n(348926)),a=n(715739),o=n(797666),s=n(155172),l=n(990445),u=n(72696),c=r(n(428760)),d=n(387191),p=n(294715),_=n(924439),f=n(46167);function h(){return g.apply(this,arguments)}function g(){return(g=(0,i.default)((function*(e,t){const n=[],r=[];e.forEach((e=>{let{id:i,type:a}=e;t.map((e=>{let{modelId:t,labelAssociationType:o}=e;"add"===a?n.push({labelId:i,associationId:t,type:o}):r.push([i,t,o])}))}));const i=(0,p.getTable)();yield Promise.all([i.bulkCreateOrReplace(n).catch((()=>{throw __LOG__(4,!0,new Error,!0)`bulkCreateOrReplace into label association table failed`,SEND_LOGS("bulkCreateOrReplace into label association table failed when saving label associations"),new Error("bulkCreateOrReplace into label association table failed")})),i.bulkRemove(r).catch((()=>{throw __LOG__(4,!0,new Error,!0)`bulkRemove from label association table failed`,SEND_LOGS("bulkRemove from label association table failed while saving label associations"),new Error("bulkRemove form label association table failed")}))])}))).apply(this,arguments)}function m(e,t){const n=(0,l.unixTimeMs)(),r=[];return e.forEach((e=>{let{id:i,type:l}=e;t.forEach((e=>{let{labelAssociationType:t,mutationIndexSegments:u}=e;const c=t===p.LabelAssociationType.Message?s.Actions.LabelMessage:s.Actions.LabelJid;r.push((0,o.buildPendingMutation)({timestamp:n,collection:s.CollectionName.Regular,operation:a.SyncdMutation$SyncdOperation.SET,indexArgs:[i,...u],version:s.LABEL_ASSOCIATION_SYNC_VERSION,value:{labelAssociationAction:{labeled:"add"===l}},action:c}))}))})),r}},968852:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createOrder=function(e,t){if((0,a.commerceFeaturesDisabledBySanctions)())return Promise.reject(new r.E451);(0,o.qplPointOrderCreate)("datasource_start");const n=(0,l.attemptWithOrderDirectConnectionRetry)(e,(n=>(0,i.createOrderMD)(e,t,n)));return n.then((()=>(0,o.qplPointOrderCreate)("datasource_end"))),n},t.queryOrder=function(e,t,n,i,u){if((0,a.commerceFeaturesDisabledBySanctions)())return Promise.reject(new r.E451);(0,o.qplPointOrderView)("datasource_start");const c=(0,l.attemptWithDirectConnectionRetry)(e,(e=>(0,s.queryOrder)(t,n,i,u,e)));return c.then((()=>(0,o.qplPointOrderView)("datasource_end"))),c};var r=n(984330),i=n(40110),a=n(72696),o=n(650809),s=n(897769),l=n(719722)},841208:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addProduct=function(e,t,n){m.QPL.markerPoint(g.QuickLogMarkerId.WHATSAPP_PRODUCT_SAVE,"datasource_start");const r=(0,o.addProductMD)(e,t,n);return r.then((()=>m.QPL.markerPoint(g.QuickLogMarkerId.WHATSAPP_PRODUCT_SAVE,"datasource_end"))),r.then(I).catch((e=>{if(e instanceof a.ServerStatusCodeError&&406===e.statusCode||e instanceof a.CatalogEditServerError&&406===e.statusCode)throw e;throw __LOG__(4,!0,new Error,!0)`Add product failed, error: ${e}`,SEND_LOGS("Add product failed"),e}))},t.appealProduct=function(e,t){m.QPL.markerPoint(g.QuickLogMarkerId.WHATSAPP_PRODUCT_APPEAL,"datasource_start");const n=(0,s.appealProductMD)(e,t);return n.then((()=>m.QPL.markerPoint(g.QuickLogMarkerId.WHATSAPP_PRODUCT_APPEAL,"datasource_end"))),(0,a.attachErrorLogger)(n,"Appeal product failed")},t.createCatalog=function(){m.QPL.markerPoint(g.QuickLogMarkerId.WHATSAPP_CATALOG_CREATE,"datasource_start");const e=(0,d.createProductCatalog)();return e.then((()=>{m.QPL.markerPoint(g.QuickLogMarkerId.WHATSAPP_CATALOG_CREATE,"datasource_end")})),(0,a.attachErrorLogger)(e,"Create catalog failed")},t.deleteProducts=function(e){let t;return m.QPL.markerPoint(g.QuickLogMarkerId.WHATSAPP_PRODUCT_DELETE,"datasource_start"),t=(0,l.deleteProductsMD)(e),t=t.then((()=>m.QPL.markerPoint(g.QuickLogMarkerId.WHATSAPP_PRODUCT_DELETE,"datasource_end"))),(0,a.attachErrorLogger)(t,"Delete product failed")},t.editProduct=function(e,t,n){m.QPL.markerPoint(g.QuickLogMarkerId.WHATSAPP_PRODUCT_SAVE,"datasource_start");const r=(0,u.default)(e,t,n);return r.then((()=>m.QPL.markerPoint(g.QuickLogMarkerId.WHATSAPP_PRODUCT_SAVE,"datasource_end"))),r.then(I).catch((e=>{if(e instanceof a.ServerStatusCodeError&&406===e.statusCode||e instanceof a.CatalogEditServerError&&406===e.statusCode)throw e;throw __LOG__(4,!0,new Error,!0)`Edit product failed, error: ${e}`,SEND_LOGS("Edit product failed"),e}))},t.mapMsgToProductModel=function(e){let t;e.businessOwnerJid&&(t=(0,v.createWid)(e.businessOwnerJid));return{catalogWid:t,id:e.productId||"",url:e.url,name:e.title,description:e.description,imageCdnUrl:e.mediaData.renderableUrl,reviewStatus:"",currency:e.currencyCode,priceAmount1000:e.priceAmount1000,salePriceAmount1000:e.salePriceAmount1000,retailerId:e.retailerId,productMsgMediaData:e.mediaData,imageCount:null!=e.productImageCount&&0!==e.productImageCount?e.productImageCount:1,fetchedFromServer:!1,t:e.t,isHidden:!1}},t.mapProductResponseToModel=I,t.parseDateValue=O,t.productVisibilitySet=function(e){m.QPL.markerPoint(g.QuickLogMarkerId.WHATSAPP_PRODUCT_SET_VISIBLE,"datasource_start");const t=(0,c.default)(e);return t.then((()=>m.QPL.markerPoint(g.QuickLogMarkerId.WHATSAPP_PRODUCT_SET_VISIBLE,"datasource_end"))),(0,a.attachErrorLogger)(t,"Product visibility change failed")},t.queryCatalog=function(e,t,n,r,i,o,s){return(0,A.attemptWithDirectConnectionRetry)(e,(a=>(0,y.default)({catalogWid:e,afterCursor:t,limit:n,width:r,height:i,checkmarkCollectionId:o,allowShopSource:s,directConnectionEncryptedInfo:a}))).catch((e=>{if(e instanceof a.ServerStatusCodeError&&404===e.statusCode)throw e;throw __LOG__(4,!0,new Error,!0)`Query catalog failed, error: ${e}`,SEND_LOGS("Query catalog failed"),e}))},t.queryCatalogHasCategories=function(e){return(0,A.attemptWithDirectConnectionRetry)(e,(t=>(0,E.queryCatalogHasCategories)({catalogWid:e,directConnectionEncryptedInfo:t})))},t.queryProduct=function(e,t,n,r,i,o){!0===o&&(0,_.qplPointProductView)("datasource_start");const s=(0,A.attemptWithDirectConnectionRetry)(e,(a=>(0,S.default)(e,t,n,r,i,a)));return s.then((()=>!0===o&&(0,_.qplPointProductView)("datasource_end"))),(0,a.attachErrorLogger)(s,"Query product failed")},t.queryProductList=function(e,t,r,i,o){if((0,p.commerceFeaturesDisabledBySanctions)())return Promise.reject(new a.E451);o&&(0,_.qplPointPLMDetailsView)("datasource_start");const s=n(628905).getJobManager,l=(0,A.attemptWithDirectConnectionRetry)(e,(n=>s().waitUntilCompleted(f.jobSerializers.queryProductList(e,t,n,r,i))));return l.then((()=>o&&(0,_.qplPointPLMDetailsView)("datasource_end"))).catch((e=>{if(451===e.errorCode)throw new a.E451})),l},t.reportProduct=function(e,t,n){m.QPL.markerPoint(g.QuickLogMarkerId.WHATSAPP_PRODUCT_REPORT,"datasource_start");const r=(0,T.default)(e,t,n);return r.then((()=>m.QPL.markerPoint(g.QuickLogMarkerId.WHATSAPP_PRODUCT_REPORT,"datasource_end"))),(0,a.attachErrorLogger)(r,"Report product failed")};var i=r(n(81109)),a=n(984330),o=n(524503),s=n(650184),l=n(728408),u=r(n(519897)),c=r(n(621753)),d=n(168965),p=n(72696),_=n(650809),f=n(323829),h=n(694630),g=n(316348),m=n(555622),y=r(n(818576)),E=n(471564),S=r(n(340591)),T=r(n(901671)),v=n(669050),A=n(719722),C=r(n(730381));function P(e){return null==e?null:parseInt(e,10)}function O(e){return e?C.default.utc(e,C.default.ISO_8601).valueOf():null}function I(e,t){var n,r;const a=(null===(n=e.capability_to_review_status[0])||void 0===n?void 0:n.value)||"APPROVED",o={catalogWid:t,id:e.id,isHidden:e.is_hidden||!1,url:e.url||"",name:e.name,description:e.description||"",availability:null!==(r=h.ProductAvailability.cast(e.availability))&&void 0!==r?r:h.ProductAvailability.UNKNOWN,maxAvailable:e.max_available,additionalImageCdnUrl:e.additional_image_cdn_urls.map((e=>e[1].value)),additionalImageHashes:e.image_hashes_for_whatsapp.slice(1),imageCdnUrl:e.image_cdn_urls[1].value,imageHash:e.image_hashes_for_whatsapp[0],reviewStatus:a,currency:e.currency,priceAmount1000:P(e.price),salePriceAmount1000:P(e.sale_price),salePriceStartDate:O(e.sale_start_date),salePriceEndDate:O(e.sale_end_date),retailerId:e.retailer_id||"",productMsgMediaData:null,imageCount:e.additional_image_cdn_urls.length+1,fetchedFromServer:!0,t:Date.now()/1e3,old:!1,canAppeal:e.whatsapp_product_can_appeal,checkmark:e.checkmark};return e.compliance_info&&(o.complianceInfo=function(e){const t={countryCodeOrigin:e.country_code_origin};e.importer_name&&(t.importerName=e.importer_name);e.importer_address&&(t.importerAddress=function(e){const t={street1:e.street1,city:e.city,countryCode:e.country_code};e.street2&&(t.street2=e.street2);e.postal_code&&(t.postalCode=e.postal_code);e.region&&(t.region=e.region);e.country_code&&(t.countryCode=e.country_code);return t}(e.importer_address));return t}(e.compliance_info)),(0,i.default)({},o)}},89455:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateQuickReply=function(e){let t=Promise.resolve();const{id:n,shortcut:i,count:a,message:o,keywords:s}=e;return t=(0,r.getQuickReplyTable)().createOrReplace({id:n,shortcut:i,count:a,message:o,keywords:s}),t};var r=n(76469)},115899:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(t){const n=i.ContactCollection.gadd(e);return(0,r.updateVerifiedInfo)(n,t.verifiedName)}return Promise.resolve()};var r=n(909975),i=n(121977)},377264:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.sendChatStateComposing=function(e){return(0,i.default)(e,"composing"),Promise.resolve()},t.sendChatStatePaused=function(e){return(0,i.default)(e,"paused"),Promise.resolve()},t.sendChatStateRecording=function(e){return(0,i.default)(e,"recording"),Promise.resolve()};var i=r(n(921311))},508133:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addChatThreadLoggingActivities=function(e){return(0,r.handleActivitiesForChatThreadLogging)(e)},t.getChatThreadID=function(e,t){return(0,r.getChatThreadID)(e,t)};var r=n(698867)},419026:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.clearStorage=g,t.sendClear=function(e,t,r){return((0,p.clearOrDeleteChatSyncEnabled)()?function(){return y.apply(this,arguments)}(e,t,r):function(){return E.apply(this,arguments)}(e,r)).then(function(){var t=(0,a.default)((function*(t){if(null!=t.result&&t.result.length>0){const r=t.result;(0,f.deleteModelsForLastAddOnPreview)(r);const i=n(628905).getJobManager;yield i().waitUntilPersisted(_.jobSerializers.deleteAddOns(e.id.toString(),r))}return t}));return function(){return t.apply(this,arguments)}}())};var i=r(n(81109)),a=r(n(348926)),o=r(n(132375)),s=n(370625),l=n(990445),u=n(133331),c=n(599580),d=n(110567),p=n(97858),_=n(323829),f=n(987523),h=n(309512);function g(){return m.apply(this,arguments)}function m(){return(m=(0,a.default)((function*(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(n)return(0,c.queryAndRemoveMessagesInMessageRange)(e.id,n,{skipStarred:t,skipRecentSystemMessages:!1});const r=yield(0,c.getBoundsForChat)(e.id),a=yield(0,c.queryAndRemoveMessageHistory)(e.id);return null==r&&__LOG__(3)`_sendClearMD: Expected to receive boundaries for chat while clearing`,d.ftsClient.purgeRange((0,i.default)({chatId:e.id.toString()},(0,o.default)(r,"rowIdBounds"))).catch((()=>{})),a}))).apply(this,arguments)}function y(){return(y=(0,a.default)((function*(e,t,r){const{lockForMessageRangeSync:i}=n(731189),o=n(822036).default,c=(0,l.unixTimeMs)(),d=yield o.getClearChatMutation(c,e.id,!r);let p;return yield i(["message"],[d],(0,a.default)((function*(){var t;yield(0,u.addActiveMessageRange)(e.id.toString(),(0,u.getActiveRangeAction)("clearChat",{deleteStarred:!r}),d.binarySyncAction);const n=null===(t=(0,h.decodeProtobuf)(s.SyncActionValueSpec,d.binarySyncAction).clearChatAction)||void 0===t?void 0:t.messageRange;p=yield g(e,r,n)}))),{_duplicate:null,result:p}}))).apply(this,arguments)}function E(){return(E=(0,a.default)((function*(e,t){return{_duplicate:null,result:yield g(e,t)}}))).apply(this,arguments)}},872722:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.create=function(){return E.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(493928),s=n(697588),l=n(559432),u=n(965012),c=n(121977),d=n(389293),p=n(800321),_=n(677159),f=r(n(140854)),h=n(240493),g=n(35109),m=n(808639),y=n(298592);function E(){return(E=(0,a.default)((function*(e,t,n){var r;const{forceUsync:i=!1,firstIncomingMsg:a,nextPrivacyMode:E,createdOffline:v=!1}=null!=n?n:{},A=e.isUser()&&i?yield(0,_.getOrQueryUsyncInfo)(e):null,C=null==A?e:A.wid;if(!e.equals(C)){const e=u.ChatCollection.get(C);if(null!=e)return e}let P=null,O=!1;if(null!=A&&(null===(r=A.bizInfo)||void 0===r?void 0:r.verifiedName.isApi))O=!0;else if(null==A){const t=c.ContactCollection.get(e);null!=t&&t.isEnterprise&&(O=!0)}!O&&C.isUser()&&!C.isPSA()&&(0,o.isDisappearingModeEnabled)()&&(P=null==a||a.id.fromMe?(0,y.getDisappearingModeSettingForChat)(C):(0,y.getDisappearingModeSettingFromMsg)(a));const I=u.ChatCollection.gadd(S(C,null!=t?t:{},P)),M=A?(0,g.getPrivacyModeFromQueryExistResponse)(A):null,b=(0,g.getLatestPrivacyMode)(I.contact.privacyMode,(0,g.getLatestPrivacyMode)(E,M)),R=(0,f.default)(C,b),N=null!=P?(0,d.genDisappearingModeSystemMsg)(C,P.duration,P.initiator===m.DisappearingModeInitiator.InitiatedByMe):null;let w=null;const L=I.contact.shareOwnPn;C.isLid()&&!L&&(w=(0,d.genMaskedThreadCreatedSystemMsg)(C));const D=yield(0,l.getOrphanTcToken)(C.toString());var k,U,G;D&&(I.tcToken=null!==(k=D.tcToken)&&void 0!==k?k:null,I.tcTokenTimestamp=null!==(U=D.tcTokenTimestamp)&&void 0!==U?U:null,I.tcTokenSenderTimestamp=null!==(G=D.tcTokenSenderTimestamp)&&void 0!==G?G:null,yield(0,l.removeOrphanTcToken)(C.toString()));if(yield(0,s.createChat)(C,T(I)),v){const e=[R,N,w].filter(Boolean);(0,p.getMessageCache)().addMessages(e.map((e=>({msg:e}))),!1)}else{const e=[R,N,w].filter(Boolean);for(const t of e)yield(0,h.handleSingleMsgMD)(t.from,t,!1,!1)}return I}))).apply(this,arguments)}function S(e,t,n){let r=(0,i.default)({id:e},t);return null!=n&&(r=(0,i.default)((0,i.default)({},r),{},{ephemeralDuration:n.duration,ephemeralSettingTimestamp:n.settingTimestamp,disappearingModeInitiator:n.initiator})),r}function T(e){return{id:e.id.toString(),t:e.t,unreadCount:e.unreadCount,archive:e.archive,isReadOnly:e.isReadOnly,modifyTag:e.modifyTag,notSpam:e.notSpam,pin:e.pin,changeNumberOldJid:null!=e.changeNumberOldJid?e.changeNumberOldJid.toString():void 0,changeNumberNewJid:null!=e.changeNumberNewJid?e.changeNumberNewJid.toString():void 0,muteExpiration:e.muteExpiration,isAutoMuted:e.isAutoMuted,endOfHistoryTransferType:(e.endOfHistoryTransferType,e.endOfHistoryTransferType),ephemeralDuration:e.ephemeralDuration,ephemeralSettingTimestamp:e.ephemeralSettingTimestamp,disappearingModeInitiator:(e.disappearingModeInitiator,e.disappearingModeInitiator),tcToken:null!=e.tcToken?e.tcToken:void 0,tcTokenTimestamp:null!=e.tcTokenTimestamp?e.tcTokenTimestamp:void 0,tcTokenSenderTimestamp:null!=e.tcTokenSenderTimestamp?e.tcTokenSenderTimestamp:void 0}}},268824:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.deleteFromStorage=function(e){return(0,g.getStorage)().lock(["chat","label-association","message","chat-assignment"],(0,a.default)((function*(){const t=yield(0,c.getBoundsForChat)(e),[n,r,i]=yield Promise.all([(0,h.getChatTable)().remove(e.toString()),(0,c.queryAndRemoveMessageHistory)(e),v(e),(0,d.removeChatAssignmentsForChat)(e)]);return{chatBoundaries:t,deletedMsgIds:r}}))).then(function(){var t=(0,a.default)((function*(t){let{chatBoundaries:r,deletedMsgIds:a}=t;if(r){_.ftsClient.purgeRange((0,i.default)({chatId:e.toString()},r)),(0,E.deleteModelsForLastAddOnPreview)(a);const t=n(628905).getJobManager;yield t().waitUntilPersisted(m.jobSerializers.deleteAddOns(e.toString(),a))}else __LOG__(3)`sendConversationDelete: chat boundaries was null`}));return function(){return t.apply(this,arguments)}}())},t.sendConversationDelete=function(e,t,r){let i=Promise.resolve({status:400,_duplicate:!1});if((0,f.clearOrDeleteChatSyncEnabled)())i=O(e,!0);else{const n=r();(t&&t.equals(n)||t===n)&&(i=O(e,!1))}return i.then(function(){var t=(0,a.default)((function*(t){if(null!=t.result&&t.result.length>0){const r=t.result;(0,E.deleteModelsForLastAddOnPreview)(r);const i=n(628905).getJobManager;return yield i().waitUntilPersisted(m.jobSerializers.deleteAddOns(e.toString(),r)),t}return t}));return function(){return t.apply(this,arguments)}}())};var i=r(n(81109)),a=r(n(348926)),o=n(370625),s=n(990445),l=n(133331),u=n(979504),c=n(599580),d=n(582523),p=n(72696),_=n(110567),f=n(97858),h=n(76469),g=n(605316),m=n(323829),y=n(294715),E=n(987523),S=n(149159),T=n(309512);function v(){return A.apply(this,arguments)}function A(){return(A=(0,a.default)((function*(e){if(!(0,p.canEditLabelAssociation)())return;const{labelsToUpdate:t,modelRecords:n}=yield C(e);yield(0,S.editLocalLabelAssociationMD)(t,n)}))).apply(this,arguments)}function C(){return P.apply(this,arguments)}function P(){return(P=(0,a.default)((function*(e){return{labelsToUpdate:(yield(0,u.queryLocalLabelAssociation)([{associationId:e.toString(),type:y.LabelAssociationType.Jid}])).map((e=>{let{labelId:t}=e;return{id:t,type:"remove"}})),modelRecords:[{labelAssociationType:y.LabelAssociationType.Jid,modelId:e.toString(),mutationIndexSegments:[e.toString({legacy:!0})]}]}}))).apply(this,arguments)}function O(){return I.apply(this,arguments)}function I(){return(I=(0,a.default)((function*(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const{lockForMessageRangeSync:i}=n(731189),u=n(889355).default,d=n(421571).default,p=(0,s.unixTimeMs)(),[_,g,m]=yield Promise.all([d.getDeleteChatMutation(p,e,!r),u.getPinMutation(p,!1,e),M(e)]),y=[...m];let E;return(0,f.pinChatSyncEnabled)()&&y.push(g),t&&y.push(_),yield i(["message","chat","label-association","group-metadata"],y,(0,a.default)((function*(){var n;t&&(yield(0,l.addActiveMessageRange)(e.toString(),(0,l.getActiveRangeAction)("deleteChat",{deleteMedia:!r}),_.binarySyncAction));const i=null===(n=(0,T.decodeProtobuf)(o.SyncActionValueSpec,_.binarySyncAction).deleteChatAction)||void 0===n?void 0:n.messageRange;i&&(E=yield(0,c.queryAndRemoveMessagesInMessageRange)(e,i,{forceDeleteAllMessages:!0}),yield Promise.all([(0,h.getChatTable)().remove(e.toString()),(0,h.getGroupMetadataTable)().remove(e.toString()),v(e)]))}))),{status:200,_duplicate:!1,result:E}}))).apply(this,arguments)}function M(){return b.apply(this,arguments)}function b(){return(b=(0,a.default)((function*(e){if(!(0,p.canEditLabelAssociation)())return[];const{labelsToUpdate:t,modelRecords:n}=yield C(e);return(0,S.createLabelAssociationMutations)(t,n)}))).apply(this,arguments)}},30771:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.findLocal=function(){return s.apply(this,arguments)};var i=r(n(348926)),a=n(642232),o=n(76085);function s(){return(s=(0,i.default)((function*(e){const t=yield(0,o.getTable)().get(e);return t?(0,a.hydrateWids)(t):null}))).apply(this,arguments)}},485330:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getExisting=function(){return s.apply(this,arguments)};var i=r(n(348926)),a=n(965012),o=n(30771);function s(){return(s=(0,i.default)((function*(e){const t=a.ChatCollection.get(e);if(t&&!t.stale)return t;const n=yield(0,o.findLocal)(e.toString());return n?a.ChatCollection.gadd(n):null}))).apply(this,arguments)}},814929:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setLastReceivedKey=function(){return Promise.resolve()}},379040:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.sendConversationMute=function(e,t,n,r){let o=Promise.resolve();const s=i.default.generateMuteMutation(e,t,r);return o=(0,a.lockForSync)(["chat"],[s],(n=>{let[i]=n;return i.merge(e.toString(),{muteExpiration:t,isAutoMuted:r})})).then((()=>({status:200}))),o};var i=r(n(737633)),a=n(924439)},572573:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.markConversationSeen=function(e,t){return(0,u.getChatTable)().merge(e.toString(),{unreadCount:t}).catch((e=>{if(e instanceof l.DbOnLogoutAbort)throw e;throw __LOG__(4,!0,new Error,!0)`update chat table failed`,SEND_LOGS("update chat table failed when mark convestation seen"),new Error("update chat table failed")}))},t.markConversationUnseen=function(e){return(0,u.getChatTable)().merge(e.toString(),{unreadCount:-1}).catch((e=>{if(e instanceof l.DbOnLogoutAbort)throw e;throw __LOG__(4,!0,new Error,!0)`update chat table failed`,SEND_LOGS("update chat table failed when mark conversation as unseen"),new Error("update chat table failed")}))},t.sendConversationSeen=function(){return d.apply(this,arguments)},t.sendConversationUnseen=function(e){const{lockForMessageRangeSync:t}=n(731189),r=n(164404).default,i=(0,a.unixTimeMs)();return r.getMarkChatAsReadMutation(i,!1,e).then((n=>t([],[n],(()=>(0,o.addActiveMessageRange)(e.toString(),"markChatAsRead",n.binarySyncAction)))))};var i=r(n(348926)),a=n(990445),o=n(133331),s=n(697588),l=n(288057),u=n(76469),c=n(203146);function d(){return(d=(0,i.default)((function*(e,t,r){const{lockForMessageRangeSync:i}=n(731189),l=n(164404).default,u=(0,a.unixTimeMs)();if(-1===r){const t=yield l.getMarkChatAsReadMutation(u,!0,e.id),n=e.id.toString();i([],[t],(()=>(0,o.addActiveMessageRange)(e.id.toString(),"markChatAsRead",t.binarySyncAction))),yield(0,s.updateChatForMarkAsReadSync)(n)}else yield(0,c.markChatRead)(e,t);return{_duplicate:!1}}))).apply(this,arguments)}},128523:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendStarMsgs=function(e,t,n){return s(t,n)},t.sendUnstarAll=function(e){return s(e,!1)};var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=i?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(573166)),i=n(74927),a=n(924439);function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}function s(e,t){t||r.addUnsetActionCount(e.length);const o=n(904117).default.getStarMessageMutations(e,t);return(0,a.lockForSync)(["message"],o,(()=>t?(0,i.starMessages)(e.map((e=>e.id.toString()))).catch((()=>{throw __LOG__(4,!0,new Error,!0)`star messages failed`,SEND_LOGS("star messages failed"),new Error("star messages failed")})):(0,i.unstarMessages)(e.map((e=>e.id.toString()))).catch((()=>{throw __LOG__(4,!0,new Error,!0)`unstar messages failed`,SEND_LOGS("unstar messages failed"),new Error("unstar messages failed")}))))}},669880:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateLocal=function(e,t){return(0,i.getTable)().merge(e.toString(),t).catch((e=>{if(e instanceof r.DbOnLogoutAbort)throw e;throw __LOG__(4,!0,new Error,!0)`update chat table failed`,SEND_LOGS("update chat table failed when update local"),new Error("update chat table failed")}))};var r=n(288057),i=n(76085)},67797:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.sendSetBlock=function(){return u.apply(this,arguments)},t.updateBlockingStatusForPSAUser=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(984330),o=n(208016),s=n(76469),l=n(394190);function u(){return(u=(0,i.default)((function*(e,t,n,r){const i=e?(0,o.blockUser)(t,n,r):(0,o.unblockUser)(t,n);yield i.then((e=>{if(e&&null!=e.errorCode)throw new a.ServerStatusCodeError(e.errorCode,e.errorText)}));try{const n=t.toString();return e?yield(0,s.getBlocklistTable)().createOrReplace({id:n}):yield(0,s.getBlocklistTable)().remove(n),!0}catch(e){throw __LOG__(4,!0,new Error,!0)`send set block failed`,SEND_LOGS("Failed to send set block"),new Error("send set block failed")}}))).apply(this,arguments)}function c(){return(c=(0,i.default)((function*(e){const t=yield(0,l.getBlockingStatusForPSAUser)();try{const n=e.toString();return t?(yield(0,s.getBlocklistTable)().createOrReplace({id:n}),!0):(yield(0,s.getBlocklistTable)().remove(e.toString()),!1)}catch(e){throw __LOG__(4,!0,new Error,!0)`failed to update blocking status of psa user`,SEND_LOGS("Failed to update blocking status of psa user"),new Error("failed to update blocking status of psa user")}}))).apply(this,arguments)}},643131:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setChecksum=function(e){return(0,r.setContactChecksum)(e),Promise.resolve()};var r=n(15321)},26074:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.contactSync=function(){return l.apply(this,arguments)};var i=r(n(348926)),a=n(76469),o=n(978538),s=n(669050);function l(){return(l=(0,i.default)((function*(e){const t=yield(0,a.getContactTable)().all();if(t.length>0){const n=t.map((e=>(0,s.createWid)(e.id)));return(0,o.syncContactListInChunksJob)(n,e)}}))).apply(this,arguments)}},750469:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setFrequent=function(e){const t={};return Object.keys(e).forEach((n=>{t[n]=e[n].map((e=>e.toString()))})),Promise.reject(new Error("unimplemented in MD mode"))}},375026:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.setPresenceAvailable=function(){(0,i.default)("available")},t.setPresenceUnavailable=function(){(0,i.default)("unavailable")},t.subscribePresence=function(e,t){let n;n=e instanceof o.default?e:(0,s.createWid)(e);return Promise.resolve((0,a.default)(n,t))};var i=r(n(263354)),a=r(n(196506)),o=r(n(124928)),s=n(669050)},670903:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.persistProfilePicToDB=m,t.profilePicFind=E,t.profilePicResync=function(e){return Promise.all(e.map(function(){var e=(0,a.default)((function*(e){try{const t=yield E(e.id);return{id:e.id,eurl:t.eurl,tag:t.tag,previewEurl:t.previewEurl,stale:!1,eurlStale:!1,timestamp:Date.now()}}catch(t){if(t instanceof u.ServerStatusCodeError)switch(t.status){case 401:case 404:return{tag:"",id:e.id,stale:!1,eurlStale:!1,timestamp:Date.now()};default:return __LOG__(3)`ProfilePicThumb:resyncPictures error - ${t.status}, ${t.message}`,{id:e.id,stale:!1,eurlStale:!1,timestamp:Date.now()}}throw t}}));return function(){return e.apply(this,arguments)}}()))},t.requestDeletePicture=function(){return h.apply(this,arguments)},t.requestProfilePicFromServer=function(){return T.apply(this,arguments)},t.sendSetPicture=function(){return g.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(417405),s=n(924583),l=n(287461),u=n(984330),c=n(650572),d=(n(97858),n(476314)),p=n(391967),_=r(n(921733)),f=r(n(79291));n(459857),n(673168);function h(){return(h=(0,a.default)((function*(e){const t=(0,_.default)(e,null).then((()=>({_duplicate:!1,status:200}))),r=yield t;if(r._duplicate)return r;return(0,n(346702).changeProfilePicThumb)(e,d.PROFILE_PIC_COMMAND.REMOVE),r}))).apply(this,arguments)}function g(){return(g=(0,a.default)((function*(e,t,r){const i=f.default.parseDataURL(r).data,s=(0,o.decodeB64)(i),l=(0,_.default)(e,s).then((0,a.default)((function*(){const t=yield(0,c.getProfilePic)(e,{preview:!1});return{_duplicate:!1,tag:t.tag,eurl:t.eurl,status:200}}))),u=yield l;if(u._duplicate)return u;return(0,n(346702).changeProfilePicThumb)(e,d.PROFILE_PIC_COMMAND.SET),u}))).apply(this,arguments)}function m(){return y.apply(this,arguments)}function y(){return(y=(0,a.default)((function*(e,t){if((0,l.getABPropConfigValue)("web_enable_profile_pic_thumb_db_caching")){var n,r,i;const a={id:e.toString(),eurl:null!==(n=null==t?void 0:t.eurl)&&void 0!==n?n:null,previewEurl:null!==(r=null==t?void 0:t.previewEurl)&&void 0!==r?r:null,tag:null!==(i=null==t?void 0:t.tag)&&void 0!==i?i:null,timestamp:Date.now()};yield(0,p.getTable)().createOrReplace(a)}}))).apply(this,arguments)}function E(){return S.apply(this,arguments)}function S(){return(S=(0,a.default)((function*(e,t){const n=Promise.all([(0,c.getProfilePic)(e,(0,i.default)((0,i.default)({},t),{},{preview:!1})),(0,c.getProfilePic)(e,(0,i.default)((0,i.default)({},t),{},{preview:!0}))]).then((e=>{const t=e[0],n=e[1];return{eurl:t.eurl,tag:t.tag,previewEurl:n.eurl}}));try{const t=yield n;m(e,t).catch((e=>{__LOG__(3)`persistProfilePicToDB failed with error ${e.message}`})),t.eurl}catch(t){yield m(e)}return n}))).apply(this,arguments)}function T(){return(T=(0,a.default)((function*(e,t){try{const n=yield E(e,t);return(0,i.default)((0,i.default)({},n),{},{id:e,timestamp:Date.now(),eurlStale:!1,stale:!1})}catch(t){return(0,s.filteredCatch)(u.ServerStatusCodeError,(t=>{const n={id:e};switch(t.status){case 401:case 404:n.tag="",n.timestamp=Date.now(),n.eurlStale=!1,n.stale=!1;break;case 423:case 429:n.stale=!0;break;default:n.eurlStale=!1}return Promise.resolve(n)}))(t)}}))).apply(this,arguments)}},672604:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.queryExists=function(e){const t=e.isLid()?"":`+${e.toString()}`;if(e.isLid())return(0,r.queryExist)({type:"lid",wid:e});return(0,r.queryExist)({type:"phone",phone:t})},t.queryPhoneExists=function(e){return(0,r.queryExist)({type:"phone",phone:e})};var r=n(803737)},816076:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendMessageReport=function(e,t){return(0,a.reportSpam)(e.chat,t,e).then((e=>{if(null==e?void 0:e.errorCode)throw new r.ServerStatusCodeError(e.errorCode,e.errorText)}))},t.sendNotSpam=function(e){return(0,i.getChatTable)().merge(e.id.toString(),{notSpam:!0}).catch((()=>{throw __LOG__(4,!0,new Error,!0)`get chat table merge failed`,SEND_LOGS("get chat table merge failed when sending spam report"),new Error("get chat table merge failed")}))},t.sendSpamReport=function(e,t){return(0,a.reportSpam)(e,t).then((e=>{if(null==e?void 0:e.errorCode)throw new r.ServerStatusCodeError(e.errorCode,e.errorText)}))},t.sendStatusSpamReport=function(e,t){return(0,a.reportStatus)(e,t).then((e=>{if(null==e?void 0:e.errorCode)throw new r.ServerStatusCodeError(e.errorCode,e.errorText)}))};var r=n(984330),i=n(76469),a=n(662193)},603774:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getStatus=function(e){return(0,s.getAbout)(e).then((e=>e.error?(__LOG__(3)`getStatus: failed ${e.error.errorCode} : ${e.error.errorText}`,{id:e.id,stale:!0,status:""}):{id:e.id,status:null!=e.status?e.status:""}))},t.queryStatusAll=function(){return(0,o.getAllStatuses)()},t.sendReadStatus=function(){return c.apply(this,arguments)},t.setMyStatus=function(e){return(0,n(628905).getJobManager)().waitUntilCompleted(l.jobSerializers.setAbout(e))};var i=r(n(348926)),a=n(402994),o=n(316982),s=n(515309),l=n(323829),u=n(203146);function c(){return(c=(0,i.default)((function*(e,t){const n=e.id;try{return yield(0,u.markStatusRead)(n,t),e.ack=a.ACK.READ,!0}catch(e){return!1}}))).apply(this,arguments)}},901289:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateLocal=function(e,t){return(0,i.getTable)().merge((0,r.toPhoneUserJid)(e.user),t)};var r=n(714443),i=n(490474)},782093:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendCreateGroup=function(e,t,n,a,o,s,l,u){return(0,r.createGroup)(e,t,l,u).then((e=>({gid:(0,i.toGroupWid)(e.wid),participants:e.participants.map((e=>({userWid:e.wid,code:null!=e.error?e.error.toString():"200",invite_code:e.invite_code,invite_code_exp:e.invite_code_exp})))})))};var r=n(247355),i=n(669050)},735917:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.markExited=function(e){return(0,a.getTable)().merge(e.toString(),{isReadOnly:!0})},t.sendExitGroup=function(e){return(0,i.leaveGroup)(e).then((e=>{if(200!==e.code)throw new r.ServerStatusCodeError(e.code);return{_duplicate:null}}))};var r=n(984330),i=n(150869),a=n(76085)},380310:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.findGroupMetadata=function(){return c.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(209639),s=n(297031),l=r(n(342310)),u=n(926209);function c(){return(c=(0,a.default)((function*(e){let t=null,r=null,a=()=>{};const c=n(318797).default.get(e);if(c){if(c.participantQueryPromise)return __LOG__(2)`findGroupMetadata: ${e} - pending participant query`,c.participantQueryPromise.then((()=>({id:e})));c.participantQueryPromise=new Promise((e=>{a=e}))}else{var p;if(t=yield(0,s.getGroupMetadataJob)(e),!t)return __LOG__(2)`findGroupMetadata: ${e} - query missing group participant`,d(e);(0,u.updateSubject)(e,null!==(p=t.subject)&&void 0!==p?p:"")}try{var _,f,h,g,m;if((!c||c.stale)&&(r=yield(0,s.getGroupParticipantJob)(e),!r))return __LOG__(2)`findGroupMetadata: ${e} - query missing group participant`,d(e);const n=(0,i.default)((0,i.default)({id:e},t),{},{participants:null===(_=r)||void 0===_?void 0:_.participants,pastParticipants:null===(f=r)||void 0===f?void 0:f.pastParticipants,deviceStale:r?r.staleType===o.STALE_TYPES.DEVICE:void 0,cachedDeviceCount:null===(h=r)||void 0===h?void 0:h.deviceCount,cachedDeviceSizeBucket:(null===(g=r)||void 0===g?void 0:g.deviceCount)?(0,l.default)(r.deviceCount):null});if((null===(m=r)||void 0===m?void 0:m.staleType)===o.STALE_TYPES.PARTICIPANT){__LOG__(2)`findGroupMetadata: ${e} - query stale group participant`;const t=yield d(e);null!=(null==t?void 0:t.participants)&&(n.participants=t.participants)}return n}finally{a(),c&&(c.participantQueryPromise=null)}}))).apply(this,arguments)}function d(){return p.apply(this,arguments)}function p(){return(p=(0,a.default)((function*(e){var t;const n=yield(0,u.sendQueryGroup)(e);return(0,u.updateSubject)(e,null!==(t=null==n?void 0:n.subject)&&void 0!==t?t:""),n}))).apply(this,arguments)}},699706:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getPendingParticipants=function(e){return(0,o.getPendingParticipants)(e)},t.sendJoinGroupViaInviteV4=function(e,t,n,r){return(0,s.joinGroupViaInviteV4)(e,t,n,r)},t.sendQueryGroupInviteV4=function(){return l.apply(this,arguments)},t.sendRevokeGroupInviteV4=function(e,t){return(0,s.revokeGroupInviteV4)(e,t)};var i=r(n(81109)),a=r(n(348926)),o=n(298466),s=n(613247);function l(){return(l=(0,a.default)((function*(e,t,n,r,a){const o=yield(0,s.queryGroupInviteV4)(e,t,n,r,a);return!0===o.phashMatch?{status:200,phashMatch:!0}:null!=o.groupMetadata?(0,i.default)({},o.groupMetadata):{status:o.status}}))).apply(this,arguments)}},824737:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.revokeGroupInvitesV4=function(){return u.apply(this,arguments)};var i=r(n(348926)),a=n(298466),o=n(74927),s=n(301460),l=n(69769);function u(){return(u=(0,i.default)((function*(e,t,n,r){const i=yield(0,a.revokeGroupInvites)(e,t,n,r),u=(null==i?void 0:i.map((e=>e.id)))||[];(yield(0,l.msgFindByIds)(u)).map((e=>{var t;null===(t=s.MsgCollection.get(e.id))||void 0===t||t.set({inviteCodeExp:"0"}),e.inviteCodeExp="0",(0,o.updateExistingMessages)([e],e.id.remote)}))}))).apply(this,arguments)}},926209:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.sendQueryGroup=function(){return d.apply(this,arguments)},t.sendQueryGroupInvite=function(e){return(0,c.queryGroupInvite)(e).then((e=>(0,i.default)({status:200},e)))},t.updateSubject=p;var i=r(n(81109)),a=r(n(348926)),o=n(425315),s=n(984330),l=n(121977),u=n(945176),c=n(113269);function d(){return(d=(0,a.default)((function*(e){__LOG__(2,void 0,void 0,void 0,["groups"])`querying server for groupMetadata of group id ${e.toString()}`;const t=(0,u.queryGroupJob)(e);try{const s=yield t;var n,r,i,a,o,l,c,d,_,f,h;if(s.id)return p(e,s.subject),{id:s.id,owner:s.owner,creation:s.creation,subject:s.subject,desc:s.desc,descId:s.descId,descOwner:s.descOwner,descTime:s.descTime,restrict:null!==(n=s.restrict)&&void 0!==n&&n,announce:null!==(r=s.announce)&&void 0!==r&&r,noFrequentlyForwarded:null!==(i=s.noFrequentlyForwarded)&&void 0!==i&&i,ephemeralDuration:null!==(a=s.ephemeralDuration)&&void 0!==a?a:0,membershipApprovalMode:s.membershipApprovalMode,participants:s.participants,support:null!==(o=s.support)&&void 0!==o&&o,suspended:null!==(l=s.suspended)&&void 0!==l&&l,terminated:null!==(c=s.terminated)&&void 0!==c&&c,parentGroup:s.parentGroup,isParentGroup:null!==(d=s.isParentGroup)&&void 0!==d&&d,isParentGroupClosed:null!==(_=s.isParentGroupClosed)&&void 0!==_&&_,defaultSubgroup:null!==(f=s.defaultSubgroup)&&void 0!==f&&f,incognito:null!==(h=s.incognito)&&void 0!==h&&h};__LOG__(3)`Store:GroupMetadata Unexpected server response`}catch(t){if(t instanceof s.ServerStatusCodeError&&t.status>=400)return{id:e,stale:!1};throw t}}))).apply(this,arguments)}function p(e,t){(0,o.isString)(t)&&l.ContactCollection.find(e).then((function(e){e.name||e.set({name:t})}))}},851460:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isLoggedIn=function(){return(0,r.isRegistered)()&&i},t.setIsConnectedAsRegistered=function(e){i=e};var r=n(673168);let i=!1},577673:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.queryServerProps=function(){return(0,a.default)().then((e=>{if(e.success)return e.result;throw new i.ServerStatusCodeError(e.errorCode,e.errorText)}))};var i=n(984330),a=r(n(820973))},108507:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.sendQueryMediaConn=function(e){return(0,o.backoff)({delay:e=>{let{taskDuration:t}=e;const n=1e3*c();return Math.max(n-t,0)},signal:e},function(){var t=(0,a.default)((function*(t){const n=(0,u.queryMediaConn)(e);try{const e=yield n;let{ttl:t,authTTL:r}=e;return null==r?(r=1e3*t,t=3e5):(r*=1e3,t*=1e3),(0,i.default)((0,i.default)({},e),{},{authTTL:r,ttl:t})}catch(e){if(e instanceof l.E507)throw e;if(e instanceof l.ServerStatusCodeError&&e.status>=500)return t(e);throw e}}));return function(){return t.apply(this,arguments)}}())};var i=r(n(81109)),a=r(n(348926)),o=n(360336),s=n(663166),l=n(984330),u=n(949241);const c=(0,s.createTimer)({algo:{type:"fibonacci",first:0,second:1},max:9e5,jitter:.25})},670913:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return i.RequestMediaReuploadManager.requestMediaReupload(e).then((e=>{let{result:t,directPath:n}=e;return{status:a(t),directPath:n,isMD:!0}}))};var r=n(229479),i=n(994451);function a(e){if(null!=e)switch(e){case r.MediaRetryNotification$ResultType.SUCCESS:return 200;case r.MediaRetryNotification$ResultType.NOT_FOUND:case r.MediaRetryNotification$ResultType.DECRYPTION_ERROR:return 404;case r.MediaRetryNotification$ResultType.GENERAL_ERROR:return 500}return 500}},403688:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.updateLocal=o,t.updateLocalAndModel=function(){return s.apply(this,arguments)};var i=r(n(348926)),a=n(121260);function o(e,t){return(0,a.getTable)().merge(e.toString(),t).catch((e=>{throw __LOG__(4,!0,new Error,!0)`updateLocal: failed to update in storage`,SEND_LOGS("message updateLocal failed"),e}))}function s(){return(s=(0,i.default)((function*(e,t){try{yield o(e,t);const r=n(301460).MsgCollection.get(e);r&&r.set(t)}catch(e){return Promise.reject(new Error(`[messaging] updateLocalAndModel: failed with error ${e}`))}}))).apply(this,arguments)}},2647:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getHighestAck=function(){return s.apply(this,arguments)};var i=r(n(348926)),a=n(402994),o=n(739245);function s(){return(s=(0,i.default)((function*(e){const t=yield o.MsgInfoCollection.find(e.id);if(!t)return __LOG__(2)`getHighestAck: no orphan ack found for ${e.id}`,null;let n=null,r=null;return 0===t.playedRemaining&&0!==t.played.length?(r=a.ACK.PLAYED,n=t.played):0===t.readRemaining&&0!==t.read.length?(r=a.ACK.READ,n=t.read):0===t.deliveryRemaining&&0!==t.delivery.length&&(r=a.ACK.RECEIVED,n=t.delivery),null==r||null==n?(__LOG__(2)`getHighestAck: orphan ack has 0 receipt for ${e.id}`,null):(__LOG__(2)`getHighestAck: orphan ack ${r} for ${e.id}`,{ack:r,t:Math.max(...n.map((e=>e.t))),to:e.to,from:e.from,deliveryPrivacyMode:t.deliveryPrivacyMode})}))).apply(this,arguments)}},69769:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.msgFindByIds=function(e){return(0,r.getMsgsByMsgKey)(e).catch((e=>{throw __LOG__(4,!0,new Error,!0)`msgFindByIds: failed to find msg in storage`,SEND_LOGS("msgFindByIdsMD failed"),e}))},t.msgFindQuery=function(e,t){return(0,r.msgFindQuery)(e,t).catch((e=>{throw __LOG__(3,!0)`msgFindQuery: failed to find msg in storage`,e}))},t.queryVcard=function(e){return(0,r.queryVcard)(e).catch((e=>{throw __LOG__(4,!0,new Error,!0)`queryVcard: failed to find vCard in storage`,SEND_LOGS("queryVcardMD failed"),e}))};var r=n(74927)},42954:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.sendQueryMsgInfo=function(){return l.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(486492),s=n(373070);function l(){return(l=(0,a.default)((function*(e){const{id:t}=e,n=(0,o.queryMsgInfo)(e.id).catch((e=>{throw __LOG__(4,!0,new Error,!0)`sendQueryMsgInfo: failed to find msg info in storage`,SEND_LOGS("queryMsgInfo failed"),e})),r=yield n;return(0,i.default)((0,i.default)({},r),{},{id:t,usePlayReceipt:e.type===s.MSG_TYPE.PTT||e.isViewOnce})}))).apply(this,arguments)}},914436:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.sendQueryReactions=function(){return p.apply(this,arguments)},t.updateHasReactionInParent=d;var i=r(n(81109)),a=r(n(348926)),o=n(402994),s=n(297673),l=r(n(565754)),u=n(459857),c=n(403688);function d(e,t){const r=n(301460).MsgCollection.get(e);return r&&r.hasReaction!==t?(0,c.updateLocalAndModel)(r.id,{hasReaction:t}):Promise.resolve()}function p(){return(p=(0,a.default)((function*(e){const t=yield(0,s.getReactions)(e.id.toString()).catch((e=>{throw __LOG__(4,!0,new Error,!0)`getReactions: failed with error: ${e.name} message: ${e.message}`,SEND_LOGS("getReactions failed"),e})),n=t.reactions.map((e=>{const t=e.senders.map((e=>(0,i.default)((0,i.default)({},e),{},{id:l.default.fromString(e.msgKey),isSendFailure:(0,u.isSerializedWidMe)(e.senderUserJid)&&e.ack===o.ACK.CLOCK})));return(0,i.default)((0,i.default)({},e),{},{hasReactionByMe:e.hasReactionByMe,id:e.aggregateEmoji,senders:t})})),r=n.length>0;return yield d(e.id.toString(),r),(0,i.default)((0,i.default)({},t),{},{id:e.id,reactions:n})}))).apply(this,arguments)}},881560:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendDeliveryReceiptsAfterPresence=function(){(0,r.sendDeliveryReceiptsAfterPresence)()};var r=n(124240)},59293:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendMsgRecord=function(e){let t;e.isForwarded&&(t=(0,i.createMessageForwardMetric)(e));const{encryptAndSendMsg:o}=n(919820);return o(e).catch((t=>{throw __LOG__(3,void 0,void 0,void 0,["messaging"])`sendMsgRecord: MD send failure, msg: ${e.id.toString()}`,(0,a.updateLocalAndModel)(e.id,{isSendFailure:!0}),(0,r.updateAddOnSendStatesForMsgAction)(e,{isSendFailure:!0}),t})).then((e=>(t&&(0,i.logMessageMetric)(t),{t:parseInt(e.t,10),data:null})))};var r=n(980330),i=n(643011),a=n(403688)},643011:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageForwardMetric=function(e){let t=Boolean(e.caption);(0,s.documentWithCaptionsSendEnabled)()&&e.type===u.MSG_TYPE.DOCUMENT&&(t=e.isCaptionByUser);const r={messageType:e.getWamMessageType(),messageMediaType:e.getWamMediaType(),mediaCaptionPresent:t,fastForwardEnabled:!0,messageIsFanout:!0,isFrequentlyForwarded:Boolean(e.isFrequentlyForwarded),isForwardedForward:Boolean(e.numTimesForwarded>1)};null!=e.ephemeralDuration&&(r.ephemeralityDuration=e.ephemeralDuration);if(!e.isGroupMsg){const t=(0,c.getMaybeMeUser)(),i=n(298592).getDisappearingModeSettingForUser,a=i(t);null!=a&&(r.senderDefaultDisappearingDuration=a.duration);const o=i(e.to);null!=o&&(r.receiverDefaultDisappearingDuration=o.duration)}const i=e.getWamDisappearingModeInitiator();null!=i&&(r.disappearingChatInitiator=i);const a=(0,d.getGroupTypeFromChatWid)(e.to);null!=a&&(r.typeOfGroup=a);return new p.default.ForwardSend(r)},t.logMessageMetric=function(e){e.markMessageSendT(),e.commit()},t.logMessageSendForChatThreadLogging=function(e){var t;if(!(0,o.shouldIncrementMsgSendAndReceive)(e))return;const n=(null===(t=e.quotedMsg)||void 0===t?void 0:t.type)===u.MSG_TYPE.PRODUCT&&e.isSentByMe&&e.chat.contact.isBusiness;(0,a.handleActivitiesForChatThreadLogging)([{activityType:"msgSend",chatId:e.id.remote,ts:(0,i.unixTime)(),isViewOnce:Boolean(e.isViewOnce),isReaction:e.isReaction(),isForwarded:e.isForwarded,isCommerceMessage:(0,o.isCommerceMessage)(e),isPdpInquiry:n,isReply:(0,l.isReplyMsg)(e)}])};var i=n(990445),a=n(698867),o=n(257147),s=n(97858),l=n(973480),u=n(373070),c=n(459857),d=n(313556),p=r(n(571834))},567432:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return function(e,t){const n=new Uint8Array((0,s.decodeB64)(e)),i=(0,c.unixTime)();return f=t,h=function(){var e=(0,a.default)((function*(e){const r=yield(0,_.default)(n,i);if(null==r?void 0:r.errorCode){if(r.errorCode>=500)throw new d.ServerStatusCodeError(r.errorCode,r.errorText);e(t)}e(void 0)}));return function(){return e.apply(this,arguments)}}(),(0,u.promiseLoop)(function(){var e=(0,a.default)((function*(e,t,n){const i=(0,l.delayMs)((0,o.expBackoff)(n,12e4,1e3,.1));try{return yield p.default.waitIfOffline({signal:(new r).signal}),yield h(e)}catch(t){return n>1?(__LOG__(3)`wam:sendLogs failure error: ${String(t)}`,e(f)):i}}));return function(){return e.apply(this,arguments)}}());var f,h}(e,t)};var a=i(n(348926)),o=n(989211),s=n(417405),l=n(36530),u=n(962833),c=n(990445),d=n(984330),p=i(n(99398)),_=i(n(122596))},389279:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!(0,c.getABPropConfigValue)("web_ps_v3_enabled"))return Promise.resolve(t);const n=new Uint8Array((0,s.decodeB64)(e));return i=t,_=function(){var e=(0,a.default)((function*(e){const{uploadedBufferKeys:r,metrics:i}=yield(0,f.upload_UNSAFE_INTERNAL_DO_NOT_USE)([{key:t,content:n}],d.getToken);i.map(h),0===r.length&&e(t),e(void 0)}));return function(){return e.apply(this,arguments)}}(),(0,u.promiseLoop)(function(){var e=(0,a.default)((function*(e,t,n){const a=(0,l.delayMs)((0,o.expBackoff)(n,12e4,1e3,.1));try{return yield p.default.waitIfOffline({signal:(new r).signal}),yield _(e)}catch(t){return n>1?(__LOG__(3)`wam:sendLogs failure error: ${String(t)}`,e(i)):a}}));return function(){return e.apply(this,arguments)}}());var i,_};var a=i(n(348926)),o=n(989211),s=n(417405),l=n(36530),u=n(962833),c=n(287461),d=n(262732),p=i(n(99398)),_=i(n(571834)),f=n(515856);function h(e){const{result:t,uploadTime:n,httpResponseCode:r}=e,i=function(e){switch(e){case"success":return _.default.PS_BUFFER_UPLOAD_RESULT.SUCCESS;case"error-server-other":return _.default.PS_BUFFER_UPLOAD_RESULT.ERROR_SERVER_OTHER;case"error-parsing":return _.default.PS_BUFFER_UPLOAD_RESULT.ERROR_PARSING;case"error-decoding":return _.default.PS_BUFFER_UPLOAD_RESULT.ERROR_DECODING;case"error-credential":return _.default.PS_BUFFER_UPLOAD_RESULT.ERROR_CREDENTIAL;case"error-other":return _.default.PS_BUFFER_UPLOAD_RESULT.ERROR_OTHER;default:return _.default.PS_BUFFER_UPLOAD_RESULT.ERROR_ACCESS_TOKEN}}(t);new _.default.PsBufferUpload({psBufferUploadResult:i,psBufferUploadT:n,psBufferUploadHttpResponseCode:r,applicationState:"visible"===document.visibilityState?_.default.APPLICATION_STATE.FOREGROUND:_.default.APPLICATION_STATE.BACKGROUND}).commit()}},138811:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.prepareRetryReceiptBridge=function(e){return(0,n(45681).Z)(e)},t.sendCallEndBridge=function(){return Promise.resolve(null)},t.sendCallOfferBridge=function(e){return(0,n(635606).Z)(e,r.TYPE.OFFER)},t.sendCallSignalingMsgBridge=function(e){return(0,n(155602).Z)(e)},t.sendEncRekeyBridge=function(e){return(0,n(635606).Z)(e,r.TYPE.ENC_REKEY)},t.sendQueryCallBridge=function(){return Promise.resolve({status:200})};var r=n(549227)},486850:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=e.shift(),r=n(965012).ChatCollection,R=n(301460).MsgCollection;if(Array.isArray(t)){const e=[],s=[],l=[],c=[];t.forEach((function(t){if("c.us"===t.id)s.push(t);else{const n=!!r.get(t.id),i=["delete","clear","ephemeral","archive","unarchive","star","unstar","spam","modify_tag","pin","modify"].includes(t.type);i?n&&i?s.push(t):__LOG__(2)`Model:chat:handle received junk chat record: ${JSON.stringify(t)}`:e.push(t)}}));const p=e.find((e=>O.default.isPSA(e.id)));null!=p&&(p.name=E.default.t(862));const _=n(986632).AllStarredMsgsCollection;s.forEach((function(e){const t=e.type;if("c.us"===e.id.toString()){switch(r.disableSortListener(),t){case"clear":__LOG__(2)`Model:chat:handle:clear:all before:${String(e.before)} kind:${String(e.kind)}`,r.forEach((function(t){"number"==typeof e.before?t.deleteMsgsOlderThan(e.before,e.star,e.kind):t.deleteMsgs(e.star,e.kind)}));break;case"delete":__LOG__(2)`Model:chat:handle:delete:all`,r.toArray().forEach((function(e){e.isGroup?e.deleteMsgs(!0):l.push(e)}));break;case"archive":__LOG__(2)`Model:chat:handle:archive:all`,r.forEach((function(e){c.push({id:e.id,archive:!0,pin:void 0})}));break;case"unarchive":__LOG__(2)`Model:chat:handle:unarchive:all`,r.forEach((function(e){c.push({id:e.id,archive:!1})}));break;case"unstar":__LOG__(2)`Model:chat:handle:unstar:all`,_.delete(),r.forEach((function(e){e.unstarAll()}));break;default:__LOG__(3)`Model:chat:handle unknown ${JSON.stringify(e)}`}r.enableSortListener()}else{const n=r.get(e.id);if(!n)return;switch(t){case"ephemeral":if(null!=e.t){const t=(0,d.getLastReceivedNonExpiredMsg)(n,e.t);t&&(0,I.setLastReceivedKey)(n.id,t.id).then((()=>{n.lastReceivedKey=t.id}))}break;case"clear":case"star":case"unstar":if(e.keys){const n=e.keys.length,r="star"===t,i=[],a=[],o=[];let s=!1;for(let l=0;l<n;l++){let n,c,d,p,_;const f=e.keys[l];Array.isArray(f)?([n,c,d]=f,p=new v.default({fromMe:c,remote:e.id,id:n,participant:d}),_=R.get(p),_?"clear"===t?_.delete():(_.star=r,o.push(_)):r&&(s=!0)):!(0,u.default)(f)||"star"!==t&&"unstar"!==t||(p=f.id,_=R.get(f.id),_?(_.star=r,o.push(_)):a.push(f)),i.push(p&&p.toString())}"star"!==t&&"unstar"!==t||_.process(r,a,o,s),__LOG__(2)`model:Chat:handle:messages:${[t,e.id,i.join(),e.modifyTag].join()}`}else"clear"===t?("number"==typeof e.before?n.deleteMsgsOlderThan(e.before,e.star,e.kind):n.deleteMsgs(e.star,e.kind),__LOG__(2)`model:Chat:handle cleared chat:${[e.id,e.before,e.modifyTag,e.kind].join()}`):"unstar"===t&&(n.unstarAll(),__LOG__(2)`model:Chat:handle unstarred chat: ${e.id}`);isNaN(e.modifyTag)||c.push({id:e.id,modifyTag:e.modifyTag});break;case"delete":l.push(n),__LOG__(2)`model:Chat:handle deleted chat for ${String(e.id)}`;break;case"archive":c.push({id:e.id,archive:!0,pin:void 0});break;case"unarchive":c.push({id:e.id,archive:!1});break;case"spam":c.push({id:e.id,notSpam:e.notSpam});break;case"modify_tag":c.push({id:e.id,modifyTag:e.modifyTag});break;case"pin":c.push({id:e.id,pin:e.pin});break;case"modify":c.push({id:e.id,changeNumberOldJid:e.changeNumberOldJid,changeNumberNewJid:e.changeNumberNewJid})}}}));return(0,T.getStorage)().lock(["chat"],function(){var t=(0,o.default)((function*(t){let[n]=t;try{return yield n.bulkCreateOrMerge(e.map((e=>(0,a.default)((0,a.default)({},e),{},{id:e.id.toString()})))),yield Promise.all(c.map((e=>{const{id:t}=e,r=(0,i.default)(e,M);n.merge(t.toString(),r)}))),n.bulkRemove(l.map((e=>e.id.toString())))}catch(e){__LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("ChatHandler: bulk handle error")}}));return function(){return t.apply(this,arguments)}}()).then((()=>{r.add(e,{merge:!0}),c.forEach((e=>{const{id:t}=e,n=(0,i.default)(e,b),a=r.get(t);a&&a.set(n)})),l.forEach((e=>e.delete()))}))}if("leave"===t.cmd)t.gids.forEach((function(e){const t=r.get(e);t&&(0,g.localExitGroup)(t)}));else{if("preempt"===t.cmd){let e=Promise.resolve();return e=(0,A.getTable)().bulkCreateOrMerge(t.response.map((e=>(0,a.default)((0,a.default)({},e),{},{id:e.id.toString(),muteExpiration:0,isAutoMuted:!1})))),e.then((()=>(0,c.frontendSendAndReceive)("chatCollectionAdd",{things:t.response,options:{merge:!0}}))).then((()=>{f.Conn.platform!==S.PLATFORMS.IPHONE&&f.Conn.platform!==S.PLATFORMS.SMBI||((0,l.default)(t.response)?(0,c.frontendFireAndForget)("msgCollectionTrigger",{name:_.COLLECTION_HAS_SYNCED}):setTimeout((()=>{(0,c.frontendFireAndForget)("msgCollectionTrigger",{name:_.COLLECTION_HAS_SYNCED})}),2500)),(0,c.frontendFireAndForget)("chatCollectionTrigger",{name:_.COLLECTION_HAS_SYNCED,args:{count:t.response.length,binarySize:t.binarySize}})}))}if("action"===t.cmd){const e=t.id,n=t.data;if("create"!==n[0]&&"introduce"!==n[0]){if(n.length<3)return void __LOG__(3)`model:chat: incorrect length of payload data for action ${JSON.stringify(t)}`;const e=t.data[0],r="unknown"===t.data[1]?null:t.data[1];let i;return i=e===y.GROUP_ACTIONS.RESTRICT||e===y.GROUP_ACTIONS.ANNOUNCE||e===y.GROUP_ACTIONS.NO_FORWARD?{action:e,value:t.data[2]}:e===y.GROUP_ACTIONS.EPHEMERAL?{action:e,duration:t.data[2]}:(0,a.default)({action:e},t.data[2]),(0,C.updateModelForGroupAction)({chatId:t.id,author:r},i)}{const t=n[1],i=n[2],a=[...(0,s.default)(i.admins,(e=>({id:e,isAdmin:!0}))),...(0,s.default)(i.superadmins||[],(e=>({id:e,isAdmin:!0,isSuperAdmin:!0}))),...(0,s.default)(i.regulars,(e=>({id:e,isAdmin:!1})))];m.default.add({id:e,creation:i.creation,owner:t,participants:a,stale:!1,desc:i.desc,descId:i.descId,descTime:i.descTime,descOwner:i.descOwner,restrict:!!i.restrict,announce:!!i.announce},{merge:!0}),h.ContactCollection.add({id:e,name:i.subject},{merge:!0});const o=r.get(e);if(!o)return;const l=o.msgs.last();if(!l)return;if("gp2"===l.type&&"add"===l.subtype){const t=(0,P.getMaybeMeUser)();m.default.trigger(`group_participant_change_${t.toString()}`,e),(0,P.isMePrimary)(l.recipients[0])&&p.Cmd.alertNewMsg(l)}}}else __LOG__(3)`model:chat: unknown payload: ${JSON.stringify(t)}`}};var i=r(n(506479)),a=r(n(81109)),o=r(n(348926)),s=r(n(435161)),l=r(n(441609)),u=r(n(513218)),c=n(359987),d=n(103846),p=n(780549),_=n(292220),f=n(266888),h=n(121977),g=n(231414),m=r(n(318797)),y=n(862159),E=r(n(932325)),S=n(828770),T=n(605316),v=r(n(565754)),A=n(76085),C=n(526128),P=n(459857),O=r(n(124928)),I=n(814929);const M=["id"],b=["id"]},287461:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getABPropConfigValue=function(e){var t;const n=r.ABPropConfigs[e],[a,o,s,l]=n,u=s;if(null==i)return __LOG__(3)`[ABProps] implementation needs to be set before its first access, config code: ${a}`,u;return null!==(t=i(e))&&void 0!==t?t:u},t.setGetABPropConfigValueImpl=function(e){i=e};var r=n(94728);let i=null},238196:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ABPropConfigCodeToName=void 0,t.bulkCreateOrReplaceABPropConfigs=function(e){let t=!1;e.forEach((e=>{s.set(e.configCode,e),!0===e.hasAccessed&&(a.accessedConfigs.add(e.configCode),null!=e.configExpoKey&&(a.exposureKeys.add(e.configExpoKey),t=!0))})),t&&(0,a.updateGlobalExpoKey)();l=!0},t.clearABPropConfigs=function(){s.clear(),a.accessedConfigs.clear(),a.exposureKeys.clear(),l=!1},t.getAllABPropConfigs=function(){return Array.from(s.values())},t.initializeABPropsCache=function(){(0,r.setGetABPropConfigValueImpl)(c)};var r=n(287461),i=n(94728),a=n(744655),o=n(827012);n(755985);const s=new Map;let l=!1;const u={};function c(e){const t=i.ABPropConfigs[e],[n,r,u,c]=t;return function(e){var t;if(!l)return __LOG__(3)`[ABProps] configs need to be initialized before its first access, config code: ${e}`,null;if(s.get(e)&&!a.accessedConfigs.has(e)){var n;const t=null===(n=s.get(e))||void 0===n?void 0:n.configExpoKey;null==t||a.exposureKeys.has(t)||(a.exposureKeys.add(t),(0,a.updateGlobalExpoKey)()),a.accessedConfigs.add(e),(0,o.setConfigAccessed)(e)}return null===(t=s.get(e))||void 0===t?void 0:t.configValue}(n)}t.ABPropConfigCodeToName=u,Object.keys(i.ABPropConfigs).forEach((e=>{const[t]=i.ABPropConfigs[e];u[t]=e})),Object.freeze(u)},94728:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ABPropConfigs=void 0;t.ABPropConfigs={order_details_total_order_minimum_value:[1719,"float",1,1],order_details_total_maximum_value:[1684,"float",5e3,5e3],order_details_total_minimum_value:[1683,"int",0,0],in_app_support_v2_enabled:[233,"bool",!1,!1],in_app_support_v2_locale_langs:[379,"string","",""],in_app_support_v2_numbers:[390,"string","",""],in_app_support_v2_number_prefixes:[1031,"string","15517868","15517868"],in_app_support_v2_jump_to_group:[819,"bool",!1,!1],in_app_support_v2_jump_to_group_wait_time_in_ms:[974,"int",5e3,5e3],quick_mute_enabled:[2765,"bool",!1,!1],groups_dogfooding_ui:[308,"bool",!1,!1],md_icdc_enabled:[309,"bool",!1,!1],md_icdc_hash_length:[310,"int",10,10],played_self_enabled:[361,"bool",!1,!1],ephemeral_24h_duration:[407,"bool",!1,!0],disappearing_mode:[536,"bool",!1,!1],payments_expressive_backgrounds_enabled:[605,"bool",!1,!0],ephemeral_allow_group_members:[432,"bool",!1,!0],business_profile_refresh_m1_enabled:[470,"bool",!1,!0],num_days_key_index_list_expiration:[730,"int",35,35],num_days_before_device_expiry_check:[731,"int",7,7],media_reupload_limit_mb:[1098,"int",100,100],portrait_thumb_enabled_chat:[1961,"bool",!1,!0],portrait_thumb_enabled_status:[1962,"bool",!1,!0],message_level_reporting:[535,"bool",!1,!0],native_shop_preview_enabled:[636,"bool",!1,!0],sync_archive_v2_setting:[736,"bool",!1,!1],ptt_conversation_waveform:[637,"bool",!1,!0],ptt_waveform_send:[746,"bool",!1,!0],adv_v2_m4_m5:[753,"bool",!1,!1],adv_v2_m6:[903,"bool",!1,!1],ptt_draft_enabled:[777,"bool",!1,!0],ptt_pausable_enabled:[871,"bool",!1,!0],tos_3_client_gating_biz_initiated_enabled:[953,"bool",!1,!1],tos_3_client_gating_enabled:[791,"bool",!1,!1],tos_3_client_force_fetch_enabled:[792,"bool",!1,!1],tos_client_state_fetch_enabled:[877,"bool",!1,!1],tos_client_state_force_fetch_enabled:[878,"bool",!1,!1],tos_client_state_fetch_iteration:[908,"int",0,0],country_client_gating_enabled:[1105,"bool",!1,!1],system_msg_numbers_fb_branded:[1035,"string","16505434800,16503130062,16507885324,16508620604,16504228206,447710173736,16315551023,16505361212,16508129150,16315555102,16315558723,16505212669,16507885280,19032707825,0","16505434800,16503130062,16507885324,16508620604,16504228206,447710173736,16315551023,16505361212,16508129150,16315555102,16315558723,16505212669,16507885280,19032707825,0"],system_msg_numbers_fb_inc:[1036,"string","",""],log_clock_skew:[1190,"bool",!1,!1],trusted_contacts:[794,"bool",!1,!1],trusted_contacts_sender:[995,"bool",!1,!1],trusted_contacts_ti:[922,"bool",!1,!1],tctoken_duration:[865,"int",604800,604800],tctoken_num_buckets:[909,"int",4,4],tctoken_duration_sender:[996,"int",604800,604800],tctoken_num_buckets_sender:[997,"int",4,4],reactions_receive:[827,"bool",!1,!0],reactions_send:[828,"bool",!1,!0],reactions_announcement_only:[1150,"bool",!1,!1],reaction_cleanup_days:[987,"int",31,31],reactions_chat_preview:[1605,"bool",!1,!0],reactions_animations:[1361,"bool",!1,!0],reactions_animations_simple:[1485,"bool",!1,!0],md_migration_experience:[861,"int",2,2],web_abprop_direct_connection_md:[869,"bool",!1,!0],media_upload_prekeys_fetch_enabled:[907,"bool",!1,!0],reactions_panel_prekeys_fetch_enabled:[1828,"bool",!1,!0],status_quick_reply_enabled:[1455,"bool",!1,!0],status_quick_reply_receiver_changes_enabled:[1974,"bool",!1,!0],ptt_remember_play_position:[952,"bool",!1,!0],banned_shops_ux_enabled:[957,"bool",!1,!0],group_suspend_v0_enabled:[973,"bool",!1,!0],parent_group_view_enabled:[982,"bool",!1,!0],parent_group_create_enabled:[1173,"bool",!1,!0],parent_group_query_ts:[1228,"int",0,0],parent_group_link_limit:[1238,"int",50,10],community_announcement_group_size_limit:[2774,"int",5e3,5e3],parent_group_link_limit_community_creation:[1990,"int",10,10],parent_group_admins_limit:[1655,"int",20,20],parent_group_view_enabled_for_smb_on_web:[2205,"bool",!1,!0],parent_group_create_enabled_for_smb_on_web:[2206,"bool",!1,!0],parent_group_create_privacy:[2356,"bool",!1,!0],parent_group_min_participants_for_group_entry_point:[2382,"int",20,20],parent_group_tap_to_request_enabled:[2436,"bool",!1,!0],parent_group_tap_to_add_enabled:[2446,"bool",!1,!0],parent_group_no_disclaimer:[2447,"bool",!1,!0],community_admin_promotion_one_time_prompt:[1864,"bool",!1,!1],document_preview_caption_changes_enabled:[2307,"bool",!1,!0],forwarded_ptt_ui_enabled:[1040,"bool",!1,!0],shops_storefront_url_format:[1054,"string","https://www.facebook.com/%s/shop/","https://www.facebook.com/%s/shop/"],message_count_logging_md_enabled:[1135,"bool",!1,!1],url_send_receive_logging_enabled:[2430,"bool",!1,!0],inline_video_playback_additional_logging_enabled:[2431,"bool",!1,!0],dev_prop_string:[1064,"string","",""],dev_prop_boolean:[1065,"bool",!1,!1],dev_prop_int:[1066,"int",0,0],dev_prop_float:[1067,"float",0,0],order_details_from_cart_enabled:[1107,"bool",!1,!0],order_details_custom_item_enabled:[1176,"bool",!1,!0],order_details_from_catalog_enabled:[1212,"bool",!1,!0],md_app_state_critical_data_processing_logging:[1187,"bool",!1,!0],md_app_state_report_md_sync_mutation_stats:[1221,"bool",!1,!0],order_management_enabled:[1188,"bool",!1,!1],growth_lock_v0_enabled:[1204,"bool",!1,!0],smart_filters_enabled_consumer:[1287,"bool",!1,!0],md_offline_v2_m2_enabled:[1517,"int",10,10],profile_photo_rings_for_status_enabled:[1533,"bool",!1,!0],dc_edit_postcode_by_default_enabled:[1534,"bool",!1,!1],media_picker_select_limit:[2614,"int",30,30],media_picker_select_limit_new:[2693,"int",30,30],chatlist_filters_v1:[1608,"bool",!1,!1],community_suspend_v0_enabled:[1653,"bool",!1,!0],is_meta_employee_or_internal_tester:[1777,"bool",!1,!1],disable_auto_download:[1838,"bool",!1,!1],community_tab_m2:[2154,"bool",!1,!0],gif_autoplay_enabled:[2281,"bool",!1,!1],web_send_only_active_receipts:[1868,"bool",!1,!0],num_days_hosted_device_signed_identity_signature_expiration:[2461,"int",90,90],cag_member_key_rotation_optimization:[2521,"bool",!1,!1],elevated_push_names_v2_enabled:[2540,"bool",!1,!1],elevated_push_names_v2_m1_follow_up_enabled:[2763,"bool",!1,!1],smb_capi_coexistence_enabled:[2588,"bool",!1,!1],smb_client_side_linkshim_enabled:[2633,"bool",!0,!0],web_non_blocking_offline_resume_max_message_count:[2508,"int",1e3,1e3],web_unified_flow:[1809,"int",0,0],smb_client_side_linkshim_signed_regexp:[2634,"string","https:\\/\\/n\\.wl\\.co\\/[^/]*\\/[^/]*\\/(.*)$","https:\\/\\/n\\.wl\\.co\\/[^/]*\\/[^/]*\\/(.*)$"],placeholder_message_key_hash_logging:[2639,"bool",!1,!0],use_appdata_stanza_on_receiver:[2795,"bool",!1,!1],use_appdata_stanza_on_sender:[2796,"bool",!1,!1],web_lazy_pull:[2814,"bool",!1,!1],offline_thread_meta_enabled:[2821,"bool",!1,!1],ctwa_data_max_length:[1841,"int",768,768],wa_ctwa_web_dc_logging_enabled:[2487,"bool",!1,!1],ig_reels_music_attribution:[1912,"bool",!1,!0],video_stream_buffering_ui_enabled:[2167,"bool",!1,!0],status_inline_link_preview_enabled:[1522,"bool",!1,!0],text_status_url_logging_enabled:[1851,"bool",!1,!0],status_reaction_emojis:[1852,"string","[128525, 128514, 128558, 128546, 128591, 128079, 127881, 128175]","[128525, 128514, 128558, 128546, 128591, 128079, 127881, 128175]"],status_reply_received_logging_enabled:[1859,"bool",!1,!0],status_caption_link_detection_enabled:[2032,"bool",!1,!0],status_view_error_type_logging_enabled:[2086,"bool",!0,!0],status_from_me_unseen_enabled:[2039,"bool",!1,!0],smb_collections_enabled:[451,"bool",!1,!0],consumer_collections_enabled:[582,"bool",!1,!0],smb_collections_appeal_flow_enabled:[724,"bool",!1,!1],smb_multi_device_awareness:[1074,"bool",!1,!0],smb_quick_replies_v2_enabled:[875,"bool",!1,!1],smb_ecommerce_compliance_india_m4:[1003,"bool",!1,!0],smb_ecommerce_compliance_india_m4_5:[1192,"bool",!1,!0],smart_filters_enabled:[1015,"bool",!1,!0],btm_threads_logging_enabled:[1022,"bool",!1,!0],native_commerce_threads_logging_enabled:[1034,"bool",!1,!0],threads_logging_observe_list_enabled:[1168,"bool",!1,!0],smb_hide_unsupported_currency_price:[1203,"bool",!1,!0],hyperlinked_phone_numbers_enabled:[1215,"bool",!1,!1],smb_catkit_query_version:[1229,"int",1,1],smb_phase_out_not_a_business:[1263,"bool",!1,!0],smb_phase_out_not_a_business_V2:[1771,"bool",!1,!0],smb_threads_logging_enabled:[1251,"bool",!1,!0],smb_click_to_chat_logging_enabled:[1252,"bool",!1,!0],smb_broadcast_logging_enabled:[1253,"bool",!1,!0],smb_status_logging_enabled:[1254,"bool",!1,!0],smb_biz_profile_logging_enabled:[1255,"bool",!1,!0],smb_registration_flow_logging_enabled:[1256,"bool",!1,!0],btm_qpl_enabled:[1272,"bool",!1,!0],smb_temp_cover_photo_privacy_messaging:[1913,"bool",!1,!0],show_shops_sunset_banner:[1949,"bool",!1,!0],qpl_enabled:[212,"bool",!1,!0],qpl_upload_delay:[215,"int",1440,1],qpl_sampling_as_string:[466,"string",'json:{"sampling":[]}','json:{"sampling":[]}'],qpl_initial_upload_delay:[1223,"int",5,1],is_meta_employee:[1570,"bool",!1,!1],should_deregister_on_syncd_fatal:[383,"bool",!0,!0],group_catch_up:[559,"bool",!1,!1],web_abprop_ctwa_context_compose_enabled:[591,"bool",!1,!1],web_abprop_group_description_length:[592,"int",0,0],web_abprop_ephemeral_messages_allowed_values:[593,"string","604800","604800"],web_abprop_collections_display:[584,"bool",!1,!1],multi_select_from_chat_list:[2312,"bool",!1,!0],web_abprop_collections_management:[585,"bool",!1,!1],web_abprop_drop_full_history_sync:[600,"bool",!1,!1],web_abprop_business_profile_incomplete_nux_banner:[710,"bool",!1,!1],web_abprop_product_catalog_nux_banner:[711,"bool",!1,!1],web_abprop_click_nux_banner_migration:[712,"bool",!1,!1],web_abprop_ecommerce_compliance_india:[717,"bool",!1,!1],web_abprop_edit_ecommerce_compliance_india:[826,"bool",!1,!1],drop_last_name:[726,"bool",!1,!1],web_abprop_catalog_icon_on_top_bar:[734,"bool",!1,!1],web_abprop_collections_nux_banner:[741,"bool",!1,!1],nfm_rendering_enabled:[760,"bool",!1,!1],web_abprop_nux_cart_interstitial:[761,"bool",!1,!1],web_abprop_business_profile_refresh_status_enabled:[763,"bool",!1,!1],web_abprop_business_profile_refresh_linked_account_enabled:[764,"bool",!1,!1],web_abprop_business_profile_refresh_edit_cover_photo_enabled:[765,"bool",!1,!1],web_abprop_business_profile_refresh_cover_photo_view_enabled:[766,"bool",!1,!1],elevated_important_msg:[809,"bool",!1,!1],web_privacy_settings:[837,"bool",!1,!1],web_privacy_settings_v2:[1226,"bool",!1,!1],web_status_psa:[873,"bool",!1,!1],web_status_psa_history_sync:[1095,"bool",!1,!1],web_2fa:[1195,"bool",!1,!1],web_abprop_stateful_enumeration_enabled:[887,"bool",!0,!0],web_abprop_block_catalog_creation_ecommerce_compliance_india:[894,"bool",!1,!1],web_sticker_store:[930,"bool",!1,!1],web_proactive_prekeys_fetch_group_size_limit:[937,"int",0,0],web_favorite_stickers:[962,"bool",!1,!1],web_orchestrator_enabled_version:[984,"string","bucket","bucket"],web_wam_v5_enabled:[1033,"bool",!1,!1],web_ps_v3_enabled:[1114,"bool",!1,!1],web_shop_storefront_message:[1053,"bool",!1,!1],web_identity_store_cache:[1078,"bool",!1,!1],web_abprop_large_files_encryption_optimization:[1086,"bool",!1,!1],web_send_invisible_msg_to_new_groups:[1099,"bool",!1,!1],web_send_invisible_msg_min_group_size:[1100,"int",128,128],web_send_invisible_msg_max_group_size:[1945,"int",1024,1024],web_init_chat_batch_size:[1171,"int",100,100],web_init_chat_max_unread_message_count:[1172,"int",0,0],web_abprop_skip_file_copy_on_attach:[1174,"bool",!1,!1],reaction_history_sync:[1179,"bool",!1,!1],web_abprop_screen_sharing_enabled:[1189,"bool",!1,!1],web_graphql_for_catalog_m1:[1205,"bool",!1,!1],web_abprop_config_experiment_test:[1217,"bool",!1,!1],web_adaptive_offline_resume_enabled:[1224,"bool",!1,!1],web_wa_signal_enabled:[1225,"bool",!1,!1],web_gdpr_request_account_info_enabled:[1232,"bool",!1,!1],web_new_compose_box_input:[1243,"bool",!1,!1],web_abprop_document_resume_upload:[1247,"bool",!1,!1],more_reactions_option_desktop_beta_rollout:[1759,"bool",!1,!1],reactions_keyboard_hides_three_flags_desktop_beta_rollout:[1796,"bool",!1,!1],web_rotate_sender_key_if_sent:[1329,"bool",!1,!1],web_lru_cache_optimization:[1339,"bool",!1,!1],web_lru_cache_purge_logic_refactor:[1383,"bool",!1,!1],companion_min_versions:[1367,"string","json:[]","json:[]"],comparion_force_upgrade:[1368,"bool",!1,!1],web_abprop_business_profile_refresh_linked_accounts_killswitch:[1351,"bool",!1,!1],web_default_pull_mode_enabled:[1355,"bool",!1,!1],web_abprop_chatd_login_cookie_enabled:[1371,"bool",!1,!1],web_prekeys_fetch_first_batch_size:[1373,"float",0,0],md_app_state_gate_D34336913:[1379,"bool",!1,!1],web_address_capture_message_enabled:[1385,"bool",!1,!1],syncd_periodic_sync_days:[1400,"int",0,0],web_enable_hyperlinked_phone_numbers_ps_logging:[1401,"bool",!1,!1],web_get_maybe_me_user_optimization_enabled:[1451,"bool",!1,!1],web_should_fatal_on_missing_patch:[1461,"bool",!0,!0],web_reactions_send_desktop_beta_rollout:[1479,"bool",!1,!1],web_abprop_remove_uploaded_files:[1481,"bool",!1,!1],web_abprop_remove_downloaded_files:[1496,"bool",!1,!1],web_killswitch_s310872_mitigation:[2879,"bool",!1,!1],web_new_rich_text_input:[1507,"bool",!1,!1],web_syncd_max_mutations_to_process_during_resume:[1513,"int",1e3,1e3],reactions_skin_tone_aggregation:[1593,"bool",!1,!1],message_quick_reply:[1623,"bool",!1,!1],web_quantity_controls_enabled:[1659,"bool",!1,!1],web_unified_message_processing_enabled:[1633,"bool",!1,!1],web_push_notifications:[1643,"bool",!1,!0],web_notification_settings_v2:[1676,"bool",!1,!0],web_abprop_device_agnostic_voip:[1675,"bool",!1,!1],web_abprop_screen_lock_enabled:[1680,"bool",!1,!1],web_command_palette:[1726,"bool",!1,!1],web_group_profile_editor:[1745,"bool",!1,!1],web_quick_reply_authoring:[1751,"bool",!1,!1],web_accidental_delete_for_me:[1752,"bool",!1,!1],web_abprop_core_wam_runtime:[1753,"bool",!1,!1],web_profile_picture_db_cache_disabled:[1757,"bool",!1,!1],web_offline_resume_qpl_enabled:[1773,"bool",!1,!1],web_offline_resume_m3_enabled:[1802,"bool",!1,!1],web_syncd_fatal_fields_from_L1104589PRV2:[1808,"bool",!1,!1],web_media_editor_blur_tool:[1816,"bool",!1,!1],web_abprop_mute_notifications_on_app_focus:[1824,"bool",!1,!0],web_auto_mute_256_groups_confirmation:[2533,"bool",!1,!1],web_multi_skin_toned_emoji_picker:[1850,"bool",!1,!1],web_message_send_cache_warming_up:[1894,"bool",!1,!0],web_message_send_precalculate_icdc:[2801,"bool",!1,!0],web_ptt_streamer_upload:[1902,"bool",!1,!1],web_prekey_fetch_cache_warming_up:[1910,"bool",!1,!0],web_history_sync_ui:[1911,"bool",!1,!1],web_abprop_emoji_experimental_api:[1932,"bool",!1,!1],web_new_media_caption_input:[1959,"bool",!1,!1],web_chatlist_toggle:[1964,"bool",!1,!0],web_electron_deprecation_windows_sideload_stage1_awareness:[1985,"bool",!1,!1],web_electron_deprecation_windows_sideload_stage2_compatible_expiry_kickoff:[1986,"bool",!1,!1],web_electron_deprecation_windows_sideload_stage2_compatible_expiry_delay:[1987,"int",0,0],web_electron_deprecation_windows_sideload_stage2_incompatible_expiry_kickoff:[1988,"bool",!1,!1],web_electron_deprecation_windows_sideload_stage2_incompatible_expiry_delay:[1989,"int",0,0],web_message_list_a11y_redesign:[2016,"bool",!1,!1],web_enable_profile_pic_thumb_db_caching:[2018,"bool",!1,!1],web_enable_biz_catalog_view_ps_logging:[2056,"bool",!1,!1],web_abprop_media_links_docs_search:[2063,"bool",!1,!1],web_poll_creation_desktop_beta_rollout:[2179,"bool",!1,!1],web_poll_receiving_desktop_beta_rollout:[2181,"bool",!1,!1],web_file_streaming_upload:[2210,"bool",!1,!1],web_new_group_member_search:[2220,"bool",!1,!1],web_max_contacts_to_show_common_groups:[2264,"int",10,10],web_max_found_common_groups_displayed:[2268,"int",10,10],web_fp_reparsing_for_non_add_ons:[2231,"bool",!1,!1],web_message_custom_aria_label:[2280,"bool",!1,!1],web_message_list_a11y_redesign_beta_only:[2294,"bool",!1,!1],web_poll_spam_report:[2303,"bool",!1,!1],web_electron_active_reload:[2322,"bool",!1,!1],desktop_upsell_win_butterbar:[2348,"bool",!1,!1],desktop_upsell_win_ctas:[2349,"bool",!1,!1],desktop_upsell_win_dropdown_btn:[2725,"bool",!1,!1],documents_with_captions_send_desktop_beta_rollout:[2486,"bool",!1,!1],profile_photo_rings_for_status_on_web_enabled:[2512,"bool",!1,!0],voice_status_receipt_on_web_enabled:[2513,"bool",!1,!0],web_crypto_library_enabled:[2534,"bool",!1,!1],group_chat_profile_pictures_enabled_web_beta_rollout:[2543,"bool",!1,!1],web_message_plugin_backend_registration_enabled:[2545,"bool",!1,!1],query_verified_name_when_msg_differs:[2549,"bool",!1,!0],web_media_auto_download_enabled:[2555,"bool",!1,!0],web_media_auto_download_desktop_beta_enabled:[2556,"bool",!1,!0],link_preview_wait_time:[2566,"int",7,7],web_screen_lock_max_retries:[2622,"int",10,10],forward_media_with_caption_desktop_beta_rollout:[2664,"bool",!1,!1],web_new_status_reply_input:[2708,"bool",!1,!1],web_display_name_for_enterprise_biz_vlevel_low_killswitch:[2715,"bool",!1,!1],web_display_name_for_biz_vlevel_low_killswitch:[2716,"bool",!0,!0],web_message_plugin_frontend_registration_enabled:[2793,"bool",!1,!1],stop_abprops_traffic_in_serverprops_response:[315,"bool",!1,!1],group_chat_profile_pictures_enabled:[1825,"bool",!1,!1],commerce_metadata_supported_business:[1693,"string","+918591749310,+917977079770,+12245555037,+13072224829,+908502419528,+5511989238421,+5515997781156","+918591749310,+917977079770,+447766028329,+12245555037,+13072224829,+908502419528,+5511989238421,+5515997781156"],in_app_survey_phone_numbers:[1607,"string","16508638904","16508638904"],order_details_payment_instructions_enabled:[1595,"bool",!1,!0],enable_biz_activity_report_request:[455,"bool",!1,!1],plm_products_max_batch_fetch_size:[464,"int",18,18],enable_granular_reject_reasons:[550,"bool",!1,!1],elevating_profile_names_enabled:[604,"bool",!1,!1],enable_group_profile_editor:[689,"bool",!1,!1],csat_message_rating:[690,"bool",!1,!0],facebook_link_preview_use_thumbnail:[810,"bool",!1,!0],tam_attachment_cache_compaction_enabled:[838,"bool",!1,!1],business_threads_logging_enabled:[853,"bool",!1,!1],private_stats_biz_view_logging_enabled:[904,"bool",!1,!1],group_join_request_m0_anyone_can_join:[2367,"bool",!1,!1],group_join_request_m1:[1727,"bool",!1,!1],group_join_request_m2:[1728,"bool",!1,!1],group_join_request_m2_setting:[1887,"bool",!1,!1],group_join_request_m2_max_pending_participants_limit:[2418,"float",2,2],group_join_request_m3:[2369,"bool",!1,!1],group_join_request_m2_pushname:[2376,"bool",!1,!0],group_join_request_m2_banner_on_conversation:[2449,"bool",!1,!1],group_invite_new_bottom_sheet_enabled:[2749,"bool",!1,!1],note_to_self:[1967,"bool",!1,!1],note_to_self_entry_point:[2630,"bool",!1,!1],no_delete_message_time_limit:[1011,"bool",!1,!1],sender_revoke_window_sender:[1333,"bool",!1,!0],sender_revoke_window_receiver:[1334,"bool",!1,!0],sender_revoke_ui:[1335,"bool",!1,!0],admin_revoke_receiver:[1177,"bool",!1,!0],admin_revoke_sender:[1292,"bool",!1,!0],admin_revoke_history_sync_consumer:[1245,"bool",!1,!0],revokes_logging_unsampled:[1865,"bool",!0,!0],admin_hfm_toggle:[1021,"bool",!1,!0],csat_message_trigger:[1082,"bool",!1,!0],graphql_privacy_imp_m1:[1096,"bool",!1,!1],lthash_check_hours:[1104,"int",0,0],interactive_message_native_flow_killswitch:[1133,"bool",!1,!1],sender_key_expired_logging_enabled:[1185,"bool",!1,!1],group_size_bypassing_sampling:[1861,"int",1e5,1e5],group_size_limit:[1304,"int",257,257],v_id_deprecation_enabled:[2334,"bool",!1,!0],proactive_distribute_sender_keys_enabled:[2757,"bool",!1,!0],minimum_percentage_to_proactive_distribute_sender_keys:[2860,"int",200,50],address_message_native_flow_killswitch:[1538,"bool",!1,!1],commerce_sanctioned:[1319,"bool",!1,!1],commerce_bloks_apps_mapping:[1320,"string",'{"address_message":{"app_id":"com.bloks.www.whatsapp.commerce.address_message","expiration_secs":300,"version":"1.0","supported_businesses":["+918591749310","+917977079770"]},"galaxy_message":{"flow_message_version":{"1":{"min_android_app_supported_version":"2.22.21","min_ios_app_supported_version":"2.22.16"}},"app_id":"com.bloks.www.whatsapp.commerce.galaxy_message","expiration_secs":300,"version":"1.0","flows":{"5315848498536354":{"supported_businesses":["18785550326","19505550093","18055555085","12115551400","12165554570"]},"384213690506206":{"supported_businesses":["13072224829","908502213040"]},"785254429343710":{"supported_businesses":["13072224829","908502213040"]},"552092896712166":{"supported_businesses":["13072224829","908502213040"]},"659207712435246":{"supported_businesses":["13072224829","908502213040"]},"1218944301990105":{"supported_businesses":["13072224829","908502213040"]},"842529276647219":{"supported_businesses":["908502419528","905333860133"]},"2135286959994016":{"supported_businesses":["908502419528","905333860133"]},"465280328842503":{"supported_businesses":["908502419528","905333860133"]},"554437403152809":{"supported_businesses":["908502419528","905333860133"]},"1503880053408592":{"supported_businesses":["908502419528","905333860133"]},"1177261906521760":{"supported_businesses":["908502419528","905333860133"]},"5199590820090002":{"supported_businesses":["5511989238421"]},"615215783523200":{"supported_businesses":["5511989238421"]},"1160930701174631":{"supported_businesses":["5511989238421","555191894444"]},"2934205950056123":{"supported_businesses":["5511916282555"]},"5324889264212944":{"supported_businesses":["5511916282555"]},"3301029236883120":{"supported_businesses":["555139214004","555198849745"]},"774830743793476":{"supported_businesses":["555139214004","555198849745"]},"1493489641166601":{"supported_businesses":["555139214004","555198849745"]},"1115920052387436":{"supported_businesses":["555139214004","555198849745"]},"611775360605929":{"supported_businesses":["551147664020"]},"1283565282457467":{"supported_businesses":["551147664020"]},"673695173931335":{"supported_businesses":["551147664020"]},"508459817855605":{"supported_businesses":["442034673249","447418310027"]},"639247544356777":{"supported_businesses":["442034673249","447418310027"]},"2679509568858534":{"supported_businesses":["442034673249","447418310027"]}}}}','{"address_message":{"app_id":"com.bloks.www.whatsapp.commerce.address_message","expiration_secs":300,"version":"1.0","supported_businesses":["+918591749310","+917977079770"]},"galaxy_message":{"flow_message_version":{"1":{"min_android_app_supported_version":"2.22.21","min_ios_app_supported_version":"2.22.16"}},"app_id":"com.bloks.www.whatsapp.commerce.galaxy_message","expiration_secs":300,"version":"1.0","flows":{"5315848498536354":{"supported_businesses":["18785550326","19505550093","18055555085","12115551400","12165554570"]},"384213690506206":{"supported_businesses":["13072224829","908502213040"]},"785254429343710":{"supported_businesses":["13072224829","908502213040"]},"552092896712166":{"supported_businesses":["13072224829","908502213040"]},"659207712435246":{"supported_businesses":["13072224829","908502213040"]},"1218944301990105":{"supported_businesses":["13072224829","908502213040"]},"842529276647219":{"supported_businesses":["908502419528","905333860133"]},"2135286959994016":{"supported_businesses":["908502419528","905333860133"]},"465280328842503":{"supported_businesses":["908502419528","905333860133"]},"554437403152809":{"supported_businesses":["908502419528","905333860133"]},"1503880053408592":{"supported_businesses":["908502419528","905333860133"]},"1177261906521760":{"supported_businesses":["908502419528","905333860133"]},"5199590820090002":{"supported_businesses":["5511989238421"]},"615215783523200":{"supported_businesses":["5511989238421"]},"1160930701174631":{"supported_businesses":["5511989238421","555191894444"]},"2934205950056123":{"supported_businesses":["5511916282555"]},"5324889264212944":{"supported_businesses":["5511916282555"]},"3301029236883120":{"supported_businesses":["555139214004","555198849745"]},"774830743793476":{"supported_businesses":["555139214004","555198849745"]},"1493489641166601":{"supported_businesses":["555139214004","555198849745"]},"1115920052387436":{"supported_businesses":["555139214004","555198849745"]},"611775360605929":{"supported_businesses":["551147664020"]},"1283565282457467":{"supported_businesses":["551147664020"]},"673695173931335":{"supported_businesses":["551147664020"]},"508459817855605":{"supported_businesses":["442034673249","447418310027"]},"639247544356777":{"supported_businesses":["442034673249","447418310027"]},"2679509568858534":{"supported_businesses":["442034673249","447418310027"]}}}}'],graphql_privacy_imp_m2:[1327,"bool",!1,!1],nux_sync:[1343,"bool",!1,!0],in_app_survey_enabled:[1377,"bool",!1,!0],poll_creation_enabled:[1394,"bool",!1,!1],poll_receiving_enabled:[1395,"bool",!1,!1],poll_receiving_cag_enabled:[2737,"bool",!1,!1],poll_name_length:[1406,"int",255,255],poll_option_length:[1407,"int",100,100],poll_option_count:[1408,"int",12,12],poll_offline_accuracy:[1409,"int",30,30],poll_cleanup_days:[1410,"int",31,31],poll_vote_processing_enabled:[1541,"bool",!1,!1],poll_result_details_view_enabled:[1948,"bool",!0,!0],poll_creation_one_on_one_chats_enabled:[2194,"bool",!1,!1],poll_creation_cag_enabled:[2738,"bool",!1,!1],poll_a11y_enabled:[2390,"bool",!1,!0],enable_status_reporting:[2728,"bool",!1,!0],group_suspend_v1_enabled:[1415,"bool",!1,!0],group_suspend_appeal_include_entity_id_enabled:[2057,"bool",!1,!0],block_from_chat_list:[2290,"bool",!1,!0],community_reporting_ui_upsell_exit:[2818,"bool",!0,!0],smb_product_price_label:[1417,"string","control","control"],interactive_response_message_killswitch:[1435,"bool",!1,!1],interactive_response_message_native_flow_killswitch:[1436,"bool",!1,!1],biz_api_voip_enabled:[1464,"bool",!1,!0],quantity_controls_enabled:[1480,"bool",!1,!0],catalog_categories_enabled:[1514,"bool",!1,!0],disappearing_messages_chat_picker:[1518,"bool",!1,!1],more_reactions_option:[1322,"bool",!1,!1],reactions_keyboard_hides_three_flags:[1792,"bool",!1,!1],send_reaction_from_details_pane:[2170,"bool",!1,!1],silent_group_exit:[1527,"bool",!1,!0],silent_group_exit_past_participants:[1528,"bool",!1,!0],silent_group_exit_dialog:[1597,"bool",!1,!0],silent_group_exit_sync:[1598,"bool",!1,!0],silent_group_exit_db:[1613,"bool",!1,!0],order_details_quick_pay:[1600,"string",'{"allowed_product_type":"none"}','{"allowed_product_type":"none"}'],incentive_program_logging_enabled:[1599,"bool",!1,!0],md_syncd_24_hour_time_format_sync_enabled:[1612,"bool",!1,!1],md_link_device_with_phone_number_enabled:[2734,"bool",!1,!1],send_cart_cta_long_button_enabled:[1660,"bool",!0,!0],send_cart_cta_long_button_alternative_text_type:[2153,"int",0,0],product_search_m1_enabled:[1678,"bool",!1,!0],smb_catalog_collections_reordering_enabled:[1688,"bool",!0,!0],smb_catalog_collection_items_reordering_enabled:[1794,"bool",!0,!0],is_message_secret_enabled:[1707,"bool",!1,!0],documents_with_captions_receive:[1749,"bool",!1,!0],documents_with_captions_send:[1750,"bool",!1,!0],external_payments_supported_business:[1763,"string","+917000770007","+918368084712,+917000770007"],active_cart_discovery_enabled:[1766,"bool",!1,!0],order_details_payment_options:[1767,"string",'{"payment_options":[{"type":"JioPay","url_regex_list":["^https://www.jio.com/.*$","^https://t.jio/.*$","^http://tiny.jio.com/.*$"],"title":{"name":"jiopay_title","default_text":"Pay on Jio.com"},"subtitle":{"name":"jiopay_subtitle","default_text":"Go to Jio.com website"},"button":{"name":"jiopay_button","default_text":"Proceed to Jio.com"}}]}','{"payment_options":[{"type":"JioPay","url_regex_list":["^https://www.jio.com/.*$","^https://t.jio/.*$","^http://tiny.jio.com/.*$"],"title":{"name":"jiopay_title","default_text":"Pay on Jio.com"},"subtitle":{"name":"jiopay_subtitle","default_text":"Go to Jio.com website"},"button":{"name":"jiopay_button","default_text":"Proceed to Jio.com"}}]}'],recent_sticker_rollout_phase:[1829,"int",0,0],enable_client_chat_psa:[1844,"bool",!1,!0],direct_connection_business_numbers:[1846,"string","16005554444,918591749310,917977079770","16005554444,918591749310,917977079770"],forward_media_with_captions:[1853,"bool",!1,!1],share_phone_number_on_cart_send_to_direct_connection_biz_enabled:[1867,"bool",!0,!0],voice_status_receipt_enabled:[1875,"bool",!1,!0],admin_include_message_secret_in_cag:[1921,"bool",!0,!0],md_syncd_primary_version_sync_enabled:[1993,"bool",!1,!1],product_catalog_qpl_logging_enabled:[2003,"bool",!1,!0],syncd_do_not_fatal_on_snapshot_mac_mismatch_in_patches:[2007,"bool",!1,!1],graphql_locale_remapping:[2014,"string","{}","{}"],product_catalog_qpl_direct_connection_status_logging_enabled:[2024,"bool",!1,!0],favorite_sticker_rmr_sync_enabled:[2155,"bool",!1,!1],web_link_preview_sync_enabled:[2156,"bool",!1,!0],message_edit_receive:[2189,"bool",!1,!1],message_edit_send:[2190,"bool",!1,!1],prekey_fetch_iq_for_missing_devices_enabled:[2193,"bool",!1,!1],extensions_message_support_version:[2306,"string",'{"1":{"min_android_app_supported_version":"2.22.21","min_ios_app_supported_version":"2.22.16"}}','{"1":{"min_android_app_supported_version": "2.22.21","min_ios_app_supported_version": "2.22.16"},"2":{"min_android_app_supported_version": "2.22.23","min_ios_app_supported_version": "2.22.23"}}'],block_from_notification:[2374,"bool",!1,!0],four_reactions_in_bubble_enabled:[2378,"bool",!1,!0],block_entry_point_logging_enabled:[2522,"bool",!1,!0],non_message_data_request_logging_enabled:[2573,"bool",!1,!0],polls_fast_follow_enabled:[2661,"bool",!0,!0],poll_chatlist_preview_enabled:[2720,"bool",!1,!0],polls_search_support_enabled:[2662,"bool",!1,!0],polls_reply_support_enabled:[2663,"bool",!1,!0],fullscreen_animation_for_keyword:[2776,"bool",!1,!1],syncd_additional_mutations_count:[2777,"int",1,1],mpm_nfm_enabled:[2811,"bool",!1,!0],interactive_template_enabled:[2813,"bool",!1,!0],inapp_banner_client_enabled:[2871,"bool",!1,!0],client_group_participants_limit:[618,"int",257,257],payment_stickers_render_enabled:[812,"bool",!1,!1],privacy_allow_contacts_except:[808,"bool",!1,!1],primary_feature_sync:[1063,"bool",!1,!0],privacy_narrative_v1:[1071,"bool",!1,!1],add_dm_to_chat_overflow_menu:[1309,"bool",!1,!1],keep_in_chat_receiver:[1352,"bool",!1,!1],keep_in_chat_sender:[1353,"bool",!1,!1],keep_in_chat_ui_content:[2005,"bool",!1,!1],kic_orphan_cleanup_days:[1673,"int",31,31],supports_keep_in_chat_in_cag:[2844,"bool",!0,!0],ddm_reversed_options:[1397,"bool",!1,!1],qm_lean_msg:[1645,"bool",!1,!1],pnh_historical_mapping_retention_seconds:[1429,"int",7776e3,7776e3],trusted_contacts_reciprocity:[1437,"bool",!1,!1],trusted_contacts_chat_state_optimization:[1566,"string","old","old"],trusted_contacts_op:[1687,"bool",!1,!0],dm_updated_system_message:[1670,"bool",!1,!0],keep_in_chat_undo_duration_limit:[1698,"int",216e3,216e3],view_once_sp_receiver:[1710,"bool",!1,!1],view_once_sp_sender:[1711,"bool",!1,!1],pnh_ctwa:[1823,"bool",!1,!0],pnh_indicator:[2245,"bool",!1,!0],usync_lid:[1892,"bool",!1,!1],pnh_identity_verification_v3:[2751,"bool",!1,!1],pnh_cag_upgrade:[2304,"int",0,0],cag_reactions_receive:[2035,"bool",!1,!1],cag_reactions_send:[2036,"bool",!1,!1],pnh_cag_show_masked_members:[2346,"bool",!1,!1],calling_privacy_callee:[1972,"bool",!1,!1],pnh_cag_future_proof_banner:[2433,"bool",!1,!1],pnh_split_threads_detection:[2479,"bool",!1,!1],project_turnkey:[2434,"bool",!1,!1],pnh_group_lid:[2507,"int",0,0],out_of_sync_disappearing_messages_logging:[2561,"bool",!1,!0],dm_chat_picker_v2:[2597,"bool",!1,!0],ephemeral_sync_response:[2714,"bool",!1,!1],settings_search:[2800,"bool",!1,!1],enable_soox_message_receiving:[2802,"bool",!1,!1],enable_soox_message_sending:[2832,"bool",!1,!1],sticker_md_favorite_stickers_enabled:[864,"bool",!1,!1],smb_orange_enabled:[1469,"bool",!1,!1],smb_melon_display_enabled:[1483,"bool",!1,!1],smb_melon_management_enabled:[1484,"bool",!1,!1],call_only_primary_device_limit_exceeded:[1525,"bool",!1,!1],smb_premium_md_limit_perf_tracker_enabled:[1591,"bool",!1,!0],smb_billing_enabled:[1583,"bool",!1,!1],smb_billing_premium_access_config:[1619,"string","",""],smb_billing_logging_enabled:[1672,"bool",!1,!0],smb_melon_logging_enabled:[1669,"bool",!1,!0],smb_dcp_enabled:[1701,"bool",!1,!1],smb_custom_url_display_v2_enabled:[1849,"bool",!1,!0],smb_multi_device_agents_enabled:[1438,"bool",!1,!0],smb_multi_device_message_attribution_enabled:[1981,"bool",!1,!0],smb_multi_device_agents_logging_enabled:[1671,"bool",!1,!0],smb_multi_device_agents_logging_V2_enabled:[1897,"bool",!1,!0],smb_md_agent_chat_assignment_enabled:[1798,"bool",!1,!0],smb_md_agent_chat_assignment_system_messages_enabled:[2157,"bool",!1,!0],smb_md_agent_chat_assignment_system_messages_logging_v2_enabled:[2709,"bool",!1,!0],smb_md_agent_chat_assignment_system_messages_chats_reorder_enabled:[2778,"bool",!1,!0],smb_md_agent_chat_assignment_chats_reorder_on_chat_assignment_enabled:[2787,"bool",!1,!0],smb_md_agent_chat_assignment_chats_reorder_on_chat_unassignment_enabled:[2788,"bool",!1,!0],smb_md_agent_chat_assignment_nux_impressions:[2207,"int",0,3],coex_biz_states_sys_msg_enabled:[2320,"bool",!1,!0],smb_biz_profile_custom_url:[2582,"bool",!1,!1],smb_biz_profile_custom_url_notifications:[2583,"bool",!1,!1],mex_phase3_enabled:[2249,"bool",!1,!1],mex_phase3_status_flags:[2250,"int",0,0]}},744655:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.exposureKeys=t.accessedConfigs=void 0,t.updateGlobalABKey=function(e){i.default.Global.set({abKey2:e})},t.updateGlobalExpoKey=function(){i.default.Global.set({expoKey:Array.from(o).join(",")})};var i=r(n(571834));const a=new Set;t.accessedConfigs=a;const o=new Set;t.exposureKeys=o},513592:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFbBrandedNumber=function(e){return(0,r.getABPropConfigValue)("system_msg_numbers_fb_branded").split(",").includes(e)},t.getIsInternalNumber=function(e){const t=(0,r.getABPropConfigValue)("system_msg_numbers_fb_branded").split(","),n=(0,r.getABPropConfigValue)("system_msg_numbers_fb_inc").split(",");return t.includes(e)||n.includes(e)};var r=n(287461)},493928:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAdminHfmToggleEnabled=function(){var e;return null!==(e=(0,r.getABPropConfigValue)("admin_hfm_toggle"))&&void 0!==e&&e},t.isDefaultDisappearingMessagesEnabled=function(){return!!(null==o?void 0:o.PrimaryFeatures.ddmSettings)&&(0,r.getABPropConfigValue)("web_privacy_settings_v2")},t.isDisappearingModeEnabled=function(){var e;return null!==(e=(0,r.getABPropConfigValue)("disappearing_mode"))&&void 0!==e&&e},t.isDropLastNameEnabled=function(){var e;return null!==(e=(0,r.getABPropConfigValue)("drop_last_name"))&&void 0!==e&&e},t.isElevatedImportantMessageEnabled=function(){var e;return!!l()&&(null!==(e=(0,r.getABPropConfigValue)("elevated_important_msg"))&&void 0!==e&&e)},t.isGroupCatchUpEnabled=l,t.isInAppSupportEnabled=function(){if(!(0,r.getABPropConfigValue)("in_app_support_v2_enabled"))return!1;const e=(0,r.getABPropConfigValue)("in_app_support_v2_locale_langs");if(""===e)return!0;const t=new Set(e.split(",")),i=n(932325).default;return t.has(i.getLocale())},t.isOnlinePresenceEnabled=function(){return(0,r.getABPropConfigValue)("trusted_contacts_op")},t.isPrivacyNarrativeV1Enabled=function(){return!(0,i.isSMB)()},t.isSenderRevokeUiEnabled=function(){var e;return null!==(e=(0,r.getABPropConfigValue)("sender_revoke_ui"))&&void 0!==e&&e},t.isSenderRevokeWindowReceiverEnabled=function(){var e;return null!==(e=(0,r.getABPropConfigValue)("sender_revoke_window_receiver"))&&void 0!==e&&e},t.isSenderRevokeWindowSenderEnabled=function(){var e;return null!==(e=(0,r.getABPropConfigValue)("sender_revoke_window_sender"))&&void 0!==e&&e};var r=n(287461),i=n(828770),a=n(757453),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(736751));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}function l(){var e,t;const n=null!==(e=(0,a.getUnreadMentionCountEnabled)())&&void 0!==e&&e;return null!==(t=(0,r.getABPropConfigValue)("group_catch_up"))&&void 0!==t&&t&&n}},183660:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getABKey=function(){const e=l();return null==e?void 0:e.abKey},t.getHash=function(){const e=l();return null==e?void 0:e.hash},t.getRefresh=function(){var e;const t=l();return parseInt(null!==(e=null==t?void 0:t.refresh)&&void 0!==e?e:86400,10)},t.isABPropsAfterFirstSync=function(){return null!=l()},t.updateAttributesLocalStorage=function(e,t,n,r){var u,c;let d=null;null!=n&&(d=n,d<600?d=600:d>s&&(d=s));const p=l()||{},_={abKey:null!=e?e:p.abKey,hash:null!=t?t:p.hash,refresh:null!==(u=null===(c=d)||void 0===c?void 0:c.toString())&&void 0!==u?u:p.refresh,lastSyncTime:r};(0,i.default)(a.default,"localStorage").setItem(o.KEYS.ABPROPS,JSON.stringify(_))};var i=r(n(132375)),a=r(n(174285)),o=n(94872);const s=604800;function l(){const e=(0,i.default)(a.default,"localStorage").getItem(o.KEYS.ABPROPS);return null==e?null:JSON.parse(e)}},143589:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=(0,r.getABPropConfigValue)("in_app_support_v2_number_prefixes");return null!=t&&""!==t&&t.split(",").some((t=>e.startsWith(t)))};var r=n(287461)},917406:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.updateABPropsFromStorage=function(){return l.apply(this,arguments)};var i=r(n(348926)),a=n(238196),o=n(94728),s=n(827012);function l(){return(l=(0,i.default)((function*(){try{const e=(yield(0,s.getABPropConfigs)()).map((e=>{const t=a.ABPropConfigCodeToName[Number(e.configCode)];if(null!=t){const n=o.ABPropConfigs[t],[r,i,a,l]=n,u=a;return{configCode:r,configValue:(0,s.parseConfigValue)(e.configValue,i,u),configExpoKey:e.configExpoKey,hasAccessed:e.hasAccessed}}__LOG__(3)`[ABProps] ABProp (code: ${e.configCode}) exists in storage but no longer available for this client version`})).filter((e=>!!e));(0,a.bulkCreateOrReplaceABPropConfigs)(e)}catch(e){__LOG__(4,!0,new Error,!0)`[ABProps] Failed to update ABProps configs cache from storage: ${e}`,SEND_LOGS("[ABProps] Failed to update ABProps configs cache from storage: "+e)}__LOG__(2,void 0,void 0,void 0,["abprops"])`--- Print ABProps Start ---`,(0,a.getAllABPropConfigs)().forEach((e=>{__LOG__(2,void 0,void 0,void 0,["abprops"])`code: ${e.configCode}, name: ${a.ABPropConfigCodeToName[e.configCode]}, value: ${e.configValue}, type: ${typeof e.configValue}`})),__LOG__(2,void 0,void 0,void 0,["abprops"])`--- Print ABProps End ---`}))).apply(this,arguments)}},564121:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageAddOnType=void 0;const r=n(76672)({Reaction:"reaction",PollVote:"poll_vote",KeepInChat:"keep_in_chat",MessageEdit:"message_edit",Unknown:"unknown"});t.MessageAddOnType=r},251780:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.APICmd=void 0,t.isWAURL=function(e){return n.test(e)};t.APICmd={GROUP_INVITE:"GROUP_INVITE",MSG_SEND:"MSG_SEND",INVALID:"INVALID",CATALOG:"CATALOG",PRODUCT:"PRODUCT",PUSH_NOTIFICATION:"PUSH_NOTIFICATION",CREATE_COMMUNITY:"CREATE_COMMUNITY"};const n=/^whatsapp:\/\/.*/i},478939:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=void 0;t.URL="https://web.whatsapp.com/"},127714:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.matchProductUrl=t.matchCatalogUrl=void 0,t.parseAPICmd=function(e){if("string"!=typeof e)return{resultType:l.APICmd.INVALID,data:void 0};const t=(e=>{let t=e.match(_);if(t)return{code:t[2],url:t[1]||"/"};if(t=e.match(f),t)return{code:t[1]};if(t=e.match(h),t)return{code:t[1]};if(t=e.match(g),t)return{code:t[1]}})(e);if(t)return{resultType:l.APICmd.GROUP_INVITE,data:t};const n=function(e){let t=e.match(N)||e.match(w);if(t)return k(t);if(t=e.match(L),t)return(0,i.default)((0,i.default)({},k(t)),{},{url:"/"})}(e);if(n)return{resultType:l.APICmd.CATALOG,data:n};const r=function(e){let t=b(e,O);if(t)return U(t);if(t=b(e,I),t)return(0,i.default)((0,i.default)({},U(t)),{},{url:"/"})}(e);if(r)return{resultType:l.APICmd.PRODUCT,data:r};const a=function(e){if(e.match(D))return{url:"/"}}(e);if(a)return{resultType:l.APICmd.CREATE_COMMUNITY,data:a};const o=function(e){let t=e.match(S);if(t){const e=E(t[2]);if(e)return e.url=t[1]||"/",e}if(t=e.match(T),t)return E(t[1]);if(t=e.match(v),t)return E(t[1]);if(t=e.match(A),t){let n;if(t[1]?n={phone:`${t[1]}@c.us`}:t[2]&&(n={url:e,customURL:t[2]}),t[3]){const e=E(t[3]);e&&(n=(0,i.default)((0,i.default)({},n),e))}return n}}(e);if(o)return{resultType:l.APICmd.MSG_SEND,data:o};const s=function(e){if(e.match(R))return{url:"/"}}(e);if(s)return{resultType:l.APICmd.PUSH_NOTIFICATION,data:s};return{resultType:l.APICmd.INVALID,data:void 0}},t.parseConversionData=y;var i=r(n(81109)),a=n(551168),o=n(287461),s=r(n(665810)),l=n(251780),u=n(478939),c=n(71870);const d=(p=u.URL,p.replace(/\/+$/,"")).replace(/[\/\.]/g,"\\$&");var p;const _=new RegExp(`^${d}((?:/\\w+)*)/accept/?\\?code=(\\w+)$`,"i"),f=/^https?:\/\/chat\.whatsapp\.com\/invite\/(\w+)$/i,h=/^https?:\/\/chat\.whatsapp\.com\/(\w+)$/i,g=/^whatsapp:\/\/chat\/?\?code=(\w+)$/i,m={text:"text",phone:"phone",data:"data",source:"source",context:"context",icebreaker:"icebreaker",source_url:"source_url",type:"type",lid:"lid"};function y(e){if(!e||"string"!=typeof e)return;const t=a.Binary.build(e);return t.size()>(0,o.getABPropConfigValue)("ctwa_data_max_length")?void 0:t.readBuffer()}function E(e){const t={};return new s.default(e).forEach(((e,n)=>{const r=n.toLowerCase();if(r===m.data){const n=y(e);if(!n)return;t.conversionTuple||(t.conversionTuple={}),t.conversionTuple.conversionData=n}else if(r===m.source){const n=e;if((0,a.numUtf8Bytes)(n)>32)return;t.conversionTuple||(t.conversionTuple={}),t.conversionTuple.conversionSource=n}else r===m.source_url?(t.ctwaContextLinkData=t.ctwaContextLinkData||{},t.ctwaContextLinkData.sourceUrl=e):r===m.context?(t.ctwaContextLinkData=t.ctwaContextLinkData||{},t.ctwaContextLinkData.context=e):r===m.icebreaker?(t.ctwaContextLinkData=t.ctwaContextLinkData||{},t.ctwaContextLinkData.icebreaker=e):m[r]&&(t[r]=e)})),t.phone&&(t.phone=t.phone.replace(/\D/g,"")+"@c.us",t.ctwaContextLinkData&&(t.ctwaContextLinkData.phone=t.phone)),null!=t.lid&&(0,c.testLidWaMeLinkEnabled)()||null!=t.phone&&""!==t.phone||null!=t.text&&""!==t.text?t:void 0}const S=new RegExp(`^${d}((?:/\\w+)*)/send/?\\?(.+)$`,"i"),T=/^https?:\/\/api\.whatsapp\.com\/send\/?\?(.+)$/i,v=/^whatsapp:\/\/send\/?\?(.*)$/i,A=/^https?:\/\/wa\.me\/?(?:([0-9.]{0,20})|([0-9a-z.]{5,35}))?\/?\??(.+)?$/i,C=new RegExp(`^${d}(?:(?:/\\w+)*)/product/([0-9]{0,20})/([0-9]{0,20})$`,"i"),P=new RegExp(`^${d}(?:(?:/\\w+)*)/product/([^/]{0,200})/([0-9]{0,20})$`,"i"),O=[/^https?:\/\/wa\.me\/p\/([0-9]{0,20})\/([0-9]{0,20})$/i,/^whatsapp:\/\/product\/([0-9]{0,20})\/([0-9]{0,20})$/i,/^https?:\/\/wa\.me\/p\/([^\/]{0,200})\/([0-9]{0,20})$/i,/^whatsapp:\/\/product\/([^\/]{0,200})\/([0-9]{0,20})$/i],I=[C,P],M=[...O,...I];function b(e,t){for(let n=0;n<t.length;n++){const r=e.match(t[n]);if(r)return r}}t.matchProductUrl=e=>null!=b(e,M);const R=new RegExp(`^${d}(?:(?:/\\w+)*)/push/`,"i"),N=/^https?:\/\/wa\.me\/c\/([0-9]{0,20})$/i,w=/^whatsapp:\/\/catalog\/([0-9]{0,20})$/i,L=new RegExp(`^${d}(?:(?:/\\w+)*)/catalog/([0-9]{0,20})$`,"i");t.matchCatalogUrl=e=>[N,w,L].some((t=>e.match(t)));const D=/^https?:\/\/wa\.me\/community\/create$/i;function k(e){return{catalogOwnerJid:`${e[1]}@s.whatsapp.net`}}function U(e){return{productId:e[1],businessOwnerJid:`${e[2]}@s.whatsapp.net`}}},817649:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.businessTypeOptions=t.VERIFIED_LEVEL=t.DAYS_OF_WEEK=t.COMMERCE_EXPERIENCE_TYPES=t.BUSINESS_PROFILE_FIELDS_LENGTH=t.BUSINESS_HOUR_MODES=void 0;t.VERIFIED_LEVEL={UNKNOWN:0,LOW:1,HIGH:2};t.DAYS_OF_WEEK=["sun","mon","tue","wed","thu","fri","sat"];t.BUSINESS_HOUR_MODES={OPEN_24H:"open_24h",SPECIFIC_HOURS:"specific_hours",APPOINTMENT_ONLY:"appointment_only"};const r=n(76672)({CATALOG:"catalog",NONE:"none",SHOP:"shop"});t.COMMERCE_EXPERIENCE_TYPES=r;t.businessTypeOptions={limitedLiabilityPartnership:"Limited liability partnership",soleProprietorship:"Sole proprietorship",partnership:"Partnership",publicCompany:"Public Company",privateCompany:"Private Company",other:"Other"};t.BUSINESS_PROFILE_FIELDS_LENGTH={WEBSITE:256,DESCRIPTION:512,EMAIL:128,ADDRESS:256}},500411:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.INVALID_PRODUCT_TOKEN=void 0;t.INVALID_PRODUCT_TOKEN="DELETED"},694630:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProductComplianceCategory=t.ProductAvailability=t.PRODUCT_AVAILABILITY_UNAVAILABLE_VALUES=void 0;const r=n(76672)({IN_STOCK:"in stock",OUT_OF_STOCK:"out of stock",AVAILABLE_FOR_ANOTHER_POSTCODE:"available for another postcode",UNKNOWN:"unknown"});t.ProductAvailability=r;const i=[r.OUT_OF_STOCK,r.AVAILABLE_FOR_ANOTHER_POSTCODE];t.PRODUCT_AVAILABILITY_UNAVAILABLE_VALUES=i;const a=n(76672)({Default:"DEFAULT",CountryOriginExempt:"COUNTRY_ORIGIN_EXEMPT"});t.ProductComplianceCategory=a},975565:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.logDeepConversation=function(e){var t,n,r,i,a;if(!(0,o.getABPropConfigValue)("wa_ctwa_web_dc_logging_enabled"))return;if(!e||!0!==e.isNewMsg)return;if(!s.Conn.isSMB)return;const c=null===(t=(0,u.getMaybeMeUser)())||void 0===t?void 0:t.toString();if(null==c)return __LOG__(3,void 0,void 0,!0)`ctwa:dc-logging: Cannot get current user`,void SEND_LOGS("ctwa:dc-logging: Cannot get current user");const d=null!==(n=null===(r=e.chat)||void 0===r?void 0:r.msgs.toArray())&&void 0!==n?n:[];if(0===d.length)return;if(null==e.ctwaContext&&function(e,t){var n,r;const i=_(e,t);return(null===(n=e.from)||void 0===n?void 0:n.toString())===(null==i||null===(r=i.from)||void 0===r?void 0:r.toString())}(e,d))return;const[h,g]=function(e){let t=0,n=e[e.length-1];for(;n&&t<=6;){if(p(n))return[null,t];if(n.ctwaContext)return[n,t];{var r,i;const a=_(n,e);if(!a)break;const o=!l.SYSTEM_MESSAGE_TYPES.includes(n.type),s=(null===(r=n.from)||void 0===r?void 0:r.toString())!==(null===(i=a.from)||void 0===i?void 0:i.toString());o&&s&&t++,n=a}}return[n,t]}(d);if(!h)return;if(g>5)return;if(c===(null===(i=e.from)||void 0===i?void 0:i.toString()))return function(e,t){if(1===t)return f(e,"FIRST_BIZ_REPLY");if(3===t)return f(e,"SECOND_BIZ_REPLY");if(5===t)return f(e,"DEEP_CONVERSATION")}(h,g);if(c===(null===(a=e.to)||void 0===a?void 0:a.toString()))return function(e,t){if(0===t)return f(e,"FIRST_MESSAGE");if(2===t)return f(e,"SECOND_MESSAGE");if(4===t)return f(e,"THIRD_MESSAGE")}(h,g)};var i=n(81758),a=n(990445),o=n(287461),s=n(266888),l=(n(387191),n(373070)),u=n(459857),c=r(n(571834)),d=(n(702011),n(769926));function p(e){const t=(0,a.unixTime)()-d.ConversionTupleExpiry;return e.t<t}function _(e,t){const n=t.indexOf(e);return n>=0?t[n-1]:null}function f(e,t){var n;const{conversionData:r,conversionSource:a}=null!==(n=e.ctwaContext)&&void 0!==n?n:{};if(null==r||null==a)return void __LOG__(3)`ctwa:dc-logging: Attempted to log a DC with no CTWA conversion data or source`;const o={ctwaConversionType:c.default.CTWA_CONVERSION_TYPE[t],deepLinkConversionData:(0,i.arrayBufferToString)(r),deepLinkConversionSource:a},s=new c.default.DeepLinkConversion(o);return s.commit(!0),s}},943914:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InteractiveMessageHeaderMediaType=t.IM_MEDIA_HEADER_TYPES=void 0;const r=n(76672).Mirrored(["IMAGE","VIDEO","DOCUMENT"]);t.InteractiveMessageHeaderMediaType=r;const i=new Set([r.IMAGE,r.VIDEO,r.DOCUMENT]);t.IM_MEDIA_HEADER_TYPES=i},182394:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(76672)({NATIVE_FLOW:"native_flow",SHOPS_STOREFRONT:"shops_storefront"});t.default=r},753110:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(76672)({ORDER_DETAILS:"order_details",ORDER_STATUS:"order_status"});t.default=r},654143:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(76672)({NATIVE_FLOW:"native_flow"});t.default=r},320437:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeBridge=function(){return new r.DynamicRouter};var r=n(869213)},403868:(e,t,n)=>{"use strict";var r=n(595318);t.Z=void 0;var i=r(n(542817)),a=r(n(367867)),o=n(591547);var s={logImpl:(e,t,n,r,i)=>(o.Logger.logImpl(e,t,n,r,i),Promise.resolve()),setLogoutState:e=>(i.default.isLogoutInProgress=e,a.default.invoke("setLogoutState",[e])),sendLogs:(e,t)=>n(996588).sendLogs(e,t),deleteDbEncKeyCache:()=>a.default.invoke("deleteDbEncKeyCache",[]),initDatabaseEncnKey:e=>a.default.invoke("initDatabaseEncnKey",[e]),generateFinalDbEncryptionAndFtsKey:e=>a.default.invoke("generateFinalDbEncryptionAndFtsKey",[e]),startBackendWorker:()=>Promise.resolve(),startBackendWorkerDebugHelper:()=>Promise.resolve()};t.Z=s},567124:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=new MessageChannel,n=t.port1,r=t.port2;s.default.respondTo(n),i.default.init(),o.default.setConnectionManager(i.default),i.default.connectVia(n),e.postMessage((0,a.buildHandshakePayload)(r),[r])};var i=r(n(838146)),a=n(747694),o=r(n(367867)),s=r(n(503488))},186749:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(567124));const a=new(r(n(988703)).default);(0,i.default)(a);var o=a;t.default=o},838146:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(132375)),a=n(975175),o=n(827653),s=r(n(441143));var l=new class{init(){return this._port=null,this._deferred=new o.Resolvable,(0,a.promiseTimeout)(this._deferred.promise,5e3)}isConnected(){return null!=this._port}getPort(){return this._port}waitForConnection(){var e;return(0,i.default)(null===(e=this._deferred)||void 0===e?void 0:e.promise,"ConnectionManager Initialization Promise")}connectVia(e){if(this.isConnected())throw new Error("Connection already established");(0,s.default)(this._deferred,"ConnectionManager not initialized"),this._port=e,this._deferred.resolve()}};t.default=l},542817:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(571834));const a={[i.default.WEBC_SCENARIO_TYPE.IDLE]:0,[i.default.WEBC_SCENARIO_TYPE.INITIAL_PAIRING]:3e5,[i.default.WEBC_SCENARIO_TYPE.OFFLINE_RESUME]:12e4};let o,s;var l={isLogoutInProgress:!1,getCurrentScenario(){var e;return null!==(e=s)&&void 0!==e?e:i.default.WEBC_SCENARIO_TYPE.IDLE},initOrUpdateTracking(e){o&&clearTimeout(o),s=e,s!==i.default.WEBC_SCENARIO_TYPE.IDLE&&(o=setTimeout((()=>{s=i.default.WEBC_SCENARIO_TYPE.IDLE,o=null}),a[e]))}};t.default=l},367867:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=r(n(132375)),o=n(369463),s=n(958396),l=n(826664),u=r(n(441143));var c=new class{constructor(){this._pending=new Map,this._handleResponseReceipt=e=>{const t=(0,s.unwrapResponsePayload)(e.data);if(null!=t){const{invocationId:e,result:n}=t;if(this._pending.has(e)){const{resolve:t}=(0,a.default)(this._pending.get(e),"this._pending.get(invocationId)");t(n),this._pending.delete(e)}}}}setConnectionManager(e){this._conn=e,e.waitForConnection().then((()=>{const t=(0,a.default)(e.getPort(),"Port obtained from ConnectionManager after connection");t.addEventListener("message",this._handleResponseReceipt),t.start()}))}invoke(e,t){var n=this;return(0,i.default)((function*(){(0,u.default)(n._conn,"Connection has not been inited"),yield n._conn.waitForConnection(),(0,u.default)(n._conn,"Connection has not been inited");const r=(0,a.default)(n._conn.getPort(),"Port obtained from ConnectionManager after connection"),i=(0,l.genInvocationId)();return r.postMessage((0,o.buildInvocationPayload)({invocationId:i,method:e,args:t})),new Promise(((e,t)=>{n._pending.set(i,{resolve:e,reject:t})}))}))()}};t.default=c},503488:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(369463),i=n(958396),a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=i?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(542137));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}var s=new class{constructor(){this._handleMessage=(e,t)=>{const n=t.data,o=(0,r.unwrapInvocationPayload)(n);if(null!=o){const{method:t,args:n,invocationId:r}=o;a.get()[t](...n).then((t=>{e.postMessage((0,i.buildResponsePayload)(r,t))}))}}}respondTo(e){e.addEventListener("message",(t=>this._handleMessage(e,t))),e.start()}};t.default=s},826664:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extractInvocationId=function(e){if(null!=e&&"number"==typeof e)return e},t.genInvocationId=function(){return n++};let n=1},542137:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.get=l,t.log=void 0,t.sendLogs=function(e,t){return l().sendLogs(e,t)},t.set=function(e){s=e};var i=r(n(957124)),a=r(n(132375)),o=r(n(356344));let s;function l(){return(0,a.default)(s,"InvocationInterface was not inited")}const u=(0,i.default)((function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;return function(a){for(var s=arguments.length,u=new Array(s>1?s-1:0),c=1;c<s;c++)u[c-1]=arguments[c];const d=(0,o.default)(a,u,!t);let p;return n&&(p={name:n.name,stack:n.stack}),l().logImpl(e,d,p,r,i),d}}),((e,t,n,r,i)=>n||i?null:String(e)+String(Boolean(t))+String(Boolean(r))));t.log=u},747694:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.buildHandshakePayload=function(e){return{__command:i.HANDSHAKE_COMMAND,__port:e}},t.extractPortFromHandshakePayload=function(e){if(null!=e&&null!=e.__command&&e.__command===i.HANDSHAKE_COMMAND&&null!=e.__port){(0,a.default)(e.__port instanceof MessagePort,"Malformed connection payload");return e.__port}};var i=n(270594),a=r(n(441143))},369463:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.buildInvocationPayload=function(e){let{invocationId:t,method:n,args:r}=e;return{__id:t,__command:i.INVOCATION_COMMAND,__method:n,__args:r}},t.unwrapInvocationPayload=function(e){if(null!=e&&e.__command===i.INVOCATION_COMMAND){(0,o.default)(e.__id,"Invocation ID missing");const t=(0,a.extractInvocationId)(e.__id);(0,o.default)(null!=t&&e.__method&&"string"==typeof e.__method&&e.__id&&e.__args&&Array.isArray(e.__args),"Malformed invocation message");const n=e,r=n.__method,i=n.__args;return{method:r,args:i,invocationId:t}}};var i=n(270594),a=n(826664),o=r(n(441143))},958396:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.buildResponsePayload=function(e,t){return{__id:e,__command:i.RESPONSE_COMMAND,__result:t}},t.unwrapResponsePayload=function(e){if(null!=e&&e.__command===i.RESPONSE_COMMAND){(0,o.default)(null!=e.__id,"Invocation ID missing");const t=(0,a.extractInvocationId)(e.__id);(0,o.default)(null!=t&&e.hasOwnProperty("__result"),"Malformed response message");return{result:e.__result,invocationId:t}}};var i=n(270594),a=n(826664),o=r(n(441143))},270594:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RESPONSE_COMMAND=t.INVOCATION_COMMAND=t.HANDSHAKE_COMMAND=void 0;t.HANDSHAKE_COMMAND="@@handshake";t.INVOCATION_COMMAND="@@invoke";t.RESPONSE_COMMAND="@@response"},402994:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EDIT_ATTR=t.ACK_STRING=t.ACK=void 0;t.ACK={INACTIVE:-6,CONTENT_UNUPLOADABLE:-5,CONTENT_TOO_BIG:-4,CONTENT_GONE:-3,EXPIRED:-2,FAILED:-1,CLOCK:0,SENT:1,RECEIVED:2,READ:3,PLAYED:4,PEER:5};t.EDIT_ATTR={MESSAGE_EDIT:1,SENDER_REVOKE:7,ADMIN_REVOKE:8};t.ACK_STRING={SENDER:"sender",DELIVERY:"delivery",READ:"read",PLAYED:"played",INACTIVE:"inactive",READ_SELF:"read-self",PLAYED_SELF:"played-self"}},753958:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CART_ITEM_MAX_QUANTITY=void 0;t.CART_ITEM_MAX_QUANTITY=99},400436:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BlockEntryPoint=t.BizOptOutReason=t.BizOptOutFirstMessage=t.BizOptOutBusinessDiscoveryEntryPoint=void 0;const r=n(76672)({OneToOneOldSpamBannerBlock:"1_1_old_spam_banner_block",OneToOneSpamBannerBlock:"1_1_spam_banner_block",AccountInfo:"account_info",AccountInfoReport:"account_info_report",BizOldSpamBannerBlock:"biz_old_spam_banner_block",BizSpamBannerBlock:"biz_spam_banner_block",BlockHeaderChat:"block_header_chat",CallLog:"call_log",Chat:"chat",ChatListBlock:"chat_list_block",ChatListContextMenuBlock:"chat_list_context_menu_block",ChatListNoInsubBlock:"chat_list_noinsub_block",NotificationBlock:"notification_block",OverflowMenuBlock:"overflow_menu_block",OverflowMenuReport:"overflow_menu_report",Profile:"profile",TriggeredBlock:"triggered_block",BlockList:"block_list",MediaViewer:"media_viewer",MessageMenu:"message_menu",OneToOneChatSpamBannerReport:"1_1_spam_banner_report"});t.BlockEntryPoint=r;const i=n(76672)({NoLongerNeeded:"no_longer_needed",NoSignUp:"no_sign_up",OffensiveMessages:"offensive_messages",Spam:"spam",Other:"other"});t.BizOptOutReason=i;const a=n(76672)({False:"false",True:"true",None:"none"});t.BizOptOutFirstMessage=a;const o=n(76672)({CatalogLink:"catalog_link",ClickToChatLink:"click_to_chat_link",Ctwa:"ctwa",MessageShortLink:"message_short_link",ProductLink:"product_link",QrCode:"qr_code"});t.BizOptOutBusinessDiscoveryEntryPoint=o},292220:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PAGE_SIZE=t.MSG_PRELOAD_THRESHOLD=t.COLLECTION_HAS_SYNCED=void 0;t.COLLECTION_HAS_SYNCED="collection_has_synced";t.PAGE_SIZE=50;t.MSG_PRELOAD_THRESHOLD=20},846870:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={IMG_THUMB_MAX_EDGE:100,DOC_THUMB_MAX_EDGE:480,VIDEO_THUMB_MAX_EDGE:480,MAX_PORTRAIT_MEDIA_CAPTION_LENGTH:500,MEDIA_EDITOR_OUTLINE_TENSION:.4,MMS_THUMBNAIL_UPLOAD_TIMEOUT:3e3,FREQUENTLY_FORWARDED_SENTINEL:127,MAX_SMB_LABEL_COUNT:20,WA_COMMERCE_POLICY_URL:"https://www.whatsapp.com/policies/commerce-policy",MAX_TXT_MSG_SIZE:65536,GROUP_DESCRIPTION_INFO_PANEL_TRUNC_LENGTH:100,BUSINESS_DESCRIPTION_INFO_PANEL_TRUNC_LENGTH:200,TEMPLATE_URL_START:64,TEMPLATE_URL_END:32,SQUELCH_RESET_VALUE:-1,MAX_CAPTION_LENGTH:1024,REACTION_CONTENT_MAX_LENGTH:30,MAX_CART_MESSAGE_LENGTH:1024,MAX_PUSHNAME_LENGTH:25,KEY_BUNDLE_TYPE:"",NEW_MSG_SENT:"new_msg_sent",ONE_BY_ONE_TRANS_GIF:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",VOIP_LOG_COLOR:"#aa6627",VOIP_MAX_GROUP_CALL_PARTICIPANTS:32,WAM_SYS_INFO_INIT_DELAY:5e3,MARKED_AS_UNREAD:-1};t.default=n},801506:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UPLOAD_TO_CLB=t.TICKET_URL=t.LOG_SIZE=t.CLB_URL=t.CLB_TOKEN=t.CLB_CHECK_URL=void 0;t.CLB_CHECK_URL="https://crashlogs.whatsapp.net/wa_fls_upload_check";t.CLB_TOKEN="1063127757113399|745146ffa34413f9dbb5469f5370b7af";t.CLB_URL="https://crashlogs.whatsapp.net/wa_clb_data";t.TICKET_URL="https://web.whatsapp.com/web-contact-us";let n=0;n=1;t.UPLOAD_TO_CLB=1;t.LOG_SIZE=4999},258105:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.PLATFORM=t.FAQ_BASE_URL=void 0,t.getBusinessFaqUrl=function(){return s("general/chats/about-chatting-with-businesses")},t.getCagPhoneNumberHidingFaqUrl=function(){return s("831150864932965")},t.getCannotConnectFaqUrl=function(){return s("web/troubleshooting/cant-connect-to-whatsapp")},t.getCatalogCartOnOffFaqUrl=function(){return s("general/account-and-profile/about-cart")},t.getCiphertextFaqUrl=function(){return s("general/security-and-privacy/seeing-waiting-for-this-message-this-may-take-a-while")},t.getCodeChangeFaqUrl=function(){return s("general/security-and-privacy/security-code-change-notification")},t.getCommunitiesLearningCenterUrl=function(){return`https://www.whatsapp.com/communities/learning?lang=${i.default.getLocale()}`},t.getCommunityCreatorPrivacyUrl=function(){return s("625069579217642")},t.getCommunityHomeNuxUrl=function(){return s("570221114584995")},t.getCommunityMemberPrivacyUrl=function(){return s("812356880201038")},t.getCommunityNotAvailableFaqUrl=function(){return s("cxt/?entrypointid=community-no-longer-available",!0)},t.getControlsWhenMessagingBusinessFaqUrl=function(){return s("138730494968892")},t.getDBErrorFaqUrl=function(){return s("web/about-seeing-a-database-error-occured-on-your-browser")},t.getE2EEnterpriseFaqUrl=function(){return s("general/security-and-privacy/end-to-end-encryption-for-business-messages")},t.getE2EFaqUrl=function(){return s("general/security-and-privacy/end-to-end-encryption")},t.getElectronUwpIncompatibleUsersFaqUrl=function(){return s("779581519948320")},t.getEphemeralFaqUrl=function(){return s("general/chats/about-disappearing-messages")},t.getExitCommunityUrl=function(){return s("366296225670044")},t.getFanoutPlaceholderFaqUrl=function(){return s("general/security-and-privacy/seeing-waiting-for-this-message-check-your-phone")},t.getFaqUrl=function(){return`${a}/web?lang=${i.default.getLocale()}`},t.getFrequentlyForwardedFaqUrl=function(){return s("general/chats/about-forwarding-limits")},t.getGroupInviteGrowthLockedFaqUrl=function(){return s("cxt/?entrypointid=invite-via-link-unavailable",!0)},t.getHowToExitAndDeleteGroupsFaq=function(){return s("web/chats/how-to-exit-and-delete-groups")},t.getJioMartPostcodeChangeLearnMoreLink=function(){return s("general/security-and-privacy/about-sharing-your-information-with-businesses-on-whatsapp")},t.getLinkDeviceFaqUrl=function(){return s("web/download-and-installation/how-to-link-a-device")},t.getLoginFaqUrl=function(){return s("web/download-and-installation/how-to-log-in-or-out")},t.getMDCodeChangeFaqUrl=function(){return`${a}/${i.default.getLocale()}/web/26000361`},t.getMembershipApprovalModeFaqUrl=function(){return s("1110600769849613")},t.getNonVerifiedTransitionFaqUrl=function(){return s("general/business-account-becomes-a-standard-account")},t.getNotificationChromeFaqUrl=function(){return s("web/troubleshooting/cant-receive-notifications-on-chrome")},t.getNotificationEdgeFaqUrl=function(){return s("web/troubleshooting/cant-receive-notifications-on-microsoft-edge")},t.getNotificationFirefoxFaqUrl=function(){return s("web/troubleshooting/cant-receive-notifications-on-firefox")},t.getNotificationOperaFaqUrl=function(){return s("web/troubleshooting/cant-receive-notifications-on-opera")},t.getNotificationSafariFaqUrl=function(){return s("web/troubleshooting/cant-receive-notifications-on-safari")},t.getPhoneNumberHidingFaqUrl=function(){return s("626403979060997")},t.getRemoveFromCommunityFaqUrl=function(){return s("1874151452788882")},t.getRevokeFaqUrl=function(){return s("web/chats/how-to-delete-messages")},t.getSupportChatFaqUrl=function(){return s("general/what-information-does-whatsapp-collect-when-you-contact-support")},t.getSupportChatSafetyFaqUrl=function(){return s("general/about-safely-communicating-with-whatsapp-support")},t.getSuspiciousLinkFaqUrl=function(){return s("web/chats/suspicious-links")},t.getUnverifiedTransitionFaqUrl=function(){return s("general/business-account-becomes-unverified")},t.getUpdatePrimaryDeviceFaqUrl=function(){return s("general/download-and-installation/how-to-update-whatsapp")},t.getVerifiedHighFaqUrl=function(){return s("general/verified-business-account")},t.getVerifiedLowUnknownFaqUrl=function(){return s("general/unverified-business-account")},t.getVerifiedTransitionFaqUrl=function(){return s("general/business-account-becomes-verified")},t.getViewOnceFaqUrl=function(){return s("general/chats/about-view-once")},t.getViewOnceScreenshotProtectionUrl=function(){return s("2917597651792702")},t.getWAChatFaqUrl=function(){return s("general/chats/about-the-official-whatsapp-chat-account")};var i=r(n(932325));const a="https://faq.whatsapp.com";t.FAQ_BASE_URL=a;const o="web";function s(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?`${a}/${e}&platform=web&lang=${i.default.getLocale()}`:`${a}/${e}?lang=${i.default.getLocale()}`}t.PLATFORM=o},682144:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PAST_PARTICIPANT_EXPIRATION_DAYS=t.GROUP_SETTING_TYPE=void 0;t.GROUP_SETTING_TYPE={ANNOUNCEMENT:"announcement",RESTRICT:"restrict",NO_FREQUENTLY_FORWARDED:"no_frequently_forwarded",EPHEMERAL:"ephemeral",MEMBERSHIP_APPROVAL_MODE:"membership_approval_mode"};t.PAST_PARTICIPANT_EXPIRATION_DAYS=60},368156:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KEYBOARD_EVENT_KEY_VALUE=void 0;t.KEYBOARD_EVENT_KEY_VALUE={UNIDENTIFIED:"Unidentified",ALT:"Alt",ALT_GRAPH:"AltGraph",CAPS_LOCK:"CapsLock",CONTROL:"Control",FN:"Fn",FN_LOCK:"FnLock",HYPER:"Hyper",META:"Meta",NUM_LOCK:"NumLock",SCROLL_LOCK:"ScrollLock",SHIFT:"Shift",SUPER:"Super",SYMBOL:"Symbol",SYMBOL_LOCK:"SymbolLock",OS:"OS",ENTER:"Enter",TAB:"Tab",SPACE:" ",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",LEFT:"Left",RIGHT:"Right",UP:"Up",DOWN:"Down",END:"End",HOME:"Home",PAGE_DOWN:"PageDown",PAGE_UP:"PageUp",BACKSPACE:"Backspace",CLEAR:"Clear",COPY:"Copy",CR_SEL:"CrSel",CRSEL:"Crsel",CUT:"Cut",DELETE:"Delete",ERASE_EOF:"EraseEof",EX_SEL:"ExSel",EXSEL:"Exsel",INSERT:"Insert",PASTE:"Paste",REDO:"Redo",UNDO:"Undo",ESCAPE:"Escape"}},332108:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LogoutReason=t.LOGOUT_REASON_CODE=void 0;const r=n(76672)({UserInitiated:"user_initiated",SyncdFailure:"syncd_failure",InvalidAdvStatus:"invalid_adv_status",CriticalSyncTimeout:"critical_sync_timeout",SyncdTimeout:"syncd_timeout",HistorySyncTimeout:"history_sync_timeout",AccountSyncTimeout:"account_sync_timeout",MDOptOut:"md_opt_out",UnknownCompanion:"unknown_companion",ClientVersionOutdated:"client_version_outdated",SyncdErrorDuringBootstrap:"syncd_error_during_bootstrap",AccountSyncError:"account_sync_error",ClientFatalError:"client_fatal_error",StorageQuotaExceeded:"storage_quota_exceeded",PrimaryIdentityKeyChange:"primary_identity_key_change",MissingEncSalt:"missing_enc_salt",MissingScreenLockSalt:"missing_screen_lock_salt"});t.LogoutReason=r;t.LOGOUT_REASON_CODE={CLIENT_FATAL:"0",SYNC_FAIL:"1",INITIAL_HISTORY_SYNC_TIMEOUT:"2"}},373070:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SYSTEM_MESSAGE_TYPES=t.MSG_TYPE=t.ADDON_MESSAGE_TYPES=void 0;t.MSG_TYPE={NOTIFICATION:"notification",NOTIFICATION_TEMPLATE:"notification_template",GROUP_NOTIFICATION:"group_notification",GP2:"gp2",BROADCAST_NOTIFICATION:"broadcast_notification",E2E_NOTIFICATION:"e2e_notification",CALL_LOG:"call_log",PROTOCOL:"protocol",CHAT:"chat",LOCATION:"location",PAYMENT:"payment",VCARD:"vcard",CIPHERTEXT:"ciphertext",MULTI_VCARD:"multi_vcard",REVOKED:"revoked",OVERSIZED:"oversized",GROUPS_V4_INVITE:"groups_v4_invite",HSM:"hsm",TEMPLATE_BUTTON_REPLY:"template_button_reply",DEBUG:"debug",IMAGE:"image",VIDEO:"video",AUDIO:"audio",PTT:"ptt",STICKER:"sticker",DOCUMENT:"document",PRODUCT:"product",ORDER:"order",LIST:"list",INTERACTIVE:"interactive",INTERACTIVE_RESPONSE:"interactive_response",LIST_RESPONSE:"list_response",BUTTONS_RESPONSE:"buttons_response",REACTION:"reaction",REACTION_ENC:"reaction_enc",POLL_CREATION:"poll_creation",REQUEST_PHONE_NUMBER:"request_phone_number",POLL_UPDATE:"poll_update",NATIVE_FLOW:"native_flow",BIZ_COVER_PHOTO:"biz-cover-photo",KEEP_IN_CHAT:"keep_in_chat",UNKNOWN:"unknown"};t.SYSTEM_MESSAGE_TYPES=["notification","notification_template","group_notification","gp2","broadcast_notification","e2e_notification","call_log","protocol","debug"];t.ADDON_MESSAGE_TYPES=["reaction","poll_update"]},955562:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PERMISSION_DENIED=t.PERMISSION_DEFAULT=t.PERMISSION_ALLOWED=void 0;t.PERMISSION_ALLOWED="granted";t.PERMISSION_DEFAULT="default";t.PERMISSION_DENIED="denied"},997772:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.VISIBILITY_WITH_ERROR=t.VISIBILITY=t.ONLINE_VISIBILITY_WITH_ERROR=t.ONLINE_VISIBILITY=t.ALL_NONE_WITH_ERROR=t.ALL_NONE=void 0;var i=r(n(81109));const a={all:"all",contacts:"contacts",contact_blacklist:"contact_blacklist",none:"none"};t.VISIBILITY=a;const o=(0,i.default)((0,i.default)({},a),{},{error:"error"});t.VISIBILITY_WITH_ERROR=o;const s={all:"all",none:"none"};t.ALL_NONE=s;const l={all:"all",match_last_seen:"match_last_seen"};t.ONLINE_VISIBILITY=l;const u=(0,i.default)((0,i.default)({},l),{},{error:"error"});t.ONLINE_VISIBILITY_WITH_ERROR=u;const c=(0,i.default)((0,i.default)({},s),{},{error:"error"});t.ALL_NONE_WITH_ERROR=c},476314:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PROFILE_PIC_COMMAND=t.PP_URL=t.PP_TOK=t.PP_REF=void 0;t.PP_URL="https://web.whatsapp.com/pp";t.PP_REF="/pp";t.PP_TOK="/pp";const n=Object.freeze({REMOVE:"remove",SET:"set"});t.PROFILE_PIC_COMMAND=n},140661:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.REVOKE_WINDOW_V2_RECEIVER_MARGIN=t.REVOKE_WINDOW_V2=t.REVOKE_WINDOW=void 0;t.REVOKE_WINDOW=4096;t.REVOKE_WINDOW_V2=216e3;t.REVOKE_WINDOW_V2_RECEIVER_MARGIN=43200},746410:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MMS_URL_MEDIA_TYPE_SEARCH_PARAM=t.IS_MMS_URL_SEARCH_PARAM=void 0;t.IS_MMS_URL_SEARCH_PARAM="__wa-mms";t.MMS_URL_MEDIA_TYPE_SEARCH_PARAM="mms-type"},453603:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpamFlow=t.SPAM_REPORT_SUPPORTED_MESSAGE_TYPES=void 0;var r=n(373070);const i=n(76672)({Block:"block_dialog",OverflowMenuBlock:"overflow_menu_block",OverflowMenuReport:"overflow_menu_report",MediaViewer:"media_viewer",MessageMenu:"message_menu",CommunityHome:"community_home",AccountInfoReport:"account_info_report",GroupInfoReport:"group_info_report",GroupSpamBannerReport:"group_spam_banner_report",OneToOneChatSpamBannerReport:"1_1_spam_banner_report",OneToOneOldSpamBannerBlock:"1_1_old_spam_banner_block",BizSpamBannerBlock:"biz_spam_banner_block",ChatListBlock:"chat_list_block",NotificationBlock:"notification_block",StatusPostReport:"status_post_report"});t.SpamFlow=i;const a=new Set([r.MSG_TYPE.CHAT,r.MSG_TYPE.AUDIO,r.MSG_TYPE.IMAGE,r.MSG_TYPE.PTT,r.MSG_TYPE.VIDEO,r.MSG_TYPE.VCARD,r.MSG_TYPE.UNKNOWN,r.MSG_TYPE.CIPHERTEXT,r.MSG_TYPE.LIST,r.MSG_TYPE.LIST_RESPONSE,r.MSG_TYPE.BUTTONS_RESPONSE,r.MSG_TYPE.NATIVE_FLOW,r.MSG_TYPE.DOCUMENT,r.MSG_TYPE.STICKER,r.MSG_TYPE.LOCATION,r.MSG_TYPE.POLL_CREATION]);t.SPAM_REPORT_SUPPORTED_MESSAGE_TYPES=a},517286:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TEMPLATE_BUTTON_SUBTYPE=void 0;t.TEMPLATE_BUTTON_SUBTYPE={QUICK_REPLY:"quick_reply",CALL:"call",URL:"url"}},254552:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return o(null,a.default.fromForwardsStrings(e.sort(((e,t)=>t.length-e.length)).map((e=>`${e}${s}`))),null,0)};var i=r(n(103522)),a=r(n(478102));function o(e,t,n,r,a){const u=[];let c=!1,d=a;if(null==d)if(e&&1===r){l.has(e)&&(d=!0)}else e&&n&&2===r&&(d=l.has(n+e));t.getChildren().forEach((t=>{t.prefix!==s?u.push(o(t.prefix,t.node,e,r+1,d)):c=!0}));const p=""!==e||null==n||d?(0,i.default)(e||""):"?";let _=0===u.length?"":`(?:${u.join("|")})`;return _&&c&&(_+="?"),`${p}${_}`}const s="\n",l=new Set(["©","®","™","♟","♾","〰"])},798721:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.convertToTextWithoutSpecialEmojis=function(e){if(!o){const e=(0,i.default)(Object.keys(a.default));o=new RegExp(`(${e})`,"g")}return o.lastIndex=0,e.replace(o,(e=>a.default[e]))};var i=r(n(254552)),a=r(n(955615));let o=null},955615:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={"🤝🏻":"🤝","🤝🏼":"🤝","🤝🏽":"🤝","🤝🏾":"🤝","🤝🏿":"🤝","👯🏻":"👯","👯🏼":"👯","👯🏽":"👯","👯🏾":"👯","👯🏿":"👯","👯🏻‍♂":"👯‍♂","👯🏼‍♂":"👯‍♂","👯🏽‍♂":"👯‍♂","👯🏾‍♂":"👯‍♂","👯🏿‍♂":"👯‍♂"}},522357:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SEVEN_DAYS=t.ONE_DAY=t.OFF=t.NINETY_DAYS=t.KeepInChatState=t.DisappearingModeInitiator=void 0;var r=n(990445);t.OFF=0;const i=r.DAY_SECONDS;t.ONE_DAY=i;const a=7*r.DAY_SECONDS;t.SEVEN_DAYS=a;const o=90*r.DAY_SECONDS;t.NINETY_DAYS=o;const s=n(76672)({ChangedInChat:"chat",InitiatedByMe:"me",InitiatedByOther:"other"});t.DisappearingModeInitiator=s;const l=n(76672).Mirrored(["KEPT","UNKEPT"]);t.KeepInChatState=l},467057:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.decodeBroadcastEphemeralSetting=function(){return h.apply(this,arguments)};var i=r(n(348926)),a=n(417405),o=n(551168),s=n(990445),l=n(199931),u=n(309512);const c=new Uint8Array(32);function d(){return p.apply(this,arguments)}function p(){return(p=(0,i.default)((function*(e,t){const n=yield self.crypto.subtle.importKey("raw",e,"HKDF",!1,["deriveKey"]),r=yield self.crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:c,info:t},n,{name:"HMAC",hash:"SHA-256"},!0,["verify"]);return self.crypto.subtle.exportKey("raw",r)}))).apply(this,arguments)}function _(){return f.apply(this,arguments)}function f(){return(f=(0,i.default)((function*(e,t,n){const r=e.slice(0,12),i=e.slice(12,44),a=yield self.crypto.subtle.importKey("raw",i,"AES-GCM",!1,["decrypt"]);return self.crypto.subtle.decrypt({name:"AES-GCM",iv:new Uint8Array(r),additionalData:n},a,t)}))).apply(this,arguments)}function h(){return(h=(0,i.default)((function*(e,t,n,r,i){const c=e.toString({legacy:!0}),p=t.toString({legacy:!0}),f=n.toString({legacy:!0}),h=o.Binary.build(`Ephemeral ${p} ${c}`).readByteArray(),g=new Uint8Array(i),m=(0,a.decodeB64)(r),y=o.Binary.build(f).readBuffer(),E=yield d(g,h),S=yield _(E,m,y),{duration:T,timestamp:v}=(0,u.decodeProtobuf)(l.EphemeralSettingSpec,S);if(null==T||null==v)throw new Error("ephSetting decoded into malformed proto");return{ephemeralDuration:T,ephemeralSettingTimestamp:(0,s.castLongIntToUnixTime)(v)}}))).apply(this,arguments)}},808639:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DisappearingModeInitiator=void 0;const r=n(76672)({ChangedInChat:"chat",InitiatedByMe:"me",InitiatedByOther:"other"});t.DisappearingModeInitiator=r},632081:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.generateEphemeralSystemMessage=function(){return u.apply(this,arguments)};var i=r(n(348926)),a=n(990445),o=r(n(565754)),s=n(373070),l=n(459857);function u(){return(u=(0,i.default)((function*(e,t){const r=n(240493).handleSingleMsgMD,i={id:new o.default({id:o.default.newId(),remote:e.id,fromMe:!1}),from:e.id,to:(0,l.getMaybeMeUser)(),t:(0,a.unixTime)(),type:s.MSG_TYPE.PROTOCOL,subtype:"ephemeral_setting",ephemeralDuration:t,isNewMsg:!0};yield r(e.id,i,!1,!1)}))).apply(this,arguments)}},298592:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDisappearingModeSettingForChat=function(e){__LOG__(2,void 0,void 0,void 0,["DM","DDM"])`fetching DM setting for chat: ${e}`;const t=o((0,i.getMaybeMeUser)()),n=o(e);if(!t&&!n)return __LOG__(2,void 0,void 0,void 0,["DM","DDM"])`DM setting for chat: ${e} is null`,null;if(t&&n)return n.duration<t.duration?n:t;return null!=n?n:t},t.getDisappearingModeSettingForUser=o,t.getDisappearingModeSettingFromMsg=function(e){var t;if(__LOG__(2,void 0,void 0,void 0,["DM","DDM"])`fetching disappearing mode setting from msg ${null==e?void 0:e.id}`,null==e)return __LOG__(2,void 0,void 0,void 0,["DM","DDM"])`resolving DM setting with null (case 1)`,null;const n=o((0,i.getMaybeMeUser)());let r=e.disappearingModeInitiator;if(null!=n&&null==e.disappearingModeInitiator)return __LOG__(2,void 0,void 0,void 0,["DM","DDM"])`resolving DM setting using mySetting (case 1)`,n;if(null==n&&e.disappearingModeInitiator===a.DisappearingModeInitiator.InitiatedByMe)r=a.DisappearingModeInitiator.ChangedInChat;else if(null!=e.disappearingModeInitiator&&e.disappearingModeInitiator===a.DisappearingModeInitiator.ChangedInChat)return __LOG__(2,void 0,void 0,void 0,["DM","DDM"])`resolving DM setting with null (case 2)`,null;if(null==r)return __LOG__(2,void 0,void 0,void 0,["DM","DDM"])`resolving DM setting with null (case 3)`,null;const s=e.ephemeralDuration,l=null!==(t=e.ephemeralSettingTimestamp)&&void 0!==t?t:0;if(null==s||0===s)return __LOG__(2,void 0,void 0,void 0,["DM","DDM"])`resolving DM setting with null (case 4)`,null;if(null!=n&&n.settingTimestamp>l)return __LOG__(2,void 0,void 0,void 0,["DM","DDM"])`resolving DM setting with mySetting (case 2)`,n;return __LOG__(2,void 0,void 0,void 0,["DM","DDM"])`resolving DM setting with msg properties`,{duration:s,settingTimestamp:l,initiator:r}};var r=n(121977),i=n(459857),a=n(808639);function o(e){const t=(0,i.getMaybeMeUser)().toString()===e.toString(),n=r.ContactCollection.get(e);if(!n)return __LOG__(2,void 0,void 0,void 0,["DM","DDM"])`no contact found when fetching disappearing mode setting for user ${e.toString()}`,null;const o=n.disappearingModeDuration,s=n.disappearingModeSettingTimestamp;return __LOG__(2,void 0,void 0,void 0,["DM","DDM"])`disappearing mode setting fetched for ${e.toString()}: duration=${o} settingTimestamp=${s}`,null==o||0===o?null:{duration:o,settingTimestamp:null!=s?s:0,initiator:t?a.DisappearingModeInitiator.InitiatedByMe:a.DisappearingModeInitiator.InitiatedByOther}}},10777:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEphemeralDurationAllowed=function(e){return!(e<0)&&(0===e||r.ServerProps.getEphemeralMessagesAllowedValues().includes(e))};var r=n(241588)},30287:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.parseKeepInChatHistorySyncMessage=function(e){const t=e.keepInChat;if(null!=t&&null!=t.key){const{id:e,remoteJid:n,participant:r,fromMe:l}=t.key,{keepType:u,serverTimestampMs:c}=t;if(null==e||null==u||null==c||null==n)throw new Error("parseKeepInChatHistorySyncMessage: malformed KIC WebMessageInfo");const d=(0,s.parseKeepTypeToKicState)(u);if(null==d)throw new Error("parseKeepInChatHistorySyncMessage: KeepType has unsupported value");return{kicKey:new a.default({fromMe:(0,i.default)(l,"fromMe"),id:(0,i.default)(e,"id"),remote:(0,i.default)((0,o.createWidFromWidLike)(n),"createWidFromWidLike(remoteJid)"),participant:null!=r?(0,o.createWidFromWidLike)(r):void 0}),kicState:d,kicTimestampMs:parseInt(c,10)}}};var i=r(n(132375)),a=r(n(565754)),o=n(669050),s=(n(522357),n(421394))},84461:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUndoKeepInChatExpiration=function(){return(0,r.getABPropConfigValue)("keep_in_chat_undo_duration_limit")||i.REVOKE_WINDOW_V2},t.isKICFullyEnabled=function(){return(0,r.getABPropConfigValue)("keep_in_chat_receiver")&&(0,r.getABPropConfigValue)("keep_in_chat_ui_content")&&(0,r.getABPropConfigValue)("keep_in_chat_sender")},t.isKeepInChatFullyDisabled=function(){return!(0,r.getABPropConfigValue)("keep_in_chat_receiver")&&!(0,r.getABPropConfigValue)("keep_in_chat_sender")},t.isKeepInChatInCAGEnabled=function(){return(0,r.getABPropConfigValue)("supports_keep_in_chat_in_cag")},t.isKeepInChatReadAndUIEnabled=function(){return(0,r.getABPropConfigValue)("keep_in_chat_receiver")&&(0,r.getABPropConfigValue)("keep_in_chat_ui_content")},t.isKeepInChatReadEnabled=a,t.isKeepInChatReadOnlyEnabled=function(){return a()&&!(0,r.getABPropConfigValue)("keep_in_chat_sender")},t.isKeepInChatVisibleUIEnabled=function(){return(0,r.getABPropConfigValue)("keep_in_chat_ui_content")};var r=n(287461),i=n(140661);function a(){return(0,r.getABPropConfigValue)("keep_in_chat_receiver")}},421394:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.compareKeepInChatMessages=p,t.getKicSender=_,t.isKept=function(e){return e===c.KeepInChatState.KEPT},t.isUnkept=d,t.kicSenderSuperPowerActive=function(e){return d(e.kicState)&&l.default.equals(_(e),(0,a.getSender)(e))},t.parseKeepTypeToKicState=function(e){if(null!=e&&e===o.KeepType.KEEP_FOR_ALL)return c.KeepInChatState.KEPT;if(null!=e&&e===o.KeepType.UNDO_KEEP_FOR_ALL)return c.KeepInChatState.UNKEPT;return null},t.runKeepInChatTieBreaker=function(e){let t,n;e.forEach((e=>{t&&1!==p(e,t)||(n=t,t=e)})),null!=n&&(0,i.frontendSendAndReceive)("logTieBreakIgnoredKicWam",{keepInChatMessage:n});return t};var i=n(359987),a=n(147980),o=n(533494),s=n(459857),l=r(n(124928)),u=n(669050),c=n(522357);function d(e){return e===c.KeepInChatState.UNKEPT}function p(e,t){return null==e.senderTimestampMs?-1:null==t.senderTimestampMs||e.senderTimestampMs>t.senderTimestampMs||e.senderTimestampMs===t.senderTimestampMs&&e.id.id>t.id.id?1:-1}function _(e){if(null!=e.kicKey){var t,n,r;const i=(0,a.isGroupMsg)(e);if(!0===(null===(t=e.kicKey)||void 0===t?void 0:t.fromMe))return(0,s.getMaybeMeUser)();if(i&&null!=(null===(n=e.kicKey)||void 0===n?void 0:n.participant))return(0,u.toUserWid)(e.kicKey.participant);if(!i&&null!=(null===(r=e.kicKey)||void 0===r?void 0:r.remote))return(0,u.toUserWid)(e.kicKey.remote)}}},108989:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUpdateEphemeralSetting=function(e){const{oldDuration:t,oldSettingTimestamp:n,newDuration:i,newSettingTimestamp:a,chatId:o}=e;if(a>n)return!0;if(a<n)return!1;if(t===i)return!1;if((0,r.getMaybeMeUser)().isLessThan(o))return!1;return!0};var r=n(459857)},591988:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MESSAGE_EDITING_ALLOWED_DURATION_SECONDS=void 0,t.isWithinEditWindow=function(e){if((new Date).getTime()/1e3<e+900)return!0;return!1},t.isWithinParentEditWindow=function(e,t){return t<e+900},t.msgTypeSupportsEditing=function(e){if(i.includes(e))return!0;return!1};var r=n(373070);t.MESSAGE_EDITING_ALLOWED_DURATION_SECONDS=900;const i=[r.MSG_TYPE.CHAT]},655822:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.enableNuxSync=function(){return(0,r.getABPropConfigValue)("nux_sync")};var r=n(287461)},153593:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.currencyForCountryShortcode=function(e){const t=o.REGION_TO_CURRENCY[e.toUpperCase()];return(null==t?void 0:t.length)>0?t[0]:o.DEFAULT_CURRENCY},t.formatAmount1000=t.formatAmount=void 0,t.formatAmount1000ToParts=function(e,t){const n=c(),r=_(n),i=f(n,e),a=p(e,t).replace(i,"").trim(),o=a.indexOf(r),s=-1===o?a:a.substring(0,o),l=-1===o?"":a.substring(o);return{symbol:i,integer:s,decimal:l}},t.formatLocalSymbol=function(e){return f(s[e],e)},t.isSupportedCurrency=function(e){return l.has(e)},t.parseValueFromString=g,t.validatePriceString=function(e,t,n,r){const i=c(),a=void 0!==o.CURRENCY_DIGITS[e]?o.CURRENCY_DIGITS[e]:o.DEFAULT_DIGITS,s=h(e,t);if(null!=n&&s<n)return!1;if(null!=r&&s>r)return!1;const l=t.replace(/\D+$/g,""),u=_(i);if(Number.isNaN(s)||l!==t||(t.split(u)[1]||"").length>a)return!1;return!0},t.valueFromString=h;var i=r(n(81109)),a=r(n(932325)),o=n(41710);const s={IDR:"in-ID",MXN:"es-MX",INR:"en-IN"},l=new Set(["DZD","ARS","AUD","BDT","BOB","BRL","GBP","CAD","CLP","CNY","COP","CRC","CZK","DKK","EGP","EUR","GTQ","HNL","HKD","HUF","ISK","INR","IDR","ILS","JPY","KES","KRW","MOP","MYR","MXN","NZD","NIO","NGN","NOK","PKR","PYG","PEN","PHP","PLN","QAR","RON","RUB","SAR","SGD","ZAR","SEK","CHF","TWD","THB","TRY","AED","USD","UYU","VEF","VND"]),u=["es-ES","pt-BR"],c=()=>[a.default.getFullLocale(),a.default.getLocale()].filter(Boolean),d=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:c(),a="symbol";return u.includes(Array.isArray(r)?r[0]:r)&&(a="code"),new Intl.NumberFormat(r,(0,i.default)({style:"currency",currency:e,currencyDisplay:a},n)).format(t)};t.formatAmount=d;const p=(e,t,n,r)=>d(e,t/1e3,n,r);function _(e){return new Intl.NumberFormat(e).format(1.1).substring(1,2)}function f(e,t){return p(t,0,{},e).replace(/\d+([,.]\d+)?/g,"").trim()}function h(e,t){const n=c(),r=f(n,e),i=function(e){return new Intl.NumberFormat(e).format(1e4).substring(2,3)}(n);return g(t,r,_(n),i)}function g(e,t,n,r){const i=e.replace(t,"").trim().split(r).join(""),a=parseFloat(i.replace(n,".")||"0");return Math.round(1e3*a)}t.formatAmount1000=p},41710:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.REGION_TO_CURRENCY=t.DEFAULT_DIGITS=t.DEFAULT_CURRENCY=t.CURRENCY_DIGITS=void 0;t.DEFAULT_CURRENCY="USD";t.DEFAULT_DIGITS=2;t.CURRENCY_DIGITS={ADP:0,AFN:0,ALL:0,BHD:3,BIF:0,BYR:0,CLF:4,CLP:0,DJF:0,ESP:0,GNF:0,IQD:0,IRR:0,ISK:0,ITL:0,JOD:3,JPY:0,KMF:0,KPW:0,KRW:0,KWD:3,LAK:0,LBP:0,LUF:0,LYD:3,MGA:0,MGF:0,MMK:0,MRO:0,OMR:3,PYG:0,RSD:0,RWF:0,SLL:0,SOS:0,STD:0,SYP:0,TMM:0,TND:3,TRL:0,UGX:0,UYI:0,UYW:4,VND:0,VUV:0,XAF:0,XOF:0,XPF:0,YER:0,ZMK:0,ZWD:0};t.REGION_TO_CURRENCY={AC:["SHP"],AD:["EUR"],AE:["AED"],AF:["AFN"],AG:["XCD"],AI:["XCD"],AL:["ALL"],AM:["AMD"],AO:["AOA"],AR:["ARS"],AS:["USD"],AT:["EUR"],AU:["AUD"],AW:["AWG"],AX:["EUR"],AZ:["AZN"],BA:["BAM"],BB:["BBD"],BD:["BDT"],BE:["EUR"],BF:["XOF"],BG:["BGN"],BH:["BHD"],BI:["BIF"],BJ:["XOF"],BL:["EUR"],BM:["BMD"],BN:["BND"],BO:["BOB"],BQ:["USD"],BR:["BRL"],BS:["BSD"],BT:["BTN","INR"],BV:["NOK"],BW:["BWP"],BY:["BYN"],BZ:["BZD"],CA:["CAD"],CC:["AUD"],CD:["CDF"],CF:["XAF"],CG:["XAF"],CH:["CHF"],CI:["XOF"],CK:["NZD"],CL:["CLP"],CM:["XAF"],CN:["CNY"],CO:["COP"],CR:["CRC"],CU:["CUP","CUC"],CV:["CVE"],CW:["ANG"],CX:["AUD"],CY:["EUR"],CZ:["CZK"],DE:["EUR"],DG:["USD"],DJ:["DJF"],DK:["DKK"],DM:["XCD"],DO:["DOP"],DZ:["DZD"],EA:["EUR"],EC:["USD"],EE:["EUR"],EG:["EGP"],EH:["MAD"],ER:["ERN"],ES:["EUR"],ET:["ETB"],EU:["EUR"],FI:["EUR"],FJ:["FJD"],FK:["FKP"],FM:["USD"],FO:["DKK"],FR:["EUR"],GA:["XAF"],GB:["GBP"],GD:["XCD"],GE:["GEL"],GF:["EUR"],GG:["GBP"],GH:["GHS"],GI:["GIP"],GL:["DKK"],GM:["GMD"],GN:["GNF"],GP:["EUR"],GQ:["XAF"],GR:["EUR"],GS:["GBP"],GT:["GTQ"],GU:["USD"],GW:["XOF"],GY:["GYD"],HK:["HKD"],HM:["AUD"],HN:["HNL"],HR:["HRK"],HT:["HTG","USD"],HU:["HUF"],IC:["EUR"],ID:["IDR"],IE:["EUR"],IL:["ILS"],IM:["GBP"],IN:["INR"],IO:["USD"],IQ:["IQD"],IR:["IRR"],IS:["ISK"],IT:["EUR"],JE:["GBP"],JM:["JMD"],JO:["JOD"],JP:["JPY"],KE:["KES"],KG:["KGS"],KH:["KHR"],KI:["AUD"],KM:["KMF"],KN:["XCD"],KP:["KPW"],KR:["KRW"],KW:["KWD"],KY:["KYD"],KZ:["KZT"],LA:["LAK"],LB:["LBP"],LC:["XCD"],LI:["CHF"],LK:["LKR"],LR:["LRD"],LS:["ZAR","LSL"],LT:["EUR"],LU:["EUR"],LV:["EUR"],LY:["LYD"],MA:["MAD"],MC:["EUR"],MD:["MDL"],ME:["EUR"],MF:["EUR"],MG:["MGA"],MH:["USD"],MK:["MKD"],ML:["XOF"],MM:["MMK"],MN:["MNT"],MO:["MOP"],MP:["USD"],MQ:["EUR"],MR:["MRU"],MS:["XCD"],MT:["EUR"],MU:["MUR"],MV:["MVR"],MW:["MWK"],MX:["MXN"],MY:["MYR"],MZ:["MZN"],NA:["NAD","ZAR"],NC:["XPF"],NE:["XOF"],NF:["AUD"],NG:["NGN"],NI:["NIO"],NL:["EUR"],NO:["NOK"],NP:["NPR"],NR:["AUD"],NU:["NZD"],NZ:["NZD"],OM:["OMR"],PA:["PAB","USD"],PE:["PEN"],PF:["XPF"],PG:["PGK"],PH:["PHP"],PK:["PKR"],PL:["PLN"],PM:["EUR"],PN:["NZD"],PR:["USD"],PS:["ILS","JOD"],PT:["EUR"],PW:["USD"],PY:["PYG"],QA:["QAR"],RE:["EUR"],RO:["RON"],RS:["RSD"],RU:["RUB"],RW:["RWF"],SA:["SAR"],SB:["SBD"],SC:["SCR"],SD:["SDG"],SE:["SEK"],SG:["SGD"],SH:["SHP"],SI:["EUR"],SJ:["NOK"],SK:["EUR"],SL:["SLL"],SM:["EUR"],SN:["XOF"],SO:["SOS"],SR:["SRD"],SS:["SSP"],ST:["STN"],SV:["USD"],SX:["ANG"],SY:["SYP"],SZ:["SZL"],TA:["GBP"],TC:["USD"],TD:["XAF"],TF:["EUR"],TG:["XOF"],TH:["THB"],TJ:["TJS"],TK:["NZD"],TL:["USD"],TM:["TMT"],TN:["TND"],TO:["TOP"],TR:["TRY"],TT:["TTD"],TV:["AUD"],TW:["TWD"],TZ:["TZS"],UA:["UAH"],UG:["UGX"],UM:["USD"],US:["USD"],UY:["UYU"],UZ:["UZS"],VA:["EUR"],VC:["XCD"],VE:["VES"],VG:["USD"],VI:["USD"],VN:["VND"],VU:["VUV"],WF:["XPF"],WS:["WST"],XK:["EUR"],YE:["YER"],YT:["EUR"],ZA:["ZAR"],ZM:["ZMW"],ZW:["USD"]}},511448:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.augmentedCagGroupMetadataParticipantList=function(){return o.apply(this,arguments)},t.augmentedCagGroupParticipantList=function(e,t){const n=[];if(e){for(const e of t)n.push(e.id),e.lid&&n.push(e.lid);return n}for(const e of t)e.id.isLid()?n.push(e.id):e.lid&&n.push(e.lid);return n};var i=r(n(348926)),a=n(450491);function o(){return(o=(0,i.default)((function*(e){const t=e.participants.iAmAdmin(),n=e.participants.toArray(),r=[],i=[];if(t)for(const e of n)r.push(e.id),i.push((0,a.getCurrentLid)(e.id.user));else for(const e of n)e.id.isLid()?r.push(e.id):i.push((0,a.getCurrentLid)(e.id.user));const o=yield Promise.all(i);return[...r,...o].filter(Boolean)}))).apply(this,arguments)}},343609:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.createOrReplaceDisplayNamesAndLidPnMappings=function(){return o.apply(this,arguments)};var i=r(n(348926)),a=n(450491);function o(){return(o=(0,i.default)((function*(e){yield Promise.all([(0,a.createOrReplaceDisplayNames)(e.map((e=>{let{displayName:t,id:n,lid:r}=e;return null==t?null:n.isLid()?{displayName:t,lid:n.user}:null!=r?{displayName:t,lid:r.user}:null})).filter(Boolean)),(0,a.createOrReplaceLidPnMappings)(e.map((e=>{let{id:t,lid:n}=e;return null==n||t.isLid()?null:{lid:n.user,pn:t.user}})).filter(Boolean))])}))).apply(this,arguments)}},71870:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFromForReactionMessage=function(e){var t;const n=Boolean(null===(t=e.chat.groupMetadata)||void 0===t?void 0:t.isIncognitoCag),r=(0,i.getMaybeMeLidUser)();return n&&null!=r?r:(0,i.getMeUser)()},t.lidHistorySyncEnabled=function(){return!1},t.lidUsyncEnabled=function(){return(0,r.getABPropConfigValue)("usync_lid")},t.testLidWaMeLinkEnabled=function(){return!1};var r=n(287461),i=n(459857)},403385:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.REVOKED_REACTION_TEXT=void 0,t.canHaveReactions=d,t.createReactionsRowFromMsg=function(){return p.apply(this,arguments)},t.updateHasReactionFromParent=function(){return _.apply(this,arguments)};var i=r(n(348926)),a=n(297673),o=n(484777),s=n(76469),l=n(373070),u=n(23030),c=n(669050);function d(e){return e!==l.MSG_TYPE.UNKNOWN&&e!==l.MSG_TYPE.CIPHERTEXT&&e!==l.MSG_TYPE.REVOKED&&e!==l.MSG_TYPE.DEBUG&&e!==l.MSG_TYPE.GP2&&e!==l.MSG_TYPE.NOTIFICATION&&e!==l.MSG_TYPE.NOTIFICATION_TEMPLATE&&e!==l.MSG_TYPE.E2E_NOTIFICATION&&e!==l.MSG_TYPE.CALL_LOG}function p(){return(p=(0,i.default)((function*(e){const t=[],n=[];e.forEach((e=>{e&&n.push(e.reactionParentKey.toString())}));const r=yield(0,o.getMsgsByMsgKey)(n),i=new Map;return r.forEach((e=>{i.set(e.id.toString(),e)})),e.forEach((e=>{var n,r;const a=null!==(n=e.author)&&void 0!==n?n:e.from;if(!a||!e)return void __LOG__(3)`createReactionsRowFromMsg: sender or reactionMsg are null`;const o=i.get(e.reactionParentKey.toString());let s,p=0;if(o){if((null==o?void 0:o.type)===l.MSG_TYPE.CIPHERTEXT)p=1,s=u.OrphanReactionsReasonType.ParentMsgPlaceholder;else if((null==o?void 0:o.type)===l.MSG_TYPE.UNKNOWN)p=1,s=u.OrphanReactionsReasonType.ParentMsgFutureproof;else if(!d(o.type))return void __LOG__(3)`createReactionsRowFromMsg: reactions not allowed for this message type ${o.type}`}else p=1,s=u.OrphanReactionsReasonType.ParentMsgMissing;const _=(0,c.toUserWid)(a),f={msgKey:e.id.toString(),parentMsgKey:e.reactionParentKey.toString(),senderUserJid:_.toString(),reactionText:null!==(r=e.reactionText)&&void 0!==r?r:"",timestamp:e.reactionTimestamp,orphan:p,orphanReason:s,read:!1};t.push(f)})),t}))).apply(this,arguments)}function _(){return(_=(0,i.default)((function*(e){const t=[],n=[];e.forEach((e=>{const r=e.parentMsgKey;""!==e.reactionText?n.push({id:r,hasReaction:!0}):t.push(e.parentMsgKey)}));const r=yield(0,a.getFilteredReactionsFromParentMsgs)(t);return t.forEach((e=>{const t=r.get(e),i=t&&t.length>0||!1;n.push({id:e,hasReaction:i})})),(0,s.getMessageTable)().bulkCreateOrMerge(n)}))).apply(this,arguments)}t.REVOKED_REACTION_TEXT=""},147034:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TcTokenMode=void 0,t.getTcTokenDuration=o,t.isTokenExpired=function(e,t){return e<s(t)},t.shouldSendNewToken=function(e){if(null==e)return!0;const t=(0,i.getABPropConfigValue)("tctoken_duration_sender"),n=Math.floor((0,r.unixTime)()/t),a=Math.floor(e/t);return n>a},t.tokenExpirationCutoff=s;var r=n(990445),i=n(287461);const a=n(76672)({Sender:"sender",Receiver:"receiver"});function o(e){const t=e===a.Receiver?"tctoken_duration":"tctoken_duration_sender";return Math.min((0,i.getABPropConfigValue)(t),15552e3)}function s(e){const t=e===a.Receiver?"tctoken_num_buckets":"tctoken_num_buckets_sender",n=(0,i.getABPropConfigValue)(t),s=o(e),l=Math.floor((0,r.unixTime)()/s);return(0,r.castToUnixTime)((l-(n-1))*s)}t.TcTokenMode=a},110567:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ftsClient=void 0;var i=r(n(348926)),a=r(n(81109)),o=r(n(132375)),s=r(n(186749)),l=n(387273),u=r(n(155275));const c=new class{constructor(){this._pendingMap=new Map}_ensureWorkerInited(){this._worker||(s.default.onerror=e=>{this._handleWorkerError(e)},s.default.onmessageerror=e=>{this._handleMessageError(e)},s.default.onmessage=e=>{const t=e.data;this._handleWorkerResponse(t)},this._worker=s.default)}_handleMessageError(){}_handleWorkerError(e){__LOG__(3)`FTS:client: worker error: ${e}`}_handleWorkerResponse(e){const{reqId:t}=e,n=this._pendingMap.get(t);n&&(e.error?(__LOG__(3)`FTS:client: worker completed job ${n.command.operation} with error`,n.reject(new Error("FTS worker error"))):n.resolve(e.result),this._untrackInvocation(t))}startIndexer(){return this._runCommand({operation:"start-indexer"})}indexFull(){return this._runCommand({operation:"run"})}index(){return this._runCommand({operation:"consume"})}purge(e){return this._runCommand({operation:"purge",ids:e})}purgeRange(e){return this._runCommand((0,a.default)({operation:"purge-range"},e))}reInit(){return this._runCommand({operation:"re-init"})}clearInitializationPromises(){return this._runCommand({operation:"clear-init"})}search(e,t){var n=this;return(0,i.default)((function*(){const r=yield n._runCommand({operation:"find",query:e,queryOptions:t});return n._coerceToSearchResult(r)}))()}_coerceToSearchResult(e){var t=this;return(0,i.default)((function*(){if(Array.isArray(e)||"boolean"==typeof e)return{canceled:!1,eof:!0,status:404,messages:[]};const{resolved:n,unresolved:r}=yield(0,l.resolveMsgIds)(e.messages),{eof:i,status:a}=e;return r.length>0&&t.purge(r),{canceled:!1,eof:i,status:a,messages:n}}))()}_runCommand(e){this._ensureWorkerInited();const t=(0,u.default)();return new Promise(((n,r)=>{this._pendingMap.set(t,{resolve:n,reject:r,command:e}),this._message({command:e,reqId:t})})).finally((()=>{this._untrackInvocation(t)}))}_untrackInvocation(e){this._pendingMap.delete(e)}_message(e){(0,o.default)(this._worker,"this._worker").postMessage(e)}};t.ftsClient=c},387273:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveMsgIds=function(e){const t=e.map((e=>+e.id)),n=new Map(e.map((e=>[+e.id,e])));return(0,i.getTable)().anyOf(["rowId"],t).then((e=>{const t=[];e.forEach((e=>{const i=(0,r.messageFromDbRow)(e),a=n.get(i.rowId);null!=a&&a.id===String(i.rowId)&&a.timestamp===i.t&&a.chatId===i.id.remote.toString()&&(t.push(i),n.delete(i.rowId))}));const i=Array.from(n.keys(),(e=>String(e)));return t.sort(((e,t)=>t.t-e.t)),{resolved:t,unresolved:i}}))};var r=n(907539),i=n(121260)},969104:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FTS_TYPING_DELAY=t.FTS_TTL=t.FTS_NUM_RESULTS=t.FTS_MIN_CHARS=void 0;t.FTS_MIN_CHARS=2;t.FTS_TTL=6e4;t.FTS_TYPING_DELAY=300;t.FTS_NUM_RESULTS=30},155275:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return n++};let n=0},72696:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QUICK_PAY_PRODUCT_TYPE_GATING=void 0,t.bannedShopsEnabled=function(){return(0,r.getABPropConfigValue)("banned_shops_ux_enabled")},t.billingEnabled=function(){return(0,l.isSMB)()&&(0,r.getABPropConfigValue)("smb_billing_enabled")},t.bizLinkedAccountsEnabled=function(){return(0,r.getABPropConfigValue)("web_abprop_business_profile_refresh_linked_accounts_killswitch")},t.blockCatalogCreationECommerceComplianceIndia=function(e){var t;return p(null==e?void 0:e.id.user,(()=>(0,r.getABPropConfigValue)("web_abprop_block_catalog_creation_ecommerce_compliance_india")),(()=>u.ServerProps.blockCatalogCreationEcommerceComplianceIndia))&&(null==e||null===(t=e.profileOptions)||void 0===t?void 0:t.commerceExperience)===i.COMMERCE_EXPERIENCE_TYPES.NONE},t.btmThreadsLoggingEnabled=function(){return(0,r.getABPropConfigValue)("btm_threads_logging_enabled")},t.buttonsMessagesEnabled=function(){return u.ServerProps.webButtonsMessage},t.canAppealCollections=function(){return(0,r.getABPropConfigValue)("smb_collections_appeal_flow_enabled")},t.canDisplayLabel=function(){return(0,l.isSMB)()},t.canEditLabel=function(){return!1},t.canEditLabelAssociation=function(){return(0,l.isSMB)()},t.canManageCollections=function(){return(0,r.getABPropConfigValue)("smb_collections_enabled")},t.canSeeBizProfileV3=function(){return(0,r.getABPropConfigValue)("business_profile_refresh_m1_enabled")},t.canSeeECommerceComplianceIndiaCountryOriginExemptBusinessJourney=function(e){return p(e,(()=>(0,r.getABPropConfigValue)("smb_ecommerce_compliance_india_m4_5")),(()=>u.ServerProps.smbEcommerceComplianceIndiaM4_5))},t.canSeeECommerceComplianceIndiaHardEnforcementBusinessJourney=function(e){return p(e,(()=>(0,r.getABPropConfigValue)("smb_ecommerce_compliance_india_m4")),(()=>u.ServerProps.smbEcommerceComplianceIndiaM4))},t.canSeeECommerceComplianceIndiaSoftEnforcement=function(e){return d(e)},t.canSeeSMBUpsell=function(){return u.ServerProps.webSMBUpsellInBizProfile},t.canSendQuickReply=function(){return(0,l.isSMB)()},t.canToggleCartOnOff=function(){return u.ServerProps.webCartOnOffToggle},t.canViewBizLinkedAccounts=function(){return(0,r.getABPropConfigValue)("web_abprop_business_profile_refresh_linked_account_enabled")},t.catalogCategoriesEnabled=function(){return(0,r.getABPropConfigValue)("catalog_categories_enabled")},t.chatAssignmentEnabled=g,t.chatAssignmentMaxNuxImpressions=function(){return g()?(0,r.getABPropConfigValue)("smb_md_agent_chat_assignment_nux_impressions"):0},t.chatAssignmentSystemMessagesEnabled=function(){return g()&&(0,r.getABPropConfigValue)("smb_md_agent_chat_assignment_system_messages_enabled")},t.commerceFeaturesDisabledBySanctions=function(){return(0,r.getABPropConfigValue)("commerce_sanctioned")},t.commerceThreadsLoggingEnabled=function(){return(0,r.getABPropConfigValue)("native_commerce_threads_logging_enabled")},t.countryGatingEnabled=function(){return(0,r.getABPropConfigValue)("country_client_gating_enabled")},t.coverPhotoPrivacyMessagingEnabled=function(){return(0,r.getABPropConfigValue)("smb_temp_cover_photo_privacy_messaging")},t.getBillingPremiumAccessConfig=function(){if(!(0,l.isSMB)())return"{}";return(0,r.getABPropConfigValue)("smb_billing_premium_access_config")},t.graphQLForCatalogM1Enabled=function(){return(0,r.getABPropConfigValue)("graphql_privacy_imp_m1")},t.graphQLForCollectionM2Enabled=function(){return(0,r.getABPropConfigValue)("graphql_privacy_imp_m2")},t.hideUnsupportedCurrency=function(){return(0,r.getABPropConfigValue)("smb_hide_unsupported_currency_price")},t.interactiveNativeFlowMessagesEnabled=function(){return!(0,r.getABPropConfigValue)("interactive_message_native_flow_killswitch")},t.interactiveNativeFlowResponseMessagesEnabled=function(){return!(0,r.getABPropConfigValue)("interactive_response_message_native_flow_killswitch")},t.interactiveResponseMessagesEnabled=function(){return!(0,r.getABPropConfigValue)("interactive_response_message_killswitch")},t.isBizCoverPhotoEditEnabled=function(){return(0,r.getABPropConfigValue)("web_abprop_business_profile_refresh_edit_cover_photo_enabled")},t.isBizCoverPhotoViewEnabled=function(){return(0,r.getABPropConfigValue)("web_abprop_business_profile_refresh_cover_photo_view_enabled")},t.isCallingToPrimarySMBLimitEnabled=function(){return(0,r.getABPropConfigValue)("call_only_primary_device_limit_exceeded")},t.isCollectionReorderingEnabled=function(){return(0,r.getABPropConfigValue)("smb_catalog_collections_reordering_enabled")},t.isCustomURLViaBizProfileEnabled=function(){return(0,r.getABPropConfigValue)("smb_biz_profile_custom_url")},t.isMultiDeviceAgentsLoggingEnabled=function(){return f()&&(0,r.getABPropConfigValue)("smb_multi_device_agents_logging_V2_enabled")},t.isMultiDeviceMessageAttributionEnabled=f,t.isOrderDetailsQuickPayEnabled=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_.NONE;try{const{allowed_product_type:t}=JSON.parse((0,r.getABPropConfigValue)("order_details_quick_pay"));if(t&&t!==_.NONE)return t===_.ANY||t===e}catch(e){__LOG__(3)`isOrderDetailsQuickPayEnabled failed to parse config json: error ${e}`}return!1},t.isPSForCatalogViewEnabled=function(){return(0,r.getABPropConfigValue)("web_enable_biz_catalog_view_ps_logging")},t.isQuantityControlsFeatureEnabled=h,t.isSendCartCTAEnabled=function(){return h()&&(0,r.getABPropConfigValue)("send_cart_cta_long_button_enabled")},t.isSmbMelonDisplayEnabled=function(){return(0,r.getABPropConfigValue)("smb_melon_display_enabled")},t.isSmbOrangeEnabled=function(){return!!(0,l.isSMB)()&&(0,r.getABPropConfigValue)("smb_orange_enabled")},t.messageQuickReplyEnabled=function(){return(0,r.getABPropConfigValue)("message_quick_reply")},t.nativeFlowMessagesEnabled=function(){return(0,r.getABPropConfigValue)("nfm_rendering_enabled")},t.orderDetailsCustomItemEnabled=function(){return(0,r.getABPropConfigValue)("order_details_custom_item_enabled")},t.orderDetailsFromCartEnabled=function(){return(0,r.getABPropConfigValue)("order_details_from_cart_enabled")},t.orderDetailsFromCatalogEnabled=function(){return(0,r.getABPropConfigValue)("order_details_from_catalog_enabled")},t.orderDetailsTotalMaxValue=function(){return(0,r.getABPropConfigValue)("order_details_total_maximum_value")},t.orderDetailsTotalOrderMinimumValue=function(){return(0,r.getABPropConfigValue)("order_details_total_order_minimum_value")},t.orderManagementEnabled=function(){return(0,r.getABPropConfigValue)("order_management_enabled")},t.productListMessagesEnabled=function(){return u.ServerProps.webProductListMessage},t.quickRepliesManagementEnabled=function(){return(0,l.isSMB)()&&(0,r.getABPropConfigValue)("web_quick_reply_authoring")},t.shopsInteractiveMessageEnabled=function(){return(0,r.getABPropConfigValue)("web_shop_storefront_message")},t.shouldReorderChatOnAssignment=function(e){if(e)return(0,r.getABPropConfigValue)("smb_md_agent_chat_assignment_chats_reorder_on_chat_unassignment_enabled");return(0,r.getABPropConfigValue)("smb_md_agent_chat_assignment_chats_reorder_on_chat_assignment_enabled")},t.smartFiltersEnabled=function(){return(0,l.isSMB)()&&(0,r.getABPropConfigValue)("smart_filters_enabled")||!(0,l.isSMB)()&&(0,r.getABPropConfigValue)("smart_filters_enabled_consumer")},t.smbBizProfileLoggingEnabled=function(){if((0,l.isSMB)())return(0,r.getABPropConfigValue)("smb_biz_profile_logging_enabled");return!1},t.smbClickToChatLoggingEnabled=function(){if((0,l.isSMB)())return(0,r.getABPropConfigValue)("smb_click_to_chat_logging_enabled");return!1},t.subscriptionFetchEnabled=function(){return!!(0,l.isSMB)()&&(0,r.getABPropConfigValue)("smb_dcp_enabled")},t.tos3GatingEnabled=function(){if(!(0,l.isSMB)())return(0,r.getABPropConfigValue)("tos_3_client_gating_enabled");return!1},t.tos3GatingEnabledB2C=function(){if(!(0,l.isSMB)())return(0,r.getABPropConfigValue)("tos_3_client_gating_biz_initiated_enabled");return!1},t.tosFetchEnabled=function(){if(!(0,l.isSMB)())return(0,r.getABPropConfigValue)("tos_client_state_fetch_enabled");return!1},t.tosFetchIteration=function(){return(0,r.getABPropConfigValue)("tos_client_state_fetch_iteration")};var r=n(287461),i=n(817649),a=n(676594),o=n(486392),s=n(390912),l=n(828770),u=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(241588));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}function d(e){return(0,o.getCountryShortcodeByPhone)(e||"")===a.COMPLIANCE_INFO_CODES.INDIA||s.LegacyPhoneFeatures.supportsFeature(s.LegacyPhoneFeatures.F.SKIP_COMPLIANCE_PHONE_CHECK)}function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>!1;return!!d(e)&&t()}const _=n(76672)({DIGITAL_GOODS:"digital-goods",PHYSICAL_GOODS:"physical-goods",ANY:"any",NONE:"none"});function f(){return(0,l.isSMB)()&&(0,r.getABPropConfigValue)("smb_multi_device_message_attribution_enabled")}function h(){return(0,r.getABPropConfigValue)("web_quantity_controls_enabled")}function g(){return(0,l.isSMB)()&&(0,r.getABPropConfigValue)("smb_md_agent_chat_assignment_enabled")}t.QUICK_PAY_PRODUCT_TYPE_GATING=_},650201:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debugDisableFeatureFlag=function(e){n[e]=!1},t.debugEnableFeatureFlag=function(e){n[e]=!0},t.isFeatureEnabled=function(e){return n[e]},t.overwriteDebugFeatures=function(){};const n={a11y_block:!1,download_status_thumb_mms:!1,format_bulleted_msg:!1,media_existence_check:!1,web_voip_voice_call:!1,web_voip_video_call:!1,youtube_video_preview_without_blur:!1,message_add_ons:!1,reactions_filter_problematic_flags:!0,native_promise_runtime:!1}},390912:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.LegacyPhoneFeatures=t.FEATURE_CHANGE_EVENT=void 0,t.getProtobufFeatureName=T;var i=r(n(23279)),a=r(n(618446)),o=r(n(114176)),s=r(n(766678)),l=r(n(944908)),u=r(n(385564)),c=r(n(682492)),d=r(n(617204)),p=n(609398),_=r(n(464359)),f=r(n(395654)),h=(r(n(665810)),n(968923));const g=(0,p.getProtoInternalSpec)(h.WebFeaturesSpec),m=(0,d.default)(Object.keys(g).map((e=>[T(e),!1]))),y={RESEND_ICON:!1,DEBUG_COMMANDS:!1,SKIP_COMPLIANCE_PHONE_CHECK:!1},E=[[(0,c.default)(y,m),{},{},{},{ARCHIVE_BROADCAST:!0},{RECENT_EMOJI_SYNC:!0},{},{},{},{},{},{INDEX_RECEIVED_VCARD:!1},{STATUS_V3_UI_SENDING:!1},{MEDIAS_COUNT:!1},{},{},{}]],S={KEY_PARTICIPANT:!1,RICH_TEXT:!0};function T(e){return(0,_.default)(e).toUpperCase()}const v="feature_change";t.FEATURE_CHANGE_EVENT=v;class A extends f.default{constructor(){super(),this.FEATURE_CHANGE_EVENT=v,this.silenceChangeEvents=!0,this.triggerFeaturesChangedDebounced=(0,i.default)((()=>{this.trigger(v)}),50),this.features={};const e=(0,u.default)((0,u.default)(E).map(Object.keys)).concat(Object.keys(S));this.F=(0,d.default)((0,l.default)(e).map((e=>[e,e]))),this.setVersion([0,0]),this.silenceChangeEvents=!1}setVersion(e){if(this.proto&&this.proto.length===e.length&&this.proto[0]===e[0]&&this.proto[1]===e[1])return;this.proto=e;const t=E.slice(0,e[0]+1),n=E.slice(e[0]+1,E.length),r=t[e[0]],i=r.slice(0,e[1]+1),l=r.slice(e[1]+1,r.length);t[e[0]]=i,n.unshift(l);const p=(0,s.default)(this.features);this.features=(0,c.default)((0,o.default)((0,c.default)({},...(0,u.default)(t)),(e=>!e)),this.features||{});const _=(0,c.default)({},...(0,u.default)(n));this.features=(0,o.default)(this.features,((e,t)=>!!_[t])),this.VF=(0,d.default)(Object.keys((0,c.default)({},...(0,u.default)(t))).map((e=>[e,e]))),(0,a.default)(p,this.features)||this.triggerFeaturesChanged()}setPlatform(e){let t=!1;switch(e){case"iphone":t=!1!==this.features.RECENT_EMOJI_SYNC||!1!==this.features.ARCHIVE_BROADCAST||!0!==this.features.RESEND_ICON,this.features.RECENT_EMOJI_SYNC=!1,this.features.ARCHIVE_BROADCAST=!1,this.features.RESEND_ICON=!0}t&&this.triggerFeaturesChanged()}setFeatureFromFlags(e,t,n){let r=!1;switch(n){case h.WebFeatures$Flag.FORCE_UPGRADE:switch(t){case h.WebFeatures$Flag.FORCE_UPGRADE:r=!0;break;case h.WebFeatures$Flag.PRODUCTION:case h.WebFeatures$Flag.DEVELOPMENT:case h.WebFeatures$Flag.NOT_STARTED:r=!1,__LOG__(4,void 0,new Error,!0)`wap:features:${e} phone value is ${n} and web value is ${t}.`,SEND_LOGS("wap_feature_unreachable_code")}break;case h.WebFeatures$Flag.PRODUCTION:switch(t){case h.WebFeatures$Flag.FORCE_UPGRADE:r=!1,__LOG__(4,void 0,new Error,!0)`wap:features:${e} phone value is ${n} and web value is ${t}.`,SEND_LOGS("wap_feature_unexpected");break;case h.WebFeatures$Flag.PRODUCTION:r=!0;break;case h.WebFeatures$Flag.DEVELOPMENT:case h.WebFeatures$Flag.NOT_STARTED:r=!1}break;case h.WebFeatures$Flag.DEVELOPMENT:switch(t){case h.WebFeatures$Flag.FORCE_UPGRADE:case h.WebFeatures$Flag.PRODUCTION:case h.WebFeatures$Flag.DEVELOPMENT:case h.WebFeatures$Flag.NOT_STARTED:r=!1}break;case h.WebFeatures$Flag.NOT_STARTED:r=!1}const i=T(e);return this.setFeature(i,r)}setFeature(e,t){let n;n=!!t;const r=this.features[e]!==n;return this.features[e]=n,r&&this.triggerFeaturesChanged(),r}setFeatures(e){const t={},n=(0,c.default)({},S,e);for(const e in n)e in this.VF||(t[e]=this.setFeature(e,n[e]));return t}supportsFeature(e){return!!this.features[e]}supportsFeatureFromFlags(e){const t=T(e);return this.supportsFeature(t)}supportsAllFeatures(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.every((e=>!!this.features[e]))}supportsAnyFeature(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.some((e=>!!this.features[e]))}resetFeatures(){this.proto=[0,0],this.features={},this.triggerFeaturesChanged()}triggerFeaturesChanged(){this.silenceChangeEvents||this.triggerFeaturesChangedDebounced()}overwriteDebugGKs(){}}const C=new A;t.LegacyPhoneFeatures=C},97858:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.accidentalDeleteMessageEnabled=function(){return(0,i.getABPropConfigValue)("web_accidental_delete_for_me")||!1},t.adminIncludeMessageSecretInCag=function(){return(0,i.getABPropConfigValue)("admin_include_message_secret_in_cag")},t.adminRevokeHistorySyncConsumerEnabled=function(){return(0,i.getABPropConfigValue)("admin_revoke_history_sync_consumer")},t.adminRevokeReceiverEnabled=function(){return(0,i.getABPropConfigValue)("admin_revoke_receiver")},t.adminRevokeSenderEnabled=function(){return(0,i.getABPropConfigValue)("admin_revoke_sender")},t.archiveV2Supported=function(){return(0,i.getABPropConfigValue)("sync_archive_v2_setting")},t.cagReactionsReceive=function(){return(0,i.getABPropConfigValue)("cag_reactions_receive")},t.cagReactionsSend=function(){return(0,i.getABPropConfigValue)("cag_reactions_send")&&!(0,s.isSMB)()},t.clearOrDeleteChatSyncEnabled=function(){if(d.ServerProps.syncdClearChatDeleteChatEnabled){if(((0,s.getMobilePlatform)()===s.PLATFORMS.ANDROID||(0,s.getMobilePlatform)()===s.PLATFORMS.SMBA)&&(0,u.getPrimaryAllowsAllMutations)())return!0;if(((0,s.getMobilePlatform)()===s.PLATFORMS.IPHONE||(0,s.getMobilePlatform)()===s.PLATFORMS.SMBI)&&(null==c?void 0:c.PrimaryFeatures.clearAndDeleteChatSync))return!0}return!1},t.communitiesEnabled=f,t.communityAdminPromotionOneTimePromptEnabled=function(){return f()&&(0,i.getABPropConfigValue)("community_admin_promotion_one_time_prompt")},t.communityCreatePrivacyEnabled=function(){return(0,i.getABPropConfigValue)("parent_group_create_privacy")},t.communityCreationEnabled=function(){if(!f())return!1;if((0,s.isSMB)())return(0,i.getABPropConfigValue)("parent_group_create_enabled_for_smb_on_web");return(0,i.getABPropConfigValue)("parent_group_create_enabled")},t.compareOSVersions=E,t.documentWithCaptionsReceiveEnabled=function(){return!!h()||(0,i.getABPropConfigValue)("documents_with_captions_receive")},t.documentWithCaptionsSendEnabled=h,t.experimentalEmojiAPIEnabled=function(){return(0,i.getABPropConfigValue)("web_abprop_emoji_experimental_api")},t.forwardMediaWithCaptionsEnabled=function(){return(0,i.getABPropConfigValue)("forward_media_with_captions")},t.fourReactionsInBubbleEnabled=function(){return(0,i.getABPropConfigValue)("four_reactions_in_bubble_enabled")},t.futureproofReparsingNonAddOnsEnabled=function(){return(0,i.getABPropConfigValue)("web_fp_reparsing_for_non_add_ons")},t.getGraphqlLocaleRemapping=function(){return(0,i.getABPropConfigValue)("graphql_locale_remapping")},t.getGroupSizeLimit=function(e){let t;t=e===a.GroupType.DEFAULT_ANNOUNCEMENT_GROUP?(0,i.getABPropConfigValue)("community_announcement_group_size_limit"):(0,i.getABPropConfigValue)("group_size_limit")-1;(null==t||t<=0||Number.isNaN(t))&&(t=d.ServerProps.maxParticipants);return t},t.getMaxContactsToShowCommonGroups=function(){return(0,i.getABPropConfigValue)("web_max_contacts_to_show_common_groups")},t.getMaxFoundCommonGroupsDisplayed=function(){return(0,i.getABPropConfigValue)("web_max_found_common_groups_displayed")},t.getParentGroupLinkLimit=function(){return(0,i.getABPropConfigValue)("parent_group_link_limit")+1},t.getParentGroupLinkLimitCommunityCreation=function(){return(0,i.getABPropConfigValue)("parent_group_link_limit_community_creation")+1},t.gifAutoplayEnabled=function(){return(0,i.getABPropConfigValue)("gif_autoplay_enabled")},t.groupChatProfilePictureEnabled=function(){return(0,i.getABPropConfigValue)("group_chat_profile_pictures_enabled")},t.groupProfileEditorEnabled=function(){return(0,i.getABPropConfigValue)("web_group_profile_editor")},t.isAutoMuteConfirmationDialogEnabled=function(){return(0,i.getABPropConfigValue)("web_auto_mute_256_groups_confirmation")},t.isFavoriteStickersEnabled=function(){return(0,i.getABPropConfigValue)("sticker_md_favorite_stickers_enabled")&&!!(null==c?void 0:c.PrimaryFeatures.favoriteSticker)},t.isHighQualityVideoThumbnailsEnabled=function(){const{UA:e}=n(368170),t=(0,l.getModernizr)();return!(e.isGecko&&!(null==t?void 0:t.exiforientation))},t.isNewCommonGroupsSearchEnabled=function(){return(0,i.getABPropConfigValue)("web_new_group_member_search")},t.isRecentStickersEnabled=function(){return!0},t.isRecentStickersMDEnabled=function(){return(0,i.getABPropConfigValue)("recent_sticker_rollout_phase")>=3&&!!(null==c?void 0:c.PrimaryFeatures.recentSticker)},t.isStickerRmrSyncEnabled=function(){return(0,i.getABPropConfigValue)("recent_sticker_rollout_phase")>=4||(0,i.getABPropConfigValue)("favorite_sticker_rmr_sync_enabled")},t.isVIdDeprecationEnabled=function(){return(0,i.getABPropConfigValue)("v_id_deprecation_enabled")},t.isViewOnceSunsetEnabled=function(){return!!(null==c?void 0:c.PrimaryFeatures.viewOnceSpReceiver)&&(0,i.getABPropConfigValue)("view_once_sp_receiver")},t.isWebUserOnSupportedWindowsOSForUWPAsync=y,t.isWebUserOnSupportedWindowsOSForUWPSync=function(){null==m&&y();return m},t.legacyUsersShouldUpdatePrimaryExperience=function(){return!1},t.mediaEditorBlurToolEnabled=function(){return(0,i.getABPropConfigValue)("web_media_editor_blur_tool")},t.mediaLinksDocsFilteringEnabled=function(){return(0,i.getABPropConfigValue)("web_abprop_media_links_docs_search")},t.messageCustomAriaLabelEnabled=function(){return(0,i.getABPropConfigValue)("web_message_custom_aria_label")},t.messageLevelReportingEnabled=function(){return(0,i.getABPropConfigValue)("message_level_reporting")},t.messageListA11yRedesignEnabled=function(){return(0,i.getABPropConfigValue)("web_message_list_a11y_redesign")},t.messagePluginBackendRegistrationEnabled=function(){return(0,i.getABPropConfigValue)("web_message_plugin_backend_registration_enabled")},t.messagePluginFrontendRegistrationEnabled=function(){return(0,i.getABPropConfigValue)("web_message_plugin_frontend_registration_enabled")},t.multiSkinToneEmojiPickerEnabled=function(){return(0,i.getABPropConfigValue)("web_multi_skin_toned_emoji_picker")||!1},t.paymentBackgroundEnabled=function(){if(d.ServerProps.webPaymentBackgroundEnabled)return!0;return!1},t.pinChatSyncEnabled=function(){if(d.ServerProps.syncdPinChatEnabled)return!!((0,s.getMobilePlatform)()!==s.PLATFORMS.ANDROID&&(0,s.getMobilePlatform)()!==s.PLATFORMS.SMBA||(0,u.getPrimaryAllowsAllMutations)());return!1},t.pnhCagShowMaskedMembersEnabled=function(){return(0,i.getABPropConfigValue)("pnh_cag_show_masked_members")},t.prekeyFetchForMessageResendEnabled=function(){return(0,i.getABPropConfigValue)("prekey_fetch_iq_for_missing_devices_enabled")},t.privacyAllowContactsExceptEnabled=function(){return(0,i.getABPropConfigValue)("privacy_allow_contacts_except")&&!!(null==c?void 0:c.PrimaryFeatures.contactExcept)},t.queryVerifiedNameWhenMsgDiffers=function(){return(0,i.getABPropConfigValue)("query_verified_name_when_msg_differs")},t.reactionsPrekeysFetchEnabled=function(){return(0,i.getABPropConfigValue)("reactions_panel_prekeys_fetch_enabled")},t.receiveMessageEditEnabled=function(){return(0,i.getABPropConfigValue)("message_edit_receive")||g()},t.rotateSenderKeyIfSentEnabled=function(){return(0,i.getABPropConfigValue)("web_rotate_sender_key_if_sent")},t.screenLockFeatureSupported=function(){return(0,i.getABPropConfigValue)("web_abprop_screen_lock_enabled")},t.sendKeyDistributionMsgMinGroupSize=function(){return(0,i.getABPropConfigValue)("web_send_invisible_msg_min_group_size")},t.sendKeyDistributionMsgToNewGroups=function(){return(0,i.getABPropConfigValue)("web_send_invisible_msg_to_new_groups")},t.sendMessageEditEnabled=g,t.sendOnlyActiveReceiptsEnabled=function(){return(0,i.getABPropConfigValue)("web_send_only_active_receipts")},t.shouldRemoveChatStateOptimization=function(){return"disabled"===(0,i.getABPropConfigValue)("trusted_contacts_chat_state_optimization")},t.showReactionChatListPreview=function(){return(0,i.getABPropConfigValue)("reactions_chat_preview")},t.web2FAEnabled=function(){return(0,i.getABPropConfigValue)("web_2fa")},t.webMediaAutoDownloadEnabled=function(){return(0,i.getABPropConfigValue)("web_media_auto_download_enabled")};var i=n(287461),a=n(862159),o=r(n(524173)),s=n(828770),l=n(223713),u=n(673168),c=_(n(736751)),d=_(n(241588));function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(p=function(e){return e?n:t})(e)}function _(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=p(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function f(){return(0,s.isSMB)()?(0,i.getABPropConfigValue)("parent_group_view_enabled_for_smb_on_web"):(0,i.getABPropConfigValue)("parent_group_view_enabled")}function h(){return(0,i.getABPropConfigValue)("documents_with_captions_send")}function g(){return(0,i.getABPropConfigValue)("message_edit_send")}let m=null;function y(){var e,t;return null!=m?Promise.resolve(m):Promise.resolve(null===(e=self.navigator)||void 0===e||null===(t=e.userAgentData)||void 0===t?void 0:t.getHighEntropyValues(["platformVersion"])).then((e=>{var t;if(null!=(null==e?void 0:e.platformVersion)&&"windows"===(null===(t=e.platform)||void 0===t?void 0:t.toLowerCase())&&null!=e.platformVersion)m=E("8.0.0",e.platformVersion)<=0;else{const e=o.default.info();m="Windows"===e.os&&parseInt(e.version,10)>=10}return m}))}function E(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"})}},430252:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Killswitch=void 0,t.getKillswitchOverridesMap=function(){return null},t.getKillswitchValue=function(){return o.apply(this,arguments)},t.setKillswitchOverride=function(){};var i=r(n(348926));const a=n(76672)({DESKTOP_UPSELL_WINDOWS_QR_BANNER:"wa_web/logged_out_killswitches:desktop_upsell_windows_qr_banner",ELECTRON_WINDOWS_QR_BANNER:"wa_web/logged_out_killswitches:electron_windows_qr_banner",ELECTRON_WINDOWS_APP_EXPIRED:"wa_web/logged_out_killswitches:electron_windows_app_expired",ELECTRON_WINDOWS_PREVENT_LOGIN:"wa_web/logged_out_killswitches:electron_windows_prevent_login"});function o(){return(o=(0,i.default)((function*(e){try{const t=yield fetch(`https://web.whatsapp.com/killswitch/${e}`,{credentials:"include"}),n=yield t.json();if(n&&"object"==typeof n)return n.value||null}catch(t){return __LOG__(2)`Unable to query killswitch ${e}`,null}}))).apply(this,arguments)}t.Killswitch=a},556078:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pastParticipantsDbEnabled=i,t.pastParticipantsScreenEnabled=a,t.silentGroupExitDialogEnabled=function(){return(0,r.getABPropConfigValue)("silent_group_exit_dialog")},t.skipLeaveSystemMessageEnabled=function(){return a()&&(0,r.getABPropConfigValue)("silent_group_exit")};var r=n(287461);function i(){return(0,r.getABPropConfigValue)("silent_group_exit_db")}function a(){return i()&&(0,r.getABPropConfigValue)("silent_group_exit_past_participants")}},918715:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.areStatusQuickRepliesEnabled=function(){return(0,r.getABPropConfigValue)("status_quick_reply_enabled")},t.canSeeStatusV3OnContact=function(){return(0,r.getABPropConfigValue)("web_abprop_business_profile_refresh_status_enabled")},t.isStatusV3ProfilePhotoRingEnabled=function(){return(0,r.getABPropConfigValue)("profile_photo_rings_for_status_on_web_enabled")},t.isStatusV3VoiceStatusReceiptEnabled=function(){return(0,r.getABPropConfigValue)("voice_status_receipt_on_web_enabled")},t.smbStatusLoggingEnabled=function(){if(i.Conn.isSMB)return(0,r.getABPropConfigValue)("smb_status_logging_enabled");return!1},t.statusQuickReplyEmojis=function(){try{const e=JSON.parse((0,r.getABPropConfigValue)("status_reaction_emojis")).map((e=>String.fromCodePoint(e))).filter((e=>o.has(e)));return 0===e.length?a:e}catch(e){return a}},t.statusV3LinkPreviewEnabled=function(){return(0,r.getABPropConfigValue)("status_inline_link_preview_enabled")};var r=n(287461),i=n(266888);const a=["😍","😂","😮","😢","🙏","👏","🎉","💯"],o=new Set(["😍","😂","😮","😢","🙏","👏","🎉","💯","👍","❤","😊","🥰","🤩","💚","🤣","😆","🔥","🙌","🥳","😭","😔","🥺","😲","🤯","😡","😤"])},429933:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigImpl=void 0;var i=r(n(480925)),a=r(n(132375)),o=n(287461),s=r(n(542817)),l=n(304528),u=n(266888),c=r(n(174285)),d=n(241588),p=n(94872);const _={isCompanion:()=>!0,logoutInProgress:()=>s.default.isLogoutInProgress,mediaImagePreviewHkdfInfo:()=>{throw(0,i.default)("config: No config for mediaImagePreviewHkdfInfo")},mediaVideoPreviewHkdfInfo:()=>{throw(0,i.default)("config: No config for mediaVideoPreviewHkdfInfo")},offlineProcessingState:()=>n(359484).OfflineMessageHandler.isResumeFromRestartComplete()?"idle":"processing",orchestratorVersion:()=>"default",primaryPlatform:()=>u.Conn.platform,syncdActionHandlers:()=>l.ActionHandlers,syncdAdditionalMutations:()=>(0,o.getABPropConfigValue)("syncd_additional_mutations_count"),syncdDisabled:()=>"true"===(0,a.default)(c.default,"localStorage").getItem(p.KEYS.SYNCD_DISABLED_DUE_TO_FATAL),syncdInlineMutationsMaxCount:()=>d.ServerProps.syncdInlineMutationsMaxCount,syncdKeyMaxUseDays:()=>d.ServerProps.syncdKeyMaxUseDays,syncdMaxMutationsToProcessDuringResume:()=>(0,o.getABPropConfigValue)("web_syncd_max_mutations_to_process_during_resume"),syncdPatchDeviceIndexIncluded:()=>d.ServerProps.syncdPatchDeviceIndexIncluded,syncdPatchProtobufMaxSize:()=>d.ServerProps.syncdPatchProtobufMaxSize,syncdQPLLoggingEnabled:()=>d.ServerProps.syncdQPLLoggingEnabled,syncdShouldFatalOnMissingPatch:()=>(0,o.getABPropConfigValue)("web_should_fatal_on_missing_patch"),syncdShouldNotFatalOnSnapshotMacMismatchInPatches:()=>(0,o.getABPropConfigValue)("syncd_do_not_fatal_on_snapshot_mac_mismatch_in_patches"),syncdWaitForKeyTimeoutDays:()=>d.ServerProps.syncdWaitForKeyTimeoutDays,maxPrekeysToUpload:()=>d.ServerProps.maxKeys,forceNonPersistedJobs:()=>!1,ignoreForceNonPersistedJobList:()=>[],orchestratorConfig:()=>"",waitForConnection:()=>!1};t.ConfigImpl=_},870263:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dbCallbacks=void 0;var r=n(310790),i=n(475222),a=n(403509);const o={downloadSyncBlob:a.downloadSyncBlob,getDeviceFingerprint:i.getDeviceFingerprint,handleSyncBeforeApplyPatch:r.handleSyncBeforeApplyPatch,handleSyncCompleted:r.handleSyncCompleted,handleSyncDelayApplyingPatchUntilUIUnblocks:r.handleSyncDelayApplyingPatchUntilUIUnblocks,handleSyncdFatal:r.handleSyncdFatal,sendSyncdKeyRequest:i.sendSyncdKeyRequest,sendSyncdKeyRotation:i.sendSyncdKeyRotation,uploadSyncExternalPatch:a.uploadSyncExternalPatch};t.dbCallbacks=o},697371:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getConfig=function(){return l().config},t.getMyDeviceJid=function(){var e;const t=null===(e=l().myJids)||void 0===e?void 0:e.deviceJid;if(null==t)throw(0,a.default)("Trying to access myDeviceJid, but it's not set");return(0,o.unsafeCoerceToPhoneDeviceJid)(t)},t.setGlobals=function(e){s=e,(0,i.setGlobals)(e)};var i=n(819416),a=r(n(480925)),o=n(616310);let s=null;function l(){if(null==s)throw Error("globals api called before set");return s}},94715:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.runInTransaction=void 0;var i=n(643841),a=n(92991),o=n(605316),s=n(954978),l=n(114703),u=n(350616),c=r(n(986128));const d={SyncActionStore:l.WAWebSyncActionStore,CollectionVersionStore:i.WAWebCollectionVersionStore,PendingMutationStore:s.WAWebPendingMutationStore,MissingKeyStore:a.WAWebMissingKeyStore,SyncKeyStore:u.WAWebSyncKeyStore};t.runInTransaction=(e,t)=>{if(null!=c.default.currentTransaction)return Promise.reject(Error("Calling runInTransaction recursively. This is not allowed."));const n=e.flatMap((e=>d[e].locks));return(0,o.getStorage)().lock(n,(()=>{const n={};for(const t of e)n[t]=new d[t];return t(n)}))}},966944:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.L10n=void 0;var i=r(n(395654)),a=n(256354),o=n(4061),s=r(n(295313)),l=r(n(717429)),u=r(n(99281)),c=r(n(156755)),d=r(n(997331)),p=r(n(730381));const _=new Set(["",""]),f=new Set(["ar","ar-XB","fa","ur","he","dv","ku"]),h=new Set(["fa"]),g="٠١٢٣٤٥٦٧٨٩".split("");function m(e){return g[parseInt(e,10)]}const y=new Error("Unimplemented method");class E extends i.default{constructor(e,t,n){if(super(),!e||!t)throw y;this._locale=e,this.localeStrings={},this.localeStrings[a.DEFAULT_LOCALE]=t,this.fbtStrings={},this.fbtStrings[a.DEFAULT_LOCALE]={en_GB:{}},this.markTranslations=n,this.customizeMoment()}getLocale(){throw y}getFbtTranslations(){throw y}setLocale(){throw y}normalizeLocale(e){const t=e.replace(/-/g,"_").toLowerCase(),n=this._getTranslationFilename(t);if(n)return n;let r=t;for(;r;){r=r.split("_").slice(0,-1).join("_");const e=r&&this._getTranslationFilename(r);if(e)return e}}isLocaleSupported(e){return!!e&&!!this.normalizeLocale(e)}_getTranslationFilename(e){const t=l.default[e]||e;return u.default[t]}isRTL(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getLocale();return f.has(e)}LR(e,t){return this.isRTL()?t:e}embedDir(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.isRTL())?this.embedRTL(e):this.embedLTR(e)}forceDir(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.isRTL())?this.forceRTL(e):this.forceLTR(e)}embedLTR(e){return""+e+""}embedRTL(e){return""+e+""}isolateLTR(e){return""+e+""}isolateRTL(e){return""+e+""}forceLTR(e){return""+e}forceRTL(e){return""+e}t(e,t,n){"number"!=typeof e&&__LOG__(3)`l10n.t was called with an unprocessed id (${e}). If you just added a string on local, restarting your build may address the issue.`;const r=e,i=null!=t?t._plural:null;let o=n||this.getLocale();this.localeStrings[o]||(o=a.DEFAULT_LOCALE);let s=this._getString(r,o,i);this.markTranslations&&(s?o===a.DEFAULT_LOCALE&&(s="["+s+"]"):(s="!!"+r+"!!",__LOG__(2)`l10n:t string key "${r}" not found`)),s||(s=this._getString(r,a.DEFAULT_LOCALE,i)),s||__LOG__(2)`l10n:t string key "${r}" fallback failed`;for(const e in t){if(!t.hasOwnProperty(e)||"_plural"===e)continue;const n=new RegExp("__"+e+"__","g");let r;r="string"==typeof t[e]&&_.has(t[e].slice(0,1))?t[e]:this.n(t[e],o),s=s.replace(n,r)}return s}_getString(e,t,n){const r=this.localeStrings[t]||this.localeStrings[a.DEFAULT_LOCALE];if(null==r)throw new Error(`Couldn't find translations for locale ${t} or default (${a.DEFAULT_LOCALE})`);if(!Array.isArray(r))throw new Error("Unexpected locale format.");const[i,o]=r,l=i[e]||"";if(null==n)return l;const u=s.default[t];if(null==u)return l;const c=u.numbers[u.plurals(n)];if(1===c)return l;return o[2===u.numbers.length&&2===c?e.toString():`${e}_${c}`]||l}useArabicScriptDigits(e){return h.has(e||this.getLocale())}isLatinAlphabetLanguage(e){return d.default.isLatin(this.removeAccents(e))}n(e,t){let n=e;return isNaN(n)||(n=n.toString()),this.useArabicScriptDigits(t)?n.toString().replace(/[0-9]/g,m):n}filesize(e){const t=this,n=e>1073741824?1:0,r=this.getLocale();return this.n((0,c.default)(e,{base:2,round:n,locale:r,symbols:{B:t.t(308),KB:t.t(310),MB:t.t(311),GB:t.t(309),KiB:t.t(310),MiB:t.t(311),GiB:t.t(309)}}))}normalizeForm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,o.normalizeForm)(e)}removeAccents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,o.removeAccents)(e)}accentFold(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.removeAccents(e).toLowerCase()}customizeMoment(){p.default.relativeTimeRounding(Math.floor),p.default.relativeTimeThreshold("s",60),p.default.relativeTimeThreshold("m",60),p.default.relativeTimeThreshold("h",24)}}t.L10n=E},932325:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=(r(n(435161)),n(989211)),o=(r(n(730368)),n(36530)),s=n(962833),l=n(966944),u=n(256354),c=n(4061),d=n(448376),p=r(n(953113)),_=n(755985),f=n(368170),h=n(548360),g=r(n(730381)),m=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(627162));function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}const E=self.location.href;E&&E.includes("/%F0%9F%8C%90/")&&Promise.resolve().then(n.bind(n,79291)).then((e=>{let{default:t}=e;t.canMuckHistory()&&window.history.replaceState({},"","/")}));const S="en-GB",T={LTR:"LTR",RTL:"RTL"},v={LTR:"style",RTL:"style_rtl"},A=u.L10N_PRIORITY;class C extends l.L10n{constructor(){super({l:u.DEFAULT_LOCALE,priority:A.DEFAULT,loc:u.DEFAULT_LOCALE},n(138097).default,m?m.getMarkTranslations():u.MARK_TRANSLATIONS);{if((0,_.isWorker)())return void __LOG__(3)`l10n should not be included in worker!`;const e=function(){const e=document.querySelector("html");return null==e?void 0:e.getAttribute("loc")}(),t={};this._considerLocale(t,e,A.PREVIOUS)&&this.downloadAndSetTranslation(t)}}getLocale(){return this._locale.l}getFbtTranslations(){return this.fbtStrings[this._locale.l]}getFullLocale(){return this._locale.loc.replace("_","-")}_getFBTLocale(){return(0,d.normalizeLocaleToFBTLocale)(this.getLocale())}getLanguage(){return(0,c.getLanguageCodeFromLocale)(this.getFullLocale())}getRegion(){return(0,c.getRegionCodeFromLocale)(this.getFullLocale())}normalizeForm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(!f.UA.isTrident)return e.normalize("NFKD");try{return e.normalize("NFKD")}catch(t){return e}}setLocale(e,t){var n=this;return(0,i.default)((function*(){const r={l:n._locale.l,priority:n._locale.priority,loc:n._locale.l};return n._considerLocale(r,e,t)?n.downloadAndSetTranslation(r):Promise.resolve()}))()}isLocaleSupported(e){try{return super.isLocaleSupported(e)&&(!self.Intl||Array.isArray(self.Intl.Collator.supportedLocalesOf(e)))}catch(e){return!1}}init(e){var t;this._initFbt();const n={l:u.DEFAULT_LOCALE,priority:A.DEFAULT,loc:u.DEFAULT_LOCALE};if(this._considerLocale(n,e,A.PREVIOUS),this._considerLocale(n,function(){let e=(E||self.location.href||"").split("/%F0%9F%8C%90/");return e.length>1?e[1].split("/")[0]:void 0}(),A.URL),this._considerLocale(n,navigator.language,A.BROWSER),null===(t=navigator.languages)||void 0===t?void 0:t.length)for(let e=0;e<navigator.languages.length&&!this._considerLocale(n,navigator.languages[e],A.BROWSER);e++);return this.downloadAndSetTranslation(n)}_initFbt(){const e=this.markTranslations?e=>this.getLocale()===u.DEFAULT_LOCALE?new h.FbtResult(["{",...e.contents,"}"]):new h.FbtResult(e.contents):void 0;(0,h.init)({translations:this.getFbtTranslations(),hooks:{getViewerContext:()=>({locale:this._getFBTLocale()}),getFbsResult:e,getFbtResult:e,getNumberFormatConfigOverride:()=>"ar"===this.getLocale()?{decimalSeparator:".",numberDelimiter:",",minDigitsForThousandsSeparator:4,standardDecimalPatternInfo:{primaryGroupSize:3,secondaryGroupSize:3},numberingSystemData:null}:null}})}_considerLocale(e,t,n){if(null!=e.priority&&n<e.priority)return;if(null==t||t===this.getLocale())return;const r=this.normalizeLocale(t);return r?(e.l=r,e.priority=n,e.loc=t,e):void 0}downloadAppLocale(e){return this.localeStrings[e]?Promise.resolve(this.localeStrings[e]):(0,s.promiseLoop)(function(){var t=(0,i.default)((function*(t,r,i){const s=(0,o.delayMs)((0,a.expBackoff)(i,12e4,1e3,.1)),l=yield n(826299)(`./${e}`);try{const[e]=yield l.default();return t(e)}catch(t){return 10===i&&(__LOG__(4,void 0,new Error,!0)`${i} times, locale is ${e}`,SEND_LOGS("downadAppLocale failure")),s}}));return function(){return t.apply(this,arguments)}}())}downloadFbtLocaleAndSetCache(e){var t=this;return this.fbtStrings[e]?Promise.resolve(this.fbtStrings[e]):(0,s.promiseLoop)(function(){var r=(0,i.default)((function*(r,i,s){const l=(0,o.delayMs)((0,a.expBackoff)(s,12e4,1e3,.1)),u=yield n(826299)(`./${e}`);try{const[,n]=yield u.default();return t.fbtStrings[e]=n,r(n)}catch(t){return 10===s&&(__LOG__(4,void 0,new Error,!0)`${s} times, locale is ${e}`,SEND_LOGS("downadAppLocale failure")),l}}));return function(){return r.apply(this,arguments)}}())}_downloadMomentResourceFile(e){return(0,i.default)((function*(){try{return(yield n(519922)(`./${e}`)).default}catch(t){__LOG__(2)`l10n:_downloadMomentResourceFile failed to download resource ${e}`}}))()}downloadMomentLocale(e){var t=this;const{l:n,loc:r}=e;return g.default.locale()===r?Promise.resolve():(0,s.promiseLoop)(function(){var e=(0,i.default)((function*(e,i,s){const l=(0,o.delayMs)((0,a.expBackoff)(s,12e4,1e3,.1)),c=r.replace(/_/g,"-");let d,_;if(c===u.DEFAULT_MOMENT_LOCALE)d=()=>Promise.resolve(),_=u.DEFAULT_MOMENT_LOCALE;else{const e=[];if(e.push(c),n===u.DEFAULT_LOCALE)e.push(S);else{const t=n.replace(/_/g,"-");e.push(t),null!=p.default[t]&&e.push(p.default[t])}e.push(S);for(let n=0;n<e.length;++n)if(d=yield t._downloadMomentResourceFile(e[n]),null!=d){_=e[n];break}null==d&&(__LOG__(3)`Could not fetch moment locales, using default en-US`,d=()=>Promise.resolve(),_=u.DEFAULT_MOMENT_LOCALE)}try{return yield d(),e(_)}catch(e){return 10===s&&(__LOG__(4,void 0,new Error,!0)`${s} times, locale is (${n}, ${r})`,SEND_LOGS("downloadMomentLocale failure")),l}}));return function(){return e.apply(this,arguments)}}())}updateFbtContext(e){null!=e&&h.FbtTranslations.registerTranslations(e)}downloadAndSetTranslation(e){const{l:t,loc:r}=this._locale,{l:i,loc:a}=e,o=this.isRTL(i),s=o?T.RTL:T.LTR;if(document.getElementById(v[s])&&a===r)return Promise.resolve();const l=self.performance.now();let c,d;return this._fetchPromise=Promise.all([this.downloadAppLocale(i),this.downloadFbtLocaleAndSetCache(i),this.downloadMomentLocale(e)]).then((t=>{let[n,r,o]=t;c=self.performance.now(),this.localeStrings[i]=n,this._locale=e,this.trigger("set_collator",i),o&&(g.default.locale(o),__LOG__(2)`l10n:moment locale updated to: ${o}`),this.customizeMomentLocale(g.default.locale()),document.documentElement&&document.documentElement.setAttribute("lang",e.l),document.documentElement&&document.documentElement.setAttribute("dir",s),this.updateFbtContext(r),this.trigger("locale_change",{l:i,loc:a})})).then((()=>{d=self.performance.now(),__LOG__(2)`l10n:locale updated: (${t}, ${r}) > (${i}, ${a}), Fetch: ${c-l}ms, Apply: ${d-c}ms`;if(n(478885).default.supported){var e;const t=n(537152).default,r=n(647349).default;(null===(e=navigator.serviceWorker)||void 0===e?void 0:e.controller)&&t.request(navigator.serviceWorker.controller,r.SET_L10N,{isRTL:o,locale:i}).catch((()=>{}))}})).catch((()=>(__LOG__(2)`l10n:locale update error: (${t}, ${r}) > (${i}, ${a})`,this.downloadAndSetTranslation({l:u.DEFAULT_LOCALE,priority:A.DEFAULT,loc:u.DEFAULT_LOCALE}))))}_updateSpellChecker(){}_updateElectronMain(){}customizeMomentLocale(e){const t=u.LOCALE_CUSTOMIZATIONS[e];t&&g.default.locale(e,t)}}C.Dir=T;var P=new C;t.default=P},256354:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.SHOULD_USE_MOMENT_LOCALE_FORMAT=t.MARK_TRANSLATIONS=t.LOCALE_DATE_TIME_CUSTOMIZATIONS=t.LOCALE_CUSTOMIZATIONS=t.LOCALES_THAT_PREFER_24HOUR_TIME=t.L10N_PRIORITY=t.DEFAULT_MOMENT_LOCALE=t.DEFAULT_LOCALE=void 0;var i=r(n(81109));t.L10N_PRIORITY={SAVED:6,PHONE:5,PREVIOUS:4,URL:3,BROWSER:2,DEFAULT:1};t.DEFAULT_LOCALE="en";t.DEFAULT_MOMENT_LOCALE="en-US";const a=new Set(["ur"]);t.SHOULD_USE_MOMENT_LOCALE_FORMAT=a;const o=new Set(["af","az","ca","cs","da","de","el","et","fi","fr","he","hr","hu","id","it","kk","lt","mk","nb","pl","pt","pt-BR","ro","ru","sk","sl","sr","sv","th","tr","uk"]);t.LOCALES_THAT_PREFER_24HOUR_TIME=o;const s={"zh-tw":{longDateFormat:{LT:"Ah:mm",LTS:"Ah:m:s",L:"YYYY年MMMD日",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日LT",LLLL:"YYYY年MMMD日ddddLT",l:"YYYY年MMMD日",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日LT",llll:"YYYY年MMMD日ddddLT"}},"zh-cn":{longDateFormat:{LT:"Ah:mm",LTS:"Ah:m:s",L:"YYYY-MM-DD",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日LT",LLLL:"YYYY年MMMD日ddddLT",l:"YYYY年MMMD日",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日LT",llll:"YYYY年MMMD日ddddLT"}},ar:{longDateFormat:{LT:"h:mm A",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"}},ta:{longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY, h:mm A"},preparse:null,postformat:null,meridiem:null,meridiemHour:null},nl:{longDateFormat:{l:"DD-MM-YYYY",L:"DD-MM-YYYY"}},"en-ie":{longDateFormat:{l:"DD/MM/YYYY",L:"DD/MM/YYYY"}},hi:{preparse:null,postformat:null,longDateFormat:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",LLL:"D MMMM YYYY A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},meridiem:(e,t)=>0===e&&0===t?"मध्यरात्रि":e>=20||e<4?"रात":e>=4&&e<12?"सुबह":e>=12&&e<16?"दोपहर":"शाम"}};t.LOCALE_DATE_TIME_CUSTOMIZATIONS=s;const l=(0,i.default)((0,i.default)({},s),{"pt-pt":{weekdays:["Domingo","Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado"]}});t.LOCALE_CUSTOMIZATIONS=l;t.MARK_TRANSLATIONS=!1},486392:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCountryShortcodeByPhone=function(e){if(null==e||0===e.length)return"";const t=function(e,t){if(null!=e&&e.length>0&&null!=t){let n=t[e[0]],r=e;for(;r.length>0&&n;){if(n.c)return n.c;r=r.substr(1,r.length-1),n=n[r[0]]}}return""}(e,n);return""===t&&"1"===e[0]?"US":"RU"===t&&["6","7"].includes(e[1])?"KZ":t};const n={1:{2:{0:{4:{c:"CA"}},2:{6:{c:"CA"}},3:{6:{c:"CA"}},4:{2:{c:"BS"},9:{c:"CA"}},5:{0:{c:"CA"}},6:{4:{c:"AI"},8:{c:"AG"}},8:{4:{c:"VG"},9:{c:"CA"}}},3:{0:{6:{c:"CA"}},4:{0:{c:"VI"},3:{c:"CA"},5:{c:"KY"}},6:{5:{c:"CA"},7:{c:"CA"}}},4:{0:{3:{c:"CA"}},1:{6:{c:"CA"},8:{c:"CA"}},3:{1:{c:"CA"},7:{c:"CA"},8:{c:"CA"}},4:{1:{c:"BM"}},5:{0:{c:"CA"}},7:{3:{c:"GD"}}},5:{0:{6:{c:"CA"}},1:{4:{c:"CA"},9:{c:"CA"}},4:{8:{c:"CA"}},7:{9:{c:"CA"}},8:{1:{c:"CA"},7:{c:"CA"}}},6:{0:{4:{c:"CA"}},1:{3:{c:"CA"}},3:{9:{c:"CA"}},4:{7:{c:"CA"},9:{c:"TC"}},5:{8:{c:"JM"}},6:{4:{c:"MS"}},7:{0:{c:"MP"},1:{c:"GU"},2:{c:"CA"}},8:{4:{c:"AS"}}},7:{0:{5:{c:"CA"},9:{c:"CA"}},2:{1:{c:"MF"}},5:{8:{c:"LC"}},6:{7:{c:"DM"}},7:{8:{c:"CA"}},8:{0:{c:"CA"},2:{c:"CA"},4:{c:"VC"},7:{c:"PR"}}},8:{0:{7:{c:"CA"},9:{c:"DO"}},1:{9:{c:"CA"}},2:{5:{c:"CA"},9:{c:"DO"}},4:{9:{c:"DO"}},6:{7:{c:"CA"},8:{c:"TT"},9:{c:"KN"}},7:{3:{c:"CA"},6:{c:"JM"}}},9:{0:{2:{c:"CA"},5:{c:"CA"}},3:{9:{c:"PR"}}}},2:{0:{c:"EG"},1:{1:{c:"SS"},2:{c:"MA"},3:{c:"DZ"},6:{c:"TN"},8:{c:"LY"}},2:{0:{c:"GM"},1:{c:"SN"},2:{c:"MR"},3:{c:"ML"},4:{c:"GN"},5:{c:"CI"},6:{c:"BF"},7:{c:"NE"},8:{c:"TG"},9:{c:"BJ"}},3:{0:{c:"MU"},1:{c:"LR"},2:{c:"SL"},3:{c:"GH"},4:{c:"NG"},5:{c:"TD"},6:{c:"CF"},7:{c:"CM"},8:{c:"CV"},9:{c:"ST"}},4:{0:{c:"GQ"},1:{c:"GA"},2:{c:"CG"},3:{c:"CD"},4:{c:"AO"},5:{c:"GW"},6:{c:"IO"},7:{c:"AC"},8:{c:"SC"},9:{c:"SD"}},5:{0:{c:"RW"},1:{c:"ET"},2:{c:"SO"},3:{c:"DJ"},4:{c:"KE"},5:{c:"TZ"},6:{c:"UG"},7:{c:"BI"},8:{c:"MZ"}},6:{0:{c:"ZM"},1:{c:"MG"},2:{c:"RE"},3:{c:"ZW"},4:{c:"NA"},5:{c:"MW"},6:{c:"LS"},7:{c:"BW"},8:{c:"SZ"},9:{c:"KM"}},7:{c:"ZA"},9:{0:{c:"SH"},1:{c:"ER"},7:{c:"AW"},8:{c:"FO"},9:{c:"GL"}}},3:{0:{c:"GR"},1:{c:"NL"},2:{c:"BE"},3:{c:"FR"},4:{c:"ES"},5:{0:{c:"GI"},1:{c:"PT"},2:{c:"LU"},3:{c:"IE"},4:{c:"IS"},5:{c:"AL"},6:{c:"MT"},7:{c:"CY"},8:{c:"FI"},9:{c:"BG"}},6:{c:"HU"},7:{0:{c:"LT"},1:{c:"LV"},2:{c:"EE"},3:{c:"MD"},4:{c:"AM"},5:{c:"BY"},6:{c:"AD"},7:{c:"MC"},8:{c:"SM"}},8:{0:{c:"UA"},1:{c:"RS"},2:{c:"ME"},3:{c:"XK"},5:{c:"HR"},6:{c:"SI"},7:{c:"BA"},9:{c:"MK"}},9:{c:"IT"}},4:{0:{c:"RO"},1:{c:"CH"},2:{0:{c:"CZ"},1:{c:"SK"},3:{c:"LI"}},3:{c:"AT"},4:{c:"GB"},5:{c:"DK"},6:{c:"SE"},7:{c:"NO"},8:{c:"PL"},9:{c:"DE"}},5:{0:{0:{c:"FK"},1:{c:"BZ"},2:{c:"GT"},3:{c:"SV"},4:{c:"HN"},5:{c:"NI"},6:{c:"CR"},7:{c:"PA"},8:{c:"PM"},9:{c:"HT"}},1:{c:"PE"},2:{c:"MX"},3:{c:"CU"},4:{c:"AR"},5:{c:"BR"},6:{c:"CL"},7:{c:"CO"},8:{c:"VE"},9:{0:{c:"GP"},1:{c:"BO"},2:{c:"GY"},3:{c:"EC"},4:{c:"GF"},5:{c:"PY"},6:{c:"MQ"},7:{c:"SR"},8:{c:"UY"},9:{c:"CW"}}},6:{0:{c:"MY"},1:{c:"AU"},2:{c:"ID"},3:{c:"PH"},4:{c:"NZ"},5:{c:"SG"},6:{c:"TH"},7:{0:{c:"TL"},2:{c:"NF"},3:{c:"BN"},4:{c:"NR"},5:{c:"PG"},6:{c:"TO"},7:{c:"SB"},8:{c:"VU"},9:{c:"FJ"}},8:{0:{c:"PW"},1:{c:"WF"},2:{c:"CK"},3:{c:"NU"},5:{c:"WS"},6:{c:"KI"},7:{c:"NC"},8:{c:"TV"},9:{c:"PF"}},9:{0:{c:"TK"},1:{c:"FM"},2:{c:"MH"}}},7:{c:"RU"},8:{1:{c:"JP"},2:{c:"KR"},4:{c:"VN"},5:{0:{c:"KP"},2:{c:"HK"},3:{c:"MO"},5:{c:"KH"},6:{c:"LA"}},6:{c:"CN"},8:{0:{c:"BD"},6:{c:"TW"}}},9:{0:{c:"TR"},1:{c:"IN"},2:{c:"PK"},3:{c:"AF"},4:{c:"LK"},5:{c:"MM"},6:{0:{c:"MV"},1:{c:"LB"},2:{c:"JO"},3:{c:"SY"},4:{c:"IQ"},5:{c:"KW"},6:{c:"SA"},7:{c:"YE"},8:{c:"OM"}},7:{0:{c:"PS"},1:{c:"AE"},2:{c:"IL"},3:{c:"BH"},4:{c:"QA"},5:{c:"BT"},6:{c:"MN"},7:{c:"NP"}},8:{c:"IR"},9:{2:{c:"TJ"},3:{c:"TM"},4:{c:"AZ"},5:{c:"GE"},6:{c:"KG"},8:{c:"UZ"}}}}},317259:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isStringOrFbt=function(e){return(0,r.isString)(e)||i.fbt.isFbtInstance(e)},t.toProductionString=function(e){return e.toString()};var r=n(425315),i=n(548360)},4061:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getLanguageCodeFromLocale=function(e){return e.replace(/_/g,"-").split("-")[0].toLowerCase()},t.getRegionCodeFromLocale=function(e){const t=e.replace(/_/g,"-").split("-");if(t.length<=1)return null;return t[t.length-1].toUpperCase()},t.normalizeForm=a,t.removeAccents=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,i.default)(a(e).replace(/(?:[\^`\xA8\xAF\xB4\xB7\xB8\u02B0-\u034E\u0350-\u0357\u035D-\u0362\u0374\u0375\u037A\u0384\u0385\u0483-\u0487\u0559\u0591-\u05A1\u05A3-\u05BD\u05BF\u05C1\u05C2\u05C4\u064B-\u0652\u0657\u0658\u06DF\u06E0\u06E5\u06E6\u06EA-\u06EC\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F5\u0818\u0819\u08E3-\u08FE\u093C\u094D\u0951-\u0954\u0971\u09BC\u09CD\u0A3C\u0A4D\u0ABC\u0ACD\u0AFD-\u0AFF\u0B3C\u0B4D\u0B55\u0BCD\u0C4D\u0CBC\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E47-\u0E4C\u0E4E\u0EBA\u0EC8-\u0ECC\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F82-\u0F84\u0F86\u0F87\u0FC6\u1037\u1039\u103A\u1063\u1064\u1069-\u106D\u1087-\u108D\u108F\u109A\u109B\u135D-\u135F\u17C9-\u17D3\u17DD\u1939-\u193B\u1A75-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B34\u1B44\u1B6B-\u1B73\u1BAA\u1BAB\u1C36\u1C37\u1C78-\u1C7D\u1CD0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1D2C-\u1D6A\u1DC4-\u1DCF\u1DF5-\u1DF9\u1DFD-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2CEF-\u2CF1\u2E2F\u302A-\u302F\u3099-\u309C\u30FC\uA66F\uA67C\uA67D\uA67F\uA69C\uA69D\uA6F0\uA6F1\uA700-\uA721\uA788-\uA78A\uA7F8\uA7F9\uA8C4\uA8E0-\uA8F1\uA92B-\uA92E\uA953\uA9B3\uA9C0\uA9E5\uAA7B-\uAA7D\uAABF-\uAAC2\uAAF6\uAB5B-\uAB5F\uAB69-\uAB6B\uABEC\uABED\uFB1E\uFE20-\uFE2F\uFF3E\uFF40\uFF70\uFF9E\uFF9F\uFFE3]|\uD800\uDEE0|\uD802[\uDEE5\uDEE6]|\uD803[\uDD22-\uDD27\uDF46-\uDF50]|\uD804[\uDCB9\uDCBA\uDD33\uDD34\uDD73\uDDC0\uDDCA-\uDDCC\uDE35\uDE36\uDEE9\uDEEA\uDF3C\uDF4D\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC42\uDC46\uDCC2\uDCC3\uDDBF\uDDC0\uDE3F\uDEB6\uDEB7\uDF2B]|\uD806[\uDC39\uDC3A\uDD3D\uDD3E\uDD43\uDDE0\uDE34\uDE47\uDE99]|\uD807[\uDC3F\uDD42\uDD44\uDD45\uDD97]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF9F\uDFF0\uDFF1]|\uD834[\uDD67-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uD838[\uDD30-\uDD36\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD46\uDD48-\uDD4A])/g,""))};var i=r(n(997331));function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.normalize("NFKD")}},448376:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeLocaleToFBTLocale=function(e){const t=n[e];if(null!=t)return t;return e};const n={af:"af_ZA",ar:"ar_AR",az:"az_AZ",bg:"bg_BG",bn:"bn_IN",ca:"ca_ES",cs:"cs_CZ",da:"da_DK",de:"de_DE",el:"el_GR",en:"en_GB",es:"es_MX",et:"et_EE",fa:"fa_IR",fi:"fi_FI",fil:"tl_PH",fr:"fr_FR",gu:"gu_IN",he:"he_IL",hi:"hi_IN",hr:"hr_HR",hu:"hu_HU",id:"id_ID",it:"it_IT",ja:"ja_JP",kk:"kk_KZ",kn:"kn_IN",ko:"ko_KR",lt:"lt_LT",lv:"lv_LV",mk:"mk_MK",ml:"ml_IN",mr:"mr_IN",ms:"ms_MY",nb:"nb_NO",nl:"nl_NL",pa:"pa_IN",pl:"pl_PL",pt:"pt_PT","pt-BR":"pt_BR",ro:"ro_RO",ru:"ru_RU",sk:"sk_SK",sl:"sl_SI",sq:"sq_AL",sr:"sr_RS",sv:"sv_SE",sw:"sw_KE",ta:"ta_IN",te:"te_IN",th:"th_TH",tr:"tr_TR",uk:"uk_UA",ur:"ur_PK",uz:"uz_UZ",vi:"vi_VN","zh-CN":"zh_CN","zh-HK":"zh_HK","zh-TW":"zh_TW"}},295313:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={ach:{name:"Acholi",numbers:[1,2],plurals:e=>Number(e>1)},af:{name:"Afrikaans",numbers:[1,2],plurals:e=>Number(1!=e)},ak:{name:"Akan",numbers:[1,2],plurals:e=>Number(e>1)},am:{name:"Amharic",numbers:[1,2],plurals:e=>Number(e>1)},an:{name:"Aragonese",numbers:[1,2],plurals:e=>Number(1!=e)},ar:{name:"Arabic",numbers:[0,1,2,3,11,100],plurals:e=>Number(0===e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},arn:{name:"Mapudungun",numbers:[1,2],plurals:e=>Number(e>1)},ast:{name:"Asturian",numbers:[1,2],plurals:e=>Number(1!=e)},ay:{name:"Aymará",numbers:[1],plurals:()=>0},az:{name:"Azerbaijani",numbers:[1,2],plurals:e=>Number(1!=e)},be:{name:"Belarusian",numbers:[1,2,5],plurals:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},bg:{name:"Bulgarian",numbers:[1,2],plurals:e=>Number(1!=e)},bn:{name:"Bengali",numbers:[1,2],plurals:e=>Number(1!=e)},bo:{name:"Tibetan",numbers:[1],plurals:()=>0},br:{name:"Breton",numbers:[1,2],plurals:e=>Number(e>1)},bs:{name:"Bosnian",numbers:[1,2,5],plurals:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},ca:{name:"Catalan",numbers:[1,2],plurals:e=>Number(1!=e)},cgg:{name:"Chiga",numbers:[1],plurals:()=>0},cs:{name:"Czech",numbers:[1,2,5],plurals:e=>Number(1==e?0:e>=2&&e<=4?1:2)},csb:{name:"Kashubian",numbers:[1,2,5],plurals:e=>Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},cy:{name:"Welsh",numbers:[1,2,3,8],plurals:e=>Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},da:{name:"Danish",numbers:[1,2],plurals:e=>Number(1!=e)},de:{name:"German",numbers:[1,2],plurals:e=>Number(1!=e)},dz:{name:"Dzongkha",numbers:[1],plurals:()=>0},el:{name:"Greek",numbers:[1,2],plurals:e=>Number(1!=e)},en:{name:"English",numbers:[1,2],plurals:e=>Number(1!=e)},eo:{name:"Esperanto",numbers:[1,2],plurals:e=>Number(1!=e)},es:{name:"Spanish",numbers:[1,2],plurals:e=>Number(1!=e)},es_ar:{name:"Argentinean Spanish",numbers:[1,2],plurals:e=>Number(1!=e)},et:{name:"Estonian",numbers:[1,2],plurals:e=>Number(1!=e)},eu:{name:"Basque",numbers:[1,2],plurals:e=>Number(1!=e)},fa:{name:"Persian",numbers:[1,2],plurals:e=>Number(e>1)},fi:{name:"Finnish",numbers:[1,2],plurals:e=>Number(1!=e)},fil:{name:"Filipino",numbers:[1,2],plurals:e=>Number(e>1)},fo:{name:"Faroese",numbers:[1,2],plurals:e=>Number(1!=e)},fr:{name:"French",numbers:[1,2],plurals:e=>Number(e>1)},fur:{name:"Friulian",numbers:[1,2],plurals:e=>Number(1!=e)},fy:{name:"Frisian",numbers:[1,2],plurals:e=>Number(1!=e)},ga:{name:"Irish",numbers:[1,2,3,7,11],plurals:e=>Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},gd:{name:"Scottish Gaelic",numbers:[1,2,3,20],plurals:e=>Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},gl:{name:"Galician",numbers:[1,2],plurals:e=>Number(1!=e)},gu:{name:"Gujarati",numbers:[1,2],plurals:e=>Number(1!=e)},gun:{name:"Gun",numbers:[1,2],plurals:e=>Number(e>1)},ha:{name:"Hausa",numbers:[1,2],plurals:e=>Number(1!=e)},he:{name:"Hebrew",numbers:[1,2,20,3],plurals:e=>Number(1===e?0:2===e?1:e>=20&&e%10==0?2:3)},hi:{name:"Hindi",numbers:[1,2],plurals:e=>Number(1!=e)},hr:{name:"Croatian",numbers:[1,2,5],plurals:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},hu:{name:"Hungarian",numbers:[1,2],plurals:e=>Number(1!=e)},hy:{name:"Armenian",numbers:[1,2],plurals:e=>Number(1!=e)},ia:{name:"Interlingua",numbers:[1,2],plurals:e=>Number(1!=e)},id:{name:"Indonesian",numbers:[1],plurals:()=>0},is:{name:"Icelandic",numbers:[1,2],plurals:e=>Number(e%10!=1||e%100==11)},it:{name:"Italian",numbers:[1,2],plurals:e=>Number(1!=e)},ja:{name:"Japanese",numbers:[1],plurals:()=>0},jbo:{name:"Lojban",numbers:[1],plurals:()=>0},jv:{name:"Javanese",numbers:[0,1],plurals:e=>Number(0!==e)},ka:{name:"Georgian",numbers:[1],plurals:()=>0},kk:{name:"Kazakh",numbers:[1],plurals:()=>0},km:{name:"Khmer",numbers:[1],plurals:()=>0},kn:{name:"Kannada",numbers:[1,2],plurals:e=>Number(1!=e)},ko:{name:"Korean",numbers:[1],plurals:()=>0},ku:{name:"Kurdish",numbers:[1,2],plurals:e=>Number(1!=e)},kw:{name:"Cornish",numbers:[1,2,3,4],plurals:e=>Number(1==e?0:2==e?1:3==e?2:3)},ky:{name:"Kyrgyz",numbers:[1],plurals:()=>0},lb:{name:"Letzeburgesch",numbers:[1,2],plurals:e=>Number(1!=e)},ln:{name:"Lingala",numbers:[1,2],plurals:e=>Number(e>1)},lo:{name:"Lao",numbers:[1],plurals:()=>0},lt:{name:"Lithuanian",numbers:[1,2,10],plurals:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},lv:{name:"Latvian",numbers:[0,1,2],plurals:e=>Number(e%10==1&&e%100!=11?0:0!==e?1:2)},mai:{name:"Maithili",numbers:[1,2],plurals:e=>Number(1!=e)},mfe:{name:"Mauritian Creole",numbers:[1,2],plurals:e=>Number(e>1)},mg:{name:"Malagasy",numbers:[1,2],plurals:e=>Number(e>1)},mi:{name:"Maori",numbers:[1,2],plurals:e=>Number(e>1)},mk:{name:"Macedonian",numbers:[1,2],plurals:e=>Number(1==e||e%10==1?0:1)},ml:{name:"Malayalam",numbers:[1,2],plurals:e=>Number(1!=e)},mn:{name:"Mongolian",numbers:[1,2],plurals:e=>Number(1!=e)},mnk:{name:"Mandinka",numbers:[0,1,2],plurals:e=>Number(0===e?0:1==e?1:2)},mr:{name:"Marathi",numbers:[1,2],plurals:e=>Number(1!=e)},ms:{name:"Malay",numbers:[1],plurals:()=>0},mt:{name:"Maltese",numbers:[1,2,11,20],plurals:e=>Number(1==e?0:0===e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},nah:{name:"Nahuatl",numbers:[1,2],plurals:e=>Number(1!=e)},nap:{name:"Neapolitan",numbers:[1,2],plurals:e=>Number(1!=e)},nb:{name:"Norwegian Bokmal",numbers:[1,2],plurals:e=>Number(1!=e)},ne:{name:"Nepali",numbers:[1,2],plurals:e=>Number(1!=e)},nl:{name:"Dutch",numbers:[1,2],plurals:e=>Number(1!=e)},nn:{name:"Norwegian Nynorsk",numbers:[1,2],plurals:e=>Number(1!=e)},no:{name:"Norwegian",numbers:[1,2],plurals:e=>Number(1!=e)},nso:{name:"Northern Sotho",numbers:[1,2],plurals:e=>Number(1!=e)},oc:{name:"Occitan",numbers:[1,2],plurals:e=>Number(e>1)},or:{name:"Oriya",numbers:[2,1],plurals:e=>Number(1!=e)},pa:{name:"Punjabi",numbers:[1,2],plurals:e=>Number(1!=e)},pap:{name:"Papiamento",numbers:[1,2],plurals:e=>Number(1!=e)},pl:{name:"Polish",numbers:[1,2,5],plurals:e=>Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},pms:{name:"Piemontese",numbers:[1,2],plurals:e=>Number(1!=e)},ps:{name:"Pashto",numbers:[1,2],plurals:e=>Number(1!=e)},pt:{name:"Portuguese",numbers:[1,2],plurals:e=>Number(1!=e)},"pt-BR":{name:"Brazilian Portuguese",numbers:[1,2],plurals:e=>Number(1!=e)},rm:{name:"Romansh",numbers:[1,2],plurals:e=>Number(1!=e)},ro:{name:"Romanian",numbers:[1,2,20],plurals:e=>Number(1==e?0:0===e||e%100>0&&e%100<20?1:2)},ru:{name:"Russian",numbers:[1,2,5],plurals:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},sah:{name:"Yakut",numbers:[1],plurals:()=>0},sco:{name:"Scots",numbers:[1,2],plurals:e=>Number(1!=e)},se:{name:"Northern Sami",numbers:[1,2],plurals:e=>Number(1!=e)},si:{name:"Sinhala",numbers:[1,2],plurals:e=>Number(1!=e)},sk:{name:"Slovak",numbers:[1,2,5],plurals:e=>Number(1==e?0:e>=2&&e<=4?1:2)},sl:{name:"Slovenian",numbers:[5,1,2,3],plurals:e=>Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},so:{name:"Somali",numbers:[1,2],plurals:e=>Number(1!=e)},son:{name:"Songhay",numbers:[1,2],plurals:e=>Number(1!=e)},sq:{name:"Albanian",numbers:[1,2],plurals:e=>Number(1!=e)},sr:{name:"Serbian",numbers:[1,2,5],plurals:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},su:{name:"Sundanese",numbers:[1],plurals:()=>0},sv:{name:"Swedish",numbers:[1,2],plurals:e=>Number(1!=e)},sw:{name:"Swahili",numbers:[1,2],plurals:e=>Number(1!=e)},ta:{name:"Tamil",numbers:[1,2],plurals:e=>Number(1!=e)},te:{name:"Telugu",numbers:[1,2],plurals:e=>Number(1!=e)},tg:{name:"Tajik",numbers:[1,2],plurals:e=>Number(e>1)},th:{name:"Thai",numbers:[1],plurals:()=>0},ti:{name:"Tigrinya",numbers:[1,2],plurals:e=>Number(e>1)},tk:{name:"Turkmen",numbers:[1,2],plurals:e=>Number(1!=e)},tr:{name:"Turkish",numbers:[1,2],plurals:e=>Number(e>1)},tt:{name:"Tatar",numbers:[1],plurals:()=>0},ug:{name:"Uyghur",numbers:[1],plurals:()=>0},uk:{name:"Ukrainian",numbers:[1,2,5],plurals:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},ur:{name:"Urdu",numbers:[1,2],plurals:e=>Number(1!=e)},uz:{name:"Uzbek",numbers:[1,2],plurals:e=>Number(e>1)},vi:{name:"Vietnamese",numbers:[1],plurals:()=>0},wa:{name:"Walloon",numbers:[1,2],plurals:e=>Number(e>1)},wo:{name:"Wolof",numbers:[1],plurals:()=>0},yo:{name:"Yoruba",numbers:[1,2],plurals:e=>Number(1!=e)},zh:{name:"Chinese",numbers:[1],plurals:()=>0}};t.default=n},99281:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={af:"af",ar:"ar",ar_xb:"ar-XB",az:"az",bg:"bg",bn:"bn",ca:"ca",cs:"cs",da:"da",de:"de",el:"el",en:"en",es:"es",et:"et",fa:"fa",fi:"fi",fil:"fil",fr:"fr",gu:"gu",he:"he",hi:"hi",hr:"hr",hu:"hu",id:"id",it:"it",ja:"ja",kk:"kk",kn:"kn",ko:"ko",lt:"lt",lv:"lv",mk:"mk",ml:"ml",mr:"mr",ms:"ms",nb:"nb",nl:"nl",pa:"pa",pl:"pl",pt:"pt",pt_br:"pt-BR",ro:"ro",ru:"ru",sk:"sk",sl:"sl",sq:"sq",sr:"sr",sv:"sv",sw:"sw",ta:"ta",te:"te",th:"th",tr:"tr",uk:"uk",ur:"ur",uz:"uz",vi:"vi",zh_cn:"zh-CN",zh_hk:"zh-HK",zh_tw:"zh-TW"};t.default=n},537469:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.SyntheticCountryCode=void 0,t.bubbleCountryOnListOfCountries=p,t.formatCountriesOfOrigin=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=d(e,!0);if(""===t)return n;return p(n,t)},t.getCountries=function(){return _.apply(this,arguments)},t.getCountryName=function(){return u.apply(this,arguments)},t.unshiftNotApplicableToListOfCountries=d;var i=r(n(348926)),a=r(n(932325)),o=n(256354),s=n(548360);r(n(156720));const l={countrySeparator:{borderBottom:"bajl15op"}};function u(){return(u=(0,i.default)((function*(e){if(!e)return;return(yield f(a.default.getLocale()))[e.toUpperCase()]}))).apply(this,arguments)}const c=n(76672)({NotApplicable:"NOT_APPLICABLE"});function d(e,t){const n=[...e];return n.unshift([String(c.NotApplicable),s.fbt._("Not Applicable",null,{hk:"2k1klN"}),s.fbt._("Item is a service or non-physical good",null,{hk:"3uDBY7"}),...!0===t?[l.countrySeparator]:[]]),n}function p(e,t,n){const r=e.findIndex((e=>{let[n]=e;return n===t})),[i,a]=[...e[r]],o=[...e];return o.splice(r,1),o.unshift([i,a,null,...n?[l.countrySeparator]:[]]),o}function _(){return(_=(0,i.default)((function*(){const e=yield f(a.default.getLocale());return Object.keys(e).filter((e=>!e.includes("@"))).map((t=>[t,e[t]])).sort(((e,t)=>{let[,n]=e,[,r]=t;return String(n).localeCompare(String(r))}))}))).apply(this,arguments)}function f(){return h.apply(this,arguments)}function h(){return(h=(0,i.default)((function*(e){const t=(yield n.e(5211).then(n.t.bind(n,401820,19))).default.includes(e)?e:o.DEFAULT_LOCALE;return(yield n(329127)(`./${t}.json`)).default}))).apply(this,arguments)}t.SyntheticCountryCode=c},953113:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={"zh-HK":"zh-TW",pa:"pa-IN"};t.default=n},717429:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={pt:"pt_br",pt_ao:"pt",pt_ch:"pt",pt_cv:"pt",pt_fr:"pt",pt_gq:"pt",pt_gw:"pt",pt_lu:"pt",pt_mo:"pt",pt_mz:"pt",pt_pt:"pt",pt_st:"pt",pt_tl:"pt",zh_hans:"zh_cn",zh_hant:"zh_tw",zh_sg:"zh_cn",tl:"fil",in:"id",iw:"he",mo:"ro",jw:"jv",ji:"yi"};t.default=n},644234:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0});var i={MediaPrep:!0,checkExistence:!0,clearMediaForChat:!0,downloadMsg:!0,downloadProgressiveJpegThumbnail:!0,downloadStatusV3Thumbnail:!0,downloadVideoThumbnail:!0,forwardMediaMsg:!0,manuallySetMedia:!0,prepRawMedia:!0,resumeUploadMsg:!0};Object.defineProperty(t,"MediaPrep",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"checkExistence",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(t,"clearMediaForChat",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"downloadMsg",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(t,"downloadProgressiveJpegThumbnail",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"downloadStatusV3Thumbnail",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(t,"downloadVideoThumbnail",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(t,"forwardMediaMsg",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(t,"manuallySetMedia",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(t,"prepRawMedia",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(t,"resumeUploadMsg",{enumerable:!0,get:function(){return v.default}});var a=n(684293);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===a[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}}))}));var o=n(567202);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===o[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}}))}));var s=n(161027);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===s[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}}))}));var l=n(713369);Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===l[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}}))}));var u=n(339213);Object.keys(u).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===u[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return u[e]}}))}));var c=n(524466);Object.keys(c).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===c[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return c[e]}}))}));var d=n(832098);Object.keys(d).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(i,e)||e in t&&t[e]===d[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return d[e]}}))}));var p=r(n(328793)),_=r(n(619641)),f=r(n(289903)),h=r(n(677998)),g=r(n(989577)),m=r(n(765108)),y=r(n(438393)),E=r(n(324572)),S=r(n(580931)),T=r(n(758634)),v=r(n(818964))},47814:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.checkAndRepair=function(e,t){const n=new i.default.WebcMediaAnalyzed;let r=!1;return function(e){let t;return new Promise(((n,r)=>{__LOG__(2)`MediaAnalyzer:sendMessageToWorker`,t=o||new a.default,o=void 0,t.onmessage=e=>{try{e.data&&"log"===e.data.type?__LOG__(2)`(via Milan) ${e.data.msg}`:n(e.data)}catch(e){r(e)}},t.onerror=e=>{r(new Error(`Milan.onerror = ${(null==e?void 0:e.message)?e.message:e}`))},t.postMessage(e)})).finally((()=>{t&&(t.terminate(),o=new a.default)}))}({type:"prep",file:e,asGif:t}).then((e=>{let{type:t,result:n,error:i,filename:a,file:o}=e;switch(t){case"result":return __LOG__(2)`MediaAnalyzer:checkAndRepair approved file`,r=!!n,n;case"parsingError":return __LOG__(2)`trouble parsing file ${o} (fossil ${a}) ${String(i)}`,o&&(__LOG__(4,void 0,new Error,!0)`MediaAnalyzer:checkAndRepair got parsing error! ${String(i)}`,SEND_LOGS("media-parsing-error")),void __LOG__(2)`MediaAnalyzer:checkAndRepair rejected file (${String(i)})`}})).catch((e=>{__LOG__(4,void 0,new Error,!0)`MediaAnalyzer:checkAndRepair got error! ${String(e)}`,SEND_LOGS("media-detection-error")})).finally((()=>{if(n){let t;if(e.name){const n=e.name.split(".");n.length>1&&(t=n[n.length-1])}n.set({webcMediaSupported:r,webcMediaExtensions:t}),n.markWebcMediaAnalyzeT(),n.commit()}}))};var i=r(n(571834)),a=r(n(648791));let o},744526:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_AUTO_DOWNLOAD_SIZE=t.AutoDownloadQueue=t.AUTO_DOWNLOAD_TYPES=t.AUDIO_AUTO_DOWNLOAD_SIZE_LIMIT=void 0,t.shouldAutoDownloadMedia=m,t.shouldTrustMedia=g,t.validateMediaSize=y;var i=r(n(348926)),a=r(n(624877)),o=n(644234),s=r(n(343087)),l=n(96219),u=n(373070),c=n(757453),d=r(n(571834));const p=n(76672)({MEDIA:"media",MMS_THUMBNAIL:"mms_thumbnail"});t.AUTO_DOWNLOAD_TYPES=p;const _=33554432;t.MAX_AUTO_DOWNLOAD_SIZE=_;const f=524288;t.AUDIO_AUTO_DOWNLOAD_SIZE_LIMIT=f;const h=512e3;function g(e){return e.isTrusted()}function m(e){switch(e.type){case u.MSG_TYPE.AUDIO:case u.MSG_TYPE.PTT:return(0,c.getAutoDownloadAudio)();case u.MSG_TYPE.STICKER:case u.MSG_TYPE.IMAGE:return(0,c.getAutoDownloadPhotos)();case u.MSG_TYPE.VIDEO:return e.isGif&&e.size<h?(0,c.getAutoDownloadPhotos)():(0,c.getAutoDownloadVideos)();case u.MSG_TYPE.DOCUMENT:return(0,c.getAutoDownloadDocuments)()}return!1}function y(e){switch(e.type){case u.MSG_TYPE.IMAGE:case u.MSG_TYPE.VIDEO:case u.MSG_TYPE.DOCUMENT:return e.size<=_;case u.MSG_TYPE.AUDIO:case u.MSG_TYPE.PTT:return e.size<f;case u.MSG_TYPE.STICKER:return!0}return!1}const E=new class{constructor(){this._downloaderQueue=new a.default(5,{photos:2,videos:1,audio:1,documents:1,mms_thumbnail:4})}getEnqueuedTasksCount(){return this._downloaderQueue.getEnqueuedTasksCount()}clearQueue(){this._downloaderQueue.clearQueue()}enqueue(e,t){if(this.getEnqueuedTasksCount()>=32)return!1;if(t===p.MEDIA&&g(e)&&e.isNewMsg&&m(e)&&y(e))switch(e.type){case u.MSG_TYPE.AUDIO:case u.MSG_TYPE.PTT:return this._enqueueMedia({message:e,group:"audio"}),!0;case u.MSG_TYPE.IMAGE:case u.MSG_TYPE.STICKER:return this._enqueueMedia({message:e,group:"photos"}),!0;case u.MSG_TYPE.VIDEO:return e.isGif&&e.size<h?(this._enqueueMedia({message:e,group:"photos"}),!0):(this._enqueueMedia({message:e,group:"videos"}),!0);case u.MSG_TYPE.DOCUMENT:return this._enqueueMedia({message:e,group:"documents"}),!0}if(t===p.MMS_THUMBNAIL){if(e.type===u.MSG_TYPE.DOCUMENT||(0,l.typeIsUrl)(e))return this._enqueueMmsThumbnail({message:e,group:"mms_thumbnail"}),!0;if(e.type===u.MSG_TYPE.IMAGE||e.type===u.MSG_TYPE.VIDEO)return this._enqueueStatusV3Thumbnail({message:e,group:"mms_thumbnail"}),!0}return!1}_enqueueMedia(e){var t=this;let{message:n,group:r}=e;return(0,i.default)((function*(){yield t._downloaderQueue.enqueue((0,i.default)((function*(){m(n)&&(yield n.downloadMedia({downloadEvenIfExpensive:!1,rmrReason:d.default.WEBC_RMR_REASON_CODE.OTHER,isUserInitiated:!1,isAutoDownload:!0}))})),{group:r,priority:-n.t})}))()}_enqueueMmsThumbnail(e){var t=this;let{message:n,group:r}=e;return(0,i.default)((function*(){yield t._downloaderQueue.enqueue((0,i.default)((function*(){yield(0,s.default)({msg:n})})),{group:r,priority:-n.t})}))()}_enqueueStatusV3Thumbnail(e){var t=this;let{message:n,group:r}=e;return(0,i.default)((function*(){yield t._downloaderQueue.enqueue((0,i.default)((function*(){yield(0,o.downloadStatusV3Thumbnail)({msg:n})})),{group:r,priority:-n.t})}))()}};t.AutoDownloadQueue=E},116253:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=n(54918),o=n(920733),s=n(196127),l=n(172259);class u extends a.BaseModel{constructor(){super(...arguments),this.type=(0,a.prop)(l.OUTWARD_TYPES.UNKNOWN),this.directPath=(0,a.prop)(),this.mediaKey=(0,a.prop)(),this.mediaKeyTimestamp=(0,a.prop)(),this.encFilehash=(0,a.prop)(),this.mediaStage=(0,a.prop)(l.MEDIA_DATA_STAGE.INIT),this.size=(0,a.prop)(),this.loadedSize=(0,a.prop)(),this.filehash=(0,a.prop)(),this.mimetype=(0,a.prop)(),this.mediaBlob=(0,a.prop)(),this.renderableUrl=(0,a.prop)(),this.fullHeight=(0,a.prop)(),this.fullWidth=(0,a.prop)(),this.aspectRatio=(0,a.prop)(),this.rgbaBuffer=(0,a.prop)(),this.rgbaHeight=(0,a.prop)(),this.rgbaWidth=(0,a.prop)(),this.animationDuration=(0,a.prop)(0),this.animatedAsNewMsg=(0,a.prop)(!1),this.isAnimated=(0,a.prop)(),this.isFirstParty=(0,a.prop)(),this.isFromStickerMaker=(0,a.prop)(),this.stickerPackId=(0,a.prop)(),this.stickerPackName=(0,a.prop)(),this.stickerPackPublisher=(0,a.prop)(),this.singleLoopDuration=(0,a.prop)(),this.firstFrameLength=(0,a.prop)(),this.firstFrameSidecar=(0,a.prop)(),this.emojis=(0,a.prop)(),this.progressiveStage=(0,a.prop)(),this.isViewOnce=(0,a.prop)(!1),this.staticUrl=(0,a.prop)(),this.preview=(0,a.prop)(),this.sidecar=(0,a.prop)(),this.duration=(0,a.prop)(),this.durationFloat=(0,a.prop)(),this.isGif=(0,a.prop)(),this.gifAttribution=(0,a.prop)(),this.streamable=(0,a.derived)((function(){return this.isStreamable()}),["isGif","isViewOnce","mediaStage","sidecar","type","_swStreamingSupported"]),this._swStreamingSupported=(0,a.prop)(!1),this._listeningToSwSupport=(0,a.prop)(!1),this.filename=(0,a.prop)(),this.pageCount=(0,a.prop)(),this.documentPreview=(0,a.prop)(),this.isVcardOverMmsDocument=(0,a.prop)(!1),this.parsedVcards=(0,a.prop)(),this.fullPreviewSize=(0,a.prop)(),this.fullPreviewData=(0,a.prop)(),this.subtype=(0,a.prop)(),this.waveform=(0,a.prop)()}initialize(){super.initialize()}set(e,t,n){let r,a=n;return"string"==typeof e?r={[e]:t}:(r=e,a=t),r=function(e){if(e.filename&&e.type===c.TYPE.DOCUMENT){const t=(0,o.cleanFilename)(e.filename);return(0,i.default)((0,i.default)({},e),{},{filename:t,caption:t})}return e}(r),super.set(r,a)}isStreamable(){return this.isStreamableType()&&this.listenToServiceWorkerSupport()&&!this.isViewOnce}_updateStreamingSupported(e){this._swStreamingSupported=e}listenToServiceWorkerSupport(){if(this._listeningToSwSupport)return this._swStreamingSupported;{const e=n(478885).default;this.listenTo(e,"change:streamingSupported",this._updateStreamingSupported),this._swStreamingSupported=Boolean(e.streamingSupported)}return this._listeningToSwSupport=!0,this._swStreamingSupported}isStreamableType(){return this.type===l.OUTWARD_TYPES.VIDEO&&!this.isGif&&(this.mediaStage===l.MEDIA_DATA_STAGE.INIT||this.mediaStage===l.MEDIA_DATA_STAGE.FETCHING||this.mediaStage===l.MEDIA_DATA_STAGE.DECRYPTING||this.mediaStage===l.MEDIA_DATA_STAGE.RESOLVED)&&null!=this.fullWidth&&null!=this.fullHeight&&Boolean(this.sidecar&&this.sidecar.byteLength>0)}isDownloadable(){return!this.isViewOnce&&(null!=this.renderableUrl||s.MediaBlobCache.has(this.filehash)||this.mediaStage===l.MEDIA_DATA_STAGE.EXISTS||this.mediaStage===l.MEDIA_DATA_STAGE.PROGRESSIVE_READY)}}u.Proxy="mediaData";const c=(0,a.defineModel)(u);c.TYPE=l.OUTWARD_TYPES;var d=c;t.default=d},343087:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return h.apply(this,arguments)};var a=i(n(348926)),o=n(88237),s=n(417405),l=i(n(132375)),u=n(941555),c=i(n(104120)),d=i(n(756680)),p=n(708761),_=n(373070),f=i(n(281007));function h(){return(h=(0,a.default)((function*(e){const{msg:t,isPreload:n,signal:i}=e,{thumbnailSha256:a,thumbnailEncSha256:h,thumbnailDirectPath:g,mediaKey:m,mediaKeyTimestamp:y}=t;if(null==g||null==h||null==a||null==m||null==y)return;if(!(t.type!==_.MSG_TYPE.DOCUMENT&&t.type!==_.MSG_TYPE.INTERACTIVE||(0,p.getMsgMediaType)(t)!==p.MEDIA_TYPES.DOCUMENT||null!=t.thumbnailHeight&&null!=t.thumbnailWidth))return;const E=t.asUrl;if(!E||null!=E.thumbnailHeight&&null!=E.thumbnailWidth){__LOG__(2)`media.downloadMmsThumbnail: start`;try{const e=yield u.downloadManager.downloadAndDecrypt({directPath:g,encFilehash:h,filehash:a,mediaKey:m,mediaKeyTimestamp:y,type:(0,c.default)(t),signal:i||(new r).signal,userDownloadAttemptCount:0,isPreload:n});if(E)E.thumbnailHQ=(0,s.encodeB64)(e);else{const n=(0,l.default)(t.mediaObject,"mediaObject cannot be null for thumbnail download"),r={fullPreviewData:yield d.default.createFromData(e,"image/jpeg")};t.type===_.MSG_TYPE.DOCUMENT&&(r.fullPreviewSize={height:(0,l.default)(t.thumbnailHeight,"msg.thumbnailHeight"),width:(0,l.default)(t.thumbnailWidth,"msg.thumbnailWidth")}),n.consolidate(r)}__LOG__(2)`media.downloadMmsThumbnail: success`}catch(e){if(e.name===o.ABORT_ERROR)return void __LOG__(2)`media.downloadMmsThumbnail aborted`;__LOG__(3,!0)`media.downloadMmsThumbnail: error\n${(0,f.default)(e)}`}}}))).apply(this,arguments)}},509998:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MediaEntryList=t.MediaEntry=void 0;var i=r(n(348926)),a=n(867624),o=n(866028),s=n(990445),l=n(643235),u=r(n(126655)),c=r(n(166034)),d=r(n(887927));const p="PROBABLY_ON_SERVER",_="PROBABLY_OFF_SERVER",f="UNKNOWN";class h{constructor(e){this.useBackupUrl=!1,this._encFilehashPromise=null,this.deprecatedMms3Url=e.deprecatedMms3Url,this.mediaKey=e.mediaKey,this.mediaKeyTimestamp=e.mediaKeyTimestamp,this.encFilehash=e.encFilehash,this.serverStatus=f,this.sidecar=e.sidecar,this.directPath=e.directPath,this.firstFrameSidecar=e.firstFrameSidecar,this.type=e.type,this.scansSidecar=e.scansSidecar,this.scanLengths=e.scanLengths,this.staticUrl=e.staticUrl}url(e){var t=this;return(0,i.default)((function*(){const{useFallback:n,forceHashUrl:r}=e||{},{encFilehash:i}=t;if(!i)return Promise.reject(new Error("media_entry: encFilehash does not exist"));const{selectedHost:a,fallbackHost:o}=yield l.mediaHosts.getHostsInfo({operation:c.default.DOWNLOAD,encFilehash:i,type:t.type}),s=n&&o?o:a;return(0,u.default)({directPath:r?null:t.directPath,encFilehash:i,hostname:s.hostname,type:t.type})}))()}canReuseMediaKey(){if(null==this.directPath)return!1;const e=(0,s.castToUnixTime)(this.mediaKeyTimestamp);return(0,o.isMediaKeyReusable)(e)}markWhetherOnServer(e){this.serverStatus=e?p:_}}t.MediaEntry=h;function g(e){e.entries.sort(((e,t)=>{const n=m(t)-m(e);return 0===n?t.mediaKeyTimestamp-e.mediaKeyTimestamp:n}))}function m(e){let t=0;switch(e.serverStatus){case p:t+=200;break;case _:break;case f:t+=100}return e.encFilehash?t+=20:e._encFilehashPromise&&(t+=10),t}t.MediaEntryList=class{constructor(){this.entries=[]}_updateEntry(e){let{foundEntry:t,mediaKey:n,mediaKeyTimestamp:r,encFilehash:i,sidecar:o,directPath:s,firstFrameSidecar:l,scansSidecar:u,scanLengths:c,deprecatedMms3Url:d,staticUrl:p}=e;if(n&&!(0,a.b64Equal)(t.mediaKey,n)){const e=t.mediaKey.replace("=","").split("\n")[0],r=n.replace("=","").split("\n")[0];return __LOG__(4,void 0,new Error,!0)`media-fault: mediaKey changed for the same MMS3 url. type:${t.type}. equal?:${e===r}. Debug:\n${JSON.stringify({before:{hasDirectPath:Boolean(t.directPath),hasEncFilehash:Boolean(t.encFilehash),hasMediaKey:Boolean(t.mediaKey),hasDeprecatedMms3Url:Boolean(t.deprecatedMms3Url)},after:{hasDirectPath:Boolean(s),hasEncFilehash:Boolean(i),hasDeprecatedMms3Url:Boolean(d)}},null,2)}`,SEND_LOGS("media-key-mismatch-same-mms3-url"),null}return null!=r&&(t.mediaKeyTimestamp=r),o&&(t.sidecar=o),l&&(t.firstFrameSidecar=l),u&&(t.scansSidecar=u),(null==c?void 0:c.length)&&(t.scanLengths=c),p&&(t.staticUrl=p),t.directPath=s,t}updateEntry(e){let{deprecatedMms3Url:t,mediaKey:n,mediaKeyTimestamp:r,encFilehash:i,type:a,sidecar:o,directPath:s,firstFrameSidecar:l,scansSidecar:u,scanLengths:c,staticUrl:d}=e;const p=this.getEntryByEncFilehash({encFilehash:i,deprecatedMms3Url:t});if(p)return this._updateEntry({foundEntry:p,mediaKey:n,mediaKeyTimestamp:r,encFilehash:i,sidecar:o,directPath:s,firstFrameSidecar:l,scansSidecar:u,scanLengths:c,deprecatedMms3Url:t,staticUrl:d})}addEntry(e){const{deprecatedMms3Url:t,mediaKey:n,mediaKeyTimestamp:r,encFilehash:i,type:a,sidecar:o,directPath:s,firstFrameSidecar:l,scansSidecar:u,scanLengths:c,staticUrl:d,debugHint:p}=e;null==i&&(__LOG__(4,void 0,new Error,!0)`Media type ${a} from ${p} is missing encFilehash`,SEND_LOGS(`media-entry-missing-upload-hash-${a}-${p}`));const _=this.entries,f=this.getEntryByEncFilehash({encFilehash:i,deprecatedMms3Url:t}),g=f?this._updateEntry({foundEntry:f,mediaKey:n,mediaKeyTimestamp:r,encFilehash:i,sidecar:o,directPath:s,firstFrameSidecar:l,scansSidecar:u,scanLengths:c,deprecatedMms3Url:t,staticUrl:d}):null;if(g)return g;if(!n)return null;const m=new h({deprecatedMms3Url:t,mediaKey:n,mediaKeyTimestamp:r,encFilehash:i,type:a,sidecar:o,directPath:s,firstFrameSidecar:l,scansSidecar:u,scanLengths:c,staticUrl:d});return _.push(m),m}_getKey(e){let{encFilehash:t,deprecatedMms3Url:n}=e;return null==t?`mms3:${n}`:t}has(e){return null!=this.getEntryByEncFilehash(e)}getEntryByEncFilehash(e){const t=this._getKey(e);return this.entries.find((e=>this._getKey(e)===t))}getUploadEntry(){return g(this),this.entries.find((e=>(0,d.default)(e.mediaKeyTimestamp)))||null}getDownloadEntry(){g(this);const e=this.entries[0];return e&&e.serverStatus!==_?e:null}clearEntries(){this.entries=[]}}},409701:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(643930),i=n(288057);class a extends((0,r.customError)("MediaFileTooLarge",!0,i.MediaFileError)){constructor(e){super(`File (${e.type()}) size = ${e.size()}`),this.opaqueData=e}}t.default=a},104120:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){switch(e.type){case a.MSG_TYPE.DOCUMENT:return i.MEDIA_TYPES.THUMBNAIL_DOCUMENT;case a.MSG_TYPE.VIDEO:return i.MEDIA_TYPES.THUMBNAIL_VIDEO;case a.MSG_TYPE.IMAGE:return i.MEDIA_TYPES.THUMBNAIL_IMAGE;case a.MSG_TYPE.CHAT:return i.MEDIA_TYPES.THUMBNAIL_LINK;case a.MSG_TYPE.INTERACTIVE:{const{interactiveHeader:t}=e;if(null!=(null==t?void 0:t.mediaType))switch(t.mediaType){case r.InteractiveMessageHeaderMediaType.DOCUMENT:return i.MEDIA_TYPES.THUMBNAIL_DOCUMENT;case r.InteractiveMessageHeaderMediaType.VIDEO:return i.MEDIA_TYPES.THUMBNAIL_VIDEO}break}}throw new Error("getThumbnailTypeForMsg: Unsupported msg type")};var r=n(943914),i=n(708761),a=n(373070)},842156:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e?(0,i.unproxy)(e).isGroup?a.default.UPLOAD_ORIGIN_TYPE.CHAT_GROUP:a.default.UPLOAD_ORIGIN_TYPE.CHAT_PERSONAL:a.default.UPLOAD_ORIGIN_TYPE.UNKNOWN};var i=n(411067),a=r(n(571834))},176779:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cleanJPEG=function(e){const t=new r.Binary(e),n=new r.Binary(e),j=new r.Binary;let Y,K=!1,H=!1,W=!1,V=!1;const $={version:257,densityUnits:0,xDensity:1,yDensity:1};if(255!==t.readUint8()||t.readUint8()!==y)throw new Error("SOI marker not at the start of the file.");n.advance(2);let z;for(;null!=z||t.size();){if(void 0===z){const e=t.readUint8();if(255!==e)throw new Error(`0x${e.toString(16)} is not a marker prefix.`);z=t.readUint8()}switch(z){case A:if(H)Y=t.readUint16(),n.advance(Y+2),t.advance(t.size()-n.size());else{if(Y=t.readUint16(),"JFIF\0"!==t.readString(5))throw new Error("APP0 marker missing 'JFIF' magic bytes.");V=!0,$.version=t.readUint16(),$.densityUnits=t.readUint8(),$.xDensity=t.readUint16(),$.yDensity=t.readUint16(),n.advance(Y+2),t.advance(t.size()-n.size()),H=!0}break;case S:if(!W&&!V)throw new Error("Missing magic bytes marker.");let e,r;t.advance(t.readUint16()-2);let y=t.readUint8();for(;t.size();){if(r=t.readUint8(),e=255===y&&!F.includes(r),e){z=r;break}y=r}j.writeByteArray(n.readByteArray(n.size()-t.size()-2));continue;case C:if(Y=t.readUint16(),!W&&"Exif\0\0"!==t.readString(6))throw new Error("APP1 marker missing 'EXIF' magic bytes.");W=!0,n.advance(Y+2),t.advance(t.size()-n.size());break;case U:case B:if(!W&&!V)throw new Error("Missing magic bytes marker.");Y=t.readUint16(),n.advance(Y+2),t.advance(t.size()-n.size());break;case E:if(!W&&!V)throw new Error("Missing magic bytes marker.");K=!0,j.writeByteArray(n.readByteArray(2));break;case i:case a:case o:case s:case u:case c:case d:case p:case _:case f:case h:case g:case m:case T:case l:case v:if(!W&&!V)throw new Error("Missing magic bytes marker.");Y=t.readUint16(),j.writeByteArray(n.readByteArray(2+Y)),t.advance(t.size()-n.size());break;case P:case O:case I:case M:case b:case R:case N:case w:case L:case D:case k:case G:case x:throw new Error(`Received unexpected APP marker 0x${z.toString(16)}`);default:throw new Error(`Did not understand marker: 0x${z.toString(16)}`)}if(z=void 0,K)break}if(!K)throw new Error("No EOI tag found.");const q=function(e){const t=new r.Binary;return t.writeBytes(255,216,255,224,0,16,74,70,73,70,0),t.writeUint16(e.version),t.writeUint8(e.densityUnits),t.writeUint16(e.xDensity),t.writeUint16(e.yDensity),t.writeBytes(0,0),t.readByteArray()}($);return new Blob([q,j.readByteArray()],{type:"image/jpeg"})};var r=n(551168);const i=192,a=193,o=194,s=195,l=196,u=197,c=198,d=199,p=201,_=202,f=203,h=205,g=206,m=207,y=216,E=217,S=218,T=219,v=221,A=224,C=225,P=226,O=227,I=228,M=229,b=230,R=231,N=232,w=233,L=234,D=235,k=236,U=237,G=238,x=239,B=254,F=[0,208,209,210,211,212,213,214,215]},197636:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.canPlayOgg=void 0,t.disposeVideo=S,t.image=function(e){return y(e).then((e=>{if(e&&e.naturalWidth>0)return{img:e,fullWidth:e.naturalWidth,fullHeight:e.naturalHeight};throw new u.MediaLoadError("image loaded with zero width")})).catch((()=>{throw new u.MediaLoadError("unable to render image")}))},t.loadImage=y,t.loadVideo=E,t.transcode=function(e,t){const n=t||e.type;if((0,l.isOpus)(n)&&!h){if(e.size<=3e5){return new _.default(e).generateBlob()}return Promise.reject(new u.TranscodeBlobTooLargeError)}return Promise.resolve(e)},t.videoWidthHeightDuration=function(e){return E(e).then((e=>{let{video:t,fullWidth:n,fullHeight:r,duration:i}=e;return S(t),{width:n,height:r,duration:i}}))};var i=n(643930),a=n(924583),o=n(36530),s=n(975175),l=n(937484),u=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),c=r(n(841737)),d=n(368170),p=r(n(571834)),_=r(n(554810));function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}const h=(new Audio).canPlayType("audio/ogg");t.canPlayOgg=h;let g=0,m=Promise.resolve();function y(e){let t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return new Promise((function(r,i){t=new Image;const a=/^(?:data|blob):/.test(e);n&&!a&&t.setAttribute("crossOrigin","anonymous"),t.onload=r,t.onabort=()=>{i(new Error("loadImage onabort"))},t.onerror=()=>{i(new u.InvalidImageFileType("Image tag load error"))},t.src=e})).then((()=>t))}function E(e){const t=m.then((()=>function(e){const t=new p.default.WebcMediaLoad;let n,r,l=null;const _=++g;function f(){n&&l&&(document.body&&document.body.removeChild(l),l=null)}let h=!0;const m=new Promise((function(t,i){__LOG__(2)`MediaLoad:video called (#${_})`;let a=!1,o=!1;n=document.createElement("video"),n.setAttribute("crossOrigin","anonymous"),n.volume=0,n.muted=!0,n.playsinline=!0;const s=()=>{o&&a&&t()};if(n.onloadedmetadata=()=>{__LOG__(2)`MediaLoad:video.onloadedmetadata #${_}. Video ready: ${o}. Video width: ${n.videoWidth}`,n.onloadedmetadata=null,a=!0,s()},n.oncanplaythrough=()=>{__LOG__(2)`MediaLoad:video.oncanplaythrough #${_}. Metadata loaded: ${a}. Video width: ${n.videoWidth}`,n.oncanplaythrough=null,n.onseeked=()=>{o=!0,n.onseeked=null,s()},n.currentTime=0},n.onerror=()=>{const t=n.error?n.error.message:"no error message";__LOG__(3)`MediaLoad:video.onerror #${_}: ${String(t)}\n Blob info -> size:${e.size}, type: ${e.type}`;const r=function(e){if(!e||!e.error)return null;const t=e.error;let n=Object.keys(c.default).find((e=>c.default[e]===t.code));n=n||`UNKNOWN CODE ${t.code}`;const r=t.message&&~t.message.indexOf(":")?t.message.split(":")[0]:"";return r?`${n}: ${r}`:n}(n);i(new u.UnableToPlayVideoError(r))},n.src=r=window.URL.createObjectURL(e),d.UA.isSafari){l=document.createElement("div");const e=l;e.style="opacity: 0.004",e.appendChild(n),document.body&&document.body.appendChild(e)}n.load(),n.currentTime=1})).finally((()=>{h=!1}));setTimeout((()=>{f(),h&&(__LOG__(3)`unable to load video #${_} (${e.size} bytes)`,new p.default.WebcMediaLoad({webcMediaLoadResult:p.default.WEBC_MEDIA_LOAD_RESULT_CODE.SILENCE}).commit())}),8e3);const y=(0,s.promiseTimeout)(m,2e4).then((()=>(0,o.delayMs)(10))).then((()=>{if(t.markWebcMediaLoadT(),__LOG__(2)`MediaLoad:video #${_} successful`,n.pause(),n.videoWidth>0)return t.webcMediaLoadResult=p.default.WEBC_MEDIA_LOAD_RESULT_CODE.SUCCESS,t.commit(),{video:n,fullWidth:n.videoWidth,fullHeight:n.videoHeight,duration:n.duration};throw n.duration>0?(__LOG__(3)`MediaLoad:video #${_} dimensions are not defined. Video readyState: ${n.readyState}. Video width: ${n.videoWidth}`,new u.MediaUnsupportedError("video loaded with duration but no dims")):(t.webcMediaLoadResult=p.default.WEBC_MEDIA_LOAD_RESULT_CODE.ZEROWIDTH,t.commit(),new u.MediaLoadError("video loaded with zero width"))})).catch((0,a.filteredCatch)(i.TimeoutError,(e=>{throw __LOG__(4,void 0,new Error,!0)`MediaLoad:video load error, currentTime=${n.currentTime}. duration=${n.duration}`,SEND_LOGS("video-load-timeout"),e}))).finally((()=>{f(),n&&(n.onloadedmetadata=null,n.onloadeddata=null,n.oncanplaythrough=null,n.ontimeupdate=null,n.onerror=null),r&&window.URL.revokeObjectURL(r)}));return y.catch((()=>{S(n)})),y}(e)));return m=(0,s.promiseTimeout)(t,1e3).then((()=>{}),(()=>{})),t}function S(e){try{e.pause(),e.src="",e.load()}catch(e){__LOG__(4,void 0,new Error,!0)`Error: ${String(e)}`,SEND_LOGS("dispose-video-error")}}},102645:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.NoEntryAfterRMR=t.MissingEncFilehash=void 0,t.cancelDownloadMedia=function(e){var t;const{downloadPromise:n}=e;if(null==n)return;const r=null===(t=L.get(n))||void 0===t?void 0:t.abort;if(null==r)return;L.delete(n),r()},t.checkExistence=function(){return B.apply(this,arguments)},t.downloadMedia=G,t.manuallySetMedia=function(){return D.apply(this,arguments)};var a=i(n(348926)),o=i(n(823493)),s=n(88237),l=n(643930),u=n(924583),c=i(n(132375)),d=i(n(99842)),p=n(941555),_=n(707132),f=n(698210),h=n(232294),g=n(196127),m=M(n(197636)),y=i(n(756680)),E=n(172259),S=n(937484),T=M(n(288057)),v=n(263958),A=n(947638),C=n(708761),P=n(105284),O=i(n(571834));function I(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(I=function(e){return e?n:t})(e)}function M(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=I(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}class b extends((0,l.customError)("NoEntryAfterRMR")){}t.NoEntryAfterRMR=b;class R extends((0,l.customError)("MissingEncFilehash")){}t.MissingEncFilehash=R;const N=3,w=4,L=new WeakMap;function D(){return(D=(0,a.default)((function*(e){let{mimetype:t,mediaObject:n,mediaBlob:r,mediaType:i,rmrReason:a,downloadOrigin:o}=e;n.mediaBlob||(yield(0,h.gatherAndSetMetadata)(n,r),yield G({mimetype:t,mediaObject:n,downloadEvenIfExpensive:!1,mediaType:i,rmrReason:a,downloadOrigin:o}))}))).apply(this,arguments)}function k(){return U.apply(this,arguments)}function U(){return(U=(0,a.default)((function*(e){const{mimetype:t}=e,n=(0,o.default)((t=>{e.mediaObject.consolidate({loadedSize:t.loaded})}),A.FILE_PROGRESS_THROTTLE_WAIT_MS),r=yield p.downloadManager.downloadAndDecrypt({directPath:e.directPath,encFilehash:e.encFilehash,filehash:e.objFilehash,isFinalRmrRetry:e.isFinalRmrRetry,mediaKey:e.mediaKey,mediaKeyTimestamp:e.mediaKeyTimestamp,signal:e.signal,staticUrl:e.staticUrl,type:e.mediaType,onDecryptStart:()=>{e.mediaObject.consolidate({downloadStage:E.DOWNLOAD_STAGE.PROCESSING})},onProgress:n,userDownloadAttemptCount:e.mediaObject.userDownloadAttemptCount,downloadOrigin:e.downloadOrigin,mode:e.mode,progressiveJpegOpts:F({scanLengths:e.scanLengths,scansSidecar:e.scansSidecar,mimetype:t,mediaObject:e.mediaObject}),isViewOnce:e.isViewOnce}),i=null!=t&&""!==t?t:(0,S.getMediaMimeType)(e.mediaType,new Uint8Array(r));return new Blob([r],{type:i})}))).apply(this,arguments)}function G(){return x.apply(this,arguments)}function x(){return(x=(0,a.default)((function*(e){let{mimetype:t,mediaObject:n,downloadEvenIfExpensive:i,mediaType:o,signal:l,rmrReason:S,rmrData:A,downloadOrigin:I,shouldThrow:M,isVcardOverMmsDocument:N,mode:w,isAutoDownload:D,isFinalRmrRetry:U,isViewOnce:x}=e;const B=!D;if(!n)return;const F=n.filehash;if(!F)return;const j=K(n);if(j&&B&&(j.shouldStoreInMemory=!0),n.downloadPromise)return n.downloadPromise;if(n.downloadStage===E.DOWNLOAD_STAGE.ERROR_MISSING)return;if(n.downloadStage===E.DOWNLOAD_STAGE.PREPARING)return;if(n.mediaBlob){return(yield n.mediaBlob.validate())?void n.consolidate({downloadStage:E.DOWNLOAD_STAGE.RESOLVED}):(n.clearBlob(),n.consolidate({downloadStage:E.DOWNLOAD_STAGE.NEED_POKE}),void n.notifyMsgsAsync())}const Y=g.MediaBlobCache.get(F);let H,W;const V=new r;return(0,d.default)([V.signal,l].filter(Boolean),(e=>{var l;const d=function(){var r=(0,a.default)((function*(){if(Y)W=Y;else{if(H=n.entries.getDownloadEntry(),!H){if(!i)return void n.consolidate({downloadStage:E.DOWNLOAD_STAGE.NEED_POKE});if(yield p.downloadManager.rmr({mediaObject:n,signal:e,rmrReason:S,rmrData:A}),H=n.entries.getDownloadEntry(),!H){if(S!==O.default.WEBC_RMR_REASON_CODE.STICKER_PANEL_STICKER)throw new b;return}}n.consolidate({downloadStage:E.DOWNLOAD_STAGE.FETCHING}),H=(0,c.default)(H,"entry");const{encFilehash:r,scansSidecar:a,scanLengths:s,directPath:l,mediaKey:u,mediaKeyTimestamp:d,staticUrl:_}=H;if(!r)throw H.markWhetherOnServer(!1),new R;const f=yield k({directPath:l,encFilehash:r,objFilehash:F,isFinalRmrRetry:U,mediaKey:u,mediaKeyTimestamp:d,signal:e,staticUrl:_,mediaType:o,mediaObject:n,downloadOrigin:I,mode:w,scanLengths:s,mimetype:t,scansSidecar:a,isViewOnce:x});W=o===C.MEDIA_TYPES.PTT||o===C.MEDIA_TYPES.AUDIO?yield m.transcode(f):f}if("text/vcard"===W.type&&N)try{const e=yield(0,f.blobToText)(W);if(e){const t=(0,P.parseMultiVcard)(e);t.length>0?n.consolidate({parsedVcards:t}):(__LOG__(4,void 0,new Error,!0,["non-sad"])`Assertion failed!`,SEND_LOGS("vcard_over_mms:Failed to parse vcard over mms contents"))}}catch(e){__LOG__(4,void 0,new Error,!0,["non-sad"])`Failed to retrieve blob text contents ${String(e)}`,SEND_LOGS(`vcard_over_mms:blobToText failed with error: ${String(e)}`)}if((0,h.shouldUseMediaCache)(o)){const e=K(n);((null==e?void 0:e.shouldStoreInMemory)||B)&&(g.MediaBlobCache.put(F,W),yield(0,h.gatherAndSetMetadataNoOpaque)(n,W))}else{const e=yield y.default.createFromData(W,W.type);yield(0,h.gatherAndSetMetadata)(n,e)}return n.consolidate({downloadStage:E.DOWNLOAD_STAGE.RESOLVED}),n.downloadPromise=null,n.resolveWhenConsolidated()}));return function(){return r.apply(this,arguments)}}()().catch((0,u.filteredCatch)(v.MediaNotFoundError,function(){var e=(0,a.default)((function*(e){if(!H)throw e;if(H.markWhetherOnServer(!1),!i)throw e;return yield p.downloadManager.rmr({mediaObject:n,signal:(new r).signal,rmrReason:S,rmrData:A}),n.downloadPromise=null,G({mimetype:t,mediaObject:n,downloadEvenIfExpensive:!1,mediaType:o,rmrReason:S,rmrData:A,downloadOrigin:I,isFinalRmrRetry:!0,isVcardOverMmsDocument:N,mode:w,isAutoDownload:D})}));return function(){return e.apply(this,arguments)}}())).catch((0,u.filteredCatch)(T.MediaUnsupportedError,(e=>{if(n.consolidate({downloadStage:E.DOWNLOAD_STAGE.ERROR_UNSUPPORTED}),__LOG__(3)`downloadMedia: media unsupported error: ${e.name}, ${e.message}, ${t||""}`,__LOG__(4,void 0,new Error,!0,["non-sad"])`Assertion failed! ${e.message}`,SEND_LOGS("downloadMedia: media unsupported error:"),M)throw e}))).catch((0,u.filteredCatch)(_.MediaNotOnPhone,(e=>{if(n.consolidate({downloadStage:E.DOWNLOAD_STAGE.ERROR_MISSING}),M)throw e}))).catch((0,u.filteredCatch)([b,R],(e=>{if(n.consolidate({downloadStage:E.DOWNLOAD_STAGE.ERROR_MISSING}),__LOG__(3)`Unexpected download error: ${e.name}`,__LOG__(4,void 0,new Error,!0,["non-sad"])`Assertion failed!`,SEND_LOGS(`unexpected download error: ${e.name}`),M)throw e}))).catch((0,u.filteredCatch)(T.MediaDecryptionError,(e=>{if(n.consolidate({downloadStage:E.DOWNLOAD_STAGE.ERROR_MISSING}),M)throw e}))).catch((e=>{if(n.consolidate({downloadStage:E.DOWNLOAD_STAGE.NEED_POKE}),e instanceof T.MediaLoadError){if(__LOG__(3)`downloadMedia: media unsupported error: ${e.name}, ${e.message}, ${t||""}`,__LOG__(4,void 0,new Error,!0,["non-sad"])`Assertion failed! ${e.message}`,SEND_LOGS("downloadMedia: media load error:"),M)throw e}else if(e instanceof T.TranscodeBlobTooLargeError){if(__LOG__(3)`downloadMedia: error: ${e.message}, ${t||""}`,__LOG__(4,void 0,new Error,!0,["non-sad"])`Assertion failed! ${e.message}`,SEND_LOGS("downloadMedia: transcode blob too large"),M)throw e}else if(e instanceof T.UnableToPlayVideoError){if(__LOG__(3)`downloadMedia: error: ${e.message}, ${t||""}`,__LOG__(4,void 0,new Error,!0,["non-sad"])`Assertion failed! ${e.message}`,SEND_LOGS("downloadMedia: unable to play video"),M)throw e}else if(e.name!==s.ABORT_ERROR){if(__LOG__(2)`downloadMedia: error`,M)throw e}else if(M)throw e})).finally((()=>{n.downloadPromise=null}));return L.set(d,{abort:()=>{V.abort()},shouldStoreInMemory:(null===(l=K(n))||void 0===l?void 0:l.shouldStoreInMemory)||B}),n.downloadPromise=d,d}))}))).apply(this,arguments)}function B(){return(B=(0,a.default)((function*(e){let{mimetype:t,mediaObject:n,mediaType:i}=e;const{filehash:a}=n;if(!a)return;if(n.downloadStage!==E.DOWNLOAD_STAGE.INIT)return;if(yield j(n))return;const o=g.MediaBlobCache.get(a),s=new r;if(o)return void(n.downloadStage===E.DOWNLOAD_STAGE.INIT&&n.consolidate({downloadStage:E.DOWNLOAD_STAGE.EXISTS}));const l=n.entries.getDownloadEntry();if(!l)return void(n.downloadStage===E.DOWNLOAD_STAGE.INIT&&n.consolidate({downloadStage:E.DOWNLOAD_STAGE.NEED_POKE}));const{encFilehash:u}=l;if(!u)return l.markWhetherOnServer(!1),void(n.downloadStage===E.DOWNLOAD_STAGE.INIT&&n.consolidate({downloadStage:E.DOWNLOAD_STAGE.NEED_POKE}));try{yield p.downloadManager.checkExistence({directPath:l.directPath,encFilehash:u,signal:s.signal,type:i}),n.downloadStage===E.DOWNLOAD_STAGE.INIT&&n.consolidate({downloadStage:E.DOWNLOAD_STAGE.EXISTS})}catch(e){n.downloadStage===E.DOWNLOAD_STAGE.INIT&&n.consolidate({downloadStage:E.DOWNLOAD_STAGE.NEED_POKE}),__LOG__(2)`checkExistence: error`}}))).apply(this,arguments)}function F(e){const{scanLengths:t,scansSidecar:n,mimetype:r,mediaObject:i}=e;if(!function(e,t){return!!(e&&t&&e.length>=2&&10*e.length===t.byteLength)}(t,n))return null;const a=new O.default.WebcProgressiveImage({webcFirstRenderScans:0});return{mimetype:r,scansSidecar:(0,c.default)(n,"scansSidecar"),scanLengths:(0,c.default)(t,"scanLengths"),onProgressiveUpdate:e=>{i.downloadStage!==E.DOWNLOAD_STAGE.RESOLVED&&(i.consolidate({downloadStage:E.DOWNLOAD_STAGE.PROGRESSIVE_READY,progressiveStage:e}),a.webcFirstRenderScans||(a.webcFirstRenderScans=e,a.markWebcFirstRenderT()),e>=N&&!a.webcMidQualityT&&a.markWebcMidQualityT(),e!==w||a.webcFullQualityT||(a.markWebcFullQualityT(),a.commit()))}}}function j(){return Y.apply(this,arguments)}function Y(){return(Y=(0,a.default)((function*(e){if(!e.mediaBlob)return!1;return(yield e.mediaBlob.validate())?(e.consolidate({downloadStage:E.DOWNLOAD_STAGE.RESOLVED}),!0):(e.clearBlob(),e.consolidate({downloadStage:E.DOWNLOAD_STAGE.NEED_POKE}),e.notifyMsgsAsync(),!1)}))).apply(this,arguments)}function K(e){const{downloadPromise:t}=e;return t?L.get(t):null}},709089:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.UploadMediaResultKind=void 0,t.cancelUploadMedia=function(e){const{uploadPromise:t}=e;if(null==t)return;const n=P.get(t);if(null==n)return;P.delete(t),n()},t.getBlobFromMediaObject=R,t.getOrDownloadBlob=M,t.uploadMedia=function(e){let{mimetype:t,mediaObject:n,mediaType:i,forwardedFromWeb:o,uploadOrigin:u,mediaKeyInfo:f,isViewOnce:y,earlyUpload:S}=e;if(n.uploadPromise)return n.uploadPromise;const T=new r,{signal:A}=T,C=Promise.resolve().then((()=>{n.consolidate({uploadStage:h.UPLOAD_STAGE.UPLOADING})})).then((()=>M({mediaObject:n,mimetype:t,mediaType:i,abortSignal:A,uploadOrigin:u}))).then(function(){var e=(0,a.default)((function*(e){const t=n.entries.getUploadEntry();t&&f&&(0,v.default)(t.mediaKey===f.key,"uploadEntry.mediaKey and mediaKeyInfo.mediaKey should be the same");const r=yield function(){return I.apply(this,arguments)}({blob:e,forwardedFromWeb:o,mediaKeyInfo:f,mediaObject:n,mediaType:i,signal:A,uploadEntry:t,uploadOrigin:u,isViewOnce:y,earlyUpload:S});if(!r)throw new Error("could not create media entry");if((i===E.MEDIA_TYPES.PTT||i===E.MEDIA_TYPES.AUDIO)&&!d.canPlayOgg())if(d.shouldUseMediaCache(i)){const e=n.filehash;if(e&&n.mediaBlob)return _.transcode(n.mediaBlob.formData()).then((t=>{p.MediaBlobCache.put(e,t)})).then((()=>r))}else if(n.mediaBlob)return d.gatherAndSetMetadata(n,n.mediaBlob).then((()=>r));return r}));return function(){return e.apply(this,arguments)}}()).then((e=>{if(A.aborted)throw new s.AbortError;return n.consolidate({uploadStage:h.UPLOAD_STAGE.UPLOADED}),__LOG__(2)`MediaAlgo.uploadMedia: success`,{kind:O.SUCCESS,mediaEntry:e}})).catch((e=>{throw e.name===s.ABORT_ERROR?__LOG__(2)`MediaAlgo.uploadMedia: canceled`:__LOG__(3)`MediaAlgo.uploadMedia: error`,e})).finally((()=>{delete n.uploadPromise})).catch((0,l.filteredCatch)(g.FileNotReadableError,(()=>(n.consolidate({uploadStage:h.UPLOAD_STAGE.ERROR_FILE_NOT_READABLE}),{kind:O.ERROR})))).catch((0,l.filteredCatch)(c.MediaNotOnPhone,(()=>(n.consolidate({uploadStage:h.UPLOAD_STAGE.ERROR_MISSING}),{kind:O.ERROR})))).catch((0,l.filteredCatch)(m.MediaTooLargeError,(()=>(n.consolidate({uploadStage:h.UPLOAD_STAGE.ERROR_TOO_LARGE}),{kind:O.ERROR})))).catch((e=>(n.consolidate({uploadStage:h.UPLOAD_STAGE.NEED_UPLOAD}),e.name===s.ABORT_ERROR?{kind:O.CANCELLATION}:{kind:O.ERROR})));return P.set(C,(()=>{T.abort()})),n.uploadPromise=C,C};var a=i(n(348926)),o=i(n(823493)),s=n(88237),l=n(924583),u=i(n(319753)),c=n(707132),d=C(n(232294)),p=n(196127),_=C(n(197636)),f=n(102645),h=n(172259),g=n(288057),m=n(263958),y=n(947638),E=n(708761),S=i(n(92577)),T=i(n(571834)),v=i(n(441143));function A(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(A=function(e){return e?n:t})(e)}function C(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=A(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}const P=new WeakMap;const O={SUCCESS:"success",CANCELLATION:"cancellation",ERROR:"error",TIMEOUT:"timeout"};function I(){return(I=(0,a.default)((function*(e){let{blob:t,forwardedFromWeb:n,mediaKeyInfo:r,mediaObject:i,mediaType:a,signal:s,uploadEntry:l,uploadOrigin:c,isViewOnce:d,earlyUpload:p}=e;if(null==l?void 0:l.canReuseMediaKey())return(0,u.default)(a,c,0,n,d).handleCheckExistingSuccess(),l;const _=yield p;if(null!=_)return i.entries.addEntry({deprecatedMms3Url:_.url,mediaKey:_.mediaKey,mediaKeyTimestamp:_.mediaKeyTimestamp,encFilehash:_.encFilehash,type:a,sidecar:_.sidecar,directPath:_.directPath,firstFrameSidecar:_.firstFrameSidecar,debugHint:"upload"});const f=r?r.key:null==l?void 0:l.mediaKey,g=r?r.timestamp:null==l?void 0:l.mediaKeyTimestamp,m=(0,o.default)(((e,t)=>{const n=e.loaded+t;Number.isFinite(n)&&i.consolidate({loadedSize:n})}),y.FILE_PROGRESS_THROTTLE_WAIT_MS),{directPath:E,encFilehash:T,mediaKey:v,mediaKeyTimestamp:A,url:C,sidecar:P,firstFrameSidecar:O}=yield S.default.encryptAndUpload({blob:t,mediaKey:f,mediaKeyTimestamp:g,type:a,signal:s,userUploadAttemptCount:i.userUploadAttemptCount,forwardedFromWeb:n,uploadOrigin:c,onProgress:m,onFinalize:()=>{i.consolidate({uploadStage:h.UPLOAD_STAGE.FINALIZING})},isViewOnce:d});return i.entries.addEntry({deprecatedMms3Url:C,mediaKey:v,mediaKeyTimestamp:A,encFilehash:T,type:a,sidecar:P,directPath:E,firstFrameSidecar:O,debugHint:"upload"})}))).apply(this,arguments)}function M(){return b.apply(this,arguments)}function b(){return(b=(0,a.default)((function*(e){let{mediaObject:t,mimetype:n,mediaType:r,abortSignal:i,uploadOrigin:a}=e;const o=R(t);if(o)return o;if(yield(0,f.downloadMedia)({mimetype:n,mediaObject:t,downloadEvenIfExpensive:!0,mediaType:r,signal:i,rmrReason:T.default.WEBC_RMR_REASON_CODE.UPLOAD,downloadOrigin:a===T.default.UPLOAD_ORIGIN_TYPE.CHAT_PERSONAL?T.default.DOWNLOAD_ORIGIN_TYPE.CHAT_PERSONAL:T.default.DOWNLOAD_ORIGIN_TYPE.CHAT_GROUP,mode:"manual"}),t.downloadStage===h.DOWNLOAD_STAGE.ERROR_MISSING)throw new c.MediaNotOnPhone;const s=R(t);if(s)return s;throw new Error("cant upload media w/out mediaBlob after download")}))).apply(this,arguments)}function R(e){const t=e.mediaBlob;return t?t.formData():e.filehash?p.MediaBlobCache.get(e.filehash):void 0}t.UploadMediaResultKind=O},189123:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MediaObject=void 0,t.consolidate=m,t.getInteractiveMsgMediaType=y,t.webMediaTypeToWamMediaType=function(e){switch(e){case"VIDEO":return 3;case"IMAGE":return 2;case"AUDIO":return 4;case"STICKER":return 16;case"DOCUMENT":return 8;case"PRODUCT":return 18;case"BIZ_COVER_PHOTO":default:throw new Error(`web media type is invalid: ${e}`)}};var i=r(n(81109)),a=r(n(348926)),o=n(201063),s=n(402994),l=r(n(904219)),u=n(943914),c=n(232294),d=n(509998),p=r(n(756680)),_=n(172259),f=n(708761),h=n(373070),g=(r(n(571834)),r(n(670913)));function m(e,t){const n=e.contentInfo;let r=!1;const i=function(e){switch(e){case _.OUTWARD_TYPES.IMAGE:case _.OUTWARD_TYPES.PRODUCT:return _.TYPE.IMAGE;case _.OUTWARD_TYPES.VIDEO:return _.TYPE.VIDEO;case _.OUTWARD_TYPES.STICKER:return _.TYPE.STICKER;case _.OUTWARD_TYPES.AUDIO:case _.OUTWARD_TYPES.PTT:return _.TYPE.AUDIO;case _.OUTWARD_TYPES.DOCUMENT:default:return}}(t.type,t.subtype);i&&!e.type&&(e.type=i,r=!0);const{downloadStage:a,uploadStage:o}=t;a&&a!==e.downloadStage&&(e.downloadStage=a,r=!0),o&&o!==e.uploadStage&&(e.uploadStage=o,r=!0),t.resolvedPreview&&!n.preview&&(t.resolvedPreview.retain(),n.preview=t.resolvedPreview,r=!0),void 0!==t.progressiveStage&&t.progressiveStage!==e.progressiveStage&&(e.progressiveStage=t.progressiveStage,r=!0);const s=t.mediaBlob;s&&!s.isBlobEqual(e.mediaBlob)&&(e.mediaBlob&&e.clearBlob(),s.retain(),e.mediaBlob=s,e.size=s.size(),r=!0),null!=t.size&&(null==e.size||t.size<e.size)&&(e.size=t.size,r=!0);const{loadedSize:l}=t;null!=l&&l!==e.loadedSize&&(e.loadedSize=l,r=!0),t.filehash&&!e.filehash&&(e.filehash=t.filehash,r=!0),t.parsedVcards&&t.parsedVcards!==e.parsedVcards&&(e.parsedVcards=t.parsedVcards,r=!0);const u=e.contentFields();for(let i=0;i<u.length;i++){const a=u[i];switch(a){case"preview":t.preview&&!n._preview&&(e.runProcessIfNotRunBefore("preview",v,t.preview),n._preview=t.preview,r=!0);break;case"fullWidth":case"fullHeight":case"aspectRatio":{const e=t[a];null!=e&&0!==e&&n[a]!==e&&(n[a]=e,r=!0);break}case"animationDuration":case"singleLoopDuration":{const e=t[a];null!=e&&e!==n[a]&&(n[a]=e,r=!0);break}default:const i=t[a];void 0!==i&&void 0===n[a]&&(n[a]=i,r=!0)}}return null!=n.aspectRatio&&0!==n.aspectRatio||(null!=n.fullWidth&&0!==n.fullWidth&&null!=n.fullHeight&&0!==n.fullHeight?(n.aspectRatio=n.fullWidth/n.fullHeight,r=!0):n.preview&&e.runProcessIfNotRunBefore("aspectRatio",C,n.preview)),r}function y(e){var t;if(null!=(null===(t=e.interactiveHeader)||void 0===t?void 0:t.mediaType))switch(e.interactiveHeader.mediaType){case u.InteractiveMessageHeaderMediaType.DOCUMENT:return _.OUTWARD_TYPES.DOCUMENT;case u.InteractiveMessageHeaderMediaType.VIDEO:return _.OUTWARD_TYPES.VIDEO;case u.InteractiveMessageHeaderMediaType.IMAGE:return _.OUTWARD_TYPES.IMAGE}}function E(e,t,n){for(let r=0;r<n.length;r++){const i=n[r];e[i]=t[i]}}function S(e,t){return t.filehash?e.id.fromMe&&e.ack<s.ACK.SENT?(e.local||(__LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("media-fault: unsent media system message not local")),function(e){switch(e.uploadStage){case _.UPLOAD_STAGE.INIT:case _.UPLOAD_STAGE.PREPARING:return _.MEDIA_DATA_STAGE.PREPARING;case _.UPLOAD_STAGE.UPLOADING:return _.MEDIA_DATA_STAGE.UPLOADING;case _.UPLOAD_STAGE.NEED_UPLOAD:return _.MEDIA_DATA_STAGE.NEED_UPLOAD;case _.UPLOAD_STAGE.ERROR_MISSING:return _.MEDIA_DATA_STAGE.ERROR_MISSING;case _.UPLOAD_STAGE.ERROR_TOO_LARGE:return _.MEDIA_DATA_STAGE.ERROR_TOO_LARGE;case _.UPLOAD_STAGE.UPLOADED:return _.MEDIA_DATA_STAGE.SENDING;case _.UPLOAD_STAGE.ERROR_FILE_NOT_READABLE:return _.MEDIA_DATA_STAGE.ERROR_FILE_NOT_READABLE;case _.UPLOAD_STAGE.FINALIZING:return _.MEDIA_DATA_STAGE.FINALIZING}}(t)):T(t):_.MEDIA_DATA_STAGE.PREPARING}function T(e){switch(e.downloadStage){case _.DOWNLOAD_STAGE.INIT:return _.MEDIA_DATA_STAGE.INIT;case _.DOWNLOAD_STAGE.EXISTS:return _.MEDIA_DATA_STAGE.EXISTS;case _.DOWNLOAD_STAGE.PREPARING:return _.MEDIA_DATA_STAGE.PREPARING;case _.DOWNLOAD_STAGE.REUPLOADING:return _.MEDIA_DATA_STAGE.REUPLOADING;case _.DOWNLOAD_STAGE.FETCHING:return _.MEDIA_DATA_STAGE.FETCHING;case _.DOWNLOAD_STAGE.PROCESSING:return _.MEDIA_DATA_STAGE.DECRYPTING;case _.DOWNLOAD_STAGE.NEED_POKE:return _.MEDIA_DATA_STAGE.NEED_POKE;case _.DOWNLOAD_STAGE.ERROR_MISSING:return _.MEDIA_DATA_STAGE.ERROR_MISSING;case _.DOWNLOAD_STAGE.ERROR_UNSUPPORTED:return _.MEDIA_DATA_STAGE.ERROR_UNSUPPORTED;case _.DOWNLOAD_STAGE.RESOLVED:return _.MEDIA_DATA_STAGE.RESOLVED;case _.DOWNLOAD_STAGE.PROGRESSIVE_READY:return _.MEDIA_DATA_STAGE.PROGRESSIVE_READY}}function v(){return A.apply(this,arguments)}function A(){return(A=(0,a.default)((function*(e){const t=yield p.default.createFromBase64Jpeg(e);return t.autorelease(),{resolvedPreview:t}}))).apply(this,arguments)}function C(){return P.apply(this,arguments)}function P(){return(P=(0,a.default)((function*(e){const{width:t,height:n}=yield(0,c.getImageWidthHeight)(e);return{aspectRatio:t/n}}))).apply(this,arguments)}t.MediaObject=class{constructor(){this._msgs=[],this._notifyTimer=new o.ShiftTimer((()=>{!function(e){const t={};E(t,e,_.FIELDS.RAW),E(t,e.contentInfo,e.contentFields()),e.mediaBlob&&(t.renderableUrl=e.mediaBlob.url());const n=e._msgs,r=n.length;for(let i=0;i<r;i++){const[r,a]=n[i];if(null!=r&&!a){if(r.type!==h.MSG_TYPE.CIPHERTEXT){t.mediaStage=S(r,e);for(let e=0;e<_.MSG_SPECIFIC_FIELDS.length;e++){const n=_.MSG_SPECIFIC_FIELDS[e];t[n]=r.get(_.MEDIA_TO_MSG[n])}t.type===h.MSG_TYPE.INTERACTIVE&&(t.type=y(r))}else{delete t.mediaStage;for(let e=0;e<_.MSG_SPECIFIC_FIELDS.length;e++)delete t[_.MSG_SPECIFIC_FIELDS[e]]}r.mediaData.set(t)}}for(let e=n.length-1;e>=0;e--)n[e][1]&&n.splice(e,1);const i=e._callOnConsolidate;!e._pendingChanges&&i&&(e._callOnConsolidate=null,i.forEach((e=>{e()})));e._saveMedia&&e._saveMedia(e)}(this),function(e){const t={};E(t,e,_.FIELDS.RAW),E(t,e.contentInfo,e.contentFields()),e.mediaBlob&&(t.renderableUrl=e.mediaBlob.url());const n=T(e);e._stickers=e._stickers.filter((e=>{let[t,n]=e;return!n})),e._stickers.forEach((e=>{let[r,a]=e;r.mediaData.set((0,i.default)((0,i.default)({},t),{},{mediaStage:n}))})),e._stickerPacks=e._stickerPacks.filter((e=>{let[t,n]=e;return!n})),e._stickerPacks.forEach((e=>{let[r,a]=e;r.mediaData.set((0,i.default)((0,i.default)({},t),{},{mediaStage:n}))})),!e._pendingChanges&&e._callOnConsolidate&&(e._callOnConsolidate.forEach((e=>{e()})),e._callOnConsolidate=null);e._saveMedia&&e._saveMedia(e)}(this)})),this._callOnConsolidate=null,this._keyedProcesses=null,this._pendingChangesCount=0,this._saveMedia=null,this._stickers=[],this._stickerPacks=[],this.entries=new d.MediaEntryList,this.downloadStage=_.DOWNLOAD_STAGE.INIT,this.uploadStage=_.UPLOAD_STAGE.INIT,this.userUploadAttemptCount=0,this.userDownloadAttemptCount=0,this.downloadPromise=null,this.uploadPromise=null,this.mediaBlob=null,this.size=void 0,this.loadedSize=void 0,this.filehash=void 0,this.contentInfo={},this.progressiveStage=void 0,this.parsedVcards=null}consolidate(e){return!!m(this,e)&&(this.notifyMsgsAsync(),!0)}clearBlob(e){const t=this.mediaBlob;t&&(this.mediaBlob=null,t.autorelease()),!0===(null==e?void 0:e.reset)&&this._resetDownloadLoadStage()}_resetDownloadLoadStage(){this.consolidate({downloadStage:_.DOWNLOAD_STAGE.INIT})}contentFields(){const e=this.type||_.TYPE.DOCUMENT;return _.FIELDS[e]}resolveWhenConsolidated(){return this._notifyTimer.ts||this._pendingChanges?new Promise((e=>{this._callOnConsolidate?this._callOnConsolidate.push(e):this._callOnConsolidate=[e]})):Promise.resolve()}notifyMsgsAsync(){this._notifyTimer.debounce(0)}addMsg(e){const t=this._msgs;for(let n=0;n<t.length;n++){const[r,i]=t[n];r!==e||i||(__LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("redundant-media-msg"))}t.push([e,!1]),this.notifyMsgsAsync()}removeMsg(e){const t=this._msgs;let n=!1;for(let r=0;!n&&r<t.length;r++){const[i,a]=t[r];i!==e||a||(t[r][1]=!0,n=!0)}}hasAssociatedMsgsOrStickers(){const e=this._msgs;for(let t=0;t<e.length;t++)if(!e[t][1])return!0;return this.hasAssociatedStickers()||this.hasAssociatedStickerPacks()}associatedMsgs(){const e=this._msgs,t=[];for(let n=0;n<e.length;n++){const[r,i]=e[n];i||t.push(r)}return t}rmr(e){var t=this;return(0,a.default)((function*(){if(t.associatedStickers().length>0){if(0===t.associatedMsgs().filter((e=>null!=e)).length)return Promise.resolve(200)}const[n]=t._msgs.find((e=>{let[t,n]=e;return!n&&!t.isUnsentPhoneMsg()}))||[null];if(n||(__LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("media-fault: rmr called on MediaObject with no msg")),!n)return Promise.reject(new Error("rmr called on MediaObject with no msg"));e.onMsgSelect(n);const r=yield(0,g.default)(n);if(200===r.status){const e=n.mediaData.type;if("unknown"===e)return Promise.reject(new Error("rmr called on MediaData with unknown type"));const i=r.isMD?t.entries.updateEntry({deprecatedMms3Url:n.deprecatedMms3Url,encFilehash:n.encFilehash,directPath:r.directPath}):t.entries.addEntry({deprecatedMms3Url:r.url,mediaKey:r.mediaKey||n.mediaKey,mediaKeyTimestamp:r.mediaKeyTimestamp,encFilehash:r.encFilehash,type:e,directPath:r.directPath,debugHint:"rmr"});i||(__LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("media-fault: rmr entry can not be found")),null==i||i.markWhetherOnServer(!0)}return r.status}))()}msgProps(e){const t={};E(t,this,_.FIELDS.RAW),E(t,this.contentInfo,this.contentFields()),E(t,e,_.MSG_SPECIFIC_FIELDS),t.preview=this.contentInfo._preview;const n={};for(const e in t){const r=_.MEDIA_TO_MSG[e];r&&(n[r]=t[e])}return n}delete(){this._saveMedia=null;const{cancelDownloadMedia:e,cancelUploadMedia:t}=n(644234);e(this),t(this),this.clearBlob()}runProcessIfNotRunBefore(e,t,n){let r=this._keyedProcesses;r||(r=this._keyedProcesses={}),r.hasOwnProperty(e)||(this._pendingChangesCount++,r[e]=Promise.resolve(n).then(t).then((e=>{this.consolidate(e)})).finally((()=>{this._pendingChangesCount--,0===this._pendingChangesCount&&this.notifyMsgsAsync()})))}getPendingProcess(e){return 0!==this._pendingChangesCount&&this._keyedProcesses&&this._keyedProcesses.hasOwnProperty(e)?this._keyedProcesses[e]:Promise.resolve()}videoStreamingInfo(e){var t=this;return(0,a.default)((function*(){if(t.type!==_.TYPE.VIDEO)return __LOG__(4,void 0,new Error,!0)`type: ${String(t.type)}`,void SEND_LOGS("media-fault: media streaming info request for non-video type");const n=t.entries.getDownloadEntry();if(!n||!n.sidecar)return null;const[r,a]=yield Promise.all([(0,l.default)(f.MEDIA_TYPES.VIDEO,n.mediaKey),n.url()]);return{cryptoKeys:(0,i.default)((0,i.default)({},r),{},{cipherKey:r.encKey,sidecar:n.sidecar}),streamData:{clientUrl:a,size:t.size,msgKey:e}}}))()}addStickerPack(e){const t=this._stickerPacks;for(let n=0;n<t.length;n++){const[r,i]=t[n];r!==e||i||(__LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("redundant-sticker-pack-add"))}t.push([e,!1]),this.notifyMsgsAsync()}addSticker(e){const t=this._stickers;for(let n=0;n<t.length;n++){const[r,i]=t[n];r!==e||i||(__LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("redundant-sticker-add"))}t.push([e,!1]),this.notifyMsgsAsync()}removeSticker(e){const t=this._stickers;let n=!1;for(let r=0;!n&&r<t.length;r++){const[i,a]=t[r];i!==e||a||(t[r][1]=!0,n=!0)}}removeStickerPack(e){const t=this._stickerPacks;let n=!1;for(let r=0;!n&&r<t.length;r++){const[i,a]=t[r];i!==e||a||(t[r][1]=!0,n=!0)}}hasAssociatedStickers(){return this._stickers.some((e=>{let[t,n]=e;return!n}))}hasAssociatedStickerPacks(){return this._stickerPacks.some((e=>{let[t,n]=e;return!n}))}associatedStickers(){return this._stickers.reduce(((e,t)=>{let[n,r]=t;return r?e:e.concat(n)}),[])}associatedStickerPacks(){return this._stickerPacks.reduce(((e,t)=>{let[n,r]=t;return r?e:e.concat(n)}),[])}toJSON(){return{mediaBlob:this.mediaBlob,size:this.size,filehash:this.filehash,type:this.type,contentInfo:this.contentInfo,downloadStage:this.downloadStage,uploadStage:this.uploadStage}}}},328793:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=r(n(348926)),o=n(293594),s=n(990445),l=n(402994),u=n(588750),c=n(299261),d=n(677332),p=r(n(507511)),_=n(862159),f=Y(n(428363)),h=r(n(116253)),g=n(232294),m=r(n(245655)),y=r(n(104120)),E=r(n(842156)),S=n(196127),T=n(901959),v=n(102645),A=n(709089),C=r(n(756680)),P=Y(n(231385)),O=n(172259),I=r(n(855118)),M=r(n(820275)),b=n(97858),R=n(708761),N=r(n(565754)),w=n(373070),L=n(257630),D=n(411562),k=n(241588),U=n(411067),G=r(n(79291)),x=n(459857),B=r(n(571834)),F=r(n(441143));function j(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(j=function(e){return e?n:t})(e)}function Y(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=j(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function K(e,t){return"product"===t.type?B.default.DOWNLOAD_ORIGIN_TYPE.PRODUCT_CATALOG:(0,U.unproxy)(e).isGroup?B.default.DOWNLOAD_ORIGIN_TYPE.CHAT_GROUP:B.default.DOWNLOAD_ORIGIN_TYPE.CHAT_PERSONAL}function H(e){return k.ServerProps.webUploadDocumentThumbMmsEnabled&&e===R.MEDIA_TYPES.DOCUMENT}function W(){return V.apply(this,arguments)}function V(){return(V=(0,a.default)((function*(e,t,r,o){var d;__LOG__(2)`Media:sendToChat chat ${t.id.toString()}`;const{caption:h,footer:k}=r,U=r.quotedMsg?r.quotedMsg.msgContextInfo(t.id):{},j=(0,x.getMeUser)(),Y=r.productMsgOptions||{};let W,V,$,z;t.isUser||(W=j),(0,c.isEphemeralSettingOn)(t)&&(V=(0,c.getEphemeralSetting)(t));const q=(0,c.getEphemeralSettingTimestamp)(t);null!=q&&($=q);const J=(0,c.getDisappearingModeInitiator)(t);let Q;if(null!=J&&(z=J),t.isGroup){const e=n(318797).default,r=yield e.find(t.id),i=(null==r?void 0:r.groupType)===_.GroupType.DEFAULT_ANNOUNCEMENT_GROUP,a=null==r?void 0:r.participants.iAmAdmin();(0,b.adminIncludeMessageSecretInCag)()&&i&&a&&(Q=self.crypto.getRandomValues(new Uint8Array(32)))}const X=(0,i.default)({t:(0,s.unixTime)(),from:j,isNewMsg:!0,to:t.id,self:"out",type:null!==(d=r.type)&&void 0!==d?d:e._baseType,ack:l.ACK.CLOCK,local:!0,id:new N.default({from:j,to:t.id,id:N.default.newId(),participant:W,selfDir:"out"}),caption:h,footer:k,quotedMsg:U.quotedMsg,quotedParticipant:U.quotedParticipant,quotedStanzaID:U.quotedStanzaID,quotedRemoteJid:U.quotedRemoteJid,mentionedJidList:r.mentionedJidList,isForwarded:r.isForwarded,forwardingScore:r.forwardingScore,multicast:r.multicast,forwardedFromWeb:r.forwardedFromWeb,ctwaContext:r.ctwaContext,ephemeralDuration:V,ephemeralSettingTimestamp:$,disappearingModeInitiator:z,messageSecret:Q,isAvatar:r.isAvatar},Y);r.type===w.MSG_TYPE.DOCUMENT&&(0,b.documentWithCaptionsSendEnabled)()&&Boolean(r.caption)&&(X.isCaptionByUser=!0);const Z=e.waitForPrep().then((e=>{const t=e.mediaBlob;return!t||t instanceof C.default?e:C.default.createFromData(t,t.type).then((t=>(e.mediaBlob=t,e)))})).then((e=>{const n=e.filehash;n||(__LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("media-fault: sendToChat filehash undefined"));const i=P.getOrCreateMediaObject(n),a=i.mediaBlob;a&&(a.retain(),e.mediaBlob instanceof C.default&&e.mediaBlob.autorelease(),e.mediaBlob=a),e.mediaBlob instanceof C.default&&(e.renderableUrl=e.mediaBlob.url()),i.consolidate(e.toJSON()),e.mediaBlob instanceof C.default&&e.mediaBlob.autorelease();if((0,g.shouldUseMediaCache)((0,R.castToV4)(i.type))&&e.mediaBlob instanceof C.default){const t=e.mediaBlob.formData();S.MediaBlobCache.put(n,t)}(0,v.downloadMedia)({mimetype:e.mimetype,mediaObject:i,downloadEvenIfExpensive:!0,mediaType:(0,R.msgToMediaType)({type:e.type,isGif:e.isGif}),rmrReason:B.default.WEBC_RMR_REASON_CODE.SEND_TO_CHAT,downloadOrigin:K(t,X),mode:"manual"});const o=i.msgProps(e);return o.caption=h,(0,b.documentWithCaptionsSendEnabled)()||h||e.type!==O.OUTWARD_TYPES.DOCUMENT||(o.caption=e.filename),r.isViewOnce&&(o.isViewOnce=!0),o}));let ee,te,ne;function re(){return ie.apply(this,arguments)}function ie(){return(ie=(0,a.default)((function*(e){ee=e;const{mediaObject:n}=e;n||(__LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("media-fault: incorrect media object for created msg")),(0,F.default)(n,"msg is missing mediaObject");const r=(0,R.msgToMediaType)(e),a=n.entries.getUploadEntry(),l=a?{key:a.mediaKey,timestamp:a.mediaKeyTimestamp}:(0,p.default)();let{fullPreviewData:c,fullPreviewSize:d}=n.contentInfo,_=e.body;if(H(r)&&!c&&n.contentInfo.preview){const e=yield f.base64ImageToCanvas(n.contentInfo.preview.url()),t=yield(0,u.generateMicroThumb)(e,1300,{mimetype:"image/jpeg",maxAttempts:10});c=n.contentInfo.preview,d={width:t.width,height:t.height},_=G.default.parseDataURL(t.dataUrl).data}const h=c&&d&&H(r),g=e.safe(),S=c&&h&&g.type===w.MSG_TYPE.DOCUMENT?(0,M.default)({thumbnail:c,mediaKeyInfo:l,mediaType:(0,y.default)(g),uploadOrigin:(0,E.default)(t),forwardedFromWeb:Boolean(e.forwardedFromWeb),isViewOnce:Boolean(e.isViewOnce)}):Promise.resolve(null),v=(0,A.uploadMedia)({mimetype:e.mimetype,mediaObject:n,mediaType:r,forwardedFromWeb:Boolean(e.forwardedFromWeb),uploadOrigin:(0,E.default)(t),mediaKeyInfo:l,isViewOnce:Boolean(e.isViewOnce),earlyUpload:o}),{filehash:C}=n;(0,T.shouldUseMediaKeyCache)()&&null!=C&&T.MediaKeyCache.put(C,l);const[{kind:P,mediaEntry:O},b]=yield Promise.all([v,S]);(0,m.default)(r)&&n.clearBlob({reset:!0});const N=null==b?void 0:b.mediaEntry;if(te=P,!O)throw new Error("upload failed: media entry was not created");(0,T.shouldUseMediaKeyCache)()&&null!=C&&T.MediaKeyCache.delete(C);let L={};if(h){if(!(N&&b&&d)){const e={thumbnailResultEntry:N,uploadThumbnailResult:b,fullPreviewSize:d};throw __LOG__(4,void 0,new Error,!0)`upload failed: thumbnail data incomplete\nDebug info:${JSON.stringify(e)}`,SEND_LOGS("mms-thumbnail-data-incomplete"),new Error("upload failed: thumbnail data incomplete")}L={thumbnailDirectPath:N.directPath,thumbnailSha256:b.filehash,thumbnailEncSha256:N.encFilehash,thumbnailHeight:d.height,thumbnailWidth:d.width}}return(0,I.default)(ee,(0,i.default)({deprecatedMms3Url:O.deprecatedMms3Url,directPath:O.directPath,mediaKey:O.mediaKey,mediaKeyTimestamp:O.mediaKeyTimestamp,filehash:n.filehash,encFilehash:O.encFilehash,size:n.size,streamingSidecar:O.sidecar,firstFrameSidecar:O.firstFrameSidecar,body:_,stickerSentTs:(0,s.unixTimeMs)()},L))}))).apply(this,arguments)}if(r.addEvenWhilePreparing){const e=r.placeholderProps||{};ne=(0,L.addAndSendMsgToChat)(t,(0,i.default)((0,i.default)({},e),X),(e=>(ee=e,Z.then((e=>(0,I.default)(ee,e))).then((()=>re(ee))))))[1]}else{const e=Z.then((e=>{const t=r.useBasePropsType?X.type:e.type;return(0,i.default)((0,i.default)((0,i.default)({},X),e),{},{type:t})}));ne=(0,L.addAndSendMsgToChat)(t,e,re)[1]}return ne.then((e=>({result:e,error:null}))).catch((e=>({result:null,error:e}))).then((e=>{var t,r;let{result:i,error:a}=e;if(i===D.SendMsgResult.OK)return ee.type===O.OUTWARD_TYPES.STICKER&&!0!==ee.isAvatar&&n(951220).RecentStickerCollectionMd.addStickerWithMediaData(ee.mediaData,ee.id.toString(),ee.stickerSentTs),D.SendMsgResult.OK;const o=null===(t=ee)||void 0===t||null===(r=t.mediaObject)||void 0===r?void 0:r.uploadStage;if(ee&&(ee.ack=l.ACK.FAILED),te===A.UploadMediaResultKind.CANCELLATION)return __LOG__(2)`Media:sendToChat canceled`,D.SendMsgResult.ERROR_CANCELLED;if(__LOG__(3)`Media:sendToChat error\nresult: ${i}\nuploadStage: ${o}\nuploadResultKind: ${te}\nerror: ${String(a)}`,null!=o)switch(o){case O.UPLOAD_STAGE.NEED_UPLOAD:case O.UPLOAD_STAGE.ERROR_TOO_LARGE:return D.SendMsgResult.ERROR_UPLOAD;case O.UPLOAD_STAGE.ERROR_MISSING:return D.SendMsgResult.ERROR_EXPIRED}return te===A.UploadMediaResultKind.ERROR?D.SendMsgResult.ERROR_UPLOAD:null!=i?i:D.SendMsgResult.ERROR_UNKNOWN}))}))).apply(this,arguments)}t.default=class{constructor(e,t){this._baseType=e,this._mediaData=new h.default({mediaStage:O.MEDIA_DATA_STAGE.PREPARING}),this._prepwork=t.then((e=>{if(this._mediaData.set(e),!e.filehash)return e.mediaBlob||(__LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("media-fault: no hash or blob")),(0,d.calculateFilehashFromBlob)(e.mediaBlob).then((e=>{this._mediaData.filehash=e}))}),(e=>{throw this._mediaData.mediaStage=O.MEDIA_DATA_STAGE.ERROR_UNSUPPORTED,e}))}sendToChat(e,t,n){return(0,o.promiseCallSync)(W,null,this,e,t,n)}waitForPrep(){var e=this;return(0,a.default)((function*(){return yield e._prepwork,e._mediaData}))()}}},231385:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.associateMediaWithMsg=function(e,t){e.addMsg(t)},t.associateMediaWithSticker=function(e,t){e.addSticker(t)},t.associateMediaWithStickerPack=function(e,t){e.addStickerPack(t)},t.clearMediaForChat=function(){},t.delistAndDeleteAllMedia=function(){const e=s;s={};for(const t in e)e[t].delete()},t.disassociateMediaFromMsg=function(e,t){if(t.mediaObject=null,e.removeMsg(t),e.hasAssociatedMsgsOrStickers())return;const{filehash:n}=e;n&&delete s[n];n&&(0,r.shouldUseLruMediaStore)((0,o.msgToMediaType)(t))&&a.LruMediaStore.del(n);e.delete()},t.disassociateMediaFromSticker=function(e,t){if(t.mediaObject=null,e.removeSticker(t),e.hasAssociatedMsgsOrStickers())return;const{filehash:n}=e;n&&delete s[n];n&&a.LruMediaStore.del(n);e.delete()},t.disassociateMediaFromStickerPack=function(e,t){if(t.mediaObject=null,e.removeStickerPack(t),e.hasAssociatedMsgsOrStickers())return;const{filehash:n}=e;n&&delete s[n];n&&a.LruMediaStore.del(n);e.delete()},t.getOrCreateMediaObject=function(e){if(s.hasOwnProperty(e))return s[e];return s[e]=new i.MediaObject};var r=n(232294),i=n(189123),a=n(719621),o=n(708761);let s={}},172259:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UPLOAD_STAGE=t.TYPE=t.OUTWARD_TYPES=t.MSG_TO_MEDIA=t.MSG_SPECIFIC_FIELDS=t.MEDIA_TO_MSG=t.MEDIA_MSG_PROPS=t.MEDIA_DATA_STAGE=t.MAPPED_STICKER_PROPS=t.MAPPED_MSG_PROPS=t.FIELDS=t.DOWNLOAD_STAGE=void 0;const r=Object.freeze({preview:"body",mediaKey:"mediaKey",mediaKeyTimestamp:"mediaKeyTimestamp",size:"size",filehash:"filehash",mimetype:"mimetype",duration:"duration",pageCount:"pageCount",fullHeight:"height",fullWidth:"width",type:"type",filename:"filename",caption:"caption",isGif:"isGif",gifAttribution:"gifAttribution",sidecar:"streamingSidecar",subtype:"subtype",firstFrameLength:"firstFrameLength",firstFrameSidecar:"firstFrameSidecar",isAnimated:"isAnimated",isVcardOverMmsDocument:"isVcardOverMmsDocument",isViewOnce:"isViewOnce",waveform:"waveform",staticUrl:"staticUrl"});t.MEDIA_TO_MSG=r;const i=Object.freeze({body:"preview",directPath:"directPath",mediaKey:"mediaKey",mediaKeyTimestamp:"mediaKeyTimestamp",size:"size",filehash:"filehash",mimetype:"mimetype",duration:"duration",pageCount:"pageCount",height:"fullHeight",width:"fullWidth",type:"type",filename:"filename",caption:"caption",isGif:"isGif",gifAttribution:"gifAttribution",streamingSidecar:"sidecar",subtype:"subtype",firstFrameLength:"firstFrameLength",firstFrameSidecar:"firstFrameSidecar",isAnimated:"isAnimated",isVcardOverMmsDocument:"isVcardOverMmsDocument",isViewOnce:"isViewOnce",waveform:"waveform",staticUrl:"staticUrl",stickerPackId:"stickerPackId",stickerPackName:"stickerPackName",stickerPackPublisher:"stickerPackPublisher"});t.MSG_TO_MEDIA=i;const a=Object.keys(i);t.MAPPED_MSG_PROPS=a;t.MAPPED_STICKER_PROPS=["filehash","height","mimetype","size","type","width","stickerPackId","stickerPackName","stickerPackPublisher"];const o=[...a,"deprecatedMms3Url","encFilehash","streamable"];t.MEDIA_MSG_PROPS=o;const s=Object.freeze({VIDEO:Object.freeze(["aspectRatio","fullWidth","fullHeight","preview","duration","durationFloat","isViewOnce","fullPreviewData","staticUrl"]),AUDIO:Object.freeze(["duration","waveform"]),IMAGE:Object.freeze(["aspectRatio","fullWidth","fullHeight","preview","isViewOnce","fullPreviewData","staticUrl"]),PRODUCT:Object.freeze(["aspectRatio","fullWidth","fullHeight","preview"]),STICKER:Object.freeze(["animationDuration","singleLoopDuration","emojis","firstFrameLength","firstFrameSidecar","isAnimated","isFirstParty","isFromStickerMaker","stickerPackId","stickerPackName","stickerPackPublisher","fullWidth","fullHeight","preview","rgbaBuffer","rgbaWidth","rgbaHeight","aspectRatio"]),STICKER_PACK:Object.freeze([]),DOCUMENT:Object.freeze(["aspectRatio","pageCount","preview","isVcardOverMmsDocument","parsedVcards","fullPreviewData","fullPreviewSize"]),RAW:Object.freeze(["mediaBlob","size","loadedSize","filehash","progressiveStage"]),BIZ_COVER_PHOTO:Object.freeze([])});t.FIELDS=s;t.MSG_SPECIFIC_FIELDS=["type","filename","caption","isGif","gifAttribution","mimetype","pageCount","sidecar","subtype","isViewOnce"];const l=n(76672).Mirrored(["INIT","EXISTS","PREPARING","REUPLOADING","FETCHING","PROCESSING","NEED_POKE","ERROR_MISSING","ERROR_UNSUPPORTED","PROGRESSIVE_READY","RESOLVED"]);t.DOWNLOAD_STAGE=l;const u=n(76672).Mirrored(["INIT","PREPARING","UPLOADING","FINALIZING","NEED_UPLOAD","ERROR_FILE_NOT_READABLE","ERROR_MISSING","ERROR_TOO_LARGE","UPLOADED"]);t.UPLOAD_STAGE=u;const c=n(76672).Mirrored(["INIT","EXISTS","PREPARING","UPLOADING","FINALIZING","SENDING","REUPLOADING","FETCHING","DECRYPTING","RESOLVED","NEED_POKE","NEED_UPLOAD","ERROR_FILE_NOT_READABLE","ERROR_MISSING","ERROR_TOO_LARGE","ERROR_UNSUPPORTED","PROGRESSIVE_READY","REMOTE_UPLOADING","REMOTE_NEED_UPLOAD"]);t.MEDIA_DATA_STAGE=c;t.OUTWARD_TYPES={IMAGE:"image",VIDEO:"video",AUDIO:"audio",PTT:"ptt",STICKER:"sticker",DOCUMENT:"document",PRODUCT:"product",BIZ_COVER_PHOTO:"biz-cover-photo",UNKNOWN:"unknown"};const d=Object.freeze({VIDEO:"VIDEO",IMAGE:"IMAGE",AUDIO:"AUDIO",STICKER:"STICKER",DOCUMENT:"DOCUMENT",PRODUCT:"PRODUCT",BIZ_COVER_PHOTO:"BIZ_COVER_PHOTO"});t.TYPE=d},855118:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return o.apply(this,arguments)};var i=r(n(348926)),a=n(403688);function o(){return(o=(0,i.default)((function*(e,t){yield(0,a.updateLocal)(e.id,t),e.set(t)}))).apply(this,arguments)}},820275:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return _.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(88237),s=n(643930),l=r(n(589970)),u=n(975175),c=n(677332),d=n(709089),p=n(189123);r(n(571834));function _(){return(_=(0,a.default)((function*(e){const{thumbnail:t,mediaType:n,mediaKeyInfo:r,uploadOrigin:_,forwardedFromWeb:f,timeout:h,signal:g,isViewOnce:m}=e,y=new p.MediaObject;try{return null==h?yield E():yield(0,u.promiseTimeout)(E(),h)}catch(e){const t=e;if(t instanceof s.TimeoutError)return(0,d.cancelUploadMedia)(y),{kind:d.UploadMediaResultKind.TIMEOUT};throw t}function E(){return S.apply(this,arguments)}function S(){return(S=(0,a.default)((function*(){try{const e=yield(0,l.default)((0,c.calculateFilehashFromBlob)(t),g);y.filehash=e,y.mediaBlob=t;const a=yield(0,l.default)((0,d.uploadMedia)({mimetype:"image/jpeg",mediaObject:y,mediaType:n,forwardedFromWeb:f,uploadOrigin:_,mediaKeyInfo:r,isViewOnce:m}),g);return a.kind===d.UploadMediaResultKind.SUCCESS?(0,i.default)((0,i.default)({},a),{},{filehash:e}):{kind:a.kind}}catch(e){const t=e;if("object"==typeof t&&(null==t?void 0:t.name)===o.ABORT_ERROR)return(0,d.cancelUploadMedia)(y),{kind:d.UploadMediaResultKind.CANCELLATION}}}))).apply(this,arguments)}}))).apply(this,arguments)}},774317:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const n=Promise.resolve().then((()=>{var n;const r=e.size();let u;u=t.asDocument?i.FILETYPE.DOCUMENT:t.asSticker?i.FILETYPE.STICKER:(0,i.typeFromMimetype)(e.type());const c=null!==(n=t.isVcardOverMmsDocument)&&void 0!==n&&n;if(r>function(e,t){if(e===i.FILETYPE.DOCUMENT)return t?1024*l.ServerProps.vcardMaxSizeKb:(0,l.getMaxFilesSizeServerProp)();return l.ServerProps.media}(u,c))throw new o.default(e);if(r<=0)throw new s.MediaFileEmpty;let d;switch(null!=t.gifAttribution?d=t.gifAttribution:t.asGif&&(d=0),u){case"image":return a.processRawImage(e,{minDimension:t.minDimension,transparency:t.transparency});case"sticker":return a.processRawSticker(e);case"video":case"audio":return a.processRawAudioVideo(e,!!t.isPtt,t.precomputedFields,t.asGif,d,e.type());case"document":return a.processRawDocument(e,t.filename,c,t.documentPageCount);default:throw new Error("Received unsupported mediaType: "+u)}}));return e.retain(),e.autoreleaseWhenPromiseCompletes(n),n};var i=n(698210),a=c(n(232294)),o=r(n(409701)),s=c(n(288057)),l=n(241588);function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function c(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}},994451:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.RequestMediaReuploadManagerImpl=t.RequestMediaReuploadManager=void 0;var i=r(n(348926)),a=r(n(132375)),o=r(n(808279));class s{constructor(){var e=this;this._rmrRequests=new Map,this.requestMediaReupload=function(){var t=(0,i.default)((function*(t){const n=t.id.id,r=e._rmrRequests.get(n);if(r)return(0,a.default)(r.request,"existingRequest.request");const i=new Promise(((r,i)=>{e._rmrRequests.set(n,{resolve:r,reject:i,msg:t})}));return(0,a.default)(e._rmrRequests.get(n),"_this._rmrRequests.get(msgId)").request=i,yield(0,o.default)(t),i}));return function(){return t.apply(this,arguments)}}(),this.resolveMediaReupload=e=>{let{msgId:t,result:n,directPath:r}=e;const i=this._rmrRequests.get(t);null!=i?(i.resolve({result:n,directPath:r}),this._rmrRequests.delete(t)):__LOG__(3)`resolveMediaReupload: msgId (${t}) is not found in _rmrRequests`},this.getMediaKey=e=>{var t;return null===(t=this._rmrRequests.get(e))||void 0===t?void 0:t.msg.mediaKey}}}t.RequestMediaReuploadManagerImpl=s;const l=new s;t.RequestMediaReuploadManager=l},887927:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,r.unixTime)()-e<i.ServerProps.mmsMediaKeyTTL+Math.floor(86400*Math.random())};var r=n(990445),i=n(241588)},920733:(e,t)=>{"use strict";function n(e){if(!e)return e;const t=e.replace(/[\u202a-\u202e\u2066-\u2069\u200E\u200F\u061C]/g,"<22>"),n=t.split(".");if(1===n.length)return t;for(let e=n.length-1;e>0;e--){const t=n[e].trim();if(t.length)return n.slice(0,e).join(".")+"."+t}return t}Object.defineProperty(t,"__esModule",{value:!0}),t.cleanFilename=n,t.cleanIncomingFilename=function(e){if(!e)return e;const t=n(e);if(e!==t&&t){const e=t.split("."),n=e.length>=2&&e.pop();["bat","exe","cmd","com","lnk","pif","scr","vb","vbe","vbs","wsh","js","ps1","hta","sh","csh","msi","app","scpt","applescript","reg","vbe","wsf","sct"].includes(n)&&__LOG__(2,!0)`cleanIncomingFilename:extension: ${n||""}`}return t}},232294:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.canPlayOgg=function(){return!!S.canPlayOgg},t.decodeWebpToRGBANoOpaque=B,t.fetchMedia=function(){return X.apply(this,arguments)},t.gatherAndSetMetadata=function(){return Z.apply(this,arguments)},t.gatherAndSetMetadataNoOpaque=function(){return ee.apply(this,arguments)},t.getImageWidthHeight=function(e){return Q(function(){var t=(0,a.default)((function*(t){t(e);const n=new Image;return yield new Promise(((t,r)=>{n.onload=t,n.onabort=()=>{r(new Error("getImageWidthHeight onabort"))},n.onerror=()=>{r(new Error("getImageWidthHeight onerror"))},n.src=e.url()})),{width:n.naturalWidth,height:n.naturalHeight}}));return function(){return t.apply(this,arguments)}}())},t.getRawDocumentMimetype=z,t.getResizedThumbData=function(e,t){return new Promise((n=>{const r=new Image;r.setAttribute("crossorigin","anonymous"),r.onload=()=>{const e=t.map((e=>{let{width:t,height:n,minWidth:i,minHeight:a,imageFormat:o,imageFormatOptions:s,keepAspectRatio:l}=e;if(null!=i&&r.width<i||null!=a&&r.height<a)return null;const u=document.createElement("canvas"),c=u.getContext("2d");let d,p,_=0,f=0;if(r.height>r.width){d=t,p=r.height/r.width*t,f=-(p-n)/2}else{p=n,d=r.width/r.height*n,_=-(d-t)/2}return l?(u.width=d,u.height=p):(u.width=t,u.height=n),c.drawImage(r,_,f,d,p),{dataUrl:u.toDataURL(o,s).replace("data:image/jpeg;base64,",""),width:u.width,height:u.height}}));n(e)},r.src=e}))},t.opaqueDataToArrayBuffer=function(e){return Q((t=>{t(e);const n=e.getBlob();if(n)return x(n);const r=(0,l.default)(e.getBase64(),"b64 should be defined");return(0,o.decodeB64)(r)}))},t.parseWebpNoOpaque=j,t.processRawAudioVideo=function(){return $.apply(this,arguments)},t.processRawDocument=function(){return J.apply(this,arguments)},t.processRawImage=function(){return W.apply(this,arguments)},t.processRawSticker=function(){return V.apply(this,arguments)},t.shouldUseLruMediaStore=function(e){const t=e===O.MEDIA_TYPES.STICKER||e===O.MEDIA_TYPES.IMAGE,n=e===O.MEDIA_TYPES.AUDIO||e===O.MEDIA_TYPES.DOCUMENT||e===O.MEDIA_TYPES.GIF||e===O.MEDIA_TYPES.PPIC||e===O.MEDIA_TYPES.PRODUCT||e===O.MEDIA_TYPES.PTT||e===O.MEDIA_TYPES.VIDEO||e===O.MEDIA_TYPES.TEMPLATE||e===O.MEDIA_TYPES.THUMBNAIL_DOCUMENT||e===O.MEDIA_TYPES.THUMBNAIL_IMAGE||e===O.MEDIA_TYPES.THUMBNAIL_LINK||e===O.MEDIA_TYPES.THUMBNAIL_VIDEO;return t||n},t.shouldUseMediaCache=function(e){return e===O.MEDIA_TYPES.STICKER||e===O.MEDIA_TYPES.IMAGE||e===O.MEDIA_TYPES.PRODUCT||e===O.MEDIA_TYPES.PTT||e===O.MEDIA_TYPES.AUDIO},t.videoWidthHeightDuration=function(e){return Q((t=>(t(e),S.videoWidthHeightDuration(e.forceToBlob()))))};var i=r(n(81109)),a=r(n(348926)),o=n(417405),s=n(924583),l=r(n(132375)),u=n(293594),c=n(204597),d=n(588750),p=r(n(846870)),_=r(n(945583)),f=U(n(48474)),h=n(868607),g=n(698210),m=U(n(428363)),y=n(47814),E=n(920733),S=U(n(197636)),T=r(n(756680)),v=n(172259),A=n(937484),C=U(n(288057)),P=n(97858),O=n(708761),I=r(n(809572)),M=n(241588),b=r(n(79291)),R=n(105284),N=r(n(571834)),w=n(724743),L=r(n(794938)),D=r(n(397769));function k(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(k=function(e){return e?n:t})(e)}function U(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=k(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}function G(e){return new Promise(((t,n)=>{const r=new Image,i=window.URL.createObjectURL(e);r.onload=()=>{const e={width:r.naturalWidth,height:r.naturalHeight};window.URL.revokeObjectURL(i),t(e)},r.onabort=()=>{window.URL.revokeObjectURL(i),n(new Error("getImageWidthHeight onabort"))},r.onerror=()=>{window.URL.revokeObjectURL(i),n(new Error("getImageWidthHeight onerror"))},r.src=i}))}function x(e){return(0,g.blobToArrayBuffer)(e).catch((e=>{throw __LOG__(3)`MediaUtils error: ${e}`,e}))}function B(){return F.apply(this,arguments)}function F(){return(F=(0,a.default)((function*(e){const t=yield x(e);return(0,_.default)(t)}))).apply(this,arguments)}function j(){return Y.apply(this,arguments)}function Y(){return(Y=(0,a.default)((function*(e){const t=yield x(e);return(0,w.parseWebp)(t)}))).apply(this,arguments)}function K(e){return S.videoWidthHeightDuration(e)}function H(e,t){return Q(function(){var n=(0,a.default)((function*(n){n(e);const r=yield S.transcode(e.forceToBlob(),t).then((e=>T.default.createFromData(e,e.type)));return n(r),r.autorelease(),r}));return function(){return n.apply(this,arguments)}}())}function W(){return(W=(0,a.default)((function*(e,t){const{transparency:n,minDimension:r}=null!=t?t:{},i=e.forceToBlob(),{width:a,height:o,images:s}=yield m.rotateAndResize(i,M.ServerProps.imageMaxEdge,m.BLOB|m.CANVAS,{transparency:n,minDimension:r}),{images:l}=yield m.rotateAndResize(s.canvas,p.default.IMG_THUMB_MAX_EDGE,m.DATA_URL|m.CANVAS),u=(0,d.getResizedDataUrl)(l.canvas,"image/jpeg",2e4),c=u?b.default.parseDataURL(u).data:null;return c||__LOG__(2)`processRawImage: Failed to reach max thumbnail size, preview will be null`,{type:v.OUTWARD_TYPES.IMAGE,mediaBlob:s.blob,mimetype:s.blob.type,fullWidth:a,fullHeight:o,preview:c}}))).apply(this,arguments)}function V(){return(V=(0,a.default)((function*(e){const t=e.forceToBlob(),{width:n,height:r,images:i}=yield m.rotateAndResize(t,M.ServerProps.imageMaxEdge,m.BLOB,{transparency:!0}),a=yield m.toWebpSticker(i.blob),o=yield T.default.createFromData(a,a.type);return{type:v.OUTWARD_TYPES.STICKER,mediaBlob:o,mimetype:a.type,fullWidth:n,fullHeight:r}}))).apply(this,arguments)}function $(){return($=(0,a.default)((function*(e,t,n,r,a){var o;const s=e.forceToBlob(),l=new N.default.VideoTranscoder({sourceHeight:null==n?void 0:n.fullHeight,sourceWidth:null==n?void 0:n.fullWidth,sourceDuration:null==n?void 0:n.duration,sourceFileSize:e.size(),sourceFormat:!0===r?N.default.VIDEO_TRANSCODER_SOURCE_FORMAT_TYPE.GIF:N.default.VIDEO_TRANSCODER_SOURCE_FORMAT_TYPE.VIDEO});l.startTranscoderT();const u=yield(0,y.checkAndRepair)(s,!!r);if(l.markTranscoderT(),!u)throw l.set({transcoderResult:N.default.VIDEO_TRANSCODER_RESULT_TYPE.FAILED}),l.commit(),__LOG__(3)`processRawAudioVideo bad video file ${s.type}`,new C.InvalidMediaFileType;const c=u.type,d=u.file;l.set({targetFileSize:d.size});const _=!0===r||!0===u.isGif;switch((0,g.typeFromMimetype)(c)){case g.FILETYPE.VIDEO:if(t)throw l.set({transcoderResult:N.default.VIDEO_TRANSCODER_RESULT_TYPE.FAILED}),l.commit(),__LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("media-fault: ptt became video"),new C.InvalidMediaFileType;l.set({targetFormat:N.default.VIDEO_TRANSCODER_TARGET_FORMAT_TYPE.VIDEO,transcoderResult:N.default.VIDEO_TRANSCODER_RESULT_TYPE.SUCCEEDED});const e={type:v.OUTWARD_TYPES.VIDEO,mediaBlob:d,mimetype:c,isGif:_,gifAttribution:_?a||0:void 0};if(n&&null!=n.duration&&null!=n.fullHeight&&0!==n.fullHeight&&null!=n.fullWidth&&0!==n.fullWidth&&n.preview){const{duration:t}=n;return l.set({sourceHeight:n.fullHeight,sourceWidth:n.fullWidth,sourceDuration:t}),l.commit(),(0,i.default)((0,i.default)({},e),{},{fullWidth:n.fullWidth,fullHeight:n.fullHeight,preview:n.preview,duration:t.toString()})}const{duration:r,thumbs:[s,u]}=yield m.generateVideoThumbsAndDuration({file:d,maxDimensions:[p.default.IMG_THUMB_MAX_EDGE,p.default.VIDEO_THUMB_MAX_EDGE],debugHint:"processRawAudioVideo"}),f=yield T.default.createFromBase64Jpeg(b.default.parseDataURL(u.url).data);return l.set({sourceHeight:s.fullHeight,sourceWidth:s.fullWidth,sourceDuration:r}),l.commit(),(0,i.default)((0,i.default)({},e),{},{fullWidth:s.fullWidth,fullHeight:s.fullHeight,preview:b.default.parseDataURL(s.url).data,fullPreviewData:f,duration:r.toString()});case g.FILETYPE.AUDIO:const h=null!==(o=null==n?void 0:n.duration)&&void 0!==o?o:yield(0,g.getAudioDuration)(d);return{type:t?v.OUTWARD_TYPES.PTT:v.OUTWARD_TYPES.AUDIO,mediaBlob:d,mimetype:c,duration:h.toString(),waveform:null==n?void 0:n.waveform};default:throw l.set({transcoderResult:N.default.VIDEO_TRANSCODER_RESULT_TYPE.FAILED}),l.commit(),__LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("media-fault: audio/video became other"),new Error(`audio/video became ${c}`)}}))).apply(this,arguments)}function z(){return q.apply(this,arguments)}function q(){return(q=(0,a.default)((function*(e,t){const n=e.type;if(n){if("*"===A.DOC_MIMES||A.DOC_MIMES.includes(n))return n;throw new C.InvalidMediaFileType(`disallowed mimetype ${n}`)}{const n=Math.min(A.MIMETYPE_DETERMINING_LENGTH,e.size),i=yield x(e.slice(0,n)),a=new Uint8Array(i);var r;if((0,A.isMsCompoundFileBinaryFormat)(a.subarray(0,8)))return null!=t&&null!==(r=(0,g.getMimeTypeForFilepath)(t))&&void 0!==r?r:A.MSCFB_MIME;const o=(0,D.default)(a);if(null==o?void 0:o.mime){const e=(0,A.isAllowedDocumentMimetype)(o.mime,t,!0);if(e)return e}else if(t){const e=(0,g.getMimeTypeForFilepath)(t);if(e)return e}throw new C.InvalidMediaFileType(`type: ${String(e.type)} name: ${String(t)}`)}}))).apply(this,arguments)}function J(){return(J=(0,a.default)((function*(e,t,n,r){var i,a;const o=e.forceToBlob(),s=(0,E.cleanFilename)(o.name||t||null),l=yield z(o,s),u=n?(0,g.blobToText)(o):null,[c,d]=yield Promise.all([f.enrich(o,l),u]),p=null!==(i=null==c||null===(a=c.microThumbnail)||void 0===a?void 0:a.dataUrl)&&void 0!==i?i:null==c?void 0:c.thumbUrl,_=p?b.default.parseDataURL(p).data:null;return{type:v.OUTWARD_TYPES.DOCUMENT,mediaBlob:yield T.default.createFromData(o,l),mimetype:l,filename:s||void 0,documentPreview:c,preview:_,fullPreviewData:null==c?void 0:c.fullPreviewData,fullPreviewSize:c?{width:c.width,height:c.height}:null,pageCount:null!=r?r:null==c?void 0:c.pdfPages,isVcardOverMmsDocument:n,parsedVcards:d?(0,R.parseMultiVcard)(d):null}}))).apply(this,arguments)}function Q(e){const t=[];return(0,u.promiseCallSync)(e,null,(function(e){e.retain(),t.push(e)})).finally((()=>{for(let e=0;e<t.length;e++)t[e].autorelease()}))}function X(){return(X=(0,a.default)((function*(e){const t=yield(0,I.default)(e,"GET",null,L.default.RESP_TYPE.ARRAY_BUFFER);return t?Promise.resolve({result:t.response,status:t.status}):Promise.resolve(null)}))).apply(this,arguments)}function Z(){return(Z=(0,a.default)((function*(e,t){let n,r;t.retain();try{switch(e.type){case v.TYPE.VIDEO:const i=t.forceToBlob(),{thumbs:[a],duration:o}=yield m.generateVideoThumbsAndDuration({file:i,maxDimensions:[p.default.VIDEO_THUMB_MAX_EDGE],debugHint:"gatherAndSetMetadata"});let s;(0,P.isHighQualityVideoThumbnailsEnabled)()&&(s=yield T.default.createFromBase64Jpeg(b.default.parseDataURL(a.url).data)),n={mediaBlob:t,renderableUrl:t.url(),fullWidth:a.fullWidth,fullHeight:a.fullHeight,duration:void 0!==o?`${Math.ceil(o)}`:void 0,durationFloat:o,fullPreviewData:s};break;case v.TYPE.AUDIO:const l=yield H(t);l.retain(),n={mediaBlob:l,renderableUrl:l.url()},r=()=>l.autorelease();break;default:e.type!==v.TYPE.IMAGE&&e.type!==v.TYPE.STICKER||(__LOG__(4,void 0,new Error,!0)`object type: ${e.type||""}`,SEND_LOGS("Entering gatherAndSetMetadata (with OpaqueData) unexpectedly")),n={mediaBlob:t,renderableUrl:t.url()}}e.consolidate(n)}catch(n){if(!(n instanceof C.MediaUnsupportedError))throw n;e.consolidate({mediaBlob:t,renderableUrl:t.url()})}finally{t.autorelease(),null!=r&&r()}}))).apply(this,arguments)}function ee(){return(ee=(0,a.default)((function*(e,t){const n=yield Promise.resolve().then((()=>{switch(e.type){case v.TYPE.VIDEO:return K(t).then((e=>({fullWidth:e.width,fullHeight:e.height,duration:void 0!==e.duration?`${Math.ceil(e.duration)}`:void 0,durationFloat:e.duration})));case v.TYPE.IMAGE:return null!=e.contentInfo.fullHeight&&null!=e.contentInfo.fullWidth&&e.size===t.size?null:G(t).then((e=>({fullWidth:e.width,fullHeight:e.height,size:t.size})));case v.TYPE.STICKER:return(0,h.detectWebpSupport)().then((e=>e?(0,c.promiseProps)({widthHeight:G(t),webpData:j(t)}).then((e=>({fullWidth:e.widthHeight.width,fullHeight:e.widthHeight.height,animationDuration:e.webpData.animationDuration,firstFrameLength:e.webpData.firstFrameLength,singleLoopDuration:e.webpData.singleLoopDuration,emojis:e.webpData.emojis,isAnimated:e.webpData.animationDuration>0,size:t.size,isFirstParty:e.webpData.isFirstParty,isFromStickerMaker:e.webpData.isFromStickerMaker,stickerPackId:e.webpData.stickerPackId,stickerPackName:e.webpData.stickerPackName,stickerPackPublisher:e.webpData.stickerPackPublisher,isAvatar:e.webpData.isAvatar}))):j(t).then(function(){var e=(0,a.default)((function*(e){let{animationDuration:n,firstFrameLength:r,singleLoopDuration:i,emojis:a,isFirstParty:o,isFromStickerMaker:s,stickerPackId:l,stickerPackName:u,stickerPackPublisher:c,isAvatar:d}=e;if(n>0)return{animationDuration:n,firstFrameLength:r,singleLoopDuration:i,emojis:a,isAnimated:!0,size:t.size,isFirstParty:o,isFromStickerMaker:s,stickerPackId:l,stickerPackName:u,stickerPackPublisher:c,isAvatar:d};const p=yield B(t);return{animationDuration:n,rgbaBuffer:p.rgbaBuffer,rgbaWidth:p.width,rgbaHeight:p.height,emojis:a,isAnimated:!1,size:t.size,isFirstParty:o,isFromStickerMaker:s,stickerPackId:l,stickerPackName:u,stickerPackPublisher:c,isAvatar:d}}));return function(){return e.apply(this,arguments)}}())));case v.TYPE.AUDIO:default:return{}}})).catch((0,s.filteredCatch)(C.MediaUnsupportedError,(t=>{throw e.consolidate({}),t})));null!=n&&e.consolidate(n)}))).apply(this,arguments)}},756680:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(417405),a=r(n(132375)),o=n(201063),s=n(698210);let l=[];const u=new o.ShiftTimer((function(){const e=l;l=[];for(let t=0;t<e.length;t++){const n=e[t];n._inAutoreleasePool=!1,0!==n._retainCount||n.released||(n.released=!0,n._releaseImpl())}}));class c{constructor(){this._retainCount=1,this._inAutoreleasePool=!1,this.released=!1,this._b64=void 0,this._blob=void 0,this._url=void 0,this._mimetype=void 0,this._released=void 0}retain(){if(this.released)throw __LOG__(3)`OpaqueData:retain called on released OpaqueData`,new Error("OpaqueData:retain called on released OpaqueData");this._retainCount++}autorelease(){this.released?__LOG__(3)`OpaqueData:autorelease called on released object`:0===this._retainCount?__LOG__(3)`OpaqueData:autorelease too many release calls`:1===this._retainCount?(this._retainCount=0,this._inAutoreleasePool||(this._inAutoreleasePool=!0,l.push(this),u.onOrBefore(1e3))):this._retainCount--}autoreleaseWhenPromiseCompletes(e){const t=()=>{this.autorelease()};e.then(t,t)}throwIfReleased(e){if(this.released)throw __LOG__(4,void 0,new Error)`${e} called on released OpaqueData`,new Error(`${e} called on released OpaqueData`);0===this._retainCount&&__LOG__(4,void 0,new Error)`${e} called on unretained OpaqueData`}url(){return this.throwIfReleased("OpaqueData:url"),null!=this._url&&""!==this._url?this._url:null!=this._b64&&""!==this._b64?(this._url=`data:image/jpeg;base64,${this._b64}`,this._url):(this._url=window.URL.createObjectURL((0,a.default)(this._blob,"this._blob")),this._url)}getBlob(){return this._blob}getBase64(){return this._b64}validate(){return!0===this._released?Promise.resolve(!1):this._blob?(0,s.validateBlob)(this._blob):Promise.resolve(!0)}size(){return this.throwIfReleased("OpaqueData:size"),this._blob?this._blob.size:null!=this._b64?(0,i.sizeWhenB64Decoded)(this._b64):(__LOG__(4,void 0,new Error,!0)`OpaqueData:size returned 0`,SEND_LOGS("opaque-data-size-0"),0)}formData(){return this.throwIfReleased("OpaqueData:formData"),this.forceToBlob()}type(){return this.throwIfReleased("OpaqueData:type"),null!=this._mimetype&&""!==this._mimetype?this._mimetype:"undefined"}forceToBlob(){this.throwIfReleased("OpaqueData:forceToBlob");const e=this._blob;if(e)return e;const t=this._b64;if(null!=t&&""!==t){this._b64=void 0,this._url=void 0;const e=this._mimetype;return this._blob=new Blob([(0,i.decodeB64)(t)],null!=e&&""!==e?{type:e}:void 0)}throw new Error("OpaqueData:forceToBlob no b64 or blob")}_releaseImpl(){this._mimetype=void 0;this._blob?(this._blob=void 0,null!=this._url&&""!==this._url&&(window.URL.revokeObjectURL(this._url),this._url=void 0)):(this._b64=void 0,this._url=void 0)}isBlobEqual(e){return e?this._blob===e._blob:!this._blob}}t.default=c,c.createFromBase64Jpeg=e=>new Promise((t=>{const n=new c;return n._b64=e,n._mimetype="image/jpeg",t(n)})),c.createFromData=(e,t)=>new Promise((n=>{const r=new c;return r._blob=e instanceof Blob&&e.type===t?e:new Blob([e],{type:t}),r._mimetype=t,n(r)}))},245655:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e===i.MEDIA_TYPES.DOCUMENT&&!0===(0,r.getABPropConfigValue)("web_abprop_remove_uploaded_files")};var r=n(287461),i=n(708761)},75421:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMaxNumberSelectableMedia=function(e){const t=(0,r.getABPropConfigValue)("media_picker_select_limit");return e<=t?t:(0,r.getABPropConfigValue)("media_picker_select_limit_new")};var r=n(287461)},196127:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MediaBlobCacheImpl=t.MediaBlobCache=void 0;var i=r(n(823493)),a=n(138596),o=n(231385),s=n(172259);class l{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:25e7;if(this._filehashesToCleanUp=new Set,this.getOrCreateURL=e=>{if(this._filehashToUrl[e])return this.touch(e),this._filehashToUrl[e];const t=this.get(e);if(!t)throw new Error(`There is no blob matching filehash: ${e}.`);const n=window.URL.createObjectURL(t);return this._filehashToUrl[e]=n,n},this.revokeURL=(e,t)=>{if(t){if(this._filehashToUrl[e]!==t)throw new Error("The url provided does not match the filehash.");delete this._filehashToUrl[e],window.URL.revokeObjectURL(t)}},this._scheduleCleanup=(0,i.default)((()=>{this._filehashesToCleanUp.forEach((e=>{window.URL.revokeObjectURL(this._filehashToUrl[e]),delete this._filehashToUrl[e]})),this._filehashesToCleanUp.clear()}),0,{leading:!1}),null!=e&&e<0)throw new Error("Size limit cannot be a negative number.");this._usageCounts={},this._filehashToUrl={},this._lruCache=new a.LruCache({sizeLimit:e,getSize:e=>e.size,onEvict:e=>{this._filehashToUrl[e]&&0===this._getUsageCount(e)&&(this.revokeURL(e,this._filehashToUrl[e]),(0,o.getOrCreateMediaObject)(e).consolidate({downloadStage:s.DOWNLOAD_STAGE.INIT,progressiveStage:null}))},shouldEvict:e=>0===this._getUsageCount(e)})}get(e){return this._lruCache.get(e)}has(e){return this._lruCache.has(e)}touch(e){this.get(e)}put(e,t){this._lruCache.put(e,t)}clear(){this._scheduleCleanup.flush(),this._usageCounts={},Object.keys(this._filehashToUrl).forEach((e=>{this._filehashToUrl[e]&&this.revokeURL(e,this._filehashToUrl[e])})),this._filehashToUrl={},this._lruCache.clear()}increaseUsageCount(e){this._usageCounts[e]=this._getUsageCount(e)+1,this._filehashesToCleanUp.delete(e)}decreaseUsageCount(e){const t=this._getUsageCount(e);if(t<=0)throw new Error("Cannot decrease the usageCount to a negative number.");this._usageCounts[e]=t-1,0===this._usageCounts[e]&&(delete this._usageCounts[e],this._filehashesToCleanUp.add(e),this._scheduleCleanup())}_getUsageCount(e){return this._usageCounts[e]||0}}t.MediaBlobCacheImpl=l;const u=new l;t.MediaBlobCache=u},901959:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediaKeyCache=void 0,t.shouldUseMediaKeyCache=function(){return!0};const r={sizeLimit:10,getSize:()=>1};const i=new(n(138596).LruCache)(r);t.MediaKeyCache=i},951551:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(630884));const a={ignoreSearch:!0,ignoreMethod:!0,ignoreVary:!0};class o extends i.default{constructor(e){super(e,s,l,{encodeKey:u,matchOptions:a})}}function s(e){return new Response(e)}function l(e){return e.arrayBuffer()}function u(e,t){const n=encodeURIComponent(e);return`https://_media_cache_v2_.whatsapp.com/${encodeURIComponent(t)}_${n}`}t.default=o},935808:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=r(n(173207)),o=n(190335),s=n(732075),l=r(n(96459));class u extends a.default{constructor(){super(),this._store=new l.default(o.initialize,s.IdbArrayBufferTable)}doGet(e){var t=this;return(0,i.default)((function*(){const n=yield t._store.get(e);return n?n.data:null}))()}doQueryByIndex(){throw new Error("Not implemented. Actual Arraybuffer store does not need it.")}doGetAll(){throw new Error("Not implemented. Actual Arraybuffer store does not need it.")}doPut(e,t){var n=this;return(0,i.default)((function*(){return(yield n._store.put(e,{id:e,data:t})).data}))()}doDel(e){return this._store.del(e)}doCount(){return this._store.count()}clear(){return this._store.clear()}doOpen(){return Promise.resolve()}doClose(){return Promise.resolve()}}t.default=u},719621:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MediaStore=t.LruMediaStore=void 0;var i=r(n(348926)),a=r(n(751463)),o=n(287461),s=r(n(422660)),l=r(n(951551)),u=r(n(935808)),c=r(n(740573)),d=r(n(198765)),p=n(288057),_=r(n(281007));class f{constructor(){this._getBackingStore=(0,a.default)((0,i.default)((function*(){try{const e=function(){const e=function(){if(null!=s.default&&"caches"in self)return new l.default("lru-media-array-buffer-cache");return null!=s.default?new u.default("media_lru_buffer"):null}();return null==e?null:new d.default({maxSize:(0,o.getABPropConfigValue)("web_lru_cache_purge_logic_refactor")?void 0:Number.MAX_SAFE_INTEGER,arrayBufferStore:e})}();if(null!=e)return yield e.open(),e}catch(e){if("SecurityError"===e.name)__LOG__(3)`There was a security error attempting to open the media storage. \
This likely indicates a permissions error. Falling back to dummy \
(no-op) storage.`;else{if(e instanceof p.DbOnLogoutAbort)throw e;__LOG__(4,!0,new Error,!0)`Failed to initialize media store! Falling back to dummy (no-op) storage. Error:
${(0,_.default)(e)}`,SEND_LOGS("Failed to initialize media store")}}return new c.default})))}get(e){var t=this;return(0,i.default)((function*(){return(yield t._getBackingStore()).get(e)}))()}queryByIndex(e,t){var n=this;return(0,i.default)((function*(){return(yield n._getBackingStore()).queryByIndex(e,t)}))()}getAll(){var e=this;return(0,i.default)((function*(){return(yield e._getBackingStore()).getAll()}))()}put(e,t){var n=this;return(0,i.default)((function*(){return(yield n._getBackingStore()).put(e,t)}))()}del(e){var t=this;return(0,i.default)((function*(){const n=yield t._getBackingStore();yield n.del(e)}))()}count(){var e=this;return(0,i.default)((function*(){return(yield e._getBackingStore()).count()}))()}clear(){var e=this;return(0,i.default)((function*(){const t=yield e._getBackingStore();yield t.clear()}))()}open(){var e=this;return(0,i.default)((function*(){const t=yield e._getBackingStore();yield t.open()}))()}close(){var e=this;return(0,i.default)((function*(){const t=yield e._getBackingStore();yield t.close()}))()}}t.MediaStore=f;const h=new f;t.LruMediaStore=h},740573:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(173207));class a extends i.default{get(){return Promise.resolve()}queryByIndex(){return Promise.resolve([])}getAll(){return Promise.resolve([])}put(e,t){return Promise.resolve(t)}del(){return Promise.resolve()}count(){return Promise.resolve(0)}clear(){return Promise.resolve()}}t.default=a},198765:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=r(n(132375)),o=n(316860),s=n(287461),l=r(n(173207)),u=r(n(495976)),c=r(n(909520)),d=r(n(986128));class p extends l.default{constructor(e){var t;super(),t=this,this._queueMap=new o.PromiseQueueMap,this._isInitialized=!1,this.updateMaxSizeInterval=null,this._dispose=e=>this._bufferStore.del(e),this.doPut=(e,n)=>this._queueMap.enqueue(e,(0,i.default)((function*(){if(n.byteLength>t.getMaxSize())return n;if(n.byteLength>3e7)return n;const r={id:e,timestamp:(new Date).getTime(),size:n.byteLength};try{return(0,s.getABPropConfigValue)("web_lru_cache_purge_logic_refactor")&&(yield t._updateMaxSize()),yield t._metaInfoStore.putObject(r),t._bufferStore.put(e,n)}catch(e){if(e instanceof d.default.AbortError&&e.message.includes("QuotaExceededError"))return __LOG__(2)`LruMediaStore: encounter QuotaExceededError, thus shrink the size of LruMediaStore`,void t.setMaxSize((0,a.default)(t.getCurrentSize(),"_this.getCurrentSize()")/2);throw e}}))),this.doDel=e=>this._isInitialized?this._queueMap.enqueue(e,(()=>this._metaInfoStore.del(e))):Promise.resolve(),this._updateMaxSize=function(){var e=(0,i.default)((function*(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const n=yield(0,u.default)();if(null==n)return void t._clearStoreForThisSession();const r=t.getCurrentSize();if(null==r)return;const i=n.available,a=t._calculateTargetedBufferSize(n.quota);if(i>a)return void(e&&t.setMaxSize(i));const o=(0,s.getABPropConfigValue)("web_lru_cache_purge_logic_refactor")?2:1,l=a*o-i;r<l?t._clearStoreForThisSession():t.setMaxSize(r-l)}));return function(){return e.apply(this,arguments)}}();const{maxSize:n,arrayBufferStore:r}=e;this._bufferStore=r,this._isInitialized=null!=n,this._metaInfoStore=new c.default(null!=n?n:0,this._dispose),this.updateMaxSizeInterval=setInterval(this._updateMaxSize,6e4)}doGet(e){var t=this;return(0,i.default)((function*(){const n=yield t._bufferStore.get(e);return null!=n&&t.put(e,n),n}))()}doClear(){var e=this;return(0,i.default)((function*(){return yield e._bufferStore.clear(),e._metaInfoStore.clear()}))()}doCount(){return this._metaInfoStore.count()}doOpen(){var e=this;return(0,i.default)((function*(){yield Promise.all([e._metaInfoStore.open(),e._bufferStore.open()]),!e._isInitialized&&(0,s.getABPropConfigValue)("web_lru_cache_purge_logic_refactor")&&(yield e._updateMaxSize(!0),e._isInitialized=!0)}))()}doClose(){var e=this;return(0,i.default)((function*(){yield Promise.all([e._metaInfoStore.close(),e._bufferStore.close()])}))()}getCurrentSize(){return this._metaInfoStore.getCurrentSize()}getMaxSize(){return this._metaInfoStore.getMaxSize()}setMaxSize(e){return this._metaInfoStore.setMaxSize(e)}_calculateTargetedBufferSize(e){const t=Math.floor(.01*e);return t<1e8?1e8:t>5e8?5e8:t}_clearStoreForThisSession(){this.setMaxSize(0),this.updateMaxSizeInterval&&(clearInterval(this.updateMaxSizeInterval),this.updateMaxSizeInterval=null)}}t.default=p},909520:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(190335),a=n(581692),o=r(n(96459)),s=r(n(24726));class l extends s.default{constructor(e,t){super(new o.default(i.initialize,a.IdbMetaInfoTable),{primaryIndex:a.metaInfoPrimaryIndex,dateIndex:a.metaInfoDateIndex,sizeIndex:a.metaInfoSizeIndex,maxSize:e,dispose:t})}}t.default=l},96459:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=r(n(173207));class o extends a.default{constructor(e,t){super(),this._initialize=e,this._table=t}doGet(e){var t=this;return(0,i.default)((function*(){return yield t._initialize(),t._table.get(e)}))()}doQueryByIndex(e,t){var n=this;return(0,i.default)((function*(){return yield n._initialize(),n._table.all({limit:t.limit,index:[e]})}))()}doGetAll(){var e=this;return(0,i.default)((function*(){return yield e._initialize(),e._table.all()}))()}doPut(e,t){var n=this;return(0,i.default)((function*(){return yield n._initialize().then((()=>n._table.createOrReplace(t))),t}))()}doDel(e){var t=this;return(0,i.default)((function*(){return yield t._initialize(),t._table.remove(e)}))()}doCount(){var e=this;return(0,i.default)((function*(){return yield e._initialize(),e._table.count()}))()}doClear(){var e=this;return(0,i.default)((function*(){return yield e._initialize(),e._table.clear(!0)}))()}doOpen(){return this._initialize()}doClose(){return Promise.resolve()}}t.default=o},24726:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=r(n(132375)),o=n(962833),s=n(316860),l=n(201063),u=n(287461),c=r(n(173207));class d extends c.default{constructor(e,t){var n;if(super(),n=this,this._queueMap=new s.PromiseQueueMap,this._purgeCount=0,this._optimizationEnabled=!1,this._purge=()=>{if(this._pendingPurgePromise)return this._pendingPurgePromise;const e=this.open().then((()=>(0,o.promiseLoop)(function(){var e=(0,i.default)((function*(e){const t=()=>{n._pendingPurgePromise=null,e()},r=n.getCurrentSize();if(null==r||r<=n._maxSize)return void t();const a=yield n.queryOneByIndex(n._dateIndex),o=n.getCurrentSize(),s=n._maxSize;if(null==o||o<=s)return void t();if(null==a)return(0,i.default)((function*(){const e=yield n.count();__LOG__(3,void 0,void 0,!0)`SizeLruObjectStore: _purge error: No row returned but currentSize (${o}) > maxSize (${s}). Row count is ${e} (may be out of date).`,SEND_LOGS("size-lru-store-invalid-empty")}))(),Promise.reject(new Error("Query returned no result but currentSize > maxSize"));const l=a[n._primaryIndex];return n.del(l)}));return function(){return e.apply(this,arguments)}}())));return this._pendingPurgePromise=e},this._purgeOptimized=(e,t)=>{this._purgeCount++;const r=Promise.resolve().then((0,i.default)((function*(){var r;const i=yield n._store.get(e),a=null==i?0:n._getSize(i),o=null!==(r=n.getCurrentSize())&&void 0!==r?r:0,s=n.getMaxSize(),l=o+(t-a);if(l<=s)return;const u=yield n.count(),c=yield n.doQueryByIndex(n._dateIndex,{limit:u}),d=[];let p=l;for(const t of c)if(t[n._primaryIndex]!==e&&(p-=n._getSize(t),d.push(t[n._primaryIndex]),p<=s))break;if(p>s)throw __LOG__(3,void 0,void 0,!0)`SizeLruObjectStore: _purge error: Adjusted size is too big even after removal of all items.`,SEND_LOGS("size-lru-store-invalid-empty"),new Error("Above max limit after purge");yield Promise.all(d.map((e=>n.del(e)))),0==--n._purgeCount&&(n._pendingPurgePromiseOptimized=null)})));return null!=this._pendingPurgePromiseOptimized?(this._pendingPurgePromiseOptimized=this._pendingPurgePromiseOptimized.finally((()=>r)),this._pendingPurgePromiseOptimized):(this._pendingPurgePromiseOptimized=r,r)},this._schedulePurge=()=>{this._purgeTimer.debounce(2e3)},this.doPut=(e,t)=>this._queueMap.enqueue(e,(0,i.default)((function*(){if(t[n._primaryIndex]!==e)throw new Error("The key you provide does not match.");const r=yield n._store.get(e),i=null==r?0:n._getSize(r),o=n._getSize(t);n._optimizationEnabled&&(yield n._purgeOptimized(e,o));const s=yield n._store.put(e,t);return n._currentSize=(0,a.default)(n.getCurrentSize(),"_this.getCurrentSize()")+(o-i),n._optimizationEnabled||n._schedulePurge(),s}))),this.doDel=e=>this._queueMap.enqueue(e,(0,i.default)((function*(){const t=yield n._store.get(e);if(null!=t){try{yield n._dispose(e,t)}catch(e){throw __LOG__(3,void 0,void 0,!0)`SizeLRUObjectStore: _dispose error: ${e.message}`,SEND_LOGS("size-lru-store-dispose-error"),e}yield n._store.del(e),n._currentSize=(0,a.default)(n.getCurrentSize(),"_this.getCurrentSize()")-n._getSize(t)}}))),this._store=e,this._primaryIndex=t.primaryIndex,this._dateIndex=t.dateIndex,this._sizeIndex=t.sizeIndex,t.maxSize<0)throw new Error("Cannot set max size to a negative number");this._maxSize=Math.floor(t.maxSize),this._dispose=t.dispose,this._purgeTimer=new l.ShiftTimer((()=>{this._purge().catch((e=>{__LOG__(3)`Error while purging: ${e.message}`}))})),this._optimizationEnabled=(0,u.getABPropConfigValue)("web_lru_cache_optimization")}getCurrentSize(){return this._currentSize}getMaxSize(){return this._maxSize}setMaxSize(e){return e<0?Promise.reject(new Error("Cannot set size to a negative number")):(this._maxSize=Math.floor(e),this._purgeTimer.cancel(),this._purge().catch((e=>{__LOG__(3)`Error while purging during setMaxSize: ${e.message}`})))}putObject(e){const t=e[this._primaryIndex];return this.put(t,e)}_getSize(e){const t=e[this._sizeIndex];return"number"!=typeof t||t<0?(__LOG__(3)`Invalid size in index ${this._sizeIndex}: ${t}`,0):t}doGet(e){return this._store.get(e)}queryOneByIndex(e){var t=this;return(0,i.default)((function*(){const n=yield t._store.queryByIndex(e,{limit:1});return 0===n.length?null:n[0]}))()}doQueryByIndex(e,t){return this._store.queryByIndex(e,t)}doGetAll(){return this._store.getAll()}doClear(){var e=this;return(0,i.default)((function*(){e._purgeTimer.cancel(),yield e._store.clear(),e._currentSize=0}))()}doCount(){return this._store.count()}doOpen(){var e=this;return(0,i.default)((function*(){if(yield e._store.open(),null!=e._currentSize)return;const t=yield e._store.doGetAll();e._currentSize=t.reduce(((t,n)=>t+e._getSize(n)),0)}))()}doClose(){return this._currentSize=null,this._store.close()}}t.default=d},619641:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return s.apply(this,arguments)};var i=r(n(348926)),a=n(102645),o=n(708761);function s(){return(s=(0,i.default)((function*(e){if(yield e.waitForPhoneUpload(),!e.mediaObject)return __LOG__(4,void 0,new Error,!0)`checkExistence msg without mediaObject, id: ${e.id.toString()} type: ${e.type}`,void SEND_LOGS("media-fault: checkExistence msg without mediaObject");yield(0,a.checkExistence)({mimetype:e.mimetype,mediaObject:e.mediaObject,mediaType:(0,o.getMsgMediaType)(e)})}))).apply(this,arguments)}},289903:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){r.clearMediaForChat(e)};var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=i(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=a?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(231385));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(i=function(e){return e?n:t})(e)}},261361:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.consolidateMediaUpdate=function(e,t){if(e.isUnsentPhoneMsg()){e.mediaObject&&(__LOG__(4,void 0,new Error,!0)`id: ${e.id.toString()} type: ${e.type}`,SEND_LOGS("media-fault: consolidateMediaUpdate unsent message"));const t=f(e);if(t.hasOwnProperty("preview")){const n=t.preview;delete t.preview,n&&l.default.createFromBase64Jpeg(n).then((t=>{(null==e?void 0:e.mediaData)&&e.isUnsentPhoneMsg()&&(e.mediaData.preview=t)}))}e.mediaData.set((0,i.default)((0,i.default)({},t),{},{mediaStage:c.MEDIA_DATA_STAGE.REMOTE_NEED_UPLOAD}))}else h(e,e,t)},t.consolidateMediaUpdateWithValues=h;var i=r(n(81109)),a=r(n(762467)),o=n(102645),s=n(189123),l=r(n(756680)),u=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=_(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(231385)),c=n(172259),d=n(708761),p=n(373070);function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(_=function(e){return e?n:t})(e)}function f(e){const t={};return c.MAPPED_MSG_PROPS.forEach((n=>{const r=e[n],i=c.MSG_TO_MEDIA[n];t[i]=r})),t.type===p.MSG_TYPE.INTERACTIVE&&(t.type=(0,s.getInteractiveMsgMediaType)(e)),t}function h(e,t,n){const r=f(t);let i=e.mediaObject;const l=t.filehash;if(i)l&&l!==i.filehash&&(__LOG__(2)`media:msg ${e.id.toString()} ${i.filehash?"changed":"added"} filehash`,u.disassociateMediaFromMsg(i,e),i=u.getOrCreateMediaObject(l),e.mediaObject=i,u.associateMediaWithMsg(i,e));else{i=l?u.getOrCreateMediaObject(l):new s.MediaObject;const t=e.mediaData;void 0!==t.aspectRatio&&(r.aspectRatio=t.aspectRatio),e.mediaObject=i,u.associateMediaWithMsg(i,e)}let p=!1;const{deprecatedMms3Url:_,mediaKey:h,mediaKeyTimestamp:g,encFilehash:m,type:y,streamingSidecar:E,firstFrameSidecar:S,directPath:T,scansSidecar:v,scanLengths:A,staticUrl:C}=t;if(_||m){let e,n;try{e=(0,d.msgToMediaType)(t)}catch(t){e=~d.MEDIA_TYPE_VALUES.indexOf(y)?y:null}p=!i.entries.has({encFilehash:m,deprecatedMms3Url:_}),p?h&&e&&m?n=i.entries.addEntry({deprecatedMms3Url:_,mediaKey:h,mediaKeyTimestamp:g,encFilehash:m,type:e,sidecar:E,directPath:T,firstFrameSidecar:S,scansSidecar:v,scanLengths:A,debugHint:"consolidate",staticUrl:C}):p=!1:h&&(n=i.entries.updateEntry({deprecatedMms3Url:_,mediaKey:h,mediaKeyTimestamp:g,encFilehash:m,type:e,sidecar:E,directPath:T,firstFrameSidecar:S,scansSidecar:v,scanLengths:A,staticUrl:C})),n||(p=!1),p&&i.downloadStage===c.DOWNLOAD_STAGE.ERROR_MISSING&&(r.downloadStage=c.DOWNLOAD_STAGE.INIT)}if(i.consolidate(r)||i.notifyMsgsAsync(),p&&i.downloadStage===c.DOWNLOAD_STAGE.NEED_POKE){let r;try{r=(0,d.getMsgMediaType)(e)}catch(n){if(!t.type)throw n;r=(0,d.msgToMediaType)({type:t.type,isGif:e.isGif})}(0,o.downloadMedia)({mimetype:t.mimetype,mediaObject:i,downloadEvenIfExpensive:!1,mediaType:r,rmrReason:n,downloadOrigin:(0,a.default)(e)})}}},989577:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return p.apply(this,arguments)};var a=i(n(348926)),o=n(88237),s=i(n(132375)),l=n(941555),u=i(n(756680)),c=n(708761),d=i(n(281007));function p(){return(p=(0,a.default)((function*(e){const{msg:t,isPreload:n,signal:i}=e;__LOG__(2)`media.downloadProgressiveJpegThumbnail: start`;try{const e=(0,s.default)(t.scanLengths,"msg.scanLengths"),a=(0,s.default)(t.scansSidecar,"msg.scansSidecar"),o=(0,s.default)(t.mediaObject,"msg.mediaObject"),d=(0,s.default)(o.filehash,"mediaObject.filehash"),{encFilehash:p,directPath:_}=t,f=yield l.downloadManager.downloadAndDecrypt({directPath:_,encFilehash:p,filehash:d,mediaKey:t.mediaKey,mediaKeyTimestamp:t.mediaKeyTimestamp,type:c.MEDIA_TYPES.IMAGE,signal:i||(new r).signal,userDownloadAttemptCount:0,progressiveJpegOpts:{mimetype:"image/jpeg",scansSidecar:a,scanLengths:e,scanCount:1},isPreload:n});o.consolidate({fullPreviewData:yield u.default.createFromData(f,"image/jpeg")}),__LOG__(2)`media.downloadProgressiveJpegThumbnail: success`}catch(e){if(e.name===o.ABORT_ERROR)return void __LOG__(2)`media.downloadProgressiveJpegThumbnail aborted`;__LOG__(3,void 0,void 0,!0)`media.downloadProgressiveJpegThumbnail: error\n${(0,d.default)(e)}`,SEND_LOGS("download-pjpeg-thumbnail-failed")}}))).apply(this,arguments)}},765108:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return l.apply(this,arguments)};var i=r(n(348926)),a=r(n(989577)),o=r(n(343087)),s=n(373070);function l(){return(l=(0,i.default)((function*(e){const{msg:t,isPreload:n,signal:r}=e,{encFilehash:i,thumbnailSha256:l,thumbnailEncSha256:u,thumbnailDirectPath:c}=t;t.type===s.MSG_TYPE.IMAGE&&t.scanLengths&&t.scansSidecar&&i?yield(0,a.default)({msg:t,signal:r,isPreload:n}):l&&u&&c&&(yield(0,o.default)({msg:t,signal:r,isPreload:n}))}))).apply(this,arguments)}},438393:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return h.apply(this,arguments)};var a=i(n(348926)),o=i(n(132375)),s=i(n(846870)),l=n(941555),u=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(428363)),c=i(n(756680)),d=n(708761),p=i(n(281007)),_=i(n(79291));function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function h(){return(h=(0,a.default)((function*(e){const{msg:t}=e,{encFilehash:n,filehash:i,directPath:a}=t;if(!n||!i||!a)return;const{fullPreviewData:f,fullWidth:h,fullHeight:g}=t.mediaData;if(!f||null==h||null==g){__LOG__(2)`media.downloadVideoThumbnail: start`;try{const e=Math.max(parseInt(t.mediaData.duration,10),1),p={video:{size:t.mediaData.size,duration:e},secondsToDownload:1},f=yield l.downloadManager.downloadAndDecrypt({directPath:a,encFilehash:n,filehash:i,mediaKey:t.mediaKey,mediaKeyTimestamp:t.mediaKeyTimestamp,type:d.MEDIA_TYPES.VIDEO,signal:(new r).signal,userDownloadAttemptCount:0,partialVideoOpts:p,isPreload:!0}),h=new Blob([f],{type:"video/mp4"}),{thumbs:[g]}=yield u.generateVideoThumbsAndDuration({file:h,maxDimensions:[s.default.VIDEO_THUMB_MAX_EDGE],debugHint:"downloadVideoThumbnail",throwOnBlack:!0}),m=yield c.default.createFromBase64Jpeg(_.default.parseDataURL(g.url).data),y=(0,o.default)(t.mediaObject,"mediaObject cannot be null for thumbnail download"),E={fullPreviewData:m,fullWidth:g.fullWidth,fullHeight:g.fullHeight};y.consolidate(E),__LOG__(2)`media.downloadVideoThumbnail: success`}catch(e){if(e instanceof u.BlackVideoThumbnailError)return void __LOG__(2)`media.downloadVideoThumbnail: black thumbnail was generated, fallback to blurred thumbnail`;__LOG__(3,!0)`media.downloadVideoThumbnail: error\n${(0,p.default)(e)}`}}}))).apply(this,arguments)}},580931:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{msg:t,media:n,rmrReason:r}=e;const l=t.mediaObject;if(!l)return;o.default.createFromData(n,t.mimetype).then((e=>{(0,a.manuallySetMedia)({mimetype:t.mimetype,mediaObject:l,mediaBlob:e,mediaType:(0,s.getMsgMediaType)(t),rmrReason:r,downloadOrigin:(0,i.default)(t)})}))};var i=r(n(762467)),a=n(102645),o=r(n(756680)),s=n(708761);r(n(571834))},684293:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cancelDownloadMedia=i,t.cancelDownloadMsg=function(e){e.mediaObject?i(e.mediaObject):e.mediaObject||(__LOG__(4,void 0,new Error,!0)`id: ${e.id.toString()} type: ${e.type}`,SEND_LOGS("media-fault: cancelDownloadMsg msg without mediaObject"))};var r=n(102645);function i(e){(0,r.cancelDownloadMedia)(e)}},567202:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cancelUploadMedia=i,t.cancelUploadMsg=function(e){e.mediaObject?i(e.mediaObject):(__LOG__(4,void 0,new Error,!0)`id: ${e.id.toString()} type: ${e.type}`,SEND_LOGS("media-fault: cancelUploadMsg msg without mediaObject"))};var r=n(709089);function i(e){(0,r.cancelUploadMedia)(e)}},677998:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const{msg:t,isUserClick:n,mode:r,downloadEvenIfExpensive:l,rmrReason:u,rmrData:c,isAutoDownload:d}=e,{mediaObject:p}=t;if(p){return p.getPendingProcess("fromDisk").then((0,i.default)((function*(){n&&p.userDownloadAttemptCount++,yield(0,o.downloadMedia)({mimetype:t.mimetype,mediaObject:p,downloadEvenIfExpensive:l,mediaType:(0,s.getMsgMediaType)(t),rmrReason:u,rmrData:c,downloadOrigin:(0,a.default)(t),isVcardOverMmsDocument:t.isVcardOverMmsDocument,mode:r,isAutoDownload:d,isViewOnce:Boolean(t.isViewOnce)}),p.userDownloadAttemptCount=0})))}return __LOG__(4,void 0,new Error,!0)`id: ${t.id.toString()} type: ${t.type}`,SEND_LOGS("media-fault: downloadMsg msg without mediaObject"),Promise.resolve()};var i=r(n(348926)),a=r(n(762467)),o=n(102645),s=n(708761);r(n(571834))},324572:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return d.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=r(n(756680)),s=r(n(328793)),l=n(172259),u=n(97858),c=r(n(571834));function d(){return(d=(0,a.default)((function*(e,t){var n;let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];__LOG__(2)`Prepping media msg`;const d=e.mediaObject;if(!d)return __LOG__(4,void 0,new Error,!0)`id: ${e.id.toString()} type: ${e.type}`,SEND_LOGS("media-fault: forwardMediaMsg msg without mediaObject"),Promise.reject(new Error("non initialized media"));const p=e.mediaData.toJSON();null!=p.preview&&(p.preview=d.contentInfo._preview),p.mediaBlob instanceof o.default&&p.mediaBlob.retain();const _={mimetype:p.mimetype},f=p.isGif?(0,i.default)((0,i.default)({},_),{},{isGif:!0}):_;p.type===l.OUTWARD_TYPES.PTT&&(p.type=l.OUTWARD_TYPES.AUDIO);const h={businessOwnerJid:e.businessOwnerJid,productId:e.productId,currencyCode:e.currencyCode,priceAmount1000:e.priceAmount1000,salePriceAmount1000:e.salePriceAmount1000,retailerId:e.retailerId,url:e.url,productImageCount:e.productImageCount,title:e.title,description:e.description},g=p.type===l.OUTWARD_TYPES.DOCUMENT&&(e.isFromTemplate||e.isDynamicReplyButtonsMsg);let m=g||p.type===l.OUTWARD_TYPES.PRODUCT?e.caption:void 0;(0,u.forwardMediaWithCaptionsEnabled)()&&a&&(p.type!==l.OUTWARD_TYPES.IMAGE&&p.type!==l.OUTWARD_TYPES.VIDEO||(m=e.caption));const y=yield new s.default(p.type,Promise.resolve(p)).sendToChat(t,{forwardedFromWeb:!0,caption:m,mentionedJidList:e.mentionedJidList,footer:p.type===l.OUTWARD_TYPES.PRODUCT?e.footer:void 0,addEvenWhilePreparing:!0,placeholderProps:f,isForwarded:e.isForwarded||!e.isSentByMe,forwardingScore:e.getForwardingScoreWhenForwarded(),multicast:r,productMsgOptions:h,isAvatar:null!==(n=e.isAvatar)&&void 0!==n&&n});var E,S,T;p.type===l.OUTWARD_TYPES.STICKER&&new c.default.StickerSend({stickerSendOrigin:c.default.STICKER_SEND_ORIGIN_TYPE.FORWARD,stickerIsAnimated:Boolean(null===(E=e.mediaData)||void 0===E?void 0:E.isAnimated),stickerIsFirstParty:Boolean(null===(S=e.mediaData)||void 0===S?void 0:S.isFirstParty),stickerIsFromStickerMaker:Boolean(null===(T=e.mediaData)||void 0===T?void 0:T.isFromStickerMaker)}).commit();return y}))).apply(this,arguments)}},762467:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.asProduct?i.default.DOWNLOAD_ORIGIN_TYPE.PRODUCT_CATALOG:e.isStatusV3?i.default.DOWNLOAD_ORIGIN_TYPE.STATUS_USER:e.isGroupMsg?i.default.DOWNLOAD_ORIGIN_TYPE.CHAT_GROUP:i.default.DOWNLOAD_ORIGIN_TYPE.CHAT_PERSONAL};var i=r(n(571834))},161027:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mediaMetadata=function(e){const t=e.mediaObject;if(!t)throw __LOG__(4,void 0,new Error,!0)`id: ${e.id.toString()} type: ${e.type}`,SEND_LOGS("media-fault: mediaMetadata msg without mediaObject"),new Error("msg.mediaMetadata with no mediaObject");const n=t.entries.getEntryByEncFilehash({encFilehash:e.encFilehash,deprecatedMms3Url:e.deprecatedMms3Url});if(!n)throw __LOG__(4,void 0,new Error,!0)`id: ${e.id.toString()} type: ${e.type}`,SEND_LOGS("media-fault: mediaMetadata no entry"),new Error("msg.mediaMetadata with entry mismatch");const r=e.mediaData;return{url:n.deprecatedMms3Url,directPath:n.directPath,encFilehash:n.encFilehash,mediaKey:n.mediaKey,mediaKeyTimestamp:n.mediaKeyTimestamp,filehash:e.filehash,type:r.type,mimetype:r.mimetype,filename:r.filename,duration:r.duration,width:r.fullWidth,height:r.fullHeight,firstFrameLength:r.firstFrameLength,isAnimated:r.isAnimated,thumbnailDirectPath:e.thumbnailDirectPath,thumbnailSha256:e.thumbnailSha256,thumbnailEncSha256:e.thumbnailEncSha256,thumbnailHeight:e.thumbnailHeight,thumbnailWidth:e.thumbnailWidth,waveform:e.waveform,staticUrl:e.staticUrl}}},713369:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.deregisterMsg=function(e){e.off(null,p);const t=e.mediaObject;t&&s.disassociateMediaFromMsg(t,e)},t.prepareMsg=function(e){const t=e.mediaObject;if(t)return t.resolveWhenConsolidated();const n=e.mediaData,r=n.preview;if(r instanceof o.default&&void 0===n.aspectRatio&&(void 0===n.fullWidth||void 0===n.fullHeight))return(0,a.getImageWidthHeight)(r).then((t=>{let{width:n,height:r}=t;e.mediaObject||e.mediaData.set({aspectRatio:n/r})}));return Promise.resolve()},t.registerMsg=function(e){e.mimetype||e.type!==l.OUTWARD_TYPES.IMAGE||(e.mimetype="image/jpeg");e.mimetype||e.type!==l.OUTWARD_TYPES.STICKER||(e.mimetype="image/webp");e.on(d,p),(0,i.consolidateMediaUpdate)(e,u.default.WEBC_RMR_REASON_CODE.MSG_INIT)},t.registerMsgEarly=function(e,t){e.isUnsentPhoneMsg()&&(__LOG__(4,void 0,new Error,!0)`id: ${e.id.toString()} type: ${e.type}`,SEND_LOGS("media-fault: registerMsgEarly msg without mediaObject"));const n={};for(let r=0;r<l.MEDIA_MSG_PROPS.length;r++){const i=l.MEDIA_MSG_PROPS[r],a=t[i];n[i]=void 0!==a?a:e[i]}n.mimetype||n.type!==l.OUTWARD_TYPES.IMAGE||(t.mimetype=n.mimetype="image/jpeg");e.on(d,p),(0,i.consolidateMediaUpdateWithValues)(e,n,u.default.WEBC_RMR_REASON_CODE.MSG_UPDATE);const r={};for(let e=0;e<l.MSG_SPECIFIC_FIELDS.length;e++){const t=l.MSG_SPECIFIC_FIELDS[e];r[t]=n[l.MEDIA_TO_MSG[t]]}e.mediaData.set(r)};var i=n(261361),a=n(232294),o=r(n(756680)),s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(231385)),l=n(172259),u=r(n(571834));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}const d=`change:ack ${l.MEDIA_MSG_PROPS.map((e=>`change:${e}`)).join(" ")}`;function p(e){(0,i.consolidateMediaUpdate)(e,u.default.WEBC_RMR_REASON_CODE.MSG_UPDATE)}},339213:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.uploadProductImage=function(){return c.apply(this,arguments)};var a=i(n(348926)),o=n(698210),s=n(708761),l=i(n(92577)),u=i(n(571834));function c(){return(c=(0,a.default)((function*(e,t){const n=yield(0,o.blobToArrayBuffer)(e.forceToBlob()).then((e=>l.default.unencryptedUpload({file:e,hash:t,signal:(new r).signal,type:s.MEDIA_TYPES.PRODUCT_CATALOG_IMAGE,uploadOrigin:u.default.UPLOAD_ORIGIN_TYPE.PRODUCT_CATALOG,isViewOnce:!1})));return new URL(n.directPath,"https://mmg.whatsapp.net").toString()}))).apply(this,arguments)}},818964:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;const{mediaObject:n}=e;if(!n)return __LOG__(4,void 0,new Error,!0)`id: ${e.id.toString()} type: ${e.type}`,SEND_LOGS("media-fault: resumeUploadMsg msg without mediaObject"),Promise.resolve();n.userUploadAttemptCount++;const{filehash:r}=n,p=(0,s.shouldUseMediaKeyCache)()&&null!=r&&null!==(t=s.MediaKeyCache.get(r))&&void 0!==t?t:void 0;e.ack=a.ACK.CLOCK;const _=(0,l.uploadMedia)({mimetype:e.mimetype,mediaObject:n,mediaKeyInfo:p,mediaType:(0,c.getMsgMediaType)(e),forwardedFromWeb:Boolean(e.forwardedFromWeb),uploadOrigin:(0,o.default)(e.chat),isViewOnce:Boolean(e.isViewOnce)}).then(function(){var t=(0,i.default)((function*(t){let{mediaEntry:i}=t;if((0,s.shouldUseMediaKeyCache)()&&null!=r&&s.MediaKeyCache.delete(r),!i)throw new Error("upload failed: media entry was not created");n.userUploadAttemptCount=0;const a={deprecatedMms3Url:i.deprecatedMms3Url,directPath:i.directPath,mediaKey:i.mediaKey,mediaKeyTimestamp:i.mediaKeyTimestamp,filehash:n.filehash,encFilehash:i.encFilehash,size:n.size,streamingSidecar:i.sidecar,firstFrameSidecar:i.firstFrameSidecar};return yield(0,u.default)(e,a),e}));return function(){return t.apply(this,arguments)}}());return(0,d.resendMsgToChat)(e.chat,_).catch((()=>{e.ack=a.ACK.FAILED}))};var i=r(n(348926)),a=n(402994),o=r(n(842156)),s=n(901959),l=n(709089),u=r(n(855118)),c=n(708761),d=n(257630);n(411562)},524466:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.deregisterSticker=function(e){const{mediaObject:t}=e;t&&u.disassociateMediaFromSticker(t,e)},t.deregisterStickerPackIcon=function(e){const{mediaObject:t}=e;t&&u.disassociateMediaFromStickerPack(t,e)},t.downloadStickerOrStickerPackIcon=function(){return h.apply(this,arguments)},t.prepSticker=function(e){__LOG__(2)`Prepping sticker`;const t=e.mediaObject,n=e.mediaData.toJSON();if(n.fullWidth=125,n.fullHeight=125,!t)return __LOG__(4,void 0,new Error,!0)`id: ${e.id}`,SEND_LOGS("media-fault: prepSticker sticker without mediaObject"),new l.default(n.type,Promise.reject(new Error("non initialized media")));return new l.default(n.type,Promise.resolve(n))},t.registerSticker=function(e){f(e,e.mediaObject||function(e){if(!e.filehash)return __LOG__(4,void 0,new Error,!0)`Unexpected sticker with no filehash`,void SEND_LOGS("sticker-filehash-error");const t=u.getOrCreateMediaObject(e.filehash);return u.associateMediaWithSticker(t,e),t}(e),d.MEDIA_TYPES.STICKER)},t.registerStickerPackIcon=function(e){f(e,e.mediaObject||function(e){if(!e.filehash)return __LOG__(4,void 0,new Error,!0)`Unexpected sticker pack with no filehash`,void SEND_LOGS("sticker-pack-filehash-error");const t=u.getOrCreateMediaObject(e.filehash);return u.associateMediaWithStickerPack(t,e),t}(e),d.MEDIA_TYPES.IMAGE)};var a=i(n(348926)),o=n(941555),s=n(102645),l=i(n(328793)),u=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=_(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(231385)),c=n(172259),d=n(708761),p=i(n(571834));function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(_=function(e){return e?n:t})(e)}function f(e,t,n){const r=function(e){const t={};return c.MAPPED_STICKER_PROPS.forEach((n=>{const r=e[n],i=c.MSG_TO_MEDIA[n];t[i]=r})),t}(e);if(e.mediaData.set(r),!t)return;e.mediaObject=t;const{deprecatedMms3Url:i,encFilehash:a}=e;if((a||i)&&!t.entries.has({encFilehash:a,deprecatedMms3Url:i})){t.entries.addEntry({deprecatedMms3Url:i,mediaKey:e.mediaKey,mediaKeyTimestamp:e.mediaKeyTimestamp,encFilehash:a,type:n,directPath:e.directPath,debugHint:"setMediaObjectValues"})&&t.downloadStage===c.DOWNLOAD_STAGE.ERROR_MISSING&&(r.downloadStage=c.DOWNLOAD_STAGE.INIT)}t.consolidate(r)}function h(){return(h=(0,a.default)((function*(e,t){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(e.isPlaceholder||e.isCreateButton)return e.mediaData.mediaStage=c.MEDIA_DATA_STAGE.PREPARING,Promise.resolve();const a=e.mediaObject;if(!a)return Promise.reject(new Error("media-fault: downloadStickerOrStickerPackIcon sticker/stickerPack without mediaObject"));const l="STICKER"===t?p.default.WEBC_RMR_REASON_CODE.STICKER_PANEL_STICKER:p.default.WEBC_RMR_REASON_CODE.STICKER_PANEL_ICON;let u=!1;yield a.getPendingProcess("fromDisk").then((()=>{if(!e.filehash||!e.mediaKey||!e.encFilehash)return u=!0,o.downloadManager.rmr({mediaObject:a,signal:(new r).signal,rmrReason:l})})).then((()=>(0,s.downloadMedia)({mimetype:e.mimetype,mediaObject:e.mediaObject,downloadEvenIfExpensive:!0,mediaType:(0,d.msgToMediaType)({type:e.type,isGif:!1}),rmrReason:l,downloadOrigin:p.default.DOWNLOAD_ORIGIN_TYPE.STICKER_PICKER,shouldThrow:i}))),u&&n(951220).RecentStickerCollectionMd.updateStickerMediaData(e.filehash,a.entries.getDownloadEntry())}))).apply(this,arguments)}},832098:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.videoStreamingInfo=function(e){const t=e.mediaObject;return t?t.videoStreamingInfo(e.id.toString()):null};n(189123)},758634:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){let n;__LOG__(2)`Prepping raw media`,n=!0===t.isPtt?a.OUTWARD_TYPES.PTT:!0===t.asDocument?a.OUTWARD_TYPES.DOCUMENT:!0===t.asGif?a.OUTWARD_TYPES.VIDEO:!0===t.isAudio?a.OUTWARD_TYPES.AUDIO:!0===t.asSticker?a.OUTWARD_TYPES.STICKER:a.OUTWARD_TYPES.UNKNOWN;const r=Promise.resolve(e).then((e=>(e.autoreleaseWhenPromiseCompletes(r),(0,o.default)(e,t))));return new i.default(n,r)};var i=r(n(328793)),a=n(172259),o=r(n(774317))},355631:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={"application/":{applixware:"aw","atom+xml":"atom","atomcat+xml":"atomcat","atomsvc+xml":"atomsvc","ccxml+xml":"ccxml","cdmi-":{capability:"cdmia",container:"cdmic",domain:"cdmid",object:"cdmio",queue:"cdmiq"},"davmount+xml":"davmount","docbook+xml":"dbk","dssc+der":"dssc","dssc+xml":"xdssc",ecmascript:"ecma","emma+xml":"emma","epub+zip":"epub",exi:"exi","font-":{tdpfr:"pfr",woff:"woff"},"gml+xml":"gml","gpx+xml":"gpx",gxf:"gxf",hyperstudio:"stk","inkml+xml":["ink","inkml"],ipfix:"ipfix","java-":{archive:"jar",vm:"class","serialized-object":"ser"},javascript:"js",json:"json","jsonml+json":"jsonml","lost+xml":"lostxml","mac-":{binhex40:"hqx",compactpro:"cpt"},"mads+xml":"mads",marc:"mrc","marcxml+xml":"mrcx",mathematica:["ma","nb","mb"],"mathml+xml":"mathml",mbox:"mbox","mediaservercontrol+xml":"mscml","metalink+xml":"metalink","metalink4+xml":"meta4","mets+xml":"mets","mods+xml":"mods",mp21:["m21","mp21"],mp4:"mp4s",msword:["doc","dot"],mxf:"mxf",oda:"oda",ogg:"ogx","omdoc+xml":"omdoc",onenote:["onetoc","onetoc2","onetmp","onepkg"],oxps:"oxps",pdf:"pdf","pgp-":{encrypted:"pgp",signature:["asc","sig"]},pkcs10:"p10","pkcs7-":{mime:["p7m","p7c"],signature:"p7s"},pkcs8:"p8","pkix-":{cert:"cer",crl:"crl",pkipath:"pkipath","attr-cert":"ac"},pkixcmp:"pki","pls+xml":"pls",postscript:["ai","eps","ps"],"pskc+xml":"pskcxml","rdf+xml":"rdf","reginfo+xml":"rif","resource-":{"lists+xml":"rl","lists-diff+xml":"rld"},"rpki-":{ghostbusters:"gbr",manifest:"mft",roa:"roa"},"rsd+xml":"rsd","rss+xml":"rss",rtf:"rtf","sbml+xml":"sbml","scvp-":{"cv-":{request:"scq",response:"scs"},"vp-":{request:"spq",response:"spp"}},sdp:"sdp","set-":{"payment-initiation":"setpay","registration-initiation":"setreg"},"shf+xml":"shf","smil+xml":["smi","smil"],"sparql-":{query:"rq","results+xml":"srx"},srgs:"gram","srgs+xml":"grxml","sru+xml":"sru","ssdl+xml":"ssdl","ssml+xml":"ssml","tei+xml":["tei","teicorpus"],"thraud+xml":"tfi","vnd.":{acucobol:"acu",acucorp:["atc","acutc"],"adobe.":{fxp:["fxp","fxpl"],"xdp+xml":"xdp",xfdf:"xfdf","formscentral.fcdt":"fcdt","air-application-installer-package+zip":"air"},"apple.":{"installer+xml":"mpkg",mpegurl:"m3u8"},audiograph:"aep",bmi:"bmi",businessobjects:"rep","chemdraw+xml":"cdxml",cinderella:"cdy",claymore:"cla",commonspace:"csp",cosmocaller:"cmc","crick.":{clicker:"clkx","clicker.":{keyboard:"clkk",palette:"clkp",template:"clkt",wordbank:"clkw"}},"curl.":{car:"car",pcurl:"pcurl"},dart:"dart","dece.":{data:["uvf","uvvf","uvd","uvvd"],"ttml+xml":["uvt","uvvt"],unspecified:["uvx","uvvx"],zip:["uvz","uvvz"]},dna:"dna",dpgraph:"dpg",dreamfactory:"dfac","dvb.":{ait:"ait",service:"svc"},dynageo:"geo",enliven:"nml","epson.":{esf:"esf",msf:"msf",quickanime:"qam",salt:"slt",ssf:"ssf"},"eszigno3+xml":["es3","et3"],"ezpix-":{album:"ez2",package:"ez3"},fdf:"fdf","fdsn.":{mseed:"mseed",seed:["seed","dataless"]},flographit:"gph",framemaker:["fm","frame","maker","book"],"frogans.":{fnc:"fnc",ltf:"ltf"},"fujitsu.":{oasys:"oas",oasys2:"oa2",oasys3:"oa3",oasysgp:"fg5",oasysprs:"bh2"},"fujixerox.":{ddd:"ddd",docuworks:"xdw","docuworks.binder":"xbd"},fuzzysheet:"fzs","geogebra.":{file:"ggb",tool:"ggt"},geonext:"gxt",geoplan:"g2w",geospace:"g3w",gmx:"gmx",grafeq:["gqf","gqs"],"groove-":{account:"gac",help:"ghf",injector:"grv","tool-":{message:"gtm",template:"tpl"},vcard:"vcg","identity-message":"gim"},"hal+xml":"hal",hbci:"hbci","hp-":{hpgl:"hpgl",hpid:"hpid",hps:"hps",jlyt:"jlt",pcl:"pcl",pclxl:"pclxl"},"ibm.":{minipay:"mpy",modcap:["afp","listafp","list3820"],"rights-management":"irm","secure-container":"sc"},iccprofile:["icc","icm"],igloader:"igl","immervision-":{ivp:"ivp",ivu:"ivu"},intergeo:"i2g","intu.":{qbo:"qbo",qfx:"qfx"},jam:"jam",jisp:"jisp",kahootz:["ktz","ktr"],"kde.":{karbon:"karbon",kchart:"chrt",kformula:"kfo",kivio:"flw",kontour:"kon",kpresenter:["kpr","kpt"],kspread:"ksp",kword:["kwd","kwt"]},kenameaapp:"htke",kidspiration:"kia",kinar:["kne","knp"],koan:["skp","skd","skt","skm"],"lotus-":{approach:"apr",freelance:"pre",notes:"nsf",organizer:"org",screencam:"scm",wordpro:"lwp","1-2-3":"123"},mcd:"mcd",medcalcdata:"mc1",mfer:"mwf",mfmp:"mfm","micrografx.":{flo:"flo",igx:"igx"},mif:"mif","mobius.":{daf:"daf",dis:"dis",mbk:"mbk",mqy:"mqy",msl:"msl",plc:"plc",txf:"txf"},"mophun.":{application:"mpn",certificate:"mpc"},"ms-":{artgalry:"cil",excel:["xls","xlm","xla","xlc","xlt","xlw"],"excel.":{"sheet.":{"macroenabled.12":"xlsm","binary.macroenabled.12":"xlsb"},"addin.macroenabled.12":"xlam","template.macroenabled.12":"xltm"},fontobject:"eot",htmlhelp:"chm",ims:"ims",lrm:"lrm",outlook:"msg",officetheme:"thmx","pki.":{seccat:"cat",stl:"stl"},powerpoint:["ppt","pps","pot"],"powerpoint.":{"addin.macroenabled.12":"ppam","presentation.macroenabled.12":"pptm","slide.macroenabled.12":"sldm","slideshow.macroenabled.12":"ppsm","template.macroenabled.12":"potm"},project:["mpp","mpt"],"word.":{"document.macroenabled.12":"docm","template.macroenabled.12":"dotm"},works:["wps","wks","wcm","wdb"],wpl:"wpl",xpsdocument:"xps","cab-compressed":"cab"},mseq:"mseq",musician:"mus",mynfc:"taglet",nitf:["ntf","nitf"],"noblenet-":{directory:"nnd",sealer:"nns",web:"nnw"},"nokia.":{"radio-":{preset:"rpst",presets:"rpss"},"n-gage.":{data:"ngdat","symbian.install":"n-gage"}},"novadigm.":{edm:"edm",edx:"edx",ext:"ext"},"osgi.":{dp:"dp",subsystem:"esa"},palm:["pdb","pqa","oprc"],pawaafile:"paw","pg.":{format:"str",osasli:"ei6"},picsel:"efif",pocketlearn:"plf",powerbuilder6:"pbd","recordare.":{musicxml:"mxl","musicxml+xml":"musicxml"},"rn-":{realmedia:"rm","realmedia-vbr":"rmvb"},seemail:"see",sema:"sema",semd:"semd",semf:"semf",smaf:"mmf","spotfire.":{dxp:"dxp",sfs:"sfs"},"stardivision.":{calc:"sdc",draw:"sda",impress:"sdd",math:"smf",writer:["sdw","vor"],"writer-global":"sgl"},"stepmania.":{package:"smzip",stepchart:"sm"},svd:"svd","syncml+xml":"xsm","syncml.":{"dm+wbxml":"bdm","dm+xml":"xdm"},trueapp:"tra",ufdl:["ufd","ufdl"],umajin:"umj",unity:"unityweb","uoml+xml":"uoml",vcx:"vcx",visio:["vsd","vst","vss","vsw"],visionary:"vis",vsf:"vsf","Webd.":{wbxml:"wbxml",wmlc:"wmlc",wmlscriptc:"wmlsc"},webturbo:"wtb",wordperfect:"wpd",wqd:"wqd",xara:"xar",xfdl:"xfdl","yamaha.":{"hv-":{dic:"hvd",script:"hvs",voice:"hvp"},openscoreformat:"osf","smaf-":{audio:"saf",phrase:"spf"},"openscoreformat.osfpvg+xml":"osfpvg"},zul:["zir","zirz"],"3gpp2.tcap":"tcap","accpac.simply.":{aso:"aso",imp:"imp"},"ahead.space":"ahead","airzip.filesecure.":{azf:"azf",azs:"azs"},"amazon.ebook":"azw","americandynamics.acc":"acc","amiga.ami":"ami","anser-web-":{"certificate-issue-initiation":"cii","funds-transfer-initiation":"fti"},"aristanetworks.swi":"swi","blueice.multipass":"mpm","cloanto.rp9":"rp9","clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"cluetrust.cartomobile-":{config:"c11amc","config-pkg":"c11amz"},"contact.cmsg":"cdbcmsg","criticaltools.wbs+xml":"wbs","ctc-posml":"pml","cups-ppd":"ppd","dolby.mlp":"mlp","ds-keypoint":"kpxx","ecowin.chart":"mag","fluxtime.clip":"ftc","fsc.weblaunch":"fsc","genomatix.tuxedo":"txd","geometry-explorer":["gex","gre"],"google-earth.":{"kml+xml":"kml",kmz:"kmz"},"handheld-entertainment+xml":"zmm","insors.igm":"igm","intercon.formnet":["xpw","xpx"],"ipunplugged.rcprofile":"rcprofile","irepository.package+xml":"irp","is-xpr":"xpr","isac.fcs":"fcs","kodak-descriptor":"sse","las.las+xml":"lasxml","macports.portpkg":"portpkg","mediastation.cdkey":"cdkey","mozilla.xul+xml":"xul","muvee.style":"msty","neurolanguage.nlu":"nlu","oasis.opendocument.":{chart:"odc",database:"odb",formula:"odf",graphics:"odg",image:"odi",presentation:"odp",spreadsheet:"ods",text:"odt","text-":{master:"odm",template:"ott",web:"oth"},"chart-template":"otc","formula-template":"odft","graphics-template":"otg","image-template":"oti","presentation-template":"otp","spreadsheet-template":"ots"},"olpc-sugar":"xo","oma.dd2+xml":"dd2","openofficeorg.extension":"oxt","openxmlformats-officedocument.":{"presentationml.":{presentation:"pptx",slide:"sldx",slideshow:"ppsx",template:"potx"},"spreadsheetml.":{sheet:"xlsx",template:"xltx"},"wordprocessingml.":{document:"docx",template:"dotx"}},"pmi.widget":"wg","previewsystems.box":"box","proteus.magazine":"mgz","pvi.ptid1":"ptid","quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"realvnc.bed":"bed","rig.cryptonote":"cryptonote","rim.cod":"cod","route66.link66+xml":"link66","sailingtracker.track":"st","shana.informed.":{formdata:"ifm",formtemplate:"itp",interchange:"iif",package:"ipk"},"simtech-mindmapper":["twd","twds"],"smart.teacher":"teacher","solent.sdkm+xml":["sdkm","sdkd"],"sun.xml.":{calc:"sxc",draw:"sxd",impress:"sxi",math:"sxm",writer:"sxw","writer.":{global:"sxg",template:"stw"},"calc.template":"stc","draw.template":"std","impress.template":"sti"},"sus-calendar":["sus","susp"],"symbian.install":["sis","sisx"],"tcpdump.pcap":["pcap","cap","dmp"],"tmobile-livetv":"tmo","trid.tpt":"tpt","triscape.mxs":"mxs","uiq.theme":"utz","wolfram.player":"nbp","wt.stf":"stf","zzazz.deck+xml":"zaz","3gpp.pic-bw-":{large:"plb",small:"psb",var:"pvb"},"3m.post-it-notes":"pwn","android.package-archive":"apk","antix.game-component":"atx","astraea-software.iota":"iota","chipnuts.karaoke-mmd":"mmd","data-vision.rdz":"rdz","denovo.fcselayout-link":"fe_launch","hhe.lesson-player":"les","hydrostatix.sof-data":"sfd-hdstx","jcp.javame.midlet-rms":"rms","joost.joda-archive":"joda","llamagraphics.life-balance.":{desktop:"lbd","exchange+xml":"lbe"},"osgeo.mapguide.package":"mgp","publishare-delta-tree":"qps","tao.intent-module-archive":"tao","yellowriver-custom-menu":"cmp"},"voicexml+xml":"vxml",widget:"wgt",winhlp:"hlp","wsdl+xml":"wsdl","wspolicy+xml":"wspolicy","x-":{abiword:"abw","authorware-":{bin:["aab","x32","u32","vox"],map:"aam",seg:"aas"},bcpio:"bcpio",bittorrent:"torrent",blorb:["blb","blorb"],bzip:"bz",bzip2:["bz2","boz"],cbr:["cbr","cba","cbt","cbz","cb7"],cdlink:"vcd",chat:"chat",conference:"nsc",cpio:"cpio",csh:"csh",director:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],doom:"wad","dtbncx+xml":"ncx","dtbook+xml":"dtb","dtbresource+xml":"res",dvi:"dvi",envoy:"evy",eva:"eva","font-":{bdf:"bdf",ghostscript:"gsf",otf:"otf",pcf:"pcf",snf:"snf",ttf:["ttf","ttc"],type1:["pfa","pfb","pfm","afm"],"linux-psf":"psf"},freearc:"arc",futuresplash:"spl",glulx:"ulx",gnumeric:"gnumeric",gtar:"gtar",hdf:"hdf",latex:"latex",mie:"mie","ms-":{application:"application",shortcut:"lnk",wmd:"wmd",wmz:"wmz",xbap:"xbap"},msaccess:"mdb",msbinder:"obd",mscardfile:"crd",msclip:"clp",msdownload:["exe","dll","com","bat","msi"],msmediaview:["mvb","m13","m14"],msmetafile:["wmf","wmz","emf","emz"],msmoney:"mny",mspublisher:"pub",msschedule:"scd",msterminal:"trm",mswrite:"wri",netcdf:["nc","cdf"],nzb:"nzb",pkcs12:["p12","pfx"],"pkcs7-":{certificates:["p7b","spc"],certreqresp:"p7r"},sh:"sh",shar:"shar",sql:"sql",stuffit:"sit",stuffitx:"sitx",subrip:"srt",sv4cpio:"sv4cpio",sv4crc:"sv4crc",tads:"gam",tar:"tar",tcl:"tcl",tex:"tex",texinfo:["texinfo","texi"],tgif:"obj",ustar:"ustar",xfig:"fig","xliff+xml":"xlf",xpinstall:"xpi",xz:"xz",zmachine:["z1","z2","z3","z4","z5","z6","z7","z8"],"7z-compressed":"7z","ace-compressed":"ace","apple-diskimage":"dmg","cfs-compressed":"cfs","chess-pgn":"pgn","debian-package":["deb","udeb"],"dgc-compressed":"dgc","gca-compressed":"gca","gramps-xml":"gramps","install-instructions":"install","iso9660-image":"iso","lzh-compressed":["lzh","lha"],"mobipocket-ebook":["prc","mobi"],"rar-compressed":"rar","shockwave-flash":"swf","silverlight-app":"xap","t3vm-image":"t3","tex-tfm":"tfm","wais-source":"src","java-jnlp-file":"jnlp","research-info-systems":"ris","x509-ca-cert":["der","crt"]},"xaml+xml":"xaml","xenc+xml":"xenc","xhtml+xml":["xhtml","xht"],xml:["xml","xsl"],"xop+xml":"xop","xproc+xml":"xpl","xslt+xml":"xslt","xspf+xml":"xspf","xv+xml":["mxml","xhvml","xvml","xvm"],yang:"yang","yin+xml":"yin",zip:"zip","andrew-inset":"ez","cu-seeme":"cu","octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy"],"oebps-package+xml":"opf","pics-rules":"prf","prs.cww":"cww","rls-services+xml":"rs","timestamped-data":"tsd","xcap-diff+xml":"xdf","xml-dtd":"dtd","patch-ops-error+xml":"xer","relax-ng-compact-syntax":"rnc"},"audio/":{adpcm:"adp",basic:["au","snd"],midi:["mid","midi","kar","rmi"],mp4:["m4a","mp4a"],mpeg:["mpga","mp2","mp2a","mp3","m2a","m3a"],ogg:["oga","ogg","spx"],s3m:"s3m",silk:"sil","vnd.":{dra:"dra",dts:"dts","nuera.":{ecelp4800:"ecelp4800",ecelp7470:"ecelp7470",ecelp9600:"ecelp9600"},rip:"rip","dece.audio":["uva","uvva"],"digital-winds":"eol","dts.hd":"dtshd","lucent.voice":"lvp","ms-playready.media.pya":"pya"},webm:"weba","x-":{aac:"aac",aiff:["aif","aiff","aifc"],caf:"caf",flac:"flac",matroska:"mka",mpegurl:"m3u","ms-":{wax:"wax",wma:"wma"},"pn-":{realaudio:["ram","ra"],"realaudio-plugin":"rmp"},wav:"wav"},xm:"xm"},"image/":{bmp:"bmp",cgm:"cgm",g3fax:"g3",gif:"gif",ief:"ief",jpeg:["jpeg","jpg","jpe"],ktx:"ktx",png:"png",sgi:"sgi","svg+xml":["svg","svgz"],tiff:["tiff","tif"],"vnd.":{djvu:["djvu","djv"],dwg:"dwg",dxf:"dxf",fastbidsheet:"fbs",fpx:"fpx",fst:"fst","ms-":{modi:"mdi",photo:"wdp"},xiff:"xif","adobe.photoshop":"psd","dece.graphic":["uvi","uvvi","uvg","uvvg"],"dvb.subtitle":"sub","fujixerox.edmics-":{mmr:"mmr",rlc:"rlc"},"net-fpx":"npx","wap.wbmp":"wbmp"},webp:"webp","x-":{"3ds":"3ds",cmx:"cmx",freehand:["fh","fhc","fh4","fh5","fh7"],icon:"ico",pcx:"pcx",pict:["pic","pct"],"portable-":{anymap:"pnm",bitmap:"pbm",graymap:"pgm",pixmap:"ppm"},rgb:"rgb",tga:"tga",xbitmap:"xbm",xpixmap:"xpm",xwindowdump:"xwd","cmu-raster":"ras","mrsid-image":"sid"},"prs.btif":"btif"},"model/":{iges:["igs","iges"],mesh:["msh","mesh","silo"],"vnd.":{"collada+xml":"dae",dwf:"dwf",gdl:"gdl",gtw:"gtw",mts:"mts",vtu:"vtu"},vrml:["wrl","vrml"],"x3d+binary":["x3db","x3dbz"],"x3d+vrml":["x3dv","x3dvz"],"x3d+xml":["x3d","x3dz"]},"text/":{calendar:["ics","ifb"],css:"css",csv:"csv",html:["html","htm"],n3:"n3",plain:["txt","text","conf","def","list","log","in"],richtext:"rtx",sgml:["sgml","sgm"],troff:["t","tr","roff","man","me","ms"],turtle:"ttl",vcard:"vcard","vnd.":{curl:"curl","curl.":{dcurl:"dcurl",mcurl:"mcurl",scurl:"scurl"},fly:"fly",graphviz:"gv","in3d.":{"3dml":"3dml",spot:"spot"},"wap.":{wml:"wml",wmlscript:"wmls"},"dvb.subtitle":"sub","fmi.flexstor":"flx","sun.j2me.app-descriptor":"jad"},"x-":{asm:["s","asm"],c:["c","cc","cxx","cpp","h","hh","dic"],fortran:["f","for","f77","f90"],nfo:"nfo",opml:"opml",pascal:["p","pas"],setext:"etx",sfv:"sfv",uuencode:"uu",vcalendar:"vcs",vcard:"vcf","java-source":"java"},"cache-manifest":"appcache","uri-list":["uri","uris","urls"],"prs.lines.tag":"dsc","tab-separated-values":"tsv"},"video/":{"3gpp":"3gp","3gpp2":"3g2",h261:"h261",h263:"h263",h264:"h264",jpeg:"jpgv",jpm:["jpm","jpgm"],mj2:["mj2","mjp2"],mp4:["mp4","mp4v","mpg4"],mpeg:["mpeg","mpg","mpe","m1v","m2v"],ogg:"ogv",quicktime:["qt","mov"],"vnd.":{"dece.":{hd:["uvh","uvvh"],mobile:["uvm","uvvm"],pd:["uvp","uvvp"],sd:["uvs","uvvs"],video:["uvv","uvvv"]},fvt:"fvt",mpegurl:["mxu","m4u"],vivo:"viv","dvb.file":"dvb","uvvu.mp4":["uvu","uvvu"],"ms-playready.media.pyv":"pyv"},webm:"webm","x-":{f4v:"f4v",fli:"fli",flv:"flv",m4v:"m4v",matroska:["mkv","mk3d","mks"],mng:"mng","ms-":{asf:["asf","asx"],vob:"vob",wm:"wm",wmv:"wmv",wmx:"wmx",wvx:"wvx"},msvideo:"avi",smv:"smv","sgi-movie":"movie"}},"chemical/x-":{cdx:"cdx",cif:"cif",cmdf:"cmdf",cml:"cml",csml:"csml",xyz:"xyz"},"message/rfc822":["eml","mime"],"x-conference/x-cooltalk":"ice"}},937484:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.VIDEO_MIMES=t.MSCFB_MIME=t.MSCFB_HEADER=t.MIMETYPE_DETERMINING_LENGTH=t.MIMETYPES=t.IMAGE_MIMES=t.EXT_TO_MIME=t.DOC_MIMES=t.DOCUMENT_MIMETYPES=void 0,t.getExtension=function(e){const t=d[e];return t?"."+(t.ext||e.split("/")[1]).toLowerCase():""},t.getMediaMimeType=function(e,t){const n=t.subarray(0,262),r=(0,l.default)(n);if(r)return r.mime;if("image"===e)return"image/jpeg";throw new s.MediaEncryptionError("unknown mime decrypt error for type:"+e)},t.isAllowedDocumentMimetype=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];for(const r in h){const i=d[r];if(null==i)continue;const{signatureMimetype:a,ext:o}=i;if((n?a:r)===e&&o&&(null==t?void 0:t.toLowerCase().endsWith(o.toLowerCase())))return r}if(n)return e;return null!=e?e:"application/octet-stream"},t.isMsCompoundFileBinaryFormat=function(e){return(0,a.default)(e,c)},t.isOpus=function(e){return!!e&&e.includes("audio/ogg")},t.previewType=function(e){const t=d[e];return null==t?void 0:t.previewType};var i=r(n(535937)),a=r(n(235670)),o=r(n(118702)),s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),l=r(n(397769));function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}t.MIMETYPE_DETERMINING_LENGTH=262;const c=new Uint8Array([208,207,17,224,161,177,26,225]);t.MSCFB_HEADER=c;t.MSCFB_MIME="application/x-cfb";const d={"text/plain":{ext:"TXT",msgType:"document",icon:"icon-doc-txt",canSend:!0},"text/rtf":{ext:"RTF",msgType:"document",icon:"icon-doc-doc",canSend:!0,signatureMimetype:"application/rtf"},"text/vcard":{ext:"VCF",msgType:"vcard"},"application/zip":{ext:"ZIP",icon:"icon-doc-generic",msgType:"document"},"application/pdf":{ext:"PDF",msgType:"document",icon:"icon-doc-pdf",canSend:!0,signatureMimetype:"application/pdf",previewType:"pdf"},"application/msword":{ext:"DOC",msgType:"document",icon:"icon-doc-doc",canSend:!0,signatureMimetype:"application/x-msi",previewType:"msoffice"},"application/vnd.ms-excel":{ext:"XLS",msgType:"document",icon:"icon-doc-xls",canSend:!0,signatureMimetype:"application/x-msi",previewType:"msoffice"},"application/vnd.ms-powerpoint":{ext:"PPT",msgType:"document",icon:"icon-doc-ppt",canSend:!0,signatureMimetype:"application/x-msi",previewType:"msoffice"},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{ext:"DOCX",msgType:"document",icon:"icon-doc-doc",canSend:!0,signatureMimetype:"application/zip",previewType:"msoffice"},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{ext:"PPTX",msgType:"document",icon:"icon-doc-ppt",canSend:!0,signatureMimetype:"application/zip",previewType:"msoffice"},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{ext:"XLSX",msgType:"document",icon:"icon-doc-xls",canSend:!0,signatureMimetype:"application/zip",previewType:"msoffice"},"audio/aac":{msgType:"audio",ext:"AAC"},"audio/mp4":{msgType:"audio"},"audio/amr":{msgType:"audio"},"audio/mpeg":{msgType:"audio"},"audio/ogg; codecs=opus":{msgType:"audio",ext:"OGG"},"audio/wav":{msgType:"audio",ext:"wav"},"video/mp4":{msgType:"video",ext:"MP4"},"video/3gpp":{msgType:"video"},"image/jpeg":{msgType:"image"},"image/png":{msgType:"image"}},p=d;t.MIMETYPES=p;const _=(0,i.default)(p,(e=>"document"===(null==e?void 0:e.msgType)));t.DOCUMENT_MIMETYPES=_;t.DOC_MIMES="*";t.IMAGE_MIMES="image/*";t.VIDEO_MIMES="video/mp4,video/3gpp,video/quicktime";const f=(0,o.default)();t.EXT_TO_MIME=f;const h=(0,i.default)(d,(e=>"document"===(null==e?void 0:e.msgType)&&!0===e.canSend&&null!=e.ext))},118702:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){try{const t=null!=e&&""!==e?JSON.parse(e):a.default,n={};return o(t,n,"",""),n}catch(e){return null}};var i=n(425315),a=r(n(355631));function o(e,t,n,r){let a=e;if(Array.isArray(a)||(0,i.isString)(a)){(0,i.isString)(a)&&(a=[a]);for(let e=0;e<a.length;e++){const o=a[e];(0,i.isString)(o)&&(t[o]=r+n)}}else if("object"==typeof a)for(const e in a)o(a[e],t,e,r+n)}},947638:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FILE_PROGRESS_THROTTLE_WAIT_MS=void 0;t.FILE_PROGRESS_THROTTLE_WAIT_MS=100},708761:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MEDIA_TYPE_VALUES=t.MEDIA_TYPES=void 0,t.castToV4=function(e){let t;if(null==e)t=s.DOCUMENT;else{if(!(e in s))throw new Error(`castToV4: unexpected mmsv3 type ${e}`);t=s[e]}return t},t.getMsgMediaType=function(e){return u({type:e.type,interactiveHeader:e.interactiveHeader,isGif:e.type===o.MSG_TYPE.VIDEO&&e.isGif})},t.msgToMediaType=u;var i=r(n(252628)),a=n(943914),o=n(373070);const s=Object.freeze({AUDIO:"audio",DOCUMENT:"document",GIF:"gif",IMAGE:"image",NATIVE_FLOW:"native_flow",PPIC:"ppic",PRODUCT:"product",PTT:"ptt",STICKER:"sticker",VIDEO:"video",TEMPLATE:"template",THUMBNAIL_DOCUMENT:"thumbnail-document",THUMBNAIL_IMAGE:"thumbnail-image",THUMBNAIL_VIDEO:"thumbnail-video",THUMBNAIL_LINK:"thumbnail-link",HISTORY_SYNC:"md-msg-hist",MD_APP_STATE:"md-app-state",PRODUCT_CATALOG_IMAGE:"product-catalog-image",PAYMENT_BG_IMAGE:"payment-bg-image",BIZ_COVER_PHOTO:"biz-cover-photo",PREVIEW:"preview"});t.MEDIA_TYPES=s;const l=(0,i.default)(s);function u(e){let{type:t,isGif:n,interactiveHeader:r}=e;switch(t){case o.MSG_TYPE.IMAGE:return s.IMAGE;case o.MSG_TYPE.VIDEO:return n?s.GIF:s.VIDEO;case o.MSG_TYPE.AUDIO:return s.AUDIO;case o.MSG_TYPE.PTT:return s.PTT;case o.MSG_TYPE.DOCUMENT:return s.DOCUMENT;case o.MSG_TYPE.STICKER:return s.STICKER;case o.MSG_TYPE.PRODUCT:return s.PRODUCT;case o.MSG_TYPE.NATIVE_FLOW:return s.NATIVE_FLOW;case o.MSG_TYPE.INTERACTIVE:if(null!=(null==r?void 0:r.mediaType))switch(r.mediaType){case a.InteractiveMessageHeaderMediaType.DOCUMENT:return s.DOCUMENT;case a.InteractiveMessageHeaderMediaType.VIDEO:return s.VIDEO;case a.InteractiveMessageHeaderMediaType.IMAGE:return s.IMAGE}}throw new Error(`msg is not a media msg: ${t}, isGif=${String(n)}`)}t.MEDIA_TYPE_VALUES=l},166034:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={DOWNLOAD:"DOWNLOAD",UPLOAD:"UPLOAD"};t.default=n},677332:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.calculateFilehashFromBlob=function(e){return(e instanceof s.default?(0,o.opaqueDataToArrayBuffer)(e):(0,a.blobToArrayBuffer)(e)).then((e=>(0,i.calculateFilehash)(e))).catch((t=>{const n={error:`${t}`,blobSize:e.size,isOpaqueData:e instanceof s.default};__LOG__(3,void 0,void 0,!0)`calculateFilehashFromBlob error. Debug:\n${JSON.stringify(n,null,2)}`,SEND_LOGS("calculate-filehash-from-blob-error")}))};var i=n(502010),a=n(698210),o=n(232294),s=r(n(756680))},794219:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){const a=16*Math.ceil(e/16),o=t.slice(0,i.IV_LENGTH+a);return(0,r.hmacSha256)(n,o,i.HMAC_LENGTH)};var r=n(128326),i=n(186884)},186884:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.IV_LENGTH=t.HMAC_LENGTH=void 0,t.calculateStreamingSidecar=function(){return u.apply(this,arguments)};var i=r(n(348926)),a=r(n(498913)),o=n(145335),s=n(128326);const l=65536;t.IV_LENGTH=16;function u(){return(u=(0,i.default)((function*(e,t){const n=e instanceof ArrayBuffer?e.byteLength:e.buffer.byteLength,r=Math.ceil((n-16)/l),i=(0,a.default)(r,(n=>{const r=n*l,i=e.slice(r,r+16+l);return(0,s.hmacSha256)(t,i,10)})),u=yield Promise.all(i);return(0,o.concatArrayBuffers)(...u)}))).apply(this,arguments)}t.HMAC_LENGTH=10},904219:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(417405),o=n(684659),s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),l=n(708761);function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function c(){return(c=(0,i.default)((function*(e,t){const n=d(e);let r;try{r=(0,a.decodeB64)(t)}catch(e){}if(!t||!n||!r)throw new s.MediaEncryptionError(`createKeys fail: !!mediakey: ${!!t} info: ${n} type: ${e}`);const i=yield(0,o.extractAndExpand)(r,n,112);if(!i||i.byteLength<112)throw new s.MediaEncryptionError("computeMediaKeys: hkdf error");return{iv:i.slice(0,16),encKey:i.slice(16,48),macKey:i.slice(48,80),refKey:i.slice(80,112)}}))).apply(this,arguments)}function d(e){switch(e){case l.MEDIA_TYPES.AUDIO:return"WhatsApp Audio Keys";case l.MEDIA_TYPES.DOCUMENT:return"WhatsApp Document Keys";case l.MEDIA_TYPES.GIF:return"WhatsApp Video Keys";case l.MEDIA_TYPES.IMAGE:return"WhatsApp Image Keys";case l.MEDIA_TYPES.PPIC:throw new Error("Cannot create media keys for profile pics");case l.MEDIA_TYPES.PRODUCT:return"WhatsApp Image Keys";case l.MEDIA_TYPES.PTT:return"WhatsApp Audio Keys";case l.MEDIA_TYPES.STICKER:return"WhatsApp Image Keys";case l.MEDIA_TYPES.VIDEO:return"WhatsApp Video Keys";case l.MEDIA_TYPES.THUMBNAIL_DOCUMENT:return"WhatsApp Document Thumbnail Keys";case l.MEDIA_TYPES.THUMBNAIL_IMAGE:return"WhatsApp Image Thumbnail Keys";case l.MEDIA_TYPES.THUMBNAIL_VIDEO:return"WhatsApp Video Thumbnail Keys";case l.MEDIA_TYPES.THUMBNAIL_LINK:return"WhatsApp Link Thumbnail Keys";case l.MEDIA_TYPES.TEMPLATE:throw new Error("Cannot create media keys for template");case l.MEDIA_TYPES.HISTORY_SYNC:return"WhatsApp History Keys";case l.MEDIA_TYPES.MD_APP_STATE:return"WhatsApp App State Keys";case l.MEDIA_TYPES.PRODUCT_CATALOG_IMAGE:throw new Error("Cannot create media keys for product catalog image");case l.MEDIA_TYPES.PAYMENT_BG_IMAGE:return"WhatsApp Payment Background Keys"}}},75170:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return f.apply(this,arguments)};var i=r(n(348926)),a=n(826507),o=n(128326),s=n(703177),l=n(502010),u=n(691015),c=n(786702),d=n(288057),p=n(245598);const _=10;function f(){return(f=(0,i.default)((function*(e){let{mediaKeys:t,ciphertextHmac:n,expectedPlaintextHash:r,debugString:f}=e;if(yield Promise.resolve(),__LOG__(2)`decryptMedia: [${f}] start`,n.byteLength<_)throw new d.MediaDecryptionError(`ciphertext too short: ${n.byteLength}`);const{iv:h,encKey:g,macKey:m}=t,y=(0,u.castTypedArrays)(Uint8Array,n);try{return yield(0,o.hmacSha256)(m,(0,c.concatTypedArrays)(Uint8Array,[new Uint8Array(h),(0,p.isPerformanceExperimentEnabled)()?y.subarray(0,-10):y.slice(0,-10)]),_).then((e=>{const t=y.buffer.slice(-10);if(!(0,s.arrayBuffersEqual)(e,t))throw new d.MediaDecryptionError("decryptMedia: hmac mismatch");return(0,a.aesCbcDecrypt)(g,h,y.subarray(0,-10))})).then(function(){var e=(0,i.default)((function*(e){if(null==r)return e;if((yield(0,l.calculateFilehash)(e))!==r)throw new d.MediaDecryptionError("decryptMedia: plaintext hash mismatch");return __LOG__(2)`decryptMedia: [${f}] success`,e}));return function(){return e.apply(this,arguments)}}())}catch(e){if(__LOG__(3)`decryptMedia: [${f}] error`,e instanceof d.MediaDecryptionError)throw e;throw new d.MediaDecryptionError(`decryption error: ${String(e)}; stack: ${e.stack}`)}}))).apply(this,arguments)}},98516:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.decryptPartialMedia=t.decrypt=t.cleanupCiphertextAndIv=t.HMAC_SIZE=t.BLOCK_SIZE=void 0;var i=r(n(348926)),a=n(786702);t.BLOCK_SIZE=16;t.HMAC_SIZE=10;const o=function(){var e=(0,i.default)((function*(e){const{ciphertext:t,iv:n,mediaKeys:r}=e,{encKey:i}=r;try{const e=yield self.crypto.subtle.importKey("raw",new Uint8Array(i),"AES-CBC",!1,["decrypt"]).catch((e=>{throw __LOG__(2)`decryptPartialMedia:decrypt importKey error: ${String(e)}`,e}));return self.crypto.subtle.decrypt({name:"AES-CBC",iv:n},e,t)}catch(e){throw __LOG__(2)`decryptPartialMedia:decrypt decrypt error: ${String(e)}`,e}}));return function(){return e.apply(this,arguments)}}();t.decrypt=o;const s=function(){var e=(0,i.default)((function*(e){const{ciphertext:t,mediaKeys:n}=e,{encKey:r}=n,i={name:"AES-CBC",iv:(t instanceof Uint8Array?t:new Uint8Array(t)).slice(-16)};try{const e=yield self.crypto.subtle.importKey("raw",new Uint8Array(r),"AES-CBC",!1,["encrypt"]).catch((e=>{__LOG__(2)`decryptPartialMedia:getEncryptedPadding importKey error: ${String(e)}`})),t=new Uint8Array([]);return self.crypto.subtle.encrypt(i,e,t)}catch(e){return void __LOG__(2)`decryptPartialMedia:getEncryptedPadding encrypt error: ${String(e)}`}}));return function(){return e.apply(this,arguments)}}(),l=e=>{const{serverRangeStart:t,ciphertext:n,mediaKeys:r}=e;let i=n instanceof Uint8Array?n:new Uint8Array(n);const o=i.byteLength%16==0;let l;return 0===t?l=new Uint8Array(r.iv):(l=i.slice(0,16),i=i.slice(16)),o||(i=i.slice(0,i.byteLength-10)),o?s({ciphertext:i,mediaKeys:r}).then((e=>(i=(0,a.concatTypedArrays)(Uint8Array,[i,new Uint8Array(e)]),{ciphertext:i,iv:l}))):Promise.resolve({ciphertext:i,iv:l})};t.cleanupCiphertextAndIv=l;const u=function(){var e=(0,i.default)((function*(e){let{mediaKeys:t,ciphertext:n}=e;const{ciphertext:r,iv:i}=yield l({serverRangeStart:0,ciphertext:n,mediaKeys:t});return o({ciphertext:r,iv:i,mediaKeys:t})}));return function(){return e.apply(this,arguments)}}();t.decryptPartialMedia=u},584656:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{mediaKey:t,plaintext:n,type:r}=e;return new Promise(((e,i)=>{if(t.slice(0,10),__LOG__(2)`encryptMedia: start`,!r)throw new f.MediaEncryptionError('encryptMedia: missing "type"');if(!t)throw new f.MediaEncryptionError('encryptMedia: missing "mediaKey"');(0,_.default)(r,t).then((e=>(0,g.isPerformanceExperimentEnabled)()?function(){return T.apply(this,arguments)}(n,r,e):function(){return y.apply(this,arguments)}(n,r,e))).then((t=>{__LOG__(2)`encryptMedia: success`,e(t)})).catch((e=>{if(__LOG__(3)`encryptMedia: error`,e instanceof f.MediaEncryptionError)throw e;throw new f.MediaEncryptionError(`encryption error: ${String(e)}; stack: ${e.stack}`)})).catch(i)}))};var i=r(n(348926)),a=n(145335),o=n(826507),s=n(128326),l=n(502010),u=n(204597),c=n(786702),d=r(n(794219)),p=n(186884),_=r(n(904219)),f=n(288057),h=n(708761),g=n(245598),m=n(724743);function y(){return(y=(0,i.default)((function*(e,t,n){let{iv:r,encKey:i,macKey:c}=n;const _=yield(0,o.aesCbcEncrypt)(i,e,r),f=_.slice(r.byteLength),g=yield(0,s.hmacSha256)(c,_,10);let y=Promise.resolve();if(t===h.MEDIA_TYPES.VIDEO||t===h.MEDIA_TYPES.AUDIO){const e=(0,a.concatArrayBuffers)(_,g);y=(0,p.calculateStreamingSidecar)(e,c)}let E=Promise.resolve();if(t===h.MEDIA_TYPES.STICKER){const{firstFrameLength:t}=(0,m.parseWebp)(e);if(null!=t){const e=(0,a.concatArrayBuffers)(_,g);E=(0,d.default)(t,e,c)}}const S=(0,a.concatArrayBuffers)(f,g);return(0,u.promiseProps)({ciphertextHmac:S,hash:(0,l.calculateFilehash)(S),sidecar:y,firstFrameSidecar:E})}))).apply(this,arguments)}function E(e){let{ivCiphertext:t,signature:n,macKey:r}=e;const i=(0,a.concatArrayBuffers)(t,n);return{sidecar:(0,p.calculateStreamingSidecar)(i,r),firstFrameSidecar:Promise.resolve()}}const S=new Map([[h.MEDIA_TYPES.VIDEO,E],[h.MEDIA_TYPES.AUDIO,E],[h.MEDIA_TYPES.STICKER,function(e){let{plaintext:t,ivCiphertext:n,signature:r,macKey:i}=e;const{firstFrameLength:o}=(0,m.parseWebp)(t);return{sidecar:Promise.resolve(),firstFrameSidecar:null!=o?(0,d.default)(o,(0,a.concatArrayBuffers)(n,r),i):Promise.resolve()}}]]);function T(){return(T=(0,i.default)((function*(e,t,n){var r,i;let{iv:a,encKey:d,macKey:p}=n;const _=(0,g.shouldEncryptInChunks)(e.byteLength)?yield(0,o.aesCbcEncryptWithChunking)(d,e,a):yield(0,o.aesCbcEncrypt)(d,e,a),f=new Uint8Array(_).subarray(a.byteLength),h=yield(0,s.hmacSha256)(p,_,10),{sidecar:m=Promise.resolve(),firstFrameSidecar:y=Promise.resolve()}=null!==(r=null===(i=S.get(t))||void 0===i?void 0:i({plaintext:e,ivCiphertext:_,signature:h,macKey:p}))&&void 0!==r?r:{},E=(0,c.concatTypedArrays)(Uint8Array,[f,new Uint8Array(h)]).buffer;return(0,u.promiseProps)({ciphertextHmac:E,hash:(0,l.calculateFilehash)(E),sidecar:m,firstFrameSidecar:y})}))).apply(this,arguments)}},874962:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ImageStreamer=t.EOI_TAG=void 0,t.getProgressiveMediaCacheKey=E;var i=r(n(348926)),a=n(889441),o=n(81758),s=n(153260),l=n(826507),u=n(128326),c=n(703177),d=n(643930),p=n(786702),_=n(196127);class f extends((0,d.customError)("ChunkValidationError")){constructor(e){super(`Chunk ${e} does not match sidecar`)}}const h=16,g=new Uint8Array([2,2]),m=new Uint8Array([255,217]);t.EOI_TAG=m;function y(){return(y=(0,i.default)((function*(e,t){const{encKey:n}=t;return(yield(0,l.aesCbcEncrypt)(n,g,new Uint8Array(e.slice(-16)))).slice(-16)}))).apply(this,arguments)}function E(e,t){return`${e}-progressive-${t}`}t.ImageStreamer=class{constructor(e){this._alignedScanLengths=[],this._increasingScanLengths=[],this._lastDecryptedChunk=0,this._downloadedBytes=new ArrayBuffer(0);const{cryptoKeys:t,scanLengths:n,scansSidecar:r,filehash:i,mimetype:a,debugString:o,onProgressiveUpdate:s}=e;this._cryptoKeys=t,this._scanLengths=n,this._scansSideCar=r,this._filehash=i,this._mimetype=a,this._nextChunkIV=this._cryptoKeys.iv,this._decryptedChunks=new Array(n.length),this._onProgressiveUpdate=s,this._debugString=o}_validateSidecar(e,t){var n=this;return(0,i.default)((function*(){0===t&&(n._nextChunkIV=n._cryptoKeys.iv);const{macKey:r}=n._cryptoKeys,i=n._scansSideCar.slice(10*t,10*t+10),a=n._nextChunkIV;n._nextChunkIV=e.slice(-16);const o=(0,p.concatTypedArrays)(Uint8Array,[new Uint8Array(a),new Uint8Array(e)]),s=yield(0,u.hmacSha256)(r,o,10);if(!(0,c.arrayBuffersEqual)(s,i))throw new f(t)}))()}_cleanupCipherTextAndIV(e,t){var n=this;return(0,i.default)((function*(){let r=e;const i=r.byteLength%h==0;let a;if(0===t)a=n._cryptoKeys.iv;else{const e=n._increasingScanLengths[t-1];a=n._downloadedBytes.slice(e-h,e)}if(i||(r=r.slice(0,r.byteLength-10)),i){const e=yield function(){return y.apply(this,arguments)}(r,n._cryptoKeys);return{cipherText:(0,p.concatTypedArrays)(Uint8Array,[new Uint8Array(r),new Uint8Array(e)]),iv:a}}return{cipherText:r,iv:a}}))()}_getLastFullyLoadedChunkIndex(e){let t=0;for(let n=0;n<this._alignedScanLengths.length;n++)if(t+=this._alignedScanLengths[n],e<t)return n;return this._alignedScanLengths.length}_handleChunk(e,t){var n=this;return(0,i.default)((function*(){yield n._validateSidecar(e,t);const{cipherText:r,iv:i}=yield n._cleanupCipherTextAndIV(e,t),a=yield(0,l.aesCbcDecrypt)(n._cryptoKeys.encKey,i,r),o=yield(0,s.removeEncryptedPadding)(a,g.buffer);return __LOG__(2)`ImageStreamer: [${n._debugString}] Successfully decrypted chunk ${t} of ${n._scanLengths.length} total`,o}))()}_generateBlobFromFullyLoadedChunks(e){var t=this;return(0,i.default)((function*(){var n;const r=yield Promise.all(t._decryptedChunks.slice(0,e)),i=t._scanLengths.slice(0,e).reduce(((e,t)=>e+t),0),a=(0,p.concatTypedArrays)(Uint8Array,r.map((e=>new Uint8Array(e)))).slice(0,i),o=(0,c.arrayBuffersEqual)(m.buffer,a.slice(-m.length).buffer)?a:(0,p.concatTypedArrays)(Uint8Array,[a,m]),s=[o],l=t._mimetype?new Blob(s,{type:t._mimetype}):new Blob(s),u=E(t._filehash,e);return _.MediaBlobCache.put(u,l),__LOG__(2)`ImageStreamer: [${t._debugString}] Generated progressive image using ${e} chunks of ${t._scanLengths.length} total`,null===(n=t._onProgressiveUpdate)||void 0===n||n.call(t,e),t._lastDecryptedChunk=e,o.buffer}))()}_decryptFullyLoadedChunks(e,t){var n=this;return(0,i.default)((function*(){for(let r=0;r<t;r++)if(!n._decryptedChunks[r]){const t=0===r?0:n._increasingScanLengths[r-1],i=e.slice(t,t+n._alignedScanLengths[r]);yield Promise.all(n._decryptedChunks),n._decryptedChunks[r]||(n._decryptedChunks[r]=n._handleChunk(i,r))}}))()}handleProgress(e,t){var n=this;return(0,i.default)((function*(){if(!n._alignedScanLengths.length){n._alignedScanLengths=(0,a.alignChunkLengthsToMultipleOfAesBlockSize)(n._scanLengths,e);for(let e=0;e<n._alignedScanLengths.length;e++){const t=n._alignedScanLengths[e],r=0===e?t:n._increasingScanLengths[e-1]+t;n._increasingScanLengths.push(r)}}const r="string"==typeof t?t.length:t.byteLength,i=n._getLastFullyLoadedChunkIndex(r);if(i<=n._lastDecryptedChunk)return null;try{const e="string"==typeof t?yield(0,o.largeStringToArrayBuffer)(t):t;return n._downloadedBytes=e,yield n._decryptFullyLoadedChunks(n._downloadedBytes,i),yield n._generateBlobFromFullyLoadedChunks(i)}catch(e){__LOG__(3)`ImageStreamer:handleProgress error: ${e}`;const t=`${e.message}, [${n._debugString}]scanLengths length: ${n._scanLengths.length}, scansSidecar byteLength: ${n._scansSideCar.byteLength}.`;e instanceof f?(__LOG__(2)`ImageStreamer:chunk validation error: ${t}`,__LOG__(4,void 0,new Error,!0)`ImageStreamer:chunk validation error`,SEND_LOGS("ImageStreamer:chunk validation error")):(__LOG__(2)`ImageStreamer:handleProgress error: ${t}`,__LOG__(4,void 0,new Error,!0)`ImageStreamer:handleProgress error`,SEND_LOGS("ImageStreamer:handleProgress error"))}}))()}}},507511:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){const e=new Uint8Array(32);return self.crypto.getRandomValues(e),{key:(0,r.encodeB64)(e),timestamp:(0,i.unixTime)()}};var r=n(417405),i=n(990445)},776687:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;const n=(0,a.generateMediaEventId)(),r=new o.default.MediaDownload2({mediaId:n,connectionType:o.default.CONNECTION_TYPE.HOSTNAME,overallMediaType:(0,a.getMetricMediaType)(e.type),overallMmsVersion:4,networkStack:o.default.NETWORK_STACK_TYPE.NATIVE,overallDownloadMode:(0,a.getMetricOverallDownloadModeType)(e.type,e.downloadMode,e.isPrefetch),overallAttemptCount:e.userDownloadAttemptCount,overallDownloadOrigin:e.downloadOrigin,overallBackendStore:null!==(t=(0,a.getMetricBackendStore)(e.directPath))&&void 0!==t?t:void 0,isViewOnce:e.isViewOnce});return i.downloadUploadCrashLogger.mark(n,i.ProgressType.DOWNLOAD_STARTED),{mediaId:n,handleDownloadSuccess:e=>{r.set({overallMediaSize:e,overallDownloadResult:o.default.MEDIA_DOWNLOAD_RESULT_TYPE.OK,overallIsFinal:!0,downloadHttpCode:200}),i.downloadUploadCrashLogger.mark(n,i.ProgressType.DOWNLOAD_FINISHED,{overallMediaSize:e})},handleDownloadHostFound:e=>{let{hostName:t,hostClass:n,failCount:i}=e;r.set({overallDomain:t,overallConnectionClass:n,overallRetryCount:i})},handleDownloadError:(e,t)=>{r.set({overallDownloadResult:(0,a.getMetricDownloadErrorResultType)(e),overallIsFinal:t});const n=(0,a.getStatusCode)(e);null!=n&&(r.downloadHttpCode=n),r.markOverallCumT(),r.commit(),(0,a.logErrorUnknownDetails)(r,e)},handleDownloadAttemptSuccess:e=>{r.set({overallT:e})},handleDownloadAttemptError:e=>{let{err:t,overallT:n,failCount:i}=e;const s=new o.default.MediaDownload2(r);s.set({mediaId:(0,a.generateMediaEventId)(),overallDownloadResult:(0,a.getMetricDownloadErrorResultType)(t),overallIsFinal:!1,overallT:n,overallRetryCount:i});const l=(0,a.getStatusCode)(t);null!=l&&(r.downloadHttpCode=l),r.markOverallCumT(),s.commit(),(0,a.logErrorUnknownDetails)(s,t)},handleDownloadAndDecryptSuccess:()=>{r.markOverallCumT(),r.commit()},markDecryptionEnd:()=>{r.markOverallDecryptT()},markDecryptionStart:()=>{r.startOverallDecryptT()}}};var i=n(300098),a=n(464404),o=r(n(571834))},809293:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DownloadAndDecryptCache=void 0,t.getLRUStoreKey=l;var i=r(n(348926)),a=n(232294),o=n(719621),s=r(n(281007));function l(e){var t,n;const r=null===(t=e.progressiveJpegOpts)||void 0===t?void 0:t.scanCount,i=null===(n=e.progressiveJpegOpts)||void 0===n?void 0:n.scanLengths;if(null!=r&&i)return`${e.filehash}-${r}/${i.length}-scans`;if(e.partialVideoOpts){const{secondsToDownload:t}=e.partialVideoOpts;return`${e.filehash}-${t}-seconds`}return e.filehash}t.DownloadAndDecryptCache=class{get(e,t){return(0,i.default)((function*(){if(!(0,a.shouldUseLruMediaStore)(t.type))return null;try{return yield o.LruMediaStore.get(l(t))}catch(e){return __LOG__(3,!0)`downloadManager.asyncCache.get error:\n${(0,s.default)(e)}`,null}}))()}set(e,t,n){return(0,i.default)((function*(){if((0,a.shouldUseLruMediaStore)(n.type))try{yield o.LruMediaStore.put(l(n),t)}catch(e){__LOG__(3,!0)`downloadManager.asyncCache.set error:\n${(0,s.default)(e)}`}}))()}}},941555:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.downloadManager=void 0;var a=i(n(81109)),o=i(n(348926)),s=i(n(431584)),l=i(n(624877)),u=i(n(947077)),c=i(n(132375)),d=n(984330),p=i(n(776687)),_=i(n(904219)),f=i(n(75170)),h=n(98516),g=n(874962),m=n(809293),y=n(707132),E=i(n(969663)),S=n(189123),T=n(172259),v=n(288057),A=i(n(28790)),C=n(263958),P=n(300098),O=n(708761),I=n(192737),M=i(n(281007)),b=i(n(571834));const R=1,N=2,w=e=>{switch(e){case O.MEDIA_TYPES.THUMBNAIL_DOCUMENT:return N;case O.MEDIA_TYPES.VIDEO:default:return R}};function L(){return D.apply(this,arguments)}function D(){return(D=(0,o.default)((function*(e){const{directPath:t,encFilehash:n,filehash:i,mediaKey:a,onDecryptStart:o,downloadOrigin:s,staticUrl:l,type:u,mode:d,progressiveJpegOpts:m,partialVideoOpts:y,onProgress:S,userDownloadAttemptCount:T,isViewOnce:v}=e,O=null==m?void 0:m.scanCount,I=null!=O&&O===(null==m?void 0:m.scanLengths.length),b=I?null:O,{handleDownloadSuccess:R,handleDownloadHostFound:N,handleDownloadError:w,handleDownloadAttemptSuccess:L,handleDownloadAttemptError:D,handleDownloadAndDecryptSuccess:k,markDecryptionStart:U,markDecryptionEnd:G,mediaId:x}=(0,p.default)({directPath:t,downloadOrigin:s,type:u,userDownloadAttemptCount:T,isViewOnce:v,downloadMode:d,isPrefetch:null!=m&&!I}),F=e.signal||(new r).signal,j=i.slice(0,10);__LOG__(2)`downloadManager.download: [${j}] start`;try{let e=null;const r=(0,E.default)({partialVideoOpts:y,progressiveJpegOpts:m,scanCount:b}),s=null==b&&m?(t,n)=>{var r;null===(r=e)||void 0===r||r.handleProgress(t.total,n)}:null,[p,T,v]=yield Promise.all([(0,_.default)(u,a).then((t=>(m&&(e=new g.ImageStreamer({cryptoKeys:t,scanLengths:m.scanLengths,scansSidecar:m.scansSidecar,mimetype:m.mimetype,filehash:i,debugString:j,onProgressiveUpdate:m.onProgressiveUpdate})),t))),B({scanCount:b,directPath:t,encFilehash:n,type:u,signal:F}),A.default.download({directPath:t,encFilehash:n,staticUrl:l,type:u,signal:F,mode:d,byteRange:r,onResponseText:s,onDownloadHostFound:N,onDownloadAttemptSuccess:L,onDownloadAttemptError:D,debugString:j,onProgress:S})]);let C;var Y;if(o&&o(),R(v.byteLength),P.downloadUploadCrashLogger.mark(x,P.ProgressType.DOWNLOAD_DECRYPTION_STARTED),U(),null!=b)C=(0,c.default)(yield null===(Y=e)||void 0===Y?void 0:Y.handleProgress(T,v),"// $FlowFixMe[incompatible-call] (T107023495) Upgrade to Flow's constrain writes mode\nyield imageStreamer?.handleProgress(encryptedFileSize, ciphertextHmac)");else C=y?yield(0,h.decryptPartialMedia)({mediaKeys:p,ciphertext:v}):yield(0,f.default)({mediaKeys:p,ciphertextHmac:v,expectedPlaintextHash:i,debugString:j});return G(),P.downloadUploadCrashLogger.mark(x,P.ProgressType.DOWNLOAD_DECRYPTION_FINISHED),__LOG__(2)`downloadManager.download: [${j}] success`,k(),C}catch(t){throw t instanceof C.MediaNotFoundError?(w(t,Boolean(e.isFinalRmrRetry)),__LOG__(2,!0)`downloadManager.download: [${j}] expected error\n${(0,M.default)(t)}`):(w(t,!0),__LOG__(3,!0)`downloadManager.download: [${j}] error\n${(0,M.default)(t)}`),P.downloadUploadCrashLogger.mark(x,P.ProgressType.DOWNLOAD_ERROR),t}}))).apply(this,arguments)}function k(){return U.apply(this,arguments)}function U(){return(U=(0,o.default)((function*(e){var t,n;const{mediaObject:r}=e,i=null!==(t=null===(n=r.filehash)||void 0===n?void 0:n.slice(0,10))&&void 0!==t?t:"";r.filehash,r.type,__LOG__(2)`downloadManager.rmr: [${i}] start`,r.consolidate({downloadStage:T.DOWNLOAD_STAGE.REUPLOADING});const o=performance.now(),s=new b.default.WebcMediaRmr((0,a.default)((0,a.default)({},e.rmrData),{},{webcRmrReason:e.rmrReason})),l=(0,I.getEffectiveNetworkType)();null!=l&&(s.webcBrowserNetworkType=l),r.type&&(s.messageMediaType=(0,S.webMediaTypeToWamMediaType)(r.type)),null!=r.size&&(s.webcMediaSize=r.size);try{const e=yield r.rmr({onMsgSelect:function(e){null==s.webcChatType&&e.chat&&(s.webcChatType=e.chat.getWebcChatType()),null==s.webcMessageT&&(s.webcMessageT=e.t),s.messageMediaType=e.getWamMediaType()}});if(s.webcRmrStatusCode=e,__LOG__(2)`downloadManager.rmr: [${i}] status ${e}`,404===e)throw new y.MediaNotOnPhone;if(200!==e)throw new d.ServerStatusCodeError(e)}catch(e){throw s.webcMediaRmrError=!0,e instanceof y.MediaNotOnPhone?(__LOG__(2,!0)`downloadManager.rmr: [${i}] error MediaNotOnPhone\n${(0,M.default)(e)}`,e):(__LOG__(3,!0)`downloadManager.rmr: [${i}] error ${e.status||e.message}\n${e.stack}`,new v.MediaNeedsReupload)}finally{s.webcMediaRmrT=Math.ceil(performance.now()-o),s.commit()}}))).apply(this,arguments)}function G(){return x.apply(this,arguments)}function x(){return(x=(0,o.default)((function*(e){const{directPath:t,encFilehash:n,signal:i,type:a}=e;yield A.default.checkExistence({directPath:t,encFilehash:n,type:a,signal:i||(new r).signal})}))).apply(this,arguments)}function B(e){const{scanCount:t,directPath:n,encFilehash:r,type:i,signal:a}=e;return null==t?Promise.resolve(null):A.default.getEncryptedMediaSize({directPath:(0,c.default)(n,"directPath is required for partial downloads"),encFilehash:(0,c.default)(r,"encFilehash is required for partial downloads"),signal:a,type:i})}const F=new class{constructor(){this.preloader=new l.default(10,{thumbnail:4}),this.downloadAndDecrypt=(0,s.default)((e=>(0,m.getLRUStoreKey)(e)),new m.DownloadAndDecryptCache,(e=>!0===e.isPreload?this.preloader.enqueue((()=>L(e)),{priority:-w(e.type),group:"thumbnail",signal:e.signal}):L(e))),this.rmr=(0,u.default)((e=>e.mediaObject.filehash||""),k),this.checkExistence=(0,u.default)((e=>e.encFilehash),G),P.downloadUploadCrashLogger.init()}};t.downloadManager=F},707132:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediaNotOnPhone=void 0;var r=n(984330);class i extends r.ServerStatusCodeError{constructor(){super(404),this.name="MediaNotOnPhone"}}t.MediaNotOnPhone=i},969663:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{partialVideoOpts:t,progressiveJpegOpts:n,scanCount:a}=e;if(n&&null!=a)return{start:0,end:(0,r.alignChunkLengthsToMultipleOfAesBlockSize)(n.scanLengths).slice(0,a).reduce(((e,t)=>e+t),0)};if(t){const{video:{size:e,duration:n},secondsToDownload:r}=t,a=Math.max(e*r/n,131072);return{start:0,end:Math.ceil(a/i.BLOCK_SIZE)*i.BLOCK_SIZE-1}}return null};var r=n(889441),i=n(98516)},464662:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MediaHost=t.HOST_TYPE=void 0;var i=r(n(81109)),a=n(708761);const o=new Set(a.MEDIA_TYPE_VALUES),s=Object.freeze({PRIMARY:"primary",FALLBACK:"fallback"});t.HOST_TYPE=s;class l{constructor(e){this.hostname=e.hostname,this.ips=e.ips||[],this.type=e.type,this.class=e.class;const{downloadBuckets:t,supportedDownloadTypes:n,supportedUploadTypes:r}=function(e){var t,n;const r=e||[];let i,a,s;for(const e of r){if(e.download){var l;i=null!==(l=i)&&void 0!==l?l:new Set;for(const t of e.download)i.add(t)}if(e.upload){var u;a=null!==(u=a)&&void 0!==u?u:new Set;for(const t of e.upload)a.add(t)}e.downloadBuckets&&(s=e.downloadBuckets.map((e=>parseInt(e,10))))}return{supportedDownloadTypes:null!==(t=i)&&void 0!==t?t:o,supportedUploadTypes:null!==(n=a)&&void 0!==n?n:o,downloadBuckets:s}}(e.rules);this.downloadBuckets=t,this._supportedDownloadTypes=n,this._supportedUploadTypes=r,this.fallback=null!=e.fallback?new l((0,i.default)((0,i.default)((0,i.default)({},e),e.fallback),{},{type:"fallback",fallback:void 0})):null}equals(e){return this.hostname===(null==e?void 0:e.hostname)}isFallback(){return this.type===s.FALLBACK}supportsDownloadMediaType(e){return this._supportedDownloadTypes.has(e)}supportsUploadMediaType(e){const t="product-catalog-image"===e?"product":e;return this._supportedUploadTypes.has(t)}}t.MediaHost=l},643235:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.mediaHosts=t.FETCH_STATE=void 0;var a=i(n(506479)),o=i(n(348926)),s=n(88237),l=i(n(947077)),u=n(984330),c=n(464662),d=n(271186),p=n(99245),_=n(191873),f=n(108507);const h=["forceRefresh"],g=["name","message","stack"];t.FETCH_STATE={PENDING:"PENDING",SUCCESS:"SUCCESS",ERROR:"ERROR"};const m=new class{constructor(){var e=this;this._locked=!1,this._fetch=(0,l.default)((()=>"all"),function(){var t=(0,o.default)((function*(t){let{signal:n}=t;try{const t=yield(0,f.sendQueryMediaConn)(n);e._err=null,e._data={auth:t.auth,authExpirationTime:new Date(t.queryStartTime.getTime()+t.authTTL),authTTL:t.authTTL,hosts:t.hosts.map((e=>new c.MediaHost(e))),hostsRefreshTime:new Date(t.queryStartTime.getTime()+t.ttl),queryStartTime:t.queryStartTime,maxBuckets:t.maxBuckets}}catch(t){const i=t;var r;if(i instanceof u.E507)return e._data=e._previousData,e._previousData=null,e._locked=!0,void setTimeout((0,o.default)((function*(){yield e._refreshIfStale({signal:n}),e._locked=!1})),null!==(r=i.backoff)&&void 0!==r?r:void 0);if(e._data=null,e._err=i,i.name===s.ABORT_ERROR)return void __LOG__(2)`mediaHosts.sendQueryMediaConn aborted`;__LOG__(3,!0)`mediaHosts.sendQueryMediaConn error: ${function(e){const{name:t,message:n,stack:r}=e,i=(0,a.default)(e,g),o=(0,_.normalizeStack)(e),s=o.slice(o.indexOf("\n")+1),l=0===Object.keys(i).length?"":" "+JSON.stringify(i,((e,t)=>e&&"object"==typeof t?String(t):t));return`${e.name||"Error"}: ${e.message}${l}\n${s}`}(i)}`,__LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("Error fetching mms hosts")}}));return function(){return t.apply(this,arguments)}}()),this._reset()}getHostsInfo(e){var t=this;let{directPath:n,encFilehash:i,operation:a,type:s,signal:l,forceRefresh:u=!1}=e;return(0,o.default)((function*(){if(!t._locked){const e={signal:l||(new r).signal,forceRefresh:u};yield t._refreshIfStale(e)}if(!t._data)throw new d.NoMediaHostsError("no fetched data");const{auth:e,hosts:o,maxBuckets:c}=t._data,{selectedHost:_,fallbackHost:f}=(0,p.routeSelection)({directPath:n,encFilehash:i,hosts:o,operation:a,type:s,maxBuckets:c});if(!_)throw new d.NoMediaHostsError("no selected host");return{auth:e,selectedHost:_,fallbackHost:f}}))()}_isExpiredOrMissing(){if(!this._data)return!0;const e=this._data;return new Date>=e.authExpirationTime}_needsRefresh(){if(!this._data)return!0;const e=this._data;if(new Date>=e.hostsRefreshTime)return!0;const{authTTL:t,queryStartTime:n}=e,r=Math.floor(.8*t),i=new Date(n.getTime()+r);return new Date>=i}_refreshIfStale(e){var t=this;let{forceRefresh:n}=e,r=(0,a.default)(e,h);return(0,o.default)((function*(){return t._isExpiredOrMissing()||n?(t._reset(),yield t._fetch(r),!0):!!t._needsRefresh()&&(t._fetch(r),!1)}))()}_reset(){this._previousData=this._data,this._data=null,this._err=null}};t.mediaHosts=m},271186:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoMediaHostsError=void 0;var r=n(643930);class i extends((0,r.customError)("NoMediaHostsError")){}t.NoMediaHostsError=i},101184:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.THRESHOLD=void 0,t.maybeSwitchHost=function(e,t,n,o){let{selectedHost:s,fallbackHost:l}=t,{selectedHost:u,fallbackHost:c}=n;if(o<i)return{changed:!1,host:e};switch(e.type){case r.HOST_TYPE.PRIMARY:if(!e.equals(u))return{changed:!0,host:u};break;case r.HOST_TYPE.FALLBACK:if(!s.equals(u))return{changed:!0,host:u};if(a(e,l,c)||a(e,s.fallback,u.fallback))return{changed:!0,host:s}}return{changed:!1,host:e}};var r=n(464662);const i=52428800;function a(e,t,n){return e.equals(t)&&null!=n&&null!=t&&!t.equals(n)}t.THRESHOLD=i},99245:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.OPERATIONS=void 0,t.routeSelection=function(e){var t,n;let r,{encFilehash:u,directPath:c,hosts:d,operation:p,type:_,maxBuckets:f}=e;if(!d.length)return{selectedHost:null,fallbackHost:null};if(p===l.DOWNLOAD){const e=c?c.match(/&_nc_hot=([0-9]+)/):null,t=parseInt(null==e?void 0:e[1],10),n=Number.isNaN(t)?null:(0,a.unixTime)()-t,{mmsHotContentTimespan:l,mmsVCacheAggregationEnabled:p}=s.ServerProps;let h;null!=l&&l>0&&(_===o.MEDIA_TYPES.STICKER||null!=n&&n<=l)?h=1:p&&null!=f&&(h=(0,i.default)(u,f)+100);const g=function(e){const t=new Map;return e.forEach((e=>{var n;null===(n=e.downloadBuckets)||void 0===n||n.forEach((n=>{t.set(n,e)}))})),t}(d),m=null==h?null:g.get(h),y=g.get(0);(null==m?void 0:m.supportsDownloadMediaType(_))?r=m:(null==y?void 0:y.supportsDownloadMediaType(_))&&(r=y)}const h=d.find((e=>e.isFallback()));return r=null!==(t=r)&&void 0!==t?t:d.find((e=>p===l.UPLOAD?e.supportsUploadMediaType(_):e.supportsDownloadMediaType(_))),{selectedHost:null!==(n=r)&&void 0!==n?n:null,fallbackHost:null!=h?h:null}};var i=r(n(670309)),a=n(990445),o=n(708761),s=n(241588);const l={DOWNLOAD:"DOWNLOAD",UPLOAD:"UPLOAD"};t.OPERATIONS=l},887694:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseCdnUrlParams=function(e){const t=(e instanceof URL?e.searchParams:new URL(e).searchParams).get(i);return{expirationDate:null==t?void 0:(0,r.convertHexToDate)(t)}};var r=n(990445);const i="oe"},28790:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n(506479)),o=i(n(81109)),s=i(n(348926)),l=n(209733),u=i(n(132375)),c=i(n(99842)),d=i(n(755344)),p=n(643235),_=i(n(68799)),f=i(n(864204)),h=i(n(774513)),g=i(n(504187)),m=n(667854),y=n(804074),E=i(n(55144)),S=n(262912),T=i(n(180813)),v=n(454889),A=n(708761),C=i(n(166034)),P=i(n(99398)),O=i(n(571834));const I=["ciphertextHmac"];function M(){return(M=(0,s.default)((function*(e){const{encFilehash:t,signal:n,type:r,mediaId:i}=e;let a=!1;const u={encFilehash:e.encFilehash,type:e.type};__LOG__(2)`mmsClient.checkIfUploadExists: start`;try{let e=null;const u=yield(0,l.exponentialBackoff)((0,o.default)((0,o.default)({},f.default),{},{signal:n}),function(){var o=(0,s.default)((function*(o,s){__LOG__(2)`mmsClient.checkIfUploadExists: attempt #${s+1}`,yield P.default.waitIfOffline({signal:n});try{const{auth:o,selectedHost:l,fallbackHost:u}=yield p.mediaHosts.getHostsInfo({operation:C.default.UPLOAD,encFilehash:t,type:r,signal:n}),c=(0,T.default)({selectedHost:l,fallbackHost:u,lastHostUsed:e,attemptCount:s,lastFetchMadeProgress:a});return e=c,yield(0,h.default)({auth:o,encFilehash:t,hostname:c.hostname,type:r,signal:n,onProgress:()=>{a=!0},mediaId:i})}catch(e){if((0,_.default)(e))return o(e);throw e}}));return function(){return o.apply(this,arguments)}}());return __LOG__(2)`mmsClient.checkIfUploadExists: success`,u}catch(e){throw(0,y.mmsLogError)("mmsClient.checkIfUploadExists",e,u),e}}))).apply(this,arguments)}function b(){return(b=(0,s.default)((function*(e){const{encFilehash:t,type:n,onUploadAttemptSuccess:r}=e;__LOG__(2)`mmsClient.upload: start`;try{if((0,v.shouldUseStreamingUpload)(e.ciphertextHmac.byteLength,e.type)){const{ciphertextHmac:t}=e,n=(0,a.default)(e,I),r=new v.UploadStreamer(n);return yield r.uploadCompleteFile({ciphertextHmac:t})}const{response:t,retryStartTime:n}=yield G(e);return r(Date.now()-n),__LOG__(2)`mmsClient.upload: success`,(0,u.default)(t,"response")}catch(e){throw(0,y.mmsLogError)("mmsClient.upload",e,{encFilehash:t,type:n},!1),e}}))).apply(this,arguments)}function R(){return(R=(0,s.default)((function*(e){const{directPath:t,encFilehash:n,type:r,debugString:i,staticUrl:a,onDownloadAttemptSuccess:o}=e;__LOG__(2)`mmsClient.download: [${i}] start`;try{const{response:t,retryStartTime:n}=yield L(e);return o(Date.now()-n),__LOG__(2)`mmsClient.download: [${i}] success`,t}catch(e){throw(0,y.mmsLogError)("mmsClient.download",e,{directPath:t,encFilehash:n,type:r,staticUrl:a}),e}}))).apply(this,arguments)}function N(e,t){const{directPath:n,encFilehash:r,type:i,signal:a}=t;return __LOG__(2)`runTaskWithBackoff: start`,(0,l.exponentialBackoff)((0,o.default)((0,o.default)({},f.default),{},{signal:a}),function(){var t=(0,s.default)((function*(t,o){__LOG__(2)`runMmsTaskWithBackoff: attempt #${o+1}`;try{const t=yield function(){return w.apply(this,arguments)}({operation:C.default.DOWNLOAD,directPath:n,encFilehash:r,type:i,signal:a,failCount:o});return yield e(t)}catch(e){if((0,_.default)(e))return t(e);throw e}}));return function(){return t.apply(this,arguments)}}())}function w(){return(w=(0,s.default)((function*(e){const{failCount:t,operation:n,directPath:r,encFilehash:i,type:a,signal:o}=e,{selectedHost:s,fallbackHost:l}=yield p.mediaHosts.getHostsInfo({operation:n,directPath:r,encFilehash:i,type:a,signal:o});return(t>=2&&l?l:s).hostname}))).apply(this,arguments)}function L(){return D.apply(this,arguments)}function D(){return(D=(0,s.default)((function*(e){let{debugString:t,signal:n,directPath:i,encFilehash:a,staticUrl:h,type:g,onDownloadHostFound:y,mode:E,byteRange:v,onDownloadAttemptError:A,onResponseText:P,onProgress:O}=e,I=Date.now(),M=!1,b=null;const R=yield(0,l.exponentialBackoff)((0,o.default)((0,o.default)({},f.default),{},{signal:n}),function(){var e=(0,s.default)((function*(e,o){I=Date.now(),__LOG__(2)`mmsClient.download: [${t}] attempt #${o+1}`;const l=e=>p.mediaHosts.getHostsInfo({operation:C.default.DOWNLOAD,directPath:i,encFilehash:a,type:g,signal:n,forceRefresh:e});try{const{selectedHost:e,fallbackHost:u}=yield l();let p=(0,T.default)({selectedHost:e,fallbackHost:u,attemptCount:o,lastHostUsed:b,lastFetchMadeProgress:M});b=p,y({hostName:p.hostname,hostClass:p.class,failCount:o});let _=0,f=null;const A={selectedHost:e,fallbackHost:u},C=e=>{if(null!=e&&null==f){const t=e.get("Content-Length"),n=parseInt(t,10);f=Number.isNaN(n)?null:n}};return yield(0,d.default)(function(){var e=(0,s.default)((function*(e){let{retry:o,failCount:s}=e;const u=e=>{null==O||O(e),M=!0,e.lengthComputable&&(_=e.loaded)};_=0;const d=new r,{signal:y}=d,T=yield(0,c.default)([n,y],(e=>{const n=(0,m.mms4Download)({directPath:i,encFilehash:a,staticUrl:h,hostname:p.hostname,type:g,signal:e,mode:E,byteRange:v,debugString:t,onHeadersReceived:C,onProgress:u,onResponseText:P}).then((e=>({kind:"download-completed",arrayBuffer:e}))),r=(0,S.shouldPollDownloadHosts)(g,f)?(0,S.pollMediaHosts)({connectionBlock:A,getHost:()=>p,getMediaHosts:()=>l(!0),getRemainingBytes:()=>null!=f?f-_:null,signal:e}).then((e=>({kind:"host-changed",host:e}))):null;return Promise.race([n,r].filter(Boolean)).finally((()=>d.abort()))}));return"host-changed"===T.kind?(p=T.host,b=p,o()):T.arrayBuffer}));return function(){return e.apply(this,arguments)}}())}catch(t){M=!1;const n=(0,_.default)(t);if(!n||o===f.default.retries||A({err:t,overallT:Date.now()-I,failCount:o}),n)return e(t);throw t}}));return function(){return e.apply(this,arguments)}}());return{response:(0,u.default)(R,"response"),retryStartTime:I}}))).apply(this,arguments)}function k(){return U.apply(this,arguments)}function U(){return(U=(0,s.default)((function*(e){let{auth:t,encFilehash:n,hostname:r,type:i,signal:a,byteLength:o,byteOffset:s,failCount:l,mediaId:u}=e;if(null!=s&&0===l)return s;if(!(0,S.shouldPollUploadHosts)(i,o))return 0;try{const e=yield(0,h.default)({auth:t,encFilehash:n,hostname:r,type:i,signal:a,mediaId:u});if(e.complete)return 0;const{resume:s}=e;return s>=o?0:s}catch(e){return __LOG__(4,!0,new Error,!0)`Failed to compute upload offset`,SEND_LOGS("upload-offset-failed"),0}}))).apply(this,arguments)}function G(){return x.apply(this,arguments)}function x(){return(x=(0,s.default)((function*(e){const{ciphertextHmac:t,encFilehash:n,type:i,signal:a,onUploadHostFound:u,onUploadAttemptError:h,onProgress:g,byteOffset:m,mediaId:y}=e;let v=!1,A=Date.now(),I=null;return{response:yield(0,l.exponentialBackoff)((0,o.default)((0,o.default)({},f.default),{},{signal:a}),function(){var e=(0,s.default)((function*(e,o){const l=e=>p.mediaHosts.getHostsInfo({operation:C.default.UPLOAD,encFilehash:n,type:i,signal:a,forceRefresh:e});A=Date.now(),__LOG__(2)`mmsClient.upload: attempt #${o+1}`;try{yield P.default.waitIfOffline({signal:a});const{auth:e,selectedHost:p,fallbackHost:_}=yield l(),f={selectedHost:p,fallbackHost:_};let h=(0,T.default)({selectedHost:p,fallbackHost:_,attemptCount:o,lastHostUsed:I,lastFetchMadeProgress:v});return I=h,u({hostName:h.hostname,hostClass:h.class,failCount:o}),yield(0,d.default)(function(){var u=(0,s.default)((function*(s){let{retry:u}=s;const d=yield k({auth:e,encFilehash:n,byteLength:t.byteLength,hostname:h.hostname,type:i,signal:a,byteOffset:m,failCount:o,mediaId:y}),p=new r,{signal:_}=p,T=yield(0,c.default)([a,_],(r=>{const o=(0,S.shouldPollUploadHosts)(i,t.byteLength)?(0,S.pollMediaHosts)({connectionBlock:f,getHost:()=>h,getMediaHosts:()=>l(!0),getRemainingBytes:()=>t.byteLength,signal:r}).then((e=>({kind:"host-changed",host:e}))):null,s=(0,E.default)({auth:e,ciphertextHmac:d>0?new Uint8Array(t).subarray(d):t,hostname:h.hostname,encFilehash:n,type:i,signal:a,onProgress:e=>{v=!0,g(e,d)},byteRange:d>0?{start:d,end:t.byteLength}:void 0,mediaId:y}).then((e=>({kind:"upload-completed",value:e})));return Promise.race([s,o].filter(Boolean)).finally((()=>p.abort()))}));return"host-changed"===T.kind?(h=T.host,I=h,u()):T.value}));return function(){return u.apply(this,arguments)}}())}catch(t){v=!1;const n=(0,_.default)(t);if(!n||o===f.default.retries||h(t,Date.now()-A,o,O.default.OVERALL_LAST_UPLOAD_RETRY_PHASE_TYPE.UPLOAD),n)return e(t);throw t}}));return function(){return e.apply(this,arguments)}}()),retryStartTime:A}}))).apply(this,arguments)}function B(){return(B=(0,s.default)((function*(e){const{failCount:t,operation:n,directPath:r,encFilehash:i,type:a,signal:o}=e,{selectedHost:s,fallbackHost:l,auth:u}=yield p.mediaHosts.getHostsInfo({operation:n,directPath:r,encFilehash:i,type:a,signal:o});return{hostname:(t>=2&&l?l:s).hostname,auth:u}}))).apply(this,arguments)}var F={download:function(){return R.apply(this,arguments)},upload:function(){return b.apply(this,arguments)},checkExistence:function(e){return N((t=>(0,m.mmsCheckExistence)((0,o.default)((0,o.default)({},e),{},{hostname:t}))),e)},getEncryptedMediaSize:function(e){return N((t=>(0,m.mmsGetEncryptedMediaSize)((0,o.default)((0,o.default)({},e),{},{hostname:t}))),e)},checkIfUploadExists:function(){return M.apply(this,arguments)},deleteMdHistorySyncBlob:function(e){const{directPath:t,encFilehash:n}=e;return function(e,t){const{directPath:n,encFilehash:r,type:i,signal:a,operation:u}=t;return __LOG__(2)`runTaskWithBackoff: start`,(0,l.exponentialBackoff)((0,o.default)((0,o.default)({},f.default),{},{signal:a}),function(){var t=(0,s.default)((function*(t,o){__LOG__(2)`runMmsTaskWithBackoff: attempt #${o+1}`;try{const{hostname:t,auth:s}=yield function(){return B.apply(this,arguments)}({operation:u,directPath:n,encFilehash:r,type:i,signal:a,failCount:o});return yield e(t,s)}catch(e){if((0,_.default)(e))return t(e);throw e}}));return function(){return t.apply(this,arguments)}}())}(((e,r)=>(0,g.default)({directPath:t,hostname:e,encFilehash:n,auth:r})),(0,o.default)((0,o.default)({},e),{},{type:A.MEDIA_TYPES.IMAGE,operation:C.default.UPLOAD}))}};t.default=F},263958:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MediaTooLargeError=t.MediaNotFoundError=t.MediaInvalidError=t.MMSUnauthorizedError=t.MMSThrottleError=t.MMSForbiddenError=void 0;var r=n(791357);class i extends r.HttpStatusCodeError{constructor(e){super(404,e),this.name="MediaNotFoundError"}}t.MediaNotFoundError=i;class a extends r.HttpStatusCodeError{constructor(e){super(413,e),this.name="MediaTooLargeError"}}t.MediaTooLargeError=a;class o extends r.HttpStatusCodeError{constructor(e){super(415,e),this.name="MediaInvalidError"}}t.MediaInvalidError=o;class s extends r.HttpStatusCodeError{constructor(e){super(401,e),this.name="MMSUnauthorizedError"}}t.MMSUnauthorizedError=s;class l extends r.HttpStatusCodeError{constructor(e){super(403,e),this.name="MMSForbiddenError"}}t.MMSForbiddenError=l;class u extends r.HttpStatusCodeError{constructor(e){super(507,e),this.name="MMSThrottleError"}}t.MMSThrottleError=u},126655:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{directPath:t,encFilehash:n,hostname:r,type:l,mode:u,byteRange:c}=e;if(t)return function(e){let{directPath:t,encFilehash:n,hostname:r,query:a}=e;const s=new URL(t,`https://${r}`);if(s.hostname!==r)throw __LOG__(4,void 0,new Error,!0)`url.hostname: ${s.hostname}, hostname: ${r}, directPath: ${t}`,SEND_LOGS("malicious directPath"),new Error("malicious directPath");const l=s.searchParams||new o.default(s.search);return l.set("hash",(0,i.default)(n)),Object.keys(a).forEach((e=>{const t=a[e];null!=t&&l.set(e,t)})),`https://${s.host}${s.pathname}?${l.toString()}`}({encFilehash:n,hostname:r,directPath:t,query:{mode:u,bytestart:null==c?void 0:c.start.toString(),byteend:null==c?void 0:c.end.toString(),[s.MMS_URL_MEDIA_TYPE_SEARCH_PARAM]:l,[s.IS_MMS_URL_SEARCH_PARAM]:""}});return(0,a.default)({hostname:r,type:l,encFilehash:n,query:{mode:u,[s.IS_MMS_URL_SEARCH_PARAM]:""}})};var i=r(n(861309)),a=r(n(955233)),o=r(n(665810)),s=n(746410)},955233:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{hostname:t,type:n,encFilehash:r,query:l}=e;const u=(0,a.default)(s[n],"MEDIA_TYPE_TO_PATH[type]"),c=new URL(`https://${t}${u}/${(0,i.default)(r)}`),d={};l&&Object.keys(l).forEach((e=>{null!=l[e]&&(d[e]=l[e])}));let p=new o.default(d).toString();p&&(p=`?${p}`);return`https://${c.host}${c.pathname}${p}`};var i=r(n(861309)),a=r(n(132375)),o=r(n(665810));const s={audio:"/mms/audio",document:"/mms/document",gif:"/mms/gif",image:"/mms/image",ppic:"/pps/photo",product:"/mms/image",ptt:"/mms/ptt",sticker:"/mms/sticker","thumbnail-document":"/mms/thumbnail-document","thumbnail-link":"/mms/thumbnail-link",video:"/mms/video","md-app-state":"/mms/md-app-state","product-catalog-image":"/product/image","biz-cover-photo":"/pps/biz-cover-photo"}},949779:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n;let{auth:r,encFilehash:o,hostname:s,query:l,type:u,byteRange:c,mediaId:d}=e;const p=null==l?void 0:l.final_hash;return(0,a.default)({encFilehash:o,hostname:s,type:u,query:{auth:r,token:(0,i.default)(o),resume:null==l||null===(t=l.resume)||void 0===t?void 0:t.toString(10),stream:null==l||null===(n=l.stream)||void 0===n?void 0:n.toString(10),final_hash:null!=p?(0,i.default)(p):void 0,bytestart:null==c?void 0:c.start.toString(10),byteend:null==c?void 0:c.end.toString(10),media_id:d.toString(10)}})};var i=r(n(861309)),a=r(n(955233))},68799:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(e instanceof a.MMSThrottleError)return!1;return e instanceof i.NoMediaHostsError||e instanceof r.HttpNetworkError||e instanceof a.MMSUnauthorizedError||e instanceof r.HttpStatusCodeError&&e.status>=500};var r=n(791357),i=n(271186),a=n(263958)},864204:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={minTimeout:1e3,retries:3};t.default=n},774513:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(791357),o=n(263958),s=r(n(852152)),l=n(804074);const u="complete";function c(){return(c=(0,i.default)((function*(e){const t={encFilehash:e.encFilehash,type:e.type};__LOG__(2)`mmsCheckIfUploadExists: start`;try{const t=yield(0,s.default)(e),{directPath:n,url:r,handle:i,resume:l}=t;if(l===u){if(null==n||""===n)throw new a.HttpInvalidResponseError("mmsCheckIfUploadExists: missing directPath");if(null==r||""===r)throw new a.HttpInvalidResponseError("mmsCheckIfUploadExists: missing url");return __LOG__(2)`mmsCheckIfUploadExists: success`,{directPath:n,url:r,handle:i,complete:!0}}const c=parseInt(l,10);if(0===c)throw new o.MediaNotFoundError("mmsCheckIfUploadExists");if(Number.isNaN(c))throw __LOG__(4,void 0,new Error,!0)`mmsCheckIfUploadExists: resume is NaN, resume=${c}`,SEND_LOGS("upload-offset-is-NaN"),new a.HttpInvalidResponseError("mmsCheckIfUploadExists: invalid resume");return{complete:!1,resume:c}}catch(e){throw(0,l.mmsLogError)("mmsCheckIfUploadExists",e,t),e}}))).apply(this,arguments)}},504187:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return d.apply(this,arguments)};var i=r(n(348926)),a=n(417405),o=r(n(861309)),s=n(791357),l=r(n(955233)),u=n(708761),c=r(n(219368));function d(){return(d=(0,i.default)((function*(e){const{directPath:t,encFilehash:n,hostname:r,auth:i}=e,d=t.split("?")[0],p=(new TextEncoder).encode(d),_=(0,a.encodeB64UrlSafe)(p),f=(0,l.default)({encFilehash:n,hostname:r,type:u.MEDIA_TYPES.IMAGE,query:{token:(0,o.default)(n),d_md:_,auth:i}}),h=yield(0,c.default)(f,{method:"DELETE"});if(!h.ok)throw new s.HttpStatusCodeError(h.status,"MMS Delete error")}))).apply(this,arguments)}},667854:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.mms4Download=function(e){let{directPath:t,encFilehash:n,staticUrl:r,hostname:o,type:s,signal:l,onProgress:u,onResponseText:c,onHeadersReceived:d,mode:p,byteRange:f,debugString:g}=e;const m=r||(0,_.default)({directPath:t,encFilehash:n,hostname:o,type:s,mode:p,byteRange:f});return function(){return h.apply(this,arguments)}({url:m,signal:l,onHeadersReceived:d,onProgress:u,onResponseText:c,ciphertextValidator:f?null:function(){var e=(0,i.default)((function*(e){return(yield(0,a.calculateFilehash)(e))===n}));return function(){return e.apply(this,arguments)}}(),debugString:g,debug:{encFilehash:n,type:s,url:m}})},t.mmsCheckExistence=function(){return g.apply(this,arguments)},t.mmsGetEncryptedMediaSize=function(){return m.apply(this,arguments)},t.validateMmsResponse=y;var i=r(n(348926)),a=n(502010),o=n(990445),s=n(287461),l=n(791357),u=n(754424),c=n(288057),d=n(887694),p=n(263958),_=r(n(126655)),f=n(804074);function h(){return(h=(0,i.default)((function*(e){let{url:t,signal:n,onHeadersReceived:r,onProgress:i,onResponseText:a,debug:o,debugString:s,ciphertextValidator:c}=e;__LOG__(2)`mmsDownload: [${s}] start`;try{const e=yield(0,u.extendedFetch)(t,{signal:n,onProgress:i,onResponseText:a,onHeadersReceived:r});yield y({response:e,functionName:"mmsDownload",url:t});const o=yield e.arrayBuffer();if(c&&!(yield c(o)))throw __LOG__(3)`download hash mismatch error. downloaded size: ${o.byteLength}`,new l.MmsDownloadFilehashMismatchError({url:t});return __LOG__(2)`mmsDownload: [${s}] success`,o}catch(e){throw(0,f.mmsLogError)("mmsDownload",e,o),e}}))).apply(this,arguments)}function g(){return(g=(0,i.default)((function*(e){const{directPath:t,encFilehash:n,hostname:r,type:i,signal:a}=e;yield S({directPath:t,encFilehash:n,hostname:r,type:i,signal:a,functionName:"mmsCheckExistence"})}))).apply(this,arguments)}function m(){return(m=(0,i.default)((function*(e){const{directPath:t,encFilehash:n,hostname:r,type:i,signal:a}=e,o=(yield S({directPath:t,encFilehash:n,hostname:r,type:i,signal:a,functionName:"mmsGetEncryptedMediaSize"})).headers.get("content-length");if(!o)throw new c.UnableToGetContentLengthError;return parseInt(o,10)}))).apply(this,arguments)}function y(){return E.apply(this,arguments)}function E(){return(E=(0,i.default)((function*(e){const{response:t,url:n,functionName:r}=e;if(!t.ok)switch(t.status){case 401:throw new p.MMSUnauthorizedError(r,{url:n});case 403:{if((yield t.text()).includes("URL signature expired"))throw new p.MediaNotFoundError(r,{url:n,status:t.status});const{expirationDate:e}=(0,d.parseCdnUrlParams)(n);if((0,s.getABPropConfigValue)("web_killswitch_s310872_mitigation")&&null!=e&&(0,o.toDate)((0,o.unixTime)())>=e)throw new p.MediaNotFoundError(r,{url:n,status:t.status});throw new p.MMSForbiddenError(r,{url:n})}case 404:case 410:throw new p.MediaNotFoundError(r,{url:n,status:t.status});case 507:throw new p.MMSThrottleError(r,{url:n});default:throw new l.HttpStatusCodeError(t.status,r,{url:n})}}))).apply(this,arguments)}function S(){return T.apply(this,arguments)}function T(){return(T=(0,i.default)((function*(e){const{directPath:t,encFilehash:n,hostname:r,type:i,signal:a,functionName:o}=e,s=(0,_.default)({directPath:t,encFilehash:n,hostname:r,type:i,mode:"auto"}),l=yield(0,u.extendedFetch)(s,{method:"HEAD",signal:a});return yield y({response:l,functionName:o,url:s}),l}))).apply(this,arguments)}},852152:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(791357),o=n(754424),s=n(263958),l=r(n(949779)),u=n(804074);function c(){return(c=(0,i.default)((function*(e){const{auth:t,encFilehash:n,hostname:r,signal:i,type:c,onProgress:d,mediaId:p}=e,_=(0,l.default)({auth:t,encFilehash:n,hostname:r,query:{resume:1},type:c,mediaId:p});__LOG__(2)`mmsGetUploadProgress: start`;try{const e=yield(0,o.extendedFetch)(_,{method:"post",signal:i,onProgress:d});if(!e.ok)switch(e.status){case 401:throw new s.MMSUnauthorizedError("mmsGetUploadProgress",{url:_});case 404:throw new s.MediaNotFoundError("mmsGetUploadProgress",{url:_});default:throw new a.HttpStatusCodeError(e.status,"mmsGetUploadProgress",{url:_})}const t=yield e.json();if(!t.resume)throw new a.HttpInvalidResponseError("mmsGetUploadProgress: missing resume",{url:_});return __LOG__(2)`mmsGetUploadProgress: success`,{directPath:t.direct_path,resume:t.resume,url:t.url,handle:t.handle}}catch(e){throw(0,u.mmsLogError)("mmsUpload",e,{encFilehash:n,type:c,url:_}),e}}))).apply(this,arguments)}},804074:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mmsLogError=function(e,t){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];t instanceof i.MediaNotFoundError&&n?__LOG__(2)`${e}: expected error`:"object"==typeof t&&(null==t?void 0:t.name)===r.ABORT_ERROR?__LOG__(2)`${e}: canceled`:__LOG__(3)`${e}: error`};var r=n(88237),i=n(263958)},55144:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return _.apply(this,arguments)};var i=r(n(348926)),a=n(791357),o=n(754424),s=n(263958),l=r(n(949779)),u=n(804074),c=n(708761);function d(e){if(null==e.direct_path||""===e.direct_path)throw new a.HttpInvalidResponseError("mmsUpload: missing direct_path");if(null==e.url||""===e.url)throw new a.HttpInvalidResponseError("mmsUpload: missing url");return{directPath:e.direct_path,url:e.url,handle:e.handle}}function p(e){if(null==e.ts)throw new a.HttpInvalidResponseError("mmsUpload: missing ts (timestamp)");if(null==e.meta_hmac)throw new a.HttpInvalidResponseError("mmsUpload: missing meta_hmac");if(null==e.fbid)throw new a.HttpInvalidResponseError("mmsUpload: missing fbid");return{directPath:"",url:"",ts:e.ts,metaHmac:e.meta_hmac,fbid:e.fbid}}function _(){return(_=(0,i.default)((function*(e){const{auth:t,ciphertextHmac:n,encFilehash:r,hostname:i,type:_,signal:f,onProgress:h,byteRange:g,mediaId:m}=e,y=(0,l.default)({auth:t,encFilehash:r,hostname:i,type:_,byteRange:g,mediaId:m});__LOG__(2)`mmsUpload: start`;try{const e=_===c.MEDIA_TYPES.BIZ_COVER_PHOTO?p:d,t=yield(0,o.extendedFetch)(y,{method:"post",body:n,signal:f,onProgress:h}).then((e=>{if(!e.ok)switch(e.status){case 401:throw new s.MMSUnauthorizedError("mmsUpload",{url:y});case 413:throw new s.MediaTooLargeError("mmsUpload",{url:y});case 415:throw new s.MediaInvalidError("mmsUpload: hash mismatch",{url:y});case 507:throw new s.MMSThrottleError("mmsUpload",{url:y});default:throw new a.HttpStatusCodeError(e.status,"mmsUpload",{url:y})}return e.json()})).then(e);return __LOG__(2)`mmsUpload: success`,t}catch(e){throw(0,u.mmsLogError)("mmsUpload",e,{encFilehash:r,type:_,url:y},!1),e}}))).apply(this,arguments)}},186322:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.mmsUploadStream=function(e){let{auth:t,encFilehash:n,type:r,hostname:i,byteStart:a,byteEnd:s,chunk:u,signal:d,onProgress:p,mediaId:_}=e;const f=(0,l.default)({auth:t,encFilehash:n,type:r,hostname:i,query:{stream:1},byteRange:{start:a,end:s},mediaId:_});return(0,o.extendedFetch)(f,{method:"post",body:u,signal:d,onProgress:p}).then((e=>{e.ok||c(e.status,"mmsUploadStream",f)}))},t.mmsUploadStreamFinalize=function(){return d.apply(this,arguments)};var i=r(n(348926)),a=n(791357),o=n(754424),s=n(263958),l=r(n(949779)),u=n(804074);function c(e,t,n){switch(e){case 401:throw new s.MMSUnauthorizedError(t,{url:n});case 413:throw new s.MediaTooLargeError(t,{url:n});case 415:throw new s.MediaInvalidError(`${t}: hash mismatch`,{url:n});case 507:throw new s.MMSThrottleError("mmsUploadStreamFinalize",{url:n});default:throw new a.HttpStatusCodeError(e,t,{url:n})}}function d(){return(d=(0,i.default)((function*(e){let{auth:t,encFilehash:n,type:r,hostname:i,finalHash:s,signal:d,mediaId:p}=e;const _=(0,l.default)({auth:t,encFilehash:n,type:r,hostname:i,query:{stream:1,final_hash:s},mediaId:p});__LOG__(2)`mmsUploadStreamFinalize: start`;try{const e=yield(0,o.extendedFetch)(_,{method:"post",signal:d}).then((e=>(e.ok||c(e.status,"mmsUploadStreamFinalize",_),e.json()))).then((e=>{if(null==e.direct_path||""===e.direct_path)throw new a.HttpInvalidResponseError("mmsUploadStreamFinalize: missing direct_path");if(null==e.url||""===e.url)throw new a.HttpInvalidResponseError("mmsUploadStreamFinalize: missing url");return{directPath:e.direct_path,url:e.url,handle:e.handle}}));return __LOG__(2)`mmsUploadStreamFinalize: success`,e}catch(e){throw(0,u.mmsLogError)("mmsUpload",e,{encFilehash:n,type:r,url:_},!1),e}}))).apply(this,arguments)}},262912:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.SERVER_POLLING_INTERVAL=void 0,t.pollMediaHosts=function(){return d.apply(this,arguments)},t.shouldPollDownloadHosts=function(e,t){return u.ServerProps.downloadHostSwitchingEnabled&&e===l.MEDIA_TYPES.DOCUMENT&&(null!=t?t:0)>s.THRESHOLD},t.shouldPollUploadHosts=function(e,t){return u.ServerProps.uploadHostSwitchingEnabled&&e===l.MEDIA_TYPES.DOCUMENT&&t>s.THRESHOLD};var i=r(n(348926)),a=n(36530),o=r(n(755344)),s=n(101184),l=n(708761),u=n(241588);const c=3e5;function d(){return(d=(0,i.default)((function*(e){let t=e.connectionBlock;return yield(0,a.delayMs)(c,e.signal),(0,o.default)((n=>{let{retry:r}=n;return new Promise((n=>e.getMediaHosts().then((i=>{let{selectedHost:a,fallbackHost:o}=i;const l={selectedHost:a,fallbackHost:o},u=e.getRemainingBytes();if(null==u)return r(c);const{changed:d,host:p}=(0,s.maybeSwitchHost)(e.getHost(),t,l,u);return t=l,d?n(p):r(c)}))))}),e.signal)}))).apply(this,arguments)}t.SERVER_POLLING_INTERVAL=c},180813:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{selectedHost:t,fallbackHost:n,attemptCount:r,lastHostUsed:i,lastFetchMadeProgress:a}=e;if(a&&i)return i;if(r<=1)return t;if(3===r&&n)return n;if((null==i?void 0:i.equals(t))&&null!=t.fallback)return t.fallback;return null!=n?n:t}},454889:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.UploadStreamer=void 0,t.shouldUseStreamingUpload=function(e,t){const n=P(t);return t===E.MEDIA_TYPES.DOCUMENT&&n>0&&e>n};var a=i(n(506479)),o=i(n(81109)),s=i(n(348926)),l=n(209733),u=i(n(99842)),c=i(n(755344)),d=n(791357),p=n(643235),_=n(99245),f=i(n(68799)),h=i(n(864204)),g=n(186322),m=n(262912),y=i(n(180813)),E=n(708761),S=i(n(99398)),T=n(241588),v=i(n(571834));const A=["auth"];function C(e,t){return(0,f.default)(e)&&t<h.default.retries}function P(e){return e===E.MEDIA_TYPES.DOCUMENT?T.ServerProps.streamingUploadChunkSize:0}t.UploadStreamer=class{constructor(e){var t;this._retryStartTime=Date.now(),this._offset=0,this._uploadedBytes=0,this._uploadingQueue=Promise.resolve(),this._encFilehash=e.encFilehash,this._type=e.type,this._signal=e.signal,this._offset=null!==(t=e.byteOffset)&&void 0!==t?t:0,this._debugString=e.encFilehash.slice(0,10),this._handleUploadHostFound=e.onUploadHostFound,this._handleUploadAttemptSuccess=e.onUploadAttemptSuccess,this._handleUploadAttemptError=e.onUploadAttemptError,this._handleProgress=e.onProgress,this._handleFinalize=e.onFinalize,this._handleStreamUploadStart=e.onStreamUploadStart,this._mediaId=e.mediaId}uploadCompleteFile(e){var t=this;let{ciphertextHmac:n}=e;return(0,s.default)((function*(){var e,r;const i=new Uint8Array(n);t._uploadSize=i.byteLength;const a=P(t._type),o=0===a?i.byteLength:a;null===(e=t._handleStreamUploadStart)||void 0===e||e.call(t),__LOG__(2)`uploadStreamer: [${t._debugString}] start upload`,yield S.default.waitIfOffline({signal:t._signal});const s=Math.ceil((i.byteLength-t._offset)/o);for(let e=0;e<s;e++){t._logChunkUploadProgress(e,s);const n=t._offset+e*o,r=i.subarray(n,n+o);yield t._uploadChunkWithBackoff(r,n),t._uploadedBytes+=r.byteLength}const l=yield t._finalizeWithBackoff(t._encFilehash);return null===(r=t._handleUploadAttemptSuccess)||void 0===r||r.call(t,Date.now()-t._retryStartTime),l}))()}startUploadFromClient(){var e=this;return(0,s.default)((function*(){var t;yield S.default.waitIfOffline({signal:e._signal}),null===(t=e._handleStreamUploadStart)||void 0===t||t.call(e)}))()}uploadChunkFromClient(e){var t=this;return(0,s.default)((function*(){t._uploadingQueue=t._uploadingQueue.then((0,s.default)((function*(){yield t._uploadChunkWithBackoff(e,t._offset),t._uploadedBytes+=e.byteLength,t._offset+=e.byteLength}))),yield t._uploadingQueue}))()}finalizeUploadFromClient(e){var t=this;return(0,s.default)((function*(){var n;const r=yield t._uploadingQueue.then((()=>t._finalizeWithBackoff(e)));return null===(n=t._handleUploadAttemptSuccess)||void 0===n||n.call(t,Date.now()-t._retryStartTime),r}))()}_resetRetryStartTime(){this._retryStartTime=Date.now()}_getAttemptTime(){return Date.now()-this._retryStartTime}_getRemainingBytes(){if(null!=this._uploadSize)return this._uploadSize-this._uploadedBytes}_logChunkUploadProgress(e,t){__LOG__(2)`uploadStreamer: [${this._debugString}] uploading chunk ${e+1}/${t}`}_uploadChunkWithBackoff(e,t){var n=this;return(0,l.exponentialBackoff)((0,o.default)((0,o.default)({},h.default),{},{signal:this._signal}),function(){var r=(0,s.default)((function*(r,i){try{yield n._uploadChunk(e,t,i)}catch(e){var a;if(C(e,i))return null===(a=n._handleUploadAttemptError)||void 0===a||a.call(n,e,n._getAttemptTime(),i,v.default.OVERALL_LAST_UPLOAD_RETRY_PHASE_TYPE.UPLOAD),n._resetRetryStartTime(),r(e);throw e}}));return function(){return r.apply(this,arguments)}}())}_finalizeWithBackoff(e){var t=this;return(0,l.exponentialBackoff)((0,o.default)((0,o.default)({},h.default),{},{signal:this._signal}),function(){var n=(0,s.default)((function*(n,r){try{var i;return null===(i=t._handleFinalize)||void 0===i||i.call(t),yield t._finalize(e,r)}catch(e){var a;if(function(e,t){if(e instanceof d.HttpStatusCodeError&&e.status>=500)return!1;return C(e,t)}(e,r))return null===(a=t._handleUploadAttemptError)||void 0===a||a.call(t,e,t._getAttemptTime(),r,v.default.OVERALL_LAST_UPLOAD_RETRY_PHASE_TYPE.FINALIZE),t._resetRetryStartTime(),n(e);throw e}}));return function(){return n.apply(this,arguments)}}())}_uploadChunk(e,t,n){var i=this;return(0,s.default)((function*(){let o=null,l=!1;yield S.default.waitIfOffline({signal:i._signal});const d=yield i._getMediaHosts(n),{auth:p}=d,_=(0,a.default)(d,A);let f=o=(0,y.default)({selectedHost:_.selectedHost,fallbackHost:_.fallbackHost,lastHostUsed:o,lastFetchMadeProgress:l,attemptCount:n});const h=e=>{var n;l=!0,null===(n=i._handleProgress)||void 0===n||n.call(i,e,t)};return(0,c.default)(function(){var a=(0,s.default)((function*(a){let{retry:s}=a;const l=new r,{signal:c}=l,d=yield(0,u.default)([c,i._signal],(r=>{const a=null!=i._uploadSize&&(0,m.shouldPollUploadHosts)(i._type,i._uploadSize)?(0,m.pollMediaHosts)({connectionBlock:_,signal:r,getHost:()=>f,getMediaHosts:()=>i._getMediaHosts(n,!0),getRemainingBytes:()=>i._getRemainingBytes()}).then((e=>({host:e,kind:"host-changed"}))):null,o=(0,g.mmsUploadStream)({auth:p,encFilehash:i._encFilehash,type:i._type,hostname:f.hostname,byteStart:t,byteEnd:t+e.byteLength,chunk:e,signal:r,onProgress:h,mediaId:i._mediaId}).then((()=>({kind:"upload-completed"})));return Promise.race([o,a].filter(Boolean)).finally((()=>l.abort()))}));if("host-changed"===d.kind)return o=f,f=d.host,s()}));return function(){return a.apply(this,arguments)}}())}))()}_finalize(e,t){var n=this;return(0,s.default)((function*(){yield S.default.waitIfOffline({signal:n._signal});const{auth:r,selectedHost:i}=yield n._getMediaHosts(t);return __LOG__(2)`uploadStreamer: [${n._debugString}] finalizing`,(0,g.mmsUploadStreamFinalize)({auth:r,hostname:i.hostname,encFilehash:n._encFilehash,finalHash:e,type:n._type,signal:n._signal,mediaId:n._mediaId})}))()}_getMediaHosts(e){var t=this;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,s.default)((function*(){var r;const i=yield p.mediaHosts.getHostsInfo({operation:_.OPERATIONS.UPLOAD,encFilehash:t._encFilehash,type:t._type,signal:t._signal,forceRefresh:n});return null===(r=t._handleUploadHostFound)||void 0===r||r.call(t,{failCount:e,hostName:i.selectedHost.hostname,hostClass:i.selectedHost.class}),i}))()}}},319753:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,r,l){const u=(0,o.generateMediaEventId)(),c=new s.default.MediaUpload2({mediaId:u,connectionType:s.default.CONNECTION_TYPE.HOSTNAME,overallMediaType:(0,o.getMetricMediaType)(e),overallMmsVersion:4,overallAttemptCount:n,networkStack:s.default.NETWORK_STACK_TYPE.NATIVE,overallUploadMode:(0,o.getMetricOverallUploadModeType)(e),overallIsForward:r,overallUploadOrigin:t,uploadSource:(0,a.default)(t,r),isViewOnce:l,overallUserVisibleT:0});return{handleStreamUploadStart:function(){c.set({uploadIsStreaming:!0})},handleArrayBufferCreated:function(e){c.set({overallMediaSize:e})},handleCheckExistingError:function(e){e instanceof i.HttpStatusCodeError&&c.set({resumeHttpCode:e.status})},handleCheckExistingSuccess:function(){c.set({overallUploadResult:s.default.MEDIA_UPLOAD_RESULT_TYPE.DUPLICATE,overallIsFinal:!0,resumeHttpCode:200}),c.markOverallCumT(),c.commit()},handleUploadHostFound:function(e){let{hostName:t,hostClass:n,failCount:r}=e;c.set({overallDomain:t,overallConnectionClass:n,overallRetryCount:r})},handleUploadSuccess:function(){c.set({resumeHttpCode:404,overallUploadResult:s.default.MEDIA_UPLOAD_RESULT_TYPE.OK,overallIsFinal:!0,uploadHttpCode:200,finalizeHttpCode:200}),c.markOverallCumT(),c.commit()},handleUploadError:function(e){c.set({overallUploadResult:(0,o.getMetricUploadErrorResultType)(e),overallIsFinal:!0});const t=(0,o.getStatusCode)(e);null!=t&&(c.uploadHttpCode=t,c.finalizeHttpCode=t),c.markOverallCumT(),c.commit(),(0,o.logErrorUnknownDetails)(c,e)},handleUploadAttemptSuccess:function(e){c.set({overallT:e})},handleUploadAttemptError:function(e,t,n,r){const i=new s.default.MediaUpload2(c),a=(0,o.getStatusCode)(e),l=r===s.default.OVERALL_LAST_UPLOAD_RETRY_PHASE_TYPE.FINALIZE?a:i.finalizeHttpCode;i.set({mediaId:(0,o.generateMediaEventId)(),overallUploadResult:(0,o.getMetricUploadErrorResultType)(e),overallIsFinal:!1,overallT:t,overallRetryCount:n,overallLastUploadRetryPhase:r,finalizeHttpCode:l}),null!=a&&(c.uploadHttpCode=a),c.markOverallCumT(),i.commit(),(0,o.logErrorUnknownDetails)(c,e)},mediaId:u,handleEncryptionStart:function(){c.startOverallEncryptT()},handleEncryptionSuccess:function(){c.markOverallEncryptT()},handleUploadProgress:function(e){c.set({uploadBytesTransferred:e})},handleSendMessageStart:function(){c.markOverallUserVisibleT()}}};var i=n(791357),a=r(n(918285)),o=n(464404),s=r(n(571834))},918285:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(t)return i.default.UPLOAD_SOURCE_TYPE.OTHER;switch(e){case i.default.MEDIA_PICKER_ORIGIN_TYPE.CHAT_PHOTO_LIBRARY:return i.default.UPLOAD_SOURCE_TYPE.GALLERY;case i.default.MEDIA_PICKER_ORIGIN_TYPE.MENU_CAMERA_CAPTURE:return i.default.UPLOAD_SOURCE_TYPE.CAMERA;case i.default.MEDIA_PICKER_ORIGIN_TYPE.PASTE:return i.default.UPLOAD_SOURCE_TYPE.SHARE;default:return i.default.UPLOAD_SOURCE_TYPE.OTHER}};var i=r(n(571834))},92577:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(88237),o=n(924583),s=r(n(947077)),l=n(990445),u=r(n(319753)),c=r(n(584656)),d=r(n(507511)),p=n(698210),_=r(n(28790)),f=n(263958),h=n(300098),g=n(245598),m=r(n(665810)),y=n(241588);r(n(571834));function E(e){let{mediaKey:t,mediaKeyTimestamp:n}=e;if(null!=t&&null!=n)return{mediaKey:t,mediaKeyTimestamp:n};const{key:r,timestamp:i}=(0,d.default)();return{mediaKey:r,mediaKeyTimestamp:i}}var S=new class{constructor(){var e=this;this.checkIfAlreadyUploaded=(0,s.default)((e=>e.encFilehash),function(){var e=(0,i.default)((function*(e){const{encFilehash:t,type:n}=e;__LOG__(2)`uploadManager.checkIfAlreadyUploaded: start`;try{const t=yield _.default.checkIfUploadExists(e).catch((0,o.filteredCatch)(f.MediaNotFoundError,(()=>null)));return __LOG__(2)`uploadManager.checkIfAlreadyUploaded: success`,t}catch(e){throw e.name===a.ABORT_ERROR?__LOG__(2)`uploadManager.checkIfAlreadyUploaded: canceled`:__LOG__(3)`uploadManager.checkIfAlreadyUploaded: error`,e}}));return function(){return e.apply(this,arguments)}}()),this._memoizedUpload=(0,s.default)((e=>e.encFilehash),function(){var e=(0,i.default)((function*(e){var t;const{ciphertextHmac:n,encFilehash:r,type:i,signal:a,onUploadHostFound:o,onUploadAttemptSuccess:s,onUploadAttemptError:l,onUploadSuccess:u,onProgress:c,onFinalize:d,onStreamUploadStart:p,mediaId:f}=e,h=yield _.default.upload({ciphertextHmac:n,encFilehash:r,type:i,signal:a,onUploadHostFound:o,onUploadAttemptSuccess:s,onUploadAttemptError:l,onProgress:c,byteOffset:null!==(t=e.byteOffset)&&void 0!==t?t:0,onFinalize:d,onStreamUploadStart:p,mediaId:f});return u(),h}));return function(){return e.apply(this,arguments)}}()),this._getExistingOrUpload=(0,s.default)((e=>e.encFilehash),function(){var t=(0,i.default)((function*(t){const{ciphertextHmac:n,encFilehash:r,signal:i,type:o,onCheckExistingSuccess:s,onCheckExistingError:l,onUploadHostFound:u,onUploadAttemptSuccess:c,onUploadAttemptError:d,onUploadSuccess:p,onProgress:_,onFinalize:f,onStreamUploadStart:h,mediaId:g}=t;__LOG__(2)`uploadManager._getExistingOrUpload: start`;try{const t=yield e.checkIfAlreadyUploaded({encFilehash:r,type:o,signal:i,mediaId:g}).catch((e=>{throw l(e),e})).then((t=>!0===(null==t?void 0:t.complete)?(s(),{directPath:t.directPath,handle:t.handle,url:t.url}):e._memoizedUpload({ciphertextHmac:n,encFilehash:r,type:o,signal:i,onUploadHostFound:u,onUploadAttemptSuccess:c,onUploadAttemptError:d,onUploadSuccess:p,onCheckExistingSuccess:s,onCheckExistingError:l,onProgress:_,onFinalize:f,onStreamUploadStart:h,byteOffset:null==t?void 0:t.resume,mediaId:g})));return __LOG__(2)`uploadManager._getExistingOrUpload: success`,t}catch(e){throw e.name===a.ABORT_ERROR?__LOG__(2)`uploadManager._getExistingOrUpload: canceled`:__LOG__(3)`uploadManager._getExistingOrUpload: error`,e}}));return function(){return t.apply(this,arguments)}}()),h.downloadUploadCrashLogger.init()}encryptAndUpload(e){var t=this;return(0,i.default)((function*(){const{blob:n,signal:r,type:o,userUploadAttemptCount:s,forwardedFromWeb:l,uploadOrigin:d,onProgress:_,onFinalize:f,isViewOnce:m}=e;__LOG__(2)`uploadManager.encryptAndUpload: start`;const{handleCheckExistingSuccess:S,handleCheckExistingError:v,handleUploadHostFound:A,handleUploadAttemptSuccess:C,handleUploadAttemptError:P,handleUploadSuccess:O,handleArrayBufferCreated:I,handleUploadError:M,mediaId:b,handleEncryptionStart:R,handleEncryptionSuccess:N,handleStreamUploadStart:w,handleUploadProgress:L}=(0,u.default)(o,d,s,l,m),D=(e,t)=>{null==_||_(e,t);const n=t+e.loaded;L(n)};h.downloadUploadCrashLogger.mark(b,h.ProgressType.UPLOAD_ENCRYPTION_STARTED);try{let a;if((0,g.isPerformanceExperimentEnabled)()){const i=E(e);a=Promise.resolve(n).then((e=>{h.downloadUploadCrashLogger.mark(b,h.ProgressType.UPLOAD_BLOB_TO_ARRAY_BUFFER_STARTED,{size:n instanceof Blob?n.size:n.byteLength});const t=e instanceof Blob?(0,p.blobToArrayBuffer)(e):e;return h.downloadUploadCrashLogger.mark(b,h.ProgressType.UPLOAD_BLOB_TO_ARRAY_BUFFER_FINISHED),t})).then((e=>(I(e.byteLength),R(),(0,c.default)({type:o,plaintext:e,mediaKey:i.mediaKey})))).then((n=>{let{hash:a,ciphertextHmac:s,sidecar:u,firstFrameSidecar:c}=n;N(),h.downloadUploadCrashLogger.mark(b,h.ProgressType.UPLOAD_ENCRYPTION_FINISHED);return(e.mediaKey?t._getExistingOrUpload:t._memoizedUpload)({ciphertextHmac:s,encFilehash:a,type:o,signal:r,onCheckExistingSuccess:S,onCheckExistingError:v,onUploadHostFound:A,onUploadAttemptSuccess:C,onUploadAttemptError:P,onUploadSuccess:O,onProgress:D,onFinalize:f,onStreamUploadStart:w,mediaId:b}).then((e=>({directPath:l&&y.ServerProps.mmsCatV1ForwardHotOverrideEnabled?T(e.directPath):e.directPath,encFilehash:a,mediaKey:i.mediaKey,mediaKeyTimestamp:i.mediaKeyTimestamp,sidecar:u,firstFrameSidecar:c,url:e.url,handle:e.handle})))}))}else{h.downloadUploadCrashLogger.mark(b,h.ProgressType.UPLOAD_BLOB_TO_ARRAY_BUFFER_STARTED,{size:n instanceof Blob?n.size:n.byteLength});const s=n instanceof Blob?(0,p.blobToArrayBuffer)(n):Promise.resolve(n);h.downloadUploadCrashLogger.mark(b,h.ProgressType.UPLOAD_BLOB_TO_ARRAY_BUFFER_FINISHED),a=s.then(function(){var n=(0,i.default)((function*(n){I(n.byteLength);const{mediaKey:i,mediaKeyTimestamp:a}=E(e);R();const{ciphertextHmac:s,hash:u,sidecar:d,firstFrameSidecar:p}=yield(0,c.default)({type:o,plaintext:n,mediaKey:i});N(),h.downloadUploadCrashLogger.mark(b,h.ProgressType.UPLOAD_ENCRYPTION_FINISHED);const _=e.mediaKey?t._getExistingOrUpload:t._memoizedUpload,g=yield _({ciphertextHmac:s,encFilehash:u,type:o,signal:r,onCheckExistingSuccess:S,onCheckExistingError:v,onUploadHostFound:A,onUploadAttemptSuccess:C,onUploadAttemptError:P,onUploadSuccess:O,onFinalize:f,onStreamUploadStart:w,onProgress:D,mediaId:b});return{directPath:l&&y.ServerProps.mmsCatV1ForwardHotOverrideEnabled?T(g.directPath):g.directPath,encFilehash:u,mediaKey:i,mediaKeyTimestamp:a,sidecar:d,firstFrameSidecar:p,url:g.url,handle:g.handle}}));return function(){return n.apply(this,arguments)}}())}const s=yield a;return __LOG__(2)`uploadManager.encryptAndUpload: success`,h.downloadUploadCrashLogger.mark(b,h.ProgressType.UPLOAD_FINISHED),s}catch(e){throw e.name===a.ABORT_ERROR?__LOG__(2)`uploadManager.encryptAndUpload: canceled`:__LOG__(3)`uploadManager.encryptAndUpload: error`,h.downloadUploadCrashLogger.mark(b,h.ProgressType.UPLOAD_ERROR),M(e),e}}))()}unencryptedUpload(e){const{file:t,hash:n,type:r,signal:i,uploadOrigin:a,isViewOnce:o}=e,{handleCheckExistingSuccess:s,handleCheckExistingError:l,handleUploadHostFound:c,handleUploadAttemptSuccess:d,handleUploadAttemptError:p,handleUploadSuccess:_,handleStreamUploadStart:f,handleUploadProgress:h,mediaId:g}=(0,u.default)(r,a,0,!1,o);return this._getExistingOrUpload({ciphertextHmac:t,encFilehash:n,type:r,signal:i,onCheckExistingSuccess:s,onCheckExistingError:l,onUploadHostFound:c,onUploadAttemptSuccess:d,onUploadAttemptError:p,onUploadSuccess:_,onStreamUploadStart:f,onProgress:(e,t)=>{h(e.loaded+t)},mediaId:g})}uploadCoverPhoto(e){const{file:t,hash:n,type:r,signal:i,uploadOrigin:a,isViewOnce:o}=e,{handleCheckExistingSuccess:s,handleCheckExistingError:l,handleUploadHostFound:c,handleUploadAttemptSuccess:d,handleUploadAttemptError:p,handleUploadSuccess:_,handleStreamUploadStart:f,handleUploadProgress:h,mediaId:g}=(0,u.default)(r,a,0,!1,o);return this._memoizedUpload({ciphertextHmac:t,encFilehash:n,type:r,signal:i,onCheckExistingSuccess:s,onCheckExistingError:l,onUploadHostFound:c,onUploadAttemptSuccess:d,onUploadAttemptError:p,onUploadSuccess:_,onStreamUploadStart:f,onProgress:(e,t)=>{h(e.loaded+t)},mediaId:g})}};function T(e){const[t,n]=e.split("?"),r=new m.default(n),i=(0,l.unixTime)();return r.set("_nc_hot",String(i)),`${t}?${r.toString()}`}t.default=S},300098:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.downloadUploadCrashLogger=t.ProgressType=void 0;var i=r(n(174285)),a=n(241588);const o=n(76672).Mirrored(["DOWNLOAD_STARTED","DOWNLOAD_FINISHED","DOWNLOAD_DECRYPTION_STARTED","DOWNLOAD_DECRYPTION_FINISHED","DOWNLOAD_ERROR","UPLOAD_STARTED","UPLOAD_FINISHED","UPLOAD_BLOB_TO_ARRAY_BUFFER_STARTED","UPLOAD_BLOB_TO_ARRAY_BUFFER_FINISHED","UPLOAD_ENCRYPTION_STARTED","UPLOAD_ENCRYPTION_FINISHED","UPLOAD_ERROR"]);t.ProgressType=o;const s="DownloadUploadCrashLoggerLikelyCrashed",l=new Set([o.DOWNLOAD_DECRYPTION_FINISHED,o.DOWNLOAD_ERROR,o.UPLOAD_FINISHED,o.UPLOAD_ERROR]);const u=new class{constructor(){this.hasPerformedInit=!1,this._clearAllStorage=()=>{null===i.default||void 0===i.default||i.default.removeItem(s)}}_getStorage(){const e=null===i.default||void 0===i.default?void 0:i.default.getItem(s);return e?JSON.parse(e):{}}_commitStorage(){null===i.default||void 0===i.default||i.default.setItem(s,JSON.stringify(this.storage))}_shouldLog(){return!0===a.ServerProps.webLogUploadDownloadCrashes}init(){!this.hasPerformedInit&&this._shouldLog()&&(window.addEventListener("beforeunload",this._clearAllStorage),this.storage=this._getStorage(),Object.entries(this.storage).forEach((e=>{let[t,{progressType:n,metadata:r}]=e;var i,a;__LOG__(3,void 0,void 0,!0)`downloadUploadCrashLogger.likelyCrashedDuring${a=n,a.toLowerCase().replace(/(?:^|_)(\w)/g,((e,t)=>t.toLocaleUpperCase()))}WithID${t}${r?`AndData => ${i=r,Object.entries(i).map((e=>{let[t,n]=e;return`${t}: ${String(n)}`})).join(", ")}`:""}`,SEND_LOGS("download-upload-manager-likely-crashed")})),this._clearAllStorage(),this.hasPerformedInit=!0)}reset(){this._shouldLog()&&(window.removeEventListener("beforeunload",this._clearAllStorage),this._clearAllStorage(),this.hasPerformedInit=!1)}mark(e,t,n){this._shouldLog()&&(l.has(t)?delete this.storage[String(e)]:this.storage[String(e)]={progressType:t,metadata:n},this._commitStorage())}};t.downloadUploadCrashLogger=u},245598:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPerformanceExperimentEnabled=function(){if(a())return!0;return(0,r.getABPropConfigValue)("web_abprop_large_files_encryption_optimization")},t.shouldEncryptInChunks=function(e){return a()&&e>i.DEFAULT_MAX_FILE_SIZE_BYTES};var r=n(287461),i=n(241588);function a(){return i.ServerProps.maxFileSize>i.DEFAULT_MAX_FILE_SIZE_BYTES||i.ServerProps.maxElectronFileSize>i.DEFAULT_MAX_FILE_SIZE_BYTES}},147980:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.EventType=void 0,t.getEphemeralExpirationTimestamp=function(e){const{ephemeralDuration:t,ephemeralStartTimestamp:n,t:r,subtype:i,id:{fromMe:a}}=e;if("ephemeral_setting"===i)return null;if(null==t||0===t)return null;if(a&&null!=n)return n+t;return r+t},t.getOriginalSender=function(e){return(0,l.toUserWid)(e.originalSelfAuthor||p(e))},t.getSender=p,t.hasMentionOfMe=d,t.isGroupMsg=_,t.isImportantMessage=function(e){return d(e)||function(e){if(!e)return!1;if(e.quotedMsg&&e.quotedParticipant)return(0,o.isMeAccount)(c(e.quotedParticipant));return!1}(e)},t.isNotification=g,t.isNotificationType=m,t.isSentByMe=h,t.isStatusV3=f,t.isUnreadTypeMsg=function(e){switch(e.type){case"chat":case"image":case"video":case"audio":case"ptt":case"document":case"vcard":case"location":case"ciphertext":case"oversized":case"multi_vcard":case"sticker":case"product":case"groups_v4_invite":case"poll_creation":return!0;case"revoked":return!(0,i.isSenderRevokeUiEnabled)();case"protocol":case"order":case"biz-cover-photo":case"broadcast_notification":case"buttons_response":case"call_log":case"debug":case"e2e_notification":case"gp2":case"group_notification":case"hsm":case"interactive":case"interactive_response":case"keep_in_chat":case"list":case"list_response":case"native_flow":case"notification":case"notification_template":case"payment":case"poll_update":case"reaction":case"reaction_enc":case"request_phone_number":case"template_button_reply":case"unknown":return!1;default:return e.type,!1}};var i=n(493928),a=n(373070),o=n(459857),s=r(n(124928)),l=n(669050);const u=n(76672)({DEFAULT:"d",SIGNIFICANT:"s",AMBIENT:"a",NOTEWORTHY:"n",IGNORE:"i"});function c(e){return e instanceof s.default?e:null!=e.user?(0,l.createUserWid)(e.user,e.server):e}function d(e){return!!(null==e?void 0:e.mentionedJidList)&&e.mentionedJidList.some((e=>(0,o.isMeAccount)(c(e))))}function p(e){return h(e)?e.from:_(e)||f(e)?e.author:e.from}function _(e){return s.default.isGroup(e.from)||s.default.isGroup(e.to)}function f(e){return s.default.isStatusV3(e.id.remote)}function h(e){return"in"!==e.id.self&&!g(e)&&(0,o.isMeAccount)(e.from)}function g(e){return m(e.type,e.subtype)}function m(e,t){switch(e){case a.MSG_TYPE.GROUP_NOTIFICATION:case a.MSG_TYPE.GP2:case a.MSG_TYPE.BROADCAST_NOTIFICATION:case a.MSG_TYPE.NOTIFICATION:case a.MSG_TYPE.NOTIFICATION_TEMPLATE:case a.MSG_TYPE.E2E_NOTIFICATION:case a.MSG_TYPE.CALL_LOG:return!0;case a.MSG_TYPE.PROTOCOL:return"ephemeral_setting"===t||"share_phone_number"===t;default:return!1}}t.EventType=u},678794:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.msgDataFromMsgModel=function e(t){const n=t.toJSON();return(0,i.default)((0,i.default)({},n),{},{paymentNoteMsg:n.paymentNoteMsg?e(n.paymentNoteMsg):void 0,quotedMsg:n.quotedMsg?e(n.quotedMsg):void 0})};var i=r(n(81109))},890344:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getNativeFlowNameByButtonName=function(e){switch(e){case"review_and_pay":return i.default.ORDER_DETAILS;case"review_order":return i.default.ORDER_STATUS}},t.isValidNativeFlowMessage=void 0;var i=r(n(753110)),a=n(931678),o=n(642680);t.isValidNativeFlowMessage=e=>{if(null==e.nativeFlowName)return!1;switch(e.nativeFlowName){case i.default.ORDER_DETAILS:return null!=(0,a.getOrderInfo)(e);case i.default.ORDER_STATUS:return null!=(0,o.getOrderStatusInfo)(e)}}},931678:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.paramsJsonToOrderInfo=t.getOrderInfo=t.getCustomItemIdPrefix=void 0;var i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(395557)),a=r(n(753110)),o=r(n(182394)),s=n(373070);function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}function u(e){var t;const n=null==e?void 0:e.value;if(null==n)return;const r=null!==(t=null==e?void 0:e.offset)&&void 0!==t?t:1;return parseFloat(null!=n?n:0)/parseInt(r,10)}const c=()=>"custom-item";t.getCustomItemIdPrefix=c;const d=(e,t)=>{var n,r;if("review_and_pay"!==e||null==t)return null;const a=i.parse(t),{order:o,currency:s,reference_id:l}=a,c=u(a.total_amount),d=null!==(n=null==o?void 0:o.items)&&void 0!==n?n:[],p=d.map((e=>{var t,n,r,i,a,o,s;return{id:null!==(t=null!==(n=null==e?void 0:e.product_id)&&void 0!==n?n:null==e?void 0:e.retailer_id)&&void 0!==t?t:"",name:null!==(r=null==e?void 0:e.name)&&void 0!==r?r:"",amount:u(null==e?void 0:e.amount),quantity:parseInt(null!==(i=null==e?void 0:e.quantity)&&void 0!==i?i:0,10),isCustomItem:null!==(a=null==e?void 0:e.isCustomItem)&&void 0!==a?a:0===(null==e||null===(o=e.retailer_id)||void 0===o?void 0:o.indexOf("custom-item")),isQuantitySet:null===(s=null==e?void 0:e.isQuantitySet)||void 0===s||s}})),_=p.reduce(((e,t)=>e+t.quantity),0),f=null===(r=d[0])||void 0===r?void 0:r.name;if(null==f||null==l||null==s||null==c)return null;return{title:f,referenceId:l,currency:s,quantity:_,shipping:u(null==o?void 0:o.shipping),tax:u(null==o?void 0:o.tax),discount:u(null==o?void 0:o.discount),subtotal:u(null==o?void 0:o.subtotal),totalAmount:c,items:p,type:a.type}};t.paramsJsonToOrderInfo=d;t.getOrderInfo=e=>{var t;if(e.nativeFlowName!==a.default.ORDER_DETAILS)return null;if(e.type===s.MSG_TYPE.INTERACTIVE&&e.interactiveType===o.default.NATIVE_FLOW&&(null===(t=e.interactivePayload)||void 0===t?void 0:t.buttons)){const{name:t,buttonParamsJson:n}=e.interactivePayload.buttons[0];return d(t,n)}if(e.type===s.MSG_TYPE.NATIVE_FLOW){var n;const{nativeFlowInfo:t}=(null!==(n=e.nativeFlowButtons)&&void 0!==n?n:[])[0];return d(null==t?void 0:t.name,null==t?void 0:t.paramsJson)}}},642680:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.paramsJsonToOrderStatusInfo=t.getOrderStatusInfo=t.getOrderMessage=t.getDefaultOrderStatus=t.findOrderStatusMessage=t.findOrderStatus=t.findOrderDetailsMessage=t.OrderStatus=void 0;var i=r(n(530988)),a=r(n(753110)),o=r(n(182394)),s=n(373070),l=n(931678);const u=n(76672)({Pending:"pending",Processing:"processing",PartiallyShipped:"partially_shipped",Shipped:"shipped",Complete:"completed",Canceled:"canceled"});t.OrderStatus=u;const c=(e,t)=>{if("review_order"!==e||null==t)return null;const{order:n,reference_id:r}=JSON.parse(t),i=u.cast(null==n?void 0:n.status);return null==i||null==r?null:{refId:r,status:i}};t.paramsJsonToOrderStatusInfo=c;const d=e=>{var t;if(e.nativeFlowName!==a.default.ORDER_STATUS)return null;if(e.type===s.MSG_TYPE.INTERACTIVE&&e.interactiveType===o.default.NATIVE_FLOW&&(null===(t=e.interactivePayload)||void 0===t?void 0:t.buttons)){const{name:t,buttonParamsJson:n}=e.interactivePayload.buttons[0];return c(t,n)}if(e.type===s.MSG_TYPE.NATIVE_FLOW){var n;const{nativeFlowInfo:t}=(null!==(n=e.nativeFlowButtons)&&void 0!==n?n:[])[0];return c(null==t?void 0:t.name,null==t?void 0:t.paramsJson)}};t.getOrderStatusInfo=d;const p=(e,t)=>{var n;const r=e.msgs.getModelsArray().slice(-1e3);return null===(n=(0,i.default)(r,(e=>{var n;return e.nativeFlowName===a.default.ORDER_DETAILS&&(null===(n=(0,l.getOrderInfo)(e))||void 0===n?void 0:n.referenceId)===t})))||void 0===n?void 0:n.safe()};t.findOrderDetailsMessage=p;t.getOrderMessage=e=>{var t;const n=null===(t=d(e))||void 0===t?void 0:t.refId;return null==n?null:p(e.chat,n)};const _=(e,t)=>{var n;const r=e.msgs.getModelsArray().slice(-1e3);return null===(n=(0,i.default)(r,(e=>{var n;return e.nativeFlowName===a.default.ORDER_STATUS&&(null===(n=d(e))||void 0===n?void 0:n.refId)===t})))||void 0===n?void 0:n.safe()};t.findOrderStatusMessage=_;const f=()=>u.Pending;t.getDefaultOrderStatus=f;t.findOrderStatus=(e,t)=>{var n;const r=_(e,t),i=null!=r?d(r):null;return null!==(n=null==i?void 0:i.status)&&void 0!==n?n:f()}},357118:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateOrderAndSendReceipt=void 0;var r=n(642680),i=n(401646);const a=new Set([r.OrderStatus.Complete,r.OrderStatus.Canceled]);t.validateOrderAndSendReceipt=(e,t)=>{if(!e)return!0;const o=n(965012).ChatCollection.get(e.remote.toString());if(!o)return!0;const s=(0,r.getOrderStatusInfo)(t);if(!s)return!0;const l=(0,r.findOrderStatusMessage)(o,s.refId);if(!l)return!0;const u=(0,r.getOrderStatusInfo)(l);if(!u)return!0;if(u.status===s.status)return!1;const c=s.status!==(0,r.getDefaultOrderStatus)()&&!a.has(u.status);return c||(0,i.sendOrderStatusUpdateFailureReceipt)(e.id,e.remote,i.BizErrorReason.InvalidTransition),c}},401646:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BizErrorReason=void 0,t.sendOrderStatusUpdateFailureReceipt=function(e,t,n){(0,r.deprecatedCastStanza)((0,i.wap)("receipt",{type:"error",to:(0,i.CUSTOM_STRING)(t.toJid()),id:(0,i.CUSTOM_STRING)(e)},(0,i.wap)("biz",{reason:(0,i.CUSTOM_STRING)(String(n))}),(0,i.wap)("error",{type:"order-status-update-failed"})))};var r=n(911794),i=n(738102);const a=n(76672)({InvalidTransition:"invalid-transition",CancellationFailed:"cancellation-failed"});t.BizErrorReason=a},565754:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(710038),a=n(459857),o=r(n(124928)),s=n(669050),l=r(n(929770)),u=r(n(349039));class c{constructor(e){let t=e;if(!t)throw new Error("MsgKey error: obj is null/undefined");t.id instanceof c&&(t=t.id,__LOG__(3)`MsgKey error: id is already a MsgKey`);const n=t.from&&t.to&&t.id,r=void 0!==t.fromMe&&t.remote&&t.id;let i,s,l,d,p,_,f;const h=(0,a.getMaybeMeUser)();if(!h)throw new Error("MsgKey error: me is undefined. Running tests? Call setupGlobalsForTests first.");if(n&&r)throw __LOG__(3)`Unclear constructor MsgKey: ${JSON.stringify(t)}`,new Error("MsgKey error: unclear which constructor to use");if(!n&&!r)throw __LOG__(3)`No matching constructor MsgKey: ${JSON.stringify(t)}`,new Error("MsgKey error: don't have a matching constructor");if(n){if(({from:i,to:s,id:l,participant:d,selfDir:p}=t),!(i instanceof o.default)||!(s instanceof o.default)||d&&!(d instanceof o.default))throw __LOG__(3)`Incorrect Wid MsgKey: from:${String(i)} to:${String(s)} p:${String(d)}`,new Error("MsgKey error: something is not a wid");p=o.default.equals(i,s)?p:void 0,o.default.equals(i,s)&&(0,a.isMePrimary)(i)?(_="out"===p,f=h):(0,a.isMePrimary)(i)?(_=!0,f=s):(0,a.isMePrimary)(s)?(_=!1,f=i):o.default.equals(i,s)&&(o.default.isGroup(i)||o.default.isBroadcast(i))?(_=!0,f=i):__LOG__(3)`MsgKey case error: ${[i,s,l,h].join()}`,void 0!==_&&(this.fromMe=_),f&&(this.remote=f),l&&(this.id=l)}else if(r){if(({fromMe:_,remote:f,id:l,participant:d}=t),!(f instanceof o.default)||d&&!(d instanceof o.default))throw __LOG__(3)`Incorrect Wid MsgKey: remote:${String(f)} p:${String(d)}`,new Error("MsgKey error: something is not a wid");(0,a.isMePrimary)(f)&&(p=_?"out":"in"),void 0!==_&&(this.fromMe=_),f&&(this.remote=f),l&&(this.id=l)}const g=[this.fromMe,this.remote,this.id];void 0!==p&&(this.self=p,g.push(this.self)),(0,u.default)()&&void 0!==d&&(this.participant=d,g.push(this.participant)),this._serialized=g.join("_")}toString(){return this._serialized}clone(){return new c({fromMe:this.fromMe,remote:this.remote,id:this.id,participant:this.participant})}equals(e){return e instanceof c&&this.toString()===e.toString()}static fromString(e){if(null==e)throw new Error("MsgKey.fromString error: str is null or not a string");return c.from(e)}static from(e){if(e instanceof c)return e;let t;return t="string"==typeof e?(0,l.default)(e):e,new c({fromMe:t.fromMe,remote:(0,s.createWidFromWidLike)(t.remote),id:t.id,participant:t.participant?(0,s.createWidFromWidLike)(t.participant):void 0})}static newId(){return"3EB0"+(0,i.randomHex)(8)}}t.default=c},929770:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!e||!(0,r.isString)(e))throw new Error("MsgKey fromString error: str is null or not a string");const t=e.split("_");let n;t.length<3?__LOG__(3)`MsgKey error: cannot create MsgKey from ${e}`:4===t.length?"out"!==t[3]&&"in"!==t[3]&&(n=t[3]):5===t.length&&(n=t[4]);return{fromMe:"true"===t[0],remote:t[1],id:t[2],participant:n}};var r=n(425315)},349039:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return!0}},95589:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.NuxSyncKey=t.NuxKeyTypes=t.NUX=t.CoolOffPeriodKeys=void 0,t.getChatAutoMutedNuxKey=s,t.getCommunityAdminPromotionNuxKey=o,t.getMembershipApprovalRequestsBannerNuxKey=function(e){return`membership_approval_requests_banner_${e}`},t.getNuxMaxViews=function(e){switch(e){case a.DESKTOP_UPSELL:return Number.POSITIVE_INFINITY;case a.CHAT_ASSIGNMENT:return(0,i.chatAssignmentMaxNuxImpressions)();case a.ARCHIVE:case a.STATUS_QUICK_REPLIES:return 3;default:return 1}},t.getNuxSyncKey=function(e){switch(e){case a.EPHEMERAL:return l.EPHEMERAL;case a.EPHEMERAL_VIEW_ONCE:return l.EPHEMERAL_VIEW_ONCE;case a.EPHEMERAL_VIEW_ONCE_RECEIVER:return l.EPHEMERAL_VIEW_ONCE_RECEIVER;case a.ARCHIVE:return l.ARCHIVE;case a.STATUS_QUICK_REPLIES:return l.STATUS_QUICK_REPLIES;case a.COMMUNITY:return l.COMMUNITY;case a.COMMUNITY_HOME:return l.COMMUNITY_HOME;case a.KEEP_IN_CHAT:return l.KEEP_IN_CHAT;default:return e.includes(o(""))||e.includes(s(""))?e:null}};var i=n(72696);r(n(571834));const a={SAFARI_LIMITED_SUPPORT:"safari_limited_support",SENDER_REVOKE_LEGAL_DISCLAIMER_NUX:"revoke_legal_disclaimer_nux",SENDER_REVOKE_LEGAL_DISCLAIMER_NUX_NEW:"sender_revoke_legal_disclaimer_nux",ADMIN_REVOKE_LEGAL_DISCLAIMER_NUX:"admin_revoke_legal_disclaimer_nux",EPHEMERAL:"ephemeral",EPHEMERAL_VIEW_ONCE:"ephemeral_view_once",EPHEMERAL_VIEW_ONCE_RECEIVER:"ephemeral_view_once_receiver",ARCHIVE:"archive",COMMUNITY:"community",COMMUNITY_HOME:"community_home",STATUS_QUICK_REPLIES:"status_quick_replies",KEEP_IN_CHAT:"keep_in_chat",CHAT_ASSIGNMENT:"chat_assignment",DESKTOP_UPSELL:"desktop_upsell",KEEP_IN_CHAT_SYSTEM_MESSAGE:"keep_in_chat_system_message"};function o(e){return`community_admin_promote_${e.toString()}`}function s(e){return`chat_auto_muted_${e.toString()}`}t.NUX=a;const l=n(76672)({EPHEMERAL:"ephemeral",EPHEMERAL_VIEW_ONCE:"ephemeral_view_once",EPHEMERAL_VIEW_ONCE_RECEIVER:"ephemeral_view_once_receiver",ARCHIVE:"archive",STATUS_QUICK_REPLIES:"status_quick_replies",COMMUNITY:"community",COMMUNITY_HOME:"community_home",KEEP_IN_CHAT:"keep_in_chat",KEEP_IN_CHAT_SYSTEM_MESSAGE:"keep_in_chat_system_message"});t.NuxSyncKey=l;t.NuxKeyTypes={COOL_OFF_NUX:{INCOMPLETE_BUSINESS_PROFILE_BANNER:"incomplete_business_profile_banner",PRODUCT_CATALOG_BANNER:"product_catalog_banner",COLLECTIONS:"collections_banner",CART_INTERSTITIAL:"cart_interstitial"},VIEW_COUNT_NUX:{SAFARI_LIMITED_SUPPORT:"safari_limited_support",SENDER_REVOKE_LEGAL_DISCLAIMER_NUX:"revoke_legal_disclaimer_nux",ADMIN_REVOKE_LEGAL_DISCLAIMER_NUX:"admin_revoke_legal_disclaimer_nux",EPHEMERAL:"ephemeral",EPHEMERAL_VIEW_ONCE:"ephemeral_view_once",EPHEMERAL_VIEW_ONCE_RECEIVER:"ephemeral_view_once_receiver",ARCHIVE:"archive",COMMUNITY:"community",COMMUNITY_HOME:"community_home",KEEP_IN_CHAT:"keep_in_chat",CHAT_ASSIGNMENT:"chat_assignment",DESKTOP_UPSELL:"desktop_upsell",KEEP_IN_CHAT_SYSTEM_MESSAGE:"keep_in_chat_system_message"}};t.CoolOffPeriodKeys={DEFAULT:"default_cool_off_banners_key",CATALOG:"catalog_banners_key"}},170315:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(984140));let a;if("undefined"!=typeof self)a=self;else{if(void 0===n.g)throw new Error("Couldn't get global object");a=n.g}var o="AbortController"in a?a.AbortController:class{constructor(){this.signal=new i.default}abort(){const e=new Event("abort");this.signal.dispatchEvent(e)}};t.default=o},984140:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(934784)),a=class extends i.default{constructor(){super(),this.aborted=!1}dispatchEvent(e){return"abort"===e.type&&(this.aborted=!0,"function"==typeof this.onabort&&this.onabort.call(this,e)),super.dispatchEvent(e)}toString(){return"[object AbortSignal]"}};t.default=a},934784:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(395654));t.default=class{constructor(){this._emitter=new i.default}addEventListener(e,t){this._emitter.on(e,t,this)}removeEventListener(e,t){this._emitter.off(e,t,this)}dispatchEvent(e){return this._emitter.trigger(e.type),!0}}},962559:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ADVSignedKeyIndexListSpec=t.ADVSignedDeviceIdentitySpec=t.ADVSignedDeviceIdentityHMACSpec=t.ADVKeyIndexListSpec=t.ADVDeviceIdentitySpec=void 0;var i=r(n(81109)),a=n(739660);const o=(0,i.default)({},null);t.ADVKeyIndexListSpec=o;const s=(0,i.default)({},null);t.ADVSignedKeyIndexListSpec=s;const l=(0,i.default)({},null);t.ADVDeviceIdentitySpec=l;const u=(0,i.default)({},null);t.ADVSignedDeviceIdentitySpec=u;const c=(0,i.default)({},null);t.ADVSignedDeviceIdentityHMACSpec=c,o.internalSpec={rawId:[1,a.TYPES.UINT32],timestamp:[2,a.TYPES.UINT64],currentIndex:[3,a.TYPES.UINT32],validIndexes:[4,a.FLAGS.REPEATED|a.FLAGS.PACKED|a.TYPES.UINT32]},s.internalSpec={details:[1,a.TYPES.BYTES],accountSignature:[2,a.TYPES.BYTES]},l.internalSpec={rawId:[1,a.TYPES.UINT32],timestamp:[2,a.TYPES.UINT64],keyIndex:[3,a.TYPES.UINT32]},u.internalSpec={details:[1,a.TYPES.BYTES],accountSignatureKey:[2,a.TYPES.BYTES],accountSignature:[3,a.TYPES.BYTES],deviceSignature:[4,a.TYPES.BYTES]},c.internalSpec={details:[1,a.TYPES.BYTES],hmac:[2,a.TYPES.BYTES]}},294075:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.NoiseCertificateSpec=t.NoiseCertificate$DetailsSpec=t.CertChainSpec=t.CertChain$NoiseCertificateSpec=t.CertChain$NoiseCertificate$DetailsSpec=void 0;var i=r(n(81109)),a=n(739660);const o=(0,i.default)({},null);t.NoiseCertificateSpec=o;const s=(0,i.default)({},null);t.NoiseCertificate$DetailsSpec=s;const l=(0,i.default)({},null);t.CertChainSpec=l;const u=(0,i.default)({},null);t.CertChain$NoiseCertificateSpec=u;const c=(0,i.default)({},null);t.CertChain$NoiseCertificate$DetailsSpec=c,o.internalSpec={details:[1,a.TYPES.BYTES],signature:[2,a.TYPES.BYTES]},s.internalSpec={serial:[1,a.TYPES.UINT32],issuer:[2,a.TYPES.STRING],expires:[3,a.TYPES.UINT64],subject:[4,a.TYPES.STRING],key:[5,a.TYPES.BYTES]},l.internalSpec={leaf:[1,a.TYPES.MESSAGE,u],intermediate:[2,a.TYPES.MESSAGE,u]},u.internalSpec={details:[1,a.TYPES.BYTES],signature:[2,a.TYPES.BYTES]},c.internalSpec={serial:[1,a.TYPES.UINT32],issuerSerial:[2,a.TYPES.UINT32],key:[3,a.TYPES.BYTES],notBefore:[4,a.TYPES.UINT64],notAfter:[5,a.TYPES.UINT64]}},113259:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DevicePropsSpec=t.DeviceProps$PlatformType=t.DeviceProps$HistorySyncConfigSpec=t.DeviceProps$AppVersionSpec=void 0;var i=r(n(81109)),a=n(739660);const o=n(76672)({UNKNOWN:0,CHROME:1,FIREFOX:2,IE:3,OPERA:4,SAFARI:5,EDGE:6,DESKTOP:7,IPAD:8,ANDROID_TABLET:9,OHANA:10,ALOHA:11,CATALINA:12,TCL_TV:13});t.DeviceProps$PlatformType=o;const s=(0,i.default)({},null);t.DevicePropsSpec=s;const l=(0,i.default)({},null);t.DeviceProps$HistorySyncConfigSpec=l;const u=(0,i.default)({},null);t.DeviceProps$AppVersionSpec=u,s.internalSpec={os:[1,a.TYPES.STRING],version:[2,a.TYPES.MESSAGE,u],platformType:[3,a.TYPES.ENUM,o],requireFullSync:[4,a.TYPES.BOOL],historySyncConfig:[5,a.TYPES.MESSAGE,l]},l.internalSpec={fullSyncDaysLimit:[1,a.TYPES.UINT32],fullSyncSizeMbLimit:[2,a.TYPES.UINT32],storageQuotaMb:[3,a.TYPES.UINT32]},u.internalSpec={primary:[1,a.TYPES.UINT32],secondary:[2,a.TYPES.UINT32],tertiary:[3,a.TYPES.UINT32],quaternary:[4,a.TYPES.UINT32],quinary:[5,a.TYPES.UINT32]}},533494:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Message$PeerDataOperationRequestType=t.Message$PeerDataOperationRequestResponseMessageSpec=t.Message$PeerDataOperationRequestResponseMessage$PeerDataOperationResultSpec=t.Message$PeerDataOperationRequestResponseMessage$PeerDataOperationResult$LinkPreviewResponseSpec=t.Message$PeerDataOperationRequestMessageSpec=t.Message$PeerDataOperationRequestMessage$RequestUrlPreviewSpec=t.Message$PeerDataOperationRequestMessage$RequestStickerReuploadSpec=t.Message$PaymentInviteMessageSpec=t.Message$PaymentInviteMessage$ServiceType=t.Message$OrderMessageSpec=t.Message$OrderMessage$OrderSurface=t.Message$OrderMessage$OrderStatus=t.Message$LocationMessageSpec=t.Message$LiveLocationMessageSpec=t.Message$ListResponseMessageSpec=t.Message$ListResponseMessage$SingleSelectReplySpec=t.Message$ListResponseMessage$ListType=t.Message$ListMessageSpec=t.Message$ListMessage$SectionSpec=t.Message$ListMessage$RowSpec=t.Message$ListMessage$ProductSpec=t.Message$ListMessage$ProductSectionSpec=t.Message$ListMessage$ProductListInfoSpec=t.Message$ListMessage$ProductListHeaderImageSpec=t.Message$ListMessage$ListType=t.Message$KeepInChatMessageSpec=t.Message$InvoiceMessageSpec=t.Message$InvoiceMessage$AttachmentType=t.Message$InteractiveResponseMessageSpec=t.Message$InteractiveResponseMessage$NativeFlowResponseMessageSpec=t.Message$InteractiveResponseMessage$BodySpec=t.Message$InteractiveMessageSpec=t.Message$InteractiveMessage$ShopMessageSpec=t.Message$InteractiveMessage$ShopMessage$Surface=t.Message$InteractiveMessage$NativeFlowMessageSpec=t.Message$InteractiveMessage$NativeFlowMessage$NativeFlowButtonSpec=t.Message$InteractiveMessage$HeaderSpec=t.Message$InteractiveMessage$FooterSpec=t.Message$InteractiveMessage$CollectionMessageSpec=t.Message$InteractiveMessage$BodySpec=t.Message$InitialSecurityNotificationSettingSyncSpec=t.Message$ImageMessageSpec=t.Message$HistorySyncNotificationSpec=t.Message$HistorySyncNotification$HistorySyncType=t.Message$HighlyStructuredMessageSpec=t.Message$HighlyStructuredMessage$HSMLocalizableParameterSpec=t.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMDateTimeSpec=t.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMDateTime$HSMDateTimeUnixEpochSpec=t.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMDateTime$HSMDateTimeComponentSpec=t.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMDateTime$HSMDateTimeComponent$DayOfWeekType=t.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMDateTime$HSMDateTimeComponent$CalendarType=t.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMCurrencySpec=t.Message$GroupInviteMessageSpec=t.Message$GroupInviteMessage$GroupType=t.Message$FutureProofMessageSpec=t.Message$ExtendedTextMessageSpec=t.Message$ExtendedTextMessage$PreviewType=t.Message$ExtendedTextMessage$InviteLinkGroupType=t.Message$ExtendedTextMessage$FontType=t.Message$EncReactionMessageSpec=t.Message$DocumentMessageSpec=t.Message$DeviceSentMessageSpec=t.Message$DeclinePaymentRequestMessageSpec=t.Message$ContactsArrayMessageSpec=t.Message$ContactMessageSpec=t.Message$ChatSpec=t.Message$CancelPaymentRequestMessageSpec=t.Message$CallSpec=t.Message$ButtonsResponseMessageSpec=t.Message$ButtonsResponseMessage$Type=t.Message$ButtonsMessageSpec=t.Message$ButtonsMessage$HeaderType=t.Message$ButtonsMessage$ButtonSpec=t.Message$ButtonsMessage$Button$Type=t.Message$ButtonsMessage$Button$NativeFlowInfoSpec=t.Message$ButtonsMessage$Button$ButtonTextSpec=t.Message$AudioMessageSpec=t.Message$AppStateSyncKeySpec=t.Message$AppStateSyncKeyShareSpec=t.Message$AppStateSyncKeyRequestSpec=t.Message$AppStateSyncKeyIdSpec=t.Message$AppStateSyncKeyFingerprintSpec=t.Message$AppStateSyncKeyDataSpec=t.Message$AppStateFatalExceptionNotificationSpec=t.LocationSpec=t.KeepType=t.InteractiveAnnotationSpec=t.HydratedTemplateButtonSpec=t.HydratedTemplateButton$HydratedURLButtonSpec=t.HydratedTemplateButton$HydratedQuickReplyButtonSpec=t.HydratedTemplateButton$HydratedCallButtonSpec=t.DisappearingModeSpec=t.DisappearingMode$Initiator=t.DeviceListMetadataSpec=t.ContextInfoSpec=t.ContextInfo$ExternalAdReplyInfoSpec=t.ContextInfo$ExternalAdReplyInfo$MediaType=t.ContextInfo$AdReplyInfoSpec=t.ContextInfo$AdReplyInfo$MediaType=t.ActionLinkSpec=void 0,t.TemplateButtonSpec=t.TemplateButton$URLButtonSpec=t.TemplateButton$QuickReplyButtonSpec=t.TemplateButton$CallButtonSpec=t.PointSpec=t.PaymentBackgroundSpec=t.PaymentBackground$Type=t.PaymentBackground$MediaDataSpec=t.MoneySpec=t.MessageSpec=t.MessageContextInfoSpec=t.Message$VideoMessageSpec=t.Message$VideoMessage$Attribution=t.Message$TemplateMessageSpec=t.Message$TemplateMessage$HydratedFourRowTemplateSpec=t.Message$TemplateMessage$FourRowTemplateSpec=t.Message$TemplateButtonReplyMessageSpec=t.Message$StickerSyncRMRMessageSpec=t.Message$StickerMessageSpec=t.Message$SenderKeyDistributionMessageSpec=t.Message$SendPaymentMessageSpec=t.Message$RequestPhoneNumberMessageSpec=t.Message$RequestPaymentMessageSpec=t.Message$ReactionMessageSpec=t.Message$ProtocolMessageSpec=t.Message$ProtocolMessage$Type=t.Message$ProductMessageSpec=t.Message$ProductMessage$ProductSnapshotSpec=t.Message$ProductMessage$CatalogSnapshotSpec=t.Message$PollVoteMessageSpec=t.Message$PollUpdateMessageSpec=t.Message$PollUpdateMessageMetadataSpec=t.Message$PollEncValueSpec=t.Message$PollCreationMessageSpec=t.Message$PollCreationMessage$OptionSpec=t.Message$PeerDataOperationRequestType=t.Message$PeerDataOperationRequestResponseMessageSpec=t.Message$PeerDataOperationRequestResponseMessage$PeerDataOperationResultSpec=t.Message$PeerDataOperationRequestResponseMessage$PeerDataOperationResult$LinkPreviewResponseSpec=t.Message$PeerDataOperationRequestMessageSpec=t.Message$PeerDataOperationRequestMessage$RequestUrlPreviewSpec=t.Message$PeerDataOperationRequestMessage$RequestStickerReuploadSpec=t.Message$PaymentInviteMessageSpec=t.Message$PaymentInviteMessage$ServiceType=t.Message$OrderMessageSpec=t.Message$OrderMessage$OrderSurface=t.Message$OrderMessage$OrderStatus=t.Message$LocationMessageSpec=t.Message$LiveLocationMessageSpec=t.Message$ListResponseMessageSpec=t.Message$ListResponseMessage$SingleSelectReplySpec=t.Message$ListResponseMessage$ListType=t.Message$ListMessageSpec=t.Message$ListMessage$SectionSpec=t.Message$ListMessage$RowSpec=t.Message$ListMessage$ProductSpec=t.Message$ListMessage$ProductSectionSpec=t.Message$ListMessage$ProductListInfoSpec=t.Message$ListMessage$ProductListHeaderImageSpec=t.Message$ListMessage$ListType=t.Message$KeepInChatMessageSpec=t.Message$InvoiceMessageSpec=t.Message$InvoiceMessage$AttachmentType=t.Message$InteractiveResponseMessageSpec=t.Message$InteractiveResponseMessage$NativeFlowResponseMessageSpec=t.Message$InteractiveResponseMessage$BodySpec=t.Message$InteractiveMessageSpec=t.Message$InteractiveMessage$ShopMessageSpec=t.Message$InteractiveMessage$ShopMessage$Surface=t.Message$InteractiveMessage$NativeFlowMessageSpec=t.Message$InteractiveMessage$NativeFlowMessage$NativeFlowButtonSpec=t.Message$InteractiveMessage$HeaderSpec=t.Message$InteractiveMessage$FooterSpec=t.Message$InteractiveMessage$CollectionMessageSpec=t.Message$InteractiveMessage$BodySpec=t.Message$InitialSecurityNotificationSettingSyncSpec=t.Message$ImageMessageSpec=t.Message$HistorySyncNotificationSpec=t.Message$HistorySyncNotification$HistorySyncType=t.Message$HighlyStructuredMessageSpec=t.Message$HighlyStructuredMessage$HSMLocalizableParameterSpec=t.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMDateTimeSpec=t.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMDateTime$HSMDateTimeUnixEpochSpec=t.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMDateTime$HSMDateTimeComponentSpec=t.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMDateTime$HSMDateTimeComponent$DayOfWeekType=t.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMDateTime$HSMDateTimeComponent$CalendarType=t.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMCurrencySpec=t.Message$GroupInviteMessageSpec=t.Message$GroupInviteMessage$GroupType=t.Message$FutureProofMessageSpec=t.Message$ExtendedTextMessageSpec=t.Message$ExtendedTextMessage$PreviewType=t.Message$ExtendedTextMessage$InviteLinkGroupType=t.Message$ExtendedTextMessage$FontType=t.Message$EncReactionMessageSpec=t.Message$DocumentMessageSpec=t.Message$DeviceSentMessageSpec=t.Message$DeclinePaymentRequestMessageSpec=t.Message$ContactsArrayMessageSpec=t.Message$ContactMessageSpec=t.Message$ChatSpec=t.Message$CancelPaymentRequestMessageSpec=t.Message$CallSpec=t.Message$ButtonsResponseMessageSpec=t.Message$ButtonsResponseMessage$Type=t.Message$ButtonsMessageSpec=t.Message$ButtonsMessage$HeaderType=t.Message$ButtonsMessage$ButtonSpec=t.Message$ButtonsMessage$Button$Type=t.Message$ButtonsMessage$Button$NativeFlowInfoSpec=t.Message$ButtonsMessage$Button$ButtonTextSpec=t.Message$AudioMessageSpec=t.Message$AppStateSyncKeySpec=t.Message$AppStateSyncKeyShareSpec=t.Message$AppStateSyncKeyRequestSpec=t.Message$AppStateSyncKeyIdSpec=t.Message$AppStateSyncKeyFingerprintSpec=t.Message$AppStateSyncKeyDataSpec=t.Message$AppStateFatalExceptionNotificationSpec=t.LocationSpec=t.KeepType=t.InteractiveAnnotationSpec=t.HydratedTemplateButtonSpec=t.HydratedTemplateButton$HydratedURLButtonSpec=t.HydratedTemplateButton$HydratedQuickReplyButtonSpec=t.HydratedTemplateButton$HydratedCallButtonSpec=t.DisappearingModeSpec=t.DisappearingMode$Initiator=t.DeviceListMetadataSpec=t.ContextInfoSpec=t.ContextInfo$ExternalAdReplyInfoSpec=t.ContextInfo$ExternalAdReplyInfo$MediaType=t.ContextInfo$AdReplyInfoSpec=t.ContextInfo$AdReplyInfo$MediaType=t.ActionLinkSpec=void 0;var i=r(n(81109)),a=n(739660),o=n(933734),s=n(229479);const l=n(76672)({UNKNOWN:0,DISPLAY_TEXT:1});t.Message$ButtonsResponseMessage$Type=l;const u=n(76672)({UNKNOWN:0,RESPONSE:1,NATIVE_FLOW:2});t.Message$ButtonsMessage$Button$Type=u;const c=n(76672)({UNKNOWN:0,EMPTY:1,TEXT:2,DOCUMENT:3,IMAGE:4,VIDEO:5,LOCATION:6});t.Message$ButtonsMessage$HeaderType=c;const d=n(76672)({DEFAULT:0,PARENT:1});t.Message$GroupInviteMessage$GroupType=d;const p=n(76672)({UNKNOWN_SURFACE:0,FB:1,IG:2,WA:3});t.Message$InteractiveMessage$ShopMessage$Surface=p;const _=n(76672)({UNKNOWN:0,SINGLE_SELECT:1});t.Message$ListResponseMessage$ListType=_;const f=n(76672)({UNKNOWN:0,SINGLE_SELECT:1,PRODUCT_LIST:2});t.Message$ListMessage$ListType=f;const h=n(76672)({CATALOG:1});t.Message$OrderMessage$OrderSurface=h;const g=n(76672)({INQUIRY:1});t.Message$OrderMessage$OrderStatus=g;const m=n(76672)({UNKNOWN:0,FBPAY:1,NOVI:2,UPI:3});t.Message$PaymentInviteMessage$ServiceType=m;const y=n(76672)({GREGORIAN:1,SOLAR_HIJRI:2});t.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMDateTime$HSMDateTimeComponent$CalendarType=y;const E=n(76672)({MONDAY:1,TUESDAY:2,WEDNESDAY:3,THURSDAY:4,FRIDAY:5,SATURDAY:6,SUNDAY:7});t.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMDateTime$HSMDateTimeComponent$DayOfWeekType=E;const S=n(76672)({UPLOAD_STICKER:0,SEND_RECENT_STICKER_BOOTSTRAP:1,GENERATE_LINK_PREVIEW:2});t.Message$PeerDataOperationRequestType=S;const T=n(76672)({INITIAL_BOOTSTRAP:0,INITIAL_STATUS_V3:1,FULL:2,RECENT:3,PUSH_NAME:4,NON_BLOCKING_DATA:5});t.Message$HistorySyncNotification$HistorySyncType=T;const v=n(76672)({REVOKE:0,EPHEMERAL_SETTING:3,EPHEMERAL_SYNC_RESPONSE:4,HISTORY_SYNC_NOTIFICATION:5,APP_STATE_SYNC_KEY_SHARE:6,APP_STATE_SYNC_KEY_REQUEST:7,MSG_FANOUT_BACKFILL_REQUEST:8,INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC:9,APP_STATE_FATAL_EXCEPTION_NOTIFICATION:10,SHARE_PHONE_NUMBER:11,MESSAGE_EDIT:14,PEER_DATA_OPERATION_REQUEST_MESSAGE:16,PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE:17});t.Message$ProtocolMessage$Type=v;const A=n(76672)({NONE:0,GIPHY:1,TENOR:2});t.Message$VideoMessage$Attribution=A;const C=n(76672)({DEFAULT:0,PARENT:1,SUB:2,DEFAULT_SUB:3});t.Message$ExtendedTextMessage$InviteLinkGroupType=C;const P=n(76672)({NONE:0,VIDEO:1});t.Message$ExtendedTextMessage$PreviewType=P;const O=n(76672)({SANS_SERIF:0,SERIF:1,NORICAN_REGULAR:2,BRYNDAN_WRITE:3,BEBASNEUE_REGULAR:4,OSWALD_HEAVY:5});t.Message$ExtendedTextMessage$FontType=O;const I=n(76672)({IMAGE:0,PDF:1});t.Message$InvoiceMessage$AttachmentType=I;const M=n(76672)({NONE:0,IMAGE:1,VIDEO:2});t.ContextInfo$ExternalAdReplyInfo$MediaType=M;const b=n(76672)({NONE:0,IMAGE:1,VIDEO:2});t.ContextInfo$AdReplyInfo$MediaType=b;const R=n(76672)({UNKNOWN:0,DEFAULT:1});t.PaymentBackground$Type=R;const N=n(76672)({CHANGED_IN_CHAT:0,INITIATED_BY_ME:1,INITIATED_BY_OTHER:2});t.DisappearingMode$Initiator=N;const w=n(76672)({UNKNOWN:0,KEEP_FOR_ALL:1,UNDO_KEEP_FOR_ALL:2});t.KeepType=w;const L=(0,i.default)({},null);t.MessageSpec=L;const D=(0,i.default)({},null);t.Message$EncReactionMessageSpec=D;const k=(0,i.default)({},null);t.Message$KeepInChatMessageSpec=k;const U=(0,i.default)({},null);t.Message$PollVoteMessageSpec=U;const G=(0,i.default)({},null);t.Message$PollEncValueSpec=G;const x=(0,i.default)({},null);t.Message$PollUpdateMessageMetadataSpec=x;const B=(0,i.default)({},null);t.Message$PollUpdateMessageSpec=B;const F=(0,i.default)({},null);t.Message$PollCreationMessageSpec=F;const j=(0,i.default)({},null);t.Message$PollCreationMessage$OptionSpec=j;const Y=(0,i.default)({},null);t.Message$StickerSyncRMRMessageSpec=Y;const K=(0,i.default)({},null);t.Message$ReactionMessageSpec=K;const H=(0,i.default)({},null);t.Message$ButtonsResponseMessageSpec=H;const W=(0,i.default)({},null);t.Message$ButtonsMessageSpec=W;const V=(0,i.default)({},null);t.Message$ButtonsMessage$ButtonSpec=V;const $=(0,i.default)({},null);t.Message$ButtonsMessage$Button$NativeFlowInfoSpec=$;const z=(0,i.default)({},null);t.Message$ButtonsMessage$Button$ButtonTextSpec=z;const q=(0,i.default)({},null);t.Message$FutureProofMessageSpec=q;const J=(0,i.default)({},null);t.Message$DeviceSentMessageSpec=J;const Q=(0,i.default)({},null);t.Message$RequestPhoneNumberMessageSpec=Q;const X=(0,i.default)({},null);t.Message$GroupInviteMessageSpec=X;const Z=(0,i.default)({},null);t.Message$InteractiveResponseMessageSpec=Z;const ee=(0,i.default)({},null);t.Message$InteractiveResponseMessage$NativeFlowResponseMessageSpec=ee;const te=(0,i.default)({},null);t.Message$InteractiveResponseMessage$BodySpec=te;const ne=(0,i.default)({},null);t.Message$InteractiveMessageSpec=ne;const re=(0,i.default)({},null);t.Message$InteractiveMessage$NativeFlowMessageSpec=re;const ie=(0,i.default)({},null);t.Message$InteractiveMessage$NativeFlowMessage$NativeFlowButtonSpec=ie;const ae=(0,i.default)({},null);t.Message$InteractiveMessage$CollectionMessageSpec=ae;const oe=(0,i.default)({},null);t.Message$InteractiveMessage$ShopMessageSpec=oe;const se=(0,i.default)({},null);t.Message$InteractiveMessage$FooterSpec=se;const le=(0,i.default)({},null);t.Message$InteractiveMessage$BodySpec=le;const ue=(0,i.default)({},null);t.Message$InteractiveMessage$HeaderSpec=ue;const ce=(0,i.default)({},null);t.Message$ListResponseMessageSpec=ce;const de=(0,i.default)({},null);t.Message$ListResponseMessage$SingleSelectReplySpec=de;const pe=(0,i.default)({},null);t.Message$ListMessageSpec=pe;const _e=(0,i.default)({},null);t.Message$ListMessage$ProductListInfoSpec=_e;const fe=(0,i.default)({},null);t.Message$ListMessage$ProductListHeaderImageSpec=fe;const he=(0,i.default)({},null);t.Message$ListMessage$ProductSectionSpec=he;const ge=(0,i.default)({},null);t.Message$ListMessage$ProductSpec=ge;const me=(0,i.default)({},null);t.Message$ListMessage$SectionSpec=me;const ye=(0,i.default)({},null);t.Message$ListMessage$RowSpec=ye;const Ee=(0,i.default)({},null);t.Message$OrderMessageSpec=Ee;const Se=(0,i.default)({},null);t.Message$ProductMessageSpec=Se;const Te=(0,i.default)({},null);t.Message$ProductMessage$ProductSnapshotSpec=Te;const ve=(0,i.default)({},null);t.Message$ProductMessage$CatalogSnapshotSpec=ve;const Ae=(0,i.default)({},null);t.Message$TemplateButtonReplyMessageSpec=Ae;const Ce=(0,i.default)({},null);t.Message$TemplateMessageSpec=Ce;const Pe=(0,i.default)({},null);t.Message$TemplateMessage$HydratedFourRowTemplateSpec=Pe;const Oe=(0,i.default)({},null);t.Message$TemplateMessage$FourRowTemplateSpec=Oe;const Ie=(0,i.default)({},null);t.Message$StickerMessageSpec=Ie;const Me=(0,i.default)({},null);t.Message$LiveLocationMessageSpec=Me;const be=(0,i.default)({},null);t.Message$PaymentInviteMessageSpec=be;const Re=(0,i.default)({},null);t.Message$CancelPaymentRequestMessageSpec=Re;const Ne=(0,i.default)({},null);t.Message$DeclinePaymentRequestMessageSpec=Ne;const we=(0,i.default)({},null);t.Message$RequestPaymentMessageSpec=we;const Le=(0,i.default)({},null);t.Message$SendPaymentMessageSpec=Le;const De=(0,i.default)({},null);t.Message$HighlyStructuredMessageSpec=De;const ke=(0,i.default)({},null);t.Message$HighlyStructuredMessage$HSMLocalizableParameterSpec=ke;const Ue=(0,i.default)({},null);t.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMDateTimeSpec=Ue;const Ge=(0,i.default)({},null);t.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMDateTime$HSMDateTimeUnixEpochSpec=Ge;const xe=(0,i.default)({},null);t.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMDateTime$HSMDateTimeComponentSpec=xe;const Be=(0,i.default)({},null);t.Message$HighlyStructuredMessage$HSMLocalizableParameter$HSMCurrencySpec=Be;const Fe=(0,i.default)({},null);t.Message$ContactsArrayMessageSpec=Fe;const je=(0,i.default)({},null);t.Message$InitialSecurityNotificationSettingSyncSpec=je;const Ye=(0,i.default)({},null);t.Message$PeerDataOperationRequestResponseMessageSpec=Ye;const Ke=(0,i.default)({},null);t.Message$PeerDataOperationRequestResponseMessage$PeerDataOperationResultSpec=Ke;const He=(0,i.default)({},null);t.Message$PeerDataOperationRequestResponseMessage$PeerDataOperationResult$LinkPreviewResponseSpec=He;const We=(0,i.default)({},null);t.Message$PeerDataOperationRequestMessageSpec=We;const Ve=(0,i.default)({},null);t.Message$PeerDataOperationRequestMessage$RequestUrlPreviewSpec=Ve;const $e=(0,i.default)({},null);t.Message$PeerDataOperationRequestMessage$RequestStickerReuploadSpec=$e;const ze=(0,i.default)({},null);t.Message$AppStateFatalExceptionNotificationSpec=ze;const qe=(0,i.default)({},null);t.Message$AppStateSyncKeyRequestSpec=qe;const Je=(0,i.default)({},null);t.Message$AppStateSyncKeyShareSpec=Je;const Qe=(0,i.default)({},null);t.Message$AppStateSyncKeyDataSpec=Qe;const Xe=(0,i.default)({},null);t.Message$AppStateSyncKeyFingerprintSpec=Xe;const Ze=(0,i.default)({},null);t.Message$AppStateSyncKeyIdSpec=Ze;const et=(0,i.default)({},null);t.Message$AppStateSyncKeySpec=et;const tt=(0,i.default)({},null);t.Message$HistorySyncNotificationSpec=tt;const nt=(0,i.default)({},null);t.Message$ProtocolMessageSpec=nt;const rt=(0,i.default)({},null);t.Message$ChatSpec=rt;const it=(0,i.default)({},null);t.Message$CallSpec=it;const at=(0,i.default)({},null);t.Message$VideoMessageSpec=at;const ot=(0,i.default)({},null);t.Message$AudioMessageSpec=ot;const st=(0,i.default)({},null);t.Message$DocumentMessageSpec=st;const lt=(0,i.default)({},null);t.Message$ExtendedTextMessageSpec=lt;const ut=(0,i.default)({},null);t.Message$LocationMessageSpec=ut;const ct=(0,i.default)({},null);t.Message$ContactMessageSpec=ct;const dt=(0,i.default)({},null);t.Message$InvoiceMessageSpec=dt;const pt=(0,i.default)({},null);t.Message$ImageMessageSpec=pt;const _t=(0,i.default)({},null);t.Message$SenderKeyDistributionMessageSpec=_t;const ft=(0,i.default)({},null);t.ContextInfoSpec=ft;const ht=(0,i.default)({},null);t.ContextInfo$ExternalAdReplyInfoSpec=ht;const gt=(0,i.default)({},null);t.ContextInfo$AdReplyInfoSpec=gt;const mt=(0,i.default)({},null);t.MessageContextInfoSpec=mt;const yt=(0,i.default)({},null);t.DeviceListMetadataSpec=yt;const Et=(0,i.default)({},null);t.InteractiveAnnotationSpec=Et;const St=(0,i.default)({},null);t.PointSpec=St;const Tt=(0,i.default)({},null);t.LocationSpec=Tt;const vt=(0,i.default)({},null);t.TemplateButtonSpec=vt;const At=(0,i.default)({},null);t.TemplateButton$CallButtonSpec=At;const Ct=(0,i.default)({},null);t.TemplateButton$URLButtonSpec=Ct;const Pt=(0,i.default)({},null);t.TemplateButton$QuickReplyButtonSpec=Pt;const Ot=(0,i.default)({},null);t.HydratedTemplateButtonSpec=Ot;const It=(0,i.default)({},null);t.HydratedTemplateButton$HydratedCallButtonSpec=It;const Mt=(0,i.default)({},null);t.HydratedTemplateButton$HydratedURLButtonSpec=Mt;const bt=(0,i.default)({},null);t.HydratedTemplateButton$HydratedQuickReplyButtonSpec=bt;const Rt=(0,i.default)({},null);t.MoneySpec=Rt;const Nt=(0,i.default)({},null);t.PaymentBackgroundSpec=Nt;const wt=(0,i.default)({},null);t.PaymentBackground$MediaDataSpec=wt;const Lt=(0,i.default)({},null);t.DisappearingModeSpec=Lt;const Dt=(0,i.default)({},null);t.ActionLinkSpec=Dt,L.internalSpec={conversation:[1,a.TYPES.STRING],senderKeyDistributionMessage:[2,a.TYPES.MESSAGE,_t],imageMessage:[3,a.TYPES.MESSAGE,pt],contactMessage:[4,a.TYPES.MESSAGE,ct],locationMessage:[5,a.TYPES.MESSAGE,ut],extendedTextMessage:[6,a.TYPES.MESSAGE,lt],documentMessage:[7,a.TYPES.MESSAGE,st],audioMessage:[8,a.TYPES.MESSAGE,ot],videoMessage:[9,a.TYPES.MESSAGE,at],call:[10,a.TYPES.MESSAGE,it],chat:[11,a.TYPES.MESSAGE,rt],protocolMessage:[12,a.TYPES.MESSAGE,nt],contactsArrayMessage:[13,a.TYPES.MESSAGE,Fe],highlyStructuredMessage:[14,a.TYPES.MESSAGE,De],fastRatchetKeySenderKeyDistributionMessage:[15,a.TYPES.MESSAGE,_t],sendPaymentMessage:[16,a.TYPES.MESSAGE,Le],liveLocationMessage:[18,a.TYPES.MESSAGE,Me],requestPaymentMessage:[22,a.TYPES.MESSAGE,we],declinePaymentRequestMessage:[23,a.TYPES.MESSAGE,Ne],cancelPaymentRequestMessage:[24,a.TYPES.MESSAGE,Re],templateMessage:[25,a.TYPES.MESSAGE,Ce],stickerMessage:[26,a.TYPES.MESSAGE,Ie],groupInviteMessage:[28,a.TYPES.MESSAGE,X],templateButtonReplyMessage:[29,a.TYPES.MESSAGE,Ae],productMessage:[30,a.TYPES.MESSAGE,Se],deviceSentMessage:[31,a.TYPES.MESSAGE,J],messageContextInfo:[35,a.TYPES.MESSAGE,mt],listMessage:[36,a.TYPES.MESSAGE,pe],viewOnceMessage:[37,a.TYPES.MESSAGE,q],orderMessage:[38,a.TYPES.MESSAGE,Ee],listResponseMessage:[39,a.TYPES.MESSAGE,ce],ephemeralMessage:[40,a.TYPES.MESSAGE,q],invoiceMessage:[41,a.TYPES.MESSAGE,dt],buttonsMessage:[42,a.TYPES.MESSAGE,W],buttonsResponseMessage:[43,a.TYPES.MESSAGE,H],paymentInviteMessage:[44,a.TYPES.MESSAGE,be],interactiveMessage:[45,a.TYPES.MESSAGE,ne],reactionMessage:[46,a.TYPES.MESSAGE,K],stickerSyncRmrMessage:[47,a.TYPES.MESSAGE,Y],interactiveResponseMessage:[48,a.TYPES.MESSAGE,Z],pollCreationMessage:[49,a.TYPES.MESSAGE,F],pollUpdateMessage:[50,a.TYPES.MESSAGE,B],keepInChatMessage:[51,a.TYPES.MESSAGE,k],documentWithCaptionMessage:[53,a.TYPES.MESSAGE,q],requestPhoneNumberMessage:[54,a.TYPES.MESSAGE,Q],viewOnceMessageV2:[55,a.TYPES.MESSAGE,q],encReactionMessage:[56,a.TYPES.MESSAGE,D],editedMessage:[58,a.TYPES.MESSAGE,q],viewOnceMessageV2Extension:[59,a.TYPES.MESSAGE,q]},D.internalSpec={targetMessageKey:[1,a.TYPES.MESSAGE,o.MessageKeySpec],encPayload:[2,a.TYPES.BYTES],encIv:[3,a.TYPES.BYTES]},k.internalSpec={key:[1,a.TYPES.MESSAGE,o.MessageKeySpec],keepType:[2,a.TYPES.ENUM,w],timestampMs:[3,a.TYPES.INT64]},U.internalSpec={selectedOptions:[1,a.FLAGS.REPEATED|a.TYPES.BYTES]},G.internalSpec={encPayload:[1,a.TYPES.BYTES],encIv:[2,a.TYPES.BYTES]},x.internalSpec={},B.internalSpec={pollCreationMessageKey:[1,a.TYPES.MESSAGE,o.MessageKeySpec],vote:[2,a.TYPES.MESSAGE,G],metadata:[3,a.TYPES.MESSAGE,x],senderTimestampMs:[4,a.TYPES.INT64]},F.internalSpec={encKey:[1,a.TYPES.BYTES],name:[2,a.TYPES.STRING],options:[3,a.FLAGS.REPEATED|a.TYPES.MESSAGE,j],selectableOptionsCount:[4,a.TYPES.UINT32],contextInfo:[5,a.TYPES.MESSAGE,ft]},j.internalSpec={optionName:[1,a.TYPES.STRING]},Y.internalSpec={filehash:[1,a.FLAGS.REPEATED|a.TYPES.STRING],rmrSource:[2,a.TYPES.STRING],requestTimestamp:[3,a.TYPES.INT64]},K.internalSpec={key:[1,a.TYPES.MESSAGE,o.MessageKeySpec],text:[2,a.TYPES.STRING],groupingKey:[3,a.TYPES.STRING],senderTimestampMs:[4,a.TYPES.INT64]},H.internalSpec={selectedButtonId:[1,a.TYPES.STRING],selectedDisplayText:[2,a.TYPES.STRING],contextInfo:[3,a.TYPES.MESSAGE,ft],type:[4,a.TYPES.ENUM,l],__oneofs__:{response:["selectedDisplayText"]}},W.internalSpec={text:[1,a.TYPES.STRING],documentMessage:[2,a.TYPES.MESSAGE,st],imageMessage:[3,a.TYPES.MESSAGE,pt],videoMessage:[4,a.TYPES.MESSAGE,at],locationMessage:[5,a.TYPES.MESSAGE,ut],contentText:[6,a.TYPES.STRING],footerText:[7,a.TYPES.STRING],contextInfo:[8,a.TYPES.MESSAGE,ft],buttons:[9,a.FLAGS.REPEATED|a.TYPES.MESSAGE,V],headerType:[10,a.TYPES.ENUM,c],__oneofs__:{header:["text","documentMessage","imageMessage","videoMessage","locationMessage"]}},V.internalSpec={buttonId:[1,a.TYPES.STRING],buttonText:[2,a.TYPES.MESSAGE,z],type:[3,a.TYPES.ENUM,u],nativeFlowInfo:[4,a.TYPES.MESSAGE,$]},$.internalSpec={name:[1,a.TYPES.STRING],paramsJson:[2,a.TYPES.STRING]},z.internalSpec={displayText:[1,a.TYPES.STRING]},q.internalSpec={message:[1,a.TYPES.MESSAGE,L]},J.internalSpec={destinationJid:[1,a.TYPES.STRING],message:[2,a.TYPES.MESSAGE,L],phash:[3,a.TYPES.STRING]},Q.internalSpec={contextInfo:[1,a.TYPES.MESSAGE,ft]},X.internalSpec={groupJid:[1,a.TYPES.STRING],inviteCode:[2,a.TYPES.STRING],inviteExpiration:[3,a.TYPES.INT64],groupName:[4,a.TYPES.STRING],jpegThumbnail:[5,a.TYPES.BYTES],caption:[6,a.TYPES.STRING],contextInfo:[7,a.TYPES.MESSAGE,ft],groupType:[8,a.TYPES.ENUM,d]},Z.internalSpec={body:[1,a.TYPES.MESSAGE,te],nativeFlowResponseMessage:[2,a.TYPES.MESSAGE,ee],contextInfo:[15,a.TYPES.MESSAGE,ft],__oneofs__:{interactiveResponseMessage:["nativeFlowResponseMessage"]}},ee.internalDefaults={version:1},ee.internalSpec={name:[1,a.TYPES.STRING],paramsJson:[2,a.TYPES.STRING],version:[3,a.TYPES.INT32]},te.internalSpec={text:[1,a.TYPES.STRING]},ne.internalSpec={header:[1,a.TYPES.MESSAGE,ue],body:[2,a.TYPES.MESSAGE,le],footer:[3,a.TYPES.MESSAGE,se],shopStorefrontMessage:[4,a.TYPES.MESSAGE,oe],collectionMessage:[5,a.TYPES.MESSAGE,ae],nativeFlowMessage:[6,a.TYPES.MESSAGE,re],contextInfo:[15,a.TYPES.MESSAGE,ft],__oneofs__:{interactiveMessage:["shopStorefrontMessage","collectionMessage","nativeFlowMessage"]}},re.internalDefaults={messageVersion:1},re.internalSpec={buttons:[1,a.FLAGS.REPEATED|a.TYPES.MESSAGE,ie],messageParamsJson:[2,a.TYPES.STRING],messageVersion:[3,a.TYPES.INT32]},ie.internalSpec={name:[1,a.TYPES.STRING],buttonParamsJson:[2,a.TYPES.STRING]},ae.internalDefaults={messageVersion:1},ae.internalSpec={bizJid:[1,a.TYPES.STRING],id:[2,a.TYPES.STRING],messageVersion:[3,a.TYPES.INT32]},oe.internalDefaults={messageVersion:1},oe.internalSpec={id:[1,a.TYPES.STRING],surface:[2,a.TYPES.ENUM,p],messageVersion:[3,a.TYPES.INT32]},se.internalSpec={text:[1,a.TYPES.STRING]},le.internalSpec={text:[1,a.TYPES.STRING]},ue.internalSpec={title:[1,a.TYPES.STRING],subtitle:[2,a.TYPES.STRING],documentMessage:[3,a.TYPES.MESSAGE,st],imageMessage:[4,a.TYPES.MESSAGE,pt],jpegThumbnail:[6,a.TYPES.BYTES],videoMessage:[7,a.TYPES.MESSAGE,at],hasMediaAttachment:[5,a.TYPES.BOOL],__oneofs__:{media:["documentMessage","imageMessage","jpegThumbnail","videoMessage"]}},ce.internalSpec={title:[1,a.TYPES.STRING],listType:[2,a.TYPES.ENUM,_],singleSelectReply:[3,a.TYPES.MESSAGE,de],contextInfo:[4,a.TYPES.MESSAGE,ft],description:[5,a.TYPES.STRING]},de.internalSpec={selectedRowId:[1,a.TYPES.STRING]},pe.internalSpec={title:[1,a.TYPES.STRING],description:[2,a.TYPES.STRING],buttonText:[3,a.TYPES.STRING],listType:[4,a.TYPES.ENUM,f],sections:[5,a.FLAGS.REPEATED|a.TYPES.MESSAGE,me],productListInfo:[6,a.TYPES.MESSAGE,_e],footerText:[7,a.TYPES.STRING],contextInfo:[8,a.TYPES.MESSAGE,ft]},_e.internalSpec={productSections:[1,a.FLAGS.REPEATED|a.TYPES.MESSAGE,he],headerImage:[2,a.TYPES.MESSAGE,fe],businessOwnerJid:[3,a.TYPES.STRING]},fe.internalSpec={productId:[1,a.TYPES.STRING],jpegThumbnail:[2,a.TYPES.BYTES]},he.internalSpec={title:[1,a.TYPES.STRING],products:[2,a.FLAGS.REPEATED|a.TYPES.MESSAGE,ge]},ge.internalSpec={productId:[1,a.TYPES.STRING]},me.internalSpec={title:[1,a.TYPES.STRING],rows:[2,a.FLAGS.REPEATED|a.TYPES.MESSAGE,ye]},ye.internalSpec={title:[1,a.TYPES.STRING],description:[2,a.TYPES.STRING],rowId:[3,a.TYPES.STRING]},Ee.internalSpec={orderId:[1,a.TYPES.STRING],thumbnail:[2,a.TYPES.BYTES],itemCount:[3,a.TYPES.INT32],status:[4,a.TYPES.ENUM,g],surface:[5,a.TYPES.ENUM,h],message:[6,a.TYPES.STRING],orderTitle:[7,a.TYPES.STRING],sellerJid:[8,a.TYPES.STRING],token:[9,a.TYPES.STRING],totalAmount1000:[10,a.TYPES.INT64],totalCurrencyCode:[11,a.TYPES.STRING],contextInfo:[17,a.TYPES.MESSAGE,ft]},Se.internalSpec={product:[1,a.TYPES.MESSAGE,Te],businessOwnerJid:[2,a.TYPES.STRING],catalog:[4,a.TYPES.MESSAGE,ve],body:[5,a.TYPES.STRING],footer:[6,a.TYPES.STRING],contextInfo:[17,a.TYPES.MESSAGE,ft]},Te.internalSpec={productImage:[1,a.TYPES.MESSAGE,pt],productId:[2,a.TYPES.STRING],title:[3,a.TYPES.STRING],description:[4,a.TYPES.STRING],currencyCode:[5,a.TYPES.STRING],priceAmount1000:[6,a.TYPES.INT64],retailerId:[7,a.TYPES.STRING],url:[8,a.TYPES.STRING],productImageCount:[9,a.TYPES.UINT32],firstImageId:[11,a.TYPES.STRING],salePriceAmount1000:[12,a.TYPES.INT64]},ve.internalSpec={catalogImage:[1,a.TYPES.MESSAGE,pt],title:[2,a.TYPES.STRING],description:[3,a.TYPES.STRING]},Ae.internalSpec={selectedId:[1,a.TYPES.STRING],selectedDisplayText:[2,a.TYPES.STRING],contextInfo:[3,a.TYPES.MESSAGE,ft],selectedIndex:[4,a.TYPES.UINT32]},Ce.internalSpec={fourRowTemplate:[1,a.TYPES.MESSAGE,Oe],hydratedFourRowTemplate:[2,a.TYPES.MESSAGE,Pe],interactiveMessageTemplate:[5,a.TYPES.MESSAGE,ne],contextInfo:[3,a.TYPES.MESSAGE,ft],hydratedTemplate:[4,a.TYPES.MESSAGE,Pe],templateId:[9,a.TYPES.STRING],__oneofs__:{format:["fourRowTemplate","hydratedFourRowTemplate","interactiveMessageTemplate"]}},Pe.internalSpec={documentMessage:[1,a.TYPES.MESSAGE,st],hydratedTitleText:[2,a.TYPES.STRING],imageMessage:[3,a.TYPES.MESSAGE,pt],videoMessage:[4,a.TYPES.MESSAGE,at],locationMessage:[5,a.TYPES.MESSAGE,ut],hydratedContentText:[6,a.TYPES.STRING],hydratedFooterText:[7,a.TYPES.STRING],hydratedButtons:[8,a.FLAGS.REPEATED|a.TYPES.MESSAGE,Ot],templateId:[9,a.TYPES.STRING],__oneofs__:{title:["documentMessage","hydratedTitleText","imageMessage","videoMessage","locationMessage"]}},Oe.internalSpec={documentMessage:[1,a.TYPES.MESSAGE,st],highlyStructuredMessage:[2,a.TYPES.MESSAGE,De],imageMessage:[3,a.TYPES.MESSAGE,pt],videoMessage:[4,a.TYPES.MESSAGE,at],locationMessage:[5,a.TYPES.MESSAGE,ut],content:[6,a.TYPES.MESSAGE,De],footer:[7,a.TYPES.MESSAGE,De],buttons:[8,a.FLAGS.REPEATED|a.TYPES.MESSAGE,vt],__oneofs__:{title:["documentMessage","highlyStructuredMessage","imageMessage","videoMessage","locationMessage"]}},Ie.internalSpec={url:[1,a.TYPES.STRING],fileSha256:[2,a.TYPES.BYTES],fileEncSha256:[3,a.TYPES.BYTES],mediaKey:[4,a.TYPES.BYTES],mimetype:[5,a.TYPES.STRING],height:[6,a.TYPES.UINT32],width:[7,a.TYPES.UINT32],directPath:[8,a.TYPES.STRING],fileLength:[9,a.TYPES.UINT64],mediaKeyTimestamp:[10,a.TYPES.INT64],firstFrameLength:[11,a.TYPES.UINT32],firstFrameSidecar:[12,a.TYPES.BYTES],isAnimated:[13,a.TYPES.BOOL],pngThumbnail:[16,a.TYPES.BYTES],contextInfo:[17,a.TYPES.MESSAGE,ft],stickerSentTs:[18,a.TYPES.INT64],isAvatar:[19,a.TYPES.BOOL]},Me.internalSpec={degreesLatitude:[1,a.TYPES.DOUBLE],degreesLongitude:[2,a.TYPES.DOUBLE],accuracyInMeters:[3,a.TYPES.UINT32],speedInMps:[4,a.TYPES.FLOAT],degreesClockwiseFromMagneticNorth:[5,a.TYPES.UINT32],caption:[6,a.TYPES.STRING],sequenceNumber:[7,a.TYPES.INT64],timeOffset:[8,a.TYPES.UINT32],jpegThumbnail:[16,a.TYPES.BYTES],contextInfo:[17,a.TYPES.MESSAGE,ft]},be.internalSpec={serviceType:[1,a.TYPES.ENUM,m],expiryTimestamp:[2,a.TYPES.INT64]},Re.internalSpec={key:[1,a.TYPES.MESSAGE,o.MessageKeySpec]},Ne.internalSpec={key:[1,a.TYPES.MESSAGE,o.MessageKeySpec]},we.internalSpec={noteMessage:[4,a.TYPES.MESSAGE,L],currencyCodeIso4217:[1,a.TYPES.STRING],amount1000:[2,a.TYPES.UINT64],requestFrom:[3,a.TYPES.STRING],expiryTimestamp:[5,a.TYPES.INT64],amount:[6,a.TYPES.MESSAGE,Rt],background:[7,a.TYPES.MESSAGE,Nt]},Le.internalSpec={noteMessage:[2,a.TYPES.MESSAGE,L],requestMessageKey:[3,a.TYPES.MESSAGE,o.MessageKeySpec],background:[4,a.TYPES.MESSAGE,Nt]},De.internalSpec={namespace:[1,a.TYPES.STRING],elementName:[2,a.TYPES.STRING],params:[3,a.FLAGS.REPEATED|a.TYPES.STRING],fallbackLg:[4,a.TYPES.STRING],fallbackLc:[5,a.TYPES.STRING],localizableParams:[6,a.FLAGS.REPEATED|a.TYPES.MESSAGE,ke],deterministicLg:[7,a.TYPES.STRING],deterministicLc:[8,a.TYPES.STRING],hydratedHsm:[9,a.TYPES.MESSAGE,Ce]},ke.internalSpec={default:[1,a.TYPES.STRING],currency:[2,a.TYPES.MESSAGE,Be],dateTime:[3,a.TYPES.MESSAGE,Ue],__oneofs__:{paramOneof:["currency","dateTime"]}},Ue.internalSpec={component:[1,a.TYPES.MESSAGE,xe],unixEpoch:[2,a.TYPES.MESSAGE,Ge],__oneofs__:{datetimeOneof:["component","unixEpoch"]}},Ge.internalSpec={timestamp:[1,a.TYPES.INT64]},xe.internalSpec={dayOfWeek:[1,a.TYPES.ENUM,E],year:[2,a.TYPES.UINT32],month:[3,a.TYPES.UINT32],dayOfMonth:[4,a.TYPES.UINT32],hour:[5,a.TYPES.UINT32],minute:[6,a.TYPES.UINT32],calendar:[7,a.TYPES.ENUM,y]},Be.internalSpec={currencyCode:[1,a.TYPES.STRING],amount1000:[2,a.TYPES.INT64]},Fe.internalSpec={displayName:[1,a.TYPES.STRING],contacts:[2,a.FLAGS.REPEATED|a.TYPES.MESSAGE,ct],contextInfo:[17,a.TYPES.MESSAGE,ft]},je.internalSpec={securityNotificationEnabled:[1,a.TYPES.BOOL]},Ye.internalSpec={peerDataOperationRequestType:[1,a.TYPES.ENUM,S],stanzaId:[2,a.TYPES.STRING],peerDataOperationResult:[3,a.FLAGS.REPEATED|a.TYPES.MESSAGE,Ke]},Ke.internalSpec={mediaUploadResult:[1,a.TYPES.ENUM,s.MediaRetryNotification$ResultType],stickerMessage:[2,a.TYPES.MESSAGE,Ie],linkPreviewResponse:[3,a.TYPES.MESSAGE,He]},He.internalSpec={url:[1,a.TYPES.STRING],title:[2,a.TYPES.STRING],description:[3,a.TYPES.STRING],thumbData:[4,a.TYPES.BYTES],canonicalUrl:[5,a.TYPES.STRING],matchText:[6,a.TYPES.STRING],previewType:[7,a.TYPES.STRING]},We.internalSpec={peerDataOperationRequestType:[1,a.TYPES.ENUM,S],requestStickerReupload:[2,a.FLAGS.REPEATED|a.TYPES.MESSAGE,$e],requestUrlPreview:[3,a.FLAGS.REPEATED|a.TYPES.MESSAGE,Ve]},Ve.internalSpec={url:[1,a.TYPES.STRING]},$e.internalSpec={fileSha256:[1,a.TYPES.STRING]},ze.internalSpec={collectionNames:[1,a.FLAGS.REPEATED|a.TYPES.STRING],timestamp:[2,a.TYPES.INT64]},qe.internalSpec={keyIds:[1,a.FLAGS.REPEATED|a.TYPES.MESSAGE,Ze]},Je.internalSpec={keys:[1,a.FLAGS.REPEATED|a.TYPES.MESSAGE,et]},Qe.internalSpec={keyData:[1,a.TYPES.BYTES],fingerprint:[2,a.TYPES.MESSAGE,Xe],timestamp:[3,a.TYPES.INT64]},Xe.internalSpec={rawId:[1,a.TYPES.UINT32],currentIndex:[2,a.TYPES.UINT32],deviceIndexes:[3,a.FLAGS.REPEATED|a.FLAGS.PACKED|a.TYPES.UINT32]},Ze.internalSpec={keyId:[1,a.TYPES.BYTES]},et.internalSpec={keyId:[1,a.TYPES.MESSAGE,Ze],keyData:[2,a.TYPES.MESSAGE,Qe]},tt.internalSpec={fileSha256:[1,a.TYPES.BYTES],fileLength:[2,a.TYPES.UINT64],mediaKey:[3,a.TYPES.BYTES],fileEncSha256:[4,a.TYPES.BYTES],directPath:[5,a.TYPES.STRING],syncType:[6,a.TYPES.ENUM,T],chunkOrder:[7,a.TYPES.UINT32],originalMessageId:[8,a.TYPES.STRING],progress:[9,a.TYPES.UINT32],oldestMsgInChunkTimestampSec:[10,a.TYPES.INT64]},nt.internalSpec={key:[1,a.TYPES.MESSAGE,o.MessageKeySpec],type:[2,a.TYPES.ENUM,v],ephemeralExpiration:[4,a.TYPES.UINT32],ephemeralSettingTimestamp:[5,a.TYPES.INT64],historySyncNotification:[6,a.TYPES.MESSAGE,tt],appStateSyncKeyShare:[7,a.TYPES.MESSAGE,Je],appStateSyncKeyRequest:[8,a.TYPES.MESSAGE,qe],initialSecurityNotificationSettingSync:[9,a.TYPES.MESSAGE,je],appStateFatalExceptionNotification:[10,a.TYPES.MESSAGE,ze],disappearingMode:[11,a.TYPES.MESSAGE,Lt],editedMessage:[14,a.TYPES.MESSAGE,L],timestampMs:[15,a.TYPES.INT64],peerDataOperationRequestMessage:[16,a.TYPES.MESSAGE,We],peerDataOperationRequestResponseMessage:[17,a.TYPES.MESSAGE,Ye]},rt.internalSpec={displayName:[1,a.TYPES.STRING],id:[2,a.TYPES.STRING]},it.internalSpec={callKey:[1,a.TYPES.BYTES],conversionSource:[2,a.TYPES.STRING],conversionData:[3,a.TYPES.BYTES],conversionDelaySeconds:[4,a.TYPES.UINT32]},at.internalSpec={url:[1,a.TYPES.STRING],mimetype:[2,a.TYPES.STRING],fileSha256:[3,a.TYPES.BYTES],fileLength:[4,a.TYPES.UINT64],seconds:[5,a.TYPES.UINT32],mediaKey:[6,a.TYPES.BYTES],caption:[7,a.TYPES.STRING],gifPlayback:[8,a.TYPES.BOOL],height:[9,a.TYPES.UINT32],width:[10,a.TYPES.UINT32],fileEncSha256:[11,a.TYPES.BYTES],interactiveAnnotations:[12,a.FLAGS.REPEATED|a.TYPES.MESSAGE,Et],directPath:[13,a.TYPES.STRING],mediaKeyTimestamp:[14,a.TYPES.INT64],jpegThumbnail:[16,a.TYPES.BYTES],contextInfo:[17,a.TYPES.MESSAGE,ft],streamingSidecar:[18,a.TYPES.BYTES],gifAttribution:[19,a.TYPES.ENUM,A],viewOnce:[20,a.TYPES.BOOL],thumbnailDirectPath:[21,a.TYPES.STRING],thumbnailSha256:[22,a.TYPES.BYTES],thumbnailEncSha256:[23,a.TYPES.BYTES],staticUrl:[24,a.TYPES.STRING]},ot.internalSpec={url:[1,a.TYPES.STRING],mimetype:[2,a.TYPES.STRING],fileSha256:[3,a.TYPES.BYTES],fileLength:[4,a.TYPES.UINT64],seconds:[5,a.TYPES.UINT32],ptt:[6,a.TYPES.BOOL],mediaKey:[7,a.TYPES.BYTES],fileEncSha256:[8,a.TYPES.BYTES],directPath:[9,a.TYPES.STRING],mediaKeyTimestamp:[10,a.TYPES.INT64],contextInfo:[17,a.TYPES.MESSAGE,ft],streamingSidecar:[18,a.TYPES.BYTES],waveform:[19,a.TYPES.BYTES],backgroundArgb:[20,a.TYPES.FIXED32]},st.internalSpec={url:[1,a.TYPES.STRING],mimetype:[2,a.TYPES.STRING],title:[3,a.TYPES.STRING],fileSha256:[4,a.TYPES.BYTES],fileLength:[5,a.TYPES.UINT64],pageCount:[6,a.TYPES.UINT32],mediaKey:[7,a.TYPES.BYTES],fileName:[8,a.TYPES.STRING],fileEncSha256:[9,a.TYPES.BYTES],directPath:[10,a.TYPES.STRING],mediaKeyTimestamp:[11,a.TYPES.INT64],contactVcard:[12,a.TYPES.BOOL],thumbnailDirectPath:[13,a.TYPES.STRING],thumbnailSha256:[14,a.TYPES.BYTES],thumbnailEncSha256:[15,a.TYPES.BYTES],jpegThumbnail:[16,a.TYPES.BYTES],contextInfo:[17,a.TYPES.MESSAGE,ft],thumbnailHeight:[18,a.TYPES.UINT32],thumbnailWidth:[19,a.TYPES.UINT32],caption:[20,a.TYPES.STRING]},lt.internalSpec={text:[1,a.TYPES.STRING],matchedText:[2,a.TYPES.STRING],canonicalUrl:[4,a.TYPES.STRING],description:[5,a.TYPES.STRING],title:[6,a.TYPES.STRING],textArgb:[7,a.TYPES.FIXED32],backgroundArgb:[8,a.TYPES.FIXED32],font:[9,a.TYPES.ENUM,O],previewType:[10,a.TYPES.ENUM,P],jpegThumbnail:[16,a.TYPES.BYTES],contextInfo:[17,a.TYPES.MESSAGE,ft],doNotPlayInline:[18,a.TYPES.BOOL],thumbnailDirectPath:[19,a.TYPES.STRING],thumbnailSha256:[20,a.TYPES.BYTES],thumbnailEncSha256:[21,a.TYPES.BYTES],mediaKey:[22,a.TYPES.BYTES],mediaKeyTimestamp:[23,a.TYPES.INT64],thumbnailHeight:[24,a.TYPES.UINT32],thumbnailWidth:[25,a.TYPES.UINT32],inviteLinkGroupType:[26,a.TYPES.ENUM,C],inviteLinkParentGroupSubjectV2:[27,a.TYPES.STRING],inviteLinkParentGroupThumbnailV2:[28,a.TYPES.BYTES],inviteLinkGroupTypeV2:[29,a.TYPES.ENUM,C],viewOnce:[30,a.TYPES.BOOL]},ut.internalSpec={degreesLatitude:[1,a.TYPES.DOUBLE],degreesLongitude:[2,a.TYPES.DOUBLE],name:[3,a.TYPES.STRING],address:[4,a.TYPES.STRING],url:[5,a.TYPES.STRING],isLive:[6,a.TYPES.BOOL],accuracyInMeters:[7,a.TYPES.UINT32],speedInMps:[8,a.TYPES.FLOAT],degreesClockwiseFromMagneticNorth:[9,a.TYPES.UINT32],comment:[11,a.TYPES.STRING],jpegThumbnail:[16,a.TYPES.BYTES],contextInfo:[17,a.TYPES.MESSAGE,ft]},ct.internalSpec={displayName:[1,a.TYPES.STRING],vcard:[16,a.TYPES.STRING],contextInfo:[17,a.TYPES.MESSAGE,ft]},dt.internalSpec={note:[1,a.TYPES.STRING],token:[2,a.TYPES.STRING],attachmentType:[3,a.TYPES.ENUM,I],attachmentMimetype:[4,a.TYPES.STRING],attachmentMediaKey:[5,a.TYPES.BYTES],attachmentMediaKeyTimestamp:[6,a.TYPES.INT64],attachmentFileSha256:[7,a.TYPES.BYTES],attachmentFileEncSha256:[8,a.TYPES.BYTES],attachmentDirectPath:[9,a.TYPES.STRING],attachmentJpegThumbnail:[10,a.TYPES.BYTES]},pt.internalSpec={url:[1,a.TYPES.STRING],mimetype:[2,a.TYPES.STRING],caption:[3,a.TYPES.STRING],fileSha256:[4,a.TYPES.BYTES],fileLength:[5,a.TYPES.UINT64],height:[6,a.TYPES.UINT32],width:[7,a.TYPES.UINT32],mediaKey:[8,a.TYPES.BYTES],fileEncSha256:[9,a.TYPES.BYTES],interactiveAnnotations:[10,a.FLAGS.REPEATED|a.TYPES.MESSAGE,Et],directPath:[11,a.TYPES.STRING],mediaKeyTimestamp:[12,a.TYPES.INT64],jpegThumbnail:[16,a.TYPES.BYTES],contextInfo:[17,a.TYPES.MESSAGE,ft],firstScanSidecar:[18,a.TYPES.BYTES],firstScanLength:[19,a.TYPES.UINT32],experimentGroupId:[20,a.TYPES.UINT32],scansSidecar:[21,a.TYPES.BYTES],scanLengths:[22,a.FLAGS.REPEATED|a.TYPES.UINT32],midQualityFileSha256:[23,a.TYPES.BYTES],midQualityFileEncSha256:[24,a.TYPES.BYTES],viewOnce:[25,a.TYPES.BOOL],thumbnailDirectPath:[26,a.TYPES.STRING],thumbnailSha256:[27,a.TYPES.BYTES],thumbnailEncSha256:[28,a.TYPES.BYTES],staticUrl:[29,a.TYPES.STRING]},_t.internalSpec={groupId:[1,a.TYPES.STRING],axolotlSenderKeyDistributionMessage:[2,a.TYPES.BYTES]},ft.internalSpec={stanzaId:[1,a.TYPES.STRING],participant:[2,a.TYPES.STRING],quotedMessage:[3,a.TYPES.MESSAGE,L],remoteJid:[4,a.TYPES.STRING],mentionedJid:[15,a.FLAGS.REPEATED|a.TYPES.STRING],conversionSource:[18,a.TYPES.STRING],conversionData:[19,a.TYPES.BYTES],conversionDelaySeconds:[20,a.TYPES.UINT32],forwardingScore:[21,a.TYPES.UINT32],isForwarded:[22,a.TYPES.BOOL],quotedAd:[23,a.TYPES.MESSAGE,gt],placeholderKey:[24,a.TYPES.MESSAGE,o.MessageKeySpec],expiration:[25,a.TYPES.UINT32],ephemeralSettingTimestamp:[26,a.TYPES.INT64],ephemeralSharedSecret:[27,a.TYPES.BYTES],externalAdReply:[28,a.TYPES.MESSAGE,ht],entryPointConversionSource:[29,a.TYPES.STRING],entryPointConversionApp:[30,a.TYPES.STRING],entryPointConversionDelaySeconds:[31,a.TYPES.UINT32],disappearingMode:[32,a.TYPES.MESSAGE,Lt],actionLink:[33,a.TYPES.MESSAGE,Dt],groupSubject:[34,a.TYPES.STRING],parentGroupJid:[35,a.TYPES.STRING],trustBannerType:[37,a.TYPES.STRING],trustBannerAction:[38,a.TYPES.UINT32]},ht.internalSpec={title:[1,a.TYPES.STRING],body:[2,a.TYPES.STRING],mediaType:[3,a.TYPES.ENUM,M],thumbnailUrl:[4,a.TYPES.STRING],mediaUrl:[5,a.TYPES.STRING],thumbnail:[6,a.TYPES.BYTES],sourceType:[7,a.TYPES.STRING],sourceId:[8,a.TYPES.STRING],sourceUrl:[9,a.TYPES.STRING],containsAutoReply:[10,a.TYPES.BOOL],renderLargerThumbnail:[11,a.TYPES.BOOL],showAdAttribution:[12,a.TYPES.BOOL],ctwaClid:[13,a.TYPES.STRING]},gt.internalSpec={advertiserName:[1,a.TYPES.STRING],mediaType:[2,a.TYPES.ENUM,b],jpegThumbnail:[16,a.TYPES.BYTES],caption:[17,a.TYPES.STRING]},mt.internalSpec={deviceListMetadata:[1,a.TYPES.MESSAGE,yt],deviceListMetadataVersion:[2,a.TYPES.INT32],messageSecret:[3,a.TYPES.BYTES],paddingBytes:[4,a.TYPES.BYTES]},yt.internalSpec={senderKeyHash:[1,a.TYPES.BYTES],senderTimestamp:[2,a.TYPES.UINT64],senderKeyIndexes:[3,a.FLAGS.REPEATED|a.FLAGS.PACKED|a.TYPES.UINT32],recipientKeyHash:[8,a.TYPES.BYTES],recipientTimestamp:[9,a.TYPES.UINT64],recipientKeyIndexes:[10,a.FLAGS.REPEATED|a.FLAGS.PACKED|a.TYPES.UINT32]},Et.internalSpec={polygonVertices:[1,a.FLAGS.REPEATED|a.TYPES.MESSAGE,St],location:[2,a.TYPES.MESSAGE,Tt],__oneofs__:{action:["location"]}},St.internalSpec={xDeprecated:[1,a.TYPES.INT32],yDeprecated:[2,a.TYPES.INT32],x:[3,a.TYPES.DOUBLE],y:[4,a.TYPES.DOUBLE]},Tt.internalSpec={degreesLatitude:[1,a.TYPES.DOUBLE],degreesLongitude:[2,a.TYPES.DOUBLE],name:[3,a.TYPES.STRING]},vt.internalSpec={quickReplyButton:[1,a.TYPES.MESSAGE,Pt],urlButton:[2,a.TYPES.MESSAGE,Ct],callButton:[3,a.TYPES.MESSAGE,At],index:[4,a.TYPES.UINT32],__oneofs__:{button:["quickReplyButton","urlButton","callButton"]}},At.internalSpec={displayText:[1,a.TYPES.MESSAGE,De],phoneNumber:[2,a.TYPES.MESSAGE,De]},Ct.internalSpec={displayText:[1,a.TYPES.MESSAGE,De],url:[2,a.TYPES.MESSAGE,De]},Pt.internalSpec={displayText:[1,a.TYPES.MESSAGE,De],id:[2,a.TYPES.STRING]},Ot.internalSpec={quickReplyButton:[1,a.TYPES.MESSAGE,bt],urlButton:[2,a.TYPES.MESSAGE,Mt],callButton:[3,a.TYPES.MESSAGE,It],index:[4,a.TYPES.UINT32],__oneofs__:{hydratedButton:["quickReplyButton","urlButton","callButton"]}},It.internalSpec={displayText:[1,a.TYPES.STRING],phoneNumber:[2,a.TYPES.STRING]},Mt.internalSpec={displayText:[1,a.TYPES.STRING],url:[2,a.TYPES.STRING]},bt.internalSpec={displayText:[1,a.TYPES.STRING],id:[2,a.TYPES.STRING]},Rt.internalSpec={value:[1,a.TYPES.INT64],offset:[2,a.TYPES.UINT32],currencyCode:[3,a.TYPES.STRING]},Nt.internalSpec={id:[1,a.TYPES.STRING],fileLength:[2,a.TYPES.UINT64],width:[3,a.TYPES.UINT32],height:[4,a.TYPES.UINT32],mimetype:[5,a.TYPES.STRING],placeholderArgb:[6,a.TYPES.FIXED32],textArgb:[7,a.TYPES.FIXED32],subtextArgb:[8,a.TYPES.FIXED32],mediaData:[9,a.TYPES.MESSAGE,wt],type:[10,a.TYPES.ENUM,R]},wt.internalSpec={mediaKey:[1,a.TYPES.BYTES],mediaKeyTimestamp:[2,a.TYPES.INT64],fileSha256:[3,a.TYPES.BYTES],fileEncSha256:[4,a.TYPES.BYTES],directPath:[5,a.TYPES.STRING]},Lt.internalSpec={initiator:[1,a.TYPES.ENUM,N]},Dt.internalSpec={url:[1,a.TYPES.STRING],buttonTitle:[2,a.TYPES.STRING]}},199931:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.EphemeralSettingSpec=void 0;var i=r(n(81109)),a=n(739660);const o=(0,i.default)({},null);t.EphemeralSettingSpec=o,o.internalSpec={duration:[1,a.TYPES.SFIXED32],timestamp:[2,a.TYPES.SFIXED64]}},60370:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.WallpaperSettingsSpec=t.StickerMetadataSpec=t.PushnameSpec=t.PastParticipantsSpec=t.PastParticipantSpec=t.PastParticipant$LeaveReason=t.MediaVisibility=t.HistorySyncSpec=t.HistorySyncMsgSpec=t.HistorySync$HistorySyncType=t.GroupParticipantSpec=t.GroupParticipant$Rank=t.GlobalSettingsSpec=t.ConversationSpec=t.Conversation$EndOfHistoryTransferType=t.AvatarUserSettingsSpec=t.AutoDownloadSettingsSpec=void 0;var i=r(n(81109)),a=n(739660),o=n(968923),s=n(533494);const l=n(76672)({INITIAL_BOOTSTRAP:0,INITIAL_STATUS_V3:1,FULL:2,RECENT:3,PUSH_NAME:4,NON_BLOCKING_DATA:5});t.HistorySync$HistorySyncType=l;const u=n(76672)({COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY:0,COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY:1});t.Conversation$EndOfHistoryTransferType=u;const c=n(76672)({REGULAR:0,ADMIN:1,SUPERADMIN:2});t.GroupParticipant$Rank=c;const d=n(76672)({DEFAULT:0,OFF:1,ON:2});t.MediaVisibility=d;const p=n(76672)({LEFT:0,REMOVED:1});t.PastParticipant$LeaveReason=p;const _=(0,i.default)({},null);t.HistorySyncSpec=_;const f=(0,i.default)({},null);t.ConversationSpec=f;const h=(0,i.default)({},null);t.HistorySyncMsgSpec=h;const g=(0,i.default)({},null);t.PushnameSpec=g;const m=(0,i.default)({},null);t.GroupParticipantSpec=m;const y=(0,i.default)({},null);t.WallpaperSettingsSpec=y;const E=(0,i.default)({},null);t.GlobalSettingsSpec=E;const S=(0,i.default)({},null);t.AutoDownloadSettingsSpec=S;const T=(0,i.default)({},null);t.StickerMetadataSpec=T;const v=(0,i.default)({},null);t.PastParticipantsSpec=v;const A=(0,i.default)({},null);t.PastParticipantSpec=A;const C=(0,i.default)({},null);t.AvatarUserSettingsSpec=C,_.internalSpec={syncType:[1,a.FLAGS.REQUIRED|a.TYPES.ENUM,l],conversations:[2,a.FLAGS.REPEATED|a.TYPES.MESSAGE,f],statusV3Messages:[3,a.FLAGS.REPEATED|a.TYPES.MESSAGE,o.WebMessageInfoSpec],chunkOrder:[5,a.TYPES.UINT32],progress:[6,a.TYPES.UINT32],pushnames:[7,a.FLAGS.REPEATED|a.TYPES.MESSAGE,g],globalSettings:[8,a.TYPES.MESSAGE,E],threadIdUserSecret:[9,a.TYPES.BYTES],threadDsTimeframeOffset:[10,a.TYPES.UINT32],recentStickers:[11,a.FLAGS.REPEATED|a.TYPES.MESSAGE,T],pastParticipants:[12,a.FLAGS.REPEATED|a.TYPES.MESSAGE,v]},f.internalSpec={id:[1,a.FLAGS.REQUIRED|a.TYPES.STRING],messages:[2,a.FLAGS.REPEATED|a.TYPES.MESSAGE,h],newJid:[3,a.TYPES.STRING],oldJid:[4,a.TYPES.STRING],lastMsgTimestamp:[5,a.TYPES.UINT64],unreadCount:[6,a.TYPES.UINT32],readOnly:[7,a.TYPES.BOOL],endOfHistoryTransfer:[8,a.TYPES.BOOL],ephemeralExpiration:[9,a.TYPES.UINT32],ephemeralSettingTimestamp:[10,a.TYPES.INT64],endOfHistoryTransferType:[11,a.TYPES.ENUM,u],conversationTimestamp:[12,a.TYPES.UINT64],name:[13,a.TYPES.STRING],pHash:[14,a.TYPES.STRING],notSpam:[15,a.TYPES.BOOL],archived:[16,a.TYPES.BOOL],disappearingMode:[17,a.TYPES.MESSAGE,s.DisappearingModeSpec],unreadMentionCount:[18,a.TYPES.UINT32],markedAsUnread:[19,a.TYPES.BOOL],participant:[20,a.FLAGS.REPEATED|a.TYPES.MESSAGE,m],tcToken:[21,a.TYPES.BYTES],tcTokenTimestamp:[22,a.TYPES.UINT64],contactPrimaryIdentityKey:[23,a.TYPES.BYTES],pinned:[24,a.TYPES.UINT32],muteEndTime:[25,a.TYPES.UINT64],wallpaper:[26,a.TYPES.MESSAGE,y],mediaVisibility:[27,a.TYPES.ENUM,d],tcTokenSenderTimestamp:[28,a.TYPES.UINT64],suspended:[29,a.TYPES.BOOL],terminated:[30,a.TYPES.BOOL],createdAt:[31,a.TYPES.UINT64],createdBy:[32,a.TYPES.STRING],description:[33,a.TYPES.STRING],support:[34,a.TYPES.BOOL],isParentGroup:[35,a.TYPES.BOOL],isDefaultSubgroup:[36,a.TYPES.BOOL],parentGroupId:[37,a.TYPES.STRING],displayName:[38,a.TYPES.STRING],pnJid:[39,a.TYPES.STRING],shareOwnPn:[40,a.TYPES.BOOL],pnhDuplicateLidThread:[41,a.TYPES.BOOL],lidJid:[42,a.TYPES.STRING]},h.internalSpec={message:[1,a.TYPES.MESSAGE,o.WebMessageInfoSpec],msgOrderId:[2,a.TYPES.UINT64]},g.internalSpec={id:[1,a.TYPES.STRING],pushname:[2,a.TYPES.STRING]},m.internalSpec={userJid:[1,a.FLAGS.REQUIRED|a.TYPES.STRING],rank:[2,a.TYPES.ENUM,c]},y.internalSpec={filename:[1,a.TYPES.STRING],opacity:[2,a.TYPES.UINT32]},E.internalSpec={lightThemeWallpaper:[1,a.TYPES.MESSAGE,y],mediaVisibility:[2,a.TYPES.ENUM,d],darkThemeWallpaper:[3,a.TYPES.MESSAGE,y],autoDownloadWiFi:[4,a.TYPES.MESSAGE,S],autoDownloadCellular:[5,a.TYPES.MESSAGE,S],autoDownloadRoaming:[6,a.TYPES.MESSAGE,S],showIndividualNotificationsPreview:[7,a.TYPES.BOOL],showGroupNotificationsPreview:[8,a.TYPES.BOOL],disappearingModeDuration:[9,a.TYPES.INT32],disappearingModeTimestamp:[10,a.TYPES.INT64],avatarUserSettings:[11,a.TYPES.MESSAGE,C]},S.internalSpec={downloadImages:[1,a.TYPES.BOOL],downloadAudio:[2,a.TYPES.BOOL],downloadVideo:[3,a.TYPES.BOOL],downloadDocuments:[4,a.TYPES.BOOL]},T.internalSpec={url:[1,a.TYPES.STRING],fileSha256:[2,a.TYPES.BYTES],fileEncSha256:[3,a.TYPES.BYTES],mediaKey:[4,a.TYPES.BYTES],mimetype:[5,a.TYPES.STRING],height:[6,a.TYPES.UINT32],width:[7,a.TYPES.UINT32],directPath:[8,a.TYPES.STRING],fileLength:[9,a.TYPES.UINT64],weight:[10,a.TYPES.FLOAT],lastStickerSentTs:[11,a.TYPES.INT64]},v.internalSpec={groupJid:[1,a.TYPES.STRING],pastParticipants:[2,a.FLAGS.REPEATED|a.TYPES.MESSAGE,A]},A.internalSpec={userJid:[1,a.TYPES.STRING],leaveReason:[2,a.TYPES.ENUM,p],leaveTs:[3,a.TYPES.UINT64]},C.internalSpec={fbid:[1,a.TYPES.STRING],password:[2,a.TYPES.STRING]}},412744:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.PollEncValueSpec=t.MsgRowOpaqueDataSpec=t.MsgOpaqueDataSpec=t.MsgOpaqueData$PollOptionSpec=void 0;var i=r(n(81109)),a=n(739660);const o=(0,i.default)({},null);t.MsgRowOpaqueDataSpec=o;const s=(0,i.default)({},null);t.PollEncValueSpec=s;const l=(0,i.default)({},null);t.MsgOpaqueDataSpec=l;const u=(0,i.default)({},null);t.MsgOpaqueData$PollOptionSpec=u,o.internalSpec={currentMsg:[1,a.TYPES.MESSAGE,l],quotedMsg:[2,a.TYPES.MESSAGE,l]},s.internalSpec={encPayload:[1,a.TYPES.BYTES],encIv:[2,a.TYPES.BYTES]},l.internalSpec={body:[1,a.TYPES.STRING],caption:[3,a.TYPES.STRING],lng:[5,a.TYPES.DOUBLE],isLive:[6,a.TYPES.BOOL],lat:[7,a.TYPES.DOUBLE],paymentAmount1000:[8,a.TYPES.INT32],paymentNoteMsgBody:[9,a.TYPES.STRING],canonicalUrl:[10,a.TYPES.STRING],matchedText:[11,a.TYPES.STRING],title:[12,a.TYPES.STRING],description:[13,a.TYPES.STRING],futureproofBuffer:[14,a.TYPES.BYTES],clientUrl:[15,a.TYPES.STRING],loc:[16,a.TYPES.STRING],pollName:[17,a.TYPES.STRING],pollOptions:[18,a.FLAGS.REPEATED|a.TYPES.MESSAGE,u],pollSelectableOptionsCount:[20,a.TYPES.UINT32],messageSecret:[21,a.TYPES.BYTES],originalSelfAuthor:[51,a.TYPES.STRING],senderTimestampMs:[22,a.TYPES.INT64],pollUpdateParentKey:[23,a.TYPES.STRING],encPollVote:[24,a.TYPES.MESSAGE,s],encReactionTargetMessageKey:[25,a.TYPES.STRING],encReactionEncPayload:[26,a.TYPES.BYTES],encReactionEncIv:[27,a.TYPES.BYTES]},u.internalSpec={name:[1,a.TYPES.STRING]}},229479:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ServerErrorReceiptSpec=t.MediaRetryNotificationSpec=t.MediaRetryNotification$ResultType=void 0;var i=r(n(81109)),a=n(739660);const o=n(76672)({GENERAL_ERROR:0,SUCCESS:1,NOT_FOUND:2,DECRYPTION_ERROR:3});t.MediaRetryNotification$ResultType=o;const s=(0,i.default)({},null);t.MediaRetryNotificationSpec=s;const l=(0,i.default)({},null);t.ServerErrorReceiptSpec=l,s.internalSpec={stanzaId:[1,a.TYPES.STRING],directPath:[2,a.TYPES.STRING],result:[3,a.TYPES.ENUM,o]},l.internalSpec={stanzaId:[1,a.TYPES.STRING]}},933734:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MessageKeySpec=void 0;var i=r(n(81109)),a=n(739660);const o=(0,i.default)({},null);t.MessageKeySpec=o,o.internalSpec={remoteJid:[1,a.TYPES.STRING],fromMe:[2,a.TYPES.BOOL],id:[3,a.TYPES.STRING],participant:[4,a.TYPES.STRING]}},759089:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.VerifiedNameCertificateSpec=t.VerifiedNameCertificate$DetailsSpec=t.LocalizedNameSpec=t.BizIdentityInfoSpec=t.BizIdentityInfo$VerifiedLevelValue=t.BizIdentityInfo$HostStorageType=t.BizIdentityInfo$ActualActorsType=t.BizAccountPayloadSpec=t.BizAccountLinkInfoSpec=t.BizAccountLinkInfo$HostStorageType=t.BizAccountLinkInfo$AccountType=void 0;var i=r(n(81109)),a=n(739660);const o=n(76672)({ENTERPRISE:0});t.BizAccountLinkInfo$AccountType=o;const s=n(76672)({ON_PREMISE:0,FACEBOOK:1});t.BizAccountLinkInfo$HostStorageType=s;const l=n(76672)({SELF:0,BSP:1});t.BizIdentityInfo$ActualActorsType=l;const u=n(76672)({ON_PREMISE:0,FACEBOOK:1});t.BizIdentityInfo$HostStorageType=u;const c=n(76672)({UNKNOWN:0,LOW:1,HIGH:2});t.BizIdentityInfo$VerifiedLevelValue=c;const d=(0,i.default)({},null);t.LocalizedNameSpec=d;const p=(0,i.default)({},null);t.VerifiedNameCertificateSpec=p;const _=(0,i.default)({},null);t.VerifiedNameCertificate$DetailsSpec=_;const f=(0,i.default)({},null);t.BizAccountPayloadSpec=f;const h=(0,i.default)({},null);t.BizAccountLinkInfoSpec=h;const g=(0,i.default)({},null);t.BizIdentityInfoSpec=g,d.internalSpec={lg:[1,a.TYPES.STRING],lc:[2,a.TYPES.STRING],verifiedName:[3,a.TYPES.STRING]},p.internalSpec={details:[1,a.TYPES.BYTES],signature:[2,a.TYPES.BYTES],serverSignature:[3,a.TYPES.BYTES]},_.internalSpec={serial:[1,a.TYPES.UINT64],issuer:[2,a.TYPES.STRING],verifiedName:[4,a.TYPES.STRING],localizedNames:[8,a.FLAGS.REPEATED|a.TYPES.MESSAGE,d],issueTime:[10,a.TYPES.UINT64]},f.internalSpec={vnameCert:[1,a.TYPES.MESSAGE,p],bizAcctLinkInfo:[2,a.TYPES.BYTES]},h.internalSpec={whatsappBizAcctFbid:[1,a.TYPES.UINT64],whatsappAcctNumber:[2,a.TYPES.STRING],issueTime:[3,a.TYPES.UINT64],hostStorage:[4,a.TYPES.ENUM,s],accountType:[5,a.TYPES.ENUM,o]},g.internalSpec={vlevel:[1,a.TYPES.ENUM,c],vnameCert:[2,a.TYPES.MESSAGE,p],signed:[3,a.TYPES.BOOL],revoked:[4,a.TYPES.BOOL],hostStorage:[5,a.TYPES.ENUM,u],actualActors:[6,a.TYPES.ENUM,l],privacyModeTs:[7,a.TYPES.UINT64],featureControls:[8,a.TYPES.UINT64]}},614806:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.HandshakeMessageSpec=t.HandshakeMessage$ServerHelloSpec=t.HandshakeMessage$ClientHelloSpec=t.HandshakeMessage$ClientFinishSpec=t.ClientPayloadSpec=t.ClientPayload$WebInfoSpec=t.ClientPayload$WebInfo$WebdPayloadSpec=t.ClientPayload$WebInfo$WebSubPlatform=t.ClientPayload$UserAgentSpec=t.ClientPayload$UserAgent$ReleaseChannel=t.ClientPayload$UserAgent$Platform=t.ClientPayload$UserAgent$AppVersionSpec=t.ClientPayload$Product=t.ClientPayload$IOSAppExtension=t.ClientPayload$DevicePairingRegistrationDataSpec=t.ClientPayload$DNSSourceSpec=t.ClientPayload$DNSSource$DNSResolutionMethod=t.ClientPayload$ConnectType=t.ClientPayload$ConnectReason=t.ClientPayload$BizMarketSegment=void 0;var i=r(n(81109)),a=n(739660);const o=n(76672)({DEFAULT:0,DEVX:1,INBOX:2});t.ClientPayload$BizMarketSegment=o;const s=n(76672)({WHATSAPP:0,MESSENGER:1});t.ClientPayload$Product=s;const l=n(76672)({SYSTEM:0,GOOGLE:1,HARDCODED:2,OVERRIDE:3,FALLBACK:4});t.ClientPayload$DNSSource$DNSResolutionMethod=l;const u=n(76672)({CELLULAR_UNKNOWN:0,WIFI_UNKNOWN:1,CELLULAR_EDGE:100,CELLULAR_IDEN:101,CELLULAR_UMTS:102,CELLULAR_EVDO:103,CELLULAR_GPRS:104,CELLULAR_HSDPA:105,CELLULAR_HSUPA:106,CELLULAR_HSPA:107,CELLULAR_CDMA:108,CELLULAR_1XRTT:109,CELLULAR_EHRPD:110,CELLULAR_LTE:111,CELLULAR_HSPAP:112});t.ClientPayload$ConnectType=u;const c=n(76672)({PUSH:0,USER_ACTIVATED:1,SCHEDULED:2,ERROR_RECONNECT:3,NETWORK_SWITCH:4,PING_RECONNECT:5});t.ClientPayload$ConnectReason=c;const d=n(76672)({SHARE_EXTENSION:0,SERVICE_EXTENSION:1,INTENTS_EXTENSION:2});t.ClientPayload$IOSAppExtension=d;const p=n(76672)({WEB_BROWSER:0,APP_STORE:1,WIN_STORE:2,DARWIN:3,WIN32:4});t.ClientPayload$WebInfo$WebSubPlatform=p;const _=n(76672)({RELEASE:0,BETA:1,ALPHA:2,DEBUG:3});t.ClientPayload$UserAgent$ReleaseChannel=_;const f=n(76672)({ANDROID:0,IOS:1,WINDOWS_PHONE:2,BLACKBERRY:3,BLACKBERRYX:4,S40:5,S60:6,PYTHON_CLIENT:7,TIZEN:8,ENTERPRISE:9,SMB_ANDROID:10,KAIOS:11,SMB_IOS:12,WINDOWS:13,WEB:14,PORTAL:15,GREEN_ANDROID:16,GREEN_IPHONE:17,BLUE_ANDROID:18,BLUE_IPHONE:19,FBLITE_ANDROID:20,MLITE_ANDROID:21,IGLITE_ANDROID:22,PAGE:23,MACOS:24,OCULUS_MSG:25,OCULUS_CALL:26,MILAN:27,CAPI:28,WEAROS:29,ARDEVICE:30,VRDEVICE:31});t.ClientPayload$UserAgent$Platform=f;const h=(0,i.default)({},null);t.HandshakeMessageSpec=h;const g=(0,i.default)({},null);t.HandshakeMessage$ClientFinishSpec=g;const m=(0,i.default)({},null);t.HandshakeMessage$ServerHelloSpec=m;const y=(0,i.default)({},null);t.HandshakeMessage$ClientHelloSpec=y;const E=(0,i.default)({},null);t.ClientPayloadSpec=E;const S=(0,i.default)({},null);t.ClientPayload$DevicePairingRegistrationDataSpec=S;const T=(0,i.default)({},null);t.ClientPayload$DNSSourceSpec=T;const v=(0,i.default)({},null);t.ClientPayload$WebInfoSpec=v;const A=(0,i.default)({},null);t.ClientPayload$WebInfo$WebdPayloadSpec=A;const C=(0,i.default)({},null);t.ClientPayload$UserAgentSpec=C;const P=(0,i.default)({},null);t.ClientPayload$UserAgent$AppVersionSpec=P,h.internalSpec={clientHello:[2,a.TYPES.MESSAGE,y],serverHello:[3,a.TYPES.MESSAGE,m],clientFinish:[4,a.TYPES.MESSAGE,g]},g.internalSpec={static:[1,a.TYPES.BYTES],payload:[2,a.TYPES.BYTES]},m.internalSpec={ephemeral:[1,a.TYPES.BYTES],static:[2,a.TYPES.BYTES],payload:[3,a.TYPES.BYTES]},y.internalSpec={ephemeral:[1,a.TYPES.BYTES],static:[2,a.TYPES.BYTES],payload:[3,a.TYPES.BYTES]},E.internalSpec={username:[1,a.TYPES.UINT64],passive:[3,a.TYPES.BOOL],userAgent:[5,a.TYPES.MESSAGE,C],webInfo:[6,a.TYPES.MESSAGE,v],pushName:[7,a.TYPES.STRING],sessionId:[9,a.TYPES.SFIXED32],shortConnect:[10,a.TYPES.BOOL],connectType:[12,a.TYPES.ENUM,u],connectReason:[13,a.TYPES.ENUM,c],shards:[14,a.FLAGS.REPEATED|a.TYPES.INT32],dnsSource:[15,a.TYPES.MESSAGE,T],connectAttemptCount:[16,a.TYPES.UINT32],device:[18,a.TYPES.UINT32],devicePairingData:[19,a.TYPES.MESSAGE,S],product:[20,a.TYPES.ENUM,s],fbCat:[21,a.TYPES.BYTES],fbUserAgent:[22,a.TYPES.BYTES],oc:[23,a.TYPES.BOOL],lc:[24,a.TYPES.INT32],iosAppExtension:[30,a.TYPES.ENUM,d],fbAppId:[31,a.TYPES.UINT64],fbDeviceId:[32,a.TYPES.BYTES],pull:[33,a.TYPES.BOOL],paddingBytes:[34,a.TYPES.BYTES],bizMarketSegment:[35,a.TYPES.ENUM,o],yearClass:[36,a.TYPES.INT32],memClass:[37,a.TYPES.INT32]},S.internalSpec={eRegid:[1,a.TYPES.BYTES],eKeytype:[2,a.TYPES.BYTES],eIdent:[3,a.TYPES.BYTES],eSkeyId:[4,a.TYPES.BYTES],eSkeyVal:[5,a.TYPES.BYTES],eSkeySig:[6,a.TYPES.BYTES],buildHash:[7,a.TYPES.BYTES],deviceProps:[8,a.TYPES.BYTES]},T.internalSpec={dnsMethod:[15,a.TYPES.ENUM,l],appCached:[16,a.TYPES.BOOL]},v.internalSpec={refToken:[1,a.TYPES.STRING],version:[2,a.TYPES.STRING],webdPayload:[3,a.TYPES.MESSAGE,A],webSubPlatform:[4,a.TYPES.ENUM,p]},A.internalSpec={usesParticipantInKey:[1,a.TYPES.BOOL],supportsStarredMessages:[2,a.TYPES.BOOL],supportsDocumentMessages:[3,a.TYPES.BOOL],supportsUrlMessages:[4,a.TYPES.BOOL],supportsMediaRetry:[5,a.TYPES.BOOL],supportsE2EImage:[6,a.TYPES.BOOL],supportsE2EVideo:[7,a.TYPES.BOOL],supportsE2EAudio:[8,a.TYPES.BOOL],supportsE2EDocument:[9,a.TYPES.BOOL],documentTypes:[10,a.TYPES.STRING],features:[11,a.TYPES.BYTES]},C.internalSpec={platform:[1,a.TYPES.ENUM,f],appVersion:[2,a.TYPES.MESSAGE,P],mcc:[3,a.TYPES.STRING],mnc:[4,a.TYPES.STRING],osVersion:[5,a.TYPES.STRING],manufacturer:[6,a.TYPES.STRING],device:[7,a.TYPES.STRING],osBuildNumber:[8,a.TYPES.STRING],phoneId:[9,a.TYPES.STRING],releaseChannel:[10,a.TYPES.ENUM,_],localeLanguageIso6391:[11,a.TYPES.STRING],localeCountryIso31661Alpha2:[12,a.TYPES.STRING],deviceBoard:[13,a.TYPES.STRING]},P.internalSpec={primary:[1,a.TYPES.UINT32],secondary:[2,a.TYPES.UINT32],tertiary:[3,a.TYPES.UINT32],quaternary:[4,a.TYPES.UINT32],quinary:[5,a.TYPES.UINT32]}},968923:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.WebNotificationsInfoSpec=t.WebMessageInfoSpec=t.WebMessageInfo$StubType=t.WebMessageInfo$Status=t.WebMessageInfo$BizPrivacyStatus=t.WebFeaturesSpec=t.WebFeatures$Flag=t.UserReceiptSpec=t.StatusPSASpec=t.ReactionSpec=t.PollUpdateSpec=t.PollAdditionalMetadataSpec=t.PhotoChangeSpec=t.PaymentInfoSpec=t.PaymentInfo$TxnStatus=t.PaymentInfo$Status=t.PaymentInfo$Currency=t.NotificationMessageInfoSpec=t.MediaDataSpec=t.KeepInChatSpec=void 0;var i=r(n(81109)),a=n(739660),o=n(533494),s=n(933734);const l=n(76672)({E2EE:0,FB:2,BSP:1,BSP_AND_FB:3});t.WebMessageInfo$BizPrivacyStatus=l;const u=n(76672)({UNKNOWN:0,REVOKE:1,CIPHERTEXT:2,FUTUREPROOF:3,NON_VERIFIED_TRANSITION:4,UNVERIFIED_TRANSITION:5,VERIFIED_TRANSITION:6,VERIFIED_LOW_UNKNOWN:7,VERIFIED_HIGH:8,VERIFIED_INITIAL_UNKNOWN:9,VERIFIED_INITIAL_LOW:10,VERIFIED_INITIAL_HIGH:11,VERIFIED_TRANSITION_ANY_TO_NONE:12,VERIFIED_TRANSITION_ANY_TO_HIGH:13,VERIFIED_TRANSITION_HIGH_TO_LOW:14,VERIFIED_TRANSITION_HIGH_TO_UNKNOWN:15,VERIFIED_TRANSITION_UNKNOWN_TO_LOW:16,VERIFIED_TRANSITION_LOW_TO_UNKNOWN:17,VERIFIED_TRANSITION_NONE_TO_LOW:18,VERIFIED_TRANSITION_NONE_TO_UNKNOWN:19,GROUP_CREATE:20,GROUP_CHANGE_SUBJECT:21,GROUP_CHANGE_ICON:22,GROUP_CHANGE_INVITE_LINK:23,GROUP_CHANGE_DESCRIPTION:24,GROUP_CHANGE_RESTRICT:25,GROUP_CHANGE_ANNOUNCE:26,GROUP_PARTICIPANT_ADD:27,GROUP_PARTICIPANT_REMOVE:28,GROUP_PARTICIPANT_PROMOTE:29,GROUP_PARTICIPANT_DEMOTE:30,GROUP_PARTICIPANT_INVITE:31,GROUP_PARTICIPANT_LEAVE:32,GROUP_PARTICIPANT_CHANGE_NUMBER:33,BROADCAST_CREATE:34,BROADCAST_ADD:35,BROADCAST_REMOVE:36,GENERIC_NOTIFICATION:37,E2E_IDENTITY_CHANGED:38,E2E_ENCRYPTED:39,CALL_MISSED_VOICE:40,CALL_MISSED_VIDEO:41,INDIVIDUAL_CHANGE_NUMBER:42,GROUP_DELETE:43,GROUP_ANNOUNCE_MODE_MESSAGE_BOUNCE:44,CALL_MISSED_GROUP_VOICE:45,CALL_MISSED_GROUP_VIDEO:46,PAYMENT_CIPHERTEXT:47,PAYMENT_FUTUREPROOF:48,PAYMENT_TRANSACTION_STATUS_UPDATE_FAILED:49,PAYMENT_TRANSACTION_STATUS_UPDATE_REFUNDED:50,PAYMENT_TRANSACTION_STATUS_UPDATE_REFUND_FAILED:51,PAYMENT_TRANSACTION_STATUS_RECEIVER_PENDING_SETUP:52,PAYMENT_TRANSACTION_STATUS_RECEIVER_SUCCESS_AFTER_HICCUP:53,PAYMENT_ACTION_ACCOUNT_SETUP_REMINDER:54,PAYMENT_ACTION_SEND_PAYMENT_REMINDER:55,PAYMENT_ACTION_SEND_PAYMENT_INVITATION:56,PAYMENT_ACTION_REQUEST_DECLINED:57,PAYMENT_ACTION_REQUEST_EXPIRED:58,PAYMENT_ACTION_REQUEST_CANCELLED:59,BIZ_VERIFIED_TRANSITION_TOP_TO_BOTTOM:60,BIZ_VERIFIED_TRANSITION_BOTTOM_TO_TOP:61,BIZ_INTRO_TOP:62,BIZ_INTRO_BOTTOM:63,BIZ_NAME_CHANGE:64,BIZ_MOVE_TO_CONSUMER_APP:65,BIZ_TWO_TIER_MIGRATION_TOP:66,BIZ_TWO_TIER_MIGRATION_BOTTOM:67,OVERSIZED:68,GROUP_CHANGE_NO_FREQUENTLY_FORWARDED:69,GROUP_V4_ADD_INVITE_SENT:70,GROUP_PARTICIPANT_ADD_REQUEST_JOIN:71,CHANGE_EPHEMERAL_SETTING:72,E2E_DEVICE_CHANGED:73,VIEWED_ONCE:74,E2E_ENCRYPTED_NOW:75,BLUE_MSG_BSP_FB_TO_BSP_PREMISE:76,BLUE_MSG_BSP_FB_TO_SELF_FB:77,BLUE_MSG_BSP_FB_TO_SELF_PREMISE:78,BLUE_MSG_BSP_FB_UNVERIFIED:79,BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED:80,BLUE_MSG_BSP_FB_VERIFIED:81,BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED:82,BLUE_MSG_BSP_PREMISE_TO_SELF_PREMISE:83,BLUE_MSG_BSP_PREMISE_UNVERIFIED:84,BLUE_MSG_BSP_PREMISE_UNVERIFIED_TO_SELF_PREMISE_VERIFIED:85,BLUE_MSG_BSP_PREMISE_VERIFIED:86,BLUE_MSG_BSP_PREMISE_VERIFIED_TO_SELF_PREMISE_UNVERIFIED:87,BLUE_MSG_CONSUMER_TO_BSP_FB_UNVERIFIED:88,BLUE_MSG_CONSUMER_TO_BSP_PREMISE_UNVERIFIED:89,BLUE_MSG_CONSUMER_TO_SELF_FB_UNVERIFIED:90,BLUE_MSG_CONSUMER_TO_SELF_PREMISE_UNVERIFIED:91,BLUE_MSG_SELF_FB_TO_BSP_PREMISE:92,BLUE_MSG_SELF_FB_TO_SELF_PREMISE:93,BLUE_MSG_SELF_FB_UNVERIFIED:94,BLUE_MSG_SELF_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED:95,BLUE_MSG_SELF_FB_VERIFIED:96,BLUE_MSG_SELF_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED:97,BLUE_MSG_SELF_PREMISE_TO_BSP_PREMISE:98,BLUE_MSG_SELF_PREMISE_UNVERIFIED:99,BLUE_MSG_SELF_PREMISE_VERIFIED:100,BLUE_MSG_TO_BSP_FB:101,BLUE_MSG_TO_CONSUMER:102,BLUE_MSG_TO_SELF_FB:103,BLUE_MSG_UNVERIFIED_TO_BSP_FB_VERIFIED:104,BLUE_MSG_UNVERIFIED_TO_BSP_PREMISE_VERIFIED:105,BLUE_MSG_UNVERIFIED_TO_SELF_FB_VERIFIED:106,BLUE_MSG_UNVERIFIED_TO_VERIFIED:107,BLUE_MSG_VERIFIED_TO_BSP_FB_UNVERIFIED:108,BLUE_MSG_VERIFIED_TO_BSP_PREMISE_UNVERIFIED:109,BLUE_MSG_VERIFIED_TO_SELF_FB_UNVERIFIED:110,BLUE_MSG_VERIFIED_TO_UNVERIFIED:111,BLUE_MSG_BSP_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED:112,BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_FB_VERIFIED:113,BLUE_MSG_BSP_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED:114,BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_FB_UNVERIFIED:115,BLUE_MSG_SELF_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED:116,BLUE_MSG_SELF_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED:117,E2E_IDENTITY_UNAVAILABLE:118,GROUP_CREATING:119,GROUP_CREATE_FAILED:120,GROUP_BOUNCED:121,BLOCK_CONTACT:122,EPHEMERAL_SETTING_NOT_APPLIED:123,SYNC_FAILED:124,SYNCING:125,BIZ_PRIVACY_MODE_INIT_FB:126,BIZ_PRIVACY_MODE_INIT_BSP:127,BIZ_PRIVACY_MODE_TO_FB:128,BIZ_PRIVACY_MODE_TO_BSP:129,DISAPPEARING_MODE:130,E2E_DEVICE_FETCH_FAILED:131,ADMIN_REVOKE:132,GROUP_INVITE_LINK_GROWTH_LOCKED:133,COMMUNITY_LINK_PARENT_GROUP:134,COMMUNITY_LINK_SIBLING_GROUP:135,COMMUNITY_LINK_SUB_GROUP:136,COMMUNITY_UNLINK_PARENT_GROUP:137,COMMUNITY_UNLINK_SIBLING_GROUP:138,COMMUNITY_UNLINK_SUB_GROUP:139,GROUP_PARTICIPANT_ACCEPT:140,GROUP_PARTICIPANT_LINKED_GROUP_JOIN:141,COMMUNITY_CREATE:142,EPHEMERAL_KEEP_IN_CHAT:143,GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST:144,GROUP_MEMBERSHIP_JOIN_APPROVAL_MODE:145,INTEGRITY_UNLINK_PARENT_GROUP:146,COMMUNITY_PARTICIPANT_PROMOTE:147,COMMUNITY_PARTICIPANT_DEMOTE:148,COMMUNITY_PARENT_GROUP_DELETED:149,COMMUNITY_LINK_PARENT_GROUP_MEMBERSHIP_APPROVAL:150,GROUP_PARTICIPANT_JOINED_GROUP_AND_PARENT_GROUP:151,MASKED_THREAD_CREATED:152,MASKED_THREAD_UNMASKED:153,BIZ_CHAT_ASSIGNMENT:154,CHAT_PSA:155,CHAT_POLL_CREATION_MESSAGE:156,CAG_MASKED_THREAD_CREATED:157,COMMUNITY_PARENT_GROUP_SUBJECT_CHANGED:158,CAG_INVITE_AUTO_ADD:159,BIZ_CHAT_ASSIGNMENT_UNASSIGN:160,CAG_INVITE_AUTO_JOINED:161});t.WebMessageInfo$StubType=u;const c=n(76672)({ERROR:0,PENDING:1,SERVER_ACK:2,DELIVERY_ACK:3,READ:4,PLAYED:5});t.WebMessageInfo$Status=c;const d=n(76672)({UNKNOWN:0,PENDING_SETUP:1,PENDING_RECEIVER_SETUP:2,INIT:3,SUCCESS:4,COMPLETED:5,FAILED:6,FAILED_RISK:7,FAILED_PROCESSING:8,FAILED_RECEIVER_PROCESSING:9,FAILED_DA:10,FAILED_DA_FINAL:11,REFUNDED_TXN:12,REFUND_FAILED:13,REFUND_FAILED_PROCESSING:14,REFUND_FAILED_DA:15,EXPIRED_TXN:16,AUTH_CANCELED:17,AUTH_CANCEL_FAILED_PROCESSING:18,AUTH_CANCEL_FAILED:19,COLLECT_INIT:20,COLLECT_SUCCESS:21,COLLECT_FAILED:22,COLLECT_FAILED_RISK:23,COLLECT_REJECTED:24,COLLECT_EXPIRED:25,COLLECT_CANCELED:26,COLLECT_CANCELLING:27,IN_REVIEW:28,REVERSAL_SUCCESS:29,REVERSAL_PENDING:30,REFUND_PENDING:31});t.PaymentInfo$TxnStatus=d;const p=n(76672)({UNKNOWN_STATUS:0,PROCESSING:1,SENT:2,NEED_TO_ACCEPT:3,COMPLETE:4,COULD_NOT_COMPLETE:5,REFUNDED:6,EXPIRED:7,REJECTED:8,CANCELLED:9,WAITING_FOR_PAYER:10,WAITING:11});t.PaymentInfo$Status=p;const _=n(76672)({UNKNOWN_CURRENCY:0,INR:1});t.PaymentInfo$Currency=_;const f=n(76672)({NOT_STARTED:0,FORCE_UPGRADE:1,DEVELOPMENT:2,PRODUCTION:3});t.WebFeatures$Flag=f;const h=(0,i.default)({},null);t.WebMessageInfoSpec=h;const g=(0,i.default)({},null);t.PaymentInfoSpec=g;const m=(0,i.default)({},null);t.WebNotificationsInfoSpec=m;const y=(0,i.default)({},null);t.NotificationMessageInfoSpec=y;const E=(0,i.default)({},null);t.WebFeaturesSpec=E;const S=(0,i.default)({},null);t.MediaDataSpec=S;const T=(0,i.default)({},null);t.PhotoChangeSpec=T;const v=(0,i.default)({},null);t.StatusPSASpec=v;const A=(0,i.default)({},null);t.UserReceiptSpec=A;const C=(0,i.default)({},null);t.ReactionSpec=C;const P=(0,i.default)({},null);t.PollUpdateSpec=P;const O=(0,i.default)({},null);t.PollAdditionalMetadataSpec=O;const I=(0,i.default)({},null);t.KeepInChatSpec=I,h.internalDefaults={status:c.PENDING},h.internalSpec={key:[1,a.FLAGS.REQUIRED|a.TYPES.MESSAGE,s.MessageKeySpec],message:[2,a.TYPES.MESSAGE,o.MessageSpec],messageTimestamp:[3,a.TYPES.UINT64],status:[4,a.TYPES.ENUM,c],participant:[5,a.TYPES.STRING],messageC2STimestamp:[6,a.TYPES.UINT64],ignore:[16,a.TYPES.BOOL],starred:[17,a.TYPES.BOOL],broadcast:[18,a.TYPES.BOOL],pushName:[19,a.TYPES.STRING],mediaCiphertextSha256:[20,a.TYPES.BYTES],multicast:[21,a.TYPES.BOOL],urlText:[22,a.TYPES.BOOL],urlNumber:[23,a.TYPES.BOOL],messageStubType:[24,a.TYPES.ENUM,u],clearMedia:[25,a.TYPES.BOOL],messageStubParameters:[26,a.FLAGS.REPEATED|a.TYPES.STRING],duration:[27,a.TYPES.UINT32],labels:[28,a.FLAGS.REPEATED|a.TYPES.STRING],paymentInfo:[29,a.TYPES.MESSAGE,g],finalLiveLocation:[30,a.TYPES.MESSAGE,o.Message$LiveLocationMessageSpec],quotedPaymentInfo:[31,a.TYPES.MESSAGE,g],ephemeralStartTimestamp:[32,a.TYPES.UINT64],ephemeralDuration:[33,a.TYPES.UINT32],ephemeralOffToOn:[34,a.TYPES.BOOL],ephemeralOutOfSync:[35,a.TYPES.BOOL],bizPrivacyStatus:[36,a.TYPES.ENUM,l],verifiedBizName:[37,a.TYPES.STRING],mediaData:[38,a.TYPES.MESSAGE,S],photoChange:[39,a.TYPES.MESSAGE,T],userReceipt:[40,a.FLAGS.REPEATED|a.TYPES.MESSAGE,A],reactions:[41,a.FLAGS.REPEATED|a.TYPES.MESSAGE,C],quotedStickerData:[42,a.TYPES.MESSAGE,S],futureproofData:[43,a.TYPES.BYTES],statusPsa:[44,a.TYPES.MESSAGE,v],pollUpdates:[45,a.FLAGS.REPEATED|a.TYPES.MESSAGE,P],pollAdditionalMetadata:[46,a.TYPES.MESSAGE,O],agentId:[47,a.TYPES.STRING],statusAlreadyViewed:[48,a.TYPES.BOOL],messageSecret:[49,a.TYPES.BYTES],keepInChat:[50,a.TYPES.MESSAGE,I],originalSelfAuthorUserJidString:[51,a.TYPES.STRING],revokeMessageTimestamp:[52,a.TYPES.UINT64]},g.internalSpec={currencyDeprecated:[1,a.TYPES.ENUM,_],amount1000:[2,a.TYPES.UINT64],receiverJid:[3,a.TYPES.STRING],status:[4,a.TYPES.ENUM,p],transactionTimestamp:[5,a.TYPES.UINT64],requestMessageKey:[6,a.TYPES.MESSAGE,s.MessageKeySpec],expiryTimestamp:[7,a.TYPES.UINT64],futureproofed:[8,a.TYPES.BOOL],currency:[9,a.TYPES.STRING],txnStatus:[10,a.TYPES.ENUM,d],useNoviFiatFormat:[11,a.TYPES.BOOL],primaryAmount:[12,a.TYPES.MESSAGE,o.MoneySpec],exchangeAmount:[13,a.TYPES.MESSAGE,o.MoneySpec]},m.internalSpec={timestamp:[2,a.TYPES.UINT64],unreadChats:[3,a.TYPES.UINT32],notifyMessageCount:[4,a.TYPES.UINT32],notifyMessages:[5,a.FLAGS.REPEATED|a.TYPES.MESSAGE,h]},y.internalSpec={key:[1,a.TYPES.MESSAGE,s.MessageKeySpec],message:[2,a.TYPES.MESSAGE,o.MessageSpec],messageTimestamp:[3,a.TYPES.UINT64],participant:[4,a.TYPES.STRING]},E.internalSpec={labelsDisplay:[1,a.TYPES.ENUM,f],voipIndividualOutgoing:[2,a.TYPES.ENUM,f],groupsV3:[3,a.TYPES.ENUM,f],groupsV3Create:[4,a.TYPES.ENUM,f],changeNumberV2:[5,a.TYPES.ENUM,f],queryStatusV3Thumbnail:[6,a.TYPES.ENUM,f],liveLocations:[7,a.TYPES.ENUM,f],queryVname:[8,a.TYPES.ENUM,f],voipIndividualIncoming:[9,a.TYPES.ENUM,f],quickRepliesQuery:[10,a.TYPES.ENUM,f],payments:[11,a.TYPES.ENUM,f],stickerPackQuery:[12,a.TYPES.ENUM,f],liveLocationsFinal:[13,a.TYPES.ENUM,f],labelsEdit:[14,a.TYPES.ENUM,f],mediaUpload:[15,a.TYPES.ENUM,f],mediaUploadRichQuickReplies:[18,a.TYPES.ENUM,f],vnameV2:[19,a.TYPES.ENUM,f],videoPlaybackUrl:[20,a.TYPES.ENUM,f],statusRanking:[21,a.TYPES.ENUM,f],voipIndividualVideo:[22,a.TYPES.ENUM,f],thirdPartyStickers:[23,a.TYPES.ENUM,f],frequentlyForwardedSetting:[24,a.TYPES.ENUM,f],groupsV4JoinPermission:[25,a.TYPES.ENUM,f],recentStickers:[26,a.TYPES.ENUM,f],catalog:[27,a.TYPES.ENUM,f],starredStickers:[28,a.TYPES.ENUM,f],voipGroupCall:[29,a.TYPES.ENUM,f],templateMessage:[30,a.TYPES.ENUM,f],templateMessageInteractivity:[31,a.TYPES.ENUM,f],ephemeralMessages:[32,a.TYPES.ENUM,f],e2ENotificationSync:[33,a.TYPES.ENUM,f],recentStickersV2:[34,a.TYPES.ENUM,f],recentStickersV3:[36,a.TYPES.ENUM,f],userNotice:[37,a.TYPES.ENUM,f],support:[39,a.TYPES.ENUM,f],groupUiiCleanup:[40,a.TYPES.ENUM,f],groupDogfoodingInternalOnly:[41,a.TYPES.ENUM,f],settingsSync:[42,a.TYPES.ENUM,f],archiveV2:[43,a.TYPES.ENUM,f],ephemeralAllowGroupMembers:[44,a.TYPES.ENUM,f],ephemeral24HDuration:[45,a.TYPES.ENUM,f],mdForceUpgrade:[46,a.TYPES.ENUM,f],disappearingMode:[47,a.TYPES.ENUM,f],externalMdOptInAvailable:[48,a.TYPES.ENUM,f],noDeleteMessageTimeLimit:[49,a.TYPES.ENUM,f]},S.internalSpec={localPath:[1,a.TYPES.STRING]},T.internalSpec={oldPhoto:[1,a.TYPES.BYTES],newPhoto:[2,a.TYPES.BYTES],newPhotoId:[3,a.TYPES.UINT32]},v.internalSpec={campaignId:[44,a.FLAGS.REQUIRED|a.TYPES.UINT64],campaignExpirationTimestamp:[45,a.TYPES.UINT64]},A.internalSpec={userJid:[1,a.FLAGS.REQUIRED|a.TYPES.STRING],receiptTimestamp:[2,a.TYPES.INT64],readTimestamp:[3,a.TYPES.INT64],playedTimestamp:[4,a.TYPES.INT64],pendingDeviceJid:[5,a.FLAGS.REPEATED|a.TYPES.STRING],deliveredDeviceJid:[6,a.FLAGS.REPEATED|a.TYPES.STRING]},C.internalSpec={key:[1,a.TYPES.MESSAGE,s.MessageKeySpec],text:[2,a.TYPES.STRING],groupingKey:[3,a.TYPES.STRING],senderTimestampMs:[4,a.TYPES.INT64],unread:[5,a.TYPES.BOOL]},P.internalSpec={pollUpdateMessageKey:[1,a.TYPES.MESSAGE,s.MessageKeySpec],vote:[2,a.TYPES.MESSAGE,o.Message$PollVoteMessageSpec],senderTimestampMs:[3,a.TYPES.INT64],serverTimestampMs:[4,a.TYPES.INT64]},O.internalSpec={pollInvalidated:[1,a.TYPES.BOOL]},I.internalSpec={keepType:[1,a.TYPES.ENUM,o.KeepType],serverTimestamp:[2,a.TYPES.INT64],key:[3,a.TYPES.MESSAGE,s.MessageKeySpec],deviceJid:[4,a.TYPES.STRING],clientTimestampMs:[5,a.TYPES.INT64],serverTimestampMs:[6,a.TYPES.INT64]}},685357:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEventSampling=function(){return(0,r.getABPropConfigValue)("qpl_sampling_as_string")},t.getInitialUploadDelayInSeconds=function(){return 60*(0,r.getABPropConfigValue)("qpl_initial_upload_delay")},t.getUploadIntervalInSeconds=function(){return 60*(0,r.getABPropConfigValue)("qpl_upload_delay")},t.isQplEnabled=function(){return(0,r.getABPropConfigValue)("qpl_enabled")};var r=n(287461)},605243:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.config=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];s&&!0!==t?__LOG__(3,void 0,void 0,void 0,["qpl"])`QPL Config has already been initialized`:(o=new Map,l=e,_(),s={isQplEnabled:u,uploadInterval:c,getEventDetails:p,uploadDelay:d});return s};var r=n(855034),i=n(786950);const a={sampleRate:0,samplingMethod:r.QplSampleMethod.EVENT_BASED_SAMPLING};r.QplSampleMethod.EVENT_BASED_SAMPLING;let o,s,l;function u(){return l.isQplEnabled()}function c(){return l.getUploadIntervalInSeconds()}function d(){return l.getInitialUploadDelayInSeconds()}function p(e){const t=o.get(e);return t||a}function _(){try{let e=l.getEventSampling();0===e.indexOf("json:")&&(e=e.slice(5));const t=JSON.parse(e);t.sampling.forEach((e=>{const t=e[0],n=e[1],r=Math.max(e[2],0);o.set(t,{sampleRate:r,samplingMethod:n})}))}catch(e){(0,i.errorParsingConfig)(e)}}},786950:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.annotationKeyTooLong=function(e,t,n){if(a++>5)return;new i.default.WebcQplHealth({webcQplHealthEventType:i.default.WEBC_QPL_HEALTH_EVENT_TYPE.ANNOTATION_KEY_TOO_LONG,webcQplHealthEventData:`markerId: ${e}, instanceKey: ${t}, annotationKey: ${n}`}).commit()},t.annotationSizeLimitExceeded=function(e,t,n){if(a++>5)return;new i.default.WebcQplHealth({webcQplHealthEventType:i.default.WEBC_QPL_HEALTH_EVENT_TYPE.ANNOTATION_SIZE_LIMIT_EXCEEDED,webcQplHealthEventData:`markerId: ${e}, instanceKey: ${t}, annotationKey: ${n}`}).commit()},t.errorParsingConfig=function(e){if(a++>5)return;new i.default.WebcQplHealth({webcQplHealthEventType:i.default.WEBC_QPL_HEALTH_EVENT_TYPE.ERROR_PARSING_CONFIG,webcQplHealthEventData:`errorString: ${e}`}).commit()},t.errorUploadingChunk=function(e){if(a++>5)return;new i.default.WebcQplHealth({webcQplHealthEventType:i.default.WEBC_QPL_HEALTH_EVENT_TYPE.ERROR_UPLOADING_CHUNK,webcQplHealthEventData:`errorString: ${e}`}).commit()},t.maxPointCountExceeded=function(e,t){if(a++>5)return;new i.default.WebcQplHealth({webcQplHealthEventType:i.default.WEBC_QPL_HEALTH_EVENT_TYPE.MAX_POINT_COUNT_EXCEEDED,webcQplHealthEventData:`markerId: ${e}, instanceKey: ${t}`}).commit()},t.maxStorageEventCountReached=function(){if(a++>5)return;new i.default.WebcQplHealth({webcQplHealthEventType:i.default.WEBC_QPL_HEALTH_EVENT_TYPE.MAX_STORAGE_EVENT_COUNT_REACHED}).commit()},t.pointDataTooLong=function(e,t,n){if(a++>5)return;new i.default.WebcQplHealth({webcQplHealthEventType:i.default.WEBC_QPL_HEALTH_EVENT_TYPE.POINT_DATA_TOO_LONG,webcQplHealthEventData:`markerId: ${e}, instanceKey: ${t}, data: ${n}`}).commit()},t.pointNameTooLong=function(e,t,n){if(a++>5)return;new i.default.WebcQplHealth({webcQplHealthEventType:i.default.WEBC_QPL_HEALTH_EVENT_TYPE.POINT_NAME_TOO_LONG,webcQplHealthEventData:`markerId: ${e}, instanceKey: ${t}, pointName: ${n}`}).commit()};var i=r(n(571834));let a=0},60287:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.startQPL=function(){(0,i.defaultQplNetwork)({instrumentForJestE2E:false,restInterface:m,isDev:!1,qplAccessToken:p.qplConfigs.accessToken,qplAppId:p.qplConfigs.appId,qplEndpoint:p.qplConfigs.endpoint});const e=(0,l.config)(s);e.isQplEnabled()?(__LOG__(2)`QPL is being initialized`,(0,a.start)({isQplEnabled:e.isQplEnabled,sendEvents:e=>(0,i.defaultQplNetwork)().sendEventsOverNetwork(e),intervalInSeconds:e.uploadInterval(),startDelayInSeconds:e.uploadDelay()},{storageApi:new d.QplStorageApi,healthLogger:g,instrumentForJestE2E:false}),c.QPL.init((e=>((0,o.add)([e]),Promise.resolve())),e.getEventDetails,e.isQplEnabled)):(__LOG__(2)`QPL is disabled, throwing Killswitch, will clear database`,c.QPL.throwKillswitch(!0),c.QPL.clearStorage())};var i=n(40999),a=n(990439),o=n(7901),s=h(n(685357)),l=n(605243),u=h(n(786950)),c=(n(316348),n(555622)),d=n(240963),p=n(497890),_=r(n(794938));function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}function h(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}const g=u;const m={post:_.default.post}},316348:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuickLogMarkerId=void 0;const r=n(76672)({PHOENIX_FDS_IQ_EXECUTION:578499140,WHATSAPP_MESSAGE_INFO_VIEW:701177629,WHATSAPP_FETCH_ASSIGN_CHAT_AGENT_LIST:701183376,WHATSAPP_ASSIGN_CHAT:701185297,WHATSAPP_COLLECTIONS_MANAGEMENT_VIEW:774768970,WHATSAPP_PRODUCT_APPEAL:774769273,WHATSAPP_CATALOG_CREATE:774769395,WHATSAPP_CATALOG_LOAD_MORE:774769641,WHATSAPP_ORDER_VIEW:774769843,WHATSAPP_PROFILE_VIEW:774770248,WHATSAPP_CATALOG_VIEW:774771408,WHATSAPP_PRODUCT_DELETE:774774122,WHATSAPP_CART_VIEW:774774619,WHATSAPP_CART_ADD:774774794,WHATSAPP_PROFILE_SAVE:774775117,WHATSAPP_PRODUCT_VIEW:774775607,WHATSAPP_COLLECTION_APPEAL:774776895,WHATSAPP_PLM_DETAILS_VIEW:774777097,WHATSAPP_COLLECTION_EDIT:774777483,WHATSAPP_ORDER_CREATE:774777518,WHATSAPP_PROFILE_CATS_VIEW:774777556,WHATSAPP_PRODUCT_SET_VISIBLE:774778628,WHATSAPP_PRODUCT_IMAGES_LOAD:774778674,WHATSAPP_PRODUCT_SAVE:774779113,WHATSAPP_PRODUCT_MESSAGE_SEND:774779800,WHATSAPP_COLLECTION_VIEW_ALL:774780089,WHATSAPP_CATALOG_COLLECTIONS_VIEW:774781666,WHATSAPP_PRODUCT_REPORT:774782053,WHATSAPP_COLLECTION_RENAME:774782934,WHATSAPP_WEB_TEST_EVENT:891422769,CHAT_OPEN:891425633,MESSAGE_RENDER:891426174,SYNCD:891431212,OFFLINE_RESUME:891431279,WHATSAPP_PHONE_NUMBER_INSIGHTS_DATA_SUCCESS:891436548,IMAGE_LOAD_LATENCY_THUMBNAIL_SINGLE_COLLECTION_CATEGORIES:897451370,IMAGE_LOAD_LATENCY_THUMBNAIL_CATEGORIES:897451484,IMAGE_LOAD_LATENCY_THUMBNAIL_SINGLE_COLLECTION:897451937,GET_COLLECTIONS:897452074,GET_PRODUCT_LIST:897452238,IMAGE_LOAD_LATENCY_THUMBNAIL_CART:897453112,VERIFY_POSTCODE:897454379,GET_SINGLE_COLLECTION:897454385,GET_SINGLE_COLLECTION_CATEGORIES:897455298,PRODUCT_CATALOG_IMAGE_LOAD:897457242,IMAGE_LOAD_LATENCY_THUMBNAIL_CATALOG_SEARCH:897460087,IMAGE_LOAD_LATENCY_FULLSIZE_PRODUCT:897460107,PLACE_ORDER:897460179,IMAGE_LOAD_LATENCY_THUMBNAIL_PRODUCT_LIST:897460699,REFRESH_CART:897460798,IMAGE_LOAD_LATENCY_THUMBNAIL_CATALOG:897462978,PRODUCT_CATALOG_EVENT:897464127,CATALOG_HOME_PAGE:897464270,GET_CATALOG:897464549,IMAGE_LOAD_LATENCY_THUMBNAIL_COLLECTIONS:897464757,IMAGE_LOAD_LATENCY_THUMBNAIL_SENT_CART:897465374,GET_CATEGORIES:897466143,GET_CATALOG_SEARCH:897466301});t.QuickLogMarkerId=r},555622:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QPL=t.ALLOWLIST_DEV_VERBOSE_LOGGING=void 0;var r=n(264325),i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(786950)),a=n(316348),o=n(240963);function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}const l=i,u=[a.QuickLogMarkerId.WHATSAPP_WEB_TEST_EVENT,a.QuickLogMarkerId.SYNCD,a.QuickLogMarkerId.OFFLINE_RESUME],c=new Map([[a.QuickLogMarkerId.SYNCD,100]]),d=[a.QuickLogMarkerId.WHATSAPP_WEB_TEST_EVENT];t.ALLOWLIST_DEV_VERBOSE_LOGGING=d;const p={cast:e=>a.QuickLogMarkerId.cast(e),getName:e=>a.QuickLogMarkerId.getName(e)};r.QPL.setAllowListDevVerboseLogging(d.map((e=>e))),r.QPL.setStartupAllowListEventFilter(u),r.QPL.setQplReducePrecisionMapMs(c),r.QPL.setStorageApi(new o.QplStorageApi),r.QPL.setHealthLogger(l),r.QPL.setEnumConversion(p),r.QPL.setIsDev(!1);const _={init(e,t,n){r.QPL.init(e,t,n)},clearInstance(){r.QPL.clearInstance()},getInstance:()=>r.QPL.getInstance(),getNextMarkerInstanceValue:e=>r.QPL.getNextMarkerInstanceValue(e),throwKillswitch(e){r.QPL.throwKillswitch(e)},clearStorage(){r.QPL.clearStorage()},logActiveQplMarkers(){r.QPL.logActiveQplMarkers()},markerStart:(e,t)=>r.QPL.markerStart(e,t),markerAnnotate(e,t,n){r.QPL.markerAnnotate(e,t,n)},markerPoint(e,t,n){r.QPL.markerPoint(e,t,n)},markerEnd(e,t,n){r.QPL.markerEnd(e,t,n)},markerDrop(e,t){r.QPL.markerDrop(e,t)},getActiveMarkerIDs:e=>r.QPL.getActiveMarkerIDs(e),getMarker(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return r.QPL.getMarker(e,t)},getMarkerInstances:e=>r.QPL.getMarkerInstances(e)};t.QPL=_},240963:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QplStorageApi=void 0;var r=n(7901);t.QplStorageApi=class{add(e,t){return(0,r.add)(e,t)}getFromBottom(e){return(0,r.getFromBottom)(e)}getRowCount(){return(0,r.rowCount)()}clear(){return(0,r.clear)()}deleteRange(e,t){return(0,r.deleteRange)(e,t)}}},497890:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.qplConfigs=void 0;const n={accessToken:"1063127757113399|745146ffa34413f9dbb5469f5370b7af",appId:"167028690535322",endpoint:"https://graph.whatsapp.net/wa_qpl_data"};t.qplConfigs=n},650809:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.qplPointCartView=function(e){i.QPL.markerPoint(r.QuickLogMarkerId.WHATSAPP_CART_VIEW,e)},t.qplPointOrderCreate=function(e){i.QPL.markerPoint(r.QuickLogMarkerId.WHATSAPP_ORDER_CREATE,e)},t.qplPointOrderView=function(e){i.QPL.markerPoint(r.QuickLogMarkerId.WHATSAPP_ORDER_VIEW,e)},t.qplPointPLMDetailsView=function(e){i.QPL.markerPoint(r.QuickLogMarkerId.WHATSAPP_PLM_DETAILS_VIEW,e)},t.qplPointProductView=function(e){i.QPL.markerPoint(r.QuickLogMarkerId.WHATSAPP_PRODUCT_VIEW,e)},t.qplPointProfileCatsView=function(e){i.QPL.markerPoint(r.QuickLogMarkerId.WHATSAPP_PROFILE_CATS_VIEW,e)},t.qplPointProfileSave=function(e){i.QPL.markerPoint(r.QuickLogMarkerId.WHATSAPP_PROFILE_SAVE,e)};var r=n(316348),i=n(555622)},643841:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.WAWebCollectionVersionStore=void 0;var i=r(n(81109)),a=n(76469);class o{get(e){return(0,a.getCollectionVersionTable)().get(e)}bulkGet(e){return(0,a.getCollectionVersionTable)().bulkGet(e)}getAll(){return(0,a.getCollectionVersionTable)().all()}update(e,t){return(0,a.getCollectionVersionTable)().createOrMerge(e,(0,i.default)({collection:e},t))}bulkUpdate(e){return(0,a.getCollectionVersionTable)().bulkCreateOrMerge(e)}clear(){return(0,a.getCollectionVersionTable)().clear()}}t.WAWebCollectionVersionStore=o,o.locks=["collection-version"]},92991:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.WAWebMissingKeyStore=void 0;var i=n(76469),a=r(n(543465));class o{getAll(){return a.default.getAllMissingKeys()}bulkGet(e){return a.default.bulkGetMissingKeys(e)}count(){return a.default.getMissingKeyCount()}bulkUpdate(e){return a.default.createOrUpdateMissingKeys(e)}bulkRemove(e){return a.default.bulkRemoveMissingKeys(e)}clear(){return(0,i.getMissingKeysTable)().clear()}}t.WAWebMissingKeyStore=o,o.locks=["missing-keys"]},954978:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.WAWebPendingMutationStore=void 0;var i=r(n(348926)),a=n(76469),o=n(257383),s=r(n(543465));class l{getByCollection(e){return(0,i.default)((function*(){return(yield s.default.getPendingMutationsRows(["collection"],e)).map(o.convertToPendingMutationFromRow)}))()}getAll(){return s.default.getAllPendingMutationsRows()}bulkCreate(e){return s.default.appendPendingMutationsRows(e).then((()=>{}))}bulkRemove(e){return s.default.bulkRemovePendingMutations(e)}clear(){return(0,a.getPendingMutationsTable)().clear()}}t.WAWebPendingMutationStore=l,l.locks=["pending-mutations"]},114703:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.WAWebSyncActionStore=void 0;var i=r(n(348926)),a=n(76469),o=n(516934),s=r(n(543465));class l{count(){return(0,a.getSyncActionsTable)().count()}get(e){return(0,i.default)((function*(){const t=yield s.default.getSyncAction(e);return null==t?null:(0,o.convertToSyncActionFromRow)(t)}))()}getByCollections(e){return(0,i.default)((function*(){return(yield s.default.getSyncActionsRows(["collection"],e.map((e=>e)))).map(o.convertToSyncActionFromRow)}))()}getByIndexMacs(e){return(0,i.default)((function*(){return(yield s.default.getSyncActionsRows(["indexMac"],e.map((e=>e)))).map(o.convertToSyncActionFromRow)}))()}getByActionStates(e){return(0,i.default)((function*(){return(yield s.default.getSyncActionsRows(["actionState"],e.map((e=>e)))).map(o.convertToSyncActionFromRow)}))()}getByModelInfos(e){return(0,i.default)((function*(){return(yield s.default.getSyncActionsRows(["modelId","modelType","actionState"],e.map((e=>e)))).map(o.convertToSyncActionFromRow)}))()}getAll(){return(0,a.getSyncActionsTable)().all().then((e=>e.map(o.convertToSyncActionFromRow)))}bulkSet(e){return s.default.setSyncActionRows(e.map(o.convertFromSyncActionToRow))}bulkUpdate(e){return s.default.updateSyncActionRows(e.map(o.convertFromSyncActionToRow))}bulkRemove(e){return s.default.deleteSyncActionRows(e)}clear(){return(0,a.getSyncActionsTable)().clear()}}t.WAWebSyncActionStore=l,l.locks=["sync-actions"]},350616:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.WAWebSyncKeyStore=void 0;var i=n(76469),a=r(n(543465));class o{get(e){return a.default.getSyncKey(e)}getAll(){return a.default.getAllSyncKeys()}set(e){return a.default.createSyncKey(e).then((()=>{}))}expire(e){return a.default.expireSyncKey(e)}clear(){return(0,i.getSyncKeysTable)().clear()}}t.WAWebSyncKeyStore=o,o.locks=["sync-keys"]},828770:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.PLATFORMS=void 0,t.getMobilePlatform=function(){null==s&&__LOG__(4,void 0,new Error)`Failed to get primary platform`;return s},t.isSMB=function(){return s===o.SMBA||s===o.SMBI},t.setMobilePlatform=function(){return l.apply(this,arguments)};var i=r(n(348926)),a=n(757453);const o={ANDROID:"android",IPAD:"ipad",IPHONE:"iphone",SMBA:"smba",SMBI:"smbi"};let s;function l(){return(l=(0,i.default)((function*(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t&&(yield(0,a.setLastMobilePlatform)(e)),s=e,__LOG__(2)`Successfully writes platform to UserPrefs, platform: ${e}`}))).apply(this,arguments)}t.PLATFORMS=o},862159:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.REMOVE_REASON=t.GroupType=t.GROUP_ACTIONS=t.DELETE_REASON=t.ADD_REASON=void 0,t.getGroupTypeFromGroupMetadata=function(e){if(!0===e.defaultSubgroup)return u.DEFAULT_ANNOUNCEMENT_GROUP;if(null!=e.parentGroup)return u.SUBGROUP;if(!0===e.isParentGroup)return u.COMMUNITY;return u.DEFAULT},t.groupTypeToWamEnum=function(e){switch(e){case u.DEFAULT_ANNOUNCEMENT_GROUP:return i.default.TYPE_OF_GROUP_ENUM.DEFAULT_SUBGROUP;case u.SUBGROUP:return i.default.TYPE_OF_GROUP_ENUM.SUBGROUP;default:return i.default.TYPE_OF_GROUP_ENUM.GROUP}};var i=r(n(571834));const a=Object.freeze({SUBJECT:"subject",ADD:"add",PROMOTE:"promote",DEMOTE:"demote",DELETE:"delete",REMOVE:"remove",MODIFY:"modify",INVITE_CODE:"invite",DESC_ADD:"desc_add",DESC_REMOVE:"desc_remove",RESTRICT:"restrict",ANNOUNCE:"announce",NO_FORWARD:"no_frequently_forwarded",EPHEMERAL:"ephemeral",REVOKE_INVITE:"revoke_invite",SUSPEND:"suspend",GROWTH_LOCKED:"growth_locked",GROWTH_UNLOCKED:"growth_unlocked",SUB_GROUP_LINK:"sub_group_link",PARENT_GROUP_LINK:"parent_group_link",PARENT_GROUP_LINK_MEMBERSHIP_APPROVAL:"parent_group_link_membership_approval",SIBLING_GROUP_LINK:"sibling_group_link",SUB_GROUP_UNLINK:"sub_group_unlink",PARENT_GROUP_UNLINK:"parent_group_unlink",SIBLING_GROUP_UNLINK:"sibling_group_unlink",DELETE_PARENT_GROUP:"delete_parent_group",DELETE_PARENT_GROUP_UNLINK:"delete_parent_group_unlink",DELETE_PARENT_SUB_GROUP_UNLINK:"delete_parent_sub_group_unlink",INTEGRITY_PARENT_GROUP_UNLINK:"integrity_parent_group_unlink",INTEGRITY_SUB_GROUP_UNLINK:"integrity_sub_group_unlink",LINKED_GROUP_PROMOTE:"linked_group_promote",LINKED_GROUP_DEMOTE:"linked_group_demote",MEMBERSHIP_APPROVAL_MODE:"membership_approval_mode",MEMBERSHIP_APPROVAL_REQUEST:"membership_approval_request",REVOKED_MEMBERSHIP_REQUESTS:"revoked_membership_requests"});t.GROUP_ACTIONS=a;const o=Object.freeze({INTEGRITY_DELETE_PARENT:"integrity_delete_parent",DELETE_PARENT:"delete_parent"});t.DELETE_REASON=o;const s=Object.freeze({INVITE:"invite",LINKED_GROUP_JOIN:"linked_group_join",AUTO_ADD:"auto_add",DEFAULT_SUBGROUP_ADMIN_ADD:"default_subgroup_admin_add",DEFAULT_SUBGROUP_PROMOTE:"default_sub_group_promote",INVITE_AUTO_ADD:"invite_auto_add"});t.ADD_REASON=s;const l=Object.freeze({DEFAULT_SUBGROUP_DEMOTE:"default_sub_group_demote"});t.REMOVE_REASON=l;const u=n(76672).Mirrored(["DEFAULT","COMMUNITY","SUBGROUP","DEFAULT_ANNOUNCEMENT_GROUP"]);t.GroupType=u},687352:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LeaveReason=void 0;const r=n(76672).Mirrored(["Left","Removed"]);t.LeaveReason=r},130207:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RequestMethod=void 0;const r=n(76672).Mirrored(["InviteLink","LinkedGroupJoin"]);t.RequestMethod=r},567472:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.copyNoiseInfoValuesToCacheStorage=function(){const e=[],t=o.default.getItemFromLocalStorage(a.MD_KEYS.NOISE_INFO);null!=t&&e.push({key:a.MD_NOISE_KEYS.NOISE_INFO,value:t});const n=o.default.getItemFromLocalStorage(a.MD_KEYS.NOISE_INFO_IV);null!=n&&e.push({key:a.MD_NOISE_KEYS.NOISE_INFO_IV,value:n});const r=o.default.getItemFromLocalStorage(a.MD_KEYS.WEB_ENC_SALT);null!=r&&(e.push({key:a.MD_NOISE_KEYS.WEB_ENC_SALT,value:r}),o.default.setItemToLocalStorage(a.MD_NOISE_KEYS.WEB_ENC_SALT,r));return i.userPrefsCacheStorage.bulkSetItemsToCacheStorage(e)};var i=n(840928),a=n(94872),o=r(n(98165))},102461:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.userPreferencesStoreBase=t.UserPreferencesStoreBase=void 0;var i=r(n(236642)),a=n(94872),o=r(n(933173));const s=[a.KEYS.WHATSAPP_MUTEX,a.KEYS.OLD_LOGOUT_CREDS,a.KEYS.PRESERVED_USER_KEYS,a.MD_KEYS.ROUTING_INFO,a.MD_KEYS.INITIAL_HISTORY_SYNCED,a.MD_KEYS.WEB_ENC_SALT,a.MD_KEYS.CRITICAL_DATA_SYNCED],l=!1,u=!1,c=!0;class d{getStorage(){return i.default}_determineStorage(e){return s.includes(e)?i.default:this.getStorage()}get(e,t){var n;if(null==e)throw new Error("UserPreferencesStoreBase.get called with no key");const r=null!==(n=null==t?void 0:t.storage)&&void 0!==n?n:this._determineStorage(e),i=null==(null==t?void 0:t.ignoreCache)?u:t.ignoreCache,a=r.getItem(e,i);if((null==(null==t?void 0:t.isRawString)?l:t.isRawString)||null==a)return a;try{return JSON.parse(a,o.default)}catch(t){return __LOG__(2,void 0,void 0,!0)`UserPreferencesStoreBase.get(${e}) '${t}' ${a}`,SEND_LOGS("userprefs-parse-error"),void r.removeItem(e)}}set(e,t,n){var r;if(null==e)throw new Error("UserPreferencesStoreBase.set called with no key");const i=null!==(r=null==n?void 0:n.storage)&&void 0!==r?r:this._determineStorage(e);if(null==t)i.removeItem(e);else{if(null==(null==n?void 0:n.isRawString)?l:n.isRawString){if("string"!=typeof t)throw new Error("UserPreferencesStoreBase.set: expecting string because isRawString is true");i.setItem(e,t)}else{const r=null==(null==n?void 0:n.shouldWriteToIdb)?c:n.shouldWriteToIdb;i.setItem(e,JSON.stringify(t),r)}}}getRememberMe(){return!0}}t.UserPreferencesStoreBase=d;const p=new d;t.userPreferencesStoreBase=p},840928:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.userPrefsCacheStorage=void 0;var i=r(n(348926)),a=r(n(630884)),o=n(599225),s=n(3973);const l=new a.default("wa_web_user_prefs_cache_store",(function(e){return new Response(JSON.stringify(e),{headers:{"content-type":"application/json"}})}),(function(e){return e.json()}),{encodeKey:function(e,t){const n=encodeURIComponent(e);return`https://_user_prefs_key_store_.whatsapp.com/${encodeURIComponent(t)}_${n}`},matchOptions:{ignoreSearch:!0,ignoreMethod:!0,ignoreVary:!0}});const u=new class{constructor(){this._cachedCacheStorageValues={}}setItemToCacheStorage(e,t){var n=this;return(0,i.default)((function*(){const r=(0,s.preProcessUserPref)(e,t);n._cachedCacheStorageValues[e]=r,yield l.doPut(e,r)}))()}getItemFromCacheStorage(e){var t=this;return(0,i.default)((function*(){let n=t._cachedCacheStorageValues[e];if(null==n)try{n=yield l.doGet(e),t._cachedCacheStorageValues[e]=n}catch(e){}if(null==n)return t.removeItemFromCacheStorage(e),null;return(0,o.postProcessUserPref)(e,n)}))()}removeItemFromCacheStorage(e){var t=this;return(0,i.default)((function*(){delete t._cachedCacheStorageValues[e],yield l.doDel(e)}))()}clearCacheStorage(){var e=this;return(0,i.default)((function*(){e._cachedCacheStorageValues={},yield l.doClear()}))()}bulkSetItemsToCacheStorage(e){var t=this;return(0,i.default)((function*(){const n=e.map((e=>t.setItemToCacheStorage(e.key,e.value)));yield Promise.all(n)}))()}};t.userPrefsCacheStorage=u},725137:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.clearAllLocalState=function(){return f.apply(this,arguments)},t.clearAllTemporaryStorageData=function(){s.default.clear(_())};var i=r(n(348926)),a=n(591547),o=r(n(236642)),s=r(n(737065)),l=n(248877),u=n(94872),c=n(53575),d=n(128378);function p(){var e;const t=null!==(e=c.userPreferencesStore.get(u.KEYS.PRESERVED_USER_KEYS,{storage:o.default}))&&void 0!==e?e:[],n=[...d.LS_PRESERVE_KEYS,...t];return c.userPreferencesStore.getKeys(o.default,n,!0)}function _(){return c.userPreferencesStore.getKeys(s.default,d.TS_PRESERVE_KEYS,!0)}function f(){return(f=(0,i.default)((function*(){const e=p(),t=[s.default.clear(_()),o.default.clear(e)];t.push(a.Logger.clearLogs()),(0,l.clearCookies)(),yield Promise.all(t)}))).apply(this,arguments)}},248877:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clearCookies=function(){if((0,o.isWorker)())return;i.setCookie({name:"ref",expirationDate:0,domain:r.COOKIE_DOMAIN,path:a.PP_REF}),i.setCookie({name:"tok",expirationDate:0,domain:r.COOKIE_DOMAIN,path:a.PP_TOK})},t.setRefTokCookies=function(e,t){if((0,o.isWorker)())return;i.setCookie({name:"ref",value:e,path:a.PP_REF,domain:r.COOKIE_DOMAIN,secure:!0}),i.setCookie({name:"tok",value:t,path:a.PP_TOK,domain:r.COOKIE_DOMAIN,secure:!0})};var r=n(247451),i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(639899)),a=n(476314),o=n(755985);function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}},757453:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.clearTokens=function(){_.forEach((e=>{d.userPreferencesStore.set(e,void 0)}))},t.deleteComposeContents=function(e){d.userPreferencesStore.clearUserSessionItem(S(e))},t.getAutoDownloadAudio=function(){var e;return null===(e=d.userPreferencesStore.getUser(c.KEYS.AUTO_DOWNLOAD_AUDIO))||void 0===e||e},t.getAutoDownloadDocuments=function(){var e;return null!==(e=d.userPreferencesStore.getUser(c.KEYS.AUTO_DOWNLOAD_DOCUMENTS))&&void 0!==e&&e},t.getAutoDownloadPhotos=function(){var e;return null===(e=d.userPreferencesStore.getUser(c.KEYS.AUTO_DOWNLOAD_PHOTOS))||void 0===e||e},t.getAutoDownloadVideos=function(){var e;return null!==(e=d.userPreferencesStore.getUser(c.KEYS.AUTO_DOWNLOAD_VIDEOS))&&void 0!==e&&e},t.getBrowserId=function(){return d.userPreferencesStore.get(c.KEYS.BROWSER_ID)},t.getComposeContents=function(e){return d.userPreferencesStore.getUserSession(S(e))},t.getContactChecksum=function(){return d.userPreferencesStore.getUser(c.KEYS.CONTACT_CHECKSUM)},t.getDailyStatsStartTime=A,t.getGroupParticipantAssignedColor=function(e){return d.userPreferencesStore.getUser(c.KEYS.GROUP_ASSIGNED_COLOR+"-"+e.toString())},t.getLastChatMuteDuration=function(){return d.userPreferencesStore.getUser(c.KEYS.LAST_CHAT_MUTE_DURATION)},t.getLastComposeBoxPanel=function(){return d.userPreferencesStore.getUser(c.KEYS.LAST_SELECTED_COMPOSE_BOX_PANEL)},t.getLastMobilePlatform=function(){return u.userPrefsIndexedDBStorage.getItemFromIndexedDB(c.BACKEND_ONLY_KEYS.MOBILE_PLATFORM)},t.getLastStatusUsage=function(){return d.userPreferencesStore.getUser(c.KEYS.LAST_STATUS_USAGE)},t.getLoginTokens=h,t.getNoticeBannerClosedAt=function(){return d.userPreferencesStore.getUser(c.KEYS.NOTICE_BANNER_CLOSED_AT)},t.getNoticeId=function(){return d.userPreferencesStore.getUser(c.KEYS.NOTICE_ID)},t.getOldLogoutCreds=function(){return d.userPreferencesStore.get(c.KEYS.OLD_LOGOUT_CREDS,{storage:s.default})||[]},t.getPersistentExpiringId=function(){return d.userPreferencesStore.getUser(c.KEYS.PERSISTENT_EXPIRING_ID)},t.getPnhCagFutureproofBannerClosed=function(){return d.userPreferencesStore.getUser(c.KEYS.PNH_CAG_FUTURE_PROOF_BANNER_CLOSED)},t.getPostcodeAutoOpenChangePostcodeCount=function(){return d.userPreferencesStore.getUser(c.KEYS.POSTCODE_AUTO_OPEN_CHANGE_POSTCODE_COUNT)},t.getPostcodeAutoOpenChangePostcodeDone=function(){return!!d.userPreferencesStore.getUser(c.KEYS.POSTCODE_AUTO_OPEN_CHANGE_POSTCODE_DONE)},t.getPostcodeTooltipViewCount=function(){return d.userPreferencesStore.getUser(c.KEYS.POSTCODE_TOOLTIP_VIEW_COUNT)},t.getPostcodeTooltipViewedInSession=function(){return!!d.userPreferencesStore.getUser(c.KEYS.POSTCODE_TOOLTIP_VIEWED_IN_SESSION)},t.getPrimaryFeatures=function(){var e;return null!==(e=d.userPreferencesStore.get(c.KEYS.PRIMARY_FEATURES))&&void 0!==e?e:[]},t.getPsKillSwitchToken=function(){return d.userPreferencesStore.get(c.KEYS.PS_KILLSWITCH_TOKEN)},t.getPttPlaybackRate=function(){var e;return null!==(e=d.userPreferencesStore.get(c.KEYS.PTT_PLAYBACK_RATE))&&void 0!==e?e:1},t.getPushname=function(){return d.userPreferencesStore.getUser(c.KEYS.LAST_PUSHNAME)},t.getSeenGroupDesc=function(e){return d.userPreferencesStore.getUser(e.toString())},t.getShouldPreemptivelyCleanupLogs=function(){if(p.PROD_KEYS){return!1!==d.userPreferencesStore.get(p.PROD_KEYS.LOG_PREEMPT_CLEAN_UP)}return!1},t.getSmbLabelPalette=function(){return d.userPreferencesStore.getUser(c.KEYS.SMB_LABEL_COLOR_PALETTE)},t.getStorageAlert=function(){return o.STORAGE_ALERT_TYPE.NO_ALERT},t.getStorageDismissState=function(){return{lowQuotaDismissed:!0,highQuotaDismissed:!0}},t.getSystemThemeMode=function(){var e;return null===(e=d.userPreferencesStore.get(c.KEYS.SYSTEM_THEME_MODE))||void 0===e||e},t.getTheme=function(){return d.userPreferencesStore.get(c.KEYS.THEME)},t.getUnknownId=function(){let e=d.userPreferencesStore.get(c.KEYS.UNKNOWN_ID);e||(e="unknown"+Math.floor(1e10*Math.random()),g(e));return e},t.getUnreadMentionCountEnabled=function(){return d.userPreferencesStore.get(c.KEYS.UNREAD_MENTION_COUNT_ENABLED)},t.getUserPrivacySettings=function(){var e;return null!==(e=d.userPreferencesStore.getUser(c.KEYS.USER_PRIVACY_SETTINGS))&&void 0!==e?e:{}},t.getVerifiedBusinessNameIsCleaned=function(){return!0===d.userPreferencesStore.getUser(c.KEYS.VERIFIED_BUSINESS_NAME_IS_CLEANED)},t.getVersion=function(){return d.userPreferencesStore.get(c.KEYS.PROTO_VERSION)},t.getVideoVolumeSettings=function(){return{volume:d.userPreferencesStore.get(c.KEYS.VIDEO_VOLUME),muted:!!d.userPreferencesStore.get(c.KEYS.VIDEO_MUTE)}},t.initDailyStatsStartTime=function(){A()},t.knowsPhone=function(){const e=h();return!(!e.client||!e.server)},t.markUserSentMessageToChat=function(e){const t=T(e);let n=d.userPreferencesStore.getUser(c.KEYS.CHATS_USER_SENT_MESSAGE_TO)||[];if(!Array.isArray(n))return __LOG__(3)`UserPrefs:markUserSentMessageToChat value in store is not an array`,d.userPreferencesStore.setUser(c.KEYS.CHATS_USER_SENT_MESSAGE_TO,[t]),!1;n=v(n);const r=!n.includes(t);r&&(n.push(t),d.userPreferencesStore.setUser(c.KEYS.CHATS_USER_SENT_MESSAGE_TO,n));return __LOG__(2)`UserPrefs:markUserSentMessageToChat`,r},t.markVerifiedBusinessNameIsCleaned=function(){d.userPreferencesStore.setUser(c.KEYS.VERIFIED_BUSINESS_NAME_IS_CLEANED,!0)},t.removeUserSentMessageToChat=function(e){let t=d.userPreferencesStore.getUser(c.KEYS.CHATS_USER_SENT_MESSAGE_TO)||[];if(!Array.isArray(t))return __LOG__(3)`UserPrefs:removeUserSentMessageToChat value in store is not an array`,void d.userPreferencesStore.setUser(c.KEYS.CHATS_USER_SENT_MESSAGE_TO,[]);t=v(t);const n=T(e);t.includes(n)&&d.userPreferencesStore.setUser(c.KEYS.CHATS_USER_SENT_MESSAGE_TO,(0,a.default)(t,n));__LOG__(2)`UserPrefs:removeUserSentMessageToChat`},t.setAutoDownloadAudio=function(e){d.userPreferencesStore.setUser(c.KEYS.AUTO_DOWNLOAD_AUDIO,e)},t.setAutoDownloadDocuments=function(e){d.userPreferencesStore.setUser(c.KEYS.AUTO_DOWNLOAD_DOCUMENTS,e)},t.setAutoDownloadPhotos=function(e){d.userPreferencesStore.setUser(c.KEYS.AUTO_DOWNLOAD_PHOTOS,e)},t.setAutoDownloadVideos=function(e){d.userPreferencesStore.setUser(c.KEYS.AUTO_DOWNLOAD_VIDEOS,e)},t.setBrowserId=function(e){d.userPreferencesStore.set(c.KEYS.BROWSER_ID,e)},t.setComposeContents=function(e,t){d.userPreferencesStore.setUserSession(S(e),t)},t.setContactChecksum=function(e){d.userPreferencesStore.setUser(c.KEYS.CONTACT_CHECKSUM,e)},t.setGroupParticipantAssignedColor=function(e,t){d.userPreferencesStore.setUser(c.KEYS.GROUP_ASSIGNED_COLOR+"-"+e.toString(),t)},t.setLastChatMuteDuration=function(e){d.userPreferencesStore.setUser(c.KEYS.LAST_CHAT_MUTE_DURATION,e)},t.setLastComposeBoxPanel=function(e){d.userPreferencesStore.setUser(c.KEYS.LAST_SELECTED_COMPOSE_BOX_PANEL,e)},t.setLastMobilePlatform=function(){return m.apply(this,arguments)},t.setLastStatusUsage=function(){d.userPreferencesStore.setUser(c.KEYS.LAST_STATUS_USAGE,Date.now())},t.setLoginTokens=function(e){const t=e.client,n=e.server;t&&n&&(__LOG__(2)`UserPrefs:setLoginTokens`,d.userPreferencesStore.set(c.KEYS.CLIENT_TOKEN,t),d.userPreferencesStore.set(c.KEYS.SERVER_TOKEN,n))},t.setNoticeBannerClosedAt=function(e){d.userPreferencesStore.setUser(c.KEYS.NOTICE_BANNER_CLOSED_AT,e)},t.setNoticeId=function(e){d.userPreferencesStore.setUser(c.KEYS.NOTICE_ID,e)},t.setOldLogoutCreds=function(e){d.userPreferencesStore.set(c.KEYS.OLD_LOGOUT_CREDS,e,{storage:s.default})},t.setPersistentExpiringId=function(e){d.userPreferencesStore.setUser(c.KEYS.PERSISTENT_EXPIRING_ID,e)},t.setPnhCagFutureproofBannerClosed=function(){d.userPreferencesStore.setUser(c.KEYS.PNH_CAG_FUTURE_PROOF_BANNER_CLOSED,!0)},t.setPostcodeAutoOpenChangePostcodeCount=function(e){d.userPreferencesStore.setUser(c.KEYS.POSTCODE_AUTO_OPEN_CHANGE_POSTCODE_COUNT,e)},t.setPostcodeAutoOpenChangePostcodeDone=function(e){d.userPreferencesStore.setUser(c.KEYS.POSTCODE_AUTO_OPEN_CHANGE_POSTCODE_DONE,e)},t.setPostcodeTooltipViewCount=function(e){d.userPreferencesStore.setUser(c.KEYS.POSTCODE_TOOLTIP_VIEW_COUNT,e)},t.setPostcodeTooltipViewedInSession=function(e){d.userPreferencesStore.setUser(c.KEYS.POSTCODE_TOOLTIP_VIEWED_IN_SESSION,e)},t.setPrimaryFeatures=function(e){d.userPreferencesStore.set(c.KEYS.PRIMARY_FEATURES,e)},t.setPsKillSwitchToken=function(e){d.userPreferencesStore.set(c.KEYS.PS_KILLSWITCH_TOKEN,e)},t.setPttPlaybackRate=function(e){d.userPreferencesStore.set(c.KEYS.PTT_PLAYBACK_RATE,e)},t.setPushname=function(e){d.userPreferencesStore.setUser(c.KEYS.LAST_PUSHNAME,e)},t.setRefTok=function(e,t){f.forEach((function(e){s.default.removeItem(e)})),(0,l.setRefTokCookies)(e,t)},t.setSeenGroupDesc=function(e){d.userPreferencesStore.setUser(e.toString(),!0)},t.setShouldPreemptivelyCleanupLogs=function(e){p.PROD_KEYS&&d.userPreferencesStore.set(p.PROD_KEYS.LOG_PREEMPT_CLEAN_UP,e)},t.setSmbLabelPalette=function(e){d.userPreferencesStore.set(c.KEYS.SMB_LABEL_COLOR_PALETTE,e)},t.setStorageAlert=function(){},t.setStorageDismissState=function(){},t.setSystemThemeMode=function(e){d.userPreferencesStore.set(c.KEYS.SYSTEM_THEME_MODE,e)},t.setTheme=function(e){d.userPreferencesStore.set(c.KEYS.THEME,e)},t.setUnknownId=g,t.setUnreadMentionCountEnabled=function(e){d.userPreferencesStore.set(c.KEYS.UNREAD_MENTION_COUNT_ENABLED,e)},t.setUserPrivacySettings=function(e){d.userPreferencesStore.setUser(c.KEYS.USER_PRIVACY_SETTINGS,e)},t.setVersion=function(e){null!=e&&d.userPreferencesStore.set(c.KEYS.PROTO_VERSION,e)},t.setVideoMutedSetting=E,t.setVideoVolumeSetting=y,t.setVideoVolumeSettings=function(e,t){y(e),E(t)};var i=r(n(348926)),a=r(n(82569)),o=n(107737),s=r(n(236642)),l=n(248877),u=n(409847),c=n(94872),d=n(53575),p=n(575525);const _=[c.KEYS.CLIENT_TOKEN,c.KEYS.SERVER_TOKEN],f=[c.KEYS.VERSION];function h(){return{client:d.userPreferencesStore.get(c.KEYS.CLIENT_TOKEN),server:d.userPreferencesStore.get(c.KEYS.SERVER_TOKEN)}}function g(e){return d.userPreferencesStore.set(c.KEYS.UNKNOWN_ID,e)}function m(){return(m=(0,i.default)((function*(e){null!=e&&(yield u.userPrefsIndexedDBStorage.setItemToIndexedDB(c.BACKEND_ONLY_KEYS.MOBILE_PLATFORM,e))}))).apply(this,arguments)}function y(e){d.userPreferencesStore.set(c.KEYS.VIDEO_VOLUME,e)}function E(e){d.userPreferencesStore.set(c.KEYS.VIDEO_MUTE,e)}function S(e){return`${c.KEYS.COMPOSE_CONTENTS_PREFIX}${e.toString()}`}function T(e){return(e.toString()||"").replace("@","_")}function v(e){if(e.some((e=>e.endsWith("_")))){const t=e.map((e=>e.replace(/_$/,"").replace("@","_")));return d.userPreferencesStore.setUser(c.KEYS.CHATS_USER_SENT_MESSAGE_TO,t),t}return e}function A(){const e=d.userPreferencesStore.get(c.KEYS.DAILY_STATS_START_TIME);if("number"==typeof e)return e;const t=Date.now();return d.userPreferencesStore.set(c.KEYS.DAILY_STATS_START_TIME,t),t}},65410:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.waNoiseInfo=t.deviceInfo=void 0;var i=r(n(348926)),a=n(417405),o=n(551168),s=n(359987),l=(n(780549),n(403206)),u=n(436005),c=r(n(932325)),d=n(804334),p=n(332108),_=(n(97858),n(226562),n(673168));const f=new class{get(){return{osVersion:"0.1",osBuild:"0.1",hardware:"desktop",manufacturer:"",device:"Desktop",lg:c.default.getLanguage(),lc:c.default.getRegion()||"",mcc:"000",mnc:"000",sim_mnc:"000",sim_mcc:"000"}}};t.deviceInfo=f;const h="AES-GCM",g="PBKDF2";const m=new class{constructor(){this.cachedPasscodeDerivedKey=null}get(){var e=this;return(0,i.default)((function*(){let t=(0,_.getNoiseInfo)();if(!t)return null;const n=e._getIv();return n?(t=yield e._decryptAllNoiseData(t,n),e._isStaticKeyPairValid(t)?t:(__LOG__(2,void 0,void 0,void 0,["info_store"])`Decrypted noise key was invalid.`,null)):null}))()}set(e){var t=this;return(0,i.default)((function*(){const n=new Uint8Array(48);self.crypto.getRandomValues(n);const r=t._processIv(n);return yield t._setIv(r),e.recoveryToken=yield t._encryptNoiseData(e.recoveryToken,r[0]),e.staticKeyPair.pubKey=yield t._encryptNoiseData(e.staticKeyPair.pubKey,r[1]),e.staticKeyPair.privKey=yield t._encryptNoiseData(e.staticKeyPair.privKey,r[2]),(0,_.setNoiseInfo)(e)}))()}_setIv(e){return(0,_.setNoiseInfoIv)(e.map(a.encodeB64))}_getIv(){const e=(0,_.getNoiseInfoIv)();return e?e.map((e=>new Uint8Array((0,a.decodeB64)(e)))):null}_processIv(e){const t=new o.Binary(e);return[t.readByteArray(16),t.readByteArray(16),t.readByteArray(16)]}_encryptNoiseData(e,t){return(0,i.default)((function*(){const n=u.DbEncKeyStore.getEncKeys()[0];return yield self.crypto.subtle.encrypt({iv:t,name:"AES-CBC"},n.key,e)}))()}_decryptAllNoiseData(e,t){var n=this;return(0,i.default)((function*(){return e.recoveryToken=yield n._decryptNoiseData(e.recoveryToken,t[0]),e.staticKeyPair.pubKey=yield n._decryptNoiseData(e.staticKeyPair.pubKey,t[1]),e.staticKeyPair.privKey=yield n._decryptNoiseData(e.staticKeyPair.privKey,t[2]),e}))()}_decryptNoiseData(e,t){return(0,i.default)((function*(){const n=u.DbEncKeyStore.getEncKeys()[0];return yield self.crypto.subtle.decrypt({iv:t,name:"AES-CBC"},n.key,e)}))()}_isStaticKeyPairValid(e){let t=!0;try{const n=new Uint8Array((0,l.keyPair)(e.staticKeyPair.privKey).pubKey),r=new Uint8Array(e.staticKeyPair.pubKey);for(let e=0;e<n.length;e++)if(n[e]!==r[e]){t=!1;break}}catch(e){__LOG__(2,void 0,void 0,void 0,["info_store"])`Decrypted noise key failed validation.`,t=!1}return t}lockNoiseInfo(e){var t=this;return(0,i.default)((function*(){const n=yield t.deriveKeyFromPasscode(e);t.createScreenLockIv();const r=yield t.get();if(!r||!r.staticKeyPair)return!1;const{recoveryToken:i,staticKeyPair:{pubKey:a,privKey:o}}=r;try{const e=yield Promise.all([i,a,o].map((e=>t.encryptNoiseWithPasscodeDerivedKey(e,n))));if(e[0]&&e[1]&&e[2])return yield t.set({recoveryToken:e[0],staticKeyPair:{pubKey:e[1],privKey:e[2]}}),!0}catch(e){}return!1}))()}passcodeUnlockNoiseInfo(e){var t=this;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,i.default)((function*(){let r;if(null==t.cachedPasscodeDerivedKey){let e;e=n?yield d.LockScreenResolvable.waitForPasscodeAfterIncorrectAttempt():yield d.LockScreenResolvable.waitForPasscode(),r=yield t.deriveKeyFromPasscode(e)}else r=t.cachedPasscodeDerivedKey;const i=yield t.getUnlockedNoiseInfo(e,r);return i&&t._isStaticKeyPairValid(i)?(d.LockScreenResolvable.correctPasscodeEntered(),i):(__LOG__(2,void 0,void 0,void 0,["info_store"])`Decrypted noise key was invalid.`,t.passcodeUnlockNoiseInfo(e,!0))}))()}getUnlockedNoiseInfo(e,t){var n=this;return(0,i.default)((function*(){const{recoveryToken:r,staticKeyPair:{pubKey:i,privKey:a}}=e;try{const e=yield Promise.all([r,i,a].map((e=>n.decryptNoiseWithPasscodeDerivedKey(e,t))));if(e[0]&&e[1]&&e[2])return n.cachedPasscodeDerivedKey=t,{recoveryToken:e[0],staticKeyPair:{pubKey:e[1],privKey:e[2]}}}catch(e){return null}}))()}removeLockOnNoiseInfo(e){var t=this;return(0,i.default)((function*(){let n=(0,_.getNoiseInfo)();if(!n)return!1;const r=t._getIv();if(!r)return!1;n=yield t._decryptAllNoiseData(n,r);const i=yield t.deriveKeyFromPasscode(e),a=yield t.getUnlockedNoiseInfo(n,i);return null!=a&&(t._isStaticKeyPairValid(a)?(yield t.set(a),(0,_.setScreenLockSalt)(null),(0,_.setScreenLockIvString)(""),(0,_.setScreenLockIterations)(null),t.cachedPasscodeDerivedKey=null,!0):(__LOG__(2,void 0,void 0,void 0,["info_store"])`Decrypted noise key was invalid.`,!1))}))()}deriveKeyFromPasscode(e){var t=this;return(0,i.default)((function*(){const n=(new TextEncoder).encode(e),r=yield self.crypto.subtle.importKey("raw",n,{name:g},!1,["deriveKey"]),i=yield t.getOrGenScreenLockSalt();return yield self.crypto.subtle.deriveKey({name:g,hash:"SHA-256",salt:i,iterations:t.getScreenLockIterationCount()},r,{name:h,length:128},!1,["encrypt","decrypt"])}))()}getOrGenScreenLockSalt(){let e=null;return(0,_.getScreenLockEnabled)()||(e=new Uint8Array(128),self.crypto.getRandomValues(e),e=btoa(String.fromCharCode(...Array.from(new Uint8Array(e)))),(0,_.setScreenLockSalt)(e)),e=(0,_.getScreenLockSalt)(),null==e&&(0,s.frontendFireAndForget)("socketLogout",{forcePost:!1,reason:p.LogoutReason.MissingScreenLockSalt}),e=Uint8Array.from(atob(e),(e=>e.charCodeAt(0))),Promise.resolve(e)}createScreenLockIv(){const e=new Uint8Array(16);self.crypto.getRandomValues(e);const t=new o.Binary(e).readByteArray(16);(0,_.setScreenLockIvString)((0,a.encodeB64)(t))}getScreenLockIvArray(){const e=(0,_.getScreenLockIvString)();return e?new Uint8Array((0,a.decodeB64)(e)):null}encryptNoiseWithPasscodeDerivedKey(e,t){var n=this;return(0,i.default)((function*(){const r=n.getScreenLockIvArray();if(!r)return null;return yield self.crypto.subtle.encrypt({iv:r,name:h},t,e)}))()}decryptNoiseWithPasscodeDerivedKey(e,t){var n=this;return(0,i.default)((function*(){const r=n.getScreenLockIvArray();if(!r)return null;return yield self.crypto.subtle.decrypt({iv:r,name:h},t,e)}))()}calculatePBKDF2Iterations(){const e=navigator.hardwareConcurrency;return 31e4*Math.max(1,Number.isNaN(e)?1:e)}getScreenLockIterationCount(){let e=(0,_.getScreenLockIterations)();return(0,_.getScreenLockEnabled)()&&null!=e||(e=this.calculatePBKDF2Iterations(),(0,_.setScreenLockIterations)(e)),e}};t.waNoiseInfo=m},94872:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MD_NOISE_KEYS=t.MD_KEYS=t.KEYS=t.HASHED_MD_KEYS=t.HASHED_KEYS=t.COLLECTIONS_KEYS=t.BACKEND_ONLY_KEYS=void 0;const n=Object.freeze({STORAGE_TEST:"storage_test",CLIENT_TOKEN:"WAToken1",SERVER_TOKEN:"WAToken2",SECRET:"WASecretKey",SECURITY_NOTIFICATIONS:"WASecurityNotifications",BROWSER_ID:"WABrowserId",GROUP_ASSIGNED_COLOR:"WAGroupAssignedColor-17",GLOBAL_MUTE_SOUNDS:"WAGlobalSounds",GLOBAL_MUTE_CALL_RINGTONE:"WAGlobalCallRingtone",OUTGOING_MESSAGE_SOUND:"WAOutgoingMessageSound",GLOBAL_MUTE_NOTIFICATIONS:"WAGlobalNotifications",GLOBAL_MUTE_IN_APP_NOTIFICATIONS:"WAGlobalInAppNotifications",GLOBAL_MUTE_PREVIEWS:"WAGlobalPreviews",GLOBAL_OFFLINE_NOTIFICATIONS_ENABLED:"WAGlobalOfflineNotificationsEnabled",GLOBAL_COLLAPSE_MUTED:"WAGlobalCollapseMuted",NOTIFICATION_SOUND:"WANotificationSound",AUTO_DOWNLOAD_PHOTOS:"WAAutoDownloadPhotos",AUTO_DOWNLOAD_AUDIO:"WAAutoDownloadAudio",AUTO_DOWNLOAD_VIDEOS:"WAAutoDownloadVideos",AUTO_DOWNLOAD_DOCUMENTS:"WAAutoDownloadDocuments",LANG:"WALangPref",LAST_ACTIVE_EMOJI_TAB:"WALastActiveEmojiTab",LAST_SELECTED_COMPOSE_BOX_PANEL:"WALastActiveComposeBoxPanel",LAST_CHAT_MUTE_DURATION:"WALastChatMuteDuration",UNKNOWN_ID:"WAUnknownID",VERSION:"WAVersion",LOAD_RETRY_GENERATION:"WALoadRetryGeneration",WHATSAPP_MUTEX:"whatsapp-mutex",LAST_WID:"last-wid",LAST_WID_MD:"last-wid-md",SAVE_TO_CAMERA_ROLL:"save_to_camera_roll",SMB_LABEL_COLOR_PALETTE:"smb_label_color_palette",MARK_TRANSLATIONS:"mark_translations",POSTCODE_AUTO_OPEN_CHANGE_POSTCODE_DONE:"postcode_auto_open_change_postcode_done",POSTCODE_AUTO_OPEN_CHANGE_POSTCODE_COUNT:"postcode_auto_open_change_postcode_count",POSTCODE_TOOLTIP_VIEW_COUNT:"postcode_tooltip_view_count",POSTCODE_TOOLTIP_VIEWED_IN_SESSION:"postcode_tooltip_viewed_in_session",LAST_PUSHNAME:"last-pushname",PROTO_VERSION:"WAProtoVersion",PTT_PLAYBACK_RATE:"WAPttPlaybackRate",LOGOUT_DIRTY_BIT:"post-logout",UNREAD_MENTION_COUNT_ENABLED:"WAUnreadMentionCountEnabled",DAILY_STATS_START_TIME:"WADailyStatsStartTime",PRIMARY_FEATURES:"WAPrimaryFeatures",TOS_STATE_FETCH_ITERATION:"ToSStateFetchIteration",NUX_LIST:"WANuxList",LID:"WALid",ME_DISPLAY_NAME:"me-display-name",PRESERVED_USER_KEYS:"preserved_user_keys",LAST_STATUS_USAGE:"last-status-usage",MOBILE_PLATFORM_DEPRECATED:"mobile-platform",REMEMBER_ME:"remember-me",OLD_LOGOUT_CREDS:"old-logout-cred",NO_TAKEOVER:"no-takeover",WHATSAPP_LS_VERSION:"ver",TIME_SPENT_EVENT:"WaTimeSpentEvent",VIDEO_VOLUME:"video-volume",VIDEO_MUTE:"video-mute",CONTACT_CHECKSUM:"contact-checksum",CONTACT_CHECKSUM_MODEL_STORAGE:"contact_checksum",FREQUENT_CONTACTS:"frequent_contacts",GK_PROTO:"gk_proto",INITIAL_HIST_BOUNDRY:"history_initial_sync_boundry",INITIAL_GROUP_PHASH:"initial_group_phash",USER_PRIVACY_SETTINGS:"user-privacy-settings",IS_SMB:"is-smb",COMPOSE_CONTENTS_PREFIX:"compose-contents_",THEME:"theme",SYSTEM_THEME_MODE:"system-theme-mode",ABPROPS:"abprops",HISTORY_SYNC_EARLIEST_DATE:"history-sync-earliest-date",CHATS_USER_SENT_MESSAGE_TO:"chats-user-sent-message-to",SYNCD_DISABLED_DUE_TO_FATAL:"syncd_disabled_due_to_fatal",SYNCD_FIRST_CLEAR_OR_DELETE:"syncd-first-clear-or-delete",CONTACT_SYNC_REFRESH:"contact-sync-refresh-seconds",TOS_3:"TOS_STATE_20210210",NOTICE_BANNER_CLOSED_AT:"notice-banner-closed-at",NOTICE_ID:"notice-id",LOG_CURSOR:"debugCursor",LOCAL_TAKEOVER_OK:"local-takeover-ok",PS_KILLSWITCH_TOKEN:"ps-killswitch-token",STORAGE_DISMISS_STATE:"storage-dismiss-state",STORAGE_ALERT_FLAG:"storage-alert-flag",HOUR_24:"hour-24",PERSISTENT_EXPIRING_ID:"WaPersistentExpiringId",LAST_ELECTRON_NOTIFICATION_CLOSE:"last-electron-notification-close",FIRST_SEEN_DESKTOP_UPSELL_BBAR:"first-seen-desktop-upsell-bbar",WEB_NOTIFICATIONS_BB_STATUS:"WAWebNotificationsButterbarStatus",OFFLINE_NOTIFICATIONS_BB_STATUS:"WAOfflineNotificationsButterbarStatus",FB_SHOPS_SUNSET_BB_STATUS:"WAWebFBShopsSunsetButterbarStatus",PNH_CAG_FUTURE_PROOF_BANNER_CLOSED:"pnh_cag_future_proof_banner_closed",VERIFIED_BUSINESS_NAME_IS_CLEANED:"WAVerifiedBusinessNameIsCleaned"});t.KEYS=n;const r=Object.freeze({EMOJI_VARIANT_COLLECTION:"emoji_variant_collection",RECENT_EMOJI_COLLECTION:"recent_emoji_collection",RECENT_REACTIONS_COLLECTION:"recent_reactions_collection",CHAT_PREFERENCE_COLLECTION:"chat_preference",CONVERSION_TUPLE_COLLECTION:"conversion_tuple",MUTE_COLLECTION:"mute",PROFILE_PIC_THUMB_COLLECTION:"profile_pic_thumb",UNATTRIBUTED_MESSAGE_COLLECTION:"unattributed_message_collection",CART_COLLECTION:"cart_collection",QUICK_REPLY_COLLECTION:"quick_replies_collection",DAILY_AGGREGATED_STATS_COLLECTION:"daily_aggregated_stats"});t.COLLECTIONS_KEYS=r;const i=Object.freeze({NOISE_INFO:"WANoiseInfo",NOISE_INFO_IV:"WANoiseInfoIv",ME_INFO:"WAMeInfo",DEVICE_ID:"WADeviceId",ROUTING_INFO:"WARoutingInfo",INITIAL_HISTORY_SYNCED:"WaInitialHistorySynced",CRITICAL_DATA_SYNCED:"critical_data_synced",HISTORY_SYNC_STATUS:"WAHistorySyncStatus",HISTORY_SYNC_REMAINING_PAUSED_SECONDS:"WAHistorySyncRemainingPausedSeconds",ADV_SECRET_KEY:"WaADVSecretKey",IS_SMB:"WAIsSMB",LAST_OFFLINE_MESSAGE:"WALastOfflineMessage",BLOCKLIST_HASH:"WABlocklistHash",SHOULD_CHECK_CONTACT_SYNC_STATUS:"WAShouldCheckContactSyncStatus",WEB_ENC_SALT:"WebEncKeySalt",MD_UPGRADE_WAM_FLAG:"MdUpgradeWamFlag",MD_HISTORY_LAST_CHUNK_PROCESSED:"MdHistoryLastChunkProcessed",UNARCHIVE_CHATS_SETTING:"WAUnarchiveChatsSetting",ARCHIVE_V2_ENABLED_SETTING:"WAArchiveV2EnabledSetting",SYNCD_PRIMARY_ALLOWS_ALL_MUTATIONS:"WASyncdPrimaryAllowsAllMutations",MD_SYNC_ACTIONS_ACTION_SANITIZED:"MdSyncActionsActionSanitized",CHAT_THREAD_LOGGING_OFFSET:"ChatThreadLoggingOffset",CHAT_THREAD_LOGGING_SECRET:"ChatThreadLoggingSecret",CHAT_THREAD_LOGGING_LAST_UPLOADED_START_TS:"ChatThreadLoggingLastUploadedStartTs",IS_COMMUNITY_DISCOVERED:"WAIsCommunityDiscovered",PAIRING_TIMESTAMP:"MdPairingTimestamp",RECENT_MAILBOX_AGE_DAYS:"MdRecentMailboxAgeDays",LAST_PERIODIC_APP_STATE_SYNC_TS:"MdLastPeriodicAppStateSyncTs",MD_LOGIN_COOKIE_REQUEST_COMPLETE:"MdLoginCookieRequestComplete",SCREEN_LOCK_DURATION_SECONDS:"WAScreenLockDuration",SCREEN_UNLOCK_TRY_COUNT:"WAScreenUnlockTryCount",SCREEN_LOCK_IV:"WAScreenLockIV",SCREEN_LOCK_SALT:"WAScreenLockSalt",SCREEN_LOCK_ITERATIONS:"WAScreenLockIterations",CACHED_PROFILE_PIC_EURL:"WACachedProfilePicEURL",COMMUNITY_TAB_LAST_SEEN_TIMESTAMP:"WACommunityTabLastSeenTimestamp"});t.MD_KEYS=i;const a=Object.freeze({NOISE_INFO:"WANoiseInfo",NOISE_INFO_IV:"WANoiseInfoIv",WEB_ENC_SALT:"WAWebEncKeySalt"});t.MD_NOISE_KEYS=a;const o=Object.freeze({ROUTING_INFO:"WARoutingInfo",INITIAL_HISTORY_SYNCED:"WAInitialHistorySynced",HISTORY_SYNC_STATUS:"WAHistorySyncStatus",BLOCKLIST_HASH:"WABlocklistHash",CRITICAL_DATA_SYNCED:"WACriticalDataSynced",SHOULD_CHECK_CONTACT_SYNC_STATUS:"WAShouldCheckContactSyncStatus",ADV_SECRET_KEY:"WAADVSecretKey",MD_UPGRADE_WAM_FLAG:"WAMdUpgradeWamFlag",MD_HISTORY_LAST_CHUNK_PROCESSED:"WAMdHistoryLastChunkProcessed",UNARCHIVE_CHATS_SETTING:"WAUnarchiveChatsSetting",ARCHIVE_V2_ENABLED_SETTING:"WAArchiveV2EnabledSetting",MD_SYNC_ACTIONS_ACTION_SANITIZED:"WAMdSyncActionsActionSanitized",CHAT_THREAD_LOGGING_OFFSET:"WAChatThreadLoggingOffset",CHAT_THREAD_LOGGING_SECRET:"WAChatThreadLoggingSecret",CHAT_THREAD_LOGGING_LAST_UPLOADED_START_TS:"WAChatThreadLoggingLastUploadedStartTs",IS_COMMUNITY_DISCOVERED:"WAIsCommunityDiscovered",PAIRING_TIMESTAMP:"WAMdPairingTimestamp",RECENT_MAILBOX_AGE_DAYS:"WAMdRecentMailboxAgeDays",LAST_PERIODIC_APP_STATE_SYNC_TS:"WAMdLastPeriodicAppStateSyncTs",MD_LOGIN_COOKIE_REQUEST_COMPLETE:"WAMdLoginCookieRequestComplete",HISTORY_SYNC_CHUNK_COUNT_FOR_END_OF_RECENT_SYNC:"WAHistorySyncChunkCountForEndOfRecentSync",MOBILE_PLATFORM:"WAMobilePlatform",NON_CRITICAL_DATA_SYNC_STATUS:"WANonCriticalDataSyncStatus"});t.BACKEND_ONLY_KEYS=o;const s=Object.freeze({});t.HASHED_MD_KEYS=s;const l=Object.freeze({});t.HASHED_KEYS=l},627162:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getHour24=function(){var e;return null!==(e=u.userPreferencesStore.get(s.KEYS.HOUR_24))&&void 0!==e?e:null},t.getLangPref=function(){return l.default.getItemFromLocalStorage(s.KEYS.LANG)},t.getMarkTranslations=function(){const e=u.userPreferencesStore.get(s.KEYS.MARK_TRANSLATIONS);return null!=e?JSON.parse(e):a.MARK_TRANSLATIONS},t.setHour24=function(e){u.userPreferencesStore.set(s.KEYS.HOUR_24,e)},t.setLangPref=function(e){l.default.setItemToLocalStorage(s.KEYS.LANG,e),(0,i.isSocketConnected)()&&o.userPrefsIndexedDBStorage.setItemToIndexedDB(s.KEYS.LANG,e)},t.setMarkTranslations=function(e){u.userPreferencesStore.set(s.KEYS.MARK_TRANSLATIONS,e)};var i=n(911794),a=n(256354),o=n(409847),s=n(94872),l=r(n(98165)),u=n(53575)},459857:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.assertGetMe=_,t.assertGetMeUser=function(){return(0,a.default)(f(),"meUser")},t.clearGetMaybeMeUserCache=void 0,t.getMaybeMeDisplayName=function(){return s.userPreferencesStoreBase.get(l.KEYS.ME_DISPLAY_NAME)},t.getMaybeMeLid=m,t.getMaybeMeLidUser=y,t.getMaybeMeUser=void 0,t.getMe=p,t.getMePNandLIDWids=function(){const e=m();return null==e?[_()]:[_(),e]},t.getMeUser=f,t.isMeAccount=S,t.isMeDevice=function(e){if(null==e||!E(e))return!1;if(e.equals(_()))return!0;const t=m();return null!=t&&e.equals(t)},t.isMePrimary=function(e){if(null==e||!E(e))return!1;if(e.equals(f()))return!0;const t=y();return null!=t&&e.equals(t)},t.isSerializedWidMe=function(e){return S((0,c.createWid)(e))},t.setMe=function(e){g(),s.userPreferencesStoreBase.set(l.KEYS.LAST_WID_MD,e),(0,i.setMyJids)((0,d.widToMyJids)(e))},t.setMeDisplayName=function(e){s.userPreferencesStoreBase.set(l.KEYS.ME_DISPLAY_NAME,e)},t.setMeLid=function(e){s.userPreferencesStoreBase.set(l.KEYS.LID,e.toString())};var i=n(819416),a=r(n(132375)),o=n(528646),s=(n(755985),n(102461)),l=n(94872),u=r(n(124928)),c=n(669050),d=n(574819);function p(){const e=s.userPreferencesStoreBase.get(l.KEYS.LAST_WID_MD);return e&&u.default.isWid(e)?(0,c.createWid)(e):e}function _(){return(0,a.default)(p(),"me")}function f(){return(0,c.toUserWid)(_())}const[h,g]=(0,o.memoizeWithClear)((()=>{const e=p();if(e)return(0,c.toUserWid)(e)}));function m(){const e=s.userPreferencesStoreBase.get(l.KEYS.LID);return null==e?null:(0,c.createWid)(e)}function y(){const e=m();return null==e?null:(0,c.toUserWid)(e)}function E(e){const t=e instanceof u.default;return t||__LOG__(3)`isWID: input exists but is not WID`,t}function S(e){if(null==e||!E(e))return!1;const t=h();if(null!=t&&e.isSameAccount(t))return!0;const n=m();return null!=n&&e.isSameAccount(n)}t.clearGetMaybeMeUserCache=g,t.getMaybeMeUser=h},15321:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getContactChecksum=function(){return i.userPreferencesStore.getUser(r.KEYS.CONTACT_CHECKSUM_MODEL_STORAGE)},t.getHistoryInitialSyncBoundry=function(){const e=i.userPreferencesStore.getUser(r.KEYS.INITIAL_HIST_BOUNDRY);try{return JSON.parse(e)}catch(e){return null}},t.getInitialGroupPhash=function(e){const t=i.userPreferencesStore.getUser(r.KEYS.INITIAL_GROUP_PHASH);try{return JSON.parse(t)[e]}catch(e){return null}},t.getInitialGroupPhashMap=function(){const e=i.userPreferencesStore.getUser(r.KEYS.INITIAL_GROUP_PHASH);try{return JSON.parse(e)}catch(e){return null}},t.setContactChecksum=function(e){i.userPreferencesStore.setUser(r.KEYS.CONTACT_CHECKSUM_MODEL_STORAGE,e)},t.setHistoryInitialSyncBoundry=function(e){i.userPreferencesStore.setUser(r.KEYS.INITIAL_HIST_BOUNDRY,JSON.stringify(e))},t.setInitialGroupPhash=function(e){i.userPreferencesStore.setUser(r.KEYS.INITIAL_GROUP_PHASH,JSON.stringify(e))};var r=n(94872),i=n(53575)},673168:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.clearRegistrationInfo=function(){return g.apply(this,arguments)},t.getADVSecretKey=function(){return k.apply(this,arguments)},t.getAllCriticalDataSynced=function(){return L.apply(this,arguments)},t.getArchiveV2EnabledSetting=function(){return $.apply(this,arguments)},t.getBlocklistHash=function(){return G.apply(this,arguments)},t.getCachedProfilePicEURL=function(){return f.userPreferencesStore.get(d.MD_KEYS.CACHED_PROFILE_PIC_EURL,{storage:l.default})},t.getChatThreadLoggingLastUploadedStartTs=function(){return ne.apply(this,arguments)},t.getChatThreadLoggingOffset=function(){return X.apply(this,arguments)},t.getChatThreadLoggingSecretB64=function(){return ee.apply(this,arguments)},t.getChunkCountForEndOfRecentHistorySync=function(){return ie.apply(this,arguments)},t.getCommunityTabLastSeenTimestamp=function(){var e;return null!==(e=f.userPreferencesStore.get(d.MD_KEYS.COMMUNITY_TAB_LAST_SEEN_TIMESTAMP))&&void 0!==e?e:0},t.getHistorySyncEarliestDate=function(){const e=f.userPreferencesStore.get(d.KEYS.HISTORY_SYNC_EARLIEST_DATE);if(!e){var t;const e={WEB:90*s.DAY_SECONDS,ELECTRON:s.YEAR_SECONDS};return(null!==(t=x())&&void 0!==t?t:(0,s.unixTime)())-e.WEB}return e},t.getHistorySyncRemainingPausedSeconds=function(){return f.userPreferencesStore.get(d.MD_KEYS.HISTORY_SYNC_REMAINING_PAUSED_SECONDS)},t.getHistorySyncStatus=R,t.getInitialHistorySyncComplete=function(){return I.apply(this,arguments)},t.getInitialHistorySyncCompleteLocalStorage=function(){return!!f.userPreferencesStore.get(d.MD_KEYS.INITIAL_HISTORY_SYNCED,{storage:l.default})},t.getLastHistorySyncedChunk=function(){return A.apply(this,arguments)},t.getLastPeriodicAppStateSyncTs=function(){return Y.apply(this,arguments)},t.getMdInternVersion=function(){h;return},t.getMdLoginCookieRequestComplete=function(){return S.apply(this,arguments)},t.getMdSyncActionsActionSanitized=function(){return q.apply(this,arguments)},t.getNoiseInfo=y,t.getNoiseInfoIv=function(){return p.default.getItemFromLocalStorage(d.MD_NOISE_KEYS.NOISE_INFO_IV)},t.getNonCriticalDataSyncStatus=ae,t.getPairingTimestamp=x,t.getPrimaryAllowsAllMutations=function(){return!!f.userPreferencesStore.get(d.MD_KEYS.SYNCD_PRIMARY_ALLOWS_ALL_MUTATIONS)},t.getRecentMailboxAgeDays=function(){return F.apply(this,arguments)},t.getRoutingInfo=function(){return P.apply(this,arguments)},t.getScreenLockDurationForLogging=function(){return f.userPreferencesStore.get(d.MD_KEYS.SCREEN_LOCK_DURATION_SECONDS)},t.getScreenLockDurationInSeconds=function(){var e;return null!==(e=f.userPreferencesStore.get(d.MD_KEYS.SCREEN_LOCK_DURATION_SECONDS))&&void 0!==e?e:0},t.getScreenLockEnabled=function(){var e;return 0!==parseInt(null!==(e=f.userPreferencesStore.get(d.MD_KEYS.SCREEN_LOCK_DURATION_SECONDS))&&void 0!==e?e:0,10)},t.getScreenLockIterations=function(){return f.userPreferencesStore.get(d.MD_KEYS.SCREEN_LOCK_ITERATIONS)},t.getScreenLockIvString=function(){return f.userPreferencesStore.get(d.MD_KEYS.SCREEN_LOCK_IV)},t.getScreenLockSalt=function(){return f.userPreferencesStore.get(d.MD_KEYS.SCREEN_LOCK_SALT,{storage:l.default})},t.getShouldCheckContactSyncStatus=function(){return H.apply(this,arguments)},t.getUnarchiveChatsSetting=function(){return W.apply(this,arguments)},t.getWebEncSalt=function(){return p.default.getItemFromLocalStorage(d.MD_NOISE_KEYS.WEB_ENC_SALT)},t.isRegistered=function(){return!(!y()||!(0,_.getMe)())},t.setADVSecretKey=function(){return D.apply(this,arguments)},t.setAllCriticalDataSynced=function(){return w.apply(this,arguments)},t.setArchiveV2EnabledSetting=function(){return z.apply(this,arguments)},t.setBlocklistHash=function(){return U.apply(this,arguments)},t.setCachedProfilePicEURL=function(e){return f.userPreferencesStore.set(d.MD_KEYS.CACHED_PROFILE_PIC_EURL,e)},t.setChatThreadLoggingLastUploadedStartTs=function(){return te.apply(this,arguments)},t.setChatThreadLoggingOffset=function(){return Q.apply(this,arguments)},t.setChatThreadLoggingSecretB64=function(){return Z.apply(this,arguments)},t.setChunkCountForEndOfRecentHistorySync=function(){return re.apply(this,arguments)},t.setCommunityTabLastSeenTimestamp=function(e){f.userPreferencesStore.set(d.MD_KEYS.COMMUNITY_TAB_LAST_SEEN_TIMESTAMP,e)},t.setHistorySyncEarliestDate=function(e){f.userPreferencesStore.set(d.KEYS.HISTORY_SYNC_EARLIEST_DATE,e)},t.setHistorySyncRemainingPausedSeconds=function(e){return f.userPreferencesStore.set(d.MD_KEYS.HISTORY_SYNC_REMAINING_PAUSED_SECONDS,e)},t.setHistorySyncStatus=function(){return b.apply(this,arguments)},t.setInitialHistorySyncComplete=function(){return O.apply(this,arguments)},t.setLastHistorySyncedChunk=function(){return v.apply(this,arguments)},t.setLastPeriodicAppStateSyncTs=function(){return j.apply(this,arguments)},t.setMdInternVersion=function(e){h},t.setMdLoginCookieRequestComplete=function(){return E.apply(this,arguments)},t.setMdSyncActionsActionSanitized=function(){return J.apply(this,arguments)},t.setNoiseInfo=function(){return m.apply(this,arguments)},t.setNoiseInfoIv=function(){return T.apply(this,arguments)},t.setNonCriticalDataSyncStatus=function(){return oe.apply(this,arguments)},t.setPairingTimestamp=function(e){return f.userPreferencesStore.set(d.MD_KEYS.PAIRING_TIMESTAMP,e)},t.setPrimaryAllowsAllMutations=function(){return f.userPreferencesStore.set(d.MD_KEYS.SYNCD_PRIMARY_ALLOWS_ALL_MUTATIONS,!0)},t.setRecentMailboxAgeDays=function(){return B.apply(this,arguments)},t.setRoutingInfo=function(){return C.apply(this,arguments)},t.setScreenLockDurationInSeconds=function(e){f.userPreferencesStore.set(d.MD_KEYS.SCREEN_LOCK_DURATION_SECONDS,e)},t.setScreenLockIterations=function(e){return f.userPreferencesStore.set(d.MD_KEYS.SCREEN_LOCK_ITERATIONS,e)},t.setScreenLockIvString=function(e){f.userPreferencesStore.set(d.MD_KEYS.SCREEN_LOCK_IV,e)},t.setScreenLockSalt=function(e){return f.userPreferencesStore.set(d.MD_KEYS.SCREEN_LOCK_SALT,e,{shouldWriteToIdb:!1})},t.setShouldCheckContactSyncStatus=function(){return K.apply(this,arguments)},t.setUnarchiveChatsSetting=function(){return V.apply(this,arguments)},t.setWebEncSalt=function(){return M.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(417405),s=n(990445),l=r(n(236642)),u=n(840928),c=n(409847),d=n(94872),p=r(n(98165)),_=n(459857),f=n(53575);const h=null;function g(){return(g=(0,a.default)((function*(){const e=[d.MD_KEYS.NOISE_INFO,d.MD_KEYS.ME_INFO,d.MD_KEYS.DEVICE_ID,d.MD_KEYS.ROUTING_INFO,d.MD_KEYS.INITIAL_HISTORY_SYNCED,d.MD_KEYS.WEB_ENC_SALT];e.push(d.KEYS.LAST_WID_MD),e.map((e=>{f.userPreferencesStore.set(e,void 0)})),yield u.userPrefsCacheStorage.clearCacheStorage()}))).apply(this,arguments)}function m(){return(m=(0,a.default)((function*(e){p.default.setItemToLocalStorage(d.MD_NOISE_KEYS.NOISE_INFO,e),yield u.userPrefsCacheStorage.setItemToCacheStorage(d.MD_NOISE_KEYS.NOISE_INFO,e)}))).apply(this,arguments)}function y(){return p.default.getItemFromLocalStorage(d.MD_NOISE_KEYS.NOISE_INFO)}function E(){return(E=(0,a.default)((function*(){return yield c.userPrefsIndexedDBStorage.setItemToIndexedDB(d.BACKEND_ONLY_KEYS.MD_LOGIN_COOKIE_REQUEST_COMPLETE,!0),f.userPreferencesStore.set(d.MD_KEYS.MD_LOGIN_COOKIE_REQUEST_COMPLETE,!0)}))).apply(this,arguments)}function S(){return(S=(0,a.default)((function*(){return!0===(yield c.userPrefsIndexedDBStorage.getItemFromIndexedDB(d.BACKEND_ONLY_KEYS.MD_LOGIN_COOKIE_REQUEST_COMPLETE))}))).apply(this,arguments)}function T(){return(T=(0,a.default)((function*(e){p.default.setItemToLocalStorage(d.MD_NOISE_KEYS.NOISE_INFO_IV,e),yield u.userPrefsCacheStorage.setItemToCacheStorage(d.MD_NOISE_KEYS.NOISE_INFO_IV,e)}))).apply(this,arguments)}function v(){return(v=(0,a.default)((function*(e,t){null!=e&&null!=t&&(yield c.userPrefsIndexedDBStorage.setItemToIndexedDB(d.BACKEND_ONLY_KEYS.MD_HISTORY_LAST_CHUNK_PROCESSED,`${e}_${t}`),f.userPreferencesStore.set(d.MD_KEYS.MD_HISTORY_LAST_CHUNK_PROCESSED,`${e}_${t}`,{shouldWriteToIdb:!1}))}))).apply(this,arguments)}function A(){return(A=(0,a.default)((function*(){return yield c.userPrefsIndexedDBStorage.getItemFromIndexedDB(d.BACKEND_ONLY_KEYS.MD_HISTORY_LAST_CHUNK_PROCESSED)}))).apply(this,arguments)}function C(){return(C=(0,a.default)((function*(e){yield c.userPrefsIndexedDBStorage.setItemToIndexedDB(d.BACKEND_ONLY_KEYS.ROUTING_INFO,e);const{domain:t,edgeRouting:n}=e,r={domain:t,edgeRouting:n?(0,o.encodeB64)(n):null};return f.userPreferencesStore.set(d.MD_KEYS.ROUTING_INFO,r,{storage:l.default})}))).apply(this,arguments)}function P(){return(P=(0,a.default)((function*(){return yield c.userPrefsIndexedDBStorage.getItemFromIndexedDB(d.BACKEND_ONLY_KEYS.ROUTING_INFO)}))).apply(this,arguments)}function O(){return(O=(0,a.default)((function*(){return yield c.userPrefsIndexedDBStorage.setItemToIndexedDB(d.BACKEND_ONLY_KEYS.INITIAL_HISTORY_SYNCED,!0),f.userPreferencesStore.set(d.MD_KEYS.INITIAL_HISTORY_SYNCED,"true",{shouldWriteToIdb:!1})}))).apply(this,arguments)}function I(){return(I=(0,a.default)((function*(){return!0===(yield c.userPrefsIndexedDBStorage.getItemFromIndexedDB(d.BACKEND_ONLY_KEYS.INITIAL_HISTORY_SYNCED))}))).apply(this,arguments)}function M(){return(M=(0,a.default)((function*(e){return null!=e?(p.default.setItemToLocalStorage(d.MD_NOISE_KEYS.WEB_ENC_SALT,e),yield u.userPrefsCacheStorage.setItemToCacheStorage(d.MD_NOISE_KEYS.WEB_ENC_SALT,e)):(p.default.removeItemFromLocalStorage(d.MD_NOISE_KEYS.WEB_ENC_SALT),yield u.userPrefsCacheStorage.removeItemFromCacheStorage(d.MD_NOISE_KEYS.WEB_ENC_SALT)),f.userPreferencesStore.set(d.MD_KEYS.WEB_ENC_SALT,e,{shouldWriteToIdb:!1})}))).apply(this,arguments)}function b(){return(b=(0,a.default)((function*(e){var t;const n=null!==(t=yield R())&&void 0!==t?t:{};yield c.userPrefsIndexedDBStorage.setItemToIndexedDB(d.BACKEND_ONLY_KEYS.HISTORY_SYNC_STATUS,(0,i.default)((0,i.default)({},n),e)),f.userPreferencesStore.set(d.MD_KEYS.HISTORY_SYNC_STATUS,(0,i.default)((0,i.default)({},n),e),{shouldWriteToIdb:!1})}))).apply(this,arguments)}function R(){return N.apply(this,arguments)}function N(){return(N=(0,a.default)((function*(){return yield c.userPrefsIndexedDBStorage.getItemFromIndexedDB(d.BACKEND_ONLY_KEYS.HISTORY_SYNC_STATUS)}))).apply(this,arguments)}function w(){return(w=(0,a.default)((function*(){return yield c.userPrefsIndexedDBStorage.setItemToIndexedDB(d.BACKEND_ONLY_KEYS.CRITICAL_DATA_SYNCED,!0),f.userPreferencesStore.set(d.MD_KEYS.CRITICAL_DATA_SYNCED,!0)}))).apply(this,arguments)}function L(){return(L=(0,a.default)((function*(){return!0===(yield c.userPrefsIndexedDBStorage.getItemFromIndexedDB(d.BACKEND_ONLY_KEYS.CRITICAL_DATA_SYNCED))}))).apply(this,arguments)}function D(){return(D=(0,a.default)((function*(e){return null==e?yield c.userPrefsIndexedDBStorage.removeItemFromIndexedDB(d.BACKEND_ONLY_KEYS.ADV_SECRET_KEY):yield c.userPrefsIndexedDBStorage.setItemToIndexedDB(d.BACKEND_ONLY_KEYS.ADV_SECRET_KEY,e),f.userPreferencesStore.set(d.MD_KEYS.ADV_SECRET_KEY,e)}))).apply(this,arguments)}function k(){return(k=(0,a.default)((function*(){return yield c.userPrefsIndexedDBStorage.getItemFromIndexedDB(d.BACKEND_ONLY_KEYS.ADV_SECRET_KEY)}))).apply(this,arguments)}function U(){return(U=(0,a.default)((function*(e){return yield c.userPrefsIndexedDBStorage.setItemToIndexedDB(d.BACKEND_ONLY_KEYS.BLOCKLIST_HASH,e),f.userPreferencesStore.set(d.MD_KEYS.BLOCKLIST_HASH,e)}))).apply(this,arguments)}function G(){return(G=(0,a.default)((function*(){return yield c.userPrefsIndexedDBStorage.getItemFromIndexedDB(d.BACKEND_ONLY_KEYS.BLOCKLIST_HASH)}))).apply(this,arguments)}function x(){const e=f.userPreferencesStore.get(d.MD_KEYS.PAIRING_TIMESTAMP);return null==e?null:parseInt(e,10)}function B(){return(B=(0,a.default)((function*(e){return yield c.userPrefsIndexedDBStorage.setItemToIndexedDB(d.BACKEND_ONLY_KEYS.RECENT_MAILBOX_AGE_DAYS,e),f.userPreferencesStore.set(d.MD_KEYS.RECENT_MAILBOX_AGE_DAYS,e)}))).apply(this,arguments)}function F(){return(F=(0,a.default)((function*(){return yield c.userPrefsIndexedDBStorage.getItemFromIndexedDB(d.BACKEND_ONLY_KEYS.RECENT_MAILBOX_AGE_DAYS)}))).apply(this,arguments)}function j(){return(j=(0,a.default)((function*(e){return yield c.userPrefsIndexedDBStorage.setItemToIndexedDB(d.BACKEND_ONLY_KEYS.LAST_PERIODIC_APP_STATE_SYNC_TS,e),f.userPreferencesStore.set(d.MD_KEYS.LAST_PERIODIC_APP_STATE_SYNC_TS,e)}))).apply(this,arguments)}function Y(){return(Y=(0,a.default)((function*(){return yield c.userPrefsIndexedDBStorage.getItemFromIndexedDB(d.BACKEND_ONLY_KEYS.RECENT_MAILBOX_AGE_DAYS)}))).apply(this,arguments)}function K(){return(K=(0,a.default)((function*(){return yield c.userPrefsIndexedDBStorage.setItemToIndexedDB(d.BACKEND_ONLY_KEYS.SHOULD_CHECK_CONTACT_SYNC_STATUS,!0),f.userPreferencesStore.set(d.MD_KEYS.SHOULD_CHECK_CONTACT_SYNC_STATUS,!0)}))).apply(this,arguments)}function H(){return(H=(0,a.default)((function*(){return!0===(yield c.userPrefsIndexedDBStorage.getItemFromIndexedDB(d.BACKEND_ONLY_KEYS.SHOULD_CHECK_CONTACT_SYNC_STATUS))}))).apply(this,arguments)}function W(){return(W=(0,a.default)((function*(){return!0===(yield c.userPrefsIndexedDBStorage.getItemFromIndexedDB(d.BACKEND_ONLY_KEYS.UNARCHIVE_CHATS_SETTING))}))).apply(this,arguments)}function V(){return(V=(0,a.default)((function*(e){yield c.userPrefsIndexedDBStorage.setItemToIndexedDB(d.BACKEND_ONLY_KEYS.UNARCHIVE_CHATS_SETTING,e),f.userPreferencesStore.set(d.MD_KEYS.UNARCHIVE_CHATS_SETTING,e)}))).apply(this,arguments)}function $(){return($=(0,a.default)((function*(){return!0===(yield c.userPrefsIndexedDBStorage.getItemFromIndexedDB(d.BACKEND_ONLY_KEYS.ARCHIVE_V2_ENABLED_SETTING))}))).apply(this,arguments)}function z(){return(z=(0,a.default)((function*(e){yield c.userPrefsIndexedDBStorage.setItemToIndexedDB(d.BACKEND_ONLY_KEYS.ARCHIVE_V2_ENABLED_SETTING,e),f.userPreferencesStore.set(d.MD_KEYS.ARCHIVE_V2_ENABLED_SETTING,e)}))).apply(this,arguments)}function q(){return(q=(0,a.default)((function*(){return!0===(yield c.userPrefsIndexedDBStorage.getItemFromIndexedDB(d.BACKEND_ONLY_KEYS.MD_SYNC_ACTIONS_ACTION_SANITIZED))}))).apply(this,arguments)}function J(){return(J=(0,a.default)((function*(e){yield c.userPrefsIndexedDBStorage.setItemToIndexedDB(d.BACKEND_ONLY_KEYS.MD_SYNC_ACTIONS_ACTION_SANITIZED,e),f.userPreferencesStore.set(d.MD_KEYS.MD_SYNC_ACTIONS_ACTION_SANITIZED,e)}))).apply(this,arguments)}function Q(){return(Q=(0,a.default)((function*(e){yield c.userPrefsIndexedDBStorage.setItemToIndexedDB(d.BACKEND_ONLY_KEYS.CHAT_THREAD_LOGGING_OFFSET,e),f.userPreferencesStore.set(d.MD_KEYS.CHAT_THREAD_LOGGING_OFFSET,e)}))).apply(this,arguments)}function X(){return(X=(0,a.default)((function*(){return yield c.userPrefsIndexedDBStorage.getItemFromIndexedDB(d.BACKEND_ONLY_KEYS.CHAT_THREAD_LOGGING_OFFSET)}))).apply(this,arguments)}function Z(){return(Z=(0,a.default)((function*(e){yield c.userPrefsIndexedDBStorage.setItemToIndexedDB(d.BACKEND_ONLY_KEYS.CHAT_THREAD_LOGGING_SECRET,e),f.userPreferencesStore.set(d.MD_KEYS.CHAT_THREAD_LOGGING_SECRET,e)}))).apply(this,arguments)}function ee(){return(ee=(0,a.default)((function*(){return yield c.userPrefsIndexedDBStorage.getItemFromIndexedDB(d.BACKEND_ONLY_KEYS.CHAT_THREAD_LOGGING_SECRET)}))).apply(this,arguments)}function te(){return(te=(0,a.default)((function*(e){yield c.userPrefsIndexedDBStorage.setItemToIndexedDB(d.BACKEND_ONLY_KEYS.CHAT_THREAD_LOGGING_LAST_UPLOADED_START_TS,e),f.userPreferencesStore.set(d.MD_KEYS.CHAT_THREAD_LOGGING_LAST_UPLOADED_START_TS,e)}))).apply(this,arguments)}function ne(){return(ne=(0,a.default)((function*(){return yield c.userPrefsIndexedDBStorage.getItemFromIndexedDB(d.BACKEND_ONLY_KEYS.CHAT_THREAD_LOGGING_LAST_UPLOADED_START_TS)}))).apply(this,arguments)}function re(){return(re=(0,a.default)((function*(e){yield c.userPrefsIndexedDBStorage.setItemToIndexedDB(d.BACKEND_ONLY_KEYS.HISTORY_SYNC_CHUNK_COUNT_FOR_END_OF_RECENT_SYNC,e)}))).apply(this,arguments)}function ie(){return(ie=(0,a.default)((function*(){var e;return null!==(e=yield c.userPrefsIndexedDBStorage.getItemFromIndexedDB(d.BACKEND_ONLY_KEYS.HISTORY_SYNC_CHUNK_COUNT_FOR_END_OF_RECENT_SYNC))&&void 0!==e?e:0}))).apply(this,arguments)}function ae(){return c.userPrefsIndexedDBStorage.getItemFromIndexedDB(d.BACKEND_ONLY_KEYS.NON_CRITICAL_DATA_SYNC_STATUS)}function oe(){return(oe=(0,a.default)((function*(e){var t;const n=null!==(t=yield ae())&&void 0!==t?t:{};yield c.userPrefsIndexedDBStorage.setItemToIndexedDB(d.BACKEND_ONLY_KEYS.NON_CRITICAL_DATA_SYNC_STATUS,(0,i.default)((0,i.default)({},n),e))}))).apply(this,arguments)}},117429:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCollapseMuted=function(){return a.userPreferencesStore.getUser(i.KEYS.GLOBAL_COLLAPSE_MUTED)},t.getGlobalCallRingtone=function(){return!a.userPreferencesStore.getUser(i.KEYS.GLOBAL_MUTE_CALL_RINGTONE)},t.getGlobalNotifications=function(){const e=a.userPreferencesStore.getUser(i.KEYS.GLOBAL_MUTE_NOTIFICATIONS);var t;return null==e?(null===(t=window.Notification)||void 0===t?void 0:t.permission)===r.PERMISSION_ALLOWED:!e},t.getGlobalOfflineNotifications=function(){var e;return null!==(e=a.userPreferencesStore.getUser(i.KEYS.GLOBAL_OFFLINE_NOTIFICATIONS_ENABLED))&&void 0!==e&&e},t.getGlobalPreviews=function(){return!a.userPreferencesStore.getUser(i.KEYS.GLOBAL_MUTE_PREVIEWS)},t.getGlobalSecurityNotifications=function(){var e;return null===(e=!a.userPreferencesStore.getUser(i.KEYS.SECURITY_NOTIFICATIONS))||void 0===e||e},t.getGlobalSounds=function(){return!a.userPreferencesStore.getUser(i.KEYS.GLOBAL_MUTE_SOUNDS)},t.getIgnoreNondirectGroupMsg=function(){o;return!1},t.getOfflineNotificationsBBStatus=function(){var e;return null!==(e=a.userPreferencesStore.getUser(i.KEYS.OFFLINE_NOTIFICATIONS_BB_STATUS))&&void 0!==e?e:{isDismissed:!1,firstSeenTime:null,isLongResumeTime:!1}},t.getOutgoingMessageSound=function(){return a.userPreferencesStore.getUser(i.KEYS.OUTGOING_MESSAGE_SOUND)},t.getWebNotificationsBBStatus=s,t.setCollapseMuted=function(e){a.userPreferencesStore.setUser(i.KEYS.GLOBAL_COLLAPSE_MUTED,e)},t.setGlobalCallRingtone=function(e){a.userPreferencesStore.setUser(i.KEYS.GLOBAL_MUTE_CALL_RINGTONE,!e)},t.setGlobalNotifications=function(e){a.userPreferencesStore.setUser(i.KEYS.GLOBAL_MUTE_NOTIFICATIONS,!e)},t.setGlobalOfflineNotifications=function(){},t.setGlobalPreviews=function(e){a.userPreferencesStore.setUser(i.KEYS.GLOBAL_MUTE_PREVIEWS,!e)},t.setGlobalSecurityNotifications=function(e){a.userPreferencesStore.setUser(i.KEYS.SECURITY_NOTIFICATIONS,!e)},t.setGlobalSounds=function(e){a.userPreferencesStore.setUser(i.KEYS.GLOBAL_MUTE_SOUNDS,!e)},t.setIgnoreNondirectGroupMsg=function(e){o},t.setOfflineNotificationsBBStatus=function(){},t.setOutgoingMessageSound=function(e){a.userPreferencesStore.setUser(i.KEYS.OUTGOING_MESSAGE_SOUND,e)},t.setWebNotificationsBBStatus=function(e){var t,n;const r=s(),{isDismissed:o,firstSeenTime:l=null}=r,u=null!==(t=e.isDismissed)&&void 0!==t?t:o,c=null!==(n=e.firstSeenTime)&&void 0!==n?n:l;a.userPreferencesStore.setUser(i.KEYS.WEB_NOTIFICATIONS_BB_STATUS,{isDismissed:u,firstSeenTime:c})};var r=n(955562),i=n(94872),a=n(53575);const o=null;function s(){var e;return null!==(e=a.userPreferencesStore.getUser(i.KEYS.WEB_NOTIFICATIONS_BB_STATUS))&&void 0!==e?e:{isDismissed:!1,firstSeenTime:null}}},377773:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.NuxPrefsEvent=void 0,t.getNUX=c,t.getNuxSyncList=p,t.nuxExistsInNuxSync=_,t.removeAllNuxSync=function(){s.userPreferencesStore.set(o.KEYS.NUX_LIST,[])},t.removeNUX=d,t.resetNux=function(e){d(e);const t=s.userPreferencesStore.get(o.KEYS.NUX_LIST).filter((t=>t!==e));s.userPreferencesStore.set(o.KEYS.NUX_LIST,t)},t.setNUX=function(e,t){s.userPreferencesStore.setUser(e,t),u.handleNuxChange(e)},t.shouldShowNUX=function(e){const t=(0,a.getNuxSyncKey)(e);if(null!=t&&_(t))return!1;const n=c(e);return!n||n.views<(0,a.getNuxMaxViews)(e)},t.updateNuxSyncList=function(e){const t=new Set(p());e.forEach((e=>{let{nuxKey:n,acknowledged:r}=e;r?t.add(n):t.delete(n)})),s.userPreferencesStore.set(o.KEYS.NUX_LIST,Array.from(t))};var i=r(n(395654)),a=n(95589),o=n(94872),s=n(53575);class l extends i.default{handleNuxChange(e){this.trigger(e)}}const u=new l;function c(e){return s.userPreferencesStore.getUser(e)}function d(e){s.userPreferencesStore.setUser(e),u.handleNuxChange(e)}function p(){var e;return null!==(e=s.userPreferencesStore.get(o.KEYS.NUX_LIST))&&void 0!==e?e:[]}function _(e){return p().includes(e)}t.NuxPrefsEvent=u},575525:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.PROD_KEYS=void 0,(0,r(n(441143)).default)(!0,"prod only");const i=Object.freeze({LOG_PREEMPT_CLEAN_UP:"WALogPreemptiveCleanUp"});t.PROD_KEYS=i},53575:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.userPreferencesStore=t.UserPreferencesStore=void 0;var i=r(n(393386)),a=r(n(617204)),o=r(n(402525)),s=r(n(907287)),l=r(n(706223)),u=r(n(236642)),c=r(n(737065)),d=n(102461),p=n(94872),_=n(128378);class f extends d.UserPreferencesStoreBase{getMe(){return n(459857).getMaybeMeUser()}getKeys(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,s.default)(t,t.map((t=>e.getItem(t,n))))}setKeys(e,t){(0,o.default)(t,(function(t,n){e.setItem(n,t)}))}getAllKeyValues(){const e=super.getStorage();return(0,a.default)(Object.keys(e).map((function(t){return[t,e.getItem(t)]})))}setAllKeyValues(e){const t=super.getStorage();Object.keys(e).forEach((function(n){null!=e[n]&&t.setItem(n,e[n])}))}updatePreservedUserKeys(){var e;const t=this.getMe(),n=null!==(e=super.get(p.KEYS.PRESERVED_USER_KEYS,{storage:u.default}))&&void 0!==e?e:[];if(null!=t){const e=_.LS_PRESERVE_USER_KEYS.map((e=>(0,l.default)(this._concatenateKey(t.toString(),e))));super.set(p.KEYS.PRESERVED_USER_KEYS,(0,i.default)(n,e),{storage:u.default})}}getPSIgnoringCache(e){return super.get(e,{storage:u.default,ignoreCache:!0})}getTS(e){return super.get(e,{storage:c.default})}setTS(e,t){super.set(e,t,{storage:c.default})}setUserSession(e,t){const n=this.getMe();if(!n)return void __LOG__(3)`userPrefs: Me has not loaded yet.`;const r=(0,l.default)(this._concatenateKey(n.toString(),e));super.set(r,t,{storage:c.default})}getUserSession(e){const t=this.getMe();if(!t)return __LOG__(3)`userPrefs: Me has not loaded yet.`,null;const n=(0,l.default)(this._concatenateKey(t.toString(),e));return super.get(n,{storage:c.default})}clearUserSessionItem(e){const t=this.getMe();if(!t)return void __LOG__(3)`userPrefs: Me has not loaded yet.`;const n=(0,l.default)(this._concatenateKey(t.toString(),e));c.default.removeItem(n)}getCollection(e){return this.getUser(e)}setCollection(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];null==this.getMe()||n||this.setUser(e,t)}getUser(e){const t=this.getMe();if(!t)return __LOG__(3)`userPrefs: Me has not loaded yet.`,null;const n=(0,l.default)(this._concatenateKey(t.toString(),e));return super.get(n)}setUser(e,t){const n=this.getMe();if(!n)return void __LOG__(3)`userPrefs: Me has not loaded yet.`;const r=(0,l.default)(this._concatenateKey(n.toString(),e));super.set(r,t)}_concatenateKey(e,t){return[e,t].join(":")}}t.UserPreferencesStore=f;const h=new f;t.userPreferencesStore=h},173077:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.THIS_TAB=void 0,t.currentTabHasMutex=function(){return(c()||"").includes(u)},t.getMutex=c,t.getNoTakeover=function(){return!!l.userPreferencesStore.getTS(s.KEYS.NO_TAKEOVER)},t.localTakeoverSuccess=function(){const e={};e.wa_tab_src=u,(0,i.default)(a.default,"localStorage").setItem(s.KEYS.LOCAL_TAKEOVER_OK,JSON.stringify(e)),(0,i.default)(a.default,"localStorage").removeItem(s.KEYS.LOCAL_TAKEOVER_OK)},t.mutexFilter=function(e){if(e.key!==s.KEYS.WHATSAPP_MUTEX)return!1;if(!(e.newValue||"").includes(u))return!0;return!1},t.parseMutex=function(e){const t=e?JSON.parse(e):"";return t?t.toString().split(/:/).pop():t},t.removeMutex=function(){l.userPreferencesStore.set(s.KEYS.WHATSAPP_MUTEX,null,{storage:o.default})},t.setMutex=function(e){const t=e?u+":"+e:e;l.userPreferencesStore.set(s.KEYS.WHATSAPP_MUTEX,t,{storage:o.default})},t.setNoTakeover=function(e){l.userPreferencesStore.setTS(s.KEYS.NO_TAKEOVER,e)},t.takeoverFilter=function(e){if(e.key!==s.KEYS.LOCAL_TAKEOVER_OK)return!1;if(!(e.newValue||"").includes(u))return!0;return!1};var i=r(n(132375)),a=r(n(174285)),o=r(n(236642)),s=n(94872),l=n(53575);const u="x"+Math.round(1e9*Math.random());function c(){return l.userPreferencesStore.getPSIgnoringCache(s.KEYS.WHATSAPP_MUTEX)}t.THIS_TAB=u},128378:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TS_PRESERVE_KEYS=t.RECENT_STICKER_INITIALIZED_STATUS_TYPE=t.NON_CRITIAL_DATA_SYNC_STATUS_TYPE=t.LS_PRESERVE_USER_KEYS=t.LS_PRESERVE_KEYS=t.LS_ONLY_KEYS=void 0;var r=n(94872);const i=n(76672)({RECENT_STICKER_INITIALIZED:"recent_sticker_initialized"});t.NON_CRITIAL_DATA_SYNC_STATUS_TYPE=i;const a=n(76672)({SUCCESS:"success",NEED_REQUEST_BOOTSTRAP:"need_request_bootstrap"});t.RECENT_STICKER_INITIALIZED_STATUS_TYPE=a;const o=[r.KEYS.LOG_CURSOR,r.KEYS.WHATSAPP_MUTEX,r.KEYS.WHATSAPP_LS_VERSION];t.LS_ONLY_KEYS=o;const s=[r.KEYS.LANG,r.KEYS.WHATSAPP_MUTEX,r.KEYS.OLD_LOGOUT_CREDS,r.KEYS.PRESERVED_USER_KEYS,r.KEYS.THEME,r.KEYS.SYSTEM_THEME_MODE];t.LS_PRESERVE_KEYS=s;t.TS_PRESERVE_KEYS=[];const l=[r.COLLECTIONS_KEYS.EMOJI_VARIANT_COLLECTION,r.COLLECTIONS_KEYS.RECENT_EMOJI_COLLECTION,r.COLLECTIONS_KEYS.RECENT_REACTIONS_COLLECTION,r.COLLECTIONS_KEYS.CHAT_PREFERENCE_COLLECTION,r.KEYS.GLOBAL_MUTE_NOTIFICATIONS,r.KEYS.OUTGOING_MESSAGE_SOUND,r.KEYS.GLOBAL_MUTE_PREVIEWS,r.KEYS.GLOBAL_COLLAPSE_MUTED,r.KEYS.GLOBAL_MUTE_SOUNDS,r.KEYS.AUTO_DOWNLOAD_PHOTOS,r.KEYS.AUTO_DOWNLOAD_VIDEOS,r.KEYS.AUTO_DOWNLOAD_AUDIO,r.KEYS.AUTO_DOWNLOAD_DOCUMENTS,r.KEYS.TOS_3,r.KEYS.POSTCODE_AUTO_OPEN_CHANGE_POSTCODE_COUNT,r.KEYS.POSTCODE_TOOLTIP_VIEW_COUNT,r.KEYS.PERSISTENT_EXPIRING_ID];t.LS_PRESERVE_USER_KEYS=l},714443:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"asChatJid",{enumerable:!0,get:function(){return r.asChatJid}}),Object.defineProperty(t,"asMulticastJid",{enumerable:!0,get:function(){return r.asMulticastJid}}),Object.defineProperty(t,"asPhoneChatJid",{enumerable:!0,get:function(){return r.asPhoneChatJid}}),Object.defineProperty(t,"asStatusJid",{enumerable:!0,get:function(){return r.asStatusJid}}),Object.defineProperty(t,"authorAsUserJid",{enumerable:!0,get:function(){return r.authorAsUserJid}}),Object.defineProperty(t,"authorToUserId",{enumerable:!0,get:function(){return r.authorToUserId}}),Object.defineProperty(t,"defaultDeviceJidForUser",{enumerable:!0,get:function(){return r.defaultDeviceJidForUser}}),Object.defineProperty(t,"defaultLidDeviceJidForLidUserJid",{enumerable:!0,get:function(){return r.defaultLidDeviceJidForLidUserJid}}),Object.defineProperty(t,"defaultPhoneDeviceJidForUser",{enumerable:!0,get:function(){return r.defaultPhoneDeviceJidForUser}}),Object.defineProperty(t,"extractDeviceIDParts",{enumerable:!0,get:function(){return r.extractDeviceIDParts}}),Object.defineProperty(t,"extractDeviceId",{enumerable:!0,get:function(){return r.extractDeviceId}}),Object.defineProperty(t,"extractFromJid",{enumerable:!0,get:function(){return r.extractFromJid}}),Object.defineProperty(t,"extractJidFromJidWithType",{enumerable:!0,get:function(){return r.extractJidFromJidWithType}}),Object.defineProperty(t,"extractPhoneUserJid",{enumerable:!0,get:function(){return r.extractPhoneUserJid}}),Object.defineProperty(t,"extractUserId",{enumerable:!0,get:function(){return r.extractUserId}}),Object.defineProperty(t,"extractUserJid",{enumerable:!0,get:function(){return r.extractUserJid}}),Object.defineProperty(t,"fullFormDeviceJidString",{enumerable:!0,get:function(){return r.fullFormDeviceJidString}}),t.getGroupCallDomain=void 0,Object.defineProperty(t,"getGroupDomain",{enumerable:!0,get:function(){return r.getGroupDomain}}),Object.defineProperty(t,"getServerDomain",{enumerable:!0,get:function(){return r.getServerDomain}}),t.getUserDomain=void 0,Object.defineProperty(t,"groupIdFromJid",{enumerable:!0,get:function(){return r.groupIdFromJid}}),Object.defineProperty(t,"interpretAndValidateJid",{enumerable:!0,get:function(){return r.interpretAndValidateJid}}),Object.defineProperty(t,"interpretAsDeviceId",{enumerable:!0,get:function(){return r.interpretAsDeviceId}}),Object.defineProperty(t,"interpretAsGroupJid",{enumerable:!0,get:function(){return r.interpretAsGroupJid}}),Object.defineProperty(t,"interpretAsNumber",{enumerable:!0,get:function(){return r.interpretAsNumber}}),Object.defineProperty(t,"interpretAsPhoneUserJid",{enumerable:!0,get:function(){return r.interpretAsPhoneUserJid}}),Object.defineProperty(t,"interpretAsUserJid",{enumerable:!0,get:function(){return r.interpretAsUserJid}}),Object.defineProperty(t,"isPrimaryDevice",{enumerable:!0,get:function(){return r.isPrimaryDevice}}),Object.defineProperty(t,"maybeSanitizeLogLineText",{enumerable:!0,get:function(){return r.maybeSanitizeLogLineText}}),Object.defineProperty(t,"parseJidParts",{enumerable:!0,get:function(){return r.parseJidParts}}),Object.defineProperty(t,"phoneNumberFromJid",{enumerable:!0,get:function(){return r.phoneNumberFromJid}}),Object.defineProperty(t,"sanitizeJidForLogging",{enumerable:!0,get:function(){return r.sanitizeJidForLogging}}),Object.defineProperty(t,"stripAgentIdFromPhoneDeviceJid",{enumerable:!0,get:function(){return r.stripAgentIdFromPhoneDeviceJid}}),Object.defineProperty(t,"switchOnChatJidType",{enumerable:!0,get:function(){return r.switchOnChatJidType}}),Object.defineProperty(t,"switchOnJidType",{enumerable:!0,get:function(){return r.switchOnJidType}}),Object.defineProperty(t,"switchOnMsgrChatJidType",{enumerable:!0,get:function(){return r.switchOnMsgrChatJidType}}),Object.defineProperty(t,"switchOnMulticastJidType",{enumerable:!0,get:function(){return r.switchOnMulticastJidType}}),Object.defineProperty(t,"switchOnPhoneChatJidType",{enumerable:!0,get:function(){return r.switchOnPhoneChatJidType}}),Object.defineProperty(t,"switchOnPhoneJidType",{enumerable:!0,get:function(){return r.switchOnPhoneJidType}}),Object.defineProperty(t,"toBroadcastJid",{enumerable:!0,get:function(){return r.toBroadcastJid}}),Object.defineProperty(t,"toGroupJid",{enumerable:!0,get:function(){return r.toGroupJid}}),Object.defineProperty(t,"toLidUserJid",{enumerable:!0,get:function(){return r.toLidUserJid}}),Object.defineProperty(t,"toPhoneDeviceJid",{enumerable:!0,get:function(){return r.toPhoneDeviceJid}}),Object.defineProperty(t,"toPhoneUserJid",{enumerable:!0,get:function(){return r.toPhoneUserJid}}),Object.defineProperty(t,"unsafeCoerceToDeviceId",{enumerable:!0,get:function(){return r.unsafeCoerceToDeviceId}}),Object.defineProperty(t,"unsafeCoerceToDeviceJid",{enumerable:!0,get:function(){return r.unsafeCoerceToDeviceJid}}),Object.defineProperty(t,"unsafeCoerceToGroupJid",{enumerable:!0,get:function(){return r.unsafeCoerceToGroupJid}}),Object.defineProperty(t,"unsafeCoerceToUserJid",{enumerable:!0,get:function(){return r.unsafeCoerceToUserJid}}),Object.defineProperty(t,"userIdFromJid",{enumerable:!0,get:function(){return r.userIdFromJid}});var r=n(616310);const i=(0,r.createJidUtils)({platform:"whatsapp"}),a=i.getUserDomain;t.getUserDomain=a;const o=i.getGroupCallDomain;t.getGroupCallDomain=o},383047:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCodeFromLogoutReason=function(e){switch(e){case r.LogoutReason.ClientFatalError:return r.LOGOUT_REASON_CODE.CLIENT_FATAL;case r.LogoutReason.SyncdFailure:case r.LogoutReason.SyncdErrorDuringBootstrap:case r.LogoutReason.AccountSyncError:case r.LogoutReason.SyncdTimeout:case r.LogoutReason.CriticalSyncTimeout:return r.LOGOUT_REASON_CODE.SYNC_FAIL;case r.LogoutReason.HistorySyncTimeout:return r.LOGOUT_REASON_CODE.INITIAL_HISTORY_SYNC_TIMEOUT;default:return null}},t.getPrevLogoutReasonCode=function(){return i},t.setPrevLogoutReasonCode=function(e){i=e};var r=n(332108);let i=null},528646:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.memoizeWithClear=function(e){let t;return[function(){return t||(t=[e()]),t[0]},function(){t=null}]}},574787:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=class{constructor(){this._plugins=new Map}getKey(e,t){return`${e}${t?`:${t}`:""}`}registerPlugins(e){e.forEach((e=>{const t=this.getKey(e.type,e.subtype);this._plugins.has(t)&&__LOG__(3)`PluginRegistry:addPlugin called for existing key`,this._plugins.set(t,e)}))}getPlugin(e,t){const n=this.getKey(e,t);return this._plugins.get(n)}getAllPlugins(){return Array.from(this._plugins.values())}}},755985:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isWorker=function(){return"undefined"!=typeof WorkerGlobalScope&&"function"==typeof importScripts}},976885:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.maxPerGroup=function(e,t,n){const r=new Map;for(const i of e){const e=n(i),a=r.get(e);(null==a||t(i)>=t(a))&&r.set(e,i)}return Array.from(r.values())}},628199:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.flattenPairList=function(e){return(0,i.default)(e.map((e=>[e[0],e[1]])))},t.unFlattenPairList=function(e){if(e.length%2!=0)throw new RangeError("Flattened pairs come in 2, invalid list size to unflatten!");const t=[];for(let n=0;n<e.length;n++)t.push([e[n],e[++n]]);return t};var i=r(n(385564))},468776:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.appendPrefilledMsg=_,t.formatInteractive=function(e){var t,n;let{formatAsSearchResult:r=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var o;if(e.interactiveType===a.default.SHOPS_STOREFRONT)return e.caption||(null===(o=e.interactiveHeader)||void 0===o?void 0:o.title)||"";if(e.nativeFlowName===i.default.ORDER_DETAILS){const t=p(e);if(null!=t)return t}if(e.nativeFlowName===i.default.ORDER_STATUS){const t=d(e);if(null!=t)return t}return[null===(t=e.interactiveHeader)||void 0===t?void 0:t.title,r?null===(n=e.interactiveHeader)||void 0===n?void 0:n.subtitle:null,e.caption,e.footer].filter(Boolean).join("\n")},t.formatOrderDetailsMessagePreview=p,t.formatOrderStatusMessage=d;var i=r(n(753110)),a=r(n(182394)),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(153593)),s=n(931678),l=n(642680),u=n(548360);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}function d(e){const t=(0,l.getOrderStatusInfo)(e);return null==t?null:_(e.caption,null==t?void 0:t.status).toString()}function p(e){const t=(0,s.getOrderInfo)(e);if(null==t)return null;const{items:n,totalAmount:r,currency:i}=t,a=o.formatAmount(i,r);return n[0].name+" · "+a}function _(e,t){let n="";switch(t){case l.OrderStatus.Pending:n=u.fbt._("Status: Order pending",null,{hk:"4m2XYh"});break;case l.OrderStatus.Canceled:n=u.fbt._("Status: Order canceled",null,{hk:"2DMTyx"});break;case l.OrderStatus.PartiallyShipped:n=u.fbt._("Status: Order partially shipped",null,{hk:"1hZ92H"});break;case l.OrderStatus.Complete:n=u.fbt._("Status: Order complete",null,{hk:"k6UB5"});break;case l.OrderStatus.Shipped:n=u.fbt._("Status: Order shipped",null,{hk:"3c9XV9"});break;case l.OrderStatus.Processing:n=u.fbt._("Status: Order processing",null,{hk:"2IS36d"})}return(null==e?void 0:e.toLowerCase().includes(n.toString().toLowerCase()))?e||"":(n.toString()+"\n"+(e||"")).trim()}},832547:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PRODUCT_INQUIRY_TYPE=t.BIZ_SYSTEM_MSG_SUBTYPES_V2_INIT=t.BIZ_SYSTEM_MSG_SUBTYPES_V2=t.BIZ_SYSTEM_MSG_SUBTYPES=void 0;t.BIZ_SYSTEM_MSG_SUBTYPES=["blue_msg_bsp_fb_to_bsp_premise","blue_msg_bsp_fb_to_self_fb","blue_msg_bsp_fb_to_self_premise","blue_msg_bsp_fb_unverified","blue_msg_bsp_fb_unverified_to_bsp_premise_verified","blue_msg_bsp_fb_unverified_to_self_fb_verified","blue_msg_bsp_fb_unverified_to_self_premise_verified","blue_msg_bsp_fb_verified","blue_msg_bsp_fb_verified_to_bsp_premise_unverified","blue_msg_bsp_fb_verified_to_self_fb_unverified","blue_msg_bsp_fb_verified_to_self_premise_unverified","blue_msg_bsp_premise_to_self_premise","blue_msg_bsp_premise_unverified","blue_msg_bsp_premise_unverified_to_self_premise_verified","blue_msg_bsp_premise_verified","blue_msg_bsp_premise_verified_to_self_premise_unverified","blue_msg_consumer_to_bsp_fb_unverified","blue_msg_consumer_to_bsp_premise_unverified","blue_msg_consumer_to_self_fb_unverified","blue_msg_consumer_to_self_premise_unverified","blue_msg_self_fb_to_bsp_premise","blue_msg_self_fb_to_self_premise","blue_msg_self_fb_unverified","blue_msg_self_fb_unverified_to_bsp_premise_verified","blue_msg_self_fb_unverified_to_self_premise_verified","blue_msg_self_fb_verified","blue_msg_self_fb_verified_to_bsp_premise_unverified","blue_msg_self_fb_verified_to_self_premise_unverified","blue_msg_self_premise_to_bsp_premise","blue_msg_self_premise_unverified","blue_msg_self_premise_verified","blue_msg_to_bsp_fb","blue_msg_to_consumer","blue_msg_to_self_fb","blue_msg_unverified_to_bsp_fb_verified","blue_msg_unverified_to_bsp_premise_verified","blue_msg_unverified_to_self_fb_verified","blue_msg_unverified_to_verified","blue_msg_verified_to_bsp_fb_unverified","blue_msg_verified_to_bsp_premise_unverified","blue_msg_verified_to_self_fb_unverified","blue_msg_verified_to_unverified"];const n=["biz_privacy_mode_init_fb","biz_privacy_mode_init_bsp"];t.BIZ_SYSTEM_MSG_SUBTYPES_V2_INIT=n;const r=[...n,"biz_privacy_mode_to_fb","biz_privacy_mode_to_bsp"];t.BIZ_SYSTEM_MSG_SUBTYPES_V2=r;t.PRODUCT_INQUIRY_TYPE="product_inquiry"},913430:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){switch(e){case r.VERIFIED_LEVEL.HIGH:return"high";case r.VERIFIED_LEVEL.LOW:return"low";case r.VERIFIED_LEVEL.UNKNOWN:default:return"unknown"}};var r=n(817649)},637842:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.scanComplianceInfoForMissingData=t.isBusinessCompliant=t.getGrievanceOfficerDetailsError=t.getEntityTypeText=t.getCustomerCareDetailsError=t.existsGrievanceOfficerDetailsContact=t.existsFieldIgnoreHardEnforcement=t.existsField=t.existsCustomerCareDetailsContact=void 0;var r=n(72696),i=n(817649),a=n(537469),o=n(548360);t.getEntityTypeText=e=>{const{entityType:t,entityTypeCustom:n,isRegistered:r}=e||{},a={[i.businessTypeOptions.limitedLiabilityPartnership]:o.fbt._("Limited liability partnership",null,{hk:"2dwmwU"}),[i.businessTypeOptions.soleProprietorship]:o.fbt._("Sole proprietorship",null,{hk:"2N7jks"}),[i.businessTypeOptions.partnership]:o.fbt._("Partnership",null,{hk:"ZeckL"}),[i.businessTypeOptions.publicCompany]:o.fbt._("Public Company",null,{hk:"1YuMvC"}),[i.businessTypeOptions.privateCompany]:o.fbt._("Private Company",null,{hk:"WL0uU"}),[i.businessTypeOptions.other]:o.fbt._("Other",null,{hk:"3zua5D"})},s=n||a[t]||"";if(!s)return"";let l="";return[i.businessTypeOptions.partnership,i.businessTypeOptions.other].includes(t)&&(l=null!=r&&r?o.fbt._("Registered Business",null,{hk:"3N1x9I"}):o.fbt._("Not Registered Business",null,{hk:"2zDsuK"})),`${s.toString()}${l?` (${l.toString()})`:""}`};const s=(e,t)=>!(!e&&!t),l=e=>!!(null==e?void 0:e.trim());t.existsFieldIgnoreHardEnforcement=l;const u=(e,t)=>!(0,r.canSeeECommerceComplianceIndiaHardEnforcementBusinessJourney)(t.user)||l(e);t.existsField=u;const c=(e,t,n,i,a)=>!(0,r.canSeeECommerceComplianceIndiaHardEnforcementBusinessJourney)(t.user)||n.some((t=>l(t===i?a:null==e?void 0:e[t]))),d=(e,t,n,r)=>c(e,t,["mobileNumber","landlineNumber"],n,r);t.existsCustomerCareDetailsContact=d;const p=(e,t,n,r)=>c(e,t,["mobileNumber","landlineNumber","email"],n,r);t.existsGrievanceOfficerDetailsContact=p;t.isBusinessCompliant=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if(!(0,r.canSeeECommerceComplianceIndiaHardEnforcementBusinessJourney)(n.user))return!0;if(!t)return!1;const{entityName:i,entityType:a,entityTypeCustom:o,customerCareDetails:l,grievanceOfficerDetails:c}=t;return[e,i,null==l?void 0:l.email,null==c?void 0:c.name].every((e=>u(e,n)))&&s(a,o)&&d(l,n)&&p(c,n)};t.getCustomerCareDetailsError=(e,t,n,r,i)=>d(e,i,t,n)?r:"";t.getGrievanceOfficerDetailsError=(e,t,n,r,i)=>p(e,i,t,n)?r:"";t.scanComplianceInfoForMissingData=e=>{const t=(null==e?void 0:e.countryCodeOrigin)===String(a.SyntheticCountryCode.NotApplicable),n=!t&&void 0!==(null==e?void 0:e.countryCodeOrigin),r=!t&&void 0!==(null==e?void 0:e.importerName);return{isExempt:t,hasImporterAddress:!t&&void 0!==(null==e?void 0:e.importerAddress)&&[e.importerAddress.street1,e.importerAddress.street2,e.importerAddress.city,e.importerAddress.region,e.importerAddress.postalCode,e.importerAddress.countryCode].some((e=>e)),hasImporterName:r,hasCountryCodeOrigin:n}}},676594:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.COMPLIANCE_INFO_LENGTH=t.COMPLIANCE_INFO_CODES=void 0;t.COMPLIANCE_INFO_CODES={INDIA:"IN"};t.COMPLIANCE_INFO_LENGTH={ENTITY_NAME:1024,ENTITY_TYPE_CUSTOM:1024,EMAIL:256,GRIEVANCE_OFFICER_NAME:256,LANDLINE_NUMBER:20,MOBILE_NUMBER:20,IMPORTER_NAME:1024,STREET1:1024,STREET2:1024,CITY:1024,REGION:1024,POSTAL_CODE:12}},944878:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.CypherType=void 0,t.cypherStringToString=function(e){return e},t.decryptDataWithSymmetricKey=c,t.decryptDataWithSymmetricKeyToString=function(){return p.apply(this,arguments)},t.genCypher=function(){return _.apply(this,arguments)},t.stringToCypherString=function(e){return e};var i=r(n(348926)),a=n(81758),o=n(78088);const s=n(76672).Mirrored(["PhoneNumberAndPostcode","Postcode"]);function l(){return u.apply(this,arguments)}function u(){return(u=(0,i.default)((function*(e,t,n){const{subtle:r}=yield(0,o.getEngine)();return r.encrypt({name:"AES-GCM",iv:new Uint8Array((0,o.base64ToArrayBuffer)(t)),tagLength:128},e,(0,o.stringToArrayBuffer)(n))}))).apply(this,arguments)}function c(){return d.apply(this,arguments)}function d(){return(d=(0,i.default)((function*(e,t,n){const{subtle:r}=yield(0,o.getEngine)(),i=yield r.importKey("raw",e,{name:"AES-GCM"},!1,["decrypt"]);return r.decrypt({name:"AES-GCM",iv:new Uint8Array((0,o.base64ToArrayBuffer)(n)),tagLength:128},i,(0,o.base64ToArrayBuffer)(t))}))).apply(this,arguments)}function p(){return(p=(0,i.default)((function*(e,t,n){return(0,a.arrayBufferToString)(yield c(e,t,n))}))).apply(this,arguments)}function _(){return(_=(0,i.default)((function*(e,t){const n=(0,o.arrayBufferToBase64)(yield(0,o.getRandomValues)(new Uint8Array(16)));try{const{subtle:r}=yield(0,o.getEngine)(),i=yield r.generateKey({name:"AES-GCM",length:256},!0,["encrypt"]),a=(0,o.arrayBufferToBase64)(yield l(i,n,JSON.stringify(t))),s=yield r.exportKey("raw",i);return{cypher:`AesKey=${yield(0,o.encryptWithPublicKey)(e,s)};IV=${n};Data=${a}`,exportedAesKey:s,iv:n}}catch(e){return __LOG__(3)`[direct-connection] cypher creation failed with ${e.toString()}`,null}}))).apply(this,arguments)}t.CypherType=s},263079:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.directConnectionBusinessNumbersFromAbprop=function(){const e=(0,a.getABPropConfigValue)("direct_connection_business_numbers");if("string"==typeof e&&e.length>0)return e.split(",");return[]},t.editPostcodeByDefaultEnabled=function(){return(0,a.getABPropConfigValue)("dc_edit_postcode_by_default_enabled")},t.enablePostcodeInCatalog=function(){return(0,a.getABPropConfigValue)("web_abprop_direct_connection_md")},t.genDirectConnectionMessageModifiers=function(){return m.apply(this,arguments)},t.supportsDirectConnection=f;var i=r(n(348926)),a=n(287461),o=n(373070),s=n(533494),l=n(241588),u=n(669050),c=n(771146);function d(){return((0,c.getBusinessProfileQueryVersion)()&c.DIRECT_CONNECTION_FLAG)>0}function p(){return l.ServerProps.isDirectConnectionForPLMTransparent&&!(0,a.getABPropConfigValue)("web_abprop_direct_connection_md")}function _(e,t){return e===o.MSG_TYPE.LIST&&t===s.Message$ListMessage$ListType.PRODUCT_LIST}function f(){return(0,a.getABPropConfigValue)("web_abprop_direct_connection_md")}function h(){return g.apply(this,arguments)}function g(){return(g=(0,i.default)((function*(e,t,r){if(p()||!_(e,t)||!r)return!1;if(!d())return __LOG__(3)`[direct-connection] This web client cannot detect if the product list message recevied is coming from a direct connection business`,"unknown";const i=(0,u.createWid)(r),{BusinessProfileCollection:a}=n(69108);let o=a.get(i);return o&&o.profileOptions||(o=yield a.find(i)),o.isBusinessDirectConnection()||!1}))).apply(this,arguments)}function m(){return(m=(0,i.default)((function*(e,t,n){const r=yield h(e,t,n);return!0!==r||f()?{requiresDirectConnection:r}:{requiresDirectConnection:r,type:o.MSG_TYPE.UNKNOWN,subtype:"phone_only_feature"}}))).apply(this,arguments)}},78088:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.arrayBufferToBase64=_,t.arrayBufferToString=h,t.base64ToArrayBuffer=p,t.certificateStringToString=function(e){return e},t.encodeToString=function(e){return e.map((e=>{const t=_(e.toSchema(!0).toBER(!1)).split(/(.{0,64})/g).filter((e=>""!==e)).join("\n");return`${s}\n${t}\n${l}`})).join("\n")},t.encryptWithPublicKey=function(){return M.apply(this,arguments)},t.extractCertificates=S,t.fetchFromCABundle=function(){return E.apply(this,arguments)},t.genRootIssuers=function(){return A.apply(this,arguments)},t.getCommonName=C,t.getEngine=P,t.getRandomValues=function(){return I.apply(this,arguments)},t.stringToArrayBuffer=f,t.stringToCertificateString=function(e){return e},t.validateCertificates=function(){return v.apply(this,arguments)};var i=r(n(348926)),a=r(n(170872)),o=n(929595);const s="-----BEGIN CERTIFICATE-----",l="-----END CERTIFICATE-----",u=`(?:${s})((?:.|\n)*?)(?:${l})`;function c(){return n.e(6352).then(n.bind(n,614231))}function d(){return n.e(6352).then(n.bind(n,865267))}function p(e){let t="";try{t=atob(e)}catch(e){__LOG__(3)`[direct-connection] base64 decoding failed with ${e.toString()}`}return f(t)}function _(e){return btoa(h(e))}function f(e){const t=e.length,n=new Uint8Array(t);for(let r=0;r<t;r++)n[r]=e.charCodeAt(r);return n.buffer}function h(e){return String.fromCharCode(...Array.from(new Uint8Array(e)))}function g(){return m.apply(this,arguments)}function m(){return(m=(0,i.default)((function*(e,t){const{CertificateChainValidationEngine:n}=yield c();return new n({trustedCerts:t,certs:e})}))).apply(this,arguments)}function y(e,t){return e.flat().reduce(((e,n)=>e.every((e=>!(0,o.isEqualBuffer)(e.tbs,n.tbs)))&&t.includes(n)?[...e,n]:e),[])}function E(){return(E=(0,i.default)((function*(){const{CA_BUNDLE:e}=yield n.e(239).then(n.bind(n,278596));return S(e)}))).apply(this,arguments)}function S(){return T.apply(this,arguments)}function T(){return(T=(0,i.default)((function*(e){const{Certificate:t}=yield c(),{fromBER:n}=yield d();return(0,a.default)(Array.from(e.matchAll(new RegExp(u,"gm"))).map((e=>{let[r,i]=e;const{result:a}=n(p(i));let o;try{o=a.error?null:new t({schema:a})}catch(e){__LOG__(3)`[direct-connection] certificate chain parsing from Get Public Key IQ failed with ${e.toString()}`}return o})))}))).apply(this,arguments)}function v(){return(v=(0,i.default)((function*(e,t){return(yield g(e,t)).verify()}))).apply(this,arguments)}function A(){return(A=(0,i.default)((function*(e,t){const n=yield g(e,t),r=y(yield Promise.all(e.map((e=>n.findIssuer(e,n)))),t);return 0===r.length?(__LOG__(3)`[direct-connection] no trusted root certificates could be found for ${C(e[0])}`,null):r}))).apply(this,arguments)}function C(e){var t;return null===(t=e.issuer.typesAndValues.find((e=>{let{type:t}=e;return"2.5.4.3"===t})))||void 0===t?void 0:t.value.valueBlock.value}function P(){return O.apply(this,arguments)}function O(){return(O=(0,i.default)((function*(){const{getEngine:e}=yield c();return e()}))).apply(this,arguments)}function I(){return(I=(0,i.default)((function*(e){const{getRandomValues:t}=yield c();return t(e)}))).apply(this,arguments)}function M(){return(M=(0,i.default)((function*(e,t){const n=yield e.getPublicKey({algorithm:{algorithm:{name:"RSA-OAEP",hash:{name:"SHA-256"}},usages:["encrypt"]}}),r=yield P();return _(yield r.subtle.encrypt({name:"RSA-OAEP"},n,t))}))).apply(this,arguments)}},454794:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LabelItemParentType=void 0;const r=n(76672).Mirrored(["Chat","Contact","Msg"]);t.LabelItemParentType=r},388536:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addToLabelCollection=function(e,t,i){if(t&&t.length>0){const o=n(478353).LabelCollection;t.forEach((t=>{const n=o.gadd({id:t});n.labelItemCollection.gadd({id:a(e,t,i),labelId:t,parentId:e,parentType:i}),i===r.LabelItemParentType.Chat&&n.labelItemCollection.gadd({id:a(e,t,r.LabelItemParentType.Contact),labelId:t,parentId:e,parentType:r.LabelItemParentType.Contact})}))}},t.createLabelItemId=a,t.getParentCollection=function(e){switch(e){case r.LabelItemParentType.Chat:return n(965012).ChatCollection;case r.LabelItemParentType.Contact:return n(121977).ContactCollection;case r.LabelItemParentType.Msg:return n(301460).MsgCollection}},t.getParentTypeFromModel=i,t.initializeLabels=function(e){const t=i(e);e.labels=n(478353).LabelCollection.getLabelsForModel(e.id.toString(),t)},t.removeLabelFromCollection=function(e,t,i){const o=n(478353).LabelCollection.get(t),s=null==o?void 0:o.labelItemCollection;if(!s)return void __LOG__(3)`labelItemCollection does not exist for lableId ${t}`;s.remove(a(e,t,i)),i===r.LabelItemParentType.Chat&&s.remove(a(e,t,r.LabelItemParentType.Contact))};var r=n(454794);function i(e){if(e instanceof n(413497).Chat)return r.LabelItemParentType.Chat;if(e instanceof n(428760).default)return r.LabelItemParentType.Contact;if(e instanceof n(387191).Msg)return r.LabelItemParentType.Msg;throw new Error("getParentTypeFromModel: model is invalid")}function a(e,t,n){return`${e}_${t}_${n}`}},395557:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parse=function(e){return JSON.parse(e)},t.stringify=function(e){return JSON.stringify(e)}},199666:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getBusinessHours=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{config:n}=e,r=(new Date).getDay(),a=i.DAYS_OF_WEEK.map(((e,a)=>{const o=(r+a)%i.DAYS_OF_WEEK.length,s=i.DAYS_OF_WEEK[o];return{day:l(o),hours:u(n[s],t).toString(),first:0===a}}));return a},t.getBusinessHoursForEdit=function(e){const t=null==e?{}:e.config,{note:n,timezone:r}=e||{};let o;const u=i.DAYS_OF_WEEK.map(((e,n)=>{const r=t[e],i=l(n);let s;return r&&(o=r.mode,r.hours&&(s=r.hours.map((e=>{let[t,n]=e;return[(0,a.minutesToTime)(t),(0,a.minutesToTime)(n)]})))),{dayName:i,dayKey:e,closed:!r,hours:s}}));let c;{const e=s.default.weekdays(!0,0),t=s.default.weekdays().indexOf(e),n=u.splice(t);c=[...n,...u]}return{mode:o,days:c,timezone:r,note:n}},t.getWebsiteLink=function(e){return`https://l.wl.co/l?u=${encodeURIComponent(e)}`};var i=n(817649),a=n(360398),o=n(548360),s=r(n(730381));function l(e){return s.default.weekdays(e)}function u(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];switch(null==e?void 0:e.mode){case i.BUSINESS_HOUR_MODES.SPECIFIC_HOURS:return t?d(null==e?void 0:e.hours):c(null==e?void 0:e.hours);case i.BUSINESS_HOUR_MODES.APPOINTMENT_ONLY:return o.fbt._("By appointment only",null,{hk:"e1vew"});case i.BUSINESS_HOUR_MODES.OPEN_24H:return o.fbt._("Open 24 hours",null,{hk:"1AlfF5"});default:return o.fbt._("Closed",null,{hk:"3IRgct"})}}function c(e){return e?e.map((e=>e.map(a.minutesToTime).join(" - "))).join("\n"):""}function d(e){if(1===(null==e?void 0:e.length))return e[0].map(a.minutesToTime).join(" - ");if(2===(null==e?void 0:e.length)){const t=(0,a.minutesToTime)(e[0][0]),n=(0,a.minutesToTime)(e[0][1]),r=(0,a.minutesToTime)(e[1][0]),i=(0,a.minutesToTime)(e[1][1]);return o.fbt._("{openTime} - {closeTime} and {additionalOpenTime} - {additionalCloseTime}",[o.fbt._param("openTime",t),o.fbt._param("closeTime",n),o.fbt._param("additionalOpenTime",r),o.fbt._param("additionalCloseTime",i)],{hk:"MyQHy"})}return""}},360398:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.minutesToTime=function(e){return a.default.utc().startOf("day").add(e,"minutes").format(i.Clock.timestampStrFormat())},t.timeStringToMinutes=void 0;var i=n(63014),a=r(n(730381));const o=["h:mm A","h:mmA","HH:mm","HH.mm","H:mm","H.mm"];t.timeStringToMinutes=e=>{let t;const n=e.trim();if(!n)return;for(const e of o){const r=(0,a.default)(n,e,!0);if(r.isValid()){t=r;break}}if(!t)return;const r=t,i=(0,a.default)().startOf("day"),s=r.diff(i);return a.default.duration(s).asMinutes()}},247451:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.COOKIE_DOMAIN=void 0;t.COOKIE_DOMAIN=".web.whatsapp.com"},639899:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deleteCookie=function(e){document.cookie=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;"},t.getCookie=function(e){const t=document.cookie.match(new RegExp("(^| )"+e+"=([^;]+)"));return t?t[2]:void 0},t.setCookie=function(e){e.session&&delete e.expirationDate;const t=[];["name","value","domain","path","secure","session","expirationDate"].forEach((n=>{const r=e[n];if(void 0!==r&&"value"!==n)switch(n){case"expirationDate":const i=new Date(e.expirationDate);t.push(`expires=${i.toUTCString()}`);break;case"secure":t.push("secure");break;case"name":const a=e.value||"";t.push(`${String(r)}=${a}`);break;default:t.push(`${n}=${String(r)}`)}})),document.cookie=t.join(";")}},639713:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const[t]=e.source.errors||[];switch(null==t?void 0:t.code){case 2498052:case 2498049:case 2498050:case 2498051:case 2498053:case 2498056:throw new i.ServerStatusCodeError(400,e.message);case 2498048:throw new i.E451;case 2498054:throw new i.ServerStatusCodeError(421)}};var i=n(984330);r(n(767916))},984330:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebdDrop=t.UnexpectedJoinSubgroupResponse=t.UnexpectedJoinGroupViaInviteResponse=t.ServerStatusCodeError=t.Server5xxDrop=t.LogoutDrop=t.EphemeralDrop=t.E507=t.E499=t.E451=t.E404=t.E401=t.ConventionViolationDrop=t.CatalogEditServerError=t.BrowserReplacedDrop=void 0,t.attachErrorLogger=function(e,t,n){return e.catch((e=>{throw __LOG__(4,!0,new Error,!0)`${n||t}, error: ${e}`,SEND_LOGS(t),e}))};var r=n(643930);class i extends((0,r.customError)("ServerStatusCodeError")){constructor(e,t){super(t),this.status=e,this.statusCode=e}}t.ServerStatusCodeError=i;class a extends((0,r.customError)("ServerStatusCodeError")){constructor(e,t,n){super(n),this.errors=t,this.status=e,this.statusCode=e}}t.CatalogEditServerError=a;class o extends((0,r.customError)("E451",!0,i)){constructor(){super(451,"commerce features disabled")}}t.E451=o;class s extends((0,r.customError)("E401",!0,i)){constructor(e){super(401,e)}}t.E401=s;class l extends((0,r.customError)("E404",!0,i)){constructor(e){super(404,e)}}t.E404=l;class u extends((0,r.customError)("E499",!0,i)){constructor(e){super(499,e)}}t.E499=u;class c extends((0,r.customError)("E507",!0,i)){constructor(e,t){super(507,e),this.backoff=Number.isNaN(t)?null:t}}t.E507=c;class d extends((0,r.customError)("WebdDrop")){}t.WebdDrop=d;class p extends((0,r.customError)("BrowserReplacedDrop",!0,d)){}t.BrowserReplacedDrop=p;class _ extends((0,r.customError)("ConventionViolationDrop",!0,d)){}t.ConventionViolationDrop=_;class f extends((0,r.customError)("Server5xxDrop",!0,d)){}t.Server5xxDrop=f;class h extends((0,r.customError)("LogoutDrop",!0,d)){}t.LogoutDrop=h;class g extends((0,r.customError)("EphemeralDrop",!0,d)){}t.EphemeralDrop=g;class m extends((0,r.customError)("UnexpectedJoinGroupViaInviteResponse")){constructor(e,t,n){super(n),this.gid=e,this.membershipApprovalMode=t}}t.UnexpectedJoinGroupViaInviteResponse=m;class y extends((0,r.customError)("UnexpectedJoinSubgroupResponse")){constructor(e,t){super(t),this.membershipApprovalMode=e}}t.UnexpectedJoinSubgroupResponse=y},288057:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UpdateImmediately=t.Unmount=t.UnableToPlayVideoError=t.UnableToGetContentLengthError=t.TranscodeBlobTooLargeError=t.SourceUnavailableError=t.SocketNotOpen=t.SocketError=t.SocketClosed=t.ServerStatusError=t.OverconstrainedError=t.Offline=t.NotSupportedError=t.NotFoundError=t.NotAllowedError=t.ModelError=t.ModelCreateError=t.MediaUnsupportedError=t.MediaNeedsReupload=t.MediaMissing=t.MediaLoadError=t.MediaFileFailedLoad=t.MediaFileError=t.MediaFileEmpty=t.MediaEncryptionError=t.MediaDragDropError=t.MediaDecryptionError=t.InvalidServerResponseError=t.InvalidMediaFileType=t.InvalidImageFileType=t.ImageError=t.GaveUpRetry=t.GUMError=t.GUM=t.FileNotReadableError=t.EncodeWebpError=t.DecodeWebpResultsError=t.DbOnLogoutAbort=t.DbMsgEncKeyNotLoaded=t.DbEncKeyNotLoaded=t.DBInvalidFtsHMACKey=t.ConstraintNotSatisfiedError=t.CatalogImageDownloadError=t.CapabilityUnknown=t.CapabilityInvalid=t.CapabilityError=t.CanNotSendUnencrypted=t.BlockedByProxy=t.BingServerError=t.ActiveChatChanged=t.ActionError=void 0;var r=n(643930);class i extends((0,r.customError)("Offline")){}t.Offline=i;class a extends((0,r.customError)("GaveUpRetry")){}t.GaveUpRetry=a;class o extends((0,r.customError)("CatalogImageDownloadError")){}t.CatalogImageDownloadError=o;class s extends((0,r.customError)("MediaFileError")){}t.MediaFileError=s;class l extends((0,r.customError)("InvalidImageFileType",!0,s)){}t.InvalidImageFileType=l;class u extends((0,r.customError)("InvalidMediaFileType",!0,s)){}t.InvalidMediaFileType=u;class c extends((0,r.customError)("MediaEncryptionError",!0,s)){}t.MediaEncryptionError=c;class d extends((0,r.customError)("MediaDecryptionError",!0,s)){}t.MediaDecryptionError=d;class p extends((0,r.customError)("MediaFileFailedLoad",!0,s)){}t.MediaFileFailedLoad=p;class _ extends((0,r.customError)("MediaFileEmpty",!0,s)){}function f(e){try{return JSON.stringify(e)}catch(t){return e.toString()}}t.MediaFileEmpty=_;class h extends((0,r.customError)("SocketError")){constructor(e){super("string"==typeof e?e:f(e)),this.event=e}}t.SocketError=h;class g extends((0,r.customError)("SocketClosed")){constructor(e){super("string"==typeof e?e:f(e)),this.event=e}}t.SocketClosed=g;class m extends((0,r.customError)("SocketNotOpen")){constructor(e){super(`socket not open, is ${e}`)}}t.SocketNotOpen=m;class y extends((0,r.customError)("BlockedByProxy")){}t.BlockedByProxy=y;class E extends((0,r.customError)("ImageError")){constructor(e,t){super("Image failed to load."),this.src=e,this.status=t,this.target={src:e,status:t}}}t.ImageError=E;class S extends((0,r.customError)("DecodeWebpResultsError")){constructor(e,t){super(e),this.event=t}}t.DecodeWebpResultsError=S;class T extends((0,r.customError)("DecodeWebpError")){constructor(e,t){super(e),this.event=t}}t.EncodeWebpError=T;class v extends((0,r.customError)("ServerStatusError")){constructor(e,t,n){super(`${e||"Server replied with a failed status code"}: ${n}`),this.url=t,this.status=n}}t.ServerStatusError=v;class A extends((0,r.customError)("InvalidServerResponseError")){constructor(e,t,n){let r=`Invalid response for ${e}, with status ${t}`;n&&(r=`${r}: ${n}`),super(r)}}t.InvalidServerResponseError=A;class C extends((0,r.customError)("BingServerError",!0,v)){constructor(e,t,n){super(`Error ${t} for ${e}: ${JSON.stringify(n)}`,e,t)}}t.BingServerError=C;class P extends((0,r.customError)("MediaNeedsReupload")){}t.MediaNeedsReupload=P;class O extends((0,r.customError)("MediaMissing")){}t.MediaMissing=O,O.message="Media is no longer available on your phone";class I extends((0,r.customError)("FileNotReadableError",!0,Error)){}t.FileNotReadableError=I;class M extends((0,r.customError)("MediaLoadError")){constructor(e){super(e),this.src=e}}t.MediaLoadError=M;class b extends((0,r.customError)("TranscodeBlobTooLargeError")){constructor(){super("Transcode blob too large")}}t.TranscodeBlobTooLargeError=b;class R extends((0,r.customError)("UnableToPlayVideoError")){constructor(e){super(`Unable to play video. Reason: ${String(e)}`)}}t.UnableToPlayVideoError=R;class N extends((0,r.customError)("MediaDragDropError",!0,M)){}t.MediaDragDropError=N;class w extends((0,r.customError)("MediaUnsupportedError")){}t.MediaUnsupportedError=w,w.message="Media format is unsupported";class L extends((0,r.customError)("ModelError")){}t.ModelError=L;class D extends((0,r.customError)("ModelCreateError")){constructor(e,t){super(e),this.model=t}}t.ModelCreateError=D;class k extends((0,r.customError)("DbEncKeyNotLoadedError")){constructor(e){super(`MasterDatabaseEncryptionKey.${e} was accessed before init`)}}t.DbEncKeyNotLoaded=k;class U extends((0,r.customError)("DbMsgEncKeyNotLoadedError")){constructor(e){super(`MasterDatabaseMessageEncryptionKey.${e} was accessed before init`)}}t.DbMsgEncKeyNotLoaded=U;class G extends((0,r.customError)("DbOnLogoutAbortError")){}t.DbOnLogoutAbort=G,G.message="DB operation was dropped due to logout activity";class x extends((0,r.customError)("DBExpiredFtsHMACKey")){}t.DBInvalidFtsHMACKey=x,x.message="MasterDatabaseEncryptionKey.fts_hmac_keys is in an invalid state";class B extends((0,r.customError)("UpdateImmediately")){}t.UpdateImmediately=B;class F extends((0,r.customError)("CapabilityError")){}t.CapabilityError=F;class j extends((0,r.customError)("CapabilityInvalid",!0,F)){}t.CapabilityInvalid=j;class Y extends((0,r.customError)("CapabilityUnknown",!0,F)){}t.CapabilityUnknown=Y;class K extends((0,r.customError)("CanNotSendUnencrypted")){}t.CanNotSendUnencrypted=K;class H extends((0,r.customError)("ActionError")){}t.ActionError=H,H.message="Could not perform action.";class W extends((0,r.customError)("Unmount")){}t.Unmount=W;class V extends((0,r.customError)("ActiveChatChanged")){}t.ActiveChatChanged=V;class $ extends((0,r.customError)("GUMError")){}t.GUMError=$;class z extends((0,r.customError)("NotSupportedError",!0,$)){}t.NotSupportedError=z,z.message="The operation is not supported.";class q extends((0,r.customError)("NotAllowedError",!0,$)){}t.NotAllowedError=q,q.message="The user did not grant permission for the operation";class J extends((0,r.customError)("ConstraintNotSatisfiedError",!0,$)){}t.ConstraintNotSatisfiedError=J,J.message="One of the mandatory Constraints could not be satisfied.";class Q extends((0,r.customError)("OverconstrainedError",!0,$)){}t.OverconstrainedError=Q,Q.message="Due to changes in the environment, one or more mandatory constraints can no longer be satisfied.";class X extends((0,r.customError)("NotFoundError",!0,$)){}t.NotFoundError=X,X.message="The object can not be found here.";class Z extends((0,r.customError)("SourceUnavailableError",!0,$)){}t.SourceUnavailableError=Z,Z.message="The source of the MediaStream could not be accessed due to a hardware error (e.g. lock from another process).";class ee extends((0,r.customError)("UnableToGetContentLengthError")){}t.UnableToGetContentLengthError=ee,ee.message="Failed to get media contentLength from mms";const te={GUMError:$,NotSupportedError:z,NotAllowedError:q,ConstraintNotSatisfiedError:J,OverconstrainedError:Q,NotFoundError:X,SourceUnavailableError:Z};t.GUM=te},191873:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeError=s,t.normalizeStack=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{name:n,message:r,stack:i}=s(e),o=i.indexOf("\n"),l=i.slice(0,o),u=l.match(new RegExp(`(${(0,a.default)(n)}|Error)(:|$)`));if(null!=u){if(!t)return i;const e=u.index+u[0].length,n=null==r?-1:i.indexOf(r,e),a=null==r||-1===n?-1:n+r.length,s=Math.max(0,o,e,a);return i.slice(s).replace(/^\n+/,"")}if(t)return i;const c=""===i?"":`\n${i}`;return r?`${n}: ${r}${c}`:`${n}${c}`};var i=r(n(81109)),a=r(n(103522)),o=r(n(854251));function s(e){const t="object"==typeof e&&"string"==typeof(null==e?void 0:e.name)?e.name:`Thrown${(0,o.default)(typeof e)}Error`;let n,r;if(n=null!=e&&"string"==typeof e.message?e.message:void 0===e?"":String(e),null!=e&&"string"==typeof e.stack)r=e.stack;else{const e=new Error;e.name=t,e.message=n,r="string"==typeof e.stack?e.stack:""}const a="object"==typeof e?(0,i.default)({},e):null;return(0,i.default)((0,i.default)({},a),{},{name:t,message:n,stack:r})}},281007:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=(0,a.normalizeError)(e),{name:n,message:r,stack:s}=t,l=(0,i.default)(t,o),u=(0,a.normalizeStack)(e,!0),c=0===Object.keys(l).length?"":" "+JSON.stringify(l,((e,t)=>e&&"object"==typeof t?String(t):t));return`${n} - ${r||""}${c}\n${u}`};var i=r(n(506479)),a=n(191873);const o=["name","message","stack"]},395654:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(873955)),a=r(n(441609)),o=r(n(751463));const s=/\s+/;t.default=class{on(e,t,n){if(!t)return this;if("function"!=typeof t)throw new Error("Callback parameter passed is not a function");return this._multiEvent(this.on,...arguments)||this._getOrCreateEvents(e).push({callback:t,context:n,ctx:n||this}),this}once(e,t,n){if(!t)return this;if(this._multiEvent(this.once,...arguments))return this;const r=this,i=(0,o.default)((function(){r.off(e,i),t.apply(this,arguments)}));return i._callback=t,this.on(e,i,n)}off(e,t,n){const r=this._events;if(!r)return this;if(this._multiEvent(this.off,...arguments))return this;if(!e&&!t&&!n)return this._events=void 0,this;const i=e?[e]:Object.keys(r);for(let e=0;e<i.length;e++){const a=i[e],o=r[a];if(o){if(r[a]=[],t||n)for(let e=0;e<o.length;e++){const i=o[e];(t&&t!==i.callback&&t!==i.callback._callback||n&&i.context!==n)&&r[a].push(i)}r[a].length||delete r[a]}}return this}trigger(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(!this._events)return this;if(this._multiEvent(this.trigger,...arguments))return this;const i=this._getEvents(e),a=this._getEvents("all");return i&&this._triggerEvents(i,n),a&&this._triggerEvents(a,arguments),this}stopListening(e,t,n){const r=this._listeningTo;if(!r)return this;const i=null==e?void 0:e._listenId,o=i?{[i]:e}:r;for(const e in o){const i=o[e];i.off(t,n,this),(!t&&!n||(0,a.default)(i._events))&&delete r[e]}return(0,a.default)(this._listeningTo)&&delete this._listeningTo,this}listenTo(e,t,n){return n?(this._addListeningTo(e),e.on(t,n,this),this):this}listenToOnce(e,t,n){return this._addListeningTo(e),e.once(t,n,this),this}listenToAndRun(e,t,n){return this.listenTo.apply(this,arguments),n.apply(this),this}isListening(e){const t=this._events;return!!t&&("string"==typeof e?!!t[e]:(0,a.default)(t))}_addListeningTo(e){(this._listeningTo||(this._listeningTo={}))[e._listenId||(e._listenId=(0,i.default)("l"))]=e}_getOrCreateEvents(e){const t=this._events||(this._events={});return t[e]||(t[e]=[])}_getEvents(e){if(!e)return;const t=this._events;return t?t[e]:void 0}_multiEvent(e,t){if(s.test(t)){const a=t.split(s);for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];for(let t=0;t<a.length;t++)e.call(this,a[t],...r);return!0}return!1}_triggerEvents(e,t){let n,r=-1;const i=e.length,a=t[0],o=t[1],s=t[2];switch(t.length){case 0:for(;++r<i;)(n=e[r]).callback.call(n.ctx);return;case 1:for(;++r<i;)(n=e[r]).callback.call(n.ctx,a);return;case 2:for(;++r<i;)(n=e[r]).callback.call(n.ctx,a,o);return;case 3:for(;++r<i;)(n=e[r]).callback.call(n.ctx,a,o,s);return;default:for(;++r<i;)(n=e[r]).callback.apply(n.ctx,t)}}bind(){return this.on(...arguments)}unbind(){return this.off(...arguments)}removeListener(){return this.off(...arguments)}removeAllListeners(){return this.off()}emit(){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return this.trigger(arguments)}}},799132:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,i){if(null==i?void 0:i.aborted)return Promise.reject(new r.AbortError);let a,o;const s=n;return new Promise((function(n,l){if(a=s?function(){s.apply(this,arguments)&&n(arguments)}:function(){n(arguments)},i){const e=()=>{var e;null===(e=o)||void 0===e||e(),l(new r.AbortError)};i.addEventListener("abort",e),o=()=>{i.removeEventListener("abort",e),o=null}}e.on(t,a)})).cancellable().finally((function(){var n;e.off(t,a),null===(n=o)||void 0===n||n()}))};var r=n(88237)},845294:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,i){if(null==i?void 0:i.aborted)return Promise.reject(new r.AbortError);let a,o;const s=n;return new Promise((function(n,l){var u;if(a=s?function(){s.apply(this,arguments)&&n.apply(this,arguments)}:n,i){const e=()=>{var e;null===(e=o)||void 0===e||e(),l(new r.AbortError)};i.addEventListener("abort",e),o=()=>{i.removeEventListener("abort",e),o=null}}null===(u=e.addEventListener)||void 0===u||u.call(e,t,a)})).cancellable().finally((function(){var n,r;null===(n=e.removeEventListener)||void 0===n||n.call(e,t,a),null===(r=o)||void 0===r||r()}))};var r=n(88237)},555470:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(i.Cmd.isMainLoaded)return Promise.resolve();return(0,a.default)(i.Cmd,"main_loaded")};var i=n(780549),a=r(n(799132))},655386:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return(0,i.default)(window,"offline")};var i=r(n(845294))},797137:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(i.Cmd.isOfflineDeliveryEnd)return Promise.resolve();return a};var i=n(780549);const a=(0,r(n(799132)).default)(i.Cmd,"offline_delivery_end")},689434:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.waitForOnlineNaive=function(){return s.apply(this,arguments)};var i=r(n(348926)),a=n(36530),o=r(n(845294));function s(){return(s=(0,i.default)((function*(){return yield(0,o.default)(self,"online"),(0,a.delayMs)(100)}))).apply(this,arguments)}},254028:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return a};var i=n(780549);const a=(0,r(n(799132)).default)(i.Cmd,"offline_process_ready")},712284:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supportsAesCbc=function(){return o().then((e=>e.generateKey(a,!1,["encrypt","decrypt"]).then((t=>Promise.resolve(self.crypto).then((e=>({name:"AES-CBC",iv:e.getRandomValues(new Uint8Array(16))}))).then((i=>e.encrypt(i,t,r).then((n=>e.decrypt(i,t,n))).catch((e=>(__LOG__(2)`CryptoSupport:AES-CBC encryption failed: ${e}`,!1))).then((e=>{const t=new Uint8Array(e);return r=t,Array.prototype.slice.call(r).map((e=>String.fromCharCode(e))).join("")===n?(__LOG__(2)`CryptoSupport:AES-CBC encryption/decryption is correct`,!0):(__LOG__(2)`CryptoSupport:AES-CBC encryption/decryption is incorrect`,!1);var r})).catch((e=>(__LOG__(2)`CryptoSupport:AES-CBC decryption failed: ${e}`,!1))))))).catch((e=>(__LOG__(2)`CryptoSupport:AES-CBC key generation failed: ${e}`,!1))))).catch((e=>(__LOG__(2)`CryptoSupport:AES-CBC: ${e}`,!1)))},t.supportsHmacSha256=function(){return o().then((e=>e.generateKey(i,!1,["sign","verify"]).then((t=>e.sign(i,t,r).then((n=>e.verify(i,t,n,r.buffer))).catch((e=>(__LOG__(2)`CryptoSupport:HMAC-SHA256 signing failed: ${e}`,!1))).then((e=>e?(__LOG__(2)`CryptoSupport:HMAC-SHA256 is verified`,!0):(__LOG__(2)`CryptoSupport:HMAC-SHA256 is not verified`,!1))).catch((e=>(__LOG__(2)`CryptoSupport:HMAC-SHA256 verification failed: ${e}`,!1))))).catch((e=>(__LOG__(2)`CryptoSupport:HMAC-SHA256 key generation failed: ${e}`,!1))))).catch((e=>(__LOG__(2)`CryptoSupport:HMAC-SHA256: ${e}`,!1)))};const n="whatsapp is da best",r=new Uint8Array(n.split("").map((e=>e.charCodeAt(0))));const i={name:"HMAC",hash:"SHA-256"},a={name:"AES-CBC",length:256};function o(){return Promise.resolve().then((()=>self.crypto.subtle||self.crypto.webkitSubtle))}},868607:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.detectWebpSupport=function(){return u.apply(this,arguments)},t.getCachedWebpSupport=function(){return l};var i=r(n(348926)),a=n(975175),o=n(197636);const s=(0,a.promiseTimeout)(new Promise((e=>{(0,o.loadImage)("data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA").then((t=>e(2===t.height)))})),5e3).catch((()=>!1));let l=null;function u(){return(u=(0,i.default)((function*(){if(null!=l)return Promise.resolve(l);const e=yield s;return l=e,e}))).apply(this,arguments)}},385158:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){const e=new Promise((function(e){function t(){e(!1)}if(self.requestFileSystem)self.requestFileSystem(window.TEMPORARY,1,t,(function(t){e("SecurityError"===t.name)}));else if(s.default){const n=s.default.open("pb_detect");n?(n.onsuccess=t,n.onerror=function(t){t.preventDefault(),window.InvalidStateError?e(t instanceof window.InvalidStateError):e(!0)}):t()}else u.UA.isTrident?e(!0):t()})).then((function(e){if(e)return e;if(!l.default)return!1;try{return l.default.setItem("INCOG","0"),l.default.removeItem("INCOG"),!1}catch(e){if("QuotaExceededError"===e.name)return!0;throw e}}));return(0,o.promiseTimeout)(e,100,"detectIncognitoTimeout").catch((0,a.filteredCatch)(i.TimeoutError,(function(){return!1}))).catch((function(e){return __LOG__(3,void 0,void 0,!0)`promiseUtil:determineIncognito failed check: ${String(e)}`,SEND_LOGS("incog-throw"),!1}))};var i=n(643930),a=n(924583),o=n(975175),s=r(n(422660)),l=r(n(174285)),u=n(368170)},103375:(e,t,n)=>{"use strict";var r=n(595318);t.Z=function(){if(u(l))return!0;return(0,i.promiseProps)({cryptoSha256:(0,a.supportsHmacSha256)(),cryptoAesCbc:(0,a.supportsAesCbc)()}).then(u),!1};var i=n(204597),a=n(712284),o=r(n(174285)),s=r(n(462032));const l={getRandomValues:!!self.crypto.getRandomValues,subtleCrypto:!(!self.crypto||!self.crypto.subtle&&!self.crypto.webkitSubtle),localstorage:!!o.default,sessionstorage:!!s.default,url:!!self.URL,websocket:!!self.WebSocket,worker:!!self.Worker};function u(e){const t=[];for(const n in e)e[n]||t.push(n);if(t.length>0){const e=`https://web.whatsapp.com/browsers.html?missing=${t.join(",")}`;return window.location.replace?window.location.replace(e):window.location.href=e,!0}return!1}},478885:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(975175),a=r(n(395654)),o=n(223713),s=r(n(537152)),l=r(n(647349)),u=n(368170);const c="Modernizr"in window,d=(0,o.getModernizr)();class p extends a.default{constructor(){super(),this.supported=c?d.serviceworker:"serviceWorker"in navigator,this._checkAlive=()=>{var e;const t=null===(e=navigator.serviceWorker)||void 0===e?void 0:e.controller;return Boolean(t)},this._checkStreamingSupport=()=>{var e;if(!this.supported||!this.alive||u.UA.isSafari)return void(this._streamingSupported=!1);if(this._streamingSupportedPromise)return this._streamingSupported;const t=null===(e=navigator.serviceWorker)||void 0===e?void 0:e.controller;t&&(this._streamingSupportedPromise=(0,i.promiseTimeout)(s.default.request(t,l.default.STREAMING_SUPPORTED),100).catch((()=>!1)).then((e=>(delete this._streamingSupportedPromise,this.streamingSupported=e,e))))},this._setSupported=e=>{this.supported=e},c&&d.on("serviceworker",this._setSupported);const e=this;Object.defineProperty(this,"streamingSupported",{get:()=>(e._checkStreamingSupport(),e._streamingSupported),set(t){t!==e._streamingSupported&&e.trigger("change:streamingSupported",t),e._streamingSupported=t}}),Object.defineProperty(this,"alive",{get:()=>e._checkAlive()})}}var _=new p;t.default=_},223713:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getModernizr=function(){return self.Modernizr}},368170:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.UA=t.OS_TYPE=t.BROWSER_TYPE=void 0,t.gteVersion=o,t.parseUA=l;var i=r(n(42238));t.BROWSER_TYPE={CHROME:"chrome",CHROMIUM:"chromium",FIREFOX:"firefox",SAFARI:"safari",IE:"ie",OPERA:"opera",EDGE:"edge"};function a(e,t){let n,r;const i=/(\.0)+[^\.]*$/,a=(e+"").replace(i,"").split("."),o=(t+"").replace(i,"").split("."),s=Math.min(a.length,o.length);for(n=0;n<s;n++)if(r=parseInt(a[n],10)-parseInt(o[n],10),0!==r)return r;return a.length-o.length}function o(e,t){return a(e,t)>=0}function s(e,t){return a(e,t)<0}function l(e){const t=new i.default;t.setUA(e||"");const n=(t.getBrowser().name||"").toUpperCase(),r=t.getBrowser().version||"0.0.0",a=(t.getEngine().name||"").toUpperCase(),l=(t.getOS().name||"").toUpperCase(),u=t.getOS().version||"0.0.0",c="SAFARI"===n,d="CHROME"===n,p="GECKO"===a,_="BLINK"===a;let f=!1;switch(l){case"MAC OS":d?f=o(u,"10.10")&&o(r,"41.0.0"):o(u,"10.7")&&(f=!0);break;case"WINDOWS":o(u,"8.1")&&(p||d&&o(r,"41.0.0"))&&(f=!0)}const h=c||d&&s(r,"76");return{isWebkit:!a||"WEBKIT"===a,isGecko:p,isTrident:"TRIDENT"===a||"EDGEHTML"===a,isSafari:c,isElectron:!1,isBlink:_,isBuggyVideoLoad:d&&o(r,"76")||_&&!d,hasEmoji:f,troublesWithLotsOfVideos:d,supportsEmojiEllipsification:!h,isBrokenGetUserMedia:d&&s(r,"50"),isLocalStorageBroken:c&&o(r,"14.1")&&s(r,"14.1.2"),os:l.toLowerCase(),osVersion:u,browser:n.toLowerCase(),browserVersion:r,parser:t,isChrome:d}}t.OS_TYPE={WINDOWS:"windows",MAC:"mac os",CHROMEOS:"chromium os"};const u=l("undefined"!=typeof self?self.navigator.userAgent:null);t.UA=u},14361:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.JS_HALT_EVENT=t.CLOCK_CHANGE_BACKWARDS_EVENT=t.BaseJsHaltDetector=void 0;var i=r(n(395654));const a="js_halt";t.JS_HALT_EVENT=a;const o="clock_change_backwards";t.CLOCK_CHANGE_BACKWARDS_EVENT=o;class s extends i.default{constructor(e,t){super(),this._interval=e,this._threshold=t}startDetection(){if(this._intervalId)return;let e=Date.now();this._intervalId=setInterval((()=>{const t=Date.now(),n=t-e-this._interval;n>this._threshold?this.trigger(a,n):n<-this._threshold&&this.trigger(o,n),e=t}),this._interval),__LOG__(2)`JsHaltDetector:detection started`}stopDetection(){this._intervalId&&(clearInterval(this._intervalId),this._intervalId=null,__LOG__(2)`JsHaltDetector:detection stopped`)}restartDetection(){this.stopDetection(),this.startDetection(),__LOG__(2)`JsHaltDetector:detection restarted`}}t.BaseJsHaltDetector=s},150204:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.jsHaltDetector=t.DEFAULT_THRESHOLD=t.DEFAULT_INTERVAL=void 0;var r=n(14361);t.DEFAULT_THRESHOLD=3e3;t.DEFAULT_INTERVAL=1e4;const i=new r.BaseJsHaltDetector(1e4,3e3);t.jsHaltDetector=i,i.startDetection()},588750:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addBorder=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"white";const r=document.createElement("canvas"),i=r.getContext("2d"),a=document.createElement("canvas"),o=a.getContext("2d"),s=2*t;r.width=a.width=e.width+2*s,r.height=a.height=e.height+2*s,i.drawImage(e,s,s),o.shadowColor=n,o.shadowBlur=1;for(let e=0;e<s;e++)o.drawImage(r,0,0),i.drawImage(a,0,0);return o.shadowColor="rgba(0,0,0,0)",o.drawImage(e,s,s),a},t.canvasToBlob=u,t.canvasToWebp=function(e){if(l.default){const t=e.getContext("2d").getImageData(0,0,e.width,e.height);return(0,l.default)(t.data,e.width,e.height,{ensureExtendedFormat:!0})}return u(e,"image/webp")},t.contain=function(e,t){const{width:n,height:r}=(0,o.boundHeightWidth)(e.height,e.width,t);if(n>e.width&&r>e.height)return e;const i=document.createElement("canvas"),a=i.getContext("2d");return i.width=n,i.height=r,a.drawImage(e,0,0,n,r),i},t.copy=p,t.createCanvas=d,t.fillBackgroundWithGray=function(e){const t=e.getContext("2d");t.fillStyle="rgb(247,247,247)",t.fillRect(0,0,e.width,e.height)},t.generateMicroThumb=function(){return c.apply(this,arguments)},t.getResizedDataUrl=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image/jpeg",n=arguments.length>2?arguments[2]:void 0;const r=e.toDataURL(t),i=(0,a.dataURLtoBlob)(r);if(i.size<=n)return e.toDataURL(t);for(let r=.9;r>=.1;r-=.1){const i=e.toDataURL(t,r);if((0,a.dataURLtoBlob)(i).size<=n)return i}return null},t.resize=function(e,t,n){const r=e.getContext("2d"),i=r.getImageData(0,0,t,n);e.width=t,e.height=n,r.putImageData(i,0,0)},t.rotate=function(e,t){const n=t.x||0,r=t.y||0;t.degrees&&(t.radians=t.degrees*(Math.PI/180));e.translate(n,r),e.rotate(t.radians),e.translate(-n,-r)},t.scale=function(e,t){const n=e.getContext("2d"),r=p(e),{width:i,height:a}=(0,o.aspectRatioScaled)(e.width/e.height,t);e.width=i,e.height=a,n.drawImage(r,0,0,i,a)},t.square=function(e){const t=e.getContext("2d"),n=e.width,r=e.height,i=t.getImageData(0,0,n,r),a=Math.max(n,r);e.width=a,e.height=a,t.clearRect(0,0,n,r),t.putImageData(i,(a-n)/2,(a-r)/2,0,0,n,r)},t.trim=function(e){if(function(e){const t=e.getContext("2d").getImageData(0,0,e.width,e.height),n=t.data.length/4;let r;for(r=0;r<n;r++){if(0!==t.data[4*r+3])return!1}return!0}(e))return;const{left:t,top:n,right:r,bottom:i}=function(e){const t=e.getContext("2d").getImageData(0,0,e.width,e.height),n=t.data.length/4;let r,i=1/0,a=1/0,o=0,s=0;for(r=0;r<n;r++){if(0===t.data[4*r+3])continue;const n=r%e.width,l=Math.floor(r/e.width);n<i&&(i=n),n>o&&(o=n),l<a&&(a=l),l>s&&(s=l)}return{left:i,top:a,right:o,bottom:s}}(e),a=i-n,o=r-t,s=e.getContext("2d").getImageData(t,n,o,a),l=d(o,a);return l.getContext("2d").putImageData(s,0,0),l};var i=r(n(348926)),a=n(437362),o=n(172254),s=r(n(756680)),l=r(n(191687));function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"image/jpeg";return e.toBlob?new Promise((function(n){e.toBlob(n,t)})):Promise.resolve((0,a.dataURLtoBlob)(e.toDataURL(t)))}function c(){return(c=(0,i.default)((function*(e,t,n){var r,i;const a=n||{},o=null!==(r=a.mimetype)&&void 0!==r?r:"image/jpeg",l=null!==(i=a.maxAttempts)&&void 0!==i?i:10;let c=.5,p=e,_=yield u(p,o);for(let n=0;n<l&&!(_.size<=t);n++){const t=Math.floor(e.width*c),n=Math.floor(e.height*c);p=d(t,n);p.getContext("2d").drawImage(e,0,0,t,n),_=yield u(p,o),c*=.5}return{opaqueData:yield s.default.createFromData(_,o),width:p.width,height:p.height,dataUrl:p.toDataURL("image/jpeg")}}))).apply(this,arguments)}function d(e,t){const n=document.createElement("canvas");return n.width=e,n.height=t,n}function p(e){const t=d(e.width,e.height);return t.getContext("2d").drawImage(e,0,0),t}},172254:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.aspectRatioScaled=function(e,t){if("number"!=typeof e||e<0||e!=e)return{width:t,height:t};if(e>1)return{width:t,height:Math.max(t/e,1)};return{width:Math.max(t*e,1),height:t}},t.boundHeightWidth=function(e,t,n){let r=null!=t?t:n,i=null!=e?e:n;r>i?r>n&&(i*=n/r,r=n):i>n&&(r*=n/i,i=n);return{width:Math.max(r,1),height:Math.max(i,1)}}},428363:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DATA_URL=t.CANVAS=t.BlackVideoThumbnailError=t.BLOB=void 0,t.base64ImageToCanvas=function(){return B.apply(this,arguments)},t.crop=function(){return R.apply(this,arguments)},t.generateLinkPreview=function(){return w.apply(this,arguments)},t.generateVideoThumbsAndDuration=function(){return b.apply(this,arguments)},t.isCached=function(e){if(!e)return!1;const t=new Image;return t.src=e,!!t.complete},t.rotateAndResize=function(e,t,n,r){const{transparency:i=!1,fitToSquare:a=!1,minDimension:o=0}=null!=r?r:{},s=new ArrayBuffer(0);let u,h,m;e instanceof HTMLCanvasElement?(h=Promise.resolve(e),m=Promise.resolve(s)):(u=window.URL.createObjectURL(e),h=f.loadImage(u),m=(0,d.blobToArrayBuffer)(e).catch((e=>(__LOG__(3)`ImageUtils::rotateAndResize error: ${e}`,s))));return(0,l.promiseProps)({buffer:m,image:h}).then((e=>{var r;let{buffer:s,image:u}=e,d={};try{d=(0,E.default)(s)}catch(e){}let f=0;if(!(null===(r=(0,g.getModernizr)())||void 0===r?void 0:r.exiforientation))switch(d.orientation||"UNKNOWN"){case"right-top":f=1;break;case"left-bottom":f=-1;break;case"bottom-right":f=2}const h=document.createElement("canvas"),m=u.naturalWidth||u.width,y=u.naturalHeight||u.height,S=Math.max(m,y),T=h.getContext("2d"),v={};if(!f){const e=(0,p.boundHeightWidth)(y,m,t);let r,d,f=n&P;if(s&&f&&m===e.width&&y===e.height)try{const e=(0,_.cleanJPEG)(s);v.blob=e,f=!1,r=m,d=y}catch(e){__LOG__(2)`Could not parse JPEG: ${e.message}`}return(f||n&~P)&&(h.width=e.width,h.height=e.height,i||(0,c.fillBackgroundWithGray)(h),T.drawImage(u,0,0,h.width,h.height),a&&((0,c.square)(h),v.blob=void 0),S<o&&((0,c.scale)(h,o),v.blob=void 0),r=h.width,d=h.height,x(v,h,n,i)),(0,l.promiseProps)(v).then((e=>({width:r,height:d,images:e})))}switch(f){case 1:case-1:const e=Math.max(m,y),r=e/2;h.width=h.height=e,i||(0,c.fillBackgroundWithGray)(h),(0,c.rotate)(T,{x:r,y:r,degrees:90*f}),1===f?T.drawImage(u,0,e-y):T.drawImage(u,e-m,0),(0,c.rotate)(T,{x:r,y:r,degrees:-90*f}),(0,c.resize)(h,y,m),a&&(0,c.square)(h),S<o&&(0,c.scale)(h,o);const s=(0,c.contain)(h,t);return x(v,s,n,i),(0,l.promiseProps)(v).then((e=>({width:s.width,height:s.height,images:e})));case 2:const d=(0,p.boundHeightWidth)(y,m,t),_=h.width=d.width,g=h.height=d.height;return i||(0,c.fillBackgroundWithGray)(h),(0,c.rotate)(T,{x:_/2,y:g/2,degrees:90*f}),T.drawImage(u,0,0,_,g),(0,c.rotate)(T,{x:_/2,y:g/2,degrees:-90*f}),a&&(0,c.square)(h),S<o&&(0,c.scale)(h,o),x(v,h,n,i),(0,l.promiseProps)(v).then((e=>({width:h.width,height:h.height,images:e})))}})).finally((()=>{}))},t.toDataUrl=function(){return L.apply(this,arguments)},t.toDataUrlWithRoundedCorners=function(){return N.apply(this,arguments)},t.toWebpSticker=function(){return U.apply(this,arguments)},t.urlToFile=function(){return G.apply(this,arguments)};var a=i(n(348926)),o=n(643930),s=n(209733),l=n(204597),u=n(389719),c=n(588750),d=n(698210),p=n(172254),_=n(176779),f=T(n(197636)),h=T(n(288057)),g=n(223713),m=n(432938),y=n(368170),E=i(n(326642));function S(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(S=function(e){return e?n:t})(e)}function T(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=S(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}const v=2,A=4,C=1;t.DATA_URL=C;const P=v;t.BLOB=P;const O=A;t.CANVAS=O;class I extends((0,o.customError)("BlackVideoThumbnailError")){}t.BlackVideoThumbnailError=I,I.message="Generated video thumbnail is black";const M=e=>{let{video:t,fullWidth:n,fullHeight:r,maxDimension:i}=e;const a=document.createElement("canvas"),{width:o,height:s}=(0,p.boundHeightWidth)(r,n,i);a.width=o,a.height=s;const l=a.getContext("2d");l.drawImage(t,0,0,o,s);const u=l.getImageData(0,0,o,s);return{thumb:{url:a.toDataURL("image/jpeg"),width:o,height:s,fullWidth:n,fullHeight:r},imageData:u}};function b(){return(b=(0,a.default)((function*(e){const{file:t,maxDimensions:n,debugHint:i,throwOnBlack:a=!1}=e,{video:o,fullWidth:l,fullHeight:u}=yield f.loadVideo(t),c=e=>{const t=e.width*e.height/4;for(let n=0;n<=1;n+=.25){const r=4*Math.round(t*n);if(0!==e.data[r])return!1;if(0!==e.data[r+1])return!1;if(0!==e.data[r+2])return!1;const i=e.data[r+3];if(0!==i&&255!==i)return!1}return!0};if(y.UA.isBuggyVideoLoad){const e=50,t=5e3/e;return(0,s.exponentialBackoff)({minTimeout:e,maxTimeout:e,retries:t,signal:(new r).signal,factor:1},((e,r)=>{const s=[];let d;for(d of n){const{thumb:n,imageData:p}=M({video:o,fullHeight:u,fullWidth:l,maxDimension:d});if(c(p)){if(r<t)return 0===r&&__LOG__(2)`generateVideoThumbsAndDuration: Setting video.currentTime to 0 to attempt to unblock the video`,o.currentTime=0,e(new Error("retry"));if(Math.random()<=.02&&(__LOG__(4,void 0,new Error,!0)`generateVideoThumbsAndDuration: Failed to generate video thumbnail from ${i}`,SEND_LOGS(`thumbnail-generation-failed-${i}`)),a)throw new I}s.push(n)}const p={duration:~~o.seekable.end(0),thumbs:s};return f.disposeVideo(o),Promise.resolve(p)}))}try{const e=n.map((e=>{const{thumb:t,imageData:n}=M({video:o,fullHeight:u,fullWidth:l,maxDimension:e});if(c(n)&&(Math.random()<=.02&&(__LOG__(4,void 0,new Error,!0)`generateVideoThumbsAndDuration: Failed to generate video thumbnail from ${i}`,SEND_LOGS(`thumbnail-generation-failed-${i}`)),a))throw new I;return t}));return{duration:~~o.seekable.end(0),thumbs:e}}finally{f.disposeVideo(o)}}))).apply(this,arguments)}function R(){return(R=(0,a.default)((function*(e,t,n,r,i,a,o){let s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:C;const u=e instanceof HTMLCanvasElement?e:yield f.loadImage(e),c=document.createElement("canvas"),d=c.getContext("2d");null==a||null==o?(c.height=i,c.width=r,d.drawImage(u,t,n,r,i)):(c.height=o,c.width=a,d.drawImage(u,t,n,r,i,0,0,a,o));const p={};x(p,c,s);const _=yield(0,l.promiseProps)(p);return{images:_,width:r,height:i}}))).apply(this,arguments)}function N(){return(N=(0,a.default)((function*(e){const t=e instanceof HTMLCanvasElement?e:yield f.loadImage(e),n=document.createElement("canvas"),r=n.getContext("2d");n.height=t.height,n.width=t.width;const i=Math.min(t.width,t.height);return r.beginPath(),r.arc(t.width/2,t.height/2,i/2,0,2*Math.PI,!0),r.clip(),r.closePath(),r.drawImage(t,0,0),n.toDataURL("image/png")}))).apply(this,arguments)}function w(){return(w=(0,a.default)((function*(e){try{const t=yield f.loadImage(e),n=100,r=140;if(t.width<n||t.height<n)return __LOG__(2)`Image size too small for link preview`,null;const i=document.createElement("canvas"),a=i.getContext("2d");i.height=r,i.width=r;const o=Math.min(t.width,t.height),s=(t.width-o)/2,l=(t.height-o)/2;return a.drawImage(t,s,l,o,o,0,0,r,r),i.toDataURL("image/jpeg").replace(/^data:image\/jpeg;base64,/,"")}catch(e){return __LOG__(2)`link preview image generation failed: `,null}}))).apply(this,arguments)}function L(){return(L=(0,a.default)((function*(e){try{const t=yield f.loadImage(e),n=document.createElement("canvas"),r=n.getContext("2d");return n.height=t.height,n.width=t.width,r.drawImage(t,0,0),n.toDataURL("image/jpeg").replace(/^data:image\/jpeg;base64,/,"")}catch(e){return __LOG__(2)`data URL conversion failed: `,null}}))).apply(this,arguments)}function D(){return k.apply(this,arguments)}function k(){return(k=(0,a.default)((function*(e,t){try{const n=yield e.arrayBuffer(),r=(0,u.addWebpMetadata)(n,t),i=new Uint8Array(r);return new Blob([i],{type:"image/webp"})}catch(t){return __LOG__(4,void 0,new Error,!0)`addMetadataToSticker: Unable to add metadata to Sticker`,SEND_LOGS("unable-to-add-sticker-metadata"),e}}))).apply(this,arguments)}function U(){return(U=(0,a.default)((function*(e){try{const t=window.URL.createObjectURL(e),n=yield f.loadImage(t);window.URL.revokeObjectURL(t);const r=m.STICKER_DIMENSION,i=(0,c.createCanvas)(r,r),a=i.getContext("2d"),{width:o,height:s}=(0,p.aspectRatioScaled)(n.width/n.height,r);a.drawImage(n,(r-o)/2,(r-s)/2,o,s);const l=yield(0,c.canvasToWebp)(i);return yield D(l,{isFirstParty:!1,isFromStickerMaker:!0,emojis:[],stickerPackPublisher:"WhatsApp Sticker Maker"})}catch(e){throw __LOG__(2)`Webp sticker file generation failed: `,e}}))).apply(this,arguments)}function G(){return(G=(0,a.default)((function*(e){try{const t=yield f.loadImage(e),n=document.createElement("canvas");n.width=t.naturalWidth,n.height=t.naturalHeight;const r=n.getContext("2d");return(0,c.fillBackgroundWithGray)(n),r.drawImage(t,0,0),(0,c.canvasToBlob)(n)}catch(t){throw new h.MediaDragDropError("unable to render image",e)}}))).apply(this,arguments)}function x(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=r?"image/png":"image/jpeg";!e.blob&&n&P&&(e.blob=(0,c.canvasToBlob)(t,i)),!e.dataUrl&&n&C&&(e.dataUrl=Promise.resolve(t.toDataURL(i))),!e.canvas&&n&O&&(e.canvas=Promise.resolve(t))}function B(){return(B=(0,a.default)((function*(e){const t=yield f.loadImage(e),n=(0,c.createCanvas)(t.width,t.height);return n.getContext("2d").drawImage(t,0,0),n}))).apply(this,arguments)}},126506:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSpamSupportedForMessageType=function(e){return r.SPAM_REPORT_SUPPORTED_MESSAGE_TYPES.has(e)};var r=n(453603)},391349:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926));t.default=class{constructor(e){let{name:t,handler:n=null,interval:r=3600,restingInterval:i=18e3,sleepWhileResting:a=!1,randomIntervalExtension:o=0}=e;if(this._running=!1,this._slowDown=!1,this._name=t,this._interval=1e3*r,this._restingInterval=1e3*i,this._sleepWhileResting=a,this._randomIntervalExtension=1e3*o,this._rest(),"function"==typeof n)this.poll(n);else if(null!=n)throw new Error("Poll handler must be a function or null")}_getRandomExtension(){return Math.ceil(Math.random()*this._randomIntervalExtension)}_getInterval(){return(this._slowDown?this._restingInterval:this._interval)+this._getRandomExtension()}_rest(){document.addEventListener("visibilitychange",(()=>{this._lock||(document.hidden?this._sleepWhileResting?(__LOG__(2)`LazyPoll[${this._name}]: Inactive paused`,this._pause()):(__LOG__(2)`LazyPoll[${this._name}]: Inactive slowing down`,this._slowDown=!0):this._callback&&(__LOG__(2)`LazyPoll[${this._name}]: Active Resuming`,this._resume()))}),!1)}_isDue(){if(!this._lastPoll)return!0;return Date.now()-this._lastPoll>=this._getInterval()}_pause(){clearTimeout(this._timer),this._running=!1}_resume(){this._slowDown=!1,this._running=!0,this._cycle()}_cycle(){var e=this;return(0,i.default)((function*(){e._running&&(e._isDue()&&(__LOG__(2)`LazyPoll[${e._name}]: Polling...`,yield e._callback(),e._lastPoll=Date.now()),clearTimeout(e._timer),e._timer=setTimeout((()=>e._cycle()),e._getInterval()))}))()}poll(e){null==this._callback?(this._callback=e,this._running=!0,this._cycle()):this.resume()}pause(){__LOG__(2)`LazyPoll[${this._name}]: Manually Paused`,this._lock=!0,this._pause()}resume(){__LOG__(2)`LazyPoll[${this._name}]: Manually Resumed`,this._lock=!1,this._resume()}}},996588:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.USER_REPORT=t.SERVER_REQUESTED=t.MANUAL_UPLOAD=t.LogType=void 0,t.registerCrashlogUploadInformationalLoggingFunction=function(e){g=e},t.sendLogs=function(){return w.apply(this,arguments)},t.upload=P;var i=r(n(348926)),a=r(n(823493)),o=r(n(542817)),s=n(801506),l=n(207024),u=n(591547),c=n(994569),d=r(n(79291)),p=n(459857),_=r(n(571834)),f=r(n(794938));const h=e=>new Promise((t=>setTimeout(t,e)));let g;const m=n(76672)({CRASHLOG:"crashlog",SUPPORT:"support"});t.LogType=m;const y="server-requested";t.SERVER_REQUESTED=y;t.MANUAL_UPLOAD="manual-upload";t.USER_REPORT="user-report";const E=n(76672)({ONLY_EXCEPTION:"only_exception"}),S={shouldHitCheckEndpoint:()=>!1,expectedCodes:[],appendToFormDataForCheck:()=>{},appendToFormDataForUpload:()=>{},shouldUseLightWeightLogs:()=>!1},T={shouldHitCheckEndpoint:()=>!0,expectedCodes:[200,403],appendToFormDataForCheck:()=>{},appendToFormDataForUpload:()=>{},shouldUseLightWeightLogs:()=>!1},v={shouldHitCheckEndpoint:()=>!0,expectedCodes:[200,403],appendToFormDataForCheck:e=>{e.append("support_exception_only_upload","true")},appendToFormDataForUpload:(e,t)=>{t&&t.upload===E.ONLY_EXCEPTION&&e.append("exception_only_upload","true")},shouldUseLightWeightLogs:e=>!!e&&e.upload===E.ONLY_EXCEPTION};function A(e,t,n){return n?S:t?v:T}const C=(0,a.default)(I,36e5);function P(){return O.apply(this,arguments)}function O(){return(O=(0,i.default)((function*(e){var t,n;let{reason:r="reason-unspecified",immediate:i=!1,logType:a=m.CRASHLOG,isHighPri:u=!1,nativeCrash:d,voipLog:p,hasTaggedMessage:f=!1,ticketId:h,clientSamplingRate:E=1}=e;if(o.default.isLogoutInProgress)return Promise.resolve();const S=g?g():{platform:void 0,ref:void 0};__LOG__(2)`==================================================`,__LOG__(2)`wa:uploadLogs ref: ${null!==(t=S.ref)&&void 0!==t?t:"no conn"}`,__LOG__(2)`wa:uploadLogs hash: ${"2689073628a9df07d1ae96a8275ff77478fcdb0c"}`,__LOG__(2)`wa:uploadLogs version: ${"2.2246.10"}`,__LOG__(2)`wa:uploadLogs userAgent: ${navigator.userAgent}`,__LOG__(2)`wa:uploadLogs platform: ${null!==(n=S.platform)&&void 0!==n?n:"no platform"}`,__LOG__(2)`wa:uploadLogs webPlatform: ${"web"}`,__LOG__(2)`wa:uploadLogs appId: ${""}`,__LOG__(2)`wa:uploadLogs url: ${location.href}`,__LOG__(2)`wa:uploadLogs distribution: ${(0,l.getDistribution)()}`,__LOG__(2)`wa:uploadLogs buildId: ${"426861583"}`,__LOG__(2)`wa:uploadLogs mdOptIn: ${!0}`,f&&__LOG__(2)`wa:uploadLogs hasTaggedMessage`,__LOG__(2)`reason for logs: ${`[MD] ${r}`}`,__LOG__(2)`${c.END_OF_UPLOAD}`;try{const e=new _.default.CrashLog;e.crashReason=r,e.commit()}catch(e){__LOG__(2)`wa:uploadLogs error logging wam event: ${e}`}if(L(E)){let e=I;if(!u){if(!(Math.random()<s.UPLOAD_TO_CLB))return void __LOG__(2)`wa:uploadLogs squelched logs`;e=C}const t=A(0,f,r===y);try{return yield e({isHighPri:u,immediate:i,logType:a,nativeCrash:d,voipLog:p,ticketId:h,getFullLogs:r===y,uploadStrategy:t})}catch(e){__LOG__(2)`wa:uploadLogs error uploading: ${e}`}}else __LOG__(2)`Crashlog:upload client sampling check w/rate: ${E} prevented upload`}))).apply(this,arguments)}function I(){return M.apply(this,arguments)}function M(){return(M=(0,i.default)((function*(e){let t,{isHighPri:n=!1,immediate:r,logType:i,nativeCrash:a,voipLog:o,ticketId:l,getFullLogs:c=!1,uploadStrategy:d}=e;if(yield h(r?0:500),d.shouldHitCheckEndpoint()){const e=b({isHighPri:n});if(d.appendToFormDataForCheck(e),t=yield f.default.post(R(i),e),!d.expectedCodes.includes(t.status))throw new Error(`Status code of ${t.status} from ${s.CLB_CHECK_URL} was unexpected, expected values are: ${d.expectedCodes.toString()}`);if(403===t.status)throw new Error("Aborting Crashlog upload due to 403 response")}else __LOG__(2)`Crashlog:doUpload skipping sampling check`;let p=null;if(t)try{p=JSON.parse(t.responseText)}catch(e){__LOG__(2)`Crashlog:failed to parse response from upload check ${String(e)}, will perform default upload`}const _=b({isHighPri:n});d.appendToFormDataForUpload(_,p);const g=(yield u.Logger.getLogs(c,d.shouldUseLightWeightLogs(p))).join("\n"),m=new Blob([g],{type:"text/plain"});_.append("file",m,"logs.txt"),l&&_.append("ticket_id",l),a&&(_.append("attachment",new Blob([a.contents],{type:"application/octet-stream"}),a.filename),_.set("agent",a.agent),_.append("tags","electron_native"),o&&_.append("voip_log",new Blob([o.contents],{type:"text/plain"}),o.filename));const y=N(i),E=yield f.default.post(y,_);if(200!==E.status)throw new Error(`Status code of ${E.status} from ${y} was unexpected, expected 200`);return E.getResponseHeader("X-Uploaded-File-Id")}))).apply(this,arguments)}function b(e){let{isHighPri:t}=e;const r=new FormData;t&&r.append("forced","true");const i=(0,p.getMe)();i&&r.append("from_jid",i.toString());const a=n(524173).default.info(),o=(0,l.getLogUserAgent)({device:a.os,browser:a.ua,appVersion:"2.2246.10"});return r.append("agent",o),r.append("app_id",""),r.append("build_id","426861583"),r.append("md_opt_in","true"),r}function R(e){return d.default.build(s.CLB_CHECK_URL,{type:String(e),access_token:s.CLB_TOKEN})}function N(e){return d.default.build(s.CLB_URL,{type:String(e),access_token:s.CLB_TOKEN})}function w(){return(w=(0,i.default)((function*(e,t){u.Logger.isTakeOver||(yield P({reason:e,hasTaggedMessage:!0,clientSamplingRate:null!=t?t:1}))}))).apply(this,arguments)}function L(e){return!(e<=0)&&(e>=1||Math.random()<e)}},356344:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:String,a=(0,i.default)(e,t.map(r)).join("");const o=n?4e3:Number.POSITIVE_INFINITY;a.length>o&&(a=a.slice(0,o).replace(/\s+$/," [truncated]"));return a};var i=r(n(332193))},591547:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0,t.cycleThroughLogLines=T,t.log=void 0;var i=r(n(348926)),a=r(n(435161)),o=r(n(957124)),s=n(201063),l=n(801506),u=r(n(356344)),c=n(994569),d=n(191873),p=r(n(236642)),_=n(94872),f=r(n(730381));const h=Date.now(),g="LTSXOo+_*-=.<^!#?".split("");function m(){return g[Math.round(Math.random()*(g.length-1))]}const y=m()+m()+m()+m(),E={};E[E.ALL=0]="all",E[E.INFO=1]="info",E[E.LOG=2]="log",E[E.WARN=3]="warn",E[E.ERROR=4]="error",E[E.OFF=5]="off";function S(e){switch(e){case E.INFO:case E.LOG:case E.WARN:case E.ERROR:return E[e];default:throw new Error(`Unexpected numeric log level: ${e}`)}}function T(){return v.apply(this,arguments)}function v(){return(v=(0,i.default)((function*(e,t,n,r){yield A(e,t+1,n,r),yield A(0,e,n,r)}))).apply(this,arguments)}function A(){return C.apply(this,arguments)}function C(){return(C=(0,i.default)((function*(e,t,n,r){for(let i=e;i<t;i+=n){const e=Math.min(i+n,t);yield r(i,e)}}))).apply(this,arguments)}const P=new class{constructor(){var e=this;this.logs=[],this.localCursor=0,this.pending=void 0,this.timer=new s.ShiftTimer((()=>this._persistIdb())),this.isTakeOver=!1,this.log=(0,o.default)((function(t){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;return function(o){for(var s=arguments.length,l=new Array(s>1?s-1:0),c=1;c<s;c++)l[c-1]=arguments[c];const d=(0,u.default)(o,l,!n);return e.logImpl(t,d,r,i,a),d}}),((e,t,n,r,i)=>n||i?null:String(e)+String(Boolean(t))+String(Boolean(r))))}logImpl(e,t,n,r,i){const a=(0,f.default)().locale("en").format("YYYY-MM-DD HH:mm:ss.SSS:"),o=n?`\n${(0,d.normalizeStack)(n,!0)}`:"",s=[S(e),r?"sendlogs":null,...null!=i?i:[]].filter(Boolean).map((e=>`[${e}]`)).join(""),u=`${y} ${a}`+(s?`${s} `:"")+t+o;this.logs.push(u),this.isTakeOver||(this.logs.length>l.LOG_SIZE&&(this.logs.shift(),this.localCursor--),this.timer.debounceAndCap(250,1e3))}logUncaughtError(e,t){const n=e instanceof Error&&e.stack?e:void 0;let r;if(r=n?String(e):t?`unhandled-rejection: ${String(e)}`:`Error: ${String(e)}`,this.logImpl(E.ERROR,r,n,!0,["uncaught"]),null!=t){const e=String(t);this.logImpl(E.WARN,e)}return r}onTakeOver(){this.isTakeOver=!0}registerErrorNotificationListener(e){this._errorNotificationCallback=e}getLogs(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const o=n(482904).default,s=[];return this.pending&&s.push(this.pending),this.timer.isScheduled()&&(this.timer.forceRunNow(),this.pending&&s.push(this.pending)),Promise.all(s).then((()=>o.idb())).then(function(){var n=(0,i.default)((function*(n){return(0,c.getTimeboxedAndTrimmedLogs)(n,t?0:e._createTimeStamp()-6048e5,r)}));return function(){return n.apply(this,arguments)}}()).then((e=>(0,a.default)(e,"log"))).catch((()=>this.logs))}_clearLogsInBatches(){var e=this;return(0,i.default)((function*(){const t=n(482904).default,{asyncSleep:r}=n(583159),a=yield t.idb(),o=yield a.logs.toCollection().last();if(null==o)return;const s=o.line,l=e._getCursor(),u=function(){var e=(0,i.default)((function*(e,t){try{yield a.transaction("rw",a.logs,(0,i.default)((function*(){const n=yield a.logs.where("line").between(e,t).primaryKeys();yield a.logs.bulkDelete(n)})))}catch(e){__LOG__(2)`_clearLogsInBatches: error while deleting, ${e.stack}`}yield r(0)}));return function(){return e.apply(this,arguments)}}();yield T(l,s,1e3,u)}))()}_clearLogsInDB(){return(0,i.default)((function*(){const e=n(482904).default;yield e.idb().then((e=>e.logs.clear())).catch((()=>{}))}))()}clearLogs(){var e=this;return(0,i.default)((function*(){yield e._clearLogsInDB(),e._setCursor(0),e.localCursor=0,e.logs=[]}))()}clearLogsPreemptive(){var e=this;return(0,i.default)((function*(){{const{getShouldPreemptivelyCleanupLogs:t,setShouldPreemptivelyCleanupLogs:r}=n(757453);t()&&(yield e._clearLogsInDB(),r(!1))}}))()}_optimisticallyAdvanceCursor(e,t){this.localCursor+=t,this._setCursor((e+t)%l.LOG_SIZE)}_persistIdb(){const e=n(482904).default,t=this.logs.slice(Math.max(this.localCursor,0),this.logs.length);t.length&&(this.pending=e.idb().then((e=>e.transaction("rw",e.logs,e.user,(()=>{let n=this._getCursor();this._optimisticallyAdvanceCursor(n,t.length),t.forEach((t=>{n=(n+1)%l.LOG_SIZE,e.logs.put({line:n,log:t,timestamp:this._createTimeStamp()})}))})))).catch((()=>{})).finally((()=>{this.pending=void 0})))}_createTimeStamp(){return performance&&performance.now()+h||Date.now()}_getCursor(){try{return JSON.parse(p.default.getItem(_.KEYS.LOG_CURSOR))||Math.max(this.localCursor,0)}catch(e){return Math.max(this.localCursor,0)}}_setCursor(e){return p.default.setItem(_.KEYS.LOG_CURSOR,String(e))}};t.Logger=P;const O=P.log;t.log=O},463812:(e,t,n)=>{"use strict";t.TG=function(e){const{promise:t,reason:n}=e,a=i.Logger.logUncaughtError(n,t);if(!d(n))return;r.upload({reason:a,hasTaggedMessage:!0})},t.HC=function(e,t,a,o,p){if(function(e){const t=[...l];return t.push(...u),t.some((t=>{let{partialUserAgent:n,partialMsg:r}=t;return c.includes(n)&&String(e).includes(r)}))}(e))return __LOG__(3)`Ignored Error: ${e||(p||"").toString()}`,!0;try{const{UIM:e}=n(238669);e.pprint(!0)}catch(e){__LOG__(3)`UIM Print Failed!`}const _=t.split("?")[0];let f;f=_&&"number"==typeof a?` (${_}:${a}:${o})`:_?` (${_})`:"";if("Script error."===e&&!p)return i.Logger.logUncaughtError(`${f} ${e}`),_&&r.upload({reason:"script-error",hasTaggedMessage:!0}),!1;const h=p instanceof Error&&p.stack?p:`${e||`Given: ${String(p)}`}`,g=i.Logger.logUncaughtError(h);if(!d(p))return!0;const m=function(e){return s.some((t=>{let{partialMsg:n}=t;return String(e).includes(n)}))}(e)||function(e){return e instanceof Error&&null!=e.stack&&e.stack.includes("chrome-extension://")}(p)?0:1;return r.upload({reason:g,hasTaggedMessage:!0,clientSamplingRate:m}),!0};var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=i?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(996588)),i=n(591547),a=n(288057);function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}const s=[{partialMsg:"ReferenceError: webpackJsonp is not defined at loadModule"},{partialMsg:"TypeError: i(...).spectrum is not a function"}],l=[{partialUserAgent:"Chrome",partialMsg:"ResizeObserver loop limit exceeded"}],u=[{partialUserAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36",partialMsg:"Cannot read property 'style' of null"},{partialUserAgent:"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36",partialMsg:"Unexpected token :"},{partialUserAgent:"Firefox/52.0,,Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.4) Gecko/20100101 Firefox/52.0",partialMsg:"Cannot read property 'style' of undefined"},{partialUserAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Safari/605.1.15",partialMsg:"is not an object"},{partialUserAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36",partialMsg:"Cannot read property 'getElementsByTagName' of undefined"},{partialUserAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36",partialMsg:"Can't find variable: dismissKeyboard"},{partialUserAgent:"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36",partialMsg:"ReferenceError: None is not defined"},{partialUserAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36",partialMsg:"Cannot read properties of null (reading 'style')"},{partialUserAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36",partialMsg:"Cannot read properties of undefined (reading 'getElementsByTagName')"}],c=window.navigator.userAgent;function d(e){return!(e instanceof a.DbOnLogoutAbort)}},994569:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.TRIM_LENGTH=t.END_OF_UPLOAD=void 0,t.getTimeboxedAndTrimmedLogs=function(){return o.apply(this,arguments)};var i=r(n(348926));const a="==================================================EOU";t.END_OF_UPLOAD=a;function o(){return(o=(0,i.default)((function*(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=[];if(n){const n=yield e.logs.orderBy("timestamp").filter((e=>e.timestamp>=t)).reverse().until((e=>e.log.includes("[sendlogs]")),!0).toArray();for(let e=n.length-1;e>=0&&(s(n[e],r),!n[e].log.includes(a));e--);}else yield e.logs.orderBy("timestamp").filter((e=>e.timestamp>=t)).each((e=>{s(e,r)}));return r}))).apply(this,arguments)}function s(e,t){e.log=e.log.slice(0,2500),t.push(e)}t.TRIM_LENGTH=2500},207024:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDistribution=function(){let e="unknown";return e="prod","web_prod"},t.getLogUserAgent=function(e){let t,{appVersion:n,browser:r,device:i}=e;return t="Web/"+r,`WhatsApp/${n} ${t} Device/${i}`}},48474:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.enrich=function(e,t){let n;switch((0,o.previewType)(t)){case"pdf":n=l(e);break;case"msoffice":n=function(){return u.apply(this,arguments)}(e);break;default:n=Promise.resolve()}return(0,a.promiseTimeout)(n,3e3,"Document enrichment timeout").catch((()=>null))},t.enrichPdf=l;var i=r(n(348926)),a=n(975175),o=n(937484),s=r(n(231170));function l(e){let t;return s.default.fileToPdf(e).then((e=>(t=e,s.default.pdfToImg(e,1)))).catch((()=>(__LOG__(2)`pdf preview generation failed`,null))).finally((()=>{t&&s.default.releasePdf(t)}))}function u(){return(u=(0,i.default)((function*(){}))).apply(this,arguments)}},698210:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.FILETYPE=void 0,t.blobToArrayBuffer=u,t.blobToText=function(){return p.apply(this,arguments)},t.createFile=function(e,t,n){const r=new Blob(e,n||{});return r.name=t,r},t.getAudioDuration=function(e){let t,n;return new Promise(((r,i)=>{t=document.createElement("audio"),t.addEventListener("loadeddata",r),t.addEventListener("error",(()=>{i(new Error("getAudioDuration: error loading audio"))})),t.src=n=URL.createObjectURL(e)})).then((()=>~~t.seekable.end(0))).finally((()=>{n&&URL.revokeObjectURL(n)}))},t.getFileExtension=d,t.getMimeTypeForFilepath=function(e){const t=d(e),n=(0,a.isAllowedDocumentMimetype)(a.EXT_TO_MIME&&t&&a.EXT_TO_MIME[t],e,!1);if(n)return n},t.removeTrailingDots=c,t.typeFromMimetype=function(e){const t=e.split("/")[0];switch(t){case s.IMAGE:case s.VIDEO:case s.AUDIO:return t;default:return s.DOCUMENT}},t.validateBlob=function(e){return u(e.webkitSlice?e.webkitSlice(0,1):e.slice(0,1)).then((e=>1===e.byteLength)).catch((()=>!1))};var i=r(n(348926)),a=n(937484),o=n(288057);const s=Object.freeze({IMAGE:"image",VIDEO:"video",AUDIO:"audio",DOCUMENT:"document",STICKER:"sticker"});t.FILETYPE=s;const l=e=>{var t;return null!==(t=null==e?void 0:e.message)&&void 0!==t?t:""};function u(e){let t;return new Promise(((n,r)=>{t=new FileReader,t.onload=n,t.onerror=()=>{var e;r("NotReadableError"===(null===(e=t.error)||void 0===e?void 0:e.name)?new o.FileNotReadableError(`blobToArrayBuffer error: ${l(t.error)}`):new Error(`blobToArrayBuffer error: ${l(t.error)}`))},t.onabort=()=>{r(new Error(`blobToArrayBuffer abort: ${l(t.error)}`))},t.readAsArrayBuffer(e)})).then((()=>t.result))}function c(e){return e.replace(/\.+$/,"")}function d(e){const t=c(e.trimRight()).split(".");return t.length>1?t[t.length-1].toLowerCase():null}function p(){return(p=(0,i.default)((function*(e){if("function"==typeof e.text)return e.text();const t=new FileReader;if(yield new Promise(((n,r)=>{t.onload=n,t.onerror=e=>{r(new Error(`blobToText error: ${String(e)}`))},t.onabort=e=>{r(new Error(`blobToText abort: ${String(e)}`))},t.readAsText(e)})),t.result instanceof ArrayBuffer)throw new TypeError("blobToText error: Invalid result type: ArrayBuffer");if(null==t.result)throw new TypeError("blobToText: Invalid result type: null");return t.result}))).apply(this,arguments)}},67819:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.setupLodashMemoizeCache=function(){i.default.Cache=a.MemoizeCache};var i=r(n(288306)),a=n(406949)},524173:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(23279)),a=n(417405),o=n(990445),s=n(368170);let l=!1;const u=(0,i.default)((()=>l=!1),500);function c(){const e=new Uint8Array(16);return self.crypto.getRandomValues(e),(0,a.encodeB64)(e)}var d={id(){const e=n(757453);let t=e.getBrowserId();return t||(t=c(),e.setBrowserId(t),t)},persistentExpiringId(){const e=n(757453);let t=e.getPersistentExpiringId();if(null!=t){if(!((0,o.unixTime)()-t.ts>=7776e3))return t.value}return t=c(),e.setPersistentExpiringId({ts:(0,o.unixTime)(),value:t}),t},info(){const e=s.UA.parser.getResult();return{os:e.os.name,version:e.os.version,name:e.browser.name,ua:e.browser.name+" "+e.browser.version}},hardRefresh(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.promptUnloadGuards++,e){n(173077).setNoTakeover(!0)}location.reload(t)},startDownloading(){l=!0,u()},clearDownloading(){l=!1},isDownloading:()=>l,promptUnloadGuards:0,open(e){window.open(e,"_blank","noopener,noreferrer")}};t.default=d},231170:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(989211),o=n(36530),s=n(962833),l=n(204597),u=n(588750),c=r(n(846870)),d=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=h(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(428363)),p=r(n(756680)),_=n(241588),f=r(n(44053));function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(h=function(e){return e?n:t})(e)}t.default=class{static fileToPdf(e){const t=URL.createObjectURL(e);return(0,s.promiseLoop)((function(e,t,r){const i=(0,o.delayMs)((0,a.expBackoff)(r,12e4,0,0));return n.e(2974).then(n.t.bind(n,299299,23)).then((t=>{t.GlobalWorkerOptions.workerSrc=f.default,e({GlobalWorkerOptions:t.default.GlobalWorkerOptions,getDocument:t.default.getDocument})})).catch((()=>i))})).then((e=>e.getDocument(t).promise))}static releasePdf(e){return e.destroy()}static pdfToImg(e,t){const n=document.createElement("canvas");return e.getPage(t).then((e=>{const t=e.getViewport({scale:1}),r=n.getContext("2d");return n.height=t.height,n.width=t.width,e.render({canvasContext:r,viewport:t}).promise})).then((()=>(0,l.promiseProps)({blob:(0,u.canvasToBlob)(n),thumbnail:d.rotateAndResize(n,c.default.DOC_THUMB_MAX_EDGE,d.DATA_URL|d.CANVAS|d.BLOB),microThumbnail:_.ServerProps.webUploadDocumentThumbMmsEnabled?(0,u.generateMicroThumb)(n,1300,{mimetype:"image/jpeg",maxAttempts:10}):Promise.resolve(null)}))).then((e=>e)).then(function(){var t=(0,i.default)((function*(t){let{blob:n,thumbnail:r,microThumbnail:i}=t;return{url:URL.createObjectURL(n),thumbUrl:r.images.dataUrl,width:r.images.canvas.width,height:r.images.canvas.height,fullPreviewData:yield p.default.createFromData(r.images.blob,"image/jpeg"),fullPreviewSize:{width:r.images.canvas.width,height:r.images.canvas.height},pdfPages:e.numPages,microThumbnail:i}}));return function(){return t.apply(this,arguments)}}())}}},848624:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.phashV1=function(){return l.apply(this,arguments)},t.phashV2=function(){return u.apply(this,arguments)};var i=r(n(348926)),a=n(417405),o=n(638778),s=n(669050);function l(){return(l=(0,i.default)((function*(e){const t=e.map((e=>(0,s.toUserWid)(e).toString({legacy:!0}))).sort().join(""),n=[];for(let e=0;e<t.length;e++)n.push(t.charCodeAt(e));const r=new Uint8Array(n),i=yield self.crypto.subtle.digest({name:"SHA-1"},r);return`1:${(0,a.encodeB64)(i.slice(0,6))}`}))).apply(this,arguments)}function u(){return(u=(0,i.default)((function*(e){const t=e.map((e=>e.toString({legacy:!0,formatFull:!0}))).sort().join(""),n=[];for(let e=0;e<t.length;e++)n.push(t.charCodeAt(e));const r=new Uint8Array(n),i=yield(0,o.sha256)(r);return`2:${(0,a.encodeB64)(i.slice(0,6))}`}))).apply(this,arguments)}},105284:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Field=void 0,t.getNameString=M,t.getNameStringFromNames=b,t.mergeVcards=function(e){if(0===e.length)throw new Error("No vcards provided");return 1===e.length?e[0]:{displayName:M(e),vcard:e.map((e=>e.vcard)).join("\n"),isMultiVcard:!0}},t.parseMultiVcard=function(e){const t=e.match(/BEGIN:VCARD([\s\S]*?)END:VCARD/g);return t?t.map((e=>O(e))).filter(Boolean):[]},t.parseVcard=O,t.vcardFromContactModel=function(e){var t;const n=P((0,_.getMaybeMeUser)()?e.displayName:e.formattedName),r=["BEGIN:VCARD","VERSION:3.0",`N:${I(e)}`,`FN:${n}`,`TEL;type=CELL;waid=${String(e.userid)}:${(0,h.widToFormattedUser)(e.userid)}`,e.isBusiness?`X-WA-BIZ-NAME:${n}`:null,(null===(t=e.businessProfile)||void 0===t?void 0:t.description)?`X-WA-BIZ-DESCRIPTION:${P(e.businessProfile.description)}`:null,"END:VCARD"].filter(Boolean);return{displayName:n,vcard:r.join("\n"),isMultiVcard:!1}},t.vcardGetDate=function(e){let t=e;return(0,s.default)([/-([^-]*)-([^-]*)-([^-]*)/,/([^-]*)-([^-]*)-([^-]*)/],(n=>{const r=e.match(n);if(r){const e=!r[1].length||"1604"===r[1],n=e?"0000":r[1];return t=(0,m.default)(`${n}-${r[2]}-${r[3]}`).format("l"),e&&(t=t.replace(/[.,-\/\s]*0000[.,-\/\s]*/,"")),!1}})),t},t.vcardGetName=I,t.vcardGetNameFromParsed=function(e){let t=null;const{FN:n,NICKNAME:r,TEL:i}=e;if(null==n?void 0:n[0])t=n[0].value;else if(null==r?void 0:r[0])t=r[0].value;else if(null==i?void 0:i[0]){var a;const e=i[0],n=null===(a=e.properties.waid)||void 0===a?void 0:a[0];t=n?(0,h.widToFormattedUser)(n):e.value}return t},t.vcardGetOrganizationString=function(e){var t,n;const r=null===(t=e.ORG)||void 0===t?void 0:t[0],i=null===(n=e.TITLE)||void 0===n?void 0:n[0];if(r&&Array.isArray(r.value)&&r.value.length>0){var a;let e=null;(null==i?void 0:i.value)&&(e=`${i.value}`.trim());const[t,...n]=r.value;n.push(t);const o=n.map((e=>(0,c.isString)(e)?e.trim():"")).filter((e=>e.length)).join(d.default.t(254));return(e||"")+((null===(a=e)||void 0===a?void 0:a.length)&&o.length?" - ":"")+o}return""},t.vcardGetType=function(e){const t={jabber:g.fbt._("Jabber",null,{hk:"3usmYV"}),"skype-username":g.fbt._("Skype",null,{hk:"1eW8ty"}),skype:g.fbt._("Skype",null,{hk:"1eW8ty"}),msn:g.fbt._("Windows Live",null,{hk:"Cb3b1"}),aim:g.fbt._("AIM",null,{hk:"1dlOP"}),yahoo:g.fbt._("Yahoo",null,{hk:"1VtQI7"}),icq:g.fbt._("ICQ",null,{hk:"M7uX3"}),"wa-biz-description":g.fbt._("Description",null,{hk:"3NFP7B"}),[T]:g.fbt._("Business Name",null,{hk:"MfcFj"})};let n=e.properties["X-ABLabel"]||t[e.type.toLowerCase()];if(null!=n&&""!==n)return function(e){if(!e)return;return e.replace(/^_\$!<([^>]*)>!\$_$/,"$1").replace(/\\,/,",").replace(/\\;/,";").replace(/\\\\/,"\\")}(String(n));const r={TEL:[[["cell"],g.fbt._("Mobile",null,{hk:"1ciHPV"})],[["iphone"],g.fbt._("iPhone",null,{hk:"2MkuaG"})],[["main"],g.fbt._("Main",null,{hk:"46Vh7G"})],[["home","fax"],g.fbt._("Home Fax",null,{hk:"34IobZ"})],[["work","fax"],g.fbt._("Work Fax",null,{hk:"4FNmsW"})],[["home"],g.fbt._("Home",null,{hk:"2zkVn1"})],[["work"],g.fbt._("Work",null,{hk:"3QfW2u"})],[["pager"],g.fbt._("Pager",null,{hk:"20r5VT"})],[[],g.fbt._("Home",null,{hk:"2zkVn1"})]],EMAIL:[[["home"],g.fbt._("Home",null,{hk:"2zkVn1"})],[["work"],g.fbt._("Work",null,{hk:"3QfW2u"})],[["internet"],g.fbt._("Email",null,{hk:"2Vzd0N"})]],URL:[[["home"],g.fbt._("Home",null,{hk:"2zkVn1"})],[["work"],g.fbt._("Work",null,{hk:"3QfW2u"})]],ADR:[[["home"],g.fbt._("Home",null,{hk:"2zkVn1"})],[["work"],g.fbt._("Work",null,{hk:"3QfW2u"})]]};return n=e.type,(0,u.default)(r,(t=>{if(t){const[r,i]=t;if(0===(0,o.default)(r,(0,a.default)(e.properties.type,(e=>e.toLowerCase()))).length)return n=i,!1}})),n},t.vcardIsBiz=function(e){return(e.SERVICE||[]).some((e=>e.type.toLowerCase()===T&&e.value))},t.vcardThumbnail=function(e){if(!e)return;const{PHOTO:t}=e;if((null==t?void 0:t[0])&&p.default.isData(t[0].value))return t[0].value},t.vcardWids=function(e){let t=[];(null==e?void 0:e.TEL)&&e.TEL.forEach((e=>{var n,r,i;(null!==(n=null===(r=e.properties)||void 0===r||null===(i=r.waid)||void 0===i?void 0:i.length)&&void 0!==n?n:0)>0&&(t=t.concat((0,a.default)(e.properties.waid,f.createUserWid)))}));return t};var i=r(n(763105)),a=r(n(435161)),o=r(n(291966)),s=r(n(784486)),l=r(n(189734)),u=r(n(402525)),c=n(425315),d=r(n(932325)),p=r(n(79291)),_=n(459857),f=n(669050),h=n(931019),g=n(548360),m=r(n(730381));const y=/X-([^;:]+)(?:;[^:]+)*:(.+)/,E={"X-ABLabel":[/X-ABLabel(?:;([^:]+))*:(.+)/,1],ADR:[/ADR(?:;([^:]+))*:;;(.*);(.*);(.*);(.*);(.*)/,5],"X-ABADR":[/X-ABADR(?:;([^:]+))*:(.*)/,1],URL:[/URL(?:;([^:]+))*:(.*)/,1],EMAIL:[/EMAIL(?:;([^:]+))*:(.+)/,1],TEL:[/TEL(?:;([^:]+))*:(.+)/,1]},S={N:[/N(?:;([^:]+))*:([^;]*);([^;]*);([^;]*);([^;]*);(.*)/,5],FN:[/FN(?:;([^:]+))*:(.*)/,1],NICKNAME:[/NICKNAME(?:;([^:]+))*:(.*)/,1],"X-PHONETIC-FIRST-NAME":[/X-PHONETIC-FIRST-NAME(?:;([^:]+))*:(.*)/,1],"X-PHONETIC-LAST-NAME":[/X-PHONETIC-LAST-NAME(?:;([^:]+))*:(.*)/,1],ORG:[/ORG(?:;([^:]+))*:([^;]*)(?:;(.*))*/,2],TITLE:[/TITLE(?:;([^:]+))*:(.*)/,1],TEL:[/TEL(?:;([^:]+))*:(.*)/,1],PHOTO:[/PHOTO(?:;([^:]+))*:(.*)/,1],BDAY:[/BDAY(?:;([^:]+))*:(.*)/,1],URL:[/URL(?:;([^:]+))*:(.+)/,1],EMAIL:[/EMAIL(?:;([^:]+))*:(.+)/,1]},T="wa-biz-name";class v{constructor(e,t,n,r){this.type=e,this.index=t,this.properties=n||{},this.value=r}}function A(e,t,n){e[t]||(e[t]=[]),e[t].push(n)}function C(e){const t={};return e?(e.split(";").forEach((e=>{const n=e.split(/=/);if(1===n.length){const e=n[0];A(t,e.toLowerCase(),!0)}else if(2===n.length){const[e,r]=n;A(t,e.toLowerCase(),r.toLowerCase())}})),t):t}function P(e){return e?e.replace(/\\/g,"\\\\").replace(/;/g,"\\;").replace(/,/g,"\\,"):""}function O(e){const t=e.replace(/\r?\n|\r/g,"\n").replace(/\n^[ \t]/gm,"").split("\n").filter((e=>0!==e.trim().length)),n={},r={};if(t.length<3)return;const i=t[0].trim().toUpperCase(),a=t[1].trim().toUpperCase(),o=t[t.length-1].trim().toUpperCase(),s="VERSION:2.1"===a||"VERSION:3.0"===a||"VERSION:4.0"===a;if("BEGIN:VCARD"!==i||!s||"END:VCARD"!==o)return __LOG__(4,void 0,new Error,!0)`vcard:parse failed because the vCard is not formatted as expected:
Header as expected? ${String("BEGIN:VCARD"===i)}
Version as expected? ${String(s)}
Footer as expected? ${String("END:VCARD"===o)}
Lines: ${t.length}`,void SEND_LOGS("vcard-fault");for(let e=2;e<t.length-1;e++){var d;const i=t[e],a=i.match(/item(\d+)\.(.*)/),o=a?a[2]:i,s=null===(d=o.match(/([^:;]*)[:;].*/))||void 0===d?void 0:d[1];if(null==s)continue;const l=a?E:S;let u,p,_=s,f=s;if(l[_]){const[e,t]=l[_],n=o.match(e);n&&(u=C(n[1]),p=1===t?p=n[2]:n.slice(2,2+t))}else{const e=o.match(y);e&&(f="SERVICE",_=e[1],p=e[2],u={})}if((Array.isArray(p)?p:[p]).some((e=>e&&(0,c.isString)(e)&&e.trim())))if(a){const t=a[1];r[t]?r[t].fields.push(new v(_,null,u,p)):r[t]={type:_,index:e,key:f,properties:u,value:p,fields:[]}}else A(n,f,new v(_,e,u,p))}return Object.keys(r).forEach((e=>{const{key:t,index:i,type:a,value:o,properties:s,fields:l}=r[e];l.forEach((e=>{s[e.type]=e.value})),A(n,t,new v(a,i,s,o))})),function(e){const t={};return(0,u.default)(e,((e,n)=>{t[n]=(0,l.default)(e,(e=>e.index))})),t}(n)}function I(e){const t=(0,i.default)(e.formattedName.split(e.formattedShortName)),n=t.length?t[0].trim():void 0,r=n?e.formattedShortName:e.formattedName;return`${P(n)};${P(r)};;;`}function M(e){return b(e.map((e=>e.displayName)))}function b(e){const t=e.find((e=>!!e));return e.length?t?1===e.length?t:d.default.t(481,{contactName:t,count:e.length-1,_plural:e.length-1}):d.default.t(482,{count:e.length,_plural:e.length}):g.fbt._("No contacts",null,{hk:"1p56oN"})}t.Field=v},809572:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;return i.default.request(e,t,n,a,r).then((e=>e.status&&e.status<12e3?e:null)).catch((()=>null))};var i=r(n(794938))},99398:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=r(n(947077)),o=n(54918),s=r(n(524173)),l=r(n(809572));class u extends o.BaseModel{constructor(){super(...arguments),this.online=(0,o.session)(!0),this.waitIfOffline=(0,a.default)((()=>"all"),(0,i.default)((function*(){this.online||("Firefox"!==s.default.info().name&&navigator.onLine?__LOG__(2)`waitIfOffline: XHR online is false, but navigator.onLine is true, resolving promise`:(__LOG__(2)`waitIfOffline: Waiting...`,yield new Promise((e=>{this.listenToOnce(this,"change:online",(()=>{__LOG__(2)`waitIfOffline: Continuing...`,e()}))}))))}))),this.checkOnline=(0,a.default)((()=>"all"),(0,i.default)((function*(){__LOG__(2)`NetworkStatus:checkOnline checking`;try{const e=yield(0,l.default)("https://web.whatsapp.com/status.json");this.online=!!e,__LOG__(2)`NetworkStatus:checkOnline response ${String(this.online)}`}catch(e){__LOG__(3)`NetworkStatus:checkOnline errored! ${String(e)}`}})))}initialize(){this.listenTo(this,"change:online",this._logOnlineOffline),this._logOnlineOffline()}_logOnlineOffline(){const e=this.online;__LOG__(2)`NetworkStatus ${e?"online":"offline"}`}}var c=new((0,o.defineModel)(u));t.default=c},192737:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEffectiveNetworkType=function(){if(navigator.connection&&"string"==typeof navigator.connection.effectiveType)return navigator.connection.effectiveType;return null}},794938:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(88237),a=r(n(589970)),o=r(n(79291));const s={GET:"GET",POST:"POST",HEAD:"HEAD",PUT:"PUT"};function l(e,t){for(const n in t)e.setRequestHeader(n,t[n])}function u(e,t,n,r,u,c,d){const p=new XMLHttpRequest,_=new Promise(((r,i)=>{if(p.onload=function(e){4===p.readyState?r(p):(__LOG__(4,void 0,new Error)`xhr.request:onload`,i(e))},p.onerror=e=>{__LOG__(4,void 0,new Error)`xhr.request:onerror`,i(e)},p.ontimeout=e=>{__LOG__(4,void 0,new Error)`xhr.request:ontimeout`,i(e)},c&&(p.onprogress=c),p.onabort=e=>{__LOG__(4,void 0,new Error)`xhr.request:onabort`,i(e)},n instanceof FormData)p.open(t||s.POST,e,!0),u&&(p.responseType=u),d&&l(p,d),p.send(n);else if(n instanceof Object){const r=o.default.build(e,n);p.open(t||s.GET,r,!0),u&&(p.responseType=u),d&&l(p,d),p.send()}else p.open(t||s.GET,e,!0),u&&(p.responseType=u),d&&l(p,d),p.send()})),f=(0,a.default)(_,r).cancellable();return f.catch((0,i.catchAbort)((()=>{p.abort()}))).catch((()=>{})),f}var c={head:function(e,t){return u(e,s.HEAD,null,t)},get:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0;return u(e,s.GET,null,r,t,void 0,n)},post:function(e,t,n){return u(e,s.POST,t,n)},request:u,VERB:s,RESP_TYPE:{ARRAY_BUFFER:"arraybuffer",BLOB:"blob",JSON:"json"}};t.default=c},754424:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.extendedFetch=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return _(e,t).catch((e=>{if(e.name===o.ABORT_ERROR)throw new o.AbortError;if(e instanceof l.HttpNetworkError)throw e;throw new l.HttpNetworkError(e.message)}))},t.sharedFetch=_;var i=r(n(348926)),a=r(n(81109)),o=n(88237),s=n(81758),l=n(791357),u=r(n(284187)),c=r(n(381912)),d=n(725241);const p=n(76672)({UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4});function _(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise(((n,r)=>{var o;if(null===(o=t.signal)||void 0===o?void 0:o.aborted)return void r(new d.DOMException("AbortError"));const _=new XMLHttpRequest;if(t.signal){const e=t.signal;e.addEventListener("abort",(function t(){e.removeEventListener("abort",t),_.onreadystatechange=()=>{},_.abort(),r(new d.DOMException("AbortError"))}))}const{onProgress:f,onResponseText:h}=t;var g;(null!=f||h)&&(("post"===(null===(g=t.method)||void 0===g?void 0:g.toLowerCase())&&null!=_.upload?_.upload:_).onprogress=e=>{h&&h(e,_.responseText),f&&f(e)});const{onHeadersReceived:m}=t;_.onreadystatechange=()=>{if(_.readyState===p.UNSENT)r(new Error("fetch error: not sent"));else if(_.readyState===p.HEADERS_RECEIVED&&null!=m)m(new c.default((0,u.default)(_.getAllResponseHeaders())));else if(_.readyState===p.DONE){if(null==_.status)return void r(new Error("fetch error: no status"));if(0===_.status||_.status>=12e3)return void r(new Error(`fetch error: unexpected status ${_.status}`));n(E())}},_.onerror=()=>r(new Error("fetch error: error")),_.ontimeout=()=>{r(new l.HttpTimedOutError("fetch error: timedout"))},_.withCredentials="include"===t.credentials,null!=t.timeout&&(_.timeout=t.timeout),_.open(t.method||"get",e.toString(),!0);const y=new c.default(t.headers||{});for(const e of y.keys()){const t=y.get(e);null!=t&&_.setRequestHeader(e,t)}function E(){const e=new c.default((0,u.default)(_.getAllResponseHeaders()));return(0,a.default)((0,a.default)({ok:200<=_.status&&_.status<300,statusText:_.statusText,status:_.status,url:_.responseURL},function(){if(h)return{text:()=>Promise.resolve(_.responseText),json:()=>Promise.resolve(JSON.parse(_.responseText)),arrayBuffer:()=>(0,s.largeStringToArrayBuffer)(_.responseText)};return{text:()=>S(),json:(e=(0,i.default)((function*(){const e=yield S();return JSON.parse(e)})),function(){return e.apply(this,arguments)}),arrayBuffer:()=>_.response};var e}()),{},{blob:()=>Promise.resolve(new Blob([_.response],{type:e.get("content-type")||""})),clone:E,headers:e})}function S(){return Promise.resolve(String.fromCharCode(...Array.from(new Uint8Array(_.response))))}h?_.overrideMimeType("text/plain; charset=x-user-defined"):_.responseType="arraybuffer",_.send(t.body||null)}))}},284187:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(e||"").trim().toLowerCase().split("\n").reduce(((e,t)=>{if(!t.trim())return e;const n=t.indexOf(":"),r=t.substr(0,n).trim(),i=t.substr(n+1).trim().replace(/;$/,"");return e[r]?Array.isArray(e[r])?e[r].push(i):e[r]+=`, ${i}`:e[r]=i,e}),{})}},791357:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MmsDownloadFilehashMismatchError=t.HttpTimedOutError=t.HttpStatusCodeError=t.HttpNetworkError=t.HttpInvalidResponseError=void 0;var r=n(643930);class i extends((0,r.customError)("HttpNetworkError")){}t.HttpNetworkError=i;t.HttpTimedOutError=class extends i{constructor(){super(...arguments),this.name="HttpTimedOutError"}};class a extends((0,r.customError)("HttpStatusCodeError")){constructor(e,t,n){super(`${t}: ${e}`),this.status=e}}t.HttpStatusCodeError=a;class o extends((0,r.customError)("HttpInvalidResponseError")){constructor(e,t){super(e)}}t.HttpInvalidResponseError=o;t.MmsDownloadFilehashMismatchError=class extends o{constructor(e){super("mmsDownload: filehash mismatch",e),this.name="MmsDownloadFilehashMismatchError"}}},176309:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e,a)};var i=r(n(114176));const a=e=>null==e},243957:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=()=>"randomUUID"in self.crypto?self.crypto.randomUUID():([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)))},219368:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=n(754424);const o=()=>{};var s="fetch"in window?fetch:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,a.sharedFetch)(e,(0,i.default)((0,i.default)({},t),{},{onProgress:o}))};t.default=s},65162:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(368170);["webkitGetUserMedia"].forEach((function(e){const t=Object.getPrototypeOf(navigator)[e];t&&navigator[e]!==t&&(navigator[e]=t)}));var i=function(){var e;if(r.UA.isBrokenGetUserMedia)return null;const t=null===(e=navigator.mediaDevices)||void 0===e?void 0:e.getUserMedia;if(t)return t.bind(navigator.mediaDevices);const n=navigator.getUserMedia||navigator.mozGetUserMedia||navigator.webkitGetUserMedia;return n?function(e){return new Promise((function(t,r){n.call(navigator,e,t,r)}))}:null}();t.default=i},381912:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(408580),a=r(n(445045));let o;var s="Headers"in window&&Headers?Headers:(o=a.default.iterator,class e{constructor(t){if(this._headers={},t instanceof e)for(const e of t.entries()){const[t,n]=e;n.split(", ").forEach((e=>{this.append(t,e)}))}else if("object"==typeof t)for(const e in t){t[e].split(", ").forEach((t=>{this.append(e,t)}))}}append(e,t){const n=e.toLowerCase();n in this._headers?this._headers[n].push(t):this._headers[n]=[t]}delete(e){const t=e.toLowerCase();delete this._headers[t]}entries(){const e=Object.keys(this._headers).map((e=>[e,this.get(e)||""]));return(0,i.iteratorFromArray)(e)}get(e){const t=e.toLowerCase();return t in this._headers?this._headers[t].join(", "):null}has(e){return e.toLowerCase()in this._headers}keys(){return(0,i.mapIterator)(this.entries(),(e=>{let[t]=e;return t}))}set(e,t){const n=e.toLowerCase();this._headers[n]=[t]}values(){return(0,i.mapIterator)(this.entries(),(e=>{let[t,n]=e;return n}))}[o](){return this.entries()}toString(){return"[Object Headers]"}});t.default=s},881839:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.requestIdleCallback=t.cancelIdleCallback=void 0;const n=window.requestIdleCallback,r=window.cancelIdleCallback,i="requestIdleCallback"in window?n:function(e){return setTimeout((()=>{const t=Date.now();e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})}),1)};t.requestIdleCallback=i;const a="cancelIdleCallback"in window?r:function(e){clearTimeout(e)};t.cancelIdleCallback=a},841737:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=window.MediaError||{MEDIA_ERR_ABORTED:1,MEDIA_ERR_NETWORK:2,MEDIA_ERR_DECODE:3,MEDIA_ERR_SRC_NOT_SUPPORTED:4};t.default=n},445045:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r="Symbol"in window?Symbol:((n=class{}).iterator="@@iterator",n);t.default=r},665810:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n(35449);var r=URLSearchParams;t.default=r},537152:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926));class a{constructor(e){this._handleMessage=e=>{if(!e.data||!e.data.action)return;const t=e.data;if(!e.ports||0===e.ports.length)return;const n=e.ports;if(!a.isSW()&&window.navigator.serviceWorker&&e.source!==window.navigator.serviceWorker.controller)return;let r;r="function"==typeof e.waitUntil?t=>e.waitUntil(t):()=>{},r(Promise.resolve(this.requestHandler(t)).then((e=>{n[0].postMessage(e)})).catch((e=>{n[0].postMessage({error:e&&e.toString()})})))},this.requestHandler=e}init(){const e=a.isSW()?self:window.navigator.serviceWorker;try{if(!e)return;e.addEventListener("message",this._handleMessage)}catch(e){}}static isSW(){return"undefined"==typeof window}static getRequestor(e){return a.isSW()?"string"==typeof e?self.clients.get(e):Promise.resolve(e):window.navigator.serviceWorker?window.navigator.serviceWorker.ready.then((()=>window.navigator.serviceWorker?window.navigator.serviceWorker.controller:null)):Promise.resolve(null)}static broadcast(e,t){return(0,i.default)((function*(){if(!a.isSW())throw new Error("Broadcast called from non-serviceworker.");const n=yield self.clients.matchAll();return 0===n.length?Promise.reject(new Error("No clients available.")):Promise.all(n.map((n=>a.request(n,e,t))))}))()}static request(e,t,n){const r=new MessageChannel;return new Promise(((i,o)=>(r.port1.onmessage=e=>{var t;(null===(t=e.data)||void 0===t?void 0:t.error)?o(e.data.error):i(e.data)},a.getRequestor(e).then((e=>{if(!e)return o(new Error("No ServiceWorker controlling this client."));e.postMessage({action:t,message:n,version:"2.2246.10"},[r.port2])})))))}}t.default=a},647349:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n={REQUEST_STREAMING_INFO:"GET_STREAMING_INFO",REQUEST_RMR:"REQUEST_RMR",SEND_STREAMING_CHUNK:"SEND_STREAMING_CHUNK",EXP_BACKOFF:"EXP_BACKOFF",LOG:"LOG",UPLOAD_LOGS:"UPLOAD_LOGS",REQUEST_DOCUMENT_DOWNLOAD:"REQUEST_DOCUMENT_DOWNLOAD",SET_L10N:"SET_L10N",STREAMING_SUPPORTED:"STREAMING_SUPPORTED",REMOVE_PP:"REMOVE_PP",LOGOUT:"LOGOUT",CLEAN_ASSETS:"CLEAN_ASSETS",PRELOAD_LAZY_LOADED_BUNDLES:"PRELOAD_LAZY_LOADED_BUNDLES",ACTIVE_TAB:"ACTIVE_TAB"};t.default=n},764597:(e,t,n)=>{"use strict";var r=n(595318),i=n(780549),a=r(n(478885)),o=n(65889),s=n(591547),l=n(72732),u=n(226562),c=n(6961),d=n(841273),p=r(n(537152)),_=r(n(647349));if(a.default.supported){const e=function(){try{const e=navigator.serviceWorker;(null==e?void 0:e.controller)&&e.controller.addEventListener("error",(e=>{c.Socket.state!==u.SOCKET_STATE.UNLAUNCHED&&__LOG__(3)`ServiceWorker controller error: ${e.error}`}))}catch(e){__LOG__(3)`Unable to add "error" event listener to service worker, error: ${e}`}};try{const t=navigator.serviceWorker;t&&t.addEventListener("controllerchange",(()=>{e(),c.Socket.state===u.SOCKET_STATE.UNLAUNCHED&&(d.Stream.needsUpdate=!0)}))}catch(e){__LOG__(3)`Unable to add "controllerchange" event listener to service worker container, error: ${e}`}try{const e=navigator.serviceWorker;e&&e.addEventListener("error",(e=>{c.Socket.state!==u.SOCKET_STATE.UNLAUNCHED&&__LOG__(3)`ServiceWorker container error: ${e.error}`}))}catch(e){__LOG__(3)`Unable to add "error" event listener to service worker container, error: ${e}`}e();const t=function(e,t){e.buffer.forEach((e=>{var n;const r=null!==(n=e.message[0])&&void 0!==n?n:"",i=function(e){switch(e){case"info":return 1;case"log":return 2;case"warn":return 3;case"error":return 4}throw new Error(`Invalid level: ${e}`)}(e.level.match(/^(.*?)(?:Verbose)?$/i)[1]);s.Logger.logImpl(i,`ServiceWorker (${t}): ${r}`,e.error,e.attachedToSendLogs,e.extraTags)}))};new p.default((e=>{var r;let{action:i,message:a,version:s}=e;switch(i){case _.default.REQUEST_STREAMING_INFO:case _.default.EXP_BACKOFF:case _.default.REQUEST_RMR:case _.default.SEND_STREAMING_CHUNK:return null===(r=(0,o.requireHandleVideoStreamingRequest)())||void 0===r?void 0:r.then((e=>null==e?void 0:e({action:i,message:a})));case _.default.LOG:if(c.Socket.state===u.SOCKET_STATE.UNLAUNCHED)return;return a&&t(a,s),{test:!0};case _.default.UPLOAD_LOGS:a&&t(a,s);return n(996588).upload({reason:"Requested by Service Worker"}).then((()=>{}));case _.default.ACTIVE_TAB:return{isActive:(0,l.getIsTabActive)()};default:return Promise.reject(new Error(`Invalid Action: ${i}`))}})).init(),i.Cmd.on("logout",(()=>{const e=navigator.serviceWorker;(null==e?void 0:e.controller)&&p.default.request(e.controller,_.default.LOGOUT).catch((()=>{}))}))}},173207:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926));t.default=class{open(){return this._openPromise?this._openPromise:this._closePromise?(this._openPromise=this._closePromise.catch((e=>{throw this._openPromise=null,e})).then((()=>(this._openPromise=null,this.open()))),this._openPromise):(this._openPromise=this.doOpen().catch((e=>{throw this._openPromise=null,e})).then((()=>{this._openPromise=null})),this._openPromise)}close(){return this._closePromise?this._closePromise:this._openPromise?(this._closePromise=this._openPromise.catch((e=>{throw this._closePromise=null,e})).then((()=>(this._closePromise=null,this.close()))),this._closePromise):(this._closePromise=this.doClose().catch((e=>{throw this._closePromise=null,e})).then((()=>{this._closePromise=null})),this._closePromise)}get(e){var t=this;return(0,i.default)((function*(){return yield t.open(),t.doGet(e)}))()}queryByIndex(e,t){var n=this;return(0,i.default)((function*(){return yield n.open(),n.doQueryByIndex(e,t)}))()}getAll(){var e=this;return(0,i.default)((function*(){return yield e.open(),e.doGetAll()}))()}put(e,t){var n=this;return(0,i.default)((function*(){return yield n.open(),n.doPut(e,t)}))()}del(e){var t=this;return(0,i.default)((function*(){return yield t.open(),t.doDel(e)}))()}count(){var e=this;return(0,i.default)((function*(){return yield e.open(),e.doCount()}))()}clear(){var e=this;return(0,i.default)((function*(){return yield e.open(),e.doClear()}))()}doGet(){throw new Error("Not implemented")}doQueryByIndex(){throw new Error("Not implemented")}doGetAll(){throw new Error("Not implemented")}doPut(){throw new Error("Not implemented")}doDel(){throw new Error("Not implemented")}doCount(){throw new Error("Not implemented")}doClear(){throw new Error("Not implemented")}doOpen(){throw new Error("Not implemented")}doClose(){throw new Error("Not implemented")}}},422660:(e,t)=>{"use strict";let n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;try{n=self.indexedDB}catch(e){}var r=n;t.default=r},344611:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.WEB_IDB_DB_NAMES=void 0,t.deleteAllIdb=function(){return l.apply(this,arguments)};var i=r(n(348926)),a=n(975175),o=r(n(986128));const s={__dbnames:"__dbnames",fts_storage:"fts-storage",fts_loadgen_metadata:"loadgen-storage",_hsm_storage_DEPRECATED:"hsm-storage",jobs_storage:"jobs-storage",lru_media_storage_idb:"lru-media-storage-idb",model_storage:"model-storage",offd_storage:"offd-storage",pb_detect:"pb_detect",signal_storage:"signal-storage",sw:"sw",wawc:"wawc",wawc_db_enc:"wawc_db_enc",qpl_storage:"qpl-storage",worker_storage:"worker-storage"};function l(){return(l=(0,i.default)((function*(){const e=Object.keys(s).map((e=>s[e]));let t=!1;const n=e.map(function(){var e=(0,i.default)((function*(e){if("__dbnames"!==e&&"sw"!==e&&"pb_detect"!==e)try{yield(0,a.promiseTimeout)(Promise.resolve(o.default.delete(e)),7e3)}catch(e){t=!0}}));return function(){return e.apply(this,arguments)}}());return yield Promise.all(n),t}))).apply(this,arguments)}t.WEB_IDB_DB_NAMES=s},630884:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=r(n(173207));class o extends a.default{constructor(e,t,n,r){var i,a;super(),this._storeName=e,this._createResponse=t,this._parseResponse=n,this._encodeKey=null!==(i=null==r?void 0:r.encodeKey)&&void 0!==i?i:e=>e,this._matchOptions=null!==(a=null==r?void 0:r.matchOptions)&&void 0!==a?a:{}}doGet(e){var t=this;return(0,i.default)((function*(){yield t.doOpen();const n=t._encodeKey(e,t._storeName);if(!t._cacheStore)throw __LOG__(3)`Unable to get. This error can occur if abstract method doGet gets called.`,new Error("Unable to get");const r=yield t._cacheStore.match(n,t._matchOptions);return null==r?null:t._parseResponse(r)}))()}doPut(e,t){var n=this;return(0,i.default)((function*(){yield n.doOpen();const r=n._encodeKey(e,n._storeName);if(!n._cacheStore)throw __LOG__(3)`Unable to put. This error can occur if abstract method doPut gets called.`,new Error("Unable to put in cache");return yield n._cacheStore.put(r,n._createResponse(t)),t}))()}doDel(e){var t=this;return(0,i.default)((function*(){yield t.doOpen();const n=t._encodeKey(e,t._storeName);if(!t._cacheStore)return __LOG__(3)`Unable to delete. This error can occur if abstract method doDel gets called.`,Promise.reject(new Error("Unable to delete"));yield t._cacheStore.delete(n,t._matchOptions)}))()}doClear(){var e=this;return(0,i.default)((function*(){(yield caches.delete(e._storeName))||__LOG__(2)`Tried to delete a non-existent cache: ${e._storeName}`,e._cacheStore=null}))()}doOpen(){var e=this;return(0,i.default)((function*(){if(null==e._cacheStore)try{e._cacheStore=yield caches.open(e._storeName)}catch(t){throw e._cacheStore=null,__LOG__(3)`Unable to open cache: ${e._storeName}, error: ${t}`,t}}))()}doClose(){return this._cacheStore=null,Promise.resolve()}}t.default=o},174285:(e,t)=>{"use strict";let n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;try{n=window.localStorage}catch(e){}var r=n;t.default=r},598031:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.migrateMDUserPrefsToIndexedDB=function(){const e=[],t=o.default.getItemFromLocalStorage(a.MD_KEYS.ROUTING_INFO);null!=t&&e.push({key:a.BACKEND_ONLY_KEYS.ROUTING_INFO,value:t});const n=o.default.getItemFromLocalStorage(a.MD_KEYS.INITIAL_HISTORY_SYNCED);null!=n&&e.push({key:a.BACKEND_ONLY_KEYS.INITIAL_HISTORY_SYNCED,value:null!=n});const r=o.default.getItemFromLocalStorage(a.MD_KEYS.HISTORY_SYNC_STATUS);null!=r&&e.push({key:a.BACKEND_ONLY_KEYS.HISTORY_SYNC_STATUS,value:r});const s=o.default.getItemFromLocalStorage(a.MD_KEYS.BLOCKLIST_HASH);null!=s&&e.push({key:a.BACKEND_ONLY_KEYS.BLOCKLIST_HASH,value:s});const l=o.default.getItemFromLocalStorage(a.MD_KEYS.CRITICAL_DATA_SYNCED);null!=l&&e.push({key:a.BACKEND_ONLY_KEYS.CRITICAL_DATA_SYNCED,value:l});const u=o.default.getItemFromLocalStorage(a.MD_KEYS.SHOULD_CHECK_CONTACT_SYNC_STATUS);null!=u&&e.push({key:a.BACKEND_ONLY_KEYS.SHOULD_CHECK_CONTACT_SYNC_STATUS,value:u});const c=o.default.getItemFromLocalStorage(a.MD_KEYS.ADV_SECRET_KEY);null!=c&&e.push({key:a.BACKEND_ONLY_KEYS.ADV_SECRET_KEY,value:c});const d=o.default.getItemFromLocalStorage(a.MD_KEYS.MD_UPGRADE_WAM_FLAG);null!=d&&e.push({key:a.BACKEND_ONLY_KEYS.MD_UPGRADE_WAM_FLAG,value:!0===d});const p=o.default.getItemFromLocalStorage(a.MD_KEYS.MD_HISTORY_LAST_CHUNK_PROCESSED);null!=p&&e.push({key:a.BACKEND_ONLY_KEYS.MD_HISTORY_LAST_CHUNK_PROCESSED,value:p});const _=o.default.getItemFromLocalStorage(a.MD_KEYS.UNARCHIVE_CHATS_SETTING);null!=_&&e.push({key:a.BACKEND_ONLY_KEYS.UNARCHIVE_CHATS_SETTING,value:_});const f=o.default.getItemFromLocalStorage(a.MD_KEYS.ARCHIVE_V2_ENABLED_SETTING);null!=f&&e.push({key:a.BACKEND_ONLY_KEYS.ARCHIVE_V2_ENABLED_SETTING,value:f});const h=o.default.getItemFromLocalStorage(a.MD_KEYS.MD_SYNC_ACTIONS_ACTION_SANITIZED);null!=h&&e.push({key:a.BACKEND_ONLY_KEYS.MD_SYNC_ACTIONS_ACTION_SANITIZED,value:!0===h});const g=o.default.getItemFromLocalStorage(a.MD_KEYS.CHAT_THREAD_LOGGING_OFFSET);null!=g&&e.push({key:a.BACKEND_ONLY_KEYS.CHAT_THREAD_LOGGING_OFFSET,value:g});const m=o.default.getItemFromLocalStorage(a.MD_KEYS.CHAT_THREAD_LOGGING_SECRET);null!=m&&e.push({key:a.BACKEND_ONLY_KEYS.CHAT_THREAD_LOGGING_SECRET,value:m});const y=o.default.getItemFromLocalStorage(a.MD_KEYS.CHAT_THREAD_LOGGING_LAST_UPLOADED_START_TS);null!=y&&e.push({key:a.BACKEND_ONLY_KEYS.CHAT_THREAD_LOGGING_LAST_UPLOADED_START_TS,value:y});const E=o.default.getItemFromLocalStorage(a.MD_KEYS.PAIRING_TIMESTAMP);null!=E&&e.push({key:a.BACKEND_ONLY_KEYS.PAIRING_TIMESTAMP,value:E});const S=o.default.getItemFromLocalStorage(a.MD_KEYS.RECENT_MAILBOX_AGE_DAYS);null!=S&&e.push({key:a.BACKEND_ONLY_KEYS.RECENT_MAILBOX_AGE_DAYS,value:S});const T=o.default.getItemFromLocalStorage(a.MD_KEYS.LAST_PERIODIC_APP_STATE_SYNC_TS);null!=T&&e.push({key:a.BACKEND_ONLY_KEYS.LAST_PERIODIC_APP_STATE_SYNC_TS,value:T});const v=o.default.getItemFromLocalStorage(a.MD_KEYS.MD_LOGIN_COOKIE_REQUEST_COMPLETE);null!=v&&e.push({key:a.BACKEND_ONLY_KEYS.MD_LOGIN_COOKIE_REQUEST_COMPLETE,value:v});const A=o.default.getItemFromLocalStorage(a.KEYS.MOBILE_PLATFORM_DEPRECATED);null!=A&&e.push({key:a.BACKEND_ONLY_KEYS.MOBILE_PLATFORM,value:A});return i.userPrefsIndexedDBStorage.bulkSetItemsToIndexedDB(e)};var i=n(409847),a=n(94872),o=r(n(98165))},236642:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=r(n(402525)),o=r(n(174285)),s=r(n(482904));var l=new class{constructor(){this.dataStore={}}setItem(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.dataStore[e]=t,null!=o.default&&o.default.setItem(e,t),n&&s.default.idb().then((n=>n.user.put({key:e,value:t}))).catch((e=>{__LOG__(3)`db:setItem:Error ${e}`}))}getItem(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(void 0===this.dataStore[e]||t){if(null!=o.default){const t=o.default.getItem(e);return null!=t&&this.setItem(e,t,!1),t}return null}return this.dataStore[e]}removeItem(e){delete this.dataStore[e],null!=o.default&&o.default.removeItem(e),s.default.idb().then((t=>t.user.delete(e))).catch((e=>{__LOG__(3)`db:removeItem:Error ${e}`}))}clear(e){var t=this;return(0,i.default)((function*(){t.dataStore={},null!=o.default&&(o.default.clear(),e&&(0,a.default)(e,(function(e,t){o.default.setItem(t,e)}))),yield s.default.idb().then((e=>e.user.clear())).catch((e=>{__LOG__(3)`db:clear:Error ${e}`}))}))()}};t.default=l},462032:(e,t)=>{"use strict";let n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;try{n=window.sessionStorage}catch(e){}var r=n;t.default=r},737065:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(402525)),a=r(n(132375)),o=n(425315),s=r(n(462032)),l=n(94872);var u=(()=>{try{const e=(0,a.default)(s.default,"sessionStorage");return e.setItem(l.KEYS.STORAGE_TEST,l.KEYS.STORAGE_TEST),(0,o.isFunction)(e.clear)}catch(e){return!1}})()?new class{constructor(){this.dataStore={}}setItem(e,t){this.dataStore[e]=t,(0,a.default)(s.default,"sessionStorage").setItem(e,t)}getItem(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return null==this.dataStore[e]||t?(0,a.default)(s.default,"sessionStorage").getItem(e):this.dataStore[e]}removeItem(e){delete this.dataStore[e],(0,a.default)(s.default,"sessionStorage").removeItem(e)}clear(e){return this.dataStore={},(0,a.default)(s.default,"sessionStorage").clear(),e&&(0,i.default)(e,(function(e,t){(0,a.default)(s.default,"sessionStorage").setItem(t,e)})),Promise.resolve()}}:new class{constructor(){this.dataStore={}}setItem(e,t){this.dataStore[e]=t}getItem(e){return void 0===this.dataStore[e]?null:this.dataStore[e]}removeItem(e){delete this.dataStore[e]}clear(){return this.dataStore={},Promise.resolve()}};t.default=u},409847:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.userPrefsIndexedDBStorage=void 0;var i=r(n(348926)),a=n(357621),o=n(94872),s=n(599225),l=n(3973),u=n(555984);function c(){return(c=(0,i.default)((function*(e){try{yield(0,a.createOrReplaceUserPref)(e)}catch(t){__LOG__(3)`An error ocurred while trying to insert the user preference '${e.key}' in IndexedDB. Err: ${t}`}}))).apply(this,arguments)}function d(){return(d=(0,i.default)((function*(e){try{const t=yield(0,a.getUserPref)(e);if(t)return t.value}catch(t){__LOG__(3)`An error ocurred while trying to get user preference '${e}' from IndexedDB. Err: ${t}`}}))).apply(this,arguments)}function p(){return(p=(0,i.default)((function*(e){try{yield(0,a.removeUserPref)(e)}catch(t){__LOG__(3)`An error ocurred while trying to remove user preference '${e}' from IndexedDB. Err: ${t}`}}))).apply(this,arguments)}function _(){return(_=(0,i.default)((function*(){try{yield(0,a.clearUserPrefs)()}catch(e){__LOG__(3)`An error ocurred while trying to clear all user preferences from IndexedDB. Err: ${e}`}}))).apply(this,arguments)}function f(){return(f=(0,i.default)((function*(e){try{yield(0,a.bulkCreateOrReplaceUserPrefs)(e)}catch(e){__LOG__(3)`An error ocurred while trying to create multiple user preferences in IndexedDB. Err: ${e}`}}))).apply(this,arguments)}function h(e){let t=e;return Object.values(o.HASHED_MD_KEYS).some((t=>t===e))&&(t=(0,u.hashUserPrefKey)(e)),t}const g=new class{constructor(){this._cachedIndexedDBValues={}}setItemToIndexedDB(e,t){var n=this;return(0,i.default)((function*(){const r=h(e);if(null==r)return;const i=(0,l.preProcessUserPref)(e,t);n._cachedIndexedDBValues[r]=i,yield function(){return c.apply(this,arguments)}({key:r,value:i})}))()}getItemFromIndexedDB(e){var t=this;return(0,i.default)((function*(){const n=h(e);if(null==n)return;let r=t._cachedIndexedDBValues[n];if(null==r&&(r=yield function(){return d.apply(this,arguments)}(n),t._cachedIndexedDBValues[n]=r),null==r)return null;return(0,s.postProcessUserPref)(e,r)}))()}removeItemFromIndexedDB(e){var t=this;return(0,i.default)((function*(){const n=h(e);null!=n&&(delete t._cachedIndexedDBValues[n],yield function(){return p.apply(this,arguments)}(n))}))()}clearIndexedDB(){var e=this;return(0,i.default)((function*(){e._cachedIndexedDBValues={},yield function(){return _.apply(this,arguments)}()}))()}bulkSetItemsToIndexedDB(e){var t=this;return(0,i.default)((function*(){const n=e.map((e=>({key:e.key,value:(0,l.preProcessUserPref)(e.key,e.value)})));yield function(){return f.apply(this,arguments)}(n),n.forEach((e=>{t._cachedIndexedDBValues[e.key]=e.value}))}))()}};t.userPrefsIndexedDBStorage=g},98165:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(174285)),a=n(94872),o=n(599225),s=n(3973),l=n(555984);function u(e){let t=e;return Object.values(a.HASHED_KEYS).some((t=>t===e))&&(t=(0,l.hashUserPrefKey)(e)),t}var c=new class{constructor(){this._cachedLocalStorageValues={}}setItemToLocalStorage(e,t){if(null==i.default)return;const n=u(e);if(null==n)return;const r=JSON.stringify((0,s.preProcessUserPref)(e,t));null!=r&&(this._cachedLocalStorageValues[n]=r,i.default.setItem(n,r))}getItemFromLocalStorage(e){const t=u(e);if(null==t)return;let n,r=this._cachedLocalStorageValues[t];if(null==r&&null!=i.default&&(r=i.default.getItem(t)),null==r)return null;this._cachedLocalStorageValues[t]=r;try{n=JSON.parse(r)}catch(t){return this.removeItemFromLocalStorage(e),null}return(0,o.postProcessUserPref)(e,n)}removeItemFromLocalStorage(e){const t=u(e);null!=t&&(delete this._cachedLocalStorageValues[t],null!=i.default&&i.default.removeItem(t))}clearLocalStorage(){this._cachedLocalStorageValues={},null!=i.default&&i.default.clear()}};t.default=c},599225:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.postProcessUserPref=function(e,t){let n=t;const r=o[e];null!=r&&(n=r(t));return n};var i=r(n(66604)),a=n(417405);const o={WANoiseInfo:function(e){const t=(0,i.default)(e,a.decodeB64);return{recoveryToken:t.recoveryToken,staticKeyPair:{pubKey:t.pubKey,privKey:t.privKey}}},WARoutingInfo:function(e){const{domain:t,edgeRouting:n}=e;return{domain:t,edgeRouting:null!=n?(0,a.decodeB64)(n):null}}}},3973:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.preProcessUserPref=function(e,t){let n=t;const r=o[e];null!=r&&(n=r(t));return n};var i=r(n(66604)),a=n(417405);const o={WANoiseInfo:function(e){const t={privKey:e.staticKeyPair.privKey,pubKey:e.staticKeyPair.pubKey,recoveryToken:e.recoveryToken};return(0,i.default)(t,a.encodeB64)},WARoutingInfo:function(e){const{domain:t,edgeRouting:n}=e;return{domain:t,edgeRouting:n?(0,a.encodeB64)(n):null}}}},555984:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.hashUserPrefKey=function(e){const t=(0,a.getMaybeMeUser)();if(!t)return void __LOG__(3)`hashUserPrefKey: Me has not loaded yet.`;return(0,i.default)(t.toString()+":"+e)};var i=r(n(706223)),a=n(459857)},460888:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.initWAWC=function(){return i.default.openDB()};var i=r(n(482904))},15605:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.genChatAssignmentNotificationTemplateMsg=function(e,t,n){const r=(0,a.getMeUser)(),o=i.default.newId();return{id:new i.default({fromMe:(0,a.isMeAccount)(e),remote:e,id:o}),t:n,type:"notification_template",subtype:null==t?"chat_assignment_unassign":"chat_assignment",from:e,to:r,templateParams:null==t?[]:[t.name]}};n(98671);var i=r(n(565754)),a=n(459857)},389293:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.genCagMaskedThreadCreatedSystemMsg=function(e){return l(e,"notification_template","cag_masked_thread_created",[])},t.genDeviceNotificationMsg=function(e,t,n,r){const l=(0,o.assertGetMe)(),u=new a.default({fromMe:t.equals((0,s.toUserWid)(l)),remote:e,id:a.default.newId()}),c=u.fromMe&&n.includes(l.getDeviceId());return{id:u,t:(0,i.unixTime)(),type:"e2e_notification",subtype:"device",from:e,to:(0,s.toUserWid)(l),body:t.toString(),devicesAdded:n.length,devicesRemoved:r.length,isThisDeviceAdded:c}},t.genDisappearingModeSystemMsg=function(e,t,n){const r=n?(0,o.getMeUser)():e,i=[String(t),r];return l(e,"notification_template","disappearing_mode",i)},t.genEncryptNotificationMsg=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"encrypt";return l(e,"e2e_notification",t,[])},t.genMaskedThreadCreatedSystemMsg=function(e){return l(e,"notification_template","masked_thread_created",[])},t.genSecurityCodeNotificationMsg=function(e,t){const n=(0,o.getMeUser)();return{id:new a.default({fromMe:t.equals(n),remote:e,id:a.default.newId()}),t:(0,i.unixTime)(),type:"e2e_notification",subtype:"identity",from:e,to:n,body:t.toString()}},t.genTealNotificationTemplateMsg=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return l(e,"notification_template",t,n)};var i=n(990445),a=r(n(565754)),o=n(459857),s=n(669050);function l(e,t,n,r){const s=(0,o.getMaybeMeLid)(),l=(0,o.getMeUser)();return{id:new a.default({fromMe:(0,o.isMeAccount)(e),remote:e,id:a.default.newId()}),t:(0,i.unixTime)(),type:t,subtype:n,from:e,to:e.isLid()&&null!=s?s:l,templateParams:r}}},143249:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!e.isGroupMsg&&0===t.msgs.length)return(0,i.default)(t.id,t.contact.privacyMode);return null};var i=r(n(140854))},614198:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.genGroupCreationMsg=function(e,t){var n,r,i;const{chatId:a}=e;let o=null!==(n=null!==(r=t.owner)&&void 0!==r?r:e.author)&&void 0!==n?n:(0,d.getMaybeMeUser)();const s=t.subject;let c,p;if((0,l.communitiesEnabled)()&&!0===t.defaultSubgroup){var _;c="community_create",t.parentGroup&&(p=[t.parentGroup,t.subject]),o=null!==(_=t.owner)&&void 0!==_?_:e.author}else{var f;o=null!==(f=t.owner)&&void 0!==f?f:e.author,c="create"}return{id:new u.default({remote:a,fromMe:!1,participant:o,id:h(e)}),author:o,body:s,from:a,recipients:[],self:"in",subtype:c,t:null!==(i=t.creation)&&void 0!==i?i:e.ts,type:"gp2",templateParams:p}},t.genGroupEphemeralSettingMsg=function(e,t,n,r){return{id:new u.default({remote:e,fromMe:!1,participant:n,id:u.default.newId()}),author:n,from:e,recipients:[],self:"in",subtype:"ephemeral",t,type:"gp2",templateParams:[`${r}`]}},t.genGroupNotificationMsg=f,t.genGroupPicChangeNotificationMsg=function(e,t,n,r){return{type:"gp2",self:"in",subtype:"picture",t:n,author:r,body:t,recipients:[],from:e,id:new u.default({remote:e,fromMe:!1,id:u.default.newId()})}},t.genInitialPhashMismatchMsg=function(e,t){return{id:new u.default({remote:e,fromMe:!1,id:u.default.newId()}),from:e,recipients:[],self:"in",subtype:"initial_pHash_mismatch",t,type:"gp2"}},t.genIntegrityDeleteParentNotifcationMsgs=function(e){var t,r;const a=[],{chatId:l}=e,u=(0,o.getCagIdFromCommunity)(l),c=n(965012).ChatCollection,d=c.assertGet(l);return u.forEach((e=>{var t;const n=c.get(e);(null==n||null===(t=n.groupMetadata)||void 0===t?void 0:t.participants.iAmMember())&&a.push(f({chatId:e,author:void 0,ts:(0,i.unixTime)()},{actionType:s.GROUP_ACTIONS.DELETE,reason:s.DELETE_REASON.INTEGRITY_DELETE_PARENT,groupDatas:[{id:l,subject:d.formattedTitle}]}))})),(null!==(t=null==d||null===(r=d.groupMetadata)||void 0===r?void 0:r.joinedSubgroups)&&void 0!==t?t:[]).filter((e=>!u.includes(e))).forEach((e=>{a.push(f({chatId:e,author:void 0,ts:(0,i.unixTime)()},{actionType:s.GROUP_ACTIONS.INTEGRITY_PARENT_GROUP_UNLINK,groupDatas:[{id:l,subject:null==d?void 0:d.formattedTitle}]}))})),a},t.generateDeleteParentNotificationMessages=function(e){var t,r;const a=[],{chatId:l}=e,u=(0,o.getCagIdFromCommunity)(l),c=n(965012).ChatCollection,d=c.get(l);if(null==d||!1===d.isParentGroup)return a;const p=d.formattedTitle,_=(0,i.unixTime)();return u.forEach((t=>{var n;const r=c.get(t);(null==r||null===(n=r.groupMetadata)||void 0===n?void 0:n.participants.iAmMember())&&a.push(f({chatId:t,author:e.author,ts:_},{actionType:s.GROUP_ACTIONS.DELETE_PARENT_GROUP,communityTitle:p}))})),(null!==(t=null===(r=d.groupMetadata)||void 0===r?void 0:r.joinedSubgroups)&&void 0!==t?t:[]).filter((e=>!u.includes(e))).forEach((t=>{a.push(f({chatId:t,author:e.author,ts:_},{actionType:s.GROUP_ACTIONS.DELETE_PARENT_GROUP,communityTitle:p})),a.push(f({chatId:t,author:e.author,ts:_},{actionType:s.GROUP_ACTIONS.PARENT_GROUP_UNLINK,groupDatas:[{id:l,subject:p}]}))})),a};var i=n(990445),a=n(287461),o=n(909450),s=n(862159),l=n(97858),u=r(n(565754)),c=n(628199),d=n(459857),p=n(669050);function _(e,t){const r=e.parentGroupId;if(!r)return!1;const i=n(318797).default.get(r.toString());return!(i&&!(i&&i.joinedSubgroups.length<=t))}function f(e,t,n){const{chatId:r,isAdmin:i=!1}=e;let o,d=e.author&&(0,p.toUserWid)(e.author)||void 0,f=null,g=[],m=d,y=t.actionType,E=null;switch(t.actionType){case s.GROUP_ACTIONS.SUBJECT:f=t.subject;break;case s.GROUP_ACTIONS.MODIFY:g=t.participants.map((e=>{let{id:t}=e;return t}));break;case s.GROUP_ACTIONS.ADD:t.reason===s.ADD_REASON.INVITE?y="invite":(0,l.communitiesEnabled)()&&(t.reason===s.ADD_REASON.LINKED_GROUP_JOIN?y="linked_group_join":t.reason===s.ADD_REASON.AUTO_ADD?(y="auto_add",_(t,2)&&(E=[t.parentGroupId,""])):t.reason===s.ADD_REASON.DEFAULT_SUBGROUP_ADMIN_ADD?(y="default_sub_group_admin_add",_(t,1)&&(E=[t.parentGroupId,""])):t.reason===s.ADD_REASON.DEFAULT_SUBGROUP_PROMOTE?y="default_sub_group_promote":t.reason===s.ADD_REASON.INVITE_AUTO_ADD&&(y="invite_auto_add",t.contextGroupId&&(E=[t.contextGroupId,""],_(t,2)?E.push("false"):E.push("true"))));case s.GROUP_ACTIONS.PROMOTE:case s.GROUP_ACTIONS.DEMOTE:case s.GROUP_ACTIONS.REMOVE:case s.GROUP_ACTIONS.LINKED_GROUP_PROMOTE:case s.GROUP_ACTIONS.LINKED_GROUP_DEMOTE:if(t.actionType===s.GROUP_ACTIONS.REMOVE&&t.reason===s.REMOVE_REASON.DEFAULT_SUBGROUP_DEMOTE){y="default_sub_group_demote";break}g=t.participants.map((e=>{let{id:t}=e;return t})),1===g.length&&(m=g[0]),t.actionType===s.GROUP_ACTIONS.REMOVE&&1===g.length&&d===m&&(y="leave");break;case s.GROUP_ACTIONS.DELETE:y="leave",t.reason===s.DELETE_REASON.INTEGRITY_DELETE_PARENT?f=s.DELETE_REASON.INTEGRITY_DELETE_PARENT:t.reason===s.DELETE_REASON.DELETE_PARENT&&(f=s.DELETE_REASON.DELETE_PARENT);break;case s.GROUP_ACTIONS.INVITE_CODE:y="revoke_invite";break;case s.GROUP_ACTIONS.DESC_ADD:y="description",f=t.desc;break;case s.GROUP_ACTIONS.DESC_REMOVE:y="description";break;case s.GROUP_ACTIONS.RESTRICT:case s.GROUP_ACTIONS.ANNOUNCE:case s.GROUP_ACTIONS.NO_FORWARD:E=t.value?["on"]:["off"],f=E[0];break;case s.GROUP_ACTIONS.EPHEMERAL:d&&(E=[`${t.duration}`,d]);break;case s.GROUP_ACTIONS.GROWTH_LOCKED:E=[t.type],f=E[0];break;case s.GROUP_ACTIONS.SUB_GROUP_LINK:case s.GROUP_ACTIONS.SIBLING_GROUP_LINK:case s.GROUP_ACTIONS.SUB_GROUP_UNLINK:case s.GROUP_ACTIONS.PARENT_GROUP_UNLINK:case s.GROUP_ACTIONS.SIBLING_GROUP_UNLINK:case s.GROUP_ACTIONS.DELETE_PARENT_GROUP_UNLINK:case s.GROUP_ACTIONS.INTEGRITY_PARENT_GROUP_UNLINK:E=(0,c.flattenPairList)(t.groupDatas.map((e=>[e.id,e.subject])));break;case s.GROUP_ACTIONS.PARENT_GROUP_LINK:E=(0,c.flattenPairList)(t.groupDatas.map((e=>[e.id,e.subject]))),o="parentGroupLink";break;case s.GROUP_ACTIONS.PARENT_GROUP_LINK_MEMBERSHIP_APPROVAL:const e=t.groupDatas[0];let n="regular";(0,a.getABPropConfigValue)("group_join_request_m1")&&(n=i?"admin":"regular");const r=t.membershipApprovalMode;E=[e.id,e.subject,n,r.toString()],o="parentGroupLinkMembershipApproval";break;case s.GROUP_ACTIONS.DELETE_PARENT_GROUP:E=[t.communityTitle];break;case s.GROUP_ACTIONS.MEMBERSHIP_APPROVAL_MODE:E=[t.value?"on":"off",i?"admin":"regular"],"server"===t.triggered&&(d=void 0)}const S={id:new u.default({remote:r,fromMe:!1,participant:m,id:h(e,o)}),author:d,from:r,recipients:g.map(p.toUserWid)||[],self:"in",subtype:y,t:null!=n?n:e.ts,type:"gp2"};return f&&(S.body=f),E&&(S.templateParams=E),S}function h(e,t){var n,r;let i=null!==(n=e.externalId)&&void 0!==n?n:u.default.newId();return null!=t&&(i=`${i}${t}`),`${i}${null!==(r=e.ts)&&void 0!==r?r:""}`}},140854:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(o.default.isPSA(e))return(0,i.genEncryptNotificationMsg)(e,"chat_psa");switch((0,a.getReducedPrivacyMode)(t)){case a.ReducedPrivacyMode.E2EE:return(0,i.genEncryptNotificationMsg)(e);case a.ReducedPrivacyMode.BSP:return(0,i.genTealNotificationTemplateMsg)(e,"biz_privacy_mode_init_bsp");case a.ReducedPrivacyMode.FB:return(0,i.genTealNotificationTemplateMsg)(e,"biz_privacy_mode_init_fb")}};var i=n(389293),a=n(35109),o=r(n(124928))},326953:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.genPaymentInviteAccoutSetupMsg=function(e,t){return{id:new i.default({remote:e,fromMe:!1,id:i.default.newId()}),from:e,recipients:[],self:"in",subtype:"payment_invite_account_set_up",t,type:a.MSG_TYPE.NOTIFICATION_TEMPLATE,templateParams:[e]}};var i=r(n(565754)),a=n(373070)},35109:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ReducedPrivacyMode=void 0,t.comparePrivacyMode=function(e,t){return null==e&&null==t?0:null==t?1:null==e?-1:e.privacyModeTs-t.privacyModeTs},t.getContactPrivacyMode=function(e){if(!a.default.isUser(e))return;const t=n(121977).ContactCollection.get(e);return null==t?void 0:t.privacyMode},t.getLatestPrivacyMode=function(e,t){return null==e?t:null==t||e.privacyModeTs>t.privacyModeTs?e:t},t.getPrivacyModeFromQueryExistResponse=function(e){var t;const n=null===(t=e.bizInfo)||void 0===t?void 0:t.verifiedName;return null==n?null:e.biz&&!0===n.isApi?n.privacyMode:null},t.getReducedPrivacyMode=function(e){if(null==e||e.actualActors===i.ActualActorsEnumType.Self&&e.hostStorage===i.HostStorageEnumType.OnPremise)return o.E2EE;if(e.hostStorage===i.HostStorageEnumType.Facebook)return o.FB;return o.BSP};var i=n(257845),a=r(n(124928));const o=n(76672).Mirrored(["E2EE","BSP","FB"]);t.ReducedPrivacyMode=o},164325:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(873955)),a=n(990445),o=n(14361),s=n(63014),l=n(150204);var u=new class{constructor(){this._alarms=new Map;const e=()=>{this._alarms.size>0&&this._validateTimeouts()};l.jsHaltDetector.on(o.JS_HALT_EVENT,e),l.jsHaltDetector.on(o.CLOCK_CHANGE_BACKWARDS_EVENT,e),s.Clock.on(s.SKEW_CHANGE_EVENT,this._resetGlobalTimeouts.bind(this))}setLocalTimeout(e,t,n){return this._setTimeout(!1,e,t,n)}setGlobalTimeout(e,t,n){return this._setTimeout(!0,e,t,n)}clearTimeout(e){if(!e)return;const t=this._alarms.get(e);t&&(window.clearTimeout(t.timeoutId),this._alarms.delete(e))}_setTimeout(e,t,n,r){r&&this.clearTimeout(r);const a=r||(0,i.default)("alarm_timer_"),o=n-this._getTimeInMS(e),s=Math.min(o,2147483647);if(o<0)return __LOG__(2)`Alarm:setTimeout:Cannot set alarm in the past.`,t(),a;const u=window.setTimeout((()=>{n-this._getTimeInMS(e)<l.DEFAULT_THRESHOLD?(this._alarms.delete(a),t()):this._setTimeout(e,t,n,a)}),s);return this._alarms.set(a,{isGlobal:e,fn:t,expiration:n,timeoutId:u}),a}_validateTimeouts(){new Map(this._alarms).forEach(((e,t)=>{const{isGlobal:n,fn:r,expiration:i}=e;i<this._getTimeInMS(n)?(this.clearTimeout(t),r()):this._setTimeout(n,r,i,t)}))}_resetGlobalTimeouts(){new Map(this._alarms).forEach(((e,t)=>{const{isGlobal:n,fn:r,expiration:i}=e;n&&this._setTimeout(n,r,i,t)}))}_getTimeInMS(){return 1e3*(arguments.length>0&&void 0!==arguments[0]&&arguments[0]?(0,a.unixTime)():(0,a.unixTimeWithoutClockSkewCorrection)())}};t.default=u},437362:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dataURLtoBlob=function(e){const t=e.match(n);if(!t)throw new Error("invalid data URI");const r=t[2]?t[1]:"text/plain"+(t[3]||";charset=US-ASCII"),i=!!t[4],a=e.slice(t[0].length);let o;o=i?atob(a):decodeURIComponent(a);const s=new ArrayBuffer(o.length),l=new Uint8Array(s);for(let e=0;e<o.length;e+=1)l[e]=o.charCodeAt(e);return new Blob([l],{type:r})};const n=/^data:((.*?)(;charset=.*?)?)(;base64)?,/},446303:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.findLink=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;const r=(0,a.findLink)(e,t);if(null==r)return;return u(r,n)},t.findLinks=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;const r=(0,a.findLinks)(e,t);return r.map((e=>u(e,n)))},Object.defineProperty(t,"validateEmail",{enumerable:!0,get:function(){return a.validateEmail}});var i=r(n(81109)),a=n(677378),o=n(974637),s=n(714443),l=n(459857);function u(e,t){var n;const r=(0,l.getMaybeMeUser)();let a=null;if(t&&r){const n=t.isLid()?(0,s.toLidUserJid)(t.user):(0,s.toPhoneUserJid)(t.user);a=(0,o.findSuspiciousCharacters)(e.domain,n,(0,s.toPhoneUserJid)(r.user),[])}return(0,i.default)((0,i.default)({},e),{},{suspiciousCharacters:null!==(n=a)&&void 0!==n?n:void 0})}},79291:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(288306)),a=r(n(402525)),o=n(417405),s=n(551168),l=n(128326),u=n(425315),c=n(437362),d=n(698210),p=r(n(665810)),_=r(n(608575));let f;const h=/^(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/,g="https://l.wl.co/l";var m={URL_REGEX:h,build(e,t){const n=new p.default;return(0,a.default)(t||{},((e,t)=>{n.set(t,e)})),`${e}?${n.toString()}`},canMuckHistory(){var e;return!(!(null===(e=window.history)||void 0===e?void 0:e.pushState)||!self.location)},relToAbs:e=>(f||(f=document.createElement("a")),f.href=e,f.href),hostname:(0,i.default)((function(e){return f||(f=document.createElement("a")),f.href=this.isHttp(e)?e:"http://"+e,f.hostname})),withoutWww:function(e){return e.split("www.").join("")},isHttp:e=>e&&("https://"===e.toLowerCase().substring(0,8)||"http://"===e.toLowerCase().substring(0,7)),isHttps:e=>e&&"https://"===e.toLowerCase().substring(0,8),hasValidUrlScheme(e){const t=e.trim();return["irc://","ftp://","mailto:","http://","https://","whatsapp://","ms-windows-store://"].some((e=>0===t.toLowerCase().indexOf(e)))},isBlob:e=>(0,u.isString)(e)&&"blob:"===e.substring(0,5),isData:e=>(0,u.isString)(e)&&"data:"===e.substring(0,5),isEncryptedMedia:e=>e&&(0,u.isString)(e)&&e.endsWith(".enc"),parseDataURL(e){const t=e.indexOf(":"),n=e.indexOf(";"),r=e.indexOf(",");return{mimetype:e.substring(t+1,n),data:e.substring(r+1)}},dataURLtoFile(e){const t=this.parseDataURL(e).mimetype;return(0,d.createFile)([(0,c.dataURLtoBlob)(e)],"",{type:t})},GSM_NAME:"gme-whatsappinc",GSM_NUMS:"LM4NgcjF-X_EedaZ6MwPVSH0Sac=",gsmURL(e,t){const n=t.replace(/\-/g,"+").replace(/_/g,"/"),r=(0,o.decodeB64)(n),i=_.default.parse(e).path,a=s.Binary.build(i).readByteArray();return(0,l.hmacSha1)(r,a).then((t=>`${e}&signature=${(0,o.encodeB64UrlSafe)(t)}`))},thumbToCSSURL(e){return`url("${this.isHttp(e)||e.startsWith("data:")?e:`data:image/jpeg;base64,${e}`}")`},thumbAsBackgroundImage(e){return e?{backgroundImage:this.thumbToCSSURL(e)}:{}},isValid:e=>h.test(e),toMaliciousSiteRedirect:e=>""===e||0===e.indexOf(g)?e:`${g}?u=${encodeURIComponent(e)}`};t.default=m},389719:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addWebpMetadata=function(e,t){const n=new Uint8Array(e);if(!(0,i.isExtendedFile)(n))throw new Error("Not extended");const s=function(e){const t=new TextEncoder,n=JSON.stringify(e),a=t.encode(n),s=function(e){return(0,r.concatTypedArrays)(Uint8Array,[(0,i.stringToUint8)("II"),new Uint8Array([42,0]),(0,i.numberToLittleEndian)(8),new Uint8Array([1,0]),(0,i.stringToUint8)("AW"),new Uint8Array([7,0]),(0,i.numberToLittleEndian)(e.byteLength),(0,i.numberToLittleEndian)(22),e])}(a),l=[o(i.Chunk.EXIF,s.byteLength),s];a.byteLength%2!=0&&l.push(new Uint8Array([0]));return(0,r.concatTypedArrays)(Uint8Array,l)}((0,a.toRawWebpMetadata)(t)),l=(0,r.concatTypedArrays)(Uint8Array,[n,s]);l.set((0,i.numberToLittleEndian)(l.byteLength-8),4);return l.buffer};var r=n(786702),i=n(176819),a=n(612193);function o(e,t){return(0,r.concatTypedArrays)(Uint8Array,[(0,i.stringToUint8)(e),(0,i.numberToLittleEndian)(t)])}},945583:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return new Promise(((t,n)=>{const r=new a.default;r.onerror=function(e){r.terminate(),n(new i.DecodeWebpResultsError("worker error",e))},r.onmessageerror=function(e){r.terminate(),n(new i.DecodeWebpResultsError("worker message error",e))},r.onmessage=e=>{r.terminate();const n=e.data;t(n)},r.postMessage({webpBuffer:e},[e])}))};var i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=i?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),a=r(n(565708));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}},191687:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,r){const{quality:o=90,ensureExtendedFormat:s=!1}=null!=r?r:{};return new Promise(((r,l)=>{const u=new a.default;u.onerror=function(e){u.terminate(),l(new i.EncodeWebpError("worker error",e))},u.onmessageerror=function(e){u.terminate(),l(new i.EncodeWebpError("worker message error",e))},u.onmessage=e=>{u.terminate(),r(e.data.blob)},u.postMessage({rgbaData:e,width:t,height:n,quality:o,ensureExtendedFormat:s})}))};var i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var s=i?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),a=r(n(913959));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}},428118:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getWebpMetadata=function(e){const t=function(e){const t=new Uint8Array(e),n=(0,r.findWebpMetadata)(t);if(!n)return{};const{position:i,size:a}=n,o=new TextDecoder,s=t.slice(i,i+a),l=o.decode(s);try{return JSON.parse(l)}catch(e){return __LOG__(2)`Failed to parse emojis out of sticker, returning empty object.`,{}}}(e);return(0,i.toWebpMetadata)(t)};var r=n(176819),i=n(612193)},176819:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.WEBP_HEADER_SIZE=t.FOUR=t.Chunk=t.CHUNK_HEADER_SIZE=void 0,t.findWebpChunk=l,t.findWebpMetadata=function(e){if(!u(e))return __LOG__(2)`Sticker file not extended format.`,null;const t=l(e,o.EXIF);if(!t)return null;const n=e.slice(t.position,t.position+t.size);let r,i;for(let e=n.byteLength;e>0;--e)if(null==i&&n[e]===s)i=e;else if(null!=i&&0===n[e]){r=e+1;break}if(null==r||null==i)return __LOG__(3)`JSON not found in sticker file`,null;return{position:t.position+r,size:i-r+1}},t.isAnimatedWebp=function(e){const t=new Uint8Array(e);return u(t)&&0!=(2&t[20])},t.isExtendedFile=u,t.littleEndianToNumber=c,t.numberToLittleEndian=function(e){const t=new i.Binary;return t.writeUint32(e,!0),t.readByteArray()},t.stringToUint8=d;var i=n(551168),a=r(n(235670));const o=n(76672)({VP8X:"VP8X",ANMF:"ANMF",EXIF:"EXIF",XMP:"XMP "});t.Chunk=o;t.WEBP_HEADER_SIZE=12;t.CHUNK_HEADER_SIZE=8;t.FOUR=4;const s="}".charCodeAt(0);function l(e,t){const n=d(t);let r=0;for(r+=12;r<e.byteLength;){const t=e.slice(r,r+8),i=t.slice(0,4);let o=c(t.slice(4,8));if(o%2!=0&&(o+=1),(0,a.default)(i,n))return{position:r,size:o+4+4};r+=8+o}return null}function u(e){const t=e.slice(12,16);return(0,a.default)(t,d(o.VP8X))}function c(e){return e.reduce(((e,t,n)=>e+(t<<8*n)),0)}function d(e){const t=new i.Binary;return t.writeString(e),t.readByteArray()}},608938:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;const n=new Uint8Array(e),a=null!==(t=(0,i.findWebpChunk)(n,i.Chunk.EXIF))&&void 0!==t?t:(0,i.findWebpChunk)(n,i.Chunk.XMP);if(null==a)return(0,r.sha256Base64)(e);const o=n.slice(0,a.position),s=o.byteLength-i.CHUNK_HEADER_SIZE;return o.set((0,i.numberToLittleEndian)(s),i.FOUR),(0,r.sha256Base64)(o)};var r=n(638778),i=n(176819)},612193:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.FIELDS=t.DEFAULT_METADATA=void 0,t.toRawWebpMetadata=function(e){const t={};null!=e.isFirstParty&&(t[a.isFirstParty]=e.isFirstParty?1:0);null!=e.isFromStickerMaker&&(t[a.isFromStickerMaker]=e.isFromStickerMaker?1:0);null!=e.emojis&&(t[a.emojis]=e.emojis);null!=e.stickerPackId&&(t[a.stickerPackId]=e.stickerPackId);null!=e.stickerPackName&&(t[a.stickerPackName]=e.stickerPackName);null!=e.stickerPackPublisher&&(t[a.stickerPackPublisher]=e.stickerPackPublisher);null!=e.stickerPackPlayStoreLink&&(t[a.stickerPackPlayStoreLink]=e.stickerPackPlayStoreLink);null!=e.stickerPackAppleStoreLink&&(t[a.stickerPackAppleStoreLink]=e.stickerPackAppleStoreLink);null!=e.isAvatar&&(t[a.isAvatar]=e.isAvatar?1:0);return t},t.toWebpMetadata=function(e){const t=e[a.isFirstParty],n=e[a.isFromStickerMaker],r=e[a.emojis],s=e[a.stickerPackId],l=e[a.stickerPackName],u=e[a.stickerPackPublisher],c=e[a.stickerPackPlayStoreLink],d=e[a.stickerPackAppleStoreLink],p=e[a.isAvatar],_=(0,i.default)({},o);null!=t&&(_.isFirstParty=1===t);null!=n&&(_.isFromStickerMaker=1===n);null!=r&&Array.isArray(r)&&(_.emojis=r);null!=s&&(_.stickerPackId=s);null!=l&&(_.stickerPackName=l);null!=u&&(_.stickerPackPublisher=u);null!=c&&(_.stickerPackPlayStoreLink=c);null!=d&&(_.stickerPackAppleStoreLink=d);null!=p&&(_.isAvatar=1===p);return _};var i=r(n(81109));const a={isFirstParty:"is-first-party-sticker",isFromStickerMaker:"is-from-sticker-maker",emojis:"emojis",stickerPackId:"sticker-pack-id",stickerPackName:"sticker-pack-name",stickerPackPublisher:"sticker-pack-publisher",stickerPackPlayStoreLink:"android-app-store-link",stickerPackAppleStoreLink:"ios-app-store-link",isAvatar:"is-avatar-sticker"};t.FIELDS=a;const o={isFirstParty:!1,isFromStickerMaker:!1,emojis:[],stickerPackId:null,stickerPackName:null,stickerPackPublisher:null,stickerPackPlayStoreLink:null,stickerPackAppleStoreLink:null,isAvatar:!1};t.DEFAULT_METADATA=o},724743:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_LOOPS=t.MAX_DURATION=void 0,t.getTotalAnimationDuration=l,t.parseWebp=function(e){const t=new Uint8Array(e);if(!(0,s.isExtendedFile)(t))return __LOG__(2)`Sticker file not extended format.`,u;const{emojis:n,isFirstParty:r,isFromStickerMaker:c,stickerPackId:d,stickerPackName:p,stickerPackPublisher:_,isAvatar:f}=(0,o.getWebpMetadata)(e),h=(0,i.default)((0,i.default)({},u),{},{emojis:n,isFirstParty:r,isFromStickerMaker:c,stickerPackId:d,stickerPackName:p,stickerPackPublisher:_,isAvatar:f});if(!(0,s.isAnimatedWebp)(t))return h;let g,m=0,y=44;for(;(0,a.default)(t.slice(y,y+4),(0,s.stringToUint8)(s.Chunk.ANMF));){const e=y+20,n=t.slice(e,e+3);if(3!==n.length)return h;m+=(0,s.littleEndianToNumber)(n);const r=y+4,i=t.slice(r,r+4);if(4!==i.length)return h;y+=8+(0,s.littleEndianToNumber)(i),null==g&&(g=y)}const E=l(m);return(0,i.default)((0,i.default)({},h),{},{animationDuration:E,firstFrameLength:g,singleLoopDuration:m})};var i=r(n(81109)),a=r(n(235670)),o=n(428118),s=n(176819);t.MAX_LOOPS=3;function l(e){if(0===e)return 0;const t=Math.min(Math.floor(5e3/e),3);return Math.max(t,1)*e}t.MAX_DURATION=5e3;const u={animationDuration:0,singleLoopDuration:0,emojis:[],isFirstParty:!1,isFromStickerMaker:!1,stickerPackId:null,stickerPackName:null,stickerPackPublisher:null,isAvatar:!1}},473190:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return Promise.resolve(!1)}},961745:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Voip=void 0,t.checkVoipCapability=function(){return Promise.resolve(!1)};var i=r(n(348926)),a=n(417405),o=n(684659),s=n(128326),l=n(990445),u=n(65889),c=n(754630),d=r(n(65162)),p=n(459857),_=r(n(178480)),f=n(571256),h=r(n(522545)),g=n(276846),m=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=T(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(549227)),y=n(416371),E=n(690565),S=r(n(367231));function T(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(T=function(e){return e?n:t})(e)}let v=null,A=new S.default;const C={init:()=>(__LOG__(2)`voip:init`,Promise.resolve(!1)),updateAudioVideoSwitch:()=>{},cleanup:()=>{},refresh:()=>{},callStart:(e,t)=>{if(!(0,f.isVoiceCallEnabled)()&&!(0,f.isVideoCallEnabled)())throw new Error("voip:callStart: calling not enabled");if(A.getState()!==y.WEB_CALL_STATES.NONE)throw new Error("Call cannot be started because there is already a call in progress");__LOG__(2)`voip:callStart: ${e.toString()} video: ${t.toString()}`,function(){I.apply(this,arguments)}(e,t)},groupCallStart:()=>{},sendGroupCallInvite:()=>{},endCall:(P=(0,i.default)((function*(){const e=A;A.getState()===y.WEB_CALL_STATES.ACTIVE&&(yield function(){return Y.apply(this,arguments)}(A.callId,A.peerJid),(yield(0,u.requireCallCollection)()).remove(e.callId)),e.pc.close(),e.localStream.getTracks().forEach((e=>e.stop())),e.remoteAudioStream&&e.remoteAudioStream.getTracks().forEach((e=>e.stop())),e.remoteVideoStream&&e.remoteVideoStream.getTracks().forEach((e=>e.stop())),A=new S.default})),function(){return P.apply(this,arguments)}),callEndByHandledRemotely:()=>{},acceptCall:()=>{},rejectCall:()=>{},rejectCallWithoutCallCtx:()=>{},resendEncRekeyRetry:()=>{},processMissedIncomingCallMaxRetry:()=>{},mute:()=>{},videoTurnCameraOn:()=>{},videoTurnCameraOff:()=>{},videoStreamPause:()=>{},videoStreamResume:()=>{},videoRequestUpgrade:()=>{},videoAcceptUpgrade:()=>{},videoRejectUpgrade:()=>{},videoCancelUpgrade:()=>{},handleIncomingSignalingMessage:(e,t)=>(0,i.default)((function*(){const n=m.TYPE_NAME[e.type];__LOG__(2)`voip:handleIncomingSignalingMsg: type: "${n}" msg: `;const[r,i]=yield Promise.all([(0,u.requireCallCollection)(),(0,u.requireVoipCommonDisabled)()]),a=r.get(e.call_id);if(null==a?void 0:a.canHandleLocally)switch(e.type){case m.TYPE.OFFER:const n=e.peer_jid,i=e.t;if(n){const{isVideo:e,callId:r,randomBytes:a,key:o,token:s,relay:l}=function(e){const t=e[1]["call-id"];let n=null,r=null,i=null,a=null,o=!1;for(const t of e[2])__LOG__(2)`voip:offer: offerChild: `,"enc"===t[0]?a=new Uint8Array(t[2]):"video"===t[0]?o=!0:"relay"===t[0]&&([n,r,i]=V(t));if(null==n||null==r||null==i)throw new Error("Error parsing relay attributes in Offer");if(null==a)throw new Error("No random byte source found in Offer");return{callId:t,token:n,key:r,relay:i,randomBytes:a,isVideo:o}}(t.payload);yield function(e,t,n){const r=E.AUDIO_CODECS.DEFAULT,i=n?E.VIDEO_CODECS.DEFAULT:E.VIDEO_CODECS.NONE,a=r.concat(i),o=["preaccept",{"call-id":e,"call-creator":t},a.concat([E.CAPABILITIES.DEFAULT,E.ENCOPT.DEFAULT])];return(0,c.sendCallSignalingMsg)({common:{type:"preaccept",call_id:e,peer_jid:t},payload:o})}(r,n.toString({legacy:!0}),e),function(){M.apply(this,arguments)}(e,r,n,a,o,s,l,i)}break;case m.TYPE.OFFER_RECEIPT:case m.TYPE.ACCEPT_RECEIPT:case m.TYPE.MUTE:case m.TYPE.VIDEO_STATE:break;case m.TYPE.ACCEPT:A.getState()===y.WEB_CALL_STATES.OUTGOING_CALLING&&A.setState(y.WEB_CALL_STATES.ACTIVE);break;case m.TYPE.REJECT:A.getState()===y.WEB_CALL_STATES.OUTGOING_CALLING&&(A.pc.close(),A.localStream.getTracks().forEach((e=>e.stop())),A=new S.default);break;case m.TYPE.TERMINATE:A.getState()===y.WEB_CALL_STATES.ACTIVE&&(A.pc.close(),A.localStream.getTracks().forEach((e=>e.stop())),r.remove(A.callId),A=new S.default)}else i.handleIncomingSignalingMessage(e,t)}))(),isInitialized:()=>!0,registerVideoCallback:()=>{},cleanupVideoBuffer:()=>{},updateNetworkMedium:()=>{},registerWebRTCCallback:e=>{v=e},notifyDeviceIdentityChangedOrDeleted:()=>{},getNumParticipantsFromCallOffer:()=>Promise.resolve(-1)};var P;function O(){const e=new Uint8Array(32);return self.crypto.getRandomValues(e),e.buffer}function I(){return(I=(0,i.default)((function*(e,t){if(!d.default)throw new Error("Unable to request Media Devices.");const n=yield(0,d.default)({audio:!0,video:t}),r=(0,_.default)(),i=yield(0,u.requireCallCollection)();i.add({id:r,peerJid:e,offerTime:(0,l.unixTime)(),isVideo:t,outgoing:!0,webClientShouldHandle:!0,canHandleLocally:!0});const a=i.assertGet(r);i.setActiveCall(a);const o=O(),s=(0,p.assertGetMe)(),c=B(),{token:f,key:h,relay:g}=yield H(o,s,e.toString({legacy:!0}),r,t);A.localStream=n,c.onnegotiationneeded=()=>b(c,r,s,e,o,h,f,g,t,!0),c.ontrack=e=>N(e)}))).apply(this,arguments)}function M(){return(M=(0,i.default)((function*(e,t,n,r,i,a,o,s){(yield(0,u.requireCallCollection)()).add({id:t,peerJid:n,offerTime:s,isVideo:e,outgoing:!1,webClientShouldHandle:!0,canHandleLocally:!0});const l=(0,p.assertGetMe)();if(h.default.openVoipWindow(),yield F(t,n.toString({legacy:!0}),e),!d.default)throw new Error("Unable to request Media Devices.");const c=yield(0,d.default)({audio:!0,video:e}),_=B();A.localStream=c,_.onnegotiationneeded=()=>b(_,t,l,n,r.buffer,i,a,o,e,!1),_.ontrack=e=>N(e)}))).apply(this,arguments)}function b(){return R.apply(this,arguments)}function R(){return(R=(0,i.default)((function*(e,t,n,r,i,a,o,s,l,u){const[c,d]=yield x(t,n,r,i),[p,_,f,h]=yield k(t,n,r),m=yield e.createOffer();__LOG__(2,!0)`voip:original-offer: ${m.sdp}`,yield z(s,t,n.toString({legacy:!0}),r.toString({legacy:!0}),y.RELAY_INFO.RELAY_LATENCY),m.sdp&&(m.sdp=(0,g.modifyOfferSDP)(m.sdp,p,_,c,l)),__LOG__(2,!0)`voip:modified-offer: ${m.sdp}`,yield e.setLocalDescription(m),__LOG__(2,!0)`voip:localDescription: `;const E=(0,g.generateICELiteAnswerSDP)(s,o,a,f,h,d,l);__LOG__(2,!0)`voip:generated-answer: ${E.sdp}`,A.setState(u?y.WEB_CALL_STATES.OUTGOING_CALLING:y.WEB_CALL_STATES.INCOMING_CALLING),e.setRemoteDescription(E),A.pc=e,A.answer=E,A.callId=t,A.peerJid=r.toString({legacy:!0}),v&&v({type:y.WEB_CALL_EVENTS.MEDIA_READY,data:A.localStream})}))).apply(this,arguments)}function N(e){if(__LOG__(2)`voip:received-track`,!v)throw new Error("No Track callback registered.");"audio"===e.track.kind&&(A.remoteAudioStream=e.streams[0],v({type:y.WEB_CALL_EVENTS.AUDIO_TRACK_RECEIVED,data:e.streams[0]})),"video"===e.track.kind&&(A.remoteVideoStream=e.streams[0],v({type:y.WEB_CALL_EVENTS.VIDEO_TRACK_RECEIVED,data:e.streams[0]}))}function w(e,t,n,r){const i=new TextDecoder;return(0,o.extractWithSaltAndExpand)(e,t,i.decode(n),r)}function L(){return D.apply(this,arguments)}function D(){return(D=(0,i.default)((function*(e,t,n){const r=new TextEncoder,i=r.encode(e).buffer,a=r.encode(t).buffer,o=new Uint32Array([n]).buffer,s=yield w(i,o,a,32);return new Uint32Array(s)[0]}))).apply(this,arguments)}function k(e,t,n){const r=L(e,t.toString({legacy:!0,formatFull:!0}),0),i=L(e,n.toString({legacy:!0}),0),a=L(e,t.toString({legacy:!0,formatFull:!0}),2),o=L(e,n.toString({legacy:!0}),2);return Promise.all([r,a,i,o])}function U(){return G.apply(this,arguments)}function G(){return(G=(0,i.default)((function*(e,t){const n=new TextEncoder;return(yield w(e,s.DEFAULT_SALT.buffer,n.encode(t).buffer,46)).slice(0,30)}))).apply(this,arguments)}function x(e,t,n,r){const i=U(r,t.toString({legacy:!0,formatFull:!0})),a=U(r,n.toString({legacy:!0}));return Promise.all([i,a])}function B(){return new RTCPeerConnection({sdpSemantics:"unified-plan"})}function F(e,t,n){const r=E.AUDIO_CODECS.DEFAULT,i=n?E.VIDEO_CODECS.DEFAULT:E.VIDEO_CODECS.NONE,a=["accept",{"call-id":e,"call-creator":t},r.concat(i).concat([["net",{medium:"3"},null],E.ENCOPT.DEFAULT])];return(0,c.sendCallSignalingMsg)({common:{type:"accept",call_id:e,peer_jid:t},payload:a})}function j(e){return["terminate",{"call-id":e},null]}function Y(){return(Y=(0,i.default)((function*(e,t){const n=j(e),r=n[0];yield(0,c.sendCallSignalingMsg)({common:{type:r,call_id:e,peer_jid:t},payload:n})}))).apply(this,arguments)}function K(e,t,n,r){const i=E.AUDIO_CODECS.DEFAULT,a=r?E.VIDEO_CODECS.DEFAULT:E.VIDEO_CODECS.NONE,o=i.concat(a);return["offer",{"call-id":t,"call-creator":n.toString({legacy:!0})},o.concat([["net",{medium:"3"},null],E.CAPABILITIES.DEFAULT,["enc",{count:"0"},Array.from(new Uint8Array(e))],E.ENCOPT.DEFAULT])]}function H(){return W.apply(this,arguments)}function W(){return(W=(0,i.default)((function*(e,t,n,r,i){const a=K(e,r,t,i),o=a[0];__LOG__(2)`voip:send:offer: payload:`;const s=yield(0,c.sendCallOffer)({common:{type:o,call_id:r,peer_jid:n},payload:a});if(!(null==s?void 0:s.status))throw new Error("Error receiving Offer Ack.");switch(s.status){case 200:if(s.payload){__LOG__(2)`voip:recv:offerAck:`;let e=null,t=null,n=null;for(const r of s.payload[2])"relay"===r[0]&&([e,t,n]=V(r));if(null==e||null==t||null==n)throw new Error("Error parsing relay attributes in Offer Ack");return{token:e,key:t,relay:n}}throw new Error("Error receiving Offer Ack: No Payload");case 409:throw new Error("Error receiving Offer Ack: Phone Busy");default:throw new Error(`Error receiving Offer Ack: Unknown status:${status}`)}}))).apply(this,arguments)}function V(e){let t=null,n=null,r=null;const i=new TextDecoder;for(const o of e[2])if("token"===o[0])t=(0,a.encodeB64)(new Uint8Array(o[2])),__LOG__(2)`voip:relay token: `;else if("key"===o[0])n=i.decode(new Uint8Array(o[2])),__LOG__(2)`voip:relay key: `;else if("te2"===o[0]){const e=new Uint8Array(o[2]);if(6===e.length){const t=new DataView(e.buffer);r={ip:[t.getUint8(0),t.getUint8(1),t.getUint8(2),t.getUint8(3)],port:t.getUint16(4)},__LOG__(2)`voip:relay address: `}}if(null==t)throw new Error("Could not extract relay token");if(null==n)throw new Error("Could not extract relay key");if(null==r)throw new Error("Could not extract relay address");return[t,n,r]}function $(e,t,n,r){const i=new ArrayBuffer(6),a=new DataView(i);a.setUint8(0,e.ip[0]),a.setUint8(1,e.ip[1]),a.setUint8(2,e.ip[2]),a.setUint8(3,e.ip[3]),a.setUint16(4,e.port);return[r,{"call-id":t,"call-creator":n},[["te",{latency:"10"},Array.from(new Int8Array(i))]]]}function z(){return q.apply(this,arguments)}function q(){return(q=(0,i.default)((function*(e,t,n,r,i){const a=$(e,t,n,i),o=a[0];yield(0,c.sendCallSignalingMsg)({common:{type:o,call_id:t,peer_jid:r},payload:a})}))).apply(this,arguments)}t.Voip=C},178480:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){const e=(0,i.randomHex)(16).substr(0,64);return __LOG__(2)`voip:generateCallId: ${e}`,e};var i=n(710038);r(n(846870))},571256:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDeviceAgnosticVoip=function(){let e=!1;return e=(0,r.getABPropConfigValue)("web_abprop_device_agnostic_voip"),e},t.isGroupCallEnabled=function(){let e=!1;return e=!1,false},t.isStatefulEnumerationEnabled=function(){let e=!1;return e=(0,r.getABPropConfigValue)("web_abprop_stateful_enumeration_enabled"),e},t.isVideoCallEnabled=function(){let e=!1;return e=(0,i.isFeatureEnabled)("web_voip_video_call"),e},t.isVoiceCallEnabled=function(){let e=!1;return e=(0,i.isFeatureEnabled)("web_voip_voice_call"),e};var r=n(287461),i=n(650201);n(241588)},276846:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateICELiteAnswerSDP=function(e,t,n,i,a,o,s){const l=(f=e,f.ip.join(".")),u=e.port+1,c=t,d=n,p=a,_=(0,r.encodeB64)(o);var f;let h=`v=0\no=- ${(new Date).getTime()} 2 IN IP4 127.0.0.1\ns=-\nt=0 0\na=group:BUNDLE 0${s?" 1":""}\na=ice-lite\na=msid-semantic: WMS g1noOjzcjYNgtJfnKdCzBmyvTozKsCGWCleP\nm=audio ${u} RTP/SAVP 111\nc=IN IP4 0.0.0.0\na=rtcp:9 IN IP4 ${l}\na=candidate:1152096416 1 udp 2113937151 ${l} ${u} typ host generation 0 network-cost 999\na=ice-ufrag:${c}\na=ice-pwd:${d}\na=ice-options:trickle\na=setup:active\na=mid:0\na=sendrecv\na=msid:g1noOjzcjYNgtJfnKdCzBmyvTozKsCGWCleP df375ff4-7ed5-459d-b991-76c8e47ffc52\na=rtcp-mux\na=crypto:0 AES_CM_128_HMAC_SHA1_32 inline:${_}\na=rtpmap:111 opus/48000/2\na=fmtp:111 useinbandfec=1\na=fmtp:111 maxplaybackrate=16000; sprop-maxcapturerate=16000\na=rtcp-fb:111 goog-remb\na=ssrc:${i} cname:noAs9WOptAnM/+QP\n`;s&&(h+=`m=video ${u} RTP/SAVP 102\nc=IN IP4 0.0.0.0\na=rtcp:9 IN IP4 ${l}\na=candidate:1152096416 1 udp 2113937151 ${l} ${u} typ host generation 0 network-cost 999\na=ice-ufrag:${c}\na=ice-pwd:${d}\na=ice-options:trickle\na=mid:1\na=extmap:3 urn:3gpp:video-orientation\na=sendrecv\na=msid:g1noOjzcjYNgtJfnKdCzBmyvTozKsCGWCleP df375ff4-7ed5-459d-b991-76c8e47ffc52\na=rtcp-mux\na=rtcp-rsize\na=crypto:0 AES_CM_128_HMAC_SHA1_32 inline:${_}\na=rtpmap:102 VP8/90000\na=rtcp-fb:102 nack\na=rtcp-fb:102 nack pli\na=rtcp-fb:102 goog-remb\na=ssrc:${p} cname:rcpcNyS/Kejuq2+Y\na=ssrc:${p} msid:g1noOjzcjYNgtJfnKdCzBmyvTozKsCGWCleP df375ff4-7ed5-459d-b991-76c8e47ffc52\na=ssrc:${p} mslabel:g1noOjzcjYNgtJfnKdCzBmyvTozKsCGWCleP\na=ssrc:${p} label:df375ff4-7ed5-459d-b991-76c8e47ffc52\n`);return{type:"answer",sdp:h}},t.modifyOfferSDP=function(e,t,n,i,a){let o=e;if(o=o.replace(/a=crypto:[1-9].*\r\n/g,""),o=o.replace(/a=crypto:0.*/g,`a=crypto:0 AES_CM_128_HMAC_SHA1_32 inline:${(0,r.encodeB64)(i)}`),o=o.replace(/a=rtcp-fb.*transport-cc.*\r\n/g,""),o=o.replace(/a=extmap:3.*draft-holmer-rmcat.*\r\n/g,""),a){const e=o.search(/m=video/g);let r=o.substring(0,e),i=o.substring(e);r=r.replace(/ssrc:\S+/g,`ssrc:${t}`),i=i.replace(/ssrc:\S+/g,`ssrc:${n}`),i=i.replace(/a=extmap:13 urn:3gpp:video-orientation/g,"a=extmap:3 urn:3gpp:video-orientation"),o=r+i}else o=o.replace(/ssrc:\S+/g,`ssrc:${t}`);return o};var r=n(417405)},549227:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TYPE_STR=t.TYPE_NAME=t.TYPE=t.ENC_RETRY_RECEIPT_ATTRS=void 0;t.TYPE={NONE:0,OFFER:1,OFFER_RECEIPT:2,ACCEPT:3,REJECT:4,TERMINATE:5,TRANSPORT:6,OFFER_ACK:7,OFFER_NACK:8,RELAY_LATENCY:9,RELAY_ELECTION:10,INTERRUPTION:11,MUTE:12,PREACCEPT:13,ACCEPT_RECEIPT:14,VIDEO_STATE:15,NOTIFY:16,GROUP_INFO:17,ENC_REKEY:18,PEER_STATE:19,VIDEO_STATE_ACK:20,FLOW_CONTROL:21,WEB_CLIENT:22,ACCEPT_ACK:23,GROUP_UPDATE:24,OFFER_NOTICE:25,MAX:26};t.TYPE_STR={OFFER:"offer",ACCEPT:"accept",ENC_REKEY:"enc_rekey",REJECT:"reject",RECEIPT:"receipt",OFFER_NOTICE:"offer_notice"};t.TYPE_NAME=["NONE","OFFER","OFFER_RECEIPT","ACCEPT","REJECT","TERMINATE","TRANSPORT","OFFER_ACK","OFFER_NACK","RELAY_LATENCY","RELAY_ELECTION","INTERRUPTION","MUTE","PREACCEPT","ACCEPT_RECEIPT","VIDEO_STATE","NOTIFY","GROUP_INFO","ENC_REKEY","PEER_STATE","VIDEO_STATE_ACK","FLOW_CONTROL","WEB_CLIENT","ACCEPT_ACK","GROUP_UPDATE","OFFER_NOTICE","MAX"];t.ENC_RETRY_RECEIPT_ATTRS={SINGLE_PARTICIPANT:"enc",GROUP_CALL:"enc_rekey_retry"}},416371:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WEB_CALL_STATES=t.WEB_CALL_EVENTS=t.WACallState=t.WACallEvent=t.WACallEndReason=t.VideoUpgradeRequestEndedReason=t.VideoState=t.VOIP_WINDOW_IPC_EVENTS=t.RENDERER_IPC_EVENTS=t.RELAY_INFO=t.PlatformTypeMapping=t.ParticipantState=t.MAIN_IPC_EVENTS=t.ContentType=t.CallNetworkMedium=t.CALL_STATES=t.CALL_LOG_RESULT_TYPE=t.CALL_LOG_RESULT=void 0;const r=n(76672).Mirrored(["INCOMING","ACTIVE_VOICE","ACTIVE_VIDEO"]);t.ContentType=r;t.WACallEvent={WANone:0,CallOfferSent:1,CallOfferReceived:2,CallOfferAckedWithRelayInfo:3,CallOfferNacked:4,CallOfferReceiptReceived:5,CallAcceptFailed:6,CallAcceptSent:7,CallAcceptReceived:8,CallPreacceptReceived:9,CallTerminateReceived:10,CallRejectReceived:11,CallOfferResend:12,AudioStreamStarted:13,P2PNegotiationSuccess:14,RelayCreateSuccess:15,CallStateChanged:16,P2PNegotiationFailed:17,MediaStreamError:18,AudioInitError:19,NoSamplingRatesForAudioRecord:20,SendOfferFailed:21,HandleOfferFailed:22,SendAcceptFailed:23,HandlePreAcceptFailed:24,HandleAcceptFailed:25,WillCreateSoundPort:26,SoundPortCreateFailed:27,TransportCandSendFailed:28,P2PTransportCreateFailed:29,P2PTransportMediaCreateFailed:30,P2PTransportStartFailed:31,P2PTransportRestartSuccess:32,MissingRelayInfo:33,ErrorGatheringHostCandidates:34,MediaStreamStartError:35,RelayLatencySendFailed:36,RelayElectionSendFailed:37,CallEnding:38,CallCaptureBufferFilled:39,CallCaptureEnded:40,RxTimeout:41,TxTimeout:42,RxTrafficStarted:43,RxTrafficStopped:44,RTCPPacketReceived:45,RTCPByeReceived:46,RelayBindsFailed:47,SoundPortCreated:48,AudioDriverRestart:49,Echo:50,SelfVideoStateChanged:51,PeerVideoStateChanged:52,VideoPortCreated:53,VideoPortCreateFailed:54,VideoDecodeStarted:55,VideoRenderStarted:56,VideoCaptureStarted:57,VideoPreviewFailed:58,VideoPreviewReady:59,VideoPreviewShouldMinimize:60,VideoStreamCreateError:61,VideoRenderFormatChanged:62,VideoCodecMismatch:63,VideoDecodePaused:64,VideoDecodeResumed:65,VideoEncodeFatalError:66,VideoDecodeFatalError:67,BatteryLevelLow:68,PeerBatteryLevelLow:69,GroupInfoChanged:70,FieldstatsReady:71,PendingCallInfoChanged:72,MuteStateChanged:73,InterruptionStateChanged:74,RxTrafficStateForPeerChanged:75,HandleAcceptReceiptFailed:76,GroupParticipantLeft:77,AudioRouteChangeRequest:78,HandleAcceptAckFailed:79,CallMissed:80,WeakWiFiSwitchedToCellular:81,CallAutoConnect:82,RejectedDecryptionFailure:83,PeerDeviceOrientationChanged:84,HandleOfferAckFailed:85,PendingCallAutoRejected:86,FDLeakDetected:87,RestartCamera:88,AudioTestReplayFinished:89,SyncDevices:90,VideoCodecStateChanged:91,CallFatal:92,UpdateJoinableCallLog:93,WAMax:94};t.WACallEndReason={WACallEndReasonUnknown:0,WACallEndReasonEndButtonTapped:1,WACallEndReasonEndButtonTappedOnBusy:2,WACallEndReasonReject:3,WACallEndReasonRejectUnavailable:4,WACallEndReasonRejectBlocked:5,WACallEndReasonTimeout:6,WACallEndReasonPeerUnavailable:7,WACallEndReasonRejectedByPeer:8,WACallEndReasonTimedoutByPeer:9,WACallEndReasonTerminatedByPeer:10,WACallEndReasonFailed:11,WACallEndReasonHandledRemotely:12};t.WACallState={WACallStateNone:0,WACallStateCalling:1,WACallStatePreacceptReceived:2,WACallStateReceivedCall:3,WACallStateAcceptSent:4,WACallStateAcceptReceived:5,WACallStateCallActive:6,WACallStateCallActiveElseWhere:7,WACallStateReceivedCallWithoutOffer:8};t.CALL_STATES={INCOMING_RING:"INCOMING_RING",OUTGOING_RING:"OUTGOING_RING",OUTGOING_CALLING:"OUTGOING_CALLING",CONNECTING:"CONNECTING",CONNECTION_LOST:"CONNECTION_LOST",ACTIVE:"ACTIVE",HANDLED_REMOTELY:"HANDLED_REMOTELY",ENDED:"ENDED",REJECTED:"REJECTED",REMOTE_CALL_IN_PROGRESS:"REMOTE_CALL_IN_PROGRESS",FAILED:"FAILED",NOT_ANSWERED:"NOT_ANSWERED"};t.WEB_CALL_STATES={OUTGOING_CALLING:"OUTGOING_CALLING",INCOMING_CALLING:"INCOMING_CALLING",ACTIVE:"ACTIVE",NONE:"NONE"};t.WEB_CALL_EVENTS={MEDIA_READY:"MEDIA_STREAM_READY",AUDIO_TRACK_RECEIVED:"AUDIO_TRACK_RECEIVED",VIDEO_TRACK_RECEIVED:"VIDEO_TRACK_RECEIVED"};t.VOIP_WINDOW_IPC_EVENTS={INIT:"VOIP_WINDOW_INIT",UPDATE:"VOIP_WINDOW_UPDATE",REJECT:"VOIP_WINDOW_REJECT",ACCEPT:"VOIP_WINDOW_ACCEPT",IGNORE:"VOIP_WINDOW_IGNORE",END:"VOIP_WINDOW_END",OPEN_PRINA_MODAL:"OPEN_PRINA_MODAL",RESET:"VOIP_WINDOW_RESET",TOGGLE_MUTE:"VOIP_WINDOW_TOGGLE_MUTE",TOGGLE_CAMERA:"VOIP_WINDOW_TOGGLE_CAMERA",OPEN_IN_CALL_MENU:"OPEN_IN_CALL_MENU",CLOSE_IN_CALL_MENU:"CLOSE_IN_CALL_MENU",TOGGLE_DEBUG_INFO:"TOGGLE_DEBUG_INFO",GROUP_CALL_INVITE:"GROUP_CALL_INVITE",UPGRADE_REQUEST:"UPGRADE_REQUEST",UPGRADE_ACCEPT:"UPGRADE_ACCEPT",UPGRADE_REJECT:"UPGRADE_REJECT",UPGRADE_CANCEL:"UPGRADE_CANCEL",INITIATE_WINDOW_MOVE:"INITIATE_WINDOW_MOVE",CLOSE_WINDOW_CLICK:"CLOSE_WINDOW_CLICK",MINIMIZE_WINDOW_CLICK:"MINIMIZE_WINDOW_CLICK",MAXIMIZE_WINDOW_CLICK:"MAXIMIZE_WINDOW_CLICK",UNMAXIMIZE_WINDOW_CLICK:"UNMAXIMIZE_WINDOW_CLICK",WINDOW_MAXIMIZED:"WINDOW_MAXIMIZED",WINDOW_UNMAXIMIZED:"WINDOW_UNMAXIMIZED",WINDOW_TITLE_DBL_CLICK:"WINDOW_TITLE_DBL_CLICK",WINDOW_ESC_PRESS:"WINDOW_ESC_PRESS",WINDOW_ALWAYS_ON_TOP_CHANGED:"WINDOW_ALWAYS_ON_TOP_CHANGED",L10N_UPDATE:"L10N_UPDATE"};t.MAIN_IPC_EVENTS={EVENT:"VOIP_MAIN_WINDOW_EVENT",SIGNALING:"VOIP_MAIN_WINDOW_SIGNALING",LOGGING:"VOIP_MAIN_WINDOW_LOGGING",LOG_PATH:"VOIP_MAIN_WINDOW_LOG_PATH",AV_EVENT:"AV_DEVICE_INFO_CHANGED",AV_LOG:"AV_MAIN_WINDOW_LOGGING",AV_DEVICE_CHANGE_TOAST:"AV_DEVICE_CHANGE_TOAST",AV_DEVICE_STATUS_CHANGE:"AV_DEVICE_STATUS_CHANGE"};t.RENDERER_IPC_EVENTS={ENABLE_VOIP_FEATURES:"voip:ENABLE_VOIP_FEATURES",ENABLE_VOIP_GROUP_FEATURES:"voip:ENABLE_VOIP_GROUP_FEATURES",REQUEST_NUM_PARTICIPANTS:"voip:REQUEST_NUM_PARTICIPANTS"};t.CALL_LOG_RESULT={0:"invalid",1:"canceled",2:"missed",3:"unavailable",4:"reject",5:"connected"};t.CALL_LOG_RESULT_TYPE={INVALID:0,CANCELED:1,MISSED:2,UNAVAILABLE:3,REJECT:4,CONNECTED:5};t.VideoState={VideoStateDisabled:0,VideoStateEnabled:1,VideoStatePaused:2,VideoStateUpgradeRequest:3,VideoStateUpgradeAccept:4,VideoStateUpgradeReject:5,VideoStateStopped:6,VideoStateUpgradeRejectByTimeout:7,VideoStateUpgradeCancel:8,VideoStateUpgradeCancelByTimeout:9,VideoStateError:20};t.VideoUpgradeRequestEndedReason={EndedByUser:0,EndedByTimeout:1};t.ParticipantState={ParticipantStateInvalid:0,ParticipantConnected:1,ParticipantIncoming:2,ParticipantRinging:3,ParticipantRejected:4,ParticipantTerminated:5,ParticipantTimedout:6,ParticipantCreatingCall:7,ParticipantInvisible:8,ParticipantVisible:9,ParticipantCancelOffer:10};t.CallNetworkMedium={CallNetworkMediumCellular:1,CallNetworkMediumWifi:2,CallNetworkMediumNone:3};t.PlatformTypeMapping={0:"unknown",1:"android",2:"iphone",3:"wp",4:"ios_tablet",5:"kaios",6:"windows",7:"portal",8:"mac_os_electron",9:"windows_electron"};t.RELAY_INFO={RELAY_ELECTION:"relayelection",RELAY_LATENCY:"relaylatency"}},690565:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VIDEO_CODECS=t.ENCOPT=t.CAPABILITIES=t.AUDIO_CODECS=void 0;t.CAPABILITIES={DEFAULT:["capability",{ver:"1"},[1,4,255,131,207,4]]};t.ENCOPT={DEFAULT:["encopt",{keygen:"2"},null]};t.AUDIO_CODECS={DEFAULT:[["audio",{enc:"opus",rate:"16000"},null],["audio",{enc:"opus",rate:"8000"},null]],RATE_16K:[["audio",{enc:"opus",rate:"16000"},null]]};t.VIDEO_CODECS={NONE:[],DEFAULT:[["video",{orientation:"0",screen_width:"1920",screen_height:"1080",device_orientation:"0",enc:"vp8",dec:"vp8"},null]]}},323321:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.checkE2eDebugEventInCoreWam=function(e){const t=Object.keys(e);if(0===t.length)return!1;for(let n=0;n<S.length;n++){const r=S[n];let i=0;for(let n=0;n<t.length&&r[t[n]]===e[t[n]];n++)i++;if(i===t.length)return!0}return!1},t.commitToCoreWam=function(e){if(!m)return Promise.resolve();if(!(0,u.getABPropConfigValue)("web_abprop_core_wam_runtime"))return Promise.resolve();y||C();const t=function(e){return{id:e.id,channel:e.wamChannel,psIdIntValue:e.privateStatsIdInt,fields:A(e),weight:e.weight,rawFields:[],debug:_}}(e);return(0,o.logAsync)(t.channel,t.id,t.psIdIntValue,t.fields,t.rawFields,t.weight,t.debug)},t.debugData=void 0,t.deinitializeCoreWam=function(){m=!1},t.doNotUseJustForTestUnloadCoreWamRuntime=function(){y=!1},t.getCoreWamSinkInitPromises=function(){return E},t.initializeCoreWam=function(e){if(m)return;g||((0,o.enableDebugMode)(),g=!0),h=e,C(),m=!0},t.setToCoreWam=function(e,t){if(!m)return;if(!(0,u.getABPropConfigValue)("web_abprop_core_wam_runtime"))return;y||C();(0,o.logAttributes)(v(e,t),_)},t.updatePrivateStatIdsToCore=function(e){if(!m)return;if(!(0,u.getABPropConfigValue)("web_abprop_core_wam_runtime"))return;(0,o.updatePrivateStatsIds)(e)},t.uploadPrivateCoreWamEvents=function(){return(0,s.getFinishedStreamBuffers)("private").then((e=>{const t=e.map((e=>(0,p.default)((0,i.encodeB64)(e.content),e.key).then((e=>{}))));return Promise.all(t)})).then((()=>{}))},t.uploadRegularCoreWamEvents=function(){return(0,s.getFinishedStreamBuffers)("regular").then((e=>{const t=e.map((e=>(0,d.default)((0,i.encodeB64)(e.content),e.key).then((t=>(0,s.removeBufferByKey)(e.key)))));return Promise.all(t)})).then((()=>{}))};r(n(81109));var i=n(417405),a=n(558553),o=n(478793),s=n(738304),l=n(612089),u=n(287461),c=r(n(571834)),d=r(n(567432)),p=r(n(389279));const _={name:"console-test",fieldIds:[],fieldTypes:[],fields:[]};t.debugData=_;const f=Object.freeze({integer:l.TYPES.INT,string:l.TYPES.STRING,boolean:l.TYPES.BOOL,number:l.TYPES.FLOAT,timer:l.TYPES.INT});let h,g=!1,m=!1,y=!1;const E=[],S=[];function T(e){return void 0===f[e]?l.TYPES.INT:f[e]}function v(e,t){const n=[];return n.push([...e.channels],e.id,T(e.type),null!=t?t:null),n}function A(e){const t=Object.keys(e.all),n=[];for(let r=0;r<t.length;r++){const i=c.default.METRICS.getEvent(e.$className,t[r]),a=e.all[t[r]];n.push(i.id,T(i.type),a)}return n}function C(){(0,u.getABPropConfigValue)("web_abprop_core_wam_runtime")&&(E.push((0,s.initializeWAMSink)("backend","regular",(()=>(0,a.rescheduleNow)("sendCoreWamRegularMetrics")))),E.push((0,s.initializeWAMSink)("backend","private",(()=>(0,a.rescheduleNow)("sendCoreWamPrivateMetrics")))),Object.keys(h).forEach((e=>{(0,o.logAttributes)(function(e,t){return v(c.default.METRICS.getGlobal(e),t)}(e,h[e]),_)})),y=!0)}},154378:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Wam=void 0,t.doNotUseOnlyForTestStopPendingTimer=function(){R.cancel()},t.initWamRuntime=function(){N=S.default.PrivateStatsAllIds.map((e=>e.key)),(0,A.initPrivateStats)(),(0,y.startWamStore)(),(0,m.logFingerprintToWam)(),R=new c.ShiftTimer((()=>{h.currentTabHasMutex()?function(){Q.apply(this,arguments)}():__LOG__(3)`wam:this tab is in the background, skipping WAM processing for now`})),(0,T.setWamImpl)(D);for(;w.length;){w.pop()()}L=!0};var i=r(n(348926)),a=(r(n(81109)),r(n(763105))),o=r(n(435161)),s=r(n(66604)),l=r(n(132375)),u=n(827653),c=n(201063),d=n(990445),p=n(323321),_=b(n(996588)),f=r(n(524173)),h=b(n(173077)),g=n(404021),m=n(332152),y=n(334338),E=n(205600),S=r(n(571834)),T=n(702011),v=n(350906),A=n(359151),C=r(n(32223)),P=n(851460),O=r(n(567432)),I=r(n(389279));function M(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(M=function(e){return e?n:t})(e)}function b(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=M(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}let R,N=[];const w=[];let L=!1;const D=(0,s.default)({commit:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null!=e.commitTime&&0!==e.commitTime)return __LOG__(3)`wam:commit redundant commit! ${e.$className}`,Promise.resolve();if(0!==e.weight&&Math.random()*e.weight>1)return e.commitTime=(0,d.unixTimeWithoutClockSkewCorrection)(),Promise.resolve();return(0,p.commitToCoreWam)(e),W(e),z([!0,e],t)},set:function(e,t){return(0,p.setToCoreWam)(e,t),z([!1,e,t])},resumeJobs:J,initialize:$},(function(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(L)return e(...n);w.push((()=>{e(...n)}))}}));t.Wam=D;const k={};let U=0,G=[],x=!1,B=!1,F=null,j=0,Y=new u.Resolvable,K=!1,H=!1;function W(e,t){e.commitTime=null!=t?t:(0,d.unixTimeWithoutClockSkewCorrection)(),e.sequenceNumber=j++}function V(){return S.default.APP_BUILD_TYPE.RELEASE}function $(e){if(F&&!e)return;const t=f.default.info();F={appVersion:"2.2246.10",appBuild:V(),platform:S.default.PLATFORM_TYPE.WEBCLIENT,appIsBetaRelease:V()===S.default.APP_BUILD_TYPE.BETA,browser:t.name||null,browserVersion:t.ua||null,deviceName:t.os||null,deviceVersion:t.version||null,webcEnv:S.default.WEBC_ENV_CODE.PROD,webcTabId:h.THIS_TAB,webcWebPlatform:S.default.WEBC_WEB_PLATFORM_TYPE[v.WAM_PLATFORM]},e&&Object.assign(F,e),S.default.Global.commitOnSet=!1,S.default.Global.set(F),S.default.Global.commitOnSet=!0,(0,p.initializeCoreWam)(F)}function z(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return G.push(e),x?t?(K=!1,H=!0,setTimeout((()=>R.forceRunNow()),1)):R.onOrBefore(1e3*g.PENDING_DELAY_IN_SECONDS):t&&(R.cancel(),K=!0,H=!1),Y.promise}function q(){x=!1,R.cancel();const e=Y;return Y=new u.Resolvable,e}function J(){x=!0,H=!1,G.length>0&&R.onOrBefore(1e3*g.PENDING_DELAY_IN_SECONDS),K&&(K=!1,H=!0,R.forceRunNow())}function Q(){return(Q=(0,i.default)((function*(){const e=H,t=q(),n=[...G];G=[];try{$();const r=yield(0,A.maybeRotatePsIds)();yield Promise.all(r.map(Z)),yield Promise.all(["regular","none",...N].map((t=>ae(t,n,e))))}finally{t.resolve(),J()}}))).apply(this,arguments)}function X(e){return"regular"===e?"regular":"private"}function Z(){return ee.apply(this,arguments)}function ee(){return(ee=(0,i.default)((function*(e){yield se(e),k[e]=yield te(e)}))).apply(this,arguments)}function te(){return ne.apply(this,arguments)}function ne(){return(ne=(0,i.default)((function*(e){return new E.WamContext(e,yield C.default.getNextSequenceNumberForStream("1"),F)}))).apply(this,arguments)}function re(){return ie.apply(this,arguments)}function ie(){return(ie=(0,i.default)((function*(e){var t;const n=null!==(t=k[e])&&void 0!==t?t:yield te(e);return k[e]=n,n}))).apply(this,arguments)}function ae(){return oe.apply(this,arguments)}function oe(){return(oe=(0,i.default)((function*(e,t,n){const r=X(e);let i;try{i=yield re(e)}catch(e){return void __LOG__(3)`wam:_executePendingForContext failed to get context ${String((null==e?void 0:e.stack)?e.stack:e)}`}try{for(let n=0;n<t.length;n++){if(i.size()>g.WAM_MAX_BUFFER_SIZE){__LOG__(3)`wam:_executePendingForContext drop the rest due to size limit: ${i.size()} > ${g.WAM_MAX_BUFFER_SIZE}`;break}const a=t[n],[o,...s]=a;if(o){const t=s[0];("regular"===t.wamChannel&&t.wamChannel===r||"private"===t.wamChannel&&e===(0,A.getPrivateStatsKeyFromInt)(t.privateStatsIdInt))&&i.write(t)}else{const[e,t]=s;e.channels.includes(r)&&(F[e.name]=t,i.set(e.id,t))}}const a=(0,d.unixTimeWithoutClockSkewCorrection)();if(i.eventsWritten>0&&(n||i.size()>g.WAM_MAX_BUFFER_SIZE||a>=U+g.WAM_ROTATE_INTERVAL_IN_SECONDS||!B)){if(!(0,P.isLoggedIn)())return void(i.buffer.size()>g.WAM_MAX_BUFFER_SIZE?k[e]=null:yield se(e));yield ue(e)}else yield se(e)}catch(t){__LOG__(3)`wam:_executePending error ${String((null==t?void 0:t.stack)?t.stack:t)}`,_.upload({reason:"wam-error"}),k[e]=null}}))).apply(this,arguments)}function se(){return le.apply(this,arguments)}function le(){return(le=(0,i.default)((function*(e){if(!k[e])return;const t=k[e].stringBuffer();if(!t)return;const n=(0,l.default)(k[e],"contexts[bufferKey]").unsavedPortion;if(n&&0===n.eventsWritten)return;const r=(0,l.default)(k[e],"contexts[bufferKey]").saveKey;try{if(n){const n=yield C.default.update(r,e,t);if(!k[e])return;n?(0,l.default)(k[e],"contexts[bufferKey]").unsavedPortion=yield te(e):(k[e]=k[e].unsavedPortion,yield se(e))}else{if(yield C.default.add(r,e,t),!k[e])return;(0,l.default)(k[e],"contexts[bufferKey]").unsavedPortion=yield te(e)}}catch(e){__LOG__(3)`wam:save WamStorage failed to save ${String(e)}`}}))).apply(this,arguments)}function ue(){return ce.apply(this,arguments)}function ce(){return(ce=(0,i.default)((function*(e){let t;try{t=yield C.default.deleteAll(e)}catch(e){t={},__LOG__(3)`wam:sendAllLogs failed to read because ${String(e)}`}const n=t;if(k[e]){k[e].unsavedPortion&&!(k[e].saveKey in n)&&(k[e]=k[e].unsavedPortion);const t=(0,l.default)(k[e],"contexts[bufferKey]").saveKey;n[t]=(0,l.default)(k[e],"contexts[bufferKey]").stringBuffer()}const r=yield Promise.all((0,o.default)(n,((t,n)=>de(t,n,X(e))))),s=(0,a.default)(r);if(s.length!==r.length&&(U=(0,d.unixTimeWithoutClockSkewCorrection)(),B=!0),k[e]&&!s.includes(k[e].saveKey)&&(k[e]=null),0===s.length)return;const u=s.reduce((function(e,t){return e+n[t].length}),0);u<g.WAM_MAX_BUFFER_SIZE?yield Promise.all((0,o.default)(s,function(){var t=(0,i.default)((function*(t){try{yield C.default.add(t,e,n[t])}catch(e){__LOG__(3)`sendAllLogs: adding to WamStorage failed`}}));return function(){return t.apply(this,arguments)}}())):(k[e]=null,__LOG__(3)`wam dropped ${s.length} buffers! (${u} bytes)`)}))).apply(this,arguments)}function de(e,t,n){return""===e||"["===e[0]?Promise.resolve():"private"===n?(0,I.default)(e,t):"regular"===n?(0,O.default)(e,t):Promise.resolve()}},437175:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.logBlockEvent=function(e){const{contact:t,blockEntryPoint:r,isBlock:o}=e;if((0,i.getABPropConfigValue)("block_entry_point_logging_enabled")){var s;const e=n(965012).ChatCollection,i=t.isMyContact||(null===(s=e.get(t.id))||void 0===s?void 0:s.isTrusted());new a.default.BlockEvents({blockEntryPoint:r,blockEventIsSuspicious:!i,blockEventIsUnsub:!t.isMyContact,blockEventActionType:o?a.default.BLOCK_EVENT_ACTION_TYPE.BLOCK:a.default.BLOCK_EVENT_ACTION_TYPE.UNBLOCK}).commit()}};var i=n(287461),a=r(n(571834))},369084:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.logChatPSADelete=function(e){var t;new i.default.ChatPsaAction({messageMediaType:e.getWamMediaType(),psaCampaignId:null===(t=e.campaignId)||void 0===t?void 0:t.toString(),psaMessageActionType:i.default.PSA_MESSAGE_ACTION_TYPE.DELETE,psaMsgId:e.id.id.toString()}).commit()},t.logChatPSAForward=function(e){var t;new i.default.ChatPsaAction({messageMediaType:e.getWamMediaType(),psaCampaignId:null===(t=e.campaignId)||void 0===t?void 0:t.toString(),psaMessageActionType:i.default.PSA_MESSAGE_ACTION_TYPE.FORWARD,psaMsgId:e.id.id.toString()}).commit()},t.logChatPSAMediaPlay=function(e,t,n){new i.default.ChatPsaAction({messageMediaType:e,psaCampaignId:null==t?void 0:t.toString(),psaMessageActionType:i.default.PSA_MESSAGE_ACTION_TYPE.MEDIA_PLAY,psaMsgId:n.toString()}).commit()},t.logChatPSAMute=function(e,t){new i.default.ChatMute({actionConducted:i.default.ACTION_CONDUCTED.MUTE,chatMuteNotificationChoice:i.default.CHAT_MUTE_NOTIFICATION_CHOICE.NO_NOTIFICATIONS_WHEN_MUTED,muteChatType:i.default.MUTE_CHAT_TYPE.ONE_ON_ONE,muteDuration:t,muteEntryPoint:e,waOfficialAccountName:i.default.WA_OFFICIAL_ACCOUNT_NAME.WHATSAPP_CHATPSA}).commit()},t.logChatPSARead=function(e){var t;null!=e.campaignId&&new i.default.ChatPsaRead({messageMediaType:e.getWamMediaType(),psaMsgId:e.id.id.toString(),psaCampaignId:null===(t=e.campaignId)||void 0===t?void 0:t.toString(),readEntryPoint:i.default.READ_ENTRY_POINT.CHAT}).commit()},t.logChatPSARemove=function(e,t,n){e?new i.default.ChatPsaRemove({lastReceivedMediaType:e.getWamMediaType(),lastReceivedMessageTs:e.t,lastReceivedMsgId:e.id.id.toString(),psaMessageRemoveAction:a(t),psaMessageRemoveEntryPoint:o(n),waOfficialAccountName:i.default.WA_OFFICIAL_ACCOUNT_NAME.WHATSAPP_CHATPSA}).commit():new i.default.ChatPsaRemove({psaMessageRemoveAction:a(t),psaMessageRemoveEntryPoint:o(n),waOfficialAccountName:i.default.WA_OFFICIAL_ACCOUNT_NAME.WHATSAPP_CHATPSA}).commit()},t.logChatPSAStar=function(e){var t;new i.default.ChatPsaAction({messageMediaType:e.getWamMediaType(),psaCampaignId:null===(t=e.campaignId)||void 0===t?void 0:t.toString(),psaMessageActionType:i.default.PSA_MESSAGE_ACTION_TYPE.SAVE,psaMsgId:e.id.id.toString()}).commit()},t.logChatPSAUnmute=function(e){new i.default.ChatMute({actionConducted:i.default.ACTION_CONDUCTED.UNMUTE,muteChatType:i.default.MUTE_CHAT_TYPE.ONE_ON_ONE,muteEntryPoint:e,waOfficialAccountName:i.default.WA_OFFICIAL_ACCOUNT_NAME.WHATSAPP_CHATPSA}).commit()};var i=r(n(571834));function a(e){switch(e){case 1:return i.default.PSA_MESSAGE_REMOVE_ACTION.BLOCK;case 2:return i.default.PSA_MESSAGE_REMOVE_ACTION.UNBLOCK;case 3:return i.default.PSA_MESSAGE_REMOVE_ACTION.ARCHIVE;case 4:return i.default.PSA_MESSAGE_REMOVE_ACTION.UNARCHIVE;case 5:return i.default.PSA_MESSAGE_REMOVE_ACTION.CLEAR;case 6:return i.default.PSA_MESSAGE_REMOVE_ACTION.DELETE_ALL}}function o(e){switch(e){case 1:return i.default.PSA_MESSAGE_REMOVE_ENTRY_POINT.BLOCK_FROM_CONTACT_INFO;case 2:return i.default.PSA_MESSAGE_REMOVE_ENTRY_POINT.BLOCK_FROM_CHAT;case 3:return i.default.PSA_MESSAGE_REMOVE_ENTRY_POINT.UNBLOCK_FROM_CONTACT_INFO;case 4:return i.default.PSA_MESSAGE_REMOVE_ENTRY_POINT.UNBLOCK_FROM_CHAT;case 5:return i.default.PSA_MESSAGE_REMOVE_ENTRY_POINT.UNBLOCK_FROM_PRIVACY_SETTINGS;case 6:return i.default.PSA_MESSAGE_REMOVE_ENTRY_POINT.ARCHIVE_FROM_CHAT_LIST;case 7:return i.default.PSA_MESSAGE_REMOVE_ENTRY_POINT.ARCHIVE_FROM_DELETE_OPTION;case 8:return i.default.PSA_MESSAGE_REMOVE_ENTRY_POINT.UNARCHIVE_FROM_ARCHIVED_CHAT_LIST;case 9:return i.default.PSA_MESSAGE_REMOVE_ENTRY_POINT.CLEAR_FROM_CONTACT_INFO;case 10:return i.default.PSA_MESSAGE_REMOVE_ENTRY_POINT.CLEAR_FROM_CHAT_LIST;case 11:return i.default.PSA_MESSAGE_REMOVE_ENTRY_POINT.DELETE_ALL_FROM_CHAT_LIST;case 12:return i.default.PSA_MESSAGE_REMOVE_ENTRY_POINT.DELETE_ALL_FROM_CONTACT_INFO;case 13:return i.default.PSA_MESSAGE_REMOVE_ENTRY_POINT.DELETE_ALL_FROM_CONVERSATION;case 14:return i.default.PSA_MESSAGE_REMOVE_ENTRY_POINT.CLEAR_FROM_CONVERSATION}}},404021:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WAM_ROTATE_INTERVAL_IN_SECONDS=t.WAM_PROTOCOL_VERSION=t.WAM_MAX_BUFFER_SIZE=t.PENDING_DELAY_IN_SECONDS=void 0;t.PENDING_DELAY_IN_SECONDS=10;t.WAM_MAX_BUFFER_SIZE=5e4;t.WAM_PROTOCOL_VERSION=5;t.WAM_ROTATE_INTERVAL_IN_SECONDS=300},784898:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.commitDeviceLinkEvent=E,t.initDeviceLinkEvent=function(){return h.apply(this,arguments)},t.setDeviceLinkPairStage=function(){return g.apply(this,arguments)};var i=r(n(348926)),a=n(417405),o=n(551168),s=n(638778),l=n(827653),u=n(990445),c=r(n(571834));let d=null,p=null,_=null,f=null;function h(){return(h=(0,i.default)((function*(e,t,n){d=new c.default.MdLinkDeviceCompanion;const r=yield m(e,t);p={regStartTime:n,sessionId:r}}))).apply(this,arguments)}function g(){return(g=(0,i.default)((function*(e){var t;d&&(yield null===(t=f)||void 0===t?void 0:t.promise,f=new l.Resolvable,_=e,yield E())}))).apply(this,arguments)}function m(){return y.apply(this,arguments)}function y(){return(y=(0,i.default)((function*(e,t){const n=new o.Binary;n.writeBuffer(e),n.write("_".charCodeAt(0)),n.writeBuffer(t);const r=n.readByteArray(),i=yield(0,s.sha256)(r);return(0,a.encodeB64)(i)}))).apply(this,arguments)}function E(e){var t;if(!d||!p)return;const n=p,r=(0,u.unixTimeWithoutClockSkewCorrection)()-n.regStartTime;if(null==_)return;d=new c.default.MdLinkDeviceCompanion({mdDurationS:r,mdSessionId:n.sessionId,mdTimestampS:n.regStartTime,mdLinkDeviceCompanionErrorCode:null==e?0:e,mdLinkDeviceCompanionStage:_});const i=d;i.commit(!0),null===(t=f)||void 0===t||t.resolve(),null==e&&i.mdLinkDeviceCompanionStage!==c.default.MD_LINK_DEVICE_COMPANION_STAGE.COMPLETE||(d=null,p=null,_=null)}},552652:(e,t)=>{"use strict";function n(){let e={},t={},n={};const r={},i=Object.getOwnPropertyNames(window),a=Object.getOwnPropertyNames(document),o=Array.prototype.slice.call(window.document.documentElement.attributes);function s(e,t){const n={};return e.map((e=>{n[e]=!!t.includes(e)})),n}return t=s(["_phantom","__nightmare","_selenium","callPhantom","callSelenium","_Selenium_IDE_Recorder"],i),e=s(["__webdriver_evaluate","__selenium_evaluate","__webdriver_script_function","__webdriver_script_func","__webdriver_script_fn","__fxdriver_evaluate","__driver_unwrapped","__webdriver_unwrapped","__driver_evaluate","__selenium_unwrapped","__fxdriver_unwrapped"],a),n=s(["selenium","webdriver","driver"],o),t.wd=window.navigator.webdriver,r.wKeys=t,r.dKeys=e,r.dElKeys=n,r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={getAutoToolsProperties:()=>({data:n()})};t.default=r},332152:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.logFingerprintToWam=function(){const e=i.default.getAutoToolsProperties(),t={webcDocumentWebdriverEvaluate:e.data.dKeys.__webdriver_evaluate,webcDocumentSeleniumEvaluate:e.data.dKeys.__selenium_evaluate,webcDocumentWebdriverScriptFunction:e.data.dKeys.__webdriver_script_function,webcDocumentWebdriverScriptFunc:e.data.dKeys.__webdriver_script_func,webcDocumentWebdriverScriptFn:e.data.dKeys.__webdriver_script_fn,webcDocumentFxdriverEvaluate:e.data.dKeys.__fxdriver_evaluate,webcDocumentDriverUnwrapped:e.data.dKeys.__driver_unwrapped,webcDocumentWebdriverUnwrapped:e.data.dKeys.__webdriver_unwrapped,webcDocumentDriverEvaluate:e.data.dKeys.__driver_evaluate,webcDocumentSeleniumUnwrapped:e.data.dKeys.__selenium_unwrapped,webcDocumentFxdriverUnwrapped:e.data.dKeys.__fxdriver_unwrapped,webcDocumentElementAttrSelenium:e.data.dElKeys.selenium,webcDocumentElementAttrWebdriver:e.data.dElKeys.webdriver,webcDocumentElementAttrDriver:e.data.dElKeys.driver,webcWindowPhantom:e.data.wKeys._phantom,webcWindowNightmare:e.data.wKeys.__nightmare,webcWindowSelenium:e.data.wKeys._selenium,webcWindowCallphantom:e.data.wKeys.callPhantom,webcWindowCallselenium:e.data.wKeys.callSelenium,webcWindowSeleniumIdeRecorder:e.data.wKeys._Selenium_IDE_Recorder,webcWindowNavigatorWebdriver:!0===e.data.wKeys.wd?a.default.WEBC_WINDOW_NAVIGATOR_WEBDRIVER_TYPE.TRUE:!1===e.data.wKeys.wd?a.default.WEBC_WINDOW_NAVIGATOR_WEBDRIVER_TYPE.FALSE:a.default.WEBC_WINDOW_NAVIGATOR_WEBDRIVER_TYPE.UNDEFINED};new a.default.WebcFingerprint(t).commit()};var i=r(n(552652)),a=r(n(571834))},313556:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTypeOfGroupToMetric=function(e,t){const n=s(e);null!=n&&(t.typeOfGroup=n)},t.getGroupCountMetricsFromChatWid=function(e){if(null!=e&&e.isGroup()){const t=o(e);if(null!=t)return(0,a.getGroupCountMetricsFromGroupMetadata)(t)}},t.getGroupTypeFromChatWid=s,t.isCagIncognitoFromChatWid=function(e){const t=o(e);return(0,a.isCagIncognitoFromGroupMetadata)(t)};var i=n(862159),a=n(869513);r(n(571834));function o(e){return e.isGroup()?n(318797).default.get(e):null}function s(e){if(null!=e&&e.isGroup()){const t=o(e);if(null!=t)return(0,i.groupTypeToWamEnum)((0,i.getGroupTypeFromGroupMetadata)(t))}}},440401:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cacheGroupMetrics=function(e){if(null==e.participants||null==e.senderKey)return;a.set(e.groupId,Promise.resolve((0,i.getGroupMetricsFromDbRecord)(e)))},t.getGroupMetrics=function(e){if(!e.isGroup())return Promise.resolve(null);const t=e.toString();a.has(t)||a.set(t,function(e){return(0,r.getParticipantTable)().get(e).then((e=>e&&(0,i.getGroupMetricsFromDbRecord)(e))).catch((t=>{__LOG__(3)`_getGroupMetricsFromDb: failed to get for ${e}: ${t}`}))}(t));return a.get(t)||Promise.resolve(null)};var r=n(76469),i=n(869513);const a=new Map},869513:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.capCount=s,t.getGroupCountMetricsFromGroupMetadata=function(e){let t=Object.freeze({});const n=e.participants.length;null!=n&&(t=(0,i.default)({participantCount:s(n)},t));const r=e.cachedDeviceCount;null!=r&&(t=(0,i.default)({deviceCount:s(r)},t));return t},t.getGroupMetricsFromDbRecord=function(e){return{participantCount:s(e.participants.length),deviceCount:s(e.senderKey.size),deviceSizeBucket:(0,o.default)(e.senderKey.size)}},t.isCagIncognitoFromGroupMetadata=function(e){return(null==e?void 0:e.groupType)===a.GroupType.DEFAULT_ANNOUNCEMENT_GROUP&&!0===(null==e?void 0:e.incognito)},t.isGroupLidFromGroupMetadata=function(e){let t=null;if(null!=e&&null!=e.participants&&null!=e.incognito){const n=e.participants.iAmAdmin(),r=e.groupType===a.GroupType.DEFAULT_ANNOUNCEMENT_GROUP;t=r&&!1!==e.incognito&&!n}return t};var i=r(n(81109)),a=n(862159),o=(r(n(571834)),r(n(342310)));function s(e){return Math.max(e,32)}},334338:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.closeWamStore=function(){(0,l.closeWamStorage)()},t.startWamStore=function(){(0,l.startWamStorage)(d)};var i=r(n(81109)),a=r(n(348926)),o=n(643930),s=n(990445),l=n(738304),u=n(757453),c=(n(359151),r(n(32223)));const d={getStreamId:()=>1,saveBuffer:()=>Promise.reject(new o.UnimplementedMethod("saveBuffer not implemented yet")),finishBuffer:()=>Promise.reject(new o.UnimplementedMethod("finishBuffer not implemented yet")),getStartingSequenceRow:()=>Promise.reject(new o.UnimplementedMethod("getStartingSequenceRow not implemented yet")),getBuffers:()=>Promise.reject(new o.UnimplementedMethod("getBuffers not implemented yet")),removeBufferByKey:()=>Promise.resolve(),nukeMetrics:()=>Promise.reject(new o.UnimplementedMethod("nukeMetrics not implemented yet")),updatePrivateStatsIds:()=>Promise.reject(new o.UnimplementedMethod("updatePrivateStatsIds not implemented yet")),redeemPrivateStatsToken:function(){var e=(0,a.default)((function*(e){const t=yield c.default.getPsToken();return t?e({redeemCount:t.redeemCount,creationTs:t.creationTs},{maxExpirySeconds:86400})?c.default.savePsToken((0,i.default)((0,i.default)({},t),{},{redeemCount:t.redeemCount+1})).then((()=>t.token)):Promise.resolve(null):null}));return function(){return e.apply(this,arguments)}}(),savePrivateStatsToken:function(e){return c.default.savePsToken({key:"token",token:e,creationTs:(0,s.unixTime)(),redeemCount:1})},privateStatsKillSwitchGetBlockedToken:function(){return Promise.resolve((0,u.getPsKillSwitchToken)())},privateStatsKillSwitchSet:function(e){return(0,u.setPsKillSwitchToken)(e),Promise.resolve()}}},464404:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.generateMediaEventId=function(){return 1+Math.floor(Number.MAX_SAFE_INTEGER*Math.random())},t.getMetricBackendStore=function(e){if(!e)return l.default.BACKEND_STORE_TYPE.NON_DIRECT_PATH;switch(e.slice(0,2).toLowerCase()){case"/v":return l.default.BACKEND_STORE_TYPE.EVERSTORE;case"/o":return l.default.BACKEND_STORE_TYPE.OIL}return __LOG__(4,void 0,new Error,!0)`Unrecognized direct path type`,SEND_LOGS("unrecognized-direct-path-type"),null},t.getMetricDownloadErrorResultType=function(e){if(e instanceof s.MMSThrottleError)return l.default.MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_THROTTLE;if(e instanceof o.NoMediaHostsError)return l.default.MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_MEDIA_CONN;if(e instanceof a.HttpNetworkError)return l.default.MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_NETWORK;if(e instanceof a.HttpStatusCodeError)switch(e.status){case 404:case 410:return l.default.MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_TOO_OLD;case 416:return l.default.MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_CANNOT_RESUME;case 401:return l.default.MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_INVALID_URL;case 429:case 507:return l.default.MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_THROTTLE;default:return l.default.MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_UNKNOWN}if(e.name===i.ABORT_ERROR)return l.default.MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_CANCEL;if(e instanceof a.MmsDownloadFilehashMismatchError)return l.default.MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_ENC_HASH_MISMATCH;return l.default.MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_UNKNOWN},t.getMetricMediaType=function(e){switch(e){case"audio":return l.default.MEDIA_TYPE.AUDIO;case"document":case"thumbnail-document":return l.default.MEDIA_TYPE.DOCUMENT;case"gif":return l.default.MEDIA_TYPE.GIF;case"image":case"thumbnail-image":return l.default.MEDIA_TYPE.PHOTO;case"ppic":return l.default.MEDIA_TYPE.PROFILE_PIC;case"product":return l.default.MEDIA_TYPE.PRODUCT_IMAGE;case"ptt":return l.default.MEDIA_TYPE.PTT;case"sticker":return l.default.MEDIA_TYPE.STICKER;case"video":case"thumbnail-video":return l.default.MEDIA_TYPE.VIDEO;case"template":return l.default.MEDIA_TYPE.TEMPLATE;case"md-msg-hist":return l.default.MEDIA_TYPE.MD_HISTORY_SYNC;case"md-app-state":return l.default.MEDIA_TYPE.MD_APP_STATE;case"product-catalog-image":return l.default.MEDIA_TYPE.PRODUCT_IMAGE;case"thumbnail-link":return l.default.MEDIA_TYPE.URL;case"payment-bg-image":case"biz-cover-photo":return l.default.MEDIA_TYPE.NONE;default:throw new Error(`webMediaType is invalid: ${e}`)}},t.getMetricOverallDownloadModeType=function(e,t,n){if(u(e))return l.default.MEDIA_DOWNLOAD_MODE_TYPE.THUMBNAIL;if("manual"===t)return l.default.MEDIA_DOWNLOAD_MODE_TYPE.MANUAL;if(n)return l.default.MEDIA_DOWNLOAD_MODE_TYPE.PREFETCH;return l.default.MEDIA_DOWNLOAD_MODE_TYPE.FULL},t.getMetricOverallUploadModeType=function(e){if(u(e))return l.default.MEDIA_UPLOAD_MODE_TYPE.THUMBNAIL;return l.default.MEDIA_UPLOAD_MODE_TYPE.REGULAR},t.getMetricUploadErrorResultType=function(e){if(e instanceof s.MMSUnauthorizedError)return l.default.MEDIA_UPLOAD_RESULT_TYPE.ERROR_NO_PERMISSIONS;if(e instanceof s.MediaTooLargeError)return l.default.MEDIA_UPLOAD_RESULT_TYPE.ERROR_BAD_MEDIA;if(e instanceof s.MMSThrottleError)return l.default.MEDIA_UPLOAD_RESULT_TYPE.ERROR_THROTTLE;if(e instanceof a.HttpStatusCodeError&&e.status>=500)return l.default.MEDIA_UPLOAD_RESULT_TYPE.ERROR_SERVER;if(e instanceof o.NoMediaHostsError)return l.default.MEDIA_UPLOAD_RESULT_TYPE.ERROR_MEDIA_CONN;if(e.name===i.ABORT_ERROR)return l.default.MEDIA_UPLOAD_RESULT_TYPE.ERROR_CANCEL;if(e instanceof a.HttpNetworkError)return l.default.MEDIA_UPLOAD_RESULT_TYPE.ERROR_UPLOAD;return l.default.MEDIA_UPLOAD_RESULT_TYPE.ERROR_UNKNOWN},t.getStatusCode=function(e){if(e instanceof a.HttpStatusCodeError)return e.status},t.logErrorUnknownDetails=function(e,t){if(null==t)return;let n;e.overallDownloadResult===l.default.MEDIA_DOWNLOAD_RESULT_TYPE.ERROR_UNKNOWN?n=l.default.WEBC_MEDIA_OPERATION_CODE.DOWNLOAD:e.overallUploadResult===l.default.MEDIA_UPLOAD_RESULT_TYPE.ERROR_UNKNOWN&&(n=l.default.WEBC_MEDIA_OPERATION_CODE.UPLOAD);if(null==n)return;new l.default.WebcMediaErrorUnknownDetails({mediaId:e.mediaId,webcMediaOperation:n,webcMediaErrorName:t.name}).commit()};var i=n(88237),a=n(791357),o=n(271186),s=n(263958),l=r(n(571834));function u(e){switch(e){case"thumbnail-document":case"thumbnail-image":case"thumbnail-video":case"thumbnail-link":return!0}return!1}},60253:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(571834));const a={document:i.default.MEDIA_TYPE.DOCUMENT,video:i.default.MEDIA_TYPE.VIDEO,gif:i.default.MEDIA_TYPE.GIF,image:i.default.MEDIA_TYPE.PHOTO,audio:i.default.MEDIA_TYPE.AUDIO};t.default=class{constructor(e,t,n){this.mediaPickerSentUnchanged=0,this.mediaPickerDeleted=0,this.mediaPickerChanged=new Set,this.mediaPickerCroppedRotated=new Set,this.mediaPickerDrawing=new Set,this.mediaPickerStickers=new Set,this.mediaPickerText=new Set,this.mediaPickerLikeDoc=0,this.mediaPickerNotLikeDoc=0,this.mediaPickerT=0,this.t0=Date.now(),this.mediaType=a[t],this.mediaPickerOrigin=n,this.medias=new Set,this.medias.add(e),this.changeTypes={mediaPickerCroppedRotated:this.mediaPickerCroppedRotated,mediaPickerDrawing:this.mediaPickerDrawing,mediaPickerStickers:this.mediaPickerStickers,mediaPickerText:this.mediaPickerText}}onAdd(e){this.medias.add(e),"document"===this.mediaType?this.mediaPickerLikeDoc++:this.mediaPickerNotLikeDoc++}onChange(e,t){this.mediaPickerChanged.add(e),this.changeTypes[t].add(e)}onDelete(e){if(this.medias.delete(e),this.mediaPickerDeleted++,0===this.medias.size)return this.onCancel()}onSend(){return this.mediaPickerSent=this.medias.size,this.mediaPickerSentUnchanged=this.mediaPickerSent-this.mediaPickerChanged.size,this.dataPreflight()}onCancel(){return this.mediaPickerSent=0,this.mediaPickerSentUnchanged=0,this.dataPreflight()}onPause(){this.mediaPickerT+=Date.now()-(this.t0||0),this.t0=null}onResume(){this.t0=null!=this.t0?this.t0:Date.now()}dataPreflight(){let e=this.mediaPickerSentUnchanged;return isNaN(e)&&(e=0,__LOG__(4,void 0,new Error,!0)`mediaPickerSentUnchange mediaPickerSent: ${null!=this.mediaPickerSent&&0!==this.mediaPickerSent?this.mediaPickerSent:"undefined"}, mediaPickerChanged: ${this.mediaPickerChanged.size||"undefined"}`,SEND_LOGS("mediaPickerSentUnchange is not a number")),{mediaPickerSent:this.mediaPickerSent,mediaPickerSentUnchanged:e,mediaPickerT:this.mediaPickerT+(Date.now()-(this.t0||0)),mediaType:this.mediaType,mediaPickerOrigin:this.mediaPickerOrigin,mediaPickerChanged:this.mediaPickerChanged.size,mediaPickerCroppedRotated:this.mediaPickerCroppedRotated.size,mediaPickerDrawing:this.mediaPickerDrawing.size,mediaPickerStickers:this.mediaPickerStickers.size,mediaPickerText:this.mediaPickerText.size,mediaPickerLikeDoc:this.mediaPickerLikeDoc,mediaPickerNotLikeDoc:this.mediaPickerNotLikeDoc,mediaPickerDeleted:this.mediaPickerDeleted}}}},456277:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MediaPickerStatsLogger=t.MediaPickerChangeTypes=void 0;var i=r(n(81109)),a=r(n(60253)),o=r(n(571834));t.MediaPickerChangeTypes={mediaPickerCroppedRotated:"mediaPickerCroppedRotated",mediaPickerDrawing:"mediaPickerCroppedRotated",mediaPickerStickers:"mediaPickerCroppedRotated",mediaPickerText:"mediaPickerCroppedRotated"};t.MediaPickerStatsLogger=class{constructor(){this.mediaByTypeAndOrigin=new Map,this.mediaEventReverseIndex=new Map,this.chatRecipients=null}pauseTimer(){this.mediaByTypeAndOrigin.forEach((e=>{e.onPause()}))}resumeTimer(){this.mediaByTypeAndOrigin.forEach((e=>{e.onResume()}))}_getKey(e,t){return`${e}_${t}`}_commitLog(e){new o.default.MediaPicker((0,i.default)((0,i.default)({},e),{},{chatRecipients:this.chatRecipients})).commit()}_processNewMedia(e,t,n){const r=this._getKey(t,n),i=this.mediaByTypeAndOrigin.get(r);if(i)i.onAdd(e),this.mediaEventReverseIndex.set(e,i);else{const i=new a.default(e,t,n);this.mediaByTypeAndOrigin.set(r,i),this.mediaEventReverseIndex.set(e,i)}}logChange(e,t){const n=this.mediaEventReverseIndex.get(e);n&&n.onChange(e,t)}logDelete(e){const t=this.mediaEventReverseIndex.get(e);t&&t.onDelete(e)}logSend(e){this.mediaByTypeAndOrigin.forEach((t=>{this._commitLog((0,i.default)((0,i.default)({},t.onSend()),{},{isViewOnce:e.isViewOnce}))}))}logCancel(){this.mediaByTypeAndOrigin.forEach((e=>{this._commitLog(e.onCancel())}))}logAdd(e,t,n){this.mediaEventReverseIndex.get(e)||this._processNewMedia(e,t,n)}}},571834:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=n(702011);const{BOOLEAN:o,INTEGER:s,NUMBER:l,STRING:u,TIMER:c}=a.TYPES,d=Object.freeze({ACTION_CLICKED_TOS:0,ACTION_CLICKED_LEARN_MORE:1,ACTION_CLICKED_START_PREMIUM:2,ACTION_CLICKED_MANAGE_SUBSCRIPTION:3,ACTION_VIEW_IMPRESSION_PREMIUM_HOME:4,ACTION_VIEW_IMPRESSION_MANAGE_SUBSCRIPTION_DIALOG:5,ACTION_CLICKED_ENTRY_POINT_TO_MANAGE_SUBSCRIPTION_FLOW:6,ACTION_CLICKED_USER_CANCELLED_PAYMENT_FLOW:7,ACTION_CLICKED_BILLING_FLOW_ENTRY_POINT:8,ACTION_VIEW_IMPRESSION_BILLING_FLOW_ENTRY_POINT:9,ACTION_CLICKED_RENEW_BUTTON:10,ACTION_CLICKED_ENTRY_POINT:11}),p=Object.freeze({MUTE:1,UNMUTE:2,EXPIRE:3}),_=Object.freeze({INVALID_PROTOCOL_BUFFER:1}),f=Object.freeze({ADV_SIGNED_DEVICE_IDENTITY:1,ADV_DEVICE_IDENTITY:2,ADV_SIGNED_KEY_INDEX_LIST:3,ADV_KEY_INDEX_LIST:4}),h=Object.freeze({NONE:1,SOFTWARE:2,BUILTIN:3}),g=Object.freeze({NONE:1,SOFTWARE:2,BUILTIN:3}),m=Object.freeze({LIMITED:0,FULL:1,LEGACY:2,LEVEL_3:3,EXTERNAL:4}),y=Object.freeze({API_1:1,API_2:2}),E=Object.freeze({NOT_AVAILABLE:1,SELF_TEST_FAILURE:2,ENC_KEY_READ_FAILURE:3,ENC_KEY_STORED_USED:4,ENC_KEY_PLAIN_DELETED:5,ENC_KEY_PLAIN_RECOVERED:6}),S=Object.freeze({DEBUG:1,ALPHA:2,BETA:3,RELEASE:4}),T=Object.freeze({FOREGROUND:1,BACKGROUND:2}),v=Object.freeze({JNI:1,OPENSLES:2}),A=Object.freeze({DEFAULT:0,SPEAKER:1,EARPIECE:2,BLUETOOTH:3,HEADSET:4}),C=Object.freeze({AUTO_MUTE_EXISTING_GROUP:1,AUTO_MUTE_GROWING_GROUP:2,AUTO_MUTE_NEW_GROUP:3,USER_DIALOG_VIEW:4,USER_ADMIT_BY_OK:5,USER_ADMIT_BY_MESSAGE_SEND:6,USER_DISMISS_BY_UNMUTE:7}),P=Object.freeze({AUTO_REPLY_ACTION_FLAG_RECEIVED:0,AUTO_REPLY_ACTION_REPLY_SENT:1}),O=Object.freeze({UNKNOWN:0,NON_DIRECT_PATH:1,EVERSTORE:2,OIL:3,EXPRESS_PATH:4,STATIC:5}),I=Object.freeze({WIFI_ONLY:0,WIFI_OR_CELLULAR:1}),M=Object.freeze({OFF:0,DAILY:1,WEEKLY:2,MONTHLY:3,MANUAL:4}),b=Object.freeze({SHOWN:1,CLICK:2,DISMISS:3,ELIGIBLE:4,REVOKED:5}),R=Object.freeze({GROUP:1,SMB_WELCOME:2,SMB_VERIFIED:3,SMB_EDIT_PROFILE:4,SMB_EDIT_DESCRIPTION:5,SMB_EDIT_CATEGORY:6,SMB_EDIT_HOURS:7,SMB_EDIT_EMAIL:8,SMB_CATALOG:9,SMB_CATALOG_SHARE_BANNER:10,CROSS_SELL_PROFILE_INTERSTITIAL:11,CROSS_SELL_CHATS_INTERSTITIAL:12,CROSS_SELL_CHATS_BANNER:13,BUSINESS_ACCOUNT_SYSTEM_MESSAGE:14,SMB_CATALOG_CART_INTERSTITIAL:15,PAYMENTS_ONBOARD_BANNER:16,SMB_DIRECTORY_UPSELL:17,SMB_CATALG_LIST_LWI_ADVERTISE_BANNER:18,SMB_LWI_AD_HUB_EDUCATIONAL_BANNER:19,SMB_COLLECTION_CREATION:20,SMB_AWAY_MESSAGE:21,SMB_GREETING_MESSAGE:22,PAYMENTS_INCENTIVE_BANNER:23,SMB_ADSCREATION_CONVERSATIONS_BANNER_WITH_VALID_PRODUCT:24,SMB_ADSCREATION_CONVERSATIONS_BANNER_WITHOUT_VALID_PRODUCT:25,SMB_MD_AWARENESS:26,BACKUP_QUOTA:27,SMB_ADD_COVER_PHOTO:28,PAYMENTS_MERCHANT_ONBOARDING_BANNER:29,SMB_PAYMENTS_MERCHANT_ACCOUNT_STATUS_BANNER:30,SMB_CTWA_AD_ACTION_BANNER:31,BIZ_INTEGRITY_WARNING_BANNER:32,SMB_CTWA_AUTO_LABEL_BANNER:33,SMB_UPDATE_CATEGORY_BANNER:34,SMB_PREMIUM_UPSELL_CHAT_BANNER:35,SMB_PREMIUM_SUBS_PAYMENT_FAILED_BANNER:36,SMB_PREMIUM_SUBS_UNINTENTIONAL_CANCELED_BANNER:37,SMB_CLICK_GET_PAID_ON_WA:38}),N=Object.freeze({SHOPS:0,NATIVE:1}),w=Object.freeze({UNKNOWN:1,SMB:2,ENT:3}),L=Object.freeze({OTHER:0,CHAT:1,PROFILE:2,BLOCK_LIST:3,TRIGGERED_BLOCK:4,ACCOUNT_INFO:5,CALL_LOG:6,OVERFLOW_MENU:7,GROUP_INFO:8,BLOCK_DIALOG:9,MESSAGE_MENU:10,MEDIA_VIEWER:11,OVERFLOW_MENU_BLOCK:12,ONE_TO_ONE_OLD_SPAM_BANNER_BLOCK:13,ONE_TO_ONE_SPAM_BANNER_BLOCK:14,BIZ_SPAM_BANNER_BLOCK:15,BLOCK_HEADER_CHAT:16,OVERFLOW_MENU_REPORT:17,ACCOUNT_INFO_REPORT:18,BIZ_OLD_SPAM_BANNER_BLOCK:19,CHAT_LIST_BLOCK:20,CHAT_LIST_NOINSUB_BLOCK:21,CHAT_LIST_CONTEXT_MENU_BLOCK:22,NOTIFICATION_BLOCK:23,ONE_TO_ONE_SPAM_BANNER_REPORT:24}),D=Object.freeze({BLOCK:0,UNBLOCK:1}),k=Object.freeze({OTHER:0,NO_LONGER_NEEDED:1,NO_SIGN_UP:2,SPAM:3,OFFENSIVE_MESSAGES:4,OTP_DID_NOT_REQUEST:5}),U=Object.freeze({REQUEST_BUILT:1,RESPONSE_RECEIVED:2,RESPONSE_PARSED_VALID:3,MISSING_KEYS_REQUESTED:4,MISSING_KEYS_RECEIVED:5,MUTATIONS_DECRYPTED:6,ABOUT_TO_APPLY_MUTATIONS:7,APPLIED_MUTATIONS:8,PUSHNAME_APPLIED:9,PUSHNAME_INVALID:10,ENTERED_RETRY_MODE:11}),G=Object.freeze({ACTION_CLICK:1,ACTION_MSG_SENT:2}),x=Object.freeze({FACEBOOK:1,INSTAGRAM:2,WHATSAPP:3,EXTERNAL:4}),B=Object.freeze({CLICK_TO_CHAT_LINK:1,MESSAGE_SHORT_LINK:2,QR_CODE:3,CUSTOM_LINK:4,CUSTOM_QR_CODE_LINK:5}),F=Object.freeze({STATUS:1,INDIVIDUAL_CHAT:2,GROUP:3,OTHER:4,OUTSIDE_OF_WA:5}),j=Object.freeze({INDIVIDUAL_CHAT:1,LANDING_PAGE:2,OTHER:3}),Y=Object.freeze({IMPRESSION:0,TAP_ON_MESSAGE:1,TAP_ON_PROFILE:2,TAP_ON_CATALOG_VIEW_ALL:3,TAP_ON_CATLOG_PRODUCT:4,DISMISS_PREVIEW:5}),K=Object.freeze({REGISTRATION:1,SETTINGS:2,COMPLIANCE:3,QUICK_REPLY_SMART_DEFAULT:4,WA_PAGES:5}),H=Object.freeze({DESCRIPTION:1,HOURS:2,ADDRESS:3,EMAIL:4,WEBSITE:5,CATEGORY:6,PROFILE:7}),W=Object.freeze({BUSINESS_PROFILE_VIEW_ACTION_IMPRESSION:1,BUSINESS_PROFILE_VIEW_ACTION_CLICK_WEBSITE:2,BUSINESS_PROFILE_VIEW_ACTION_CLICK_LOCATION:3,BUSINESS_PROFILE_VIEW_ACTION_CLICK_HOURS:4,BUSINESS_PROFILE_VIEW_ACTION_CLICK_DESCRIPTION:5,BUSINESS_PROFILE_VIEW_ACTION_CLICK_EMAIL:6,BUSINESS_PROFILE_VIEW_ACTION_CLICK_ADDTOCONTACT:7,BUSINESS_PROFILE_VIEW_ACTION_CLICK_MORE_BIZ_PROFILE:8}),V=Object.freeze({SOURCE_OTHER:1,SOURCE_INSTAGRAM:2}),$=Object.freeze({ENTRY_BANNER:0,ENTRY_REGISTRATION_ONBOARDING:1,ENTRY_CONVERSATIONS:2,ENTRY_SETTINGS:3,ENTRY_DEEPLINK:4,ENTRY_STATUS_TAB_MENU:5,ENTRY_CALLS_TAB_MENU:6,ENTRY_BUSINESS_TOOLS_TAB:7}),z=Object.freeze({OVERFLOW:0,PROFILE:1,CATALOG:2,AWAY_MESSAGE:3,GREETING_MESSAGE:4,QUICK_REPLIES:5,LABELS:6,LINKED_ACCOUNTS:7,SHORT_LINK:8,STATISTICS:9,CREATE_ACCOUNT_LINK:10,MANAGE_CTA:11,CREATE_AD:12,CONTINUE_PROMPT:13,ADVERTISE_LIST_ITEM:14,SHOPS:15,DISABLED_CATALOG:16,BANNED_SHOP:17,PREMIUM_TOOLS:18,BUSINESS_DIRECTORY:19}),q=Object.freeze({FACEBOOK:0,INSTAGRAM:1}),J=Object.freeze({PROMOTION_NOTIFICATION:1,MEMBER_LIST:2}),Q=Object.freeze({SUCCESS:1,FAILURE:2,CANCEL:3,RETRY_SUCCESS:4,RETRY_FAILURE:5,RETRY_CANCEL:6}),X=Object.freeze({CALLS_TAB_MISSED:1,CALLS_TAB_OUTGOING:2,SELECT_CONTACT:3,CALL_INFO:4,NOTIFICATION_MISSED:5,CONTACT_INFO:6,QUICK_CONTACT_INFO:7,CONVERSATION:8,CALLS_TAB_INCOMING:9,GROUP_CHAT_INFO:10,GROUP_CHAT_RECENT_LOCATION:11,ANDROID_BROADCAST_DETAILS:12,ANDROID_LIST_CHAT_INFO:13,ANDROID_CONTACTS_APPLICATION:14,CONTACT_VCARD:15,CALLS_TAB_NEW_CALL:16,VOICE_MAIL_CALL_BACK:17,IOS_INTENT:18,LIVE_LOCATION_MAP:19,GROUP_CALL_INFO:20,CALLS_TAB_BOTTOM_SHEET:21,STATUS_VIEWER:22,DEBUG_TOOL:23,GROUP_CHAT_PICKER:24,GROUP_CHAT_DIRECT:25,STELLA:26,CHAT_LIST:27,NEW_CHAT:28,CONVERSATION_OPTIONS:29,CALL_FAILED_SCREEN:30,BUSINESS_DIRECTORY:31,CALL_LINK:32,PHONE_NUMBER_LINK:33}),Z=Object.freeze({CELLULAR:1,WIFI:2,NONE:3}),ee=Object.freeze({UNBOUND:1,BINDED:2}),te=Object.freeze({INVALID:0,CONNECTED:1,REJECTED_BY_USER:2,REJECTED_BY_SERVER:3,MISSED:4,BUSY:5,SETUP_ERROR:6,SERVER_NACK:7,CALL_OFFER_ACK_NOT_RECEIVED:8,MISSED_NO_RECEIPT:9,ACCEPTED_BUT_NOT_CONNECTED:10,CALL_CANCELED_CELLULAR_IN_PROGRESS:11,CALL_CANCELED_AIRPLANE_MODE_ON:12,CALL_CANCELED_NO_NETWORK:13,CALL_OFFER_ACK_CORRUPT:14,CALL_REJECTED_TOS:15,CALL_REJECTED_E2E:16,CALL_REJECTED_UNAVAILABLE:17,CALL_CANCELED_OFFER_NOT_SENT:18,PEER_SETUP_ERROR:19,ACTIVE_ELSEWHERE:20,NO_DECRYPTED_OFFER:21,ACCEPTED_ELSEWHERE:22,REJECTED_ELSEWHERE:23,LONELY:24,CALL_IS_FULL:25}),ne=Object.freeze({UNKNOWN:1,CALL_ACCEPT_FAILED:2,INIT_MEDIA_STREAM_FAILED:3,START_MEDIA_STREAM_FAILED:4,AUDIO_INIT_ERROR:5,HANDLE_OFFER_FAILED:6,HANDLE_ACCEPT_FAILED:7,SOUND_PORT_CREATE_FAILED:8,P2P_TRANSPORT_CREATE_FAILED:9,P2P_TRANSPORT_MEDIA_CREATE_FAILED:10,INCOMPATIBLE_SRTP_KEY_EXCHANGE:11,SRTP_KEY_GENERATION_ERROR:12,UNSUPPORTED_AUDIO_CAPS:13,P2P_TRANSPORT_START_FAILED:14,RELAY_BIND_FAILED:15,CANNOT_INITIALIZE_AUDIO_RECORD_OBJECT:16,PEER_RELAY_BIND_FAILED:17,VIDEO_CAPTURE_INIT_FAILED:18,VIDEO_CAPTURE_START_FAILED:19,VIDEO_RENDER_INIT_FAILED:20,VIDEO_RENDER_START_FAILED:21,VIDEO_ENCODER_OPEN_FAILED:22,VIDEO_DECODER_OPEN_FAILED:23,VIDEO_STREAM_CREATE_FAILED:24,VIDEO_STREAM_SETUP_FAILED:25,PEER_SETUP_FAILED:26,HANDLE_PREACCEPT_FAILED:27}),re=Object.freeze({CALLER:1,CALLEE:2}),ie=Object.freeze({ENDED_BY_USER:1,TIMEOUT:2,RECONNECTING:3,ENDED_BY_SELF:4,ENDED_BY_PEER:5,VIDEO_ENCODER_FATAL_ERROR:6,VIDEO_DECODER_FATAL_ERROR:7,AUDIO_RECORD_FATAL_ERROR:8,CRASH:9,DETECT_IDENTITY_CHANGE:10,USER_INVISIBLE:11,RELAY_BIND_FAILED:12,SETUP_FAILED:13,ACCEPTED_ELSEWHERE:14,REJECTED_ELSEWHERE:15,GROUP_CALL_ENDED:16,CALL_IS_FULL:17,PHONE_PERMISSION_DENIED:18,USER_REMOVED:19,HEARTBEAT_TERMINATE:20}),ae=Object.freeze({TEST_VALUE:0}),oe=Object.freeze({UNKNOWN:0,P2P:1,UDP_RELAY:2,TCP_RELAY:3,MIXED:4}),se=Object.freeze({DISABLED:0,ENABLED:1,PAUSED:2,UPGRADE_REQUEST:3,MUTED:6,ERROR:20}),le=Object.freeze({NONE:0,UNKNOWN:1,APNS_PUSH:2,IOS_VOIP_PUSH:3,GCM_PUSH:4,ONLINE:5,RIM_PUSH:6,WNS_PUSH:7}),ue=Object.freeze({DEFAULT:0,TEXTURE:1,TEXTURE_FALLBACK:2}),ce=Object.freeze({DEFAULT:0,CONSERVATIVE:1,STRICT:2,ERROR:11}),de=Object.freeze({ACTION_PRODUCT_ADD_CLICKED:1,ACTION_PRODUCT_ADD_SUCCESS:2,ACTION_PRODUCT_ADD_FAILED:3,ACTION_PRODUCT_EDIT_CLICKED:4,ACTION_PRODUCT_EDIT_SUCCESS:5,ACTION_PRODUCT_EDIT_FAILED:6,ACTION_PRODUCT_DELETE_CLICKED:7,ACTION_PRODUCT_DELETE_SUCCESS:8,ACTION_PRODUCT_DELETE_FAILED:9,ACTION_APPEAL_PRODUCT_CLICKED:10,ACTION_APPEAL_PRODUCT_SUCCESS:11,ACTION_APPEAL_PRODUCT_FAILED:12,ACTION_CREATE_PRODUCT_CATALOG:13,ACTION_CREATE_PRODUCT_CATALOG_SUCCESS:14,ACTION_CREATE_PRODUCT_CATALOG_FAILED:15,ACTION_CATALOG_MENU_ITEM_CLICKED:16,ACTION_PRODUCT_RESUBMIT_CLICKED:17,ACTION_START_IMPORT_FLOW:18,ACTION_IMPORT_POST:19,ACTION_CARD_IMPRESSION:20,ACTION_CARD_ITEM_CLICK:21,ACTION_CARD_MORE_CLICK:22,ACTION_LIST_IMPRESSION:23,ACTION_LIST_ITEM_CLICK:24,ACTION_DETAIL_IMAGE_CLICK:25,ACTION_DETAIL_LINK_CLICK:26,ACTION_IMAGE_LIST_IMPRESSION:27,ACTION_IMAGE_LIST_CLICK:28,ACTION_FULL_IMAGE_IMPRESSION:29,ACTION_FULL_IMAGE_SWIPE:30,ACTION_DETAIL_IMPRESSION:31,ACTION_QUOTED_PRODUCT_IN_CONVERSATION_CLICK:32,ACTION_PRODUCT_IN_CONVERSATION_CLICK:33,ACTION_SEND_PRODUCT_MESSAGE:34,ACTION_ONBOARD_IMPRESSION:35,ACTION_SHARE_CATALOG_LINK_CLICK:36,ACTION_SHARE_PRODUCT_LINK_CLICK:37,ACTION_CATALOG_IN_CONVERSATION_CLICK:38,ACTION_SHARE_CATALOG_VIA_WA_LINK_CLICK:39,ACTION_SHARE_PRODUCT_VIA_WA_LINK_CLICK:40,ACTION_SHARE_CATALOG_COPY_LINK_CLICK:41,ACTION_SHARE_PRODUCT_COPY_LINK_CLICK:42,ACTION_SEND_CATALOG_CLICK:43,ACTION_ORDER_MESSAGE_CLICK:44,ACTION_ORDER_LIST_IMPRESSION:45,ACTION_ORDER_LIST_ITEM_CLICK:46,ACTION_MESSAGE_BUSINESS_BUTTON_CLICK:47,ACTION_QUOTED_PRODUCT_MESSAGE_SEND:48,ACTION_CART_ADD_PRODUCT:49,ACTION_CART_ICON_CLICK:50,ACTION_CART_SNACKBAR_CLICK:51,ACTION_CART_LIST_IMPRESSION:52,ACTION_CART_EDIT_PRODUCT:53,ACTION_CART_DELETE_PRODUCT:54,ACTION_CART_ABANDON:55,ACTION_SEND_ORDER_MESSAGE:56,ACTION_MENU_CLICK:57,ACTION_PRODUCT_HIDE_CLICKED:58,ACTION_PRODUCT_HIDE_SUCCESS:59,ACTION_PRODUCT_HIDE_CANCELLED:60,ACTION_PRODUCT_HIDE_FAILED:61,ACTION_PRODUCT_UNHIDE_CLICKED:62,ACTION_PRODUCT_UNHIDE_SUCCESS:63,ACTION_PRODUCT_UNHIDE_CANCELLED:64,ACTION_PRODUCT_UNHIDE_FAILED:65,ACTION_CATALOG_LIST_MENU_CLICKED:66,ACTION_CATALOG_LIST_MENU_CLICKED_WITH_ADVERTISE_SHOWN:67,ACTION_COLLECTION_CREATE_CLICKED:68,ACTION_COLLECTION_CREATED:69,ACTION_MENU_COLLECTIONS_CLICK:70,ACTION_COLLECTION_RENAME_CLICKED:71,ACTION_COLLECTION_RENAME_CANCELLED:72,ACTION_COLLECTION_RENAMED:73,ACTION_COLLECTION_DELETE_CLICKED:74,ACTION_COLLECTION_DELETE_CANCELLED:75,ACTION_COLLECTION_DELETED:76,ACTION_COLLECTION_ASSIGN_ITEMS:77,ACTION_COLLECTION_UNASSIGN_ITEMS:78,ACTION_COLLECTION_IMPRESSION:79,ACTION_COLLECTION_CHANGE_ORDER:80,ACTION_COLLECTION_ITEM_CHANGE_ORDER:81}),pe=Object.freeze({CATALOG_ENTRY_POINT_PROFILE:1,CATALOG_ENTRY_POINT_SETTINGS:2,CATALOG_ENTRY_POINT_MESSAGE:3,CATALOG_ENTRY_POINT_ATTACHMENT_PANEL:4,CATALOG_ENTRY_POINT_NUX:5,CATALOG_ENTRY_POINT_DEEPLINK:6,CATALOG_ENTRY_POINT_CHAT:7,CATALOG_ENTRY_POINT_ORDER_MESSAGE:8,CATALOG_ENTRY_POINT_INVOICE_ATTACHMENT_PANEL:9,CATALOG_ENTRY_POINT_PRODUCT_LIST_MESSAGE:10,CATALOG_ENTRY_POINT_TOP_BAR:11,CATALOG_ENTRY_POINT_PROFILE_ITEM_CLICK:12,CATALOG_ENTRY_POINT_PROFILE_SEE_ALL:13,CATALOG_ENTRY_POINT_QUOTED_PRODUCT:14,CATALOG_ENTRY_POINT_CATALOG_MESSAGE:15,CATALOG_ENTRY_QBM:16,CATALOG_ENTRY_POINT_ADS_DEEPLINK:17,CATALOG_ENTRY_POINT_WA_PAGES:18,CATALOG_ENTRY_POINT_DIRECTORY_BARE_TIPS:19}),_e=Object.freeze({ACTION_CARD_IMPRESSION:1,ACTION_CARD_ITEM_CLICK:2,ACTION_CARD_MORE_CLICK:3,ACTION_LIST_IMPRESSION:4,ACTION_LIST_ITEM_CLICK:5,ACTION_DETAIL_IMAGE_CLICK:6,ACTION_DETAIL_LINK_CLICK:7,ACTION_IMAGE_LIST_IMPRESSION:8,ACTION_IMAGE_LIST_CLICK:9,ACTION_FULL_IMAGE_IMPRESSION:10,ACTION_FULL_IMAGE_SWIPE:11,ACTION_DETAIL_IMPRESSION:12,ACTION_REPORT_PRODUCT:13,ACTION_SEND_PRODUCT_MESSAGE:14,ACTION_REPORT_PRODUCT_SUCCESS:15,ACTION_REPORT_PRODUCT_FAILURE:16,ACTION_QUOTED_PRODUCT_IN_CONVERSATION_CLICK:17,ACTION_PRODUCT_IN_CONVERSATION_CLICK:18,ACTION_SHARE_CATALOG_LINK_CLICK:19,ACTION_SHARE_PRODUCT_LINK_CLICK:20,ACTION_CATALOG_IN_CONVERSATION_CLICK:21,ACTION_SHARE_CATALOG_VIA_WA_LINK_CLICK:22,ACTION_SHARE_PRODUCT_VIA_WA_LINK_CLICK:23,ACTION_SHARE_CATALOG_COPY_LINK_CLICK:24,ACTION_SHARE_PRODUCT_COPY_LINK_CLICK:25,ACTION_CHAT_CATALOG_ICON_CLICK:26,ACTION_MESSAGE_BUSINESS_BUTTON_CLICK:27,ACTION_CART_ADD_PRODUCT:28,ACTION_CART_EDIT_PRODUCT:29,ACTION_CART_DELETE_PRODUCT:30,ACTION_CART_ABANDON:31,ACTION_CART_ICON_CLICK:32,ACTION_CART_SNACKBAR_CLICK:33,ACTION_SEND_ORDER_MESSAGE:34,ACTION_ORDER_LIST_IMPRESSION:35,ACTION_QUOTED_PRODUCT_MESSAGE_SEND:36,ACTION_CART_LIST_IMPRESSION:37,ACTION_ORDER_MESSAGE_CLICK:38,ACTION_ORDER_LIST_ITEM_CLICK:39,ACTION_PLM_CART_CTA_CLICK:40,ACTION_COLLECTION_IMPRESSION:41,ACTION_CART_CHAT_ICON_CLICK:42,ACTION_CREATE_CART:43}),fe=Object.freeze({CATEGORY_SCROLLING_CHIPS:1,ALL_CATEGORIES_PAGE:2,CATEGORY_PILLS:3}),he=Object.freeze({CONTACT:0,NON_CONTACT:1,GROUP:2}),ge=Object.freeze({ACTION_ASSIGNED:0,ACTION_UNASSIGNED:1,ACTION_REASSIGNED:2}),me=Object.freeze({INDIVIDUAL:0,GROUP:1,COMMUNITY:2}),ye=Object.freeze({CONVERSATION_OVERFLOW_MENU:0,CONTACT_INFO_SCREEN:1,MULTI_SELECT:2,SYSTEM_MESSAGE:3,CHAT_LIST_SWIPE:4}),Ee=Object.freeze({ATTACHMENT:1,CAMERA:2,PTT:3,PAYMENT:4,GIMMICK:5,PHONE:6,VIDEO:7,MESSAGE:8,CALL:9}),Se=Object.freeze({CLICK:1}),Te=Object.freeze({OPEN:1,SELECT_FILTER:2,SEARCH_WITH_FILTER:3,SEARCH:4,SEARCH_ITEM_SELECTED:5,SEARCH_MSG_SENT:6,UNSELECT_FILTER:7,AUTO_CLEAR_FILTER:8}),ve=Object.freeze({CHAT_LIST:0}),Ae=Object.freeze({NONE:0,OTHER_LABELS:1,UNREAD:2,GROUP:3,BROADCAST_LIST:4,NEW_CUSTOMER:5,NEW_ORDER:6,PENDING_PAYMENT:7,PAID:8,ORDER_COMPLETE:9,CONTACT:10,NON_CONTACT:11,PHOTOS:12,GIFS:13,LINKS:14,VIDEOS:15,DOCUMENTS:16,AUDIOS:17,ASSIGNED_TO_YOU:18}),Ce=Object.freeze({TOS3:1,COUNTRY:2}),Pe=Object.freeze({NO_NOTIFICATIONS_WHEN_MUTED:1,YES_NOTIFICATIONS_WHEN_MUTED:2}),Oe=Object.freeze({NOT_MUTED:1,MUTED_NO_NOTIFICATIONS:2,MUTED_SILENT_NOTIFICATIONS:3}),Ie=Object.freeze({CONTACT:0,CHAT:1,GROUP:2,BROADCAST_LIST:3,MESSAGE:4}),Me=Object.freeze({INDIVIDUAL:1,SMB:2,ENT:3}),be=Object.freeze({INBOX:1,ARCHIVED:2}),Re=Object.freeze({OUTSIDE_DIALOG_BOX:0,OK:1,LEARN_MORE:2}),Ne=Object.freeze({SMALL:1,MEDIUM:2,LARGE:3,EXTRA_LARGE:4,XX_LARGE:5,XXX_LARGE:6,LT1024:16,LT1500:7,LT2000:8,LT2500:9,LT3000:10,LT3500:11,LT4000:12,LT4500:13,LT5000:14,LARGEST_BUCKET:15}),we=Object.freeze({CLIENT_RENDERED:1,CLIENT_SAVED:2,CLIENT_WRITTEN_WIRE:3,CLIENT_QUEUED:4,CLIENT_WAITING_TO_ENCRYPT:5,CLIENT_READY_TO_SEND:6,CLIENT_ENCRYPT:7,CLIENT_PREKEYS_FETCH:8}),Le=Object.freeze({REGULAR:1,REGULAR_LOW:2,REGULAR_HIGH:3,CRITICAL_BLOCK:4,CRITICAL_UNBLOCK_LOW:5}),De=Object.freeze({COMMERCE_ACTION_CARD_IMPRESSION:1,COMMERCE_ACTION_CARD_ITEM_CLICK:2,COMMERCE_ACTION_CARD_MORE_CLICK:3,COMMERCE_ACTION_LIST_IMPRESSION:4,COMMERCE_ACTION_LIST_ITEM_CLICK:5,COMMERCE_ACTION_DETAIL_IMAGE_CLICK:6,COMMERCE_ACTION_DETAIL_LINK_CLICK:7,COMMERCE_ACTION_IMAGE_LIST_IMPRESSION:8,COMMERCE_ACTION_IMAGE_LIST_CLICK:9,COMMERCE_ACTION_FULL_IMAGE_IMPRESSION:10,COMMERCE_ACTION_FULL_IMAGE_SWIPE:11,COMMERCE_ACTION_DETAIL_IMPRESSION:12,COMMERCE_ACTION_REPORT_PRODUCT:13,COMMERCE_ACTION_SEND_PRODUCT_MESSAGE:14,COMMERCE_ACTION_REPORT_PRODUCT_SUCCESS:15,COMMERCE_ACTION_REPORT_PRODUCT_FAILURE:16,COMMERCE_ACTION_QUOTED_PRODUCT_IN_CONVERSATION_CLICK:17,COMMERCE_ACTION_PRODUCT_IN_CONVERSATION_CLICK:18,COMMERCE_ACTION_SHARE_CATALOG_LINK_CLICK:19,COMMERCE_ACTION_SHARE_PRODUCT_LINK_CLICK:20,COMMERCE_ACTION_CATALOG_IN_CONVERSATION_CLICK:21,COMMERCE_ACTION_SHARE_CATALOG_VIA_WA_LINK_CLICK:22,COMMERCE_ACTION_SHARE_PRODUCT_VIA_WA_LINK_CLICK:23,COMMERCE_ACTION_SHARE_CATALOG_COPY_LINK_CLICK:24,COMMERCE_ACTION_SHARE_PRODUCT_COPY_LINK_CLICK:25,COMMERCE_ACTION_CHAT_CATALOG_ICON_CLICK:26,COMMERCE_ACTION_CLICK_ON_MESSAGE_BUSINESS_BUTTON:27}),ke=Object.freeze({COMMERCE_ENTRY_POINT_PROFILE:1,COMMERCE_ENTRY_POINT_SETTINGS:2,COMMERCE_ENTRY_POINT_MESSAGE:3,COMMERCE_ENTRY_POINT_ATTACHMENT_PANEL:4,COMMERCE_ENTRY_POINT_NUX:5,COMMERCE_ENTRY_POINT_DEEPLINK:6,COMMERCE_ENTRY_POINT_CHAT:7,COMMERCE_ENTRY_POINT_ORDER_MESSAGE:8}),Ue=Object.freeze({COMMERCE_PERF_ENTRY_POINT_PROFILE:1,COMMERCE_PERF_ENTRY_POINT_SETTINGS:2,COMMERCE_PERF_ENTRY_POINT_PRODUCT_MESSAGE:3,COMMERCE_PERF_ENTRY_POINT_ATTACHMENT_PANEL:4,COMMERCE_PERF_ENTRY_POINT_CATALOG_PDP:5,COMMERCE_PERF_ENTRY_POINT_DEEPLINK:6,COMMERCE_PERF_ENTRY_POINT_CATALOG_HOME:7,COMMERCE_PERF_ENTRY_POINT_SHOPS_PDP:8,COMMERCE_PERF_ENTRY_POINT_PRODUCT_LIST_MESSAGE:9}),Ge=Object.freeze({COMMERCE_PERF_MARKER_START:1,COMMERCE_PERF_MARKER_CACHE_CONTENT:2,COMMERCE_PERF_MARKER_NETWORK_CONTENT:3,COMMERCE_PERF_MARKER_INTERACT:4}),xe=Object.freeze({COMMERCE_PERF_CATALOG_PDP:1,COMMERCE_PERF_CATALOG_HOME:2,COMMERCE_PERF_PROFILE_CATALOG:3,COMMERCE_PERF_SHOPS_PDP:4}),Be=Object.freeze({ENTER:1,GET_STARTED:2,DISMISS:3,NEXT:4,CREATE_GROUP:5,LINK_GROUP:6,CREATE_COMMUNITY:7,EXIT:8}),Fe=Object.freeze({CHATS_TAB:1,COMMUNITIES_TAB:2,COMMUNITY_NUX:3,COMMUNITY_INFO:4,COMMUNITY_GROUPS_SUMMARY:5,DEEP_LINK:6,BANNER:7,GROUP_INFO:8}),je=Object.freeze({ENTRY:1,GROUP_NAV:2,GROUP_ADD:3,COMMUNITY_NAV:4}),Ye=Object.freeze({SUBGROUP_SWITCH:1}),Ke=Object.freeze({PERSON:1,PUSH:2,OTHER:3,BACKOFF:4}),He=Object.freeze({HOSTNAME:0,IP4:1,IP6:2}),We=Object.freeze({CHATD:1,MMS:2}),Ve=Object.freeze({PROBLEM_DESCRIPTION:1,SUGGESTED_FAQ:2,EMAIL_SEND:3,IN_APP_FAQ:4,CANCELLED:5,FAQ:6}),$e=Object.freeze({CRASH:0,OOM:1,MAIN_THREAD_STALL_30_SECONDS:2,MAIN_THREAD_STALL_DEBUG:3,AUDIO_TRANSCODING_ERROR:4,VIDEO_TRANSCODING_ERROR:5,ANR:6,CRITICAL_EVENT:7,UNHANDLED_EXCEPTION:8,APP_CRASH:9,NATIVE_CRASH:10,UFAD:11}),ze=Object.freeze({NO_OTP_REQUEST_RECEIVED:0,OTP_REQUEST_EXPIRED:1,HASH_MISMATCH:2,NO_ACTIVITY_LISTENING_ON_THIRD_PARTY_APP:3,OTHER:4}),qe=Object.freeze({COPY_CODE:0,AUTOFILL:1}),Je=Object.freeze({JID:0,LID:1}),Qe=Object.freeze({FIRST_MESSAGE:0,DEEP_CONVERSATION:1,FIRST_BIZ_REPLY:2,FIRST_CALL:3,FIRST_LONG_CALL:4,SECOND_MESSAGE:5,SECOND_BIZ_REPLY:6,THIRD_MESSAGE:7,CART_RECEIVED:8,ORDER_CREATED:9}),Xe=Object.freeze({LAND_ON_WHATSAPP:1,GET_CONTEXT_CALL_INITIATED:2,GET_CONTEXT_CALL_SUCCESS:3,AD_CONTEXT_FALLBACK_RENDERED:4,AD_CONTEXT_DISMISSED:5,KILL_APP:6,BACK_BUTTON_CLICKED:7,CALL_BUSINESS_BUTTON_CLICKED:8,VIEW_CATALOG_BUTTON_CLICKED:9,PROFILE_PHOTO_CLICKED:10,BIZ_PROFILE_CLICKED:11,GET_CONTEXT_CALL_FAILED:12,CHAT_SETTINGS_CLICKED:13,FIRST_CUSTOM_MESSAGE_SENT_WITH_AD_CONTEXT:14,FIRST_CUSTOM_MESSAGE_SENT_WITHOUT_AD_CONTEXT:15,ICEBREAKER_SENT:16,AD_CONTEXT_FULLPREVIEW_RENDERED:17,TRUST_BANNER_SHOWN:18,TRUST_BANNER_DISMISSED:19,CTWA_ADD_CONTACT_DIALOG_OPEN:20,CTWA_ADD_CONTACT_CREATE_NEW:21,CTWA_ADD_CONTACT_EXISTING:22,CTWA_ARCHIVE_THREAD:23,CTWA_DELETE_THREAD:24}),Ze=Object.freeze({MSG_SENT:1}),et=Object.freeze({DEEP_LINK_EXTERNAL:1,DEEP_LINK_WA_LINK_CLICK:2,QR_CODE_SHEET:3,DEEP_LINK_BANNER:4,DEEP_LINK_SMB_NOTIFICATION:5}),tt=Object.freeze({DEEP_LINK_UNKNOWN:1,DEEP_LINK_CHAT:2,DEEP_LINK_CONTACT_QR_CODE:3,DEEP_LINK_PAYMENT:4,DEEP_LINK_PRODUCT:5,DEEP_LINK_CATALOG:6,DEEP_LINK_FUTURE_PROOF:7,DEEP_LINK_GROUP_INVITE:8,DEEP_LINK_MSG_FORWARD:9,DEEP_LINK_MESSAGE_QR_CODE:10,DEEP_LINK_OPT_IN_QR_CODE:11,DEEP_LINK_CTWA:12,DEEP_LINK_STICKERPACK:13,DEEP_LINK_NOVI_HUB:14,DEEP_LINK_NOVI_ADD_DEBIT_CARD:15,DEEP_LINK_NOVI_ADD_BANK_ACCOUNT:16,DEEP_LINK_NOVI_WITHDRAW:17,DEEP_LINK_NOVI_RESET_PASSWORD:18,DEEP_LINK_PAYMENT_SIGNUP:19,DEEP_LINK_BIZTOOLS_ACCOUNTS:20,DEEP_LINK_PAYMENT_VIRALITY:21,DEEP_LINK_SETTINGS_ACCOUNT_DELETE:22,DEEP_LINK_SETTINGS_ACCOUNT_REQUEST_INFO:23,DEEP_LINK_SETTINGS_CHATS_HISTORY:24,DEEP_LINK_DISAPPEARING_MODE:25,DEEP_LINK_ARCHIVE_SETTINGS:26,DEEP_LINK_TOS:27,DEEP_LINK_NOVI_CARE:28,DEEP_LINK_NOVI_TPP_ACCOUNT_LINKING:29,DEEP_LINK_CONTACT_SUPPORT:30,DEEP_LINK_BIZTOOLS_DIRECTORY:31,DEEP_LINK_DIRECTORY:32,DEEP_LINK_CALL:33,DEEP_LINK_DIRECTORY_DEEPER_CATEGORY_SELECTION:34,DEEP_LINK_PHOENIX:35,DEEP_LINK_HELP_CENTER_TO_SETTINGS_CHATS:36,DEEP_LINK_CREATE_COMMUNITY:37,DEEP_LINK_SMB_AD_CREATION:38,DEEP_LINK_SMB_MANAGE_ADS:39,DEEP_LINK_SMB_MANAGE_ADS_DETAIL:40,DEEP_LINK_STATUS_SHARE:41,DEEP_LINK_PREMIUM:42,DEEP_LINK_SETTINGS_LINKED_DEVICES:43,DEEP_LINK_SMB_AD_CREATION_FROM_CATALOG:44}),nt=Object.freeze({DELETE_FOR_ME:0,DELETE_FOR_EVERYONE:1}),rt=Object.freeze({APP_SWITCH:1,BROWSER:2,CANCELLED:3}),it=Object.freeze({PRIMARY:1,COMPANION:2}),at=Object.freeze({CHAT:1,INITIATED_BY_ME:2,INITIATED_BY_OTHER:3,CHAT_PICKER:4}),ot=Object.freeze({ACCOUNT_SETTINGS:1,SYSTEM_MESSAGE:2,INDIVIDUAL_CHAT_DISAPPEARING_MESSAGES_SETTING:3,GROUP_CHAT_DISAPPEARING_MESSAGES_SETTING:4,DEEP_LINK:5,STORAGE_SETTINGS:6,PRIVACY_SETTINGS:7}),st=Object.freeze({DEFAULT_MESSAGE_TIMER_OPEN:1,DEFAULT_MESSAGE_TIMER_SET:2,DEFAULT_MESSAGE_TIMER_EXIT:3,LEARN_MORE_CLICK:4}),lt=Object.freeze({DEFAULT_MODE_SETTING:0,STORAGE_SETTING:1,PRIVACY_SETTING:2}),ut=Object.freeze({CHAT_PICKER_LINK_IMPRESSION:0,CHAT_PICKER_TRAY_OPEN:1,CHAT_PICKER_TRAY_EXIT:2,CHAT_PICKER_CHATS_SELECTED:3}),ct=Object.freeze({STORAGE_SETTING:0,PRIVACY:1,DM_TIMER_SCREEN:2,CHAT_PICKER_SCREEN:3}),dt=Object.freeze({CHAT_PERSONAL:1,CHAT_GROUP:2,STATUS_USER:3,STATUS_ADS:4,PRODUCT_CATALOG:5,GDPR:6,STICKER_PICKER:7,PROFILE_PICTURE:8,BLOKS:9,P2B:10,MESSAGE_HISTORY_SYNC:11}),pt=Object.freeze({NORMAL_QUALITY:1,MID_QUALITY:2,INELIGIBLE_IMAGE_TOO_SMALL:3,INELIGIBLE_PARTIAL_HASHES_NOT_FOUND:4,ERROR_DETERMINING_ELIGIBILITY:5,NOT_DOWNLOADED_ENOUGH_BYTES_TO_DETERMINE_ELIGIBILITY:6}),_t=Object.freeze({INVALID_SENDER:1,MISSING_DSM:2,INVALID_DSM:3}),ft=Object.freeze({MESSAGE:0,PREKEY_MESSAGE:1,SENDER_KEY_MESSAGE:2}),ht=Object.freeze({INDIVIDUAL:0,GROUP:1,LIST:2,STATUS:3}),gt=Object.freeze({INVALID_MESSAGE:0,LEGACY_MESSAGE:1,INVALID_VERSION:2,PRE_KEY_MESSAGE_MISSING_PRE_KEY:3,PRE_KEY_MESSAGE_INVALID_KEY:4,UNTRUSTED_IDENTITY:5,NO_SESSION_AVAILABLE:6,PLAINTEXT_BYTE_MISMATCH:7,UNKNOWN_CIPHERTEXT_TYPE:8,UNKNOWN_CIPHERTEXT_VERSION:9,INVALID_PADDING:10,INVALID_PROTOCOL_BUFFER:11,INVALID_NUMBER_OF_MESSAGE_TYPES:12,INVALID_IMAGE_FILE_LENGTH:13,INVALID_IMAGE_FILE_SHA256:14,INVALID_IMAGE_MEDIA_URL:15,INVALID_IMAGE_MEDIA_KEY:16,INVALID_IMAGE_MIME_TYPE:17,UNKNOWN_V2_TAGS:18,INVALID_EDIT_VERSION:19,INVALID_HSM_NAMESPACE:20,INVALID_HSM_ELEMENT:21,UNKNOWN_PROTOCOL_MESSAGE_TYPE:22,DUPLICATE_MESSAGE:23,FINGERPRINT_IDENTITY_MISMATCH:24,FINGERPRINT_VERSION_MISMATCH:25,INVALID_ARGUMENT:26,INVALID_KEY:27,INVALID_KEY_ID:28,INVALID_MAC:29,NO_MEMORY:30,STALE_KEY_EXCHANGE:31,VRF_SIGNATURE_VERIFICATION_FAILED:32,ERROR_MINIMUM_VALUE:33,ERROR_UNKNOWN:34,INVALID_BROADCAST_STANZA_ATTRIBUTE:35,INVALID_LIST_REPLY_MESSAGE:36,INVALID_LIST_REPLY_ROW_IDENTIFIER:37,INVALID_BUTTONS_RESPONSE_MESSAGE:38,INVALID_BUTTONS_RESPONSE_BUTTON_IDENTIFIER:39,INVALID_ORDER_MESSAGE:40,ERROR_CANCELLED:41,FUTURE_MESSAGE:42,INVALID_EMPTY_PROTOBUF_NOT_ALLOWED:43,SELF_SEND:44,INVALID_MEDIA_MIME_TYPE_TEMPLATE_MESSAGE:45,INVALID_MEDIA_ENC_HASH:46,INVALID_IDENTITY:47,PASSTHROUGH:48,NOT_IN_PENDING_DEVICES:49,EDIT_TYPE_AND_PROTOCOL_MISMATCH:50,DECRYPTION_FAILED:51,DESERIALIZE_INVALID_PROTO_FORMAT:52,DESERIALIZE_RATCHET_KEY_BAD_FORMAT:53,DESERIALIZE_PK_INVALID_PROTO_FORMAT:54,DESERIALZE_PK_KEY_BAD_FORMAT:55,TOO_MANY_MESSAGES_IN_FUTURE:56,EMPTY_VERSION_CONTENT_SUFFIX:57,CONTENT_EXCEEDED_EXPECTED_LENGTH:58,GRP_INVALID_PROTO_FORMAT:59,GRP_INVALID_KEY_FORMAT:60,GRP_VERSION_CONTENT_EMPTY:61,GRP_INVALID_VERSION_CONTENT_LENGTH:62,GRP_SENDER_KEY_INVALID_PROTO_FORMAT:63,GRP_SENDER_KEY_PROTO_ERROR:64,GRP_TOO_MANY_MESSAGES_IN_FUTURE:65,MISSING_MESSAGE_SECRET:66,MESSAGE_SECRET_INVALID:67,INVALID_REACTION_TEXT:68,UNSUPPORTED_MESSAGE_TYPE:69}),mt=Object.freeze({MY_PRIMARY:1,OTHER_PRIMARY:2,MY_COMPANION:3,OTHER_COMPANION:4}),yt=Object.freeze({B1:1,B4:2,B8:3,B16:4,B32:5,B64:6,B128:7,B256:8,B512:9,B1000:10,B1500:11,B2000:12,B2500:13,B3000:14,B3500:15,B4000:16,B4500:17,B5000:18,NULL:19}),Et=Object.freeze({ACTION_OPEN:1,ACTION_SAVE:2,ACTION_DISCARD:3,ACTION_PROFILE_FIELD_OPEN:4,ACTION_PROFILE_FIELD_SAVE:5,ACTION_PROFILE_FIELD_DISCARD:6,ACTION_FACEBOOK_ENABLED:7,ACTION_FACEBOOK_DISABLED:8,ACTION_INSTAGRAM_ENABLED:9,ACTION_INSTAGRAM_DISABLED:10,ACTION_FB_IG_POP_SHOWN:11,ACTION_EDIT_COVER_PHOTO_CLICK:12,ACTION_REMOVE_COVER_PHOTO:13,UPGRADE_TO_CUSTOM_LINK_CLICK:14}),St=Object.freeze({CALL_TOO_SHORT:1}),Tt=Object.freeze({FIRST_MESSAGE:0,DEEP_CONVERSATION:1,FIRST_BIZ_REPLY:2,SECOND_MESSAGE:3,SECOND_BIZ_REPLY:4,THIRD_MESSAGE:5}),vt=Object.freeze({CHAT_INFO:1,SYSTEM_MESSAGE:2,CHAT_OVERFLOW:3,CHAT_PICKER:4,EPHEMERAL_NUX:5,CHAT_PICKER_DISAPPEARING_MODE_TIMER:6,CHAT_PICKER_STORAGE_SETTING:7}),At=Object.freeze({ROOM_OPEN_FAILURE:1,UNKNOWN_ERROR:2}),Ct=Object.freeze({ERROR_FETCHING_AGENT_NAME:0,ERROR_FETCHING_CHAT:1,ERROR_OTHER:2}),Pt=Object.freeze({USER_LEAVE:1,DEVICE_UNPAIR:2,IDENTITY_CHANGE:3,AUDIENCE_CHANGE:4,PERIODIC_ROTATION:5,KEY_CORRUPTION:6,PEER_COMPANION_UNPAIR:7,OTHER_DEVICE_UNPAIR:8}),Ot=Object.freeze({BOTH:1,SELF:2,PEER:3}),It=Object.freeze({SHOW:1,LOGOUT:2,UPGRADE:3}),Mt=Object.freeze({NEW:0,RETAINED:1,RESURRECTED:2}),bt=Object.freeze({GIPHY:0,TENOR:1}),Rt=Object.freeze({GET_CATALOG:1,GET_PRODUCT:2,GET_PRODUCT_LIST:3,GET_COLLECTIONS:4,GET_SINGLE_COLLECTION:5,GET_CATEGORIES:6}),Nt=Object.freeze({SUCCESS:1,FAILURE:2}),wt=Object.freeze({ADMINS_ONLY:1,ALL_PARTICIPANTS:2}),Lt=Object.freeze({MEMBERSHIP_REQUEST_CREATE:1,VIEW_PENDING_PARTICIPANTS:2}),Dt=Object.freeze({CHANGE_PROFILE_PHOTO:1,TAP_ACTION_ITEM_TAKE_PHOTO:2,TAP_ACTION_ITEM_VIEW_PHOTO:3,TAP_ACTION_ITEM_EMOJI_STICKER:4,TAP_ACTION_ITEM_UPLOAD_PHOTO:5,TAP_ACTION_ITEM_REMOVE_PHOTO:6,TAP_ACTION_ITEM_WEB_SEARCH:7,EMOJI_PANEL_OPEN:8,STICKER_PANEL_OPEN:9,PROFILE_PIC_UPDATED:10}),kt=Object.freeze({REGULAR_GROUP:1,SUB_GROUP:2,DEFAULT_SUB_GROUP:3,PARENT_GROUP:4}),Ut=Object.freeze({GOLDEN_BOX_CONTACT:0,GOLDEN_BOX_GROUP:1,GOLDEN_BOX_BROADCAST:2,INFO_SCREEN_CONTACT:3,INFO_SCREEN_GROUP:4,INFO_SCREEN_BROADCAST:5,CALLS_LIST:6,CHATS_LIST:7,STATUS_LIST:8,LINKED_DEVICES_SCREEN:9,CALLING_SCREEN_AUDIO:10,CALLING_SCREEN_VIDEO:11}),Gt=Object.freeze({NONE:1,BANNERS:2,ALERTS:3}),xt=Object.freeze({INCOMING_CALL_SCREEN_ANSWER:1,INCOMING_CALL_SCREEN_REJECT:2,INCOMING_CALL_NOTIFICATION_ANSWER:3,INCOMING_CALL_NOTIFICATION_REJECT:4,PENDING_CALL_SCREEN_END_AND_ANSWER:5,PENDING_CALL_SCREEN_HOLD_AND_ANSWER:6,PENDING_CALL_SCREEN_REJECT:7,INCOMING_CALL_REMOTE_ANSWER:8,INCOMING_CALL_REMOTE_REJECT:9,PENDING_CALL_NOTIFICATION_END_AND_ANSWER:10,PENDING_CALL_NOTIFICATION_REJECT:11}),Bt=Object.freeze({DEFAULT:0,PROBING_ROTT_TO_RELAY:1,PROBING_E2E_PEER_RX:2,PROBING_E2E_RX:3,HIS_RECENT_PEER_RX:4,HIS_RECENT_RX:5,HIS_RECENT_PROBING_ROTT_TO_RELAY:6,HIS_RECENT_PROBING_E2E_PEER_RX:7,HIS_RECENT_PROBING_E2E_RX:8,ONE_SIDE_INITIAL_BANDWIDTH_ESTIMATION:9}),Ft=Object.freeze({LOGO:1,MUSIC:2,AUTHOR:3,WATCH_MORE_END:4}),jt=Object.freeze({FACEBOOK:1,FACEBOOK_WATCH:2,INSTAGRAM:3,YOUTUBE:4,STREAMABLE:5,NETFLIX:6,LASSO:7,SHARECHAT:8}),Yt=Object.freeze({USER_START:0,USER_CANCEL:1,FLOW_SUCCESS:2,FLOW_ERROR:3,USER_VIEW:4,USER_PAY_NOW:5,USER_VIEW_BASKET:6,CLICK_PAYMENT_DETAILS:7,CLICK_MESSAGE_BUSINESS:8,MODIFY_PAYMENT_METHOD:9,CONFIRM_PAYMENT_METHOD:10,USER_VIEW_SUMMARY:11,USER_PAY_NOW_QUICK_BUY:12,USER_SEND_PAYMENT:13,USER_SEND_PAYMENT_QUICK_BUY:14,CLICK_HELP:15,CLICK_ORDER_SUMMARY:16,USER_CONFIRM:17,CLICK_REPORT_THIS_TRANSACTION:18}),Kt=Object.freeze({KEEP_MESSAGE:1,UNKEEP_MESSAGE:2,VIEW_KEPT_MESSAGES:3,SEARCH_RESULTS_DISPLAY:4,SEARCH_RESULTS_TAP:5}),Ht=Object.freeze({KEEP_MESSAGE:1,UNKEEP_MESSAGE:2}),Wt=Object.freeze({SENDER:1,RECIPIENT:2}),Vt=Object.freeze({CHAT_INFO:1,SEARCH:2,CHAT:3,MEDIA:4,DOCS:5,LINKS:6}),$t=Object.freeze({NONE:1,MESSAGE_MISSING:2,MESSAGE_REVOKED:3,SENDER_UNKEPT:4,OLDER_REQUEST:5,ORPHAN_EXPIRED:6,TIE_BREAK_IGNORED:7,MESSAGE_EXPIRED:8,NO_PERMISSION_TO_EDIT:9,MESSAGE_FROM_EX_MEMBER:10,OFFLINE:11,SENDER_DISABLED:12,KEPT_BEYOND_EXPIRY:13,NOT_PART_OF_THE_GROUP:14,CONTACT_BLOCKED:15,UNKNOWN:999}),zt=Object.freeze({FIRST_DM_NUX_IMPRESSION:1,KIC_NUX_IMPRESSION:2,KIC_NUX_LEARN_MORE_TAP:3,KIC_SYSTEM_MESSAGE_GENERATE:4}),qt=Object.freeze({KEEP:1,UNKEEP:2}),Jt=Object.freeze({ADD:1,EDIT:2,DELETE:3,VIEW:4,CLICK_POSITIVE:5,CLICK_NEGATIVE:6,UPDATE_LABEL_COUNT:7,AUTO_ADDED:8}),Qt=Object.freeze({LABEL:1,MESSAGE:2,CONTACT:3,LABELS_SCREEN:4,LABEL_DETAILS_SCREEN:5,EDIT_LABEL_DIALOG:6,DELETE_LABEL_DIALOG:7,LABEL_MESSAGE_DIALOG:8,LABEL_CHAT_DIALOG:9,ADD_LABEL_DIALOG:10,BULK_UNLABEL_DIALOG:11,LABEL_COMBINED_DIALOG:12,GROUP:13,BROADCAST:14}),Xt=Object.freeze({MESSAGE_SYNCING:1,SYNC_COMPLETE_CHECK_PHONE:2}),Zt=Object.freeze({TRUE:1,FALSE:2,NOT_DETERMINED:3,RESTRICTED:4,DENIED:5,ALWAYS:6,WHEN_IN_USE:7,UNKNOWN:8}),en=Object.freeze({TRUE:1,FALSE:2,NOT_DETERMINED:3,RESTRICTED:4,DENIED:5,ALWAYS:6,WHEN_IN_USE:7,UNKNOWN:8}),tn=Object.freeze({CURRENT_LOCATION_SENT:1,CUSTOM_LOCATION_SENT:2,PLACE_SENT:3,NO_LOCATION_SENT:4}),nn=Object.freeze({OK:1,ERROR_UNKNOWN:2,SERVER_ERROR:3,SERVER_GOAWAY:4,NETWORK_ERROR:5,ANDROID_KEYSTORE_ERROR:6}),rn=Object.freeze({RECEIVED:1,READ:2,CLICKED:3}),an=Object.freeze({APP_STATE_SYNC_KEY_EXPIRY:1,DEVICE_DEREGISTERATION:2,NO_KEYS:3}),on=Object.freeze({INITIAL:1,RECENT_HISTORY:2,FULL_HISTORY:3,PUSHNAME:4,STATUS_V3:5,NON_BLOCKING_DATA:6}),sn=Object.freeze({CRITICAL:1,NON_CRITICAL:2}),ln=Object.freeze({APP_STATE:1,HISTORY:2}),un=Object.freeze({SUCCESS:1,FAILURE:2}),cn=Object.freeze({ASSIGNED:0,UNASSIGNED:1}),dn=Object.freeze({GROUP:0,BROADCAST_LIST:1,INDIVIDUAL:2,COMMUNITY:3}),pn=Object.freeze({ACTION_SYSTEM_MESSAGE_ADDED_TO_CHAT_HISTORY:0,ACTION_SYSTEM_MESSAGE_CREATION_ERROR:1,ACTION_SYSTEM_MESSAGE_RENDERED:2,ACTION_CHAT_STATUS_TICKER_SHOWN:3,ACTION_TOOLTIP_SHOWN:4}),_n=Object.freeze({NONE:0,BOOTSTRAP:1}),fn=Object.freeze({PIN_MUTATION:1,UNPIN_4TH_CHAT_MUTATION:2,DELETE_MUTATION:3,CLEAR_CHAT_REMOVE_STARRED_MUTATION:4,CLEAR_CHAT_KEEP_STARRED_MUTATION:5}),hn=Object.freeze({PAIR_SUCCESS_RECEIVED:1,PAIR_DEVICE_SIGN_SENT:2,FIRST_CONNECT:3,UPLOAD_PREKEYS:4,COMPLETE:5}),gn=Object.freeze({INITIAL_SYNC:1,RESUME_SYNC:2,REGULAR_SYNC:3}),mn=Object.freeze({MESSAGE_RANGE_UNSET:1,MESSAGE_RANGE_LAST_SYSTEM_MESSAGE_TIMESTAMP_SET:2,MESSAGE_RANGE_MESSAGES_UNSET:3,MESSAGE_RANGE_MESSAGES_EMPTY:4,MESSAGE_RANGE_MESSAGES_CROSS_LIMIT:5,MESSAGE_RANGE_MESSAGE_KEY_UNSET:6,MESSAGE_RANGE_MESSAGE_KEY_REMOTE_JID_UNSET:7,MESSAGE_RANGE_MESSAGE_KEY_FROM_ME_UNSET:8,MESSAGE_RANGE_MESSAGE_KEY_STANZA_ID_UNSET:9,MESSAGE_RANGE_MESSAGE_KEY_REMOTE_JID_INVALID:10,MESSAGE_RANGE_MESSAGE_KEY_PARTICIPANT_UNSET:11,MALFORMED_PENDING_MUTATION:12,ACTION_INVALID_INDEX_DATA:13,MISSING_MUTATION_TO_REMOVE:14,LTHASH_INCONSISTENCY_ON_DAILY_CHECK:15,LTHASH_INCONSISTENCY_ON_SNAPSHOT_MAC_MISMATCH:16}),yn=Object.freeze({TOO_MANY_INTERNAL_SERVER_ERRORS_IN_7D:1,SERVER_DATA_MISMATCH:2,PROTOBUF_DESERIALIZATION_FAILED:3,EXTERNAL_PATCH_EXPIRED:4,MISSING_OR_EMPTY_INDEX:5,SAME_INDEX_FOR_MULTIPLE_MUTATIONS_IN_PATCH:6,DECRYPTION_FAILED:7,MISSING_PATCH_VERSION:8,DUPLICATE_PATCH_VERSION_IN_COLLECTION:9,ENCRYPTION_FAILED:10,MISSING_MUTATION_VERSION:11,MISSING_MUTATION_VALUE:12,INVALID_MUTATION_INDEX:13,PATCH_WITH_BOTH_INLINE_AND_EXTERNAL_MUTATIONS:14,MISSING_MUTATION_OPERATION:15,MISSING_MUTATION_RECORD:16,MISSING_MUTATION_KEY_ID:17,PATCH_PROTOBUF_DESERIALIZATION_FAILED:18,ACTION_DATA_PROTOBUF_DESERIALIZATION_FAILED:19,MISSING_MUTATION_INDEX:20,MISSING_ACTION_INDEX:21,INVALID_ACTION_INDEX:22,MISSING_ACTION_VALUE:23,MISSING_ACTION_VERSION:24,MISSING_ACTION_TIMESTAMP:25,MUTATIONS_PROTOBUF_DESERIALIZATION_FAILED:26,MUTATIONS_PROTOBUF_SERIALIZATION_FAILED:27,PATCH_PROTOBUF_SERIALIZATION_FAILED:28,ACTION_DATA_PROTOBUF_SERIALIZATION_FAILED:29,MISSING_KEY_ON_ALL_CLIENTS:30,TIMEOUT_WHILE_WAITING_FOR_MISSING_KEY:31,MAC_MISMATCH_SNAPSHOT:33,MAC_MISMATCH_PATCH:34,DB_STORE_NOT_READY:35,TERMINAL_PATCH_MISSING_DATA:36,TERMINAL_PATCH_DESERIALIZATION_ERROR:37,TERMINAL_PATCH_UNKNOWN:38,CYCLIC_MUTATION_DEPENDENCY_IN_PATCH:39,MISSING_SNAPSHOT_VERSION:45,MISSING_SNAPSHOT_MAC:46,MISSING_PATCH_SNAPSHOT_MAC:47,MISSING_PATCH_MAC:48,MISSING_EXTERNAL_BLOB_REFERENCE_MEDIA_KEY:49,MISSING_EXTERNAL_BLOB_REFERENCE_DIRECT_PATH:50,MISSING_EXTERNAL_BLOB_REFERENCE_FILE_SHA256:51,MISSING_EXTERNAL_BLOB_REFERENCE_FILE_ENC_SHA256:52,INVALID_KEY_SHARE_KEY_ID:53,MISSING_PATCH_KEY_ID:56,INVALID_KEY_SHARE_KEY_DATA:57,SNAPSHOT_EXPIRED:58,MISSING_SNAPSHOT_KEY_ID:59,SNAPSHOT_MAC_MISMATCH_IN_PATCH:60,SNAPSHOT_MAC_MISMATCH_IN_SNAPSHOT:61,XMPP_BAD_REQUEST_FOR_COLLECTION:62,XMPP_NOT_FOUND_FOR_COLLECTION:63,XMPP_BAD_REQUEST_GLOBAL_ERROR:64,XMPP_NOT_FOUND_GLOBAL_ERROR:65,XMPP_BAD_METHOD_GLOBAL_ERROR:66,XMPP_NOT_ACCEPTABLE_GLOBAL_ERROR:67,SAME_INDEX_FOR_MULTIPLE_MUTATIONS_IN_SNAPSHOT:68,EXTERNAL_BLOB_REFERENCE_PROTOBUF_DESERIALIZATION_FAILED:69,SNAPSHOT_PROTOBUF_DESERIALIZATION_FAILED:70,REQUESTING_MISSING_KEY_WITH_NO_CLIENTS:71,DB_STORE_NOT_READY_LOW_DISK_SPACE:72,SERVER_DID_NOT_SEND_ALL_PATCHES:73,SERVER_SENT_EARLIER_PATCH:74,MISSING_KEY_FOR_MUTATION_IN_LOCAL_SNAPSHOT:75,MISSING_ACTIVE_KEY_AFTER_ROTATION:76,MISSING_ACTIVE_KEY_FOR_ENCRYPTION:77,MISSING_CURRENT_EPOCH_FOR_ACTIVE_KEY_VALIDATION:78,SAME_INDEX_FOR_MULTIPLE_MUTATIONS_IN_OUTGOING_PATCH:79,INVALID_SNAPSHOT_RECORDS:80,MISSING_EXTERNAL_BLOB_REFERENCE_HANDLE:81,INVALID_EXTERNAL_BLOB_REFERENCE_UPLOADED:82,INVALID_PATCH_KEY_ID_SIZE:83,INVALID_PATCH_MAC_SIZE:84,INVALID_PATCH_SNAPSHOT_MAC_SIZE:85,INVALID_COLLECTION_SNAPSHOT_HASH_SIZE:86,MISSING_COLLECTION_SNAPSHOT_HASH:87,INVALID_PATCH_KEY_ID_DEVICE_ID:88,INVALID_PATCH_KEY_ID_EPOCH:89,DECRYPTION_FAILED_KEY_ID_MISMATCH:90,DECRYPTION_FAILED_VALUE_MAC_MISMATCH:91,DECRYPTION_FAILED_INDEX_MAC_MISMATCH:92,EXTERNAL_PATCH_MISSING_BLOB:93,COLLECTION_PULL_REQUEST_RECEIVED_PUSH_RESPONSE_WITH_UPDATED_VERSION:94,COLLECTION_PUSH_REQUEST_RECEIVED_RESPONSE_WITH_VERSION_MISMATCH:95,MMS_ERROR_INVALID_FILEHASH:96,UNKNOWN:97,MALFORMED_MUTATION_CLEAR_CHAT:98,MALFORMED_MUTATION_DELETE_CHAT:99,FAILED_MUTATION_CLEAR_CHAT:100,FAILED_MUTATION_DELETE_CHAT:101,CHAT_DB_CORRUPTION:102}),En=Object.freeze({SNAPSHOT:1,EXTERNAL_PATCH:2,INLINE_PATCH:3}),Sn=Object.freeze({SYNCD:1,WEB:2}),Tn=Object.freeze({BROWSER:1,DESKTOP:2}),vn=Object.freeze({MANUAL:1,FULL:2,PREFETCH:3,HEADER:4,THUMBNAIL:5,EXPRESS_PATH_DOWNLOAD:6}),An=Object.freeze({OK:1,ERROR_UNKNOWN:2,ERROR_TIMEOUT:3,ERROR_DNS:4,ERROR_INSUFFICIENT_SPACE:5,ERROR_TOO_OLD:6,ERROR_CANNOT_RESUME:7,ERROR_HASH_MISMATCH:8,ERROR_INVALID_URL:9,ERROR_OUTPUT_STREAM:10,ERROR_CANCEL:11,DEDUPED:12,ERROR_ENC_HASH_MISMATCH:14,PREFETCH_END:15,ERROR_CANCEL_PROGRAMMATIC:16,ERROR_MEDIA_CONN:17,ERROR_THROTTLE:18,ERROR_SSL:19,ERROR_NETWORK:20,ERROR_CONNECT:21,ERROR_EP_NOTIFY_DECRYPTION_FAILURE:22,SKIPPED_EP_DIFFERENT_POP:23,SKIPPED_EP_AUTODOWNLOAD_DISABLED:24,ERROR_SERVER:25,ERROR_WATLS:26,ERROR_INVALID_CODE:27,ERROR_WAMSYS:28,ERROR_GENERIC:29}),Cn=Object.freeze({CHAT_PHOTO_LIBRARY:1,CAMERA_TAB_CAPTURE:2,FORWARD:3,PASTE:4,SHARE_EXTENSION:5,EXPORT:6,MENU_CAMERA_CAPTURE:7,EXTERNAL_CAMERA:8,LINK_PREVIEW_DOWNLOAD:9,CAMERA_TAB_MEDIA_STRIP:10,CAMERA_TAB_PHOTO_LIBRARY:11,CHAT_BUTTON_CAMERA_CAPTURE:12,CHAT_BUTTON_CAMERA_MEDIA_STRIP:13,CHAT_BUTTON_CAMERA_PHOTO_LIBRARY:14,STATUS_TAB_CAMERA_CAPTURE:15,STATUS_TAB_CAMERA_MEDIA_STRIP:16,STATUS_TAB_CAMERA_PHOTO_LIBRARY:17,STATUS_REPLY_CAMERA_CAPTURE:18,STATUS_REPLY_CAMERA_MEDIA_STRIP:19,STATUS_REPLY_CAMERA_PHOTO_LIBRARY:20,MENU_CAMERA_PHOTO_LIBRARY:21,CHAT_GIF_INAPP:22,CHAT_GIF_EXTERNAL:23,STATUS_REPLY_GIF_INAPP:24,STATUS_REPLY_GIF_EXTERNAL:25,SMB_QUICK_REPLY_EDIT:26,SMB_QUICK_REPLY_SEND:27,MEDIA_BROWSER:28,CHAT_QUICK_EDIT:29,CAMERA_TAB_GIF:30,STATUS_TAB_GIF:31,PAYMENT_COMPOSER:32,PHOTO_RECEIVED:33,PHOTO_RECEIVED_GALLERY:34,AD_CREATION:35,EXTERNAL_DROP:36}),Pn=Object.freeze({NONE:1,PHOTO:2,VIDEO:3,AUDIO:4,PTT:5,LOCATION:6,CONTACT:7,DOCUMENT:8,URL:9,CALL:10,GIF:11,FUTURE:12,CONTACT_ARRAY:13,LIVE_LOCATION:14,PROFILE_PIC:15,STICKER:16,HSM:17,PRODUCT_IMAGE:18,TEMPLATE:19,MD_APP_STATE:20,MD_HISTORY_SYNC:21,CATALOG_LINK:22,PRODUCT_LINK:23,ORDER:24,LIST:25,LIST_REPLY:26,BUTTON_MESSAGE:27,BUTTON_RESPONSE_MESSAGE:28,PRODUCT_LIST:29,BUTTON_NFM:30,VIEW_ONCE_IMAGE:31,VIEW_ONCE_VIDEO:32,SHOP_STOREFRONT:33,REACTION:34,INTERACTIVE_NFM:35,INTERACTIVE_RESPONSE_NFM:36,POLL_CREATE:37,POLL_VOTE:38,TEXT:39,KEEP:40,UNKEEP:41,INVISIBLE_HELLO:42,MEDIA_EXPRESS_NOTIFY:43}),On=Object.freeze({REGULAR:1,FAST_FORWARD_EXIST_CHECK:2,VIDEO_EXIST_CHECK:3,PRODUCT:4,MEDIA_RETRY:5,WEB_REUPLOAD:6,THUMBNAIL:7,EXPRESS_PATH_UPLOAD:8}),In=Object.freeze({OK:1,DUPLICATE:3,ERROR_UNKNOWN:2,ERROR_REQUEST:4,ERROR_UPLOAD:5,ERROR_OOM:6,ERROR_IO:7,ERROR_NO_PERMISSIONS:8,ERROR_BAD_MEDIA:9,ERROR_INSUFFICIENT_SPACE:10,ERROR_FNF:11,ERROR_CANCEL:12,ERROR_SERVER:13,ERROR_REQUEST_TIMEOUT:14,ERROR_NOT_FINALIZED:15,ERROR_OPTIMISTIC_HASH:16,ERROR_MEDIA_CONN:17,ERROR_DNS:18,ERROR_THROTTLE:19,ERROR_SSL:20,ERROR_NO_CLIENT_NETWORK:21,SKIPPED_EP_NOT_ONLINE:22,SKIPPED_EP_NOT_1TO1CHAT:23,SKIPPED_EP_UPLOAD_FAILED:24,SKIPPED_EP_MULTI_CHAT:25,SKIPPED_EP_NO_PRIMARY_HOST:26}),Mn=Object.freeze({OTHER:0,INDIVIDUAL:1,GROUP:2,STATUS:3,BROADCAST:4}),bn=Object.freeze({OPEN:1,CLICK:2}),Rn=Object.freeze({UNKNOWN:1,OVERFLOW:2,FORWARD:3,DELETE:4,REPLY:5,REPLY_PRIVATELY:6,STAR_OR_UNSTAR:7,COPY:8,REPORT:9,MESSAGE_CONTACT:10,MESSAGE_INFO:11}),Nn=Object.freeze({REGULAR_MESSAGE:0,DIRECT_MESSAGE:1,SENDER_KEY_DISTRIBUTION_MESSAGE:2}),wn=Object.freeze({STAR:0,FORWARD:1,COPY:2,REPORT:3,DELETE:4}),Ln=Object.freeze({MESSAGE_POLL:0}),Dn=Object.freeze({MISSING_MESSAGE_SECRET:0,WRONG_LENGTH:1,ENCRYPTION_ERROR:2,DECRYPTION_ERROR:3}),kn=Object.freeze({OK:1,ERROR_UNKNOWN:3,ERROR_NETWORK:4,ERROR_EXPIRED:5,ERROR_CANCELLED:6,ERROR_UPLOAD:7,ERROR_BACKFILL_USYNC_FAILED:8,ERROR_PAYLOAD_TOO_BIG:9,ERROR_LOCATION:10,ERROR_INVALID_MESSAGE:11,ERROR_E2EE:12}),Un=Object.freeze({INDIVIDUAL:1,GROUP:2,BROADCAST:3,STATUS:4}),Gn=Object.freeze({PREKEY_MESSAGE:1,CALL_PAYLOAD:2,RETRY_RECEIPT:3,PREKEY_RESPONSE:4,IDENTITY_RESPONSE:5,USYNC_RESPONSE:6}),xn=Object.freeze({LOGIN:0,LOGOUT:1,CUSTOM_AGENT_NAME:2,MESSAGE_INFO:3,ACTIVE:4,DELETE:5}),Bn=Object.freeze({ZERO:1,ONE:2,LT10:3,LT100:4,LT500:5,LT1K:6,LT5K:7,GTE5K:8}),Fn=Object.freeze({ONE_ON_ONE:1,GROUP:2}),jn=Object.freeze({CHAT_LIST_SCREEN:1,CONTACT_INFO:2,CONVERSATION_SCREEN:3}),Yn=Object.freeze({NATIVE:0,OK_HTTP:1,LIGER:2,APACHE:3,WATLS:4}),Kn=Object.freeze({SHOW:1,REMOVE:2}),Hn=Object.freeze({INDIVIDUAL:1,GROUP:2,OTHER:3}),Wn=Object.freeze({LOCAL:0,UNIVERSAL:1}),Vn=Object.freeze({LOCAL:0,UNIVERSAL:1}),$n=Object.freeze({LOCAL:0,UNIVERSAL:1}),zn=Object.freeze({LOCAL:0,UNIVERSAL:1}),qn=Object.freeze({ALLOWED:1,BLOCKED:2,UNKNOWN:3}),Jn=Object.freeze({DEFAULT:1,CUSTOM:2}),Qn=Object.freeze({PUSH_TRIGGERED:1,MAIN_APP:2,IN_APP:3}),Xn=Object.freeze({TEXT_MESSAGE:1,VOICE_MESSAGE:2,FILE_MESSAGE:3,PHOTO_MESSAGE:4,VIDEO_MESSAGE:5,MISSED_VOICE_CALL:6,MISSED_VIDEO_CALL:7,STICKER_MESSAGE:8,REACTION_MESSAGE:9,GROUP_INVITE_MESSAGE:10,REQUEST_MEDIA_REUPLOAD:11,WEB_CLIENT_LOGIN:12,BACKUP:13,KEEP_IN_CHAT:14,PAYMENT:15,POLL_MESSAGE:16,LOCATION_MESSAGE:17,WEB_PAGE_MESSAGE:18,FAILED_UPLOAD:19,GDPR_REPORT:20,INCOMING_VOICE_CALL:21,INCOMING_VIDEO_CALL:22,VIDEO_CALL_UPGRADE:23,WAFFLE:24,XPLAT_MIGRATION:25,OTHER:26}),Zn=Object.freeze({NONE:1,SOFTWARE:2,BUILTIN:3}),er=Object.freeze({COMPLETE:1,INCOMPLETE_UNKNOWN_ERROR:2}),tr=Object.freeze({PAGE_LOAD:1,SOCKET_CONNECT:2,PROCESS_COMPLETE:3,SCREEN_LOAD:4,OFFLINE_PREVIEW:5}),nr=Object.freeze({NONE:0,OPTIMISTIC:1,OPT_USED:2,OPT_TAKEOVER:3,OPT_DISABLED:4}),rr=Object.freeze({CLICK_VIEW_RECEIVED_CART:1,SEND_DECLINE_CART:2,USER_DELETED_CART:3,CLICK_CREATE_ORDER_DETAILS_FROM_CART:4,CLICK_ORDER_FROM_ICON_MENU:5,CLICK_CREATE_ORDER_DETAILS_FROM_FAB:6,SEND_ORDER_DETAILS:7,VIEW_ORDER_DETAILS_HUB:8,VIEW_ORDER_DETAILS:9,CLICK_SORT_ORDERS:10,CLICK_UPDATE_ORDER_STATUS:11,SEND_ORDER_STATUS:12,CLICK_PAYMENT_DETAILS:13,SEND_MARK_AS_PAID:14,SEND_MARK_AS_UNPAID:15,CLICK_HELP:16,CLICK_MESSAGE_CUSTOMER:17,CLICK_ADD_PAYMENT_OPTION:18,CLICK_SAVE_ADD_PAYMENT_OPTION:19,CLICK_SAVE_EDIT_PAYMENT_OPTION:20,CLICK_EDIT_PAYMENT_OPTION:21,CLICK_DELETE_PAYMENT_OPTION:22,CLICK_GET_PAID_ON_WA:23,CLICK_SEE_ALL_OTHER_ORDERS:24,ADD_PAYMENT_OPTION_TO_OD:25,EDIT_PAYMENT_OPTION_IN_OD:26,CLICK_ADD_CUSTOM_ITEM_TO_ORDER:27,ADD_ADDITIONAL_CHARGES_TO_ORDER:28,CLICK_ADD_ITEM:29,CLICK_ADD_ADDITIONAL_CHARGES:30}),ir=Object.freeze({OTHER:0,CHAT:1,NOTIFICATION:2}),ar=Object.freeze({NOTIFICATION_CTA:0,NOTIFICATION_BODY:1,CHAT_CTA:2,OTHER:3}),or=Object.freeze({CLICK:0,IMPRESSION:1,OTP_CODE_REQUESTED:2,OTP_CODE_SENT:3}),sr=Object.freeze({ONE_TAP:0,ZERO_TAP:1}),lr=Object.freeze({RESUME_CHECK:1,UPLOAD:2,FINALIZE:3}),ur=Object.freeze({NONE_NEW_CONTENT:1,NONE_EXPIRED:2,REUSED:3,NONE_WAS_STATUS:4}),cr=Object.freeze({CONSUMER:1,SMB:2,ENT:3}),dr=Object.freeze({CELLULAR:1,WIFI:2,NONE:3}),pr=Object.freeze({UPLOAD_STICKER:0,SEND_RECENT_STICKER_BOOTSTRAP:1,GENERAL_LINK_PREVIEW:2}),_r=Object.freeze({PHONE_NUM_HYPERLINK_MSG_RECEIVED:1,LONG_PRESS_PHONE_NUM_HYPERLINK:2,CLICK_PHONE_NUM_HYPERLINK:3,CLICK_CALL:4,CLICK_ADD_TO_CONTACTS:5,CLICK_MESSAGE_ON_WHATSAPP:6,CLICK_COPY_PHONE_NUMBER:7,CLOSE_DIALOG_BOX:8,MESSAGE_SENT:9,CLICK_CALL_ON_WHATSAPP:10}),fr=Object.freeze({OTHER:0,ADD:1,VIEW:2,POPULATE:3}),hr=Object.freeze({OTHER:0,INDIVIDUAL:1,GROUP:2,STATUS:3,BROADCAST:4}),gr=Object.freeze({OTHER:0,SIGNAL_NO_SESSION:1,DEVICE_VERIFICATION_FAILURE:2,UNKNOWN_SELF_DEVICE:3,SIGNAL_INVALID_KEY:4,SIGNAL_INVALID_KEY_ID:5,SIGNAL_INVALID_MESSAGE:6,DEVICE_VERIFICATION_FAILURE_SELF_PEER:7,UNKNOWN_COMPANION_NO_PREKEY:8,BAD_EPHEMERAL_SETTING:9}),mr=Object.freeze({OTHER:0,CIPHERTEXT:1,FANOUT:2,DOWNGRADE:3}),yr=Object.freeze({IPHONE:1,ANDROID:2,BB:3,BBX:7,S40:4,SYMBIAN:5,WP:6,WEBCLIENT:8,OSMETA:11,ENT:12,SMBA:13,KAIOS:14,SMBI:15,WINDOWS:16,WEB:17,PORTAL:18,BLOKS:19,BLUEA:20,BLUEI:21,FBLITEA:22,GREENA:23,GREENI:24,IGDA:25,IGDI:26,IGLITEA:27,MLITEA:28,MSGRA:29,MSGRI:30,MSGRP:31,MSGRW:32,IGDW:33,PAGE:34,MSGRDM:35,MSGRDW:36,MSGROM:37,MSGROC:38,MSGRM:43,IGDM:44,WEARM:45,CAPI:46,XR:47,MACOS:48,WAMETA_REPL:49,ARDEV:50,WEAROS:51,MSGRVR:52,TEST:9,UNKNOWN:10}),Er=Object.freeze({CONVERSATION:1,STATUS:2}),Sr=Object.freeze({IDLE:1,READY_PLAY:2,READY_PAUSE:3,BUFFERING:4,OUTSIDE:5,ENDED:6,ERROR:7}),Tr=Object.freeze({SEE_MASKED_PN_AT_CHAT_CREATION:1,REQUEST_DIALOG_APPEAR:2,SEND_REQUEST:3,SHARE_PN_SHEET_APPEAR:4,DISMISS:5,SHARE_NUMBER:6}),vr=Object.freeze({VIEW:1,CLOSE:2,UPGRADE:3}),Ar=Object.freeze({CTWA:1}),Cr=Object.freeze({CHAT_CREATION:1,CHAT_INFO_REQUEST:2,AUDIO:3,VIDEO:4,PN_REQUEST:5,SYSTEM_MESSAGE:6,CHAT_INFO_PN_VISIBILITY:7}),Pr=Object.freeze({BIZ:1,CONSUMER:2}),Or=Object.freeze({OPEN_CREATE_MODAL:1,CREATE_POLL:2,VIEW_RESULTS_MODAL:4,REMOVE_VOTE:5,VOTE:6,CHANGE_VOTE:7}),Ir=Object.freeze({LT4:1,LT8:2,LT16:3,LT32:4,LT64:5,LT128:6,LT256:7,LT512:8,LT1000:9,LT1500:10,LT2000:11,LT2500:12,LT3000:13,LT3500:14,LT4000:15,LT4500:16,LT5000:17,LARGEST_BUCKET:18}),Mr=Object.freeze({LOCAL:0,UNIVERSAL:1}),br=Object.freeze({SEND_MESSAGE:1,GET_VNAME_CERTIFICATE:2,SEND_LIVE_LOCATION_RETRY:3,SEND_LIVE_LOCATION_KEY:4,SEND_PEER_MESSAGE:5,MULTI_DEVICE_CALL:6,CALL_PEER_E2E_FAIL:7,IDENTITY_CHANGE_NOTIFICATION:8,BACK_OFF:9,USER_INTENT_PREFETCH:10,RESEND_MESSAGE:11,RETRY_MESSAGE:12,USER_INTENT_STATUS_PREFETCH:13}),Rr=Object.freeze({ADV_SIGNED_DEVICE_IDENTITY:1,ADV_SIGNED_KEY_INDEX_LIST:2}),Nr=Object.freeze({VIEW_TWICE:0}),wr=Object.freeze({VIEW_ONCE:0}),Lr=Object.freeze({PRIVACY_SETTINGS:0,PROFILE_PHOTO_JIT:1}),Dr=Object.freeze({LAST_SEEN_AND_ONLINE:0,PROFILE_PHOTO:1,ABOUT:2,GROUPS:3,STATUS:4,READ_RECEIPT:5,BLOCKED:6,LIVE_LOCATION:7,SCREEN_LOCK:8,DDM_TIMER:9,SILENCE_UNKNOWN_CALLERS:10,FINGERPRINT_LOCK:11}),kr=Object.freeze({E2EE:0}),Ur=Object.freeze({GOLDEN_BOX_CONTACT:0,GOLDEN_BOX_GROUP:1,GOLDEN_BOX_BROADCAST:2,INFO_SCREEN_CONTACT:3,INFO_SCREEN_GROUP:4,INFO_SCREEN_BROADCAST:5,CALLS_LIST:6,CHATS_LIST:7,STATUS_LIST:8,LINKED_DEVICES_SCREEN:9,CALLING_SCREEN_AUDIO:10,CALLING_SCREEN_VIDEO:11}),Gr=Object.freeze({B0:1,B1:2,B5:3,B10:4,B15:5,B20:6,B30:7,B40:8,B50:9,B60:10,B70:11,B80:12,B90:13,B100:14}),xr=Object.freeze({NOBODY:1,ONLY_SHARE_WITH:2,MY_CONTACTS:3,MY_CONTACTS_EXCEPT:4,EVERYONE:5}),Br=Object.freeze({CONTACT_CARD:1,CHAT_HEADER:2,CHAT_MENU:3,GROUP_MEMBERSHIP_SCREEN:4,STATUS:5,CALLS:6,BROADCAST_LIST:7,PRODUCT:8,CATALOG:9,SETTINGS:10,SPAM_BLOCK:11,CHATS_HOME:12,SHOPS:13,MENTION:14,EPHEMERAL_SETTINGS_MESSAGE:15,MAP:16,SEARCH:17,PAYMENT_TRANSACTION_DETAILS:18,CUSTOM_URL_LINK:19,CUSTOM_URL_QR_CODE:20,NOTIFICATION_BLOCK_ACTION:21}),Fr=Object.freeze({PHOTO_CAMERA:1,PHOTO_UPLOAD:2,WEB_SEARCH:3,EMOJI:4,STICKER:5,REMOVE_PHOTO:6}),jr=Object.freeze({DIT:1,DIRECTORY_SEARCH:2}),Yr=Object.freeze({CHATLIST:1,CHAT:2,SHARE:3}),Kr=Object.freeze({COLD:1,WARM:2,LUKEWARM:3}),Hr=Object.freeze({SUCCESS:1,ERROR_PARSING:2,ERROR_DECODING:3,ERROR_CREDENTIAL:4,ERROR_OTHER:5,ERROR_CLIENT_NETWORK:6,ERROR_WAIT_FOR_TOKEN:7,ERROR_SERVER_OTHER:8,SKIPPED_NO_NETWORK:9,SKIPPED_NO_DATA:10,ERROR_ACCESS_TOKEN:11}),Wr=Object.freeze({CRASH:0,OOM:1,MAIN_THREAD_STALL_30_SECONDS:2,MAIN_THREAD_STALL_DEBUG:3,AUDIO_TRANSCODING_ERROR:4,VIDEO_TRANSCODING_ERROR:5,ANR:6,CRITICAL_EVENT:7,UNHANDLED_EXCEPTION:8,APP_CRASH:9,NATIVE_CRASH:10,UFAD:11}),Vr=Object.freeze({CREATED:1,ROTATED:2,DELETED:3}),$r=Object.freeze({TEST_VALUE1:1,TEST_VALUE2:2}),zr=Object.freeze({NO_REASON:0,REASON_UNKNOWN:1,REASON_WAIT_FOR_FIRST_TOKEN:2,REASON_INVALID_SHARED_KEY:3,REASON_INVALID_FACTOR:4,REASON_GEN_FACTOR_FAILURE:5,REASON_COMPUTE_HMAC_FAILURE:6,REASON_BLIND_FAILURE:7,REASON_UNBLIND_FAILURE:8,REASON_LAST_SIGNREQ_NETWORK_FAILURE:9,REASON_LAST_SIGNREQ_SERVER_ERROR:10,REASON_LAST_SIGNREQ_BAD_REQUEST:11,REASON_LAST_SIGNREQ_OTHER_ERROR:12,REASON_WAIT_FOR_GEN_TOKEN:13,REASON_GEN_SHAREDKEY_FAILURE:14,REASON_WAIT_FOR_GEN_FIRST_TOKEN:15}),qr=Object.freeze({REASON_PS_PINGER:0,REASON_PS_OFFCYCLE:1}),Jr=Object.freeze({OTHER:0,MESSAGES_ARENT_HELPFUL:1,TOO_MANY_MESSAGES:2,IT_LOOKS_SUSPICIOUS:3}),Qr=Object.freeze({SUCCESS:1,CANCEL:2,ERROR:3}),Xr=Object.freeze({SAVE:1,FORWARD:2,REACT:3,LINK_CLICK:4,MEDIA_PLAY:5,DELETE:6}),Zr=Object.freeze({BLOCK:1,UNBLOCK:2,ARCHIVE:3,UNARCHIVE:4,CLEAR:5,DELETE_ALL:6}),ei=Object.freeze({BLOCK_FROM_CONTACT_INFO:1,BLOCK_FROM_CHAT:2,UNBLOCK_FROM_CONTACT_INFO:3,UNBLOCK_FROM_CHAT:4,UNBLOCK_FROM_PRIVACY_SETTINGS:5,ARCHIVE_FROM_CHAT_LIST:6,ARCHIVE_FROM_DELETE_OPTION:7,UNARCHIVE_FROM_ARCHIVED_CHAT_LIST:8,CLEAR_FROM_CONTACT_INFO:9,CLEAR_FROM_CHAT_LIST:10,DELETE_ALL_FROM_CHAT_LIST:11,DELETE_ALL_FROM_CONTACT_INFO:12,DELETE_ALL_FROM_CONVERSATION:13,CLEAR_FROM_CONVERSATION:14,BLOCK_FROM_CONSENT_MODAL:15}),ti=Object.freeze({SPEED_1:0,SPEED_1_5:1,SPEED_2:2}),ni=Object.freeze({AUDIO_QUEUE:0,AVPLAYER:1,AVAUDIOPLAYER:2,OPUSPLAYER:3,ANDROIDPLAYER:4,EXOPLAYER:5}),ri=Object.freeze({SENT:1,CANCELLED:2,TOO_SHORT:3}),ii=Object.freeze({FROM_CONVERSATION:0,FROM_VOICEMAIL:1}),ai=Object.freeze({UNKNOWN:0,AAC:1,MP3:2,AMR_NB:3,AMR_WB:4,OPUS:5,MULTIPLE_TRACKS:6}),oi=Object.freeze({MANUAL:0,SEQUENTIAL:1}),si=Object.freeze({STICKER_STORE_DATA:0,PREVIEW_IMAGE_DOWNLOAD:1,STICKER_PACK_DATA:2,STICKER_SEARCH:3}),li=Object.freeze({ACTION_SETTINGS_IMPRESSION:1,ACTION_SETTINGS_ADD_CLICK:2,ACTION_SETTINGS_ADD_ABANDONED:3,ACTION_SETTINGS_ADDED:4,ACTION_SETTINGS_DELETED:5,ACTION_CHAT_IMPRESSION:6,ACTION_CHAT_CLICK:7,ACTION_SETTINGS_EDITED:8,ACTION_CHAT_INVALID_ATTACHMENTS:9,ACTION_SETTINGS_INVALID_ATTACHMENTS:10,ACTION_SETTINGS_MEDIA_TRANSCODE:11,ACTION_CHAT_CLICK_CANCEL:12,ACTION_SMART_DEFAULT_CLICK:13,QUICK_REPLY_MESSAGE_SENT:14}),ui=Object.freeze({QUICK_REPLY_ENTRY_POINT_KEYBOARD:1,QUICK_REPLY_ENTRY_POINT_ATTACHMENT_PANEL:2,QUICK_REPLY_ENTRY_POINT_SETTINGS_MENU:3,QUICK_REPLY_ENTRY_POINT_BANNERS:4,QUICK_REPLY_ENTRY_POINT_NUX:5}),ci=Object.freeze({UNKNOWN:0,CONVERSATIONS:1,BUTTON:2,KEYBOARD:3}),di=Object.freeze({QUICK_REPLY_TRANSCODE_RESULT_OK:1,QUICK_REPLY_TRANSCODE_RESULT_CANCELLED:2,QUICK_REPLY_TRANSCODE_RESULT_FAIL_IMAGE_UNKNOWN:3,QUICK_REPLY_TRANSCODE_RESULT_FAIL_IMAGE_ENCODING:4,QUICK_REPLY_TRANSCODE_RESULT_FAIL_IMAGE_FILE_COPY:5,QUICK_REPLY_TRANSCODE_RESULT_FAIL_VIDEO_UNKNOWN:6}),pi=Object.freeze({CELLULAR_UNKNOWN:0,WIFI_UNKNOWN:1,CELLULAR_EDGE:100,CELLULAR_IDEN:101,CELLULAR_UMTS:102,CELLULAR_EVDO:103,CELLULAR_GPRS:104,CELLULAR_HSDPA:105,CELLULAR_HSUPA:106,CELLULAR_HSPA:107,CELLULAR_CDMA:108,CELLULAR_1XRTT:109,CELLULAR_EHRPD:110,CELLULAR_LTE:111,CELLULAR_HSPAP:112}),_i=Object.freeze({OPEN_TRAY:1,DELETE:2,UPDATE:3}),fi=Object.freeze({CHAT_LIST:1,CHAT:2}),hi=Object.freeze({OTHER:0,CHAT:1,NOTIFICATION:2}),gi=Object.freeze({EXCEPTION_TYPE_TOS_ENABLED:0,EXCEPTION_TYPE_TOS_DISABLED:1,EXCEPTION_TYPE_REMOTE_CHAT_JID_NULL:2,EXCEPTION_TYPE_DEEP_LINK_NULL:3,EXCEPTION_TYPE_CTWA_ADS_SOURCE_NULL:4,EXCEPTION_TYPE_CTWA_ADS_PAYLOAD_NULL:5,EXCEPTION_TYPE_ADS_DATA_PARSING_FAILURE:6,EXCEPTION_TYPE_ADS_DATA_VALIDATION_FAILURE:7,EXCEPTION_TYPE_CONVERSION_TUPLE_NULL:8,EXCEPTION_TYPE_TOS_2021_ENABLED:9,EXCEPTION_TYPE_TOS_2021_DISABLED:10}),mi=Object.freeze({SUCCESS:1,ERROR:2}),yi=Object.freeze({OTHER:0,DOUBLE_CHECKMARK:1,IDENTITY_CHANGE:2}),Ei=Object.freeze({SENDER:0,ADMIN:1}),Si=Object.freeze({CALLS_TAB:1,GROUP_CALL_UI:2,ATTACHMENT:3,WEB_MENU:4}),Ti=Object.freeze({CATALOG:1,COLLECTION:2,CATEGORY:3}),vi=Object.freeze({ACTION_SEARCH_CLICK:1,ACTION_SUBMIT_SEARCH:2,ACTION_SEARCH_RESULT_CLICK:3,ACTION_QUANTITY_SELECTOR_ADD:4,ACTION_QUANTITY_SELECTOR_REMOVE:5,ACTION_SEARCH_VIEW_CART_CLICK:6,ACTION_EXIT_SEARCH_CLICK:7}),Ai=Object.freeze({E2EE:0,BSP:1,FB:2}),Ci=Object.freeze({PROFILE:0,BUSINESS_TOOLS:1,ACCOUNT:2,CHATS:3,NOTIFICATIONS:4,DATA_STORAGE_USAGE:5,HELP:6,INVITE_FRIEND:7,STARRED_MESSAGES:8,WHATSAPP_WEB:9,PREMIUM_SUBSCRIPTION:10,PRIVACY:11}),Pi=Object.freeze({CUSTOM_URL:1,PHONE_NUMBER:2}),Oi=Object.freeze({ACTION_COPY_BUSINESS_LINK:1,ACTION_SHARE_BUSINESS_LINK:2,ACTION_SHARE_QR_CODE:3,ACTION_PREMIUM_NAME_REGISTER:4,ACTION_SHARE_QR_CODE_BUTTON_CLICK:5,ACTION_DELETE_CUSTOM_URL:6,ACTION_UPGRADE_TO_PREMIUM_LINK_CLICK:7,ACTION_PREMIUM_NAME_PAGE_IMPRESSION:8,ACTION_PREMIUM_UPSELL_IMPRESSION:9,ACTION_SHARE_BUSINESS_ICON_CLICK:10,ACTION_EDIT_CUSTOM_URL:11,ACTION_PREMIUM_EXAMPLE_PAGE_IMPRESSION:12,ACTION_VIEW_IN_BROWSER_CLICK:13,ACTION_CHANGE_LINK_CLICK:14,ACTION_DELETE_WEB_CLICK:15,ACTION_CREATE_YOUR_PAGE_CLICK:16,ACTION_PRETRIAL_AWARENESS_BOTTOM_SHEET_IMPRESSION:17,ACTION_PRETRIAL_AWARENESS_BOTTOM_SHEET_CLICK:18,ACTION_POST_SIGNUP_WEB_PAGE_AWARENESS_BOTTOM_SHEET_IMPRESSION:19,ACTION_POST_SIGNUP_WEB_PAGE_AWARENESS_BOTTOM_SHEET_CLICK:20,ACTION_POST_SIGNUP_MD_AWARENESS_BOTTOM_SHEET_IMPRESSION:21,ACTION_POST_SIGNUP_MD_AWARENESS_BOTTOM_SHEET_CLICK:22,ACTION_TRIAL_PERIOD_WEB_PAGE_AWARENESS_BOTTOM_SHEET_IMPRESSION:23,ACTION_TRIAL_PERIOD_WEB_PAGE_AWARENESS_BOTTOM_SHEET_CLICK:24,ACTION_TRIAL_PERIOD_MD_AWARENESS_BOTTOM_SHEET_IMPRESSION:25,ACTION_TRIAL_PERIOD_MD_AWARENESS_BOTTOM_SHEET_CLICK:26}),Ii=Object.freeze({ACTION_CLICK_SHOPS_SETTING:1,ACTION_CLICK_CATALOG_SETTING:2,ACTION_CLICK_COMMERCE_MANAGER_IN_CATALOG_SETTING:3,ACTION_CLICK_CANCEL_IN_CATALOG_SETTING:4,ACTION_CLICK_VIEW_SHOPS_IN_SHOPS_SETTING:5,ACTION_CLICK_COMMERCE_MANAGER_IN_SHOPS_SETTING:6,ACTION_CLICK_CANCEL_IN_SHOPS_SETTING:7,ACTION_SHOPS_PRODUCT_PREVIEW_VISIBLE:8,ACTION_CLICK_SHOPS_PRODUCT_PREVIEW_TILE:9,ACTION_CLICK_MANAGE_SHOPS:10,ACTION_SHARE_SHOPS:11,ACTION_CLICK_VIEW_SHOPS_FROM_EDIT_BIZ_PROFILE:12,ACTION_CLICK_COMMERCE_MANAGER_FROM_EDIT_BIZ_PROFILE:13,ACTION_CLICK_CANCEL_FROM_EDIT_BIZ_PROFILE:14}),Mi=Object.freeze({SUCCESS:1,ERROR_BAD_REQUEST:2,ERROR_SERVER:3,ERROR_OTHER:4,ERROR_CLIENT_NETWORK:5}),bi=Object.freeze({ACCOUNT_SIGNATURE:1,DEVICE_SIGNATURE:2}),Ri=Object.freeze({LT32:1,LT64:2,LT128:3,LT256:4,LT512:5,LT1000:6,LT1024:16,LT1500:7,LT2000:8,LT2500:9,LT3000:10,LT3500:11,LT4000:12,LT4500:13,LT5000:14,LARGEST_BUCKET:15}),Ni=Object.freeze({WELCOME_SCREEN:1,WELCOME_SCREEN_AGREE_TO_TERMS_TAPPED:2,WELCOME_SCREEN_TOS_LINK_TAPPED:3,WELCOME_SCREEN_NOT_A_BUSINESS_TAPPED:4,ENTER_NEW_NUMBER_SCREEN:5,REUSE_EXISTING_NUMBER_SCREEN:6,REUSE_EXISTING_NUMBER_SCREEN_REUSE_EXISTING_NUMBER_TAPPED:7,REUSE_EXISTING_NUMBER_SCREEN_USE_DIFFERENT_NUMER_TAPPED:8,ENTER_2FA_CODE_SCREEN:9,MIGRATION_STARTED:10,MIGRATION_COMPLETED:11,MIGRATION_FAILED:12,SETUP_PROFILE_SCREEN:13,SELECT_BUSINESS_CATEGORY_SCREEN:14,EXPLORE_TOOLS_SCREEN:15,EXPLORE_TOOLS_SKIP_TAPPED:16,EXPLORE_TOOLS_EXPLORE_TAPPED:17,CHAT_BACKUP_SCREEN:18,CHAT_LIST_SCREEN:19,ENTER_ACTIVATION_CODE_SCREEN:20}),wi=Object.freeze({SNACKBAR_SHOWN:0,MESSAGE_UNDELETE:1}),Li=Object.freeze({STATIC:0,SHARED:1}),Di=Object.freeze({OK:1,CANCELLED:2,ERROR_UNKNOWN:3,MEDIA_ERROR_UNKNOWN:4,MEDIA_ERROR_DNS:5,MEDIA_ERROR_TIMEOUT:6,MEDIA_ERROR_INSUFFICIENT_SPACE:7,MEDIA_ERROR_TOO_OLD:8,MEDIA_ERROR_CANNOT_RESUME:9,MEDIA_ERROR_HASH_MISMATCH:10,MEDIA_ERROR_INVALID_URL:11,MEDIA_ERROR_OUTPUT_STREAM:12,MEDIA_ERROR_MEDIA_CONN:13,MEDIA_ERROR_THROTTLE:14,MEDIA_DOWNLOAD_CANCEL:15,MEDIA_PREFETCH_END:16,MEDIA_ERROR_WATLS:17,MEDIA_ERROR_SERVER:18,MEDIA_ERROR_WAMSYS:19,MEDIA_ERROR_NETWORK:20,MEDIA_ERROR_CONNECT:21,MEDIE_HOST_SWTICH_REQUIRED:22,MEDIA_INVALID_CODE:23,MEDIA_SUSPICIOUS_CONTENT:24}),ki=Object.freeze({UNKNOWN:1,TEXT:2,IMAGE:3,VOICE:4,DOCUMENT:5,AUDIO:6,STICKER:7,LOCATION:8,PRODUCT:9,CONTACT:10,CONTACT_ARRAY:11,CAMERA_CAPTURE_IMAGE:12,MEDIA_GALLERY:13,GIF_VIDEO:14,QUICK_REPLY:15,POLL:16}),Ui=Object.freeze({OK:1,CANCELLED:2,ERROR_UNKNOWN:3}),Gi=Object.freeze({CLICK_REPORT:0,CLICK_SUBMIT_REPORT:1,CLICK_CANCEL_REPORT:2}),xi=Object.freeze({DIRECT_ROW_TAP:1,BACKWARDS_SWIPE:2,FOWARDS_SWIPE:3,BACKWARDS_TAP:4,FOWARDS_TAP:5,PREVIOUS_ROW_TIMEOUT:6}),Bi=Object.freeze({RECENT_STORIES:1,PREVIOUS_STORIES:2,MUTED_STORIES:3,MY_STATUS:4,CHAT_LIST:5,GROUP_PARTICIPANT:6,CONTACT_CARD:7,PROFILE_PAGE:8,CHAT_LIST_SEARCH:9}),Fi=Object.freeze({STATUS_TAB:1,PROFILE_BADGE:2,THREADS_PROFILE_BADGE:3,RECENT_STORIES:4,PREVIOUS_STORIES:5,MUTED_STORIES:6,MY_STATUS:7,CHAT_LIST:8,GROUP_PARTICIPANT:9,CONTACT_CARD:10,PROFILE_PAGE:11,CHAT_LIST_SEARCH:12}),ji=Object.freeze({RECEIVED:1,VIEWED:2,FORWARD_TAP:3,MUTE_TAP:4,VIEW_CONTACT:5,MESSAGE_TAP:6}),Yi=Object.freeze({MESSAGE_SEND:1,REACTION_TAP:2,VOICE_CALL_TAP:3,VIDEO_CALL_TAP:4}),Ki=Object.freeze({REGULAR:1,PAYMENTS:2}),Hi=Object.freeze({STICKER_SEARCH:1,FORWARD:2,STICKER_PICKER_TAB_RECENTS:3,STICKER_PICKER_TAB_FAVORITES:4,STICKER_PICKER_TAB_EMOTION:5,STICKER_PICKER_TAB_PACK:6,STICKER_PICKER_TAB_CONTEXTUAL_SUGGESTIONS:7,STICKER_MAKER:8,STICKER_STORE:9}),Wi=Object.freeze({BANNER_SHOW:1,BANNER_DISMISS:2,BANNER_TAP_VIEW_CHANGES:3,BANNER_NOT_SHOWN_REGISTRATION_TOO_NEW:4,BANNER_NOT_SHOWN_AGAIN_BEYOND_WINDOW:5}),Vi=Object.freeze({HSM:0,BUTTON:1,LIST:2,PRODUCT_LIST:3,BUTTON_NFM:4,PRODUCT_ITEM:5,SHOP_STOREFRONT:6}),$i=Object.freeze({NEW:0,ACTIVE:1,CHURNED:2}),zi=Object.freeze({ACTIVATED:0,FAILED:1,CANCELED:3,EXPIRED:4,PAUSED:5}),qi=Object.freeze({MULTI_DEVICE:0,CUSTOM_URL:1,MANAGE_EXISTING_SUBSCRIPTION:2,SMB_PREMIUM_UPSELL_CHAT_BANNER:3,SMB_PREMIUM_SUBS_PAYMENT_FAILED_BANNER:4,SMB_PREMIUM_SUBS_UNINTENTIONAL_CANCELED_BANNER:5,SETTINGS:6,BUSINESS_TOOLS:7,PREMIUM_TOOLS:8,DEEPLINK:9}),Ji=Object.freeze({NO_SUBSCRIPTION_DATA_FOUND:0,WA_LATEST_VERSION_REQUIRED:1,GOOGLE_PLAY_SERVICES_NOT_INSTALLED:2,SUBSCRIPTION_QUOTE_FETCH_FAILED:3,SUBSCRIPTION_VERIFICATION_FAILED:4}),Qi=Object.freeze({PAID:0,FREE_TRIAL:1,DISCOUNT_TRIAL:2}),Xi=Object.freeze({NONE:1,SPEEX:2,WEBRTC:3,MWEBRTC:4,ECHOSUPPRESSOR:5}),Zi=Object.freeze({TITLE:1,CONTENT:2,FOOTER:3,BUTTON:4}),ea=Object.freeze({CHATLIST:0,INTRO_CARD:1,PROFILE_VIEW:2,OTHER:3,CONTEXT_MENU:4}),ta=Object.freeze({ARCHIVE:0,UNARCHIVE:1,MUTE:2,UNMUTE:3,CLEAR:4,DELETE:5,BLOCK:6,REPORT:7}),na=Object.freeze({CHAT_ENTRY:1,SYSTEM_MESSAGE:2,KEEP_MESSAGE_FIRST_TIME:3,USER_MESSAGE_KEPT:4,KEPT_FOLDER_TAP_FIRST_TIME:5,UNKEEP_MESSAGE_FIRST_TIME:6,EPHEMERAL_SETTINGS:7}),ra=Object.freeze({VIEWED:0,DISMISSED:1}),ia=Object.freeze({B0:1,B1:2,B2:3,B11:4,B51:5,B101:6,B501:7,B1K:8,B10K:9,B100K:10,B1M:11}),aa=Object.freeze({UPLOAD_SUCCESS:1,EMPTY_LOG_DIR:2,GZIP_FAILURE:3,UPLOAD_FAILURE:4,LOG_SIZE_EXCEEDED:5}),oa=Object.freeze({GROUP:1,SUBGROUP:2,DEFAULT_SUBGROUP:3}),sa=Object.freeze({INDIVIDUAL:1,GROUP:2,SUBGROUP:3,DEFAULT_SUBGROUP:4}),la=Object.freeze({OTHER:1,APP_OPEN:2,CHAT_OPEN:3,IMAGE_OPEN:4,FIRST_FTS_RESULT:5,CONTACTS_OPEN:6,GROUP_INFO_OPEN:7,MSG_INFO_OPEN:8,COMMUNITY_INFO_OPEN:9,DEFAULT_SUBGROUP_INFO_OPEN:10,COMMUNITY_CREATE:11,COMMUNITY_LINK:12}),ua=Object.freeze({NEW_CHAT_PRESSED:1,YOU_SELECTED:2,SEARCH_BAR_PRESSED:3,SEARCH_FULL_NAME_YOU_SELECTED:4,NEW_NTS_CREATED:5,EXISTING_NTS_OPENED:6}),ca=Object.freeze({NEW_CHAT:1,CONTACT_AND_GLOBAL_SEARCH:2}),da=Object.freeze({MESSAGE_SELECTED:0,TRASH_CAN_SELECTED:1,ADMIN_DELETE_FOR_EVERYONE:2,SENDER_DELETE_FOR_EVERYONE:3,ADMIN_AND_SENDER_DELETE_FOR_EVERYONE:4,DELETE_FOR_EVERYONE_SELECTED:5}),pa=Object.freeze({UNKNOWN:1,CHAT_PERSONAL:2,CHAT_GROUP:3,STATUS_USER:4,PRODUCT_CATALOG:5,STICKER_WEB:6,PAYMENTS_KYC:7,MESSAGE_HISTORY_SYNC:8}),_a=Object.freeze({OTHER:1,CAMERA:2,GALLERY:3,SHARE:4}),fa=Object.freeze({SUCCESS:0,UNKNOWN_ERROR:1,INVALID_ARGS:2,HTTP_ERROR:3,INVALID_RESPONSE:4,MEM_ALLOC_ERROR:5,NO_DEVICE_FOUND:6,NO_IGD_FOUND:7,NOT_ON_WIFI:100,TOO_MANY_PORTS:101,TIMEOUT:102,ERR_CODE_INVALID_ACTION:401,ERR_CODE_INVALID_ARGS:402,ERR_CODE_ACTION_FAILED:501,ERR_CODE_ACTION_NOT_AUTHORIZED:606,ERR_CODE_PINHOLE_SPACE_EXHAUSTED:701,ERR_CODE_FIREWALL_DISABLED:702,ERR_CODE_INBOUND_PINHOLE_NOT_ALLOWED:703,ERR_CODE_NO_SUCH_ENTRY:704,ERR_CODE_PROTOCOL_NOT_SUPPORTED:705,ERR_CODE_INTERNAL_PORT_WILDCARD_NOT_ALLOWED:706,ERR_CODE_PROTOCOL_WILDCARD_NOT_ALLOWED:707,ERR_CODE_WILDCARD_NOT_PERMITTED_IN_SRC_IP:708,ERR_CODE_NO_PACKET_SENT:709,ERR_CODE_SPECIFIED_ARRAY_INDEX_INVALID:713,ERR_CODE_NO_SUCH_ENTRY_IN_ARRAY:714,ERR_CODE_WILD_CARD_NOT_PERMITTED_IN_SRC_IP:715,ERR_CODE_WILD_CARD_NOT_PERMITTED_IN_EXT_PORT:716,ERR_CODE_CONFLICT_IN_MAPPING_ENTRY:718,ERR_CODE_SAME_PORT_VALUES_REQUIRED:724,ERR_CODE_ONLY_PERMANENT_LEASES_SUPPORTED:725,ERR_CODE_REMOTE_HOST_ONLY_SUPPORTS_WILDCARD:726,ERR_CODE_EXTERNAL_PORT_ONLY_SUPORTS_WILDCARD:727,ERR_CODE_NO_PORT_MAPS_AVAILABLE:728,ERR_CODE_CONFLICT_WITH_OTHER_MECHANISMS:729,ERR_CODE_WILD_CARD_NOT_PERMITTED_IN_INT_PORT:732,DISABLED:999}),ha=Object.freeze({SUCCESS:0,UNKNOWN_ERROR:1,INVALID_ARGS:2,HTTP_ERROR:3,INVALID_RESPONSE:4,MEM_ALLOC_ERROR:5,NO_DEVICE_FOUND:6,NO_IGD_FOUND:7,NOT_ON_WIFI:100,TIMEOUT:102,ERR_CODE_INVALID_ACTION:401,ERR_CODE_INVALID_ARGS:402,ERR_CODE_ACTION_FAILED:501,ERR_CODE_ACTION_NOT_AUTHORIZED:606,ERR_CODE_WILD_CARD_NOT_PERMITTED_IN_SRC_IP:715,ERR_CODE_WILD_CARD_NOT_PERMITTED_IN_EXT_PORT:716,ERR_CODE_NO_PORT_MAPS_AVAILABLE:728,ERR_CODE_CONFLICT_WITH_OTHER_MECHANISMS:729,ERR_CODE_WILD_CARD_NOT_PERMITTED_IN_INT_PORT:732,DISABLED:999}),ga=Object.freeze({ONE_CLICK:1,TWO_CLICKS:2,NO_CLICK:3}),ma=Object.freeze({NO_PREVIEW:1,TRUNCATED:2,NON_TRUNCATED:3}),ya=Object.freeze({NARRATIVE_APPEAR:0,DIALOG_APPEAR:1,DIALOG_SELECT:2}),Ea=Object.freeze({INVALID_STANZA:1,JSON_FETCH:2,JSON_PARSE:3,IMAGE_FETCH:4}),Sa=Object.freeze({BANNER_APPEAR:1,BANNER_SELECT:2,MODAL_APPEAR:3,MODAL_DISMISS:4,MODAL_LINK_FOLLOW:5,MODAL_ACCEPT:6,BLOCKING_MODAL_APPEAR:7,BLOCKING_MODAL_LINK_FOLLOW:8,BLOCKING_MODAL_ACCEPT:9,BANNER_DISMISS:10,EDUCATION_1_APPEAR:11,EDUCATION_1_DISMISS:12,EDUCATION_1_CONTINUE:13,MODAL_BACK:14,BLOCKING_MODAL_BACK:15}),Ta=Object.freeze({FAILURE:0,SUCCESS:1}),va=Object.freeze({WA_IPHONE:0,FB_IPHONE:1}),Aa=Object.freeze({UNKNOWN:0,SUCCEEDED:1,FAILED:2,CANCELLED:3}),Ca=Object.freeze({SLOMO:0,VIDEO:1,GIF:2}),Pa=Object.freeze({IMAGE:0,VIDEO:1,GIF:2}),Oa=Object.freeze({ACTION_CATEGORY_LEVEL_CLICK:1,ACTION_CATEGORY_LEVEL_IMPRESSION:2,ACTION_CATEGORY_PRODUCT_CLICK:3,ACTION_CATEGORY_PREFETCH:4}),Ia=Object.freeze({ACTION_IMPRESSION:1,ACTION_CLICK_WEBSITE:2,ACTION_CLICK_LOCATION:3,ACTION_CLICK_HOURS:4,ACTION_CLICK_DESCRIPTION:5,ACTION_CLICK_EMAIL:6,ACTION_CLICK_ADDTOCONTACT:7,ACTION_CLICK_MORE_BIZ_PROFILE:8,ACTION_CLICK_MESSAGE:9,ACTION_CLICK_VOICE_CALL:10,ACTION_CLICK_VIDEO_CALL:11,ACTION_CLICK_FORWARD:12,ACTION_CLICK_CATALOG_ICON:13,ACTION_CLICK_SHOPS_ICON:14,ACTION_CLICK_APP_LINK:15,ACTION_APP_IMPRESSION:16,ACTION_CLICK_STATUS:17,ACTION_EXIT:18,ACTION_COVER_PHOTO_IMPRESSION:19}),Ma=Object.freeze({SERIAL_MISMATCH_CERT_IN_MESSAGE_INVALID:0,NEW_SERIAL_CERT_IN_MESSAGE_INVALID:1,GET_VNAME_CERT_INVALID:2,VNAME_CERT_UPDATE_INVALID:3,IDENTITY_ADDED_INVALID:4,IDENTITY_CHANGED_INVALID:5,IDENTITY_DELETED_INVALID:6,USYNC_VNAME_CERT_INVALID:7,USYNC_NO_VNAME_CERT:8}),ba=Object.freeze({PHOTO:1,VIDEO:2}),Ra=Object.freeze({SENDER_NUX_TYPE_C_IMPRESSION:1,SENDER_NUX_TYPE_D_IMPRESSION:2,SCREENSHOT_SENDER_NUX_TYPE_D_IMPRESSION:3,RECIPIENT_OPEN_NUX_TYPE_C_IMPRESSION:4,RECIPIENT_OPEN_NUX_TYPE_D_IMPRESSION:5,SENDER_NUX_TYPE_C_LEARN_MORE_TAP:6,SENDER_NUX_TYPE_D_LEARN_MORE_TAP:7,SCREENSHOT_SENDER_NUX_TYPE_D_LEARN_MORE_TAP:8,RECIPIENT_OPEN_NUX_TYPE_C_LEARN_MORE_TAP:9,RECIPIENT_OPEN_NUX_TYPE_D_LEARN_MORE_TAP:10,SCREENSHOT_BLOCKED:11,SCREENSHOT_TAKEN:12,SCREEN_RECORDING_BLOCKED:13,SCREEN_RECORDING_STARTED:14,PLACEHOLDER_MESSAGE_LEARN_MORE_TAP:15}),Na=Object.freeze({STATIC:0,SHARED:1}),wa=Object.freeze({WHATSAPP_CHATPSA:1}),La=Object.freeze({UNKNOWN:0,IS_REDIAL:1,NOT_REDIAL:2}),Da=Object.freeze({INVALID:0,NOT_SINGLE_SEGMENT_CALL:1,NOT_START_FROM_VIDEO_CALL:2,HAS_AV_SWITCH:3,SELF_CAMERA_OFF:4,PEER_CAMERA_OFF:5,SELF_HAS_NETWORK_TRANSITION:6,PEER_HAS_NETWORK_TRANSITION:7,CALL_TOO_SHORT:8,PASS:100}),ka=Object.freeze({UNCACHED:0,IDLE:1,CHECKING:2,DOWNLOADING:3,UPDATEREADY:4,OBSOLETE:5}),Ua=Object.freeze({UNCACHED:0,IDB:1,SW:2}),Ga=Object.freeze({IMPRESSION:1,CLICK_CTA:2,CLICK_DISMISS:3,AUTO_DISMISS:4}),xa=Object.freeze({OFFLINE:1,RESUME_CONNECTING:2,RESUME_LOADING_MSGS_PROGRESS:3,UPDATE_DUE_TO_SOFT_MIN:4,UWP_UPSELL:5,NOTIFICATION:6}),Ba=Object.freeze({INDIVIDUAL:0,GROUP:1,BROADCAST_LIST:2,COMMUNITY:3}),Fa=Object.freeze({SHOWED_PREVIEW_TO_USER:1,PREVIEW_TIMEOUT:2,PREVIEW_MALFORMED:3,PREVIEW_NOT_FOUND:4,PREVIEW_GENERAL_ERROR:5,PREVIEW_DECRYPTION_ERROR:6}),ja=Object.freeze({PROD:0,INTERN:1,DEV:2,E2E:3}),Ya=Object.freeze({COMPLETED:0,ERROR:1,TIMEOUT:2,ABORTED:3}),Ka=Object.freeze({SUCCESS:0,SILENCE:1,ZEROWIDTH:2}),Ha=Object.freeze({DOWNLOAD:1,UPLOAD:2}),Wa=Object.freeze({NEW_GROUP:1,CREATE_A_ROOM:2,PROFILE:3,CATALOG:4,ARCHIVED:5,STARRED:6,LABELS:7,SETTINGS:8,LOG_OUT:9,CONTACT_INFO:10,SELECT_MESSAGES:11,CLOSE_CHAT:12,MUTE_NOTIFICATIONS:13,CLEAR_MESSAGES:14,DELETE_CHAT:15,REPORT_BUSINESS:16,BLOCK:17,SETTINGS_NOTIFICATIONS:18,SETTINGS_THEME:19,SETTINGS_CHAT_WALLPAPER:20,SETTINGS_BLOCKED:21,SETTINGS_HELP:22,OPEN:23,CLOSE:24}),Va=Object.freeze({THREADS_SCREEN_CLICK:1,CHAT_SCREEN_CLICK:2,SETTINGS_SCREEN_CLICK:3}),$a=Object.freeze({LOAD_PREV:0,LOAD_NEXT:1,LOAD_AROUND:2}),za=Object.freeze({INTRO_PANEL:1,CHATLIST_DROPDOWN:2,BUTTERBAR:3}),qa=Object.freeze({NAVIGATE_NEXT:0,RELOAD:1,BACK_FORWARD:2,UNDEFINED:255}),Ja=Object.freeze({ANNOTATION_SIZE_LIMIT_EXCEEDED:1,MAX_POINT_COUNT_EXCEEDED:2,MAX_MARKER_COUNT_EXCEEDED:3,TOO_MANY_OPEN_MARKERS_TO_WRITE:4,POINT_TO_END_AT_NOT_FOUND:5,JSON_FORMAT_ERROR:6,MAX_STORAGE_EVENT_COUNT_REACHED:7,ERROR_UPLOADING_CHUNK:8,POINT_NAME_TOO_LONG:9,ANNOTATION_KEY_TOO_LONG:10,POINT_DATA_TOO_LONG:11,ERROR_PARSING_CONFIG:12}),Qa=Object.freeze({UNKNOWN:0,USER_SCROLL:1,NEW_MESSAGE_PREFETCH:2,SEARCH_RESULT_CLICK:3}),Xa=Object.freeze({OTHER:0,MSG_CLICK:1,STICKER_PANEL_ICON:2,MEDIA_VIEWER:3,VIDEO_STREAMING:4,STATUS_V3:5,MULTI_SELECT_DOWNLOAD:6,DOCUMENT_DOWNLOAD:7,PIP:8,STICKER_PANEL_STICKER:9,SEND_TO_CHAT:10,UPLOAD:11,MSG_INIT:12,MSG_UPDATE:13,MSG_DELETE:14,MSG_RENDER:15}),Za=Object.freeze({INITIAL_PAIRING:0,OFFLINE_RESUME:1,IDLE:2}),eo=Object.freeze({TEXT:0,URL:1,IMAGE:2,VIDEO:3,GIF:4}),to=Object.freeze({MY:0,RECENT:1,VIEWED:2,MUTED:3}),no=Object.freeze({STICKER_MAKER_BUTTON_TAP:0,IMAGE_UPLOADED:1,IMAGE_CROPPED:2,EMOJI_ADDED:3,STICKER_ADDED:4,TEXT_ADDED:5,IMAGE_OUTLINED:6,SEND_STICKER:7}),ro=Object.freeze({QR:0,MAIN:1,SYNCING:2,OFFLINE:3,CONFLICT:4,PROXYBLOCK:5,TOS_BLOCK:6,SMB_TOS_BLOCK:7,DEPRECATED_VERSION:8,LOCK:9}),io=Object.freeze({PHONE:0,SERVER:1}),ao=Object.freeze({GET:0,SET:1}),oo=Object.freeze({WEB:1,WIN32:2,DARWIN:3,IOS_TABLET:4,ANDROID_TABLET:5,WINSTORE:6,MACSTORE:7,DARWIN_BETA:8,WIN32_BETA:9}),so=Object.freeze({FALSE:0,TRUE:1,UNDEFINED:2}),lo=Object.freeze({SOURCE_OTHER:1,SOURCE_INSTAGRAM:2}),uo=Object.freeze({FIRST_WELCOME_MESSAGE_IMP:0,FIRST_MESSAGE_SENT:1,QUICK_QUESTIONS_TAP:2,ICEBREAKERS_IMP:3,SELECT_QUESTION_TAP:4,SEND_TAP:5,ADS_CONTENT_DISMISSED:6}),co=Object.freeze({IQ_REQUEST_FAILED:0,NO_WELCOME_MESSAGE_RETURNED:1,WELCOME_MESSAGE_RETURNED:2}),po=Object.freeze({DISCONNECTED:1,CONNECTING:2,CONNECTED:3,UNKNOWN:4}),_o=Object.freeze({DISABLED:0,ALLOC:1,ALLOC_AND_RTP:2}),fo=(0,a.defineGlobal)({abKey2:[4473,u,["regular"]],appBuild:[1657,S,["regular","private"]],appIsBetaRelease:[21,o,["regular","private"]],appVersion:[17,u,["regular","private"]],browser:[779,u,["regular"]],browserVersion:[295,u,["regular"]],datacenter:[2795,u,["regular"]],deviceName:[13,u,["regular","private"]],deviceVersion:[4505,u,["regular"]],expoKey:[5029,u,["regular","private"]],mcc:[5,s,["regular","private"]],memClass:[655,s,["regular","private"]],mnc:[3,s,["regular","private"]],networkIsWifi:[23,o,["regular"]],osVersion:[15,u,["regular","private"]],platform:[11,yr,["regular","private"]],psCountryCode:[6833,u,["private"]],psId:[6005,u,["private"]],webcBucket:[875,u,["regular"]],webcEnv:[633,ja,["regular"]],webcNativeAutolaunch:[1009,o,["regular"]],webcNativeBetaUpdates:[1007,o,["regular"]],webcPhoneAppVersion:[1005,u,["regular"]],webcPhoneCharging:[783,o,["regular"]],webcPhoneDeviceManufacturer:[829,u,["regular"]],webcPhoneDeviceModel:[831,u,["regular"]],webcPhoneOsBuildNumber:[833,u,["regular"]],webcPhoneOsVersion:[835,u,["regular"]],webcPhonePlatform:[707,yr,["regular"]],webcTabId:[3727,u,["regular"]],webcWebArch:[6605,u,["regular"]],webcWebDeviceManufacturer:[6599,u,["regular"]],webcWebDeviceModel:[6601,u,["regular"]],webcWebOsReleaseNumber:[6603,u,["regular"]],webcWebPlatform:[899,oo,["regular","private"]],yearClass:[689,s,["regular","private"]],yearClass2016:[2617,s,["regular","private"]]});(0,a.defineEvents)({AdvExpectedTsUnavailable:[3038,{},[1,1,1],"regular"],AdvIdentitySignatureInvalid:[3028,{advSignatureType:[1,bi]},[1,1,1],"regular"],AdvIdentityTimestampInvalid:[3046,{advIdentityIncomingTimestampInHours:[2,s],advIdentityLocalTimestampInHours:[1,s],advIdentityPrimaryIdentityMatch:[3,o]},[1,1,1],"regular"],AdvListSignatureInvalid:[3026,{},[1,1,1],"regular"],AdvListTimestampInvalid:[3040,{advListIncomingTimestampInHours:[2,s],advListIsExpired:[3,o],advListLocalTimestampInHours:[1,s]},[1,1,1],"regular"],AdvMetadataCreationFailure:[3048,{advMetadataIsMe:[1,o]},[1,1,1],"regular"],AdvPrimaryIdentityMissing:[3044,{primaryIdentityMissingProtoType:[1,Rr]},[1,1,1],"regular"],AdvProtoDecodeFailed:[3032,{advDecodeErrorType:[2,_],advDecodeProtoType:[1,f]},[1,1,1],"regular"],AdvProtoMissing:[3042,{advCompanionIdentityMissing:[2,o],missingProtoType:[1,Gn]},[1,1,1],"regular"],AdvStoredTimestampExpired:[3036,{advExpireTimeInHours:[1,s]},[1,1,1],"regular"],AdvTimestampMismatch:[3030,{advProtobufTimestampInHours:[2,s],advStanzaTimestampInHours:[1,s]},[1,1,1],"regular"],AdvUsyncInvalidKeyIndex:[3034,{},[1,1,1],"regular"],AndroidMessageSendPerf:[1994,{appRestart:[16,o],bucketedSenderKeyDistributionCountPercentage:[32,s],bucketedSenderKeyDistributionHashTime:[35,s],deviceCount:[36,s],deviceSizeBucket:[26,Ri],durationAbs:[11,c],durationRelative:[12,c],durationT:[1,c],fetchPrekeys:[15,o],fetchPrekeysPercentage:[21,s],groupSizeBucket:[17,Ne],isDirectedMessage:[33,o],isE2eBackfill:[27,o],isLid:[41,o],isMessageFanout:[9,o],isMessageForward:[8,o],isRevokeMessage:[24,o],isViewOnce:[29,o],jobsInQueue:[18,s],mediaType:[3,Pn],messageIsFirstUserMessage:[30,o],messageIsInvisible:[31,o],messageType:[4,Un],networkWasDisconnected:[14,o],participantCount:[37,s],phoneCores:[34,s],prekeysEligibleForPrallelProcessing:[28,o],receiverDeviceCount:[39,s],sendCount:[13,s],sendRetryCount:[10,s],sendStage:[2,we],senderDeviceCount:[40,s],senderKeyDistributionCountPercentage:[23,s],sessionsMissingWhenComposing:[25,o],targetDeviceGroupSizeBucket:[20,Ne],threadsInExecution:[19,s],typeOfGroup:[38,oa]},[1,1,2e3],"regular"],ArchiveSettings:[2788,{keepChatsArchived:[1,o]},[1,1,1],"regular"],ArchiveStateDaily:[2810,{settingsKeepChatsArchived:[5,o],totalGroupArchivedChats:[2,s],totalIndividualArchivedChats:[1,s],totalUnreadGroupArchivedChats:[4,s],totalUnreadIndividualArchivedChats:[3,s]},[1,1,1],"regular"],AutoMuteLargeGroupActions:[3880,{autoMuteAction:[1,C],autoMuteGroupId:[2,u],autoMuteGroupSize:[3,s]},[1,1,1],"regular"],AutoReply:[3212,{autoReplyAction:[1,P]},[1,1,1],"private",113760892],BadInteraction:[3316,{actual:[1,c],name:[2,u],threshold:[3,c]},[1,1,1],"regular"],BannerEvent:[1578,{bannerId:[3,u],bannerOperation:[2,b],bannerType:[1,R]},[1,1,1],"regular"],BizCatalogView:[3006,{bizPlatform:[14,w],cartToggle:[13,o],catalogCategoryId:[19,u],catalogEntryPoint:[2,pe],catalogEventSampled:[11,o],catalogOwnerJid:[10,u],catalogReportReasonCode:[8,u],catalogSessionId:[3,u],catalogViewAction:[1,_e],collectionId:[15,u],collectionIndex:[16,u],deepLinkOpenFrom:[12,et],isNewProductAddedToCart:[7,o],isOrderMsgAttached:[5,o],orderId:[4,u],productId:[9,u],productIndex:[17,u],quantity:[6,s],sequenceNumber:[18,s]},[1,1,1],"private",0],BizProfileView:[3008,{bizFbSize:[8,ia],bizIgSize:[9,ia],businessProfileJid:[2,u],catalogSessionId:[6,u],hasCoverPhoto:[13,o],isProfileLinked:[10,o],isSelfView:[11,o],linkedAccount:[5,q],profileEntryPoint:[12,Br],scrollDepth:[4,s],sequenceNumber:[7,s],viewBusinessProfileAction:[1,Ia],websiteSource:[3,lo]},[1,1,1],"private",0],BlockEvents:[3862,{blockEntryPoint:[1,L],blockEventActionType:[2,D],blockEventIsSuspicious:[4,o],blockEventIsUnsub:[3,o]},[1,1,1],"private",113760892],BusinessInteraction:[3450,{businessInteractionAction:[1,G],businessInteractionTargetScreen:[2,j],businessJid:[3,u],entryPointApp:[4,x],entryPointSource:[5,B],internalEntryPoint:[6,F],sequenceNumber:[7,s]},[1,1,1],"private",113760892],BusinessMute:[1376,{muteT:[2,c],muteeId:[1,u]},[1,1,1],"regular"],BusinessProfileView:[2440,{businessOwnerJid:[2,u],businessProfileViewAction:[1,W],businessProfileWebsiteSourceTyp:[3,V]},[1,1,1],"private",113760892],BusinessTemplateMessageIncomingStats:[3762,{businessPhoneNumber:[1,s],chatsFolderType:[2,be],isKeepChatsArchivedEnabled:[3,o],isMuted:[4,o],isNotificationEnabled:[5,o],templateId:[6,u]},[1,1,1],"private",0],BusinessTemplateMessageNotificationStats:[3764,{businessPhoneNumber:[1,s],templateId:[2,u]},[1,1,1],"private",0],BusinessTemplateMessageReadStats:[3766,{businessPhoneNumber:[1,s],chatsFolderType:[2,be],deltaTime:[3,s],readSource:[4,hi],templateId:[5,u]},[1,1,1],"private",0],BusinessTemplateMessageReplyStats:[3768,{businessPhoneNumber:[1,s],deltaTime:[2,s],templateId:[3,u]},[1,1,1],"private",0],BusinessTemplateMessageThreadLevelUserAction:[3770,{businessPhoneNumber:[1,s],deltaTime:[2,s],templateId:[3,u],threadActionEntryPoint:[4,ea],threadLevelAction:[5,ta]},[1,1,1],"private",0],BusinessTemplateMessageUserAction:[3772,{businessPhoneNumber:[1,s],deltaTime:[2,s],messageLevelAction:[3,wn],templateId:[4,u]},[1,1,1],"private",0],BusinessToolsClick:[2218,{businessToolsEntryPoint:[5,$],businessToolsItem:[3,z],businessToolsSequenceNumber:[2,s],businessToolsSessionId:[1,u],linkingTarget:[4,q]},[1,1,1],"regular"],BusinessToolsEntry:[2216,{businessToolsEntryPoint:[3,$],businessToolsSequenceNumber:[2,s],businessToolsSessionId:[1,u]},[1,1,1],"regular"],BusinessToolsImpression:[2220,{businessToolsEntryPoint:[4,$],businessToolsSequenceNumber:[2,s],businessToolsSessionId:[1,u]},[1,1,1],"regular"],BusinessUnmute:[1378,{muteeId:[1,u]},[1,1,1],"regular"],CadminDemote:[3426,{cadminDemoteOrigin:[1,J],cadminDemoteResult:[2,Q],isLastCadminOrCreator:[4,o]},[1,1,1],"regular"],Call:[462,{acceptAckLatencyMs:[1016,c],acceptedButNotConnectedTimeSpentMs:[1015,c],activeRelayProtocol:[412,s],aflDisPrefetchFailure1x:[1186,c],aflDisPrefetchFailure2x:[1187,c],aflDisPrefetchFailure4x:[1188,c],aflDisPrefetchFailure8x:[1189,c],aflDisPrefetchFailureTotal:[1190,c],aflDisPrefetchSuccess1x:[1191,c],aflDisPrefetchSuccess2x:[1192,c],aflDisPrefetchSuccess4x:[1193,c],aflDisPrefetchSuccess8x:[1194,c],aflDisPrefetchSuccessTotal:[1195,c],aflNackFailure1x:[1196,c],aflNackFailure2x:[1197,c],aflNackFailure4x:[1198,c],aflNackFailure8x:[1199,c],aflNackFailureTotal:[1200,c],aflNackSuccess1x:[1201,c],aflNackSuccess2x:[1202,c],aflNackSuccess4x:[1203,c],aflNackSuccess8x:[1204,c],aflNackSuccessTotal:[1205,c],aflOther1x:[1206,c],aflOther2x:[1207,c],aflOther4x:[1208,c],aflOther8x:[1209,c],aflOtherTotal:[1210,c],aflPureLoss1x:[1211,c],aflPureLoss2x:[1212,c],aflPureLoss4x:[1213,c],aflPureLoss8x:[1214,c],aflPureLossTotal:[1215,c],allocErrorBitmap:[593,s],androidAudioRouteMismatch:[1055,o],androidCamera2MinHardwareSupportLevel:[444,m],androidCameraApi:[443,y],androidSystemPictureInPictureT:[477,c],androidTelecomTimeSpentBeforeReject:[497,c],appInBackgroundDuringCall:[1109,o],audStreamMixPct:[1119,l],audioCodecDecodedFecFrames:[755,s],audioCodecDecodedPlcFrames:[756,s],audioCodecEncodedFecFrames:[751,s],audioCodecEncodedNonVoiceFrames:[753,s],audioCodecEncodedThrottledVoiceFrames:[1177,s],audioCodecEncodedVoiceFrames:[752,s],audioCodecReceivedFecFrames:[754,s],audioDeviceIssues:[860,s],audioDeviceLastIssue:[861,s],audioDeviceSwitchCount:[867,s],audioDeviceSwitchDuration:[866,c],audioFrameLoss1xMs:[724,c],audioFrameLoss2xMs:[725,c],audioFrameLoss4xMs:[726,c],audioFrameLoss8xMs:[727,c],audioGetFrameUnderflowPs:[83,s],audioInbandFecDecoded:[679,s],audioInbandFecEncoded:[678,s],audioJbResets:[1318,s],audioJbResetsPartial:[1334,s],audioLossPeriodCount:[722,s],audioNackHbhEnabled:[1184,o],audioNackReqPktsProcessed:[1271,s],audioNackReqPktsRecvd:[646,s],audioNackReqPktsSent:[645,s],audioNackRtpRetransmitDiscardCount:[649,s],audioNackRtpRetransmitFailCount:[651,s],audioNackRtpRetransmitRecvdCount:[648,s],audioNackRtpRetransmitReqCount:[647,s],audioNackRtpRetransmitSentCount:[650,s],audioNumPiggybackRxPkt:[1008,s],audioNumPiggybackTxPkt:[1007,s],audioPktsNotTriggerOutOfPaused:[1283,s],audioPlayCbIntervalGtDefaultCnt:[1138,s],audioPlayCbLatencyGteMaxCnt:[1139,s],audioPutFrameOverflowPs:[82,s],audioRecCbLatencyAvg:[1036,s],audioRecCbLatencyMax:[1035,s],audioRecCbLatencyMin:[1034,s],audioRecCbLatencyStddev:[1037,s],audioRtxPktDiscarded:[677,s],audioRtxPktProcessed:[676,s],audioRtxPktSent:[675,s],audioRxAvgFpp:[728,l],audioRxPktLossPctDuringPip:[642,l],audioRxUlpFecPkts:[1358,s],audioSwbDurationMs:[1322,c],audioTarget06Ms:[1351,s],audioTarget1015Ms:[1352,s],audioTarget1520Ms:[1353,s],audioTarget2030Ms:[1354,s],audioTarget30PlusMs:[1355,s],audioTarget610Ms:[1356,s],audioTargetBitrateDrops:[1357,s],audioTotalBytesOnNonDefCell:[450,l],audioTxUlpFecPkts:[1359,s],audioUlpFecRecovered:[1360,s],avAvgDelta:[192,l],avMaxDelta:[193,l],aveNumPeersAutoPaused:[578,s],aveTimeBwResSwitches:[994,c],aveTimeBwVidRcDynCondTrue:[719,c],avgClockCbT:[139,c],avgCpuUtilizationPct:[1220,l],avgDecodeT:[136,c],avgEncRestartAndKfGenT:[1048,c],avgEncRestartIntervalT:[1047,c],avgEncodeT:[135,c],avgEventQueuingDelay:[816,s],avgLoudnessDiffNoiseFrames:[1302,l],avgLoudnessDiffSpeechFrames:[1303,l],avgLoudnessInputNoiseFrames:[1304,l],avgLoudnessInputSpeechFrames:[1305,l],avgLoudnessOutputNoiseFrames:[1306,l],avgLoudnessOutputSpeechFrames:[1307,l],avgPlayCbIntvT:[1152,c],avgPlayCbT:[137,c],avgRecordCbIntvT:[495,c],avgRecordCbT:[138,c],avgRecordGetFrameT:[140,c],avgTargetBitrate:[141,l],avgTcpConnCount:[413,s],avgTcpConnLatencyInMsec:[414,c],batteryDropMatched:[355,o],batteryDropTriggered:[442,o],batteryLowMatched:[354,o],batteryLowTriggered:[441,o],batteryRulesApplied:[353,o],biDirRelayRebindLatencyMs:[843,c],biDirRelayResetLatencyMs:[844,c],boundSocketIpAddressIsInvalid:[1222,s],builtinAecAvailable:[33,o],builtinAecEnabled:[38,o],builtinAecImplementor:[36,u],builtinAecUuid:[37,u],builtinAgcAvailable:[34,o],builtinNsAvailable:[35,o],bwaVidDisablingCandidate:[1114,o],bwaVidDisablingRxCandidateDuration:[1116,c],bwaVidDisablingTxCandidateDuration:[1115,c],bweEvaluationScoreE2e:[1068,s],bweEvaluationScoreSfuDl:[1070,s],bweEvaluationScoreSfuUl:[1069,s],c2DecAvgT:[302,c],c2DecFrameCount:[300,s],c2DecFramePlayed:[301,s],c2EncAvgT:[298,c],c2EncCpuOveruseCount:[299,s],c2EncFrameCount:[297,s],c2RxTotalBytes:[296,s],c2TxTotalBytes:[295,s],callAcceptFuncT:[132,c],callAecMode:[39,h],callAecOffset:[42,s],callAecTailLength:[43,s],callAgcMode:[52,g],callAndrGcmFgEnabled:[268,o],callAndroidAudioMode:[55,s],callAndroidRecordAudioPreset:[57,s],callAndroidRecordAudioSource:[56,s],callAudioEngineType:[54,v],callAudioOutputRoute:[1336,A],callAudioRestartCount:[96,l],callAudioRestartReason:[97,l],callAvgAudioRxPipBitrate:[640,l],callAvgRottRx:[259,c],callAvgRottTx:[258,c],callAvgRtt:[107,c],callAvgVideoRxPipBitrate:[638,l],callBatteryChangePct:[195,l],callCalculatedEcOffset:[50,s],callCalculatedEcOffsetStddev:[51,s],callCreatorHid:[505,u],callDefNetwork:[405,Z],callEcRestartCount:[99,l],callEchoEnergy:[46,l],callEchoLikelihood:[44,s],callEchoLikelihoodBeforeEc:[47,l],callEndFrameLossMs:[1142,c],callEndFuncT:[130,c],callEndReconnecting:[70,o],callEndReconnectingBeforeNetworkChange:[877,o],callEndReconnectingBeforeP2pFailover:[875,o],callEndReconnectingBeforeRelayFailover:[869,o],callEndReconnectingBeforeRelayReset:[948,o],callEndReconnectingSoonAfterCallActive:[848,o],callEndReconnectingSoonAfterNetworkChange:[878,o],callEndReconnectingSoonAfterP2pFailover:[876,o],callEndReconnectingSoonAfterRelayFailover:[870,o],callEndReconnectingSoonAfterRelayReset:[949,o],callEndedDuringAudFreeze:[518,o],callEndedDuringVidFreeze:[517,o],callEndedInterrupted:[23,o],callEnterPipModeCount:[626,s],callFromUi:[2,X],callHistEchoLikelihood:[45,l],callInitRxPktLossPct3s:[1157,l],callInitialRtt:[109,c],callInterrupted:[22,o],callLastRtt:[108,c],callMaxRtt:[106,c],callMessagesBufferedCount:[422,s],callMinRtt:[105,c],callNetwork:[76,Z],callNetworkSubtype:[77,s],callNsMode:[53,Zn],callOfferAckTimout:[159,l],callOfferDelayT:[243,c],callOfferElapsedT:[102,c],callOfferFanoutCount:[588,s],callOfferReceiptDelay:[134,c],callP2pAvgRtt:[457,c],callP2pDisabled:[18,o],callP2pMinRtt:[456,c],callPeerAppVersion:[15,u],callPeerIpStr:[10,u],callPeerIpv4:[8,s],callPeerPlatform:[5,u],callPeerTestBucket:[1225,u],callPendingCallsAcceptedCount:[501,s],callPendingCallsCount:[498,s],callPendingCallsRejectedCount:[499,s],callPendingCallsTerminatedCount:[500,s],callPipMode10sCount:[628,s],callPipMode10sT:[633,c],callPipMode120sCount:[631,s],callPipMode120sT:[636,c],callPipMode240sCount:[632,s],callPipMode240sT:[637,c],callPipMode30sCount:[629,s],callPipMode30sT:[634,c],callPipMode60sCount:[630,s],callPipMode60sT:[635,c],callPipModeT:[627,c],callPlaybackBufferSize:[59,s],callPlaybackCallbackStopped:[25,o],callPlaybackFramesPs:[93,l],callPlaybackSilenceRatio:[95,l],callRadioType:[231,pi],callRandomId:[529,u],callRecentPlaybackFramesPs:[94,l],callRecentRecordFramesPs:[29,l],callReconnectingStateCount:[438,s],callRecordBufferSize:[58,s],callRecordCallbackStopped:[24,o],callRecordFramesPs:[28,s],callRecordMaxEnergyRatio:[98,l],callRecordSilenceRatio:[26,s],callRejectFuncT:[131,c],callRelayAvgRtt:[455,c],callRelayBindStatus:[16,ee],callRelayCreateT:[104,c],callRelayErrorCode:[1300,s],callRelayMinRtt:[454,c],callRelayServer:[17,u],callRelaysReceived:[1301,s],callReplayerId:[1155,u],callResult:[63,te],callRingingT:[103,c],callRxAvgBitrate:[121,l],callRxAvgBwe:[122,l],callRxAvgJitter:[125,c],callRxAvgLossPeriod:[128,c],callRxBweCnt:[1329,s],callRxMaxJitter:[124,c],callRxMaxLossPeriod:[127,c],callRxMinJitter:[123,c],callRxMinLossPeriod:[126,c],callRxPktLossPct:[120,l],callRxPktLossRetransmitPct:[892,l],callRxStoppedT:[100,c],callSamplingRate:[30,s],callSelfIpStr:[9,u],callSelfIpv4:[7,s],callServerNackErrorCode:[68,s],callSetupErrorType:[71,ne],callSetupT:[101,c],callSide:[1,re],callSoundPortFuncT:[133,c],callStartFuncT:[129,c],callSwAecMode:[41,s],callSwAecType:[40,Xi],callSystemPipDurationT:[1363,c],callT:[92,c],callTermReason:[69,ie],callTestBoolean:[1324,o],callTestBucket:[19,u],callTestDouble:[1325,l],callTestEvent:[318,s],callTestInteger:[1326,ae],callTestLong:[1327,s],callTestString:[1328,u],callTonesDetectedInRecord:[49,s],callTonesDetectedInRingback:[48,s],callTransitionCount:[78,s],callTransitionCountCellularToWifi:[432,s],callTransitionCountWifiToCellular:[431,s],callTransport:[72,oe],callTransportExtrayElected:[515,o],callTransportMaxAllocRetries:[1268,s],callTransportP2pToRelayFallbackCount:[80,s],callTransportPeerTcpUsed:[587,o],callTransportRelayToRelayFallbackCount:[79,s],callTransportTcpFallbackToUdp:[516,o],callTransportTcpUsed:[514,o],callTransportTotalRxAllocBytes:[1319,l],callTransportTotalTxAllocBytes:[1320,l],callTransportTxAllocCnt:[1321,s],callTxAvgBitrate:[112,l],callTxAvgBwe:[113,l],callTxAvgJitter:[116,c],callTxAvgLossPeriod:[119,c],callTxBweCnt:[1330,s],callTxMaxJitter:[115,c],callTxMaxLossPeriod:[118,c],callTxMinJitter:[114,c],callTxMinLossPeriod:[117,c],callTxPktErrorPct:[111,l],callTxPktLossPct:[110,l],callUserRate:[20,s],callWakeupSource:[156,le],calleeAcceptToDecodeT:[447,c],callerInContact:[476,o],callerOfferToDecodeT:[445,c],callerVidRtpToDecodeT:[446,c],cameraFormats:[765,s],cameraIssues:[850,s],cameraLastIssue:[851,s],cameraOffCount:[331,s],cameraPauseT:[1131,c],cameraPermission:[849,o],cameraPreviewMode:[322,ue],cameraStartDuration:[852,c],cameraStartFailureDuration:[856,c],cameraStartMode:[233,ce],cameraStartToFirstFrameT:[916,c],cameraStopDuration:[853,c],cameraStopFailureCount:[858,s],cameraSwitchCount:[855,s],cameraSwitchDuration:[854,c],cameraSwitchFailureDuration:[857,c],clampedBwe:[527,o],codecSamplingRate:[624,s],combinedE2eAvgRtt:[760,l],combinedE2eMaxRtt:[761,l],combinedE2eMinRtt:[759,l],confBridgeSamplingRate:[623,s],connectedToCar:[1226,o],conservativeModeStopped:[974,o],conservativeRampUpExploringT:[743,c],conservativeRampUpHeldCount:[643,s],conservativeRampUpHoldingT:[741,c],conservativeRampUpRampingUpT:[742,c],cpuOverUtilizationPct:[1223,l],createdFromGroupCallDowngrade:[519,o],dataLimitOnAltNetworkReached:[537,o],deviceBoard:[230,u],deviceClass:[1269,u],deviceHardware:[229,u],dlOnlyHighPlrPct:[1364,l],droppedVideoFrameOutOfPausedMs:[1284,c],dtxRxByteFrameCount:[914,s],dtxRxCount:[912,s],dtxRxDurationT:[911,c],dtxRxTotalCount:[913,s],dtxRxTotalFrameCount:[1083,s],dtxTxByteFrameCount:[910,s],dtxTxCount:[619,s],dtxTxDurationT:[618,c],dtxTxTotalCount:[909,s],dtxTxTotalFrameCount:[1082,s],echoCancellationMsPerSec:[320,s],echoCancellationNumLoops:[1264,s],echoCancelledFrameCount:[940,s],echoEstimatedFrameCount:[941,s],echoMaxConvergeFrameCount:[1265,s],echoSpeakerModeFrameCount:[987,s],encoderCompStepdowns:[81,s],endCallAfterConfirmation:[90,St],failureToCreateAltSocket:[534,s],failureToCreateTestAltSocket:[532,s],fastplayMaxDurationMs:[1005,c],fastplayNumFrames:[1004,s],fastplayNumTriggers:[1006,s],fieldStatsRowType:[328,Ot],finishedDlBwe:[503,o],finishedOverallBwe:[528,o],finishedUlBwe:[502,o],freezeAheadBweCongestionCorrPct:[1051,l],freezeBweCongestionCorrPct:[1009,l],gainAdjustedMicAvgPower:[1292,s],gainAdjustedMicMaxPower:[1293,s],gainAdjustedMicMinPower:[1294,s],groupAcceptNoCriticalGroupUpdate:[1013,o],groupAcceptToCriticalGroupUpdateMs:[1014,c],groupCallCallerParticipantCountAtCallStart:[439,s],groupCallInviteCountSinceCallStart:[360,s],groupCallIsGroupCallInvitee:[357,o],groupCallIsLastSegment:[356,o],groupCallNackCountSinceCallStart:[361,s],groupCallReringCountSinceCallStart:[946,s],groupCallReringNackCountSinceCallStart:[947,s],groupCallSegmentIdx:[329,s],groupCallTotalCallTSinceCallStart:[358,c],groupCallTotalP3CallTSinceCallStart:[359,c],groupCallVideoMaximizedCount:[592,s],hasRestrictedSettingsForAudioCalls:[539,o],hbhSrtcpRxBytes:[1256,s],hbhSrtcpRxRejAuthFail:[1257,s],hbhSrtcpRxRejEinval:[1258,s],hbhSrtcpRxRejectedPktCntFromOldRelay:[1219,s],hbhSrtcpRxSuccessNackPktCnt:[1248,s],hbhSrtcpRxSuccessRembPktCnt:[1249,s],hbhSrtcpRxSuccessSbwaPktCnt:[1250,s],hbhSrtcpRxSuccessSpPktCnt:[1251,s],hbhSrtcpTxBytes:[1259,s],hbhSrtcpTxNackPktCnt:[1254,s],hbweHistoryBasedAvgVideoTxBitrate:[1279,s],hbweHistoryBasedBweInstantRampUpDone:[1280,o],hbweHistoryBasedBweUpdateCeilingDone:[1281,o],hbweHistoryBasedBweUpdateCeilingForced:[1282,o],highPeerBweT:[884,c],hisBasedInitialTxBitrate:[342,s],hisInfoCouldBeUsedForInitBwe:[339,o],historyBasedBweActivated:[807,o],historyBasedBweEnabled:[806,o],historyBasedBweSuccess:[808,o],historyBasedBweVideoTxBitrate:[809,s],imbalancedDlPlrTPct:[1350,l],incomingCallUiAction:[387,xt],initBweSource:[337,Bt],initialEstimatedTxBitrate:[244,l],isCallCreator:[1323,o],isCallFull:[1149,o],isFromCallLink:[1316,o],isIpv6Capable:[91,o],isLinkCreator:[1372,o],isLinkJoin:[1335,o],isLinkedGroupCall:[1090,o],isOsMicrophoneMute:[1227,o],isPendingCall:[976,o],isRejoin:[927,o],isRering:[945,o],isUpnpExternalIpPrivate:[260,o],isUpnpExternalIpTheSameAsReflexiveIp:[261,o],jbAvgDelay:[146,l],jbAvgDelayUniform:[644,l],jbAvgDisorderTargetSize:[1086,l],jbAvgTargetSize:[1012,l],jbDiscards:[150,l],jbEmpties:[151,l],jbEmptyPeriods1x:[997,l],jbEmptyPeriods2x:[998,l],jbEmptyPeriods4x:[999,l],jbEmptyPeriods8x:[1e3,l],jbGets:[152,l],jbLastDelay:[149,l],jbLost:[277,l],jbLostEmptyDuringPip:[641,s],jbLostEmptyHighPeerBwePerSec:[777,l],jbLostEmptyLowPeerBwePerSec:[775,l],jbLostEmptyLowToHighPeerBwePerSec:[776,l],jbMaxDelay:[148,l],jbMaxDisorderTargetSize:[1087,l],jbMinDelay:[147,l],jbNonSpeechDiscards:[846,l],jbPuts:[153,l],jbTotalEmptyPeriods:[996,l],jbVoiceFrames:[1081,s],joinableAfterCall:[895,o],joinableDuringCall:[894,o],joinableNewUi:[893,o],keyFrameVqsOpenh264:[1315,l],l1Locations:[986,u],lastConnErrorStatus:[415,s],libsrtpVersionUsed:[504,Li],lobbyVisibleT:[1127,c],logSampleRatio:[1120,s],lonelyT:[1331,c],longConnect:[21,o],lossOfAltSocket:[535,s],lossOfTestAltSocket:[533,s],lowDataUsageBitrate:[157,l],lowPeerBweT:[885,c],lowToHighPeerBweT:[886,c],malformedStanzaXpath:[452,u],maxConnectedParticipants:[1085,s],maxEventQueueDepth:[558,s],mediaStreamSetupT:[448,c],micAvgPower:[253,s],micMaxPower:[252,s],micMinPower:[251,s],micPermission:[859,o],micStartDuration:[862,c],micStartToFirstCallbackT:[931,c],micStopDuration:[863,c],multipleTxRxRelaysInUse:[838,o],muteNotSupportedCount:[1169,s],muteReqAlreadyMutedCount:[1170,s],muteReqTimeoutsCount:[1171,s],nativeSamplesPerFrame:[32,u],nativeSamplingRate:[31,u],neteqAcceleratedFrames:[653,s],neteqExpandedFrames:[652,s],networkFailoverTriggeredCount:[1135,s],networkMediumChangeLatencyMs:[995,c],newEndCallSurveyVersion:[1361,s],nseEnabled:[1128,o],nseOfflineQueueMs:[1129,c],numAsserts:[933,s],numConnectedParticipants:[330,s],numConnectedPeers:[1052,s],numCriticalGroupUpdateDropped:[567,s],numDirPjAsserts:[985,s],numInvitedParticipants:[1054,s],numL1Errors:[929,s],numL2Errors:[930,s],numOutOfOrderCriticalGroupUpdate:[625,s],numOutgoingRingingPeers:[1053,s],numPeersAutoPausedOnce:[577,s],numRenderSkipGreenFrame:[1029,s],numResSwitch:[993,s],numTransitionsToSpeech:[1113,s],numVidDlAutoPause:[574,s],numVidDlAutoResume:[576,s],numVidDlAutoResumeRejectBadAudio:[579,s],numVidRcDynCondTrue:[717,s],numVidUlAutoPause:[559,s],numVidUlAutoPauseFail:[560,s],numVidUlAutoPauseRejectHighSendingRate:[564,s],numVidUlAutoPauseRejectTooEarly:[565,s],numVidUlAutoPauseUserAction:[566,s],numVidUlAutoResume:[561,s],numVidUlAutoResumeFail:[562,s],numVidUlAutoResumeRejectAudioLqm:[563,s],numberOfProcessors:[27,s],offerAckLatencyMs:[1017,c],oibweDlProbingTime:[805,c],oibweE2eProbingTime:[802,c],oibweNotFinishedWhenCallActive:[868,o],oibweOibleProbingTime:[803,c],oibweUlProbingTime:[804,c],onMobileDataSaver:[525,o],onWifiAtStart:[540,o],oneSideInitRxBitrate:[507,s],oneSideInitTxBitrate:[506,s],oneSideMinPeerInitRxBitrate:[509,s],oneSideRcvdPeerRxBitrate:[508,o],opusVersion:[287,s],p2pSuccessCount:[522,s],pausedRtcpCount:[1285,s],pcntPoorAudLqmAfterPause:[599,l],pcntPoorAudLqmBeforePause:[598,l],pcntPoorVidLqmAfterPause:[597,l],pcntPoorVidLqmBeforePause:[596,l],pctPeersOnCellular:[1314,l],peerCallNetwork:[264,dr],peerCallResult:[66,te],peerRxForErrorRelayBytes:[1340,l],peerRxForOtherRelayBytes:[1341,l],peerRxForTxRelayBytes:[1342,l],peerTransport:[591,oe],peerVideoHeight:[191,s],peerVideoWidth:[190,s],peerXmppStatus:[4,po],peersMuteSuccCount:[1172,s],peersRejectedMuteReqCount:[1173,s],pingsSent:[160,l],pongsReceived:[161,l],poolMemUsage:[510,s],poolMemUsagePadding:[511,s],presentEndCallConfirmation:[89,St],prevCallTestBucket:[1060,u],previousCallInterval:[266,c],previousCallVideoEnabled:[265,o],previousCallWithSamePeer:[267,o],probeAvgBitrate:[327,l],pstnCallExists:[1228,o],pushToCallOfferDelay:[158,l],rcMaxrtt:[155,l],rcMinrtt:[154,l],receivedByNse:[1130,o],reconnectingStartsBeforeCallActive:[847,o],recordCircularBufferFrameCount:[84,s],reflectivePortsDiff:[162,l],rejectMuteReqCount:[1174,s],rekeyTime:[1140,s],relayBindFailureAltNetSwitchSuccess:[583,s],relayBindFailureAltNetSwitchTriggered:[582,s],relayBindFailureAltNetworkSwitchToCallEnd:[586,c],relayBindFailureFallbackCount:[581,s],relayBindFailureIpVersionSwitchToCallEnd:[585,c],relayBindFailureIpVersionSwitchTriggered:[584,s],relayBindTimeInMsec:[424,c],relayElectionTimeInMsec:[423,c],relayFallbackOnRxDataFromRelay:[481,s],relayFallbackOnStopRxDataOnP2p:[482,s],relayFallbackOnTransportStanzaNotification:[483,s],relaySwapped:[1309,s],renderFreezeHighPeerBweT:[780,c],renderFreezeLowPeerBweT:[778,c],renderFreezeLowToHighPeerBweT:[779,c],rtcpRembInVideoCnt:[1362,s],rxAllocRespNoMatchingTid:[1168,s],rxForErrorRelayBytes:[1310,l],rxForOtherRelayBytes:[1311,l],rxForTxRelayBytes:[1312,l],rxProbeCountSuccess:[291,s],rxProbeCountTotal:[290,s],rxRelayRebindLatencyMs:[841,c],rxRelayResetLatencyMs:[842,c],rxSubOnScreenDur:[1295,c],rxSubRequestSentCnt:[1370,s],rxSubRequestThrottledCnt:[1296,s],rxSubSwitchCnt:[1297,s],rxSubVideoWaitDur:[1298,c],rxSubVideoWaitDurAvg:[1366,c],rxSubVideoWaitDurSum:[1367,c],rxTotalBitrate:[145,l],rxTotalBytes:[143,l],rxTpFbBitrate:[294,l],rxTrafficStartFalsePositive:[758,o],sbweAvgDowntrend:[963,l],sbweAvgUptrend:[962,l],sbweCeilingCongestionCount:[783,s],sbweCeilingCount:[781,s],sbweCeilingMissingRtcpCongestionCount:[786,s],sbweCeilingNoNewDataReceivedCongestionCount:[787,s],sbweCeilingPktLossCount:[782,s],sbweCeilingReceiveSideCount:[1106,s],sbweCeilingRttCongestionCount:[784,s],sbweCeilingZeroRttCongestionCount:[785,s],sbweGlobalMinRttCongestionCount:[1103,s],sbweHighestRttCongestionCount:[1133,s],sbweHoldCount:[961,s],sbweHoldDuration:[1347,c],sbweMinRttEmaCongestionCount:[1104,s],sbweMinRttSlideWindowCount:[1308,s],sbweRampDownCount:[960,s],sbweRampDownDuration:[1348,c],sbweRampUpCount:[959,s],sbweRampUpDuration:[1349,c],sbweRampUpPauseCount:[1134,s],selfMuteSuccessCount:[1175,s],selfUnmuteAfterMuteReqCount:[1176,s],senderBweInitBitrate:[975,s],serverRecommendedRelayReceivedMs:[1339,c],serverRecommendedToElectedRelayMs:[1266,c],sfuAbnormalUplinkRttCount:[879,s],sfuAvgDlPlrAtBalancedCongestion:[1096,l],sfuAvgDlPlrAtHighDlCongestion:[1094,l],sfuAvgDlPlrAtHighUlCongestion:[1092,l],sfuAvgLqHqTargetBitrateDiff:[1002,l],sfuAvgPeerRttAtBalancedCongestion:[1102,s],sfuAvgPeerRttAtHighPeerCongestion:[1100,s],sfuAvgPeerRttAtHighSelfCongestion:[1098,s],sfuAvgSelfRttAtBalancedCongestion:[1101,s],sfuAvgSelfRttAtHighPeerCongestion:[1099,s],sfuAvgSelfRttAtHighSelfCongestion:[1097,s],sfuAvgTargetBitrate:[673,l],sfuAvgTargetBitrateHq:[943,l],sfuAvgUlPlrAtBalancedCongestion:[1095,l],sfuAvgUlPlrAtHighDlCongestion:[1093,l],sfuAvgUlPlrAtHighUlCongestion:[1091,l],sfuBalancedPktLossAtCongestion:[1075,s],sfuBalancedRttAtCongestion:[1079,s],sfuBwaAllParticipantDlBwUsedPct:[919,l],sfuBwaAllParticipantUlBwUsedPct:[918,l],sfuBwaChangeNumStreamCount:[928,s],sfuBwaSelfDlBwUsedPct:[1003,l],sfuBwaSelfUlBwUsedPct:[917,l],sfuBwaSimulcastDisabledCntReasonBattery:[920,s],sfuBwaSimulcastDisabledCntReasonNetMedium:[921,s],sfuBwaVidEncHqStreamScheduledT:[926,c],sfuBwaVidEncLqStreamScheduledT:[925,c],sfuDownlinkAvgCombinedBwe:[662,l],sfuDownlinkAvgPktLossPct:[667,l],sfuDownlinkAvgRemoteBwe:[661,l],sfuDownlinkAvgSenderBwe:[660,l],sfuDownlinkInitCombinedBwe3s:[1158,l],sfuDownlinkInitPktLossPct3s:[1159,l],sfuDownlinkMaxPktLossPct:[668,l],sfuDownlinkMinPktLossPct:[666,l],sfuDownlinkSbweAvgDowntrend:[973,l],sfuDownlinkSbweAvgUptrend:[972,l],sfuDownlinkSbweCeilingCongestionCount:[797,s],sfuDownlinkSbweCeilingCount:[795,s],sfuDownlinkSbweCeilingMissingRtcpCongestionCount:[800,s],sfuDownlinkSbweCeilingNoNewDataReceivedCongestionCount:[801,s],sfuDownlinkSbweCeilingPktLossCount:[796,s],sfuDownlinkSbweCeilingRttCongestionCount:[798,s],sfuDownlinkSbweCeilingZeroRttCongestionCount:[799,s],sfuDownlinkSbweHoldCount:[971,s],sfuDownlinkSbweRampDownCount:[970,s],sfuDownlinkSbweRampUpCount:[969,s],sfuDownlinkSenderBweDiffStddev:[958,l],sfuDownlinkSenderBweStddev:[957,l],sfuFirstRxBandwidthReportTime:[1111,c],sfuFirstRxParticipantReportTime:[883,c],sfuFirstRxUplinkReportTime:[881,c],sfuHighDlPktLossAtCongestion:[1074,s],sfuHighDlRttAtCongestion:[1078,s],sfuHighUlPktLossAtCongestion:[1073,s],sfuHighUlRttAtCongestion:[1077,s],sfuMaxTargetBitrate:[674,l],sfuMaxTargetBitrateHq:[944,l],sfuMinTargetBitrate:[672,l],sfuMinTargetBitrateHq:[942,l],sfuPeerDownlinkStddevAllCombinedBwe:[813,l],sfuRxBandwidthReportCount:[1110,s],sfuRxParticipantReportCount:[882,s],sfuRxUplinkReportCount:[880,s],sfuServerBwaBrAdjustedForParticipantChange:[1260,s],sfuServerBwaBrCappedByUplink:[1261,s],sfuServerBwaInvalidSimulcastResult:[1262,s],sfuServerBwaLocalBwaRun:[1263,s],sfuServerBwaLocalBwaTransition:[1337,s],sfuServerBwaLongestSbwaMissingMs:[1338,c],sfuSimulcastAvgDecSessFlipTime:[833,c],sfuSimulcastAvgEncSchedEventUpdateTime:[837,c],sfuSimulcastBwaCandidateCnt:[923,s],sfuSimulcastBwaDownlinkBottleneckCount:[874,s],sfuSimulcastBwaUplinkBottleneckCount:[873,s],sfuSimulcastDecAvgKfRecvTimeSinceFlip:[952,c],sfuSimulcastDecAvgNumReplayedCachedPkt:[951,l],sfuSimulcastDecAvgNumSkippedCachedPkt:[950,l],sfuSimulcastDecNumNoKf:[953,s],sfuSimulcastDecSessFlipCount:[744,s],sfuSimulcastDecSessFlipErrorBitmap:[768,s],sfuSimulcastDecSessFlipErrorCount:[767,s],sfuSimulcastEncErrorBitmap:[766,s],sfuSimulcastEncSchedEventCount:[732,s],sfuSimulcastEncSchedEventErrorCount:[735,s],sfuSimulcastEncSchedEventSkipCount:[734,s],sfuSimulcastEncSchedEventSuccessUpdateCount:[733,s],sfuSimulcastMaxDecSessFlipTime:[832,c],sfuSimulcastMaxEncSchedEventUpdateTime:[836,c],sfuSimulcastMinDecSessFlipTime:[831,c],sfuSimulcastMinEncSchedEventUpdateTime:[835,c],sfuUplinkAvgCombinedBwe:[659,l],sfuUplinkAvgPktLossPct:[664,l],sfuUplinkAvgRemoteBwe:[658,l],sfuUplinkAvgRtt:[670,l],sfuUplinkAvgSenderBwe:[657,l],sfuUplinkInitCombinedBwe3s:[1160,l],sfuUplinkInitPktLossPct3s:[1161,l],sfuUplinkMaxPktLossPct:[665,l],sfuUplinkMaxRtt:[671,l],sfuUplinkMinPktLossPct:[663,l],sfuUplinkMinRtt:[669,l],sfuUplinkSbweAvgDowntrend:[968,l],sfuUplinkSbweAvgUptrend:[967,l],sfuUplinkSbweCeilingCongestionCount:[790,s],sfuUplinkSbweCeilingCount:[788,s],sfuUplinkSbweCeilingMissingRtcpCongestionCount:[793,s],sfuUplinkSbweCeilingNoNewDataReceivedCongestionCount:[794,s],sfuUplinkSbweCeilingPktLossCount:[789,s],sfuUplinkSbweCeilingRttCongestionCount:[791,s],sfuUplinkSbweCeilingZeroRttCongestionCount:[792,s],sfuUplinkSbweHoldCount:[966,s],sfuUplinkSbweRampDownCount:[965,s],sfuUplinkSbweRampUpCount:[964,s],sfuUplinkSenderBweDiffStddev:[956,l],sfuUplinkSenderBweStddev:[955,l],simulcastAvgLqBitrateWhenHqEnabled:[1011,s],simulcastReplayVideoRenderFreeze2xT:[982,c],simulcastReplayVideoRenderFreeze4xT:[983,c],simulcastReplayVideoRenderFreeze8xT:[984,c],simulcastReplayVideoRenderFreezeT:[981,c],skippedBwaCycles:[748,s],skippedBweCycles:[747,s],slowRenderVideoFrameOutOfPausedMs:[1286,c],speakerAvgPower:[250,s],speakerMaxPower:[249,s],speakerMinPower:[248,s],speakerStartDuration:[864,c],speakerStartToFirstCallbackT:[932,c],speakerStopDuration:[865,c],sreRecommendedDiff:[1313,s],startedInitBweProbing:[900,o],streamDroppedPkts:[1287,s],streamPausedTimeMs:[1288,c],streamTransitionsToPaused:[1289,s],streamTransitionsToPausedWithoutNotif:[1290,s],switchToDefTriggeredByGoodDefNet:[538,s],switchToNonSfu:[750,s],switchToNonSimulcast:[1057,s],switchToSfu:[749,s],switchToSimulcast:[1056,s],symmetricNatPortGap:[257,s],systemNotificationOfNetChange:[541,s],telecomFrameworkCallStartDelayT:[440,c],timeCpuUtilizationSamplingInMs:[1224,c],timeEnc1280w:[992,c],timeEnc160w:[988,c],timeEnc320w:[989,c],timeEnc480w:[990,c],timeEnc640w:[991,c],timeOnNonDefNetwork:[530,c],timeOnNonDefNetworkPerSegment:[531,c],timeSinceLastRtpToCallEndInMsec:[715,c],timeToFirstElectedRelayMs:[1267,c],timeVidRcDynCondTrue:[718,c],totalAqsMsgSent:[1126,s],totalAudioFrameLossMs:[723,c],totalBytesOnNonDefCell:[449,l],totalTimeVidDlAutoPause:[575,c],totalTimeVidUlAutoPause:[573,c],trafficShaperAvgAudioQueueMs:[898,c],trafficShaperAvgQueueMs:[242,c],trafficShaperAvgVideoQueueMs:[899,c],trafficShaperMaxDelayViolations:[240,s],trafficShaperMinDelayViolations:[241,s],trafficShaperOverflowCount:[237,s],trafficShaperQueueEmptyCount:[238,s],trafficShaperQueuedAudioPacketCount:[896,s],trafficShaperQueuedPacketCount:[239,s],trafficShaperQueuedVideoPacketCount:[897,s],transportCurTimeInMsecAsyncWriteWaitingInQueue:[552,c],transportDebugEventBitmap:[1371,s],transportLastSendOsError:[555,s],transportNumAsyncWriteDispatched:[580,s],transportNumAsyncWriteQueued:[551,s],transportOvershoot10PercCount:[699,s],transportOvershoot20PercCount:[700,s],transportOvershoot40PercCount:[701,s],transportOvershootLongestStreakS:[708,s],transportOvershootSinceLast10sCount:[704,s],transportOvershootSinceLast15sCount:[705,s],transportOvershootSinceLast1sCount:[702,s],transportOvershootSinceLast30sCount:[706,s],transportOvershootSinceLast5sCount:[703,s],transportOvershootStreakAvgS:[709,l],transportOvershootTimeBetweenAvgS:[707,l],transportRtpSendErrorRate:[557,l],transportSendErrorCount:[556,s],transportSnJumpDetectCount:[1153,s],transportSplitterRxErrCnt:[1059,s],transportSplitterTxErrCnt:[1058,s],transportSrtcpRxRejectedPktCnt:[1141,s],transportSrtpRxMaxPktSize:[1038,s],transportSrtpRxRejectedBitrate:[763,l],transportSrtpRxRejectedDupPktCnt:[772,s],transportSrtpRxRejectedPktCnt:[762,s],transportSrtpTxFailedPktCnt:[774,s],transportSrtpTxMaxPktSize:[773,s],transportTotalNumSendOsError:[554,s],transportTotalTimeInMsecAsyncWriteQueueToDispatch:[553,c],transportUndershoot10PercCount:[710,s],transportUndershoot20PercCount:[711,s],transportUndershoot40PercCount:[712,s],triggeredButDataLimitReached:[536,s],tsLogUpload:[1112,aa],txProbeCountSuccess:[289,s],txProbeCountTotal:[288,s],txRelayBindUnbindPacketsMissingMessageIntegrity:[1105,s],txRelayRebindLatencyMs:[839,c],txRelayResetLatencyMs:[840,c],txTotalBitrate:[144,l],txTotalBytes:[142,l],txTpFbBitrate:[293,l],ulOnlyHighPlrPct:[1365,l],upnpAddResultCode:[246,fa],upnpRemoveResultCode:[247,ha],usedInitTxBitrate:[341,s],usedIpv4Count:[1150,s],usedIpv6Count:[1151,s],userDescription:[87,u],userProblems:[88,s],userRating:[86,s],v2vAudioFrameLoss1xMs:[1143,c],v2vAudioFrameLoss2xMs:[1144,c],v2vAudioFrameLoss4xMs:[1145,c],v2vAudioFrameLoss8xMs:[1146,c],v2vAudioLossPeriodCount:[1147,s],v2vTotalAudioFrameLossMs:[1148,c],vidAvgBurstyPktLossLength:[1121,c],vidAvgRandomPktLossLength:[1122,c],vidBurstyPktLossTime:[1123,c],vidCorrectRetxDetectPcnt:[688,s],vidFreezeTMsInSample0:[695,c],vidJbAvgDelay:[1062,l],vidJbDiscards:[1063,l],vidJbEmpties:[1064,l],vidJbGets:[1065,l],vidJbLost:[1061,l],vidJbPuts:[1066,l],vidJbResets:[1067,l],vidNumFecDroppedNoHole:[696,s],vidNumFecDroppedTooBig:[697,s],vidNumRandToBursty:[1124,s],vidNumRetxDropped:[698,s],vidNumRxRetx:[757,s],vidPktRxState0:[693,u],vidRandomPktLossTime:[1125,c],vidRxFecRateInSample0:[694,l],vidUlAutoPausedAtCallEnd:[589,o],vidUlTimeSinceAutoPauseAtCallEnd:[590,c],vidWrongRetxDetectPcnt:[716,s],videoActiveTime:[276,c],videoAheadAvSyncDiscardedFramesAvgDeltaT:[1041,c],videoAheadAvSyncRenderedFramesAvgDeltaT:[1043,c],videoAheadNumAvSyncDiscardFrames:[1039,s],videoAveDelayLtrp:[484,c],videoAvgCombPsnr:[390,l],videoAvgEncodingPsnr:[410,l],videoAvgScalingPsnr:[408,l],videoAvgSenderBwe:[186,l],videoAvgTargetBitrate:[184,l],videoAvgTargetBitrateHq:[828,l],videoBehindAvSyncDiscardedFramesAvgDeltaT:[1042,c],videoBehindAvSyncRenderedFramesAvgDeltaT:[1044,c],videoBehindNumAvSyncDiscardFrames:[1040,s],videoCaptureAvgFps:[222,s],videoCaptureConverterTs:[226,c],videoCaptureDupFrames:[887,s],videoCaptureFrameOverwriteCount:[496,s],videoCaptureHeight:[228,s],videoCaptureWidth:[227,s],videoCodecScheme:[401,s],videoCodecSubType:[303,s],videoCodecType:[236,s],videoDecAvgBitrate:[220,s],videoDecAvgConsecutiveKfVp8:[610,l],videoDecAvgConsecutiveLtrpVp8:[611,l],videoDecAvgFps:[207,l],videoDecAvgFramesFromFoundLtrVp8:[612,l],videoDecAvgFramesFromUnfoundLtrVp8:[613,l],videoDecColorId:[205,s],videoDecCrcMismatchFrames:[419,s],videoDecErrorFrames:[174,s],videoDecErrorFramesCodecSwitch:[714,s],videoDecErrorFramesDuplicate:[713,s],videoDecErrorFramesH264:[680,s],videoDecErrorFramesIgnoreConsecutive:[478,s],videoDecErrorFramesOutoforder:[682,s],videoDecErrorFramesSpsPpsH264:[812,s],videoDecErrorFramesSpsPpsMissingAfterResolutionSwitch:[810,s],videoDecErrorFramesSpsPpsNotSupportedAfterResolutionSwitch:[811,s],videoDecErrorFramesVp8:[681,s],videoDecErrorLtrpFramesVp8:[462,s],videoDecErrorLtrpFramesVp8CrcMismatch:[479,s],videoDecErrorLtrpFramesVp8NoLtr:[480,s],videoDecErrorLtrpFramesVp8NoLtr10:[615,s],videoDecErrorLtrpFramesVp8NoLtr5:[614,s],videoDecFatalErrorNum:[1084,s],videoDecInputFrames:[172,s],videoDecKeyframes:[175,s],videoDecLatency:[223,c],videoDecLatencyH264:[684,c],videoDecLatencyVp8:[683,c],videoDecLostPackets:[210,s],videoDecLtrpFramesVp8:[461,s],videoDecLtrpPoolCreateFailed:[490,o],videoDecName:[204,s],videoDecNumPliThrottledByAllLtrp:[915,s],videoDecNumSkippedFramesVp8:[616,s],videoDecNumSwitchesToAllLtrp:[617,s],videoDecOutputFrames:[173,s],videoDecRestart:[206,s],videoDecSkipPackets:[209,s],videoDecodePausedCount:[232,s],videoDowngradeCount:[273,s],videoEnabled:[163,o],videoEnabledAtCallStart:[270,o],videoEncAllLtrpTimeInMsec:[609,c],videoEncAvgBitrate:[221,s],videoEncAvgConsecutiveKfVp8:[605,l],videoEncAvgConsecutiveLtrpVp8:[606,l],videoEncAvgFps:[216,l],videoEncAvgFpsHq:[825,l],videoEncAvgFramesFromFoundLtrVp8:[604,l],videoEncAvgFramesFromUnfoundLtrVp8:[603,l],videoEncAvgPsnrKeyFrameVp8:[465,l],videoEncAvgPsnrLtrpFrameVp8:[469,l],videoEncAvgPsnrPFramePrevRefVp8:[474,l],videoEncAvgQpKeyFrameOpenh264:[1216,l],videoEncAvgQpKeyFrameVp8:[466,l],videoEncAvgQpLtrpFrameOpenh264:[1217,l],videoEncAvgQpLtrpFrameVp8:[470,l],videoEncAvgQpPFramePrevRefOpenh264:[1218,l],videoEncAvgQpPFramePrevRefVp8:[475,l],videoEncAvgSizeAllLtrpFrameVp8:[685,l],videoEncAvgSizeKeyFrameVp8:[464,l],videoEncAvgSizeLtrpFrameVp8:[468,l],videoEncAvgSizePFramePrevRefVp8:[473,l],videoEncAvgTargetFps:[215,l],videoEncAvgTargetFpsHq:[827,l],videoEncColorId:[213,s],videoEncDeviationAllLtrpFrameVp8:[686,l],videoEncDeviationPFramePrevRefVp8:[687,l],videoEncDiscardFrame:[217,s],videoEncDiscardFrameHq:[938,s],videoEncDropFrames:[179,s],videoEncDropFramesHq:[937,s],videoEncErrorFrames:[178,s],videoEncErrorFramesHq:[936,s],videoEncFatalErrorNum:[1049,s],videoEncInputFrames:[176,s],videoEncInputFramesHq:[934,s],videoEncKeyframes:[180,s],videoEncKeyframesHq:[939,s],videoEncKeyframesVp8:[463,s],videoEncKfErrCodecSwitchT:[731,c],videoEncKfIgnoreOldFrames:[729,s],videoEncKfQueueEmpty:[730,s],videoEncLatency:[224,c],videoEncLatencyHq:[826,c],videoEncLtrpFrameGenFailedVp8:[471,s],videoEncLtrpFramesVp8:[467,s],videoEncLtrpPoolCreateFailed:[491,o],videoEncLtrpToKfFallbackVp8:[494,s],videoEncModifyNum:[1050,s],videoEncName:[212,s],videoEncNumErrorLtrHoldFailedVp8:[600,s],videoEncNumErrorLtrHoldFailedVp810:[602,s],videoEncNumErrorLtrHoldFailedVp85:[601,s],videoEncNumSuccessHfFallbackVp8:[622,s],videoEncNumSwitchesToAllLtrp:[607,s],videoEncOutputFrames:[177,s],videoEncOutputFramesHq:[935,s],videoEncPFramePrevRefVp8:[472,s],videoEncRegularLtrpTimeInMsec:[608,c],videoEncRestart:[214,s],videoEncRestartPresetChange:[1046,s],videoEncRestartResChange:[1045,s],videoEncTimeOvershoot10PercH264:[363,c],videoEncTimeOvershoot10PercH265:[366,c],videoEncTimeOvershoot10PercVp8:[369,c],videoEncTimeOvershoot10PercVp9:[372,c],videoEncTimeOvershoot20PercH264:[364,c],videoEncTimeOvershoot20PercH265:[367,c],videoEncTimeOvershoot20PercVp8:[370,c],videoEncTimeOvershoot20PercVp9:[373,c],videoEncTimeOvershoot40PercH264:[365,c],videoEncTimeOvershoot40PercH265:[368,c],videoEncTimeOvershoot40PercVp8:[371,c],videoEncTimeOvershoot40PercVp9:[374,c],videoEncTimeSpentInFastH264Ms:[1026,c],videoEncTimeSpentInFasterH264Ms:[1025,c],videoEncTimeSpentInMediumH264Ms:[1027,c],videoEncTimeSpentInNegative10Vp8Ms:[1019,c],videoEncTimeSpentInNegative12Vp8Ms:[1018,c],videoEncTimeSpentInNegative4Vp8Ms:[1022,c],videoEncTimeSpentInNegative6Vp8Ms:[1021,c],videoEncTimeSpentInNegative8Vp8Ms:[1020,c],videoEncTimeSpentInSuperfastH264Ms:[1023,c],videoEncTimeSpentInVeryfastH264Ms:[1024,c],videoEncTimeUndershoot10PercH264:[375,c],videoEncTimeUndershoot10PercH265:[378,c],videoEncTimeUndershoot10PercVp8:[381,c],videoEncTimeUndershoot10PercVp9:[384,c],videoEncTimeUndershoot20PercH264:[376,c],videoEncTimeUndershoot20PercH265:[379,c],videoEncTimeUndershoot20PercVp8:[382,c],videoEncTimeUndershoot20PercVp9:[385,c],videoEncTimeUndershoot40PercH264:[377,c],videoEncTimeUndershoot40PercH265:[380,c],videoEncTimeUndershoot40PercVp8:[383,c],videoEncTimeUndershoot40PercVp9:[386,c],videoFecRecovered:[183,s],videoH264Time:[334,s],videoH265Time:[335,s],videoHeight:[189,s],videoInitRxBitrate16s:[904,l],videoInitRxBitrate2s:[901,l],videoInitRxBitrate4s:[902,l],videoInitRxBitrate8s:[903,l],videoInitialCodecScheme:[402,s],videoInitialCodecType:[321,s],videoLastCodecType:[404,s],videoLastSenderBwe:[185,l],videoMaxCombPsnr:[392,l],videoMaxEncodingPsnr:[411,l],videoMaxRxBitrate:[426,l],videoMaxScalingPsnr:[409,l],videoMaxTargetBitrate:[420,l],videoMaxTargetBitrateHq:[829,l],videoMaxTxBitrate:[425,l],videoMaxTxBitrateHq:[824,l],videoMinCombPsnr:[391,l],videoMinEncodingPsnr:[407,l],videoMinScalingPsnr:[406,l],videoMinTargetBitrate:[421,l],videoMinTargetBitrateHq:[830,l],videoNackHbhEnabled:[1185,o],videoNackRtpRetransmitRecvdCount:[1272,s],videoNackRtpRetransmitReqCount:[1373,s],videoNackSendDelay:[872,c],videoNewPktsBeforeNack:[871,s],videoNpsiGenFailed:[594,s],videoNpsiNoNack:[595,s],videoNumAvSyncDiscardFrames:[1010,s],videoNumH264Frames:[332,s],videoNumH265Frames:[333,s],videoPeerState:[275,se],videoPeerTriggeredPauseCount:[654,s],videoQualityScore:[1270,s],videoRenderAvgFps:[208,s],videoRenderConverterTs:[225,c],videoRenderDelayT:[196,c],videoRenderDupFrames:[888,s],videoRenderFreeze2xT:[304,c],videoRenderFreeze4xT:[305,c],videoRenderFreeze8xT:[306,c],videoRenderFreezeT:[235,c],videoRenderInitFreeze16sT:[908,c],videoRenderInitFreeze2sT:[905,c],videoRenderInitFreeze4sT:[906,c],videoRenderInitFreeze8sT:[907,c],videoRenderInitFreezeT:[526,c],videoRenderNumFreezes:[569,s],videoRenderNumSinceLastFreeze10s:[571,s],videoRenderNumSinceLastFreeze30s:[572,s],videoRenderNumSinceLastFreeze5s:[570,s],videoRenderPauseT:[1132,c],videoRenderSumTimeSinceLastFreeze:[568,c],videoRetxRtcpNack:[1178,s],videoRetxRtcpPli:[1179,s],videoRetxRtcpRr:[1180,s],videoRtcpAppRxFailed:[493,s],videoRtcpAppTxFailed:[492,s],videoRtcpNackProcessed:[1273,s],videoRtcpNackProcessedHq:[1274,s],videoRxBitrate:[169,l],videoRxBweHitTxBwe:[187,o],videoRxBytesRtcpApp:[489,l],videoRxFecBitrate:[219,l],videoRxFecFrames:[182,s],videoRxKfBeforeLtrpAfterRpsi:[485,s],videoRxLtrpFramesVp8:[460,s],videoRxNumCodecSwitch:[721,s],videoRxPackets:[201,s],videoRxPktErrorPct:[171,l],videoRxPktLossPct:[170,l],videoRxPktRtcpApp:[487,s],videoRxRtcpFir:[621,s],videoRxRtcpNack:[203,s],videoRxRtcpNackDropped:[1181,s],videoRxRtcpNpsi:[521,s],videoRxRtcpPli:[202,s],videoRxRtcpPliDropped:[1182,s],videoRxRtcpRpsi:[459,s],videoRxRtcpRrDropped:[1183,s],videoRxTotalBytes:[168,l],videoSelfState:[274,se],videoSenderBweDiffStddev:[954,l],videoSenderBweStddev:[348,l],videoTargetBitrateReaches1000kbpsT:[351,c],videoTargetBitrateReaches1500kbpsT:[435,c],videoTargetBitrateReaches2000kbpsT:[436,c],videoTargetBitrateReaches200kbpsT:[349,c],videoTargetBitrateReaches250kbpsT:[433,c],videoTargetBitrateReaches500kbpsT:[350,c],videoTargetBitrateReaches750kbpsT:[434,c],videoTotalBytesOnNonDefCell:[451,l],videoTxBitrate:[165,l],videoTxBitrateHq:[823,l],videoTxBytesRtcpApp:[488,l],videoTxFecBitrate:[218,l],videoTxFecFrames:[181,s],videoTxNumCodecSwitch:[720,s],videoTxPackets:[197,s],videoTxPacketsHq:[818,s],videoTxPktErrorPct:[167,l],videoTxPktErrorPctHq:[821,l],videoTxPktLossPct:[166,l],videoTxPktLossPctHq:[822,l],videoTxPktRtcpApp:[486,s],videoTxResendCauseKf:[1275,s],videoTxResendCauseKfHq:[1276,s],videoTxResendFailures:[1277,s],videoTxResendFailuresHq:[1278,s],videoTxResendPackets:[198,s],videoTxResendPacketsHq:[819,s],videoTxRtcpFirEmptyJb:[620,s],videoTxRtcpNack:[200,s],videoTxRtcpNpsi:[520,s],videoTxRtcpPli:[199,s],videoTxRtcpPliHq:[820,s],videoTxRtcpRpsi:[458,s],videoTxTotalBytes:[164,l],videoTxTotalBytesHq:[817,l],videoUpdateEncoderFailureCount:[453,s],videoUpgradeCancelByTimeoutCount:[325,s],videoUpgradeCancelCount:[323,s],videoUpgradeCount:[272,s],videoUpgradeRejectByTimeoutCount:[326,s],videoUpgradeRejectCount:[324,s],videoUpgradeRequestCount:[271,s],videoWidth:[188,s],voipParamsCompressedSize:[1136,s],voipParamsUncompressedSize:[1137,s],vpxLibUsed:[513,Na],waLongFreezeCount:[891,s],waReconnectFreezeCount:[890,s],waShortFreezeCount:[889,s],waVoipHistoryCallRedialStatus:[1346,La],waVoipHistoryGetVideoTxBitrateBySelfAndPeerIpStrResult:[1162,s],waVoipHistoryGetVideoTxBitrateBySelfAndPeerIpStrSuccess:[1163,o],waVoipHistoryGetVideoTxBitrateBySelfIpStrResult:[1164,s],waVoipHistoryGetVideoTxBitrateBySelfIpStrSuccess:[1165,o],waVoipHistoryIpAddressNotAvailable:[834,o],waVoipHistoryIsCallParticipantRecordSaved:[1343,o],waVoipHistoryIsCallRecordLoaded:[737,o],waVoipHistoryIsCallRecordSaved:[738,o],waVoipHistoryIsInitialized:[769,o],waVoipHistoryNumOfCallParticipantRecordFound:[1344,s],waVoipHistoryNumOfCallRecordFoundByMatchingSelfAndPeerIpStr:[1166,s],waVoipHistoryNumOfCallRecordFoundByMatchingSelfIpStr:[1167,s],waVoipHistoryNumOfCallRecordLoaded:[739,s],waVoipHistorySaveCallRecordConditionCheckStatus:[770,Da],warpHeaderRxTotalBytes:[656,l],warpHeaderTxTotalBytes:[655,l],warpMiRxPktErrorCount:[1118,s],warpMiTxPktErrorCount:[1117,s],warpRelayChangeDetectCount:[1154,s],warpRxPktErrorCount:[746,s],warpTxPktErrorCount:[745,s],waspKeyErrorCount:[1156,s],wavFileWriteMaxLatency:[1089,c],weakCellularNetConditionDetected:[429,s],weakWifiNetConditionDetected:[430,s],weakWifiSwitchToDefNetSuccess:[397,s],weakWifiSwitchToDefNetSuccessByPeriodicalCheck:[395,s],weakWifiSwitchToDefNetTriggered:[396,s],weakWifiSwitchToDefNetTriggeredByPeriodicalCheck:[394,s],weakWifiSwitchToNonDefNetFalsePositive:[399,s],weakWifiSwitchToNonDefNetSuccess:[400,s],weakWifiSwitchToNonDefNetTriggered:[398,s],wifiRssiAtCallStart:[263,s],wpNotifyCallFailed:[64,s],wpSoftwareEcMatches:[65,o],xmppStatus:[3,po],xorCipher:[269,_o],zedFileWriteMaxLatency:[1088,c]},[1,1,1],"regular"],CatalogBiz:[1722,{cartToggle:[13,o],catalogAppealReason:[4,u],catalogBizAction:[1,de],catalogEntryPoint:[7,pe],catalogSessionId:[3,u],collectionCount:[18,s],collectionId:[14,u],collectionIndex:[15,u],deepLinkOpenFrom:[8,et],errorCode:[5,s],isOrderMsgAttached:[10,o],orderId:[9,u],productCount:[6,s],productId:[2,u],productIds:[12,u],productIndex:[16,u],quantity:[11,s]},[1,1,1],"regular"],CatalogCategoryView:[3292,{catalogCategoryId:[1,u],catalogOwnerJid:[2,u],catalogSessionId:[3,u],categoryBrowsingEntryPoint:[4,fe],categoryItemIndex:[5,s],categoryLevel:[6,s],isLastLevel:[7,o],productId:[8,u],sequenceNumber:[9,s],viewAction:[10,Oa]},[1,1,1],"private",0],CatalogView:[1630,{bizPlatform:[16,w],cartToggle:[15,o],catalogEntryPoint:[7,pe],catalogEventSampled:[8,o],catalogOwnerJid:[6,u],catalogReportReasonCode:[4,u],catalogSessionId:[2,u],catalogViewAction:[1,_e],collectionId:[17,u],collectionIndex:[18,u],deepLinkOpenFrom:[9,et],isNewProductAddedToCart:[13,o],isOrderMsgAttached:[10,o],orderId:[11,u],productId:[5,u],productIndex:[19,u],quantity:[12,s]},[1,1,1],"regular"],ChatComposerAction:[2948,{chatComposerActionTarget:[2,Ee],chatComposerActionType:[1,Se]},[1,1,1],"private",113760892],ChatFilterEvent:[1616,{actionType:[1,Te],filterType:[2,Ae],searchResultType:[4,Ie],sessionId:[3,s],targetScreen:[5,ve]},[1,1,1],"regular"],ChatFolderOpen:[2808,{activityIndicatorCount:[2,s],folderType:[1,u],hasImportantMessages:[3,o]},[1,1,1],"regular"],ChatMessageCounts:[1644,{awayMsgsSent:[56,s],bizCatalogType:[60,N],bizConversationDepth:[65,s],blockReason:[33,k],broadcastMsgsReceived:[30,s],broadcastMsgsSent:[29,s],callOffersReceived:[27,s],callOffersSent:[26,s],callsResultBusy:[70,s],callsResultCancelled:[71,s],callsResultConnected:[72,s],callsResultError:[78,s],callsResultMissed:[73,s],callsResultRejected:[74,s],canEditDmSettings:[88,o],cartViews:[86,s],chatEphemeralityDuration:[15,s],chatMuted:[8,Oe],chatOverflowClicks:[79,s],chatTypeInd:[2,Me],collectionInquiriesSent:[44,s],commerceMsgsReceived:[41,s],commerceMsgsSent:[40,s],disappearingChatInitiator:[59,at],entryPointConversionApp:[47,u],entryPointConversionSource:[46,u],ephemeralMessagesReceived:[14,s],ephemeralMessagesSent:[13,s],ephemeralMessagesUnreadExpired:[69,s],fbCtaInquiriesSent:[45,s],firstResponseTime:[25,s],forwardMessagesReceived:[89,s],forwardMessagesSent:[90,s],gaStatus:[22,Mt],greetingMsgsSent:[57,s],groupContainsBiz:[75,o],groupInfoSetting:[87,wt],groupMembershipReplies:[51,s],groupPrivateReplies:[52,s],groupSize:[19,s],isAContact:[6,o],isAGroup:[5,o],isArchived:[10,o],isBlocked:[32,o],isCartAddClicked:[36,o],isCommerceViewed:[35,o],isCtaOnPdpClicked:[37,o],isLabelled:[54,o],isMessageYourself:[91,o],isOppositePartyInitiated:[62,o],isPinned:[9,o],isPnhEnabledChat:[92,o],isWaPayRegistered:[81,o],labelledMsgs:[55,s],locationsSent:[96,s],messagesReceived:[4,s],messagesSent:[3,s],messagesStarred:[12,s],messagesUnread:[11,s],newThread:[68,o],odReceived:[82,s],ordersSent:[38,s],p2mOdNnpTransactionsSent:[83,s],p2mOdNpTransactionsSent:[84,s],paymentsSent:[39,s],pdpInquiriesSent:[42,s],pdpViews:[61,s],profileReplies:[64,s],profileViews:[63,s],quickRepliesSent:[58,s],reactionsReceived:[97,s],reactionsSent:[98,s],receiverDefaultDisappearingDuration:[21,s],repliesSent:[80,s],requestedPhoneNumber:[93,o],seenMaskedPhoneNumber:[94,o],senderDefaultDisappearingDuration:[20,s],sharedPhoneNumber:[99,o],spamReports:[31,s],startTime:[7,s],statusReplies:[50,s],statusViews:[49,s],storefrontInquiriesSent:[43,s],threadDs:[66,u],threadId:[67,u],totalCallDuration:[28,s],typeOfGroup:[85,oa],videoCallsOffered:[76,s],viewOnceMessagesOpened:[18,s],viewOnceMessagesReceived:[17,s],viewOnceMessagesSent:[16,s],voiceCallsOffered:[77,s]},[1,1,1],"regular"],ChatMute:[2280,{actionConducted:[3,p],chatMuteNotificationChoice:[5,Pe],muteChatType:[4,Fn],muteDuration:[1,c],muteEntryPoint:[6,jn],muteGroupSize:[2,s],waOfficialAccountName:[7,wa]},[1,1,1],"regular"],ChatPsaAction:[3572,{messageMediaType:[1,Pn],psaCampaignId:[4,u],psaMessageActionType:[2,Xr],psaMsgId:[5,u]},[1,1,1],"regular"],ChatPsaRead:[3574,{messageMediaType:[1,Pn],psaCampaignId:[4,u],psaMsgId:[5,u],readEntryPoint:[3,fi]},[1,1,1],"regular"],ChatPsaRemove:[3582,{lastReceivedMediaType:[2,Pn],lastReceivedMessageTs:[4,c],lastReceivedMsgId:[8,u],psaBlockReason:[10,Jr],psaCampaignId:[9,u],psaMessageRemoveAction:[5,Zr],psaMessageRemoveEntryPoint:[6,ei],waOfficialAccountName:[7,wa]},[1,1,1],"regular"],ClockSkewDifferenceT:[3178,{clockSkewHourly:[1,s]},[1,1e3,1e4],"private",37887164],CommercePerf:[2420,{commercePerfEntryPoint:[4,Ue],commercePerfMarker:[3,Ge],commercePerfView:[5,xe],instanceKey:[1,s],timespentT:[2,c]},[1,1,1],"private",113760892],CommerceView:[2438,{businessOwnerJid:[4,u],commerceAction:[1,De],commerceActionSequenceNumber:[5,s],commerceEntryPoint:[2,ke],commerceEventSampled:[8,o],commerceReportReasonCode:[6,u],commerceSessionId:[3,u],deepLinkOpenFrom:[9,et],productId:[7,u]},[1,1,1],"private",113760892],CommunityCreation:[3492,{communityCreationActionCount:[1,s],communityCreationActionTaken:[2,Be],communityCreationCurrentScreen:[3,Fe],communityCreationSessionId:[4,u]},[1,1,1],"regular"],CommunityFeatureUsage:[3696,{communityId:[2,u],communityUiAction:[4,je],communityUiFeature:[3,Ye]},[1,1,1],"regular"],CommunityHomeAction:[3494,{communityHomeGroupDiscoveries:[1,s],communityHomeGroupJoins:[2,s],communityHomeGroupNavigations:[3,s],communityHomeId:[4,u],communityHomeViews:[5,s]},[1,1,1],"regular"],CommunityTabAction:[3496,{communityNoActionTabViews:[4,s],communityTabGroupNavigations:[1,s],communityTabToHomeViews:[2,s],communityTabViews:[3,s]},[1,1,1],"regular"],CompanionForceUpgradeUserActionV2:[3294,{forceUpgradeReasonV2:[1,u],forceUpgradeUserActionV2:[2,It]},[1,1,1],"regular"],CompanionGetDevicesList:[3010,{getDevicesListApiCount:[2,s],getDevicesListApiDeviceType:[3,u],getDevicesListApiEnumerationType:[4,u],getDevicesListApiT:[1,c]},[1,1,1],"regular"],ContactDiscoveryTimeToEngagement:[3190,{elapsedTime:[1,s]},[1,1,1],"private",0],ContactSend:[2234,{channel:[1,We],isMultiVcard:[2,o],messageSendResult:[3,kn],messageSendT:[4,c],vcardDataSize:[5,s]},[1,1,1],"regular"],ContactUsSession:[470,{contactUsAutomaticEmail:[3,o],contactUsExitState:[1,Ve],contactUsFaq:[2,o],contactUsLogs:[4,o],contactUsMenuFaqT:[12,c],contactUsOutage:[5,o],contactUsOutageEmail:[6,o],contactUsProblemDescription:[7,u],contactUsScreenshotC:[19,l],contactUsT:[11,c],languageCode:[21,u]},[1,1,1],"regular"],CoreShadowTestAnonymousMonthlyId:[3630,{},[1,1,1],"private",191000728],CoreShadowUiAction:[3632,{testIntField:[1,s]},[1,1,1],"regular"],CrashLog:[494,{crashContext:[3,u],crashCount:[5,s],crashReason:[2,u],crashType:[6,$e]},[1,1,100],"regular"],CtwaActionBannerUnderstand:[3586,{bannerIdentifier:[1,u],bannerLocale:[2,u],clientLocale:[3,u],hasLocalLink:[4,o],hasUniversalLink:[5,o],invalidLink:[6,u],lwiFlowIdentifier:[7,u],preferredLink:[8,Mr],validLocale:[9,o],validNotification:[10,o]},[1,1,1],"private",0],CtwaBusinessPreview:[3078,{catalogPresent:[4,o],ctwaBusinessPreviewAction:[1,Y],eventTimestampMs:[2,s],openingHoursPresent:[5,o],profileLoadTimeMs:[3,s]},[1,1,1],"private",113760892],CtwaJwtVerificationState:[3720,{failReason:[2,u],verificationState:[3,Ta]},[1,1,1],"private",113760892],CtwaNotificationUnderstand:[3668,{smbNotificationClientLocale:[1,u],smbNotificationHasLocalLink:[2,o],smbNotificationHasLocalLinkButton1:[11,o],smbNotificationHasLocalLinkButton2:[12,o],smbNotificationHasLocalLinkButton3:[13,o],smbNotificationHasUniversalLink:[3,o],smbNotificationHasUniversalLinkButton1:[14,o],smbNotificationHasUniversalLinkButton2:[15,o],smbNotificationHasUniversalLinkButton3:[16,o],smbNotificationIdentifier:[4,u],smbNotificationInvalidLink:[5,u],smbNotificationInvalidLinkButton1:[17,u],smbNotificationInvalidLinkButton2:[18,u],smbNotificationInvalidLinkButton3:[19,u],smbNotificationLocale:[6,u],smbNotificationLwiFlowIdentifier:[7,u],smbNotificationPreferredLink:[8,Wn],smbNotificationPreferredLinkButton1:[20,Vn],smbNotificationPreferredLinkButton2:[21,$n],smbNotificationPreferredLinkButton3:[22,zn],smbNotificationValidLocale:[9,o],smbNotificationValidNotification:[10,o]},[1,1,1],"private",0],CtwaReliabilityUnderstand:[3678,{flowId:[2,u],reliabilityActionEnum:[3,gi]},[1,1,1],"private",0],CtwaUserJourney:[3466,{adId:[1,u],businessJid:[2,u],ctwaChatCreationMode:[6,Je],ctwaUserJourneyOperation:[3,Xe],icebreakersShown:[4,o],sequenceNumber:[5,s],trustBannerAction:[7,ra],trustBannerType:[8,u]},[1,1,1],"private",113760892],CtwaWelcomeMessage:[3022,{ctwaWelcomeMessageAction:[1,uo],ctwaWelcomeMessageContainsIcebreakers:[3,o],ctwaWelcomeMessageError:[4,co],ctwaWelcomeMessageIcebreakersContainAutoreply:[5,o],firstWelcomeMessageImpressionTime:[2,s]},[1,1,1],"private",113760892],Daily:[1158,{accessibilityVoiceover:[108,o],addressbookSize:[11,s],addressbookWhatsappSize:[12,s],androidAdvertisingId:[135,u],androidKeystoreState:[139,E],appCodeHash:[103,u],autoDlAudioCellular:[90,o],autoDlAudioRoaming:[91,o],autoDlAudioWifi:[89,o],autoDlDocCellular:[96,o],autoDlDocRoaming:[97,o],autoDlDocWifi:[95,o],autoDlImageCellular:[87,o],autoDlImageRoaming:[88,o],autoDlImageWifi:[86,o],autoDlVideoCellular:[93,o],autoDlVideoRoaming:[94,o],autoDlVideoWifi:[92,o],backupNetworkSetting:[10,I],backupRestoreEncryptionVersion:[138,s],backupSchedule:[9,M],chatDatabaseSize:[19,s],defaultDisappearingDuration:[140,s],deviceLanguage:[153,u],entSecurityNotificationsEnabled:[134,o],favoritedAnimatedStickerCount:[113,s],favoritedFirstPartyStickerCount:[112,s],favoritedTotalStickerCount:[111,s],installedAnimatedStickerPackCount:[116,s],installedAnimatedThirdPartyStickerPackCount:[137,s],installedFirstPartyStickerPackCount:[115,s],installedTotalStickerPackCount:[114,s],ipCountry:[123,u],ipStr:[122,u],keyboardLanguage:[154,u],languageCode:[5,u],locationCode:[6,u],mdPairTime:[124,s],mediaFolderFileCount:[21,s],mediaFolderSize:[20,s],modifiedInternalProps:[155,o],networkIsRoaming:[7,o],osBuildNumber:[4,u],osNotificationSetting:[118,qn],packageName:[102,u],paymentsIsEnabled:[100,o],permissionContacts:[104,o],phoneCores:[156,s],privacySettingsAbout:[141,xr],privacySettingsAboutExceptNum:[142,Gr],privacySettingsGroups:[143,xr],privacySettingsGroupsExceptNum:[144,Gr],privacySettingsLastSeen:[145,xr],privacySettingsLastSeenExceptNum:[146,Gr],privacySettingsProfilePhoto:[147,xr],privacySettingsProfilePhotoExceptNum:[148,Gr],privacySettingsStatus:[150,xr],privacySettingsStatusExceptNum:[151,Gr],privacySettingsStatusShareNum:[152,Gr],receiptsEnabled:[8,o],simMcc:[2,s],simMnc:[3,s],storageAvailSize:[31,s],storageTotalSize:[32,s],videoFolderFileCount:[23,s],videoFolderSize:[22,s]},[1,1,1],"regular"],DeepLinkClick:[1156,{deepLinkHasPhoneNumber:[2,o],deepLinkHasText:[1,o],deepLinkSessionId:[3,u]},[1,1,1],"regular"],DeepLinkConversion:[1432,{ctwaChatCreationMode:[4,Je],ctwaConversionType:[3,Qe],deepLinkConversionData:[2,u],deepLinkConversionSource:[1,u],trustBannerAction:[5,ra],trustBannerType:[6,u]},[1,1,1],"regular"],DeepLinkMsgSent:[3198,{deepLinkAction:[1,Ze],deepLinkSessionId:[2,u]},[1,1,1],"regular"],DeepLinkOpen:[2136,{deepLinkOpenFrom:[2,et],deepLinkSessionId:[6,u],deepLinkType:[3,tt],isContact:[4,o],linkOwnerType:[5,cr]},[1,1,1],"regular"],DisappearingMessageChatPicker:[3398,{chatsSelected:[1,s],dmChatPickerEntryPoint:[2,lt],dmChatPickerEventName:[3,ut],ephemeralityDuration:[4,s],groupChatsSelected:[5,s],groupSizeDistributionJson:[9,u],newlyEphemeralChats:[7,s],totalChatsInChatPicker:[8,s]},[1,1,1],"regular"],DisappearingMessageKeepInChat:[3482,{canEditDmSettings:[16,o],chatEphemeralityDuration:[1,s],isAGroup:[2,o],isAdmin:[3,o],keptCount:[15,s],keptDelta:[4,s],kicActionName:[5,Kt],kicActor:[6,Wt],kicEntryPoint:[7,Vt],mediaType:[8,Pn],messageExpiredOnUnkeep:[9,o],messageExpiryTimer:[10,s],messagesInFolder:[11,s],messagesSelected:[12,s],threadId:[13,u]},[1,1,1],"regular"],DisappearingModeSettingChange:[3056,{disappearingModeEntryPoint:[4,ot],lastToggleTimestamp:[3,s],newEphemeralityDuration:[2,s],previousEphemeralityDuration:[1,s]},[1,1,1],"regular"],DisappearingModeSettingEvents:[3446,{disappearingModeEntryPoint:[5,ot],disappearingModeSettingEventName:[1,st],lastToggleTimestamp:[2,s],newEphemeralityDuration:[3,s],previousEphemeralityDuration:[4,s]},[1,1,1],"regular"],DmInterstitialScreenImpression:[3918,{accountEphemeralityDuration:[1,s],dmScreenEntryPoint:[2,ct]},[1,1,1],"regular"],E2eMessageDecryptFailSender:[3524,{clientMessageId:[1,u],e2eCiphertextType:[2,ft],e2eDestination:[9,ht],e2eFailureReason:[3,gt],e2eSenderJid:[4,u],e2eSenderType:[5,mt],messageMediaType:[6,Pn],offline:[7,o],retryCount:[8,s],revokeType:[10,Ei]},[1,1,1],"private",0],E2eMessageRecv:[478,{e2eCiphertextType:[5,ft],e2eCiphertextVersion:[6,s],e2eDestination:[4,ht],e2eFailureReason:[2,gt],e2eSenderType:[8,mt],e2eSuccessful:[1,o],isLid:[11,o],messageMediaType:[7,Pn],offline:[9,o],retryCount:[3,s],revokeType:[10,Ei],typeOfGroup:[12,oa]},[1,1,20],"regular"],E2eMessageSend:[476,{e2eCiphertextType:[5,ft],e2eCiphertextVersion:[6,s],e2eDestination:[4,ht],e2eFailureReason:[2,gt],e2eReceiverType:[8,it],e2eSuccessful:[1,o],encRetryCount:[9,s],isLid:[12,o],messageIsInvisible:[10,o],messageMediaType:[7,Pn],retryCount:[3,s],revokeType:[11,Ei],typeOfGroup:[13,oa]},[1,1,1],"regular"],E2eRetryAfterDelivery:[894,{deviceType:[4,it],messageType:[1,Un],msgRetryCount:[3,s],retryRevoke:[2,o]},[1,1,1],"regular"],E2eRetryReject:[3578,{messageType:[1,Un],msgRetryCount:[2,s],retryRejectReason:[3,yi],retryRevoke:[4,o],senderDeviceType:[5,it]},[1,1,1],"regular"],E2eeSystemMessage:[3176,{chatCategory:[1,he],e2eeDialogInteraction:[2,Re],e2eeSystemMessageGroupSizeBucket:[3,yt],e2eeSystemMessageType:[4,Ai]},[1,1,1],"regular"],EditBusinessProfile:[1466,{businessProfileEntryPoint:[10,K],editBusinessProfileSessionId:[2,u],editProfileAction:[1,Et],editProfileActionField:[9,H],hasAddress:[5,o],hasCategory:[4,o],hasDescription:[3,o],hasEmail:[7,o],hasHours:[6,o],hasWebsite:[8,o]},[1,1,1],"regular"],EntryPointConversion:[2784,{entryPointConversionApp:[3,u],entryPointConversionSource:[2,u],entryPointConverstionType:[1,Tt],firstMessageTimeStamp:[4,s]},[1,1,1],"regular"],EphemeralMessageTime:[2742,{zombieStateDuration:[1,s]},[1,1,1],"regular"],EphemeralOutOfSyncInfo:[3892,{groupSizeBucket:[1,Ne],incomingMessageEphemeralityDuration:[2,s],isAGroup:[3,o],isNewThreadForOther:[4,o],isNewThreadForUser:[5,o],otherDefaultModeDuration:[6,s],threadEphemeralityDuration:[7,s],threadId:[8,u],userDefaultModeDuration:[9,s]},[1,1,1],"regular"],EphemeralPurgeCount:[2744,{messageCount:[1,s]},[1,1,1],"regular"],EphemeralSettingChange:[2370,{chatEphemeralityDuration:[1,s],ephemeralSettingEntryPoint:[3,vt],ephemeralSettingGroupSize:[5,Ir],previousEphemeralityDuration:[2,s],threadId:[6,u]},[1,1,1],"regular"],ForwardSend:[1728,{disappearingChatInitiator:[21,at],e2eCiphertextType:[12,ft],e2eCiphertextVersion:[11,s],ephemeralityDuration:[18,s],fastForwardEnabled:[5,o],isForwardedForward:[22,o],isFrequentlyForwarded:[14,o],mediaCaptionPresent:[10,o],messageForwardAgeT:[4,c],messageIsFanout:[6,o],messageIsFastForward:[3,o],messageIsInternational:[9,o],messageMediaType:[2,Pn],messageSendT:[13,c],messageType:[1,Un],receiverDefaultDisappearingDuration:[20,s],resendCount:[8,s],retryCount:[7,s],senderDefaultDisappearingDuration:[19,s],typeOfGroup:[23,oa],wouldBeFrequentlyForwardedAt3:[16,o],wouldBeFrequentlyForwardedAt4:[17,o]},[1,1,1],"regular"],GatedChatOpened:[3150,{chatGatedReason:[1,Ce],selfInitiated:[2,o]},[1,1,1],"regular"],GatedMessageReceived:[3152,{chatGatedReason:[1,Ce]},[1,1,1],"regular"],GifFromProviderSent:[1124,{gifSearchProvider:[1,bt]},[1,1,1],"regular"],GifSearchCancelled:[1126,{gifSearchProvider:[1,bt]},[1,1,1],"regular"],GifSearchNoResults:[1128,{gifSearchProvider:[1,bt],inputLanguageCode:[3,u],languageCode:[2,u]},[1,1,1],"regular"],GifSearchResultTapped:[1122,{gifSearchProvider:[1,bt],rank:[2,s]},[1,1,1],"regular"],GifSearchSessionStarted:[1134,{gifSearchProvider:[1,bt]},[1,1,1],"regular"],GraphqlCatalogRequest:[3206,{graphqlCatalogEndpoint:[1,Rt],graphqlErrorCode:[3,s],graphqlRequestResult:[2,Nt]},[1,1,1],"private",0],GroupCatchUp:[3058,{mentionsCountPendingPercentage:[4,s]},[1,1,1],"regular"],GroupCreateC:[156,{},[1,1,1],"regular"],GroupJoinC:[158,{},[1,1,1],"regular"],GroupProfilePicture:[3652,{groupCreationDs:[1,u],groupProfileAction:[7,Dt],hasProfilePicture:[3,o],isAdmin:[4,o],preciseGroupSizeBucket:[5,Ir],profilePictureType:[6,Fr]},[1,1,1],"regular"],HfmTextSearchComplete:[2186,{},[1,1,1],"regular"],InlineVideoPlaybackClosed:[2032,{inlineVideoCancelBeforePlayStateT:[7,c],inlineVideoComplete:[8,o],inlineVideoCompletionRate:[9,s],inlineVideoCtaClick:[10,Ft],inlineVideoDurationT:[2,c],inlineVideoError:[11,u],inlineVideoPlayStartT:[6,c],inlineVideoPlayed:[3,o],inlineVideoStallT:[4,c],inlineVideoType:[1,jt],inlineVideoWatchT:[5,c],messageType:[12,Un]},[1,1,1],"regular"],KeepInChatErrors:[3698,{canEditDmSettings:[7,o],isAGroup:[2,o],isAdmin:[3,o],kicAction:[4,Ht],kicErrorCode:[5,$t],kicMessageEphemeralityDuration:[6,s]},[1,1,1],"regular"],KeepInChatNotif:[3484,{kicGroupNotificationTaps:[3,s],kicGroupNotifications:[4,s],kicNotificationTaps:[5,s],kicNotifications:[6,s]},[1,1,1],"regular"],KeepInChatNux:[3486,{chatEphemeralityDuration:[1,s],kicNuxActionName:[2,zt],threadId:[3,u],trigger:[4,na]},[1,1,1],"regular"],KeepInChatPerf:[3488,{chatEphemeralityDuration:[1,s],kicErrorCode:[2,$t],kicMessageEphemeralityDuration:[3,s],kicRequestType:[4,qt],requestSendTime:[5,s],response:[6,mi],threadId:[7,u]},[1,1,1],"regular"],LabelEvent:[1422,{itemsLabeledCount:[5,s],labelCount:[4,s],labelOperation:[2,Jt],labelTarget:[1,Qt],predefinedLabelNumber:[3,s]},[1,1,1],"regular"],LdpExampleEvent1:[2866,{rapporValue1:[1,s],rapporValue2:[2,s]},[1,1,1],"private",113760892],Login:[460,{androidKeystoreState:[10,E],connectionOrigin:[6,Ke],connectionT:[5,c],loginResult:[1,nn],loginT:[3,c],longConnect:[4,o],passive:[8,o],retryCount:[2,s],sequenceStep:[7,s],serverErrorCode:[9,s]},[1,1,1],"regular"],MarketingOptOut:[3948,{businessPhoneNumber:[1,s],marketingOptOutEventType:[2,rn],numIncomingMessages:[4,s],templateId:[3,u]},[1,1,1],"private",0],MdAppStateDirtyBits:[2520,{dirtyBitsFalsePositive:[2,o]},[1,20,1e3],"regular"],MdAppStateKeyRotation:[2518,{mdAppStateKeyRotationReason:[1,an]},[1,20,1e3],"regular"],MdAppStateMessageRange:[2522,{additionalMessagesCount:[1,s]},[1,20,1e3],"regular"],MdAppStateOfflineNotifications:[2602,{redundantCount:[1,s]},[1,20,1e3],"regular"],MdAppStateSyncDaily:[2300,{crossIndexConflictCount:[11,s],invalidActionCount:[4,s],keyRotationRemoveCount:[12,s],missingKeyCount:[9,s],mutationCount:[1,s],storedMutationCount:[7,s],unsetActionCount:[8,s],unsupportedActionCount:[5,s],uploadConflictCount:[10,s]},[1,1,1],"regular"],MdAppStateSyncMutationStats:[3180,{applied:[1,Bn],failed:[2,Bn],invalid:[3,Bn],orphan:[4,Bn],syncdAction:[5,u],unsupported:[6,Bn]},[1,1,20],"private",0],MdBadDeviceSentMessage:[2176,{dsmError:[2,_t],peerType:[1,it]},[1,1,1],"regular"],MdBootstrapAppStateCriticalDataProcessing:[3164,{bootstrapAppStateDataStage:[1,U],mdBootstrapPayloadType:[2,sn],mdRegAttemptId:[3,u],mdSessionId:[4,u],mdTimestamp:[5,s]},[1,1,1],"regular"],MdBootstrapAppStateDataDownloaded:[2294,{mdBootstrapContactsCount:[5,s],mdBootstrapHistoryPayloadType:[11,on],mdBootstrapPayloadSize:[4,s],mdBootstrapPayloadType:[2,sn],mdBootstrapStepDuration:[6,s],mdBootstrapStepResult:[7,un],mdRegAttemptId:[10,u],mdSessionId:[1,u],mdStorageQuotaBytes:[8,s],mdStorageQuotaUsedBytes:[9,s],mdTimestamp:[3,s]},[1,1,1],"regular"],MdBootstrapDataApplied:[2298,{collection:[5,Le],historySyncStageProgress:[11,s],mdBootstrapContactsCount:[8,s],mdBootstrapHistoryPayloadType:[10,on],mdBootstrapPayloadType:[3,sn],mdBootstrapSource:[2,ln],mdBootstrapStepDuration:[6,s],mdRegAttemptId:[9,u],mdSessionId:[1,u],mdTimestamp:[4,s],usedSnapshot:[7,o]},[1,1,1],"regular"],MdBootstrapHistoryDataDownloaded:[2296,{historySyncStageProgress:[14,s],mdBootstrapChatsCount:[6,s],mdBootstrapHistoryPayloadType:[13,on],mdBootstrapMessagesCount:[5,s],mdBootstrapPayloadSize:[4,s],mdBootstrapPayloadType:[2,sn],mdBootstrapStepDuration:[7,s],mdBootstrapStepResult:[8,un],mdHsOldestMessageTimestamp:[11,s],mdRegAttemptId:[12,u],mdSessionId:[1,u],mdStorageQuotaBytes:[9,s],mdStorageQuotaUsedBytes:[10,s],mdTimestamp:[3,s]},[1,1,1],"regular"],MdBootstrapHistoryDataReceived:[2998,{historySyncStageProgress:[5,s],mdBootstrapHistoryPayloadType:[3,on],mdBootstrapPayloadType:[2,sn],mdSessionId:[1,u],mdTimestamp:[4,s]},[1,1,1],"regular"],MdChatAssignment:[3752,{assignerAgentId:[1,u],assignerBrowserId:[2,u],assignerMdId:[3,s],chatAssignmentAction:[4,ge],chatAssignmentAgentId:[5,u],chatAssignmentBrowserId:[6,u],chatAssignmentChatType:[7,me],chatAssignmentEntryPoint:[8,ye],chatAssignmentMdId:[9,s],chatsCnt:[10,s]},[1,1,1],"regular"],MdChatAssignmentSecondaryAction:[3716,{mdChatAssignmentSecondaryActionAgentId:[1,u],mdChatAssignmentSecondaryActionAssignmentType:[8,cn],mdChatAssignmentSecondaryActionBrowserId:[2,u],mdChatAssignmentSecondaryActionChatType:[3,dn],mdChatAssignmentSecondaryActionError:[4,Ct],mdChatAssignmentSecondaryActionMdId:[5,s],mdChatAssignmentSecondaryActionSource:[6,_n],mdChatAssignmentSecondaryActionType:[7,pn]},[1,1,1],"regular"],MdCriticalEvent:[2746,{collection:[2,Le],mdCriticalEventCode:[1,mn]},[1,1,1],"regular"],MdDeviceSyncAck:[2180,{chatType:[1,Mn],isLid:[3,o],revoke:[2,o],typeOfGroup:[4,oa]},[1,1,1],"regular"],MdExpansionAgentBrowserMdId:[3390,{agentId:[1,u],browserId:[2,u],companionMdId:[5,s],isCustomAgentName:[6,o],isNewAgent:[9,o],loginTimestamp:[3,s],logoutTimestamp:[4,s],mdLinkedCount:[8,s],multideviceAction:[7,xn]},[1,1,1],"regular"],MdFatalError:[2304,{collection:[2,Le],currentPrimaryAppVersion:[14,u],daysSinceLastPeriodicSync:[11,s],hoursSinceFirstFiniteFailure:[12,s],isBootstrap:[3,o],isFatal:[16,o],mailboxAgeDays:[13,s],mdFatalErrorCode:[1,yn],patchSnapshotMutationCount:[9,s],patchVersion:[5,s],sessionStartPrimaryAppVersion:[15,u],sourceType:[10,En],timeSincePairingMs:[6,s],timeSinceRefreshMs:[7,s],timeSinceTabTakeoverMs:[8,s]},[1,1,1],"regular"],MdLinkDeviceCompanion:[2576,{mdDurationS:[8,s],mdLinkDeviceCompanionErrorCode:[6,s],mdLinkDeviceCompanionStage:[4,hn],mdRegAttemptId:[9,u],mdSessionId:[1,u],mdTimestampS:[7,s],mdWasUpgraded:[5,o]},[1,1,1],"regular"],MdLoadingHistoryMessage:[3382,{chatThreadId:[1,u],loadingMessageTypeShown:[2,Xt],mdSessionId:[3,u]},[1,1,1],"regular"],MdPushnameValidation:[2302,{didWebUserChangeSyncd:[3,o],isSyncdPushnameEmpty:[2,o],matches:[1,o],validationCaller:[4,Sn],validationStage:[5,gn],webPlatform:[6,Tn]},[1,1,1e3],"regular"],MdRetryFromUnknownDevice:[2178,{offline:[2,o],senderType:[1,it]},[1,1,1],"regular"],MdSyncdDogfoodingFeatureUsage:[3016,{mdSyncdDogfoodingFeature:[1,fn]},[1,1,1],"regular"],MediaDownload2:[1590,{connectionType:[31,He],debugMediaException:[24,u],debugMediaIp:[22,u],debugUrl:[23,u],downloadBytesTransferred:[20,l],downloadConnectT:[15,c],downloadHttpCode:[18,s],downloadIsReuse:[17,o],downloadIsStreaming:[19,o],downloadNetworkT:[16,c],downloadQuality:[37,pt],downloadResumePoint:[14,s],downloadTimeToFirstByteT:[21,c],estimatedBandwidth:[36,l],expressPathBytesSaved:[42,l],expressPathTimeSavedMs:[43,c],hasLeveragedExpressPath:[44,o],isViewOnce:[41,o],mediaId:[38,s],networkStack:[30,Yn],overallAttemptCount:[4,s],overallBackendStore:[39,O],overallConnBlockFetchT:[10,c],overallConnectionClass:[29,u],overallCumT:[27,c],overallDecryptT:[12,c],overallDomain:[5,u],overallDownloadMode:[11,vn],overallDownloadOrigin:[35,dt],overallDownloadResult:[25,An],overallFileValidationT:[13,c],overallIsEncrypted:[28,o],overallIsFinal:[26,o],overallMediaSize:[7,l],overallMediaType:[1,Pn],overallMmsVersion:[6,s],overallQueueT:[9,c],overallRetryCount:[3,s],overallT:[8,c],usedFallbackHint:[40,u]},[1,1,1],"regular"],MediaPicker:[1038,{audienceSelectorClicked:[24,o],audienceSelectorUpdated:[25,o],chatRecipients:[16,s],isViewOnce:[22,o],mediaPickerChanged:[4,s],mediaPickerCroppedRotated:[10,s],mediaPickerDeleted:[3,s],mediaPickerDrawing:[11,s],mediaPickerFilter:[18,s],mediaPickerHasLocationSticker:[26,o],mediaPickerLikeDoc:[19,s],mediaPickerNotLikeDoc:[20,s],mediaPickerOrigin:[14,Cn],mediaPickerOriginThirdParty:[21,o],mediaPickerSent:[2,s],mediaPickerSentUnchanged:[5,s],mediaPickerStickers:[12,s],mediaPickerT:[15,c],mediaPickerText:[13,s],mediaType:[1,Pn],photoGalleryDurationT:[23,c],statusRecipients:[17,s]},[1,1,1],"regular"],MediaStreamPlayback:[1584,{bytesDownloadedStart:[4,l],bytesTransferred:[5,l],didPlay:[15,o],forcedPlayCount:[12,s],initialBufferingT:[7,c],mediaSize:[2,l],mediaType:[3,Pn],overallPlayT:[10,c],overallT:[1,c],playbackCount:[14,s],playbackError:[17,s],playbackOrigin:[16,Er],playbackState:[11,Sr],seekCount:[13,s],totalRebufferingCount:[9,s],totalRebufferingT:[8,c],videoDuration:[6,s]},[1,1,1],"regular"],MediaUpload2:[1588,{connectionType:[43,He],debugMediaException:[34,u],debugMediaIp:[32,u],debugUrl:[33,u],estimatedBandwidth:[45,l],finalizeConnectT:[28,c],finalizeHttpCode:[31,s],finalizeIsReuse:[30,o],finalizeNetworkT:[29,c],isViewOnce:[49,o],mediaId:[46,s],networkStack:[42,Yn],overallAttemptCount:[4,s],overallConnBlockFetchT:[10,c],overallConnectionClass:[41,u],overallCumT:[37,c],overallCumUserVisibleT:[38,c],overallDomain:[5,u],overallEncryptT:[50,c],overallIsFinal:[36,o],overallIsForward:[16,o],overallIsManual:[13,o],overallLastUploadRetryPhase:[11,lr],overallMediaKeyReuse:[40,ur],overallMediaSize:[7,l],overallMediaType:[1,Pn],overallMmsVersion:[6,s],overallOptimisticFlag:[12,nr],overallQueueT:[9,c],overallRetryCount:[3,s],overallT:[8,c],overallTranscodeT:[15,c],overallUploadMode:[39,On],overallUploadOrigin:[44,pa],overallUploadResult:[35,In],overallUserVisibleT:[14,c],resumeConnectT:[17,c],resumeHttpCode:[20,s],resumeIsReuse:[19,o],resumeNetworkT:[18,c],uploadBytesTransferred:[27,l],uploadConnectT:[22,c],uploadHttpCode:[25,s],uploadIsReuse:[24,o],uploadIsStreaming:[26,o],uploadNetworkT:[23,c],uploadResumePoint:[21,s],uploadSource:[48,_a],usedFallbackHint:[47,u]},[1,1,1],"regular"],MemoryStat:[1336,{hasVerifiedNumber:[7,o],numMessages:[8,l],privateBytes:[3,l],processType:[5,u],sharedBytes:[4,l],uptime:[6,l],workingSetPeakSize:[2,l],workingSetSize:[1,l]},[1,1,1],"regular"],MessageContextMenuActions:[3694,{isAGroup:[1,o],isMultiAction:[2,o],isOriginalSender:[3,o],messageContextMenuAction:[4,bn],messageContextMenuOption:[5,Rn]},[1,1,1],"regular"],MessageDeleteActions:[3626,{deleteActionType:[1,nt],isAGroup:[2,o],mediaType:[6,Pn],messagesDeleted:[3,s],threadId:[4,u]},[1,1,1],"regular"],MessageHighRetryCount:[3132,{deviceSizeBucket:[5,Ri],e2eSenderType:[3,mt],mediaType:[1,Pn],messageType:[4,Un],retryCount:[2,s]},[1,20,20],"regular"],MessageReceive:[450,{deviceCount:[16,s],deviceSizeBucket:[10,Ri],disappearingChatInitiator:[14,at],ephemeralityDuration:[13,s],isAReply:[19,o],isForwardedForward:[18,o],isLid:[24,o],isViewOnce:[9,o],messageIsInternational:[4,o],messageIsInvisible:[23,o],messageIsOffline:[5,o],messageMediaType:[2,Pn],messageQueueTime:[15,c],messageReceiveT0:[6,c],messageReceiveT1:[7,c],messageType:[1,Un],mutedGroupMessage:[8,o],numOfWebUrlsInTextMessage:[3,s],paddingBytesSize:[22,s],participantCount:[17,s],receiverDefaultDisappearingDuration:[12,s],revokeType:[20,Ei],senderDefaultDisappearingDuration:[11,s],typeOfGroup:[21,oa]},[1,1,1],"regular"],MessageSecretErrors:[3686,{messageSecretAllowedList:[1,Ln],messageSecretError:[2,Dn]},[1,1,1],"regular"],MessageSend:[854,{deviceCount:[31,s],deviceSizeBucket:[25,Ri],disappearingChatInitiator:[30,at],e2eBackfill:[23,o],e2eCiphertextType:[10,ft],e2eCiphertextVersion:[9,s],ephemeralityDuration:[21,s],excessPayloadKbSize:[40,s],fastForwardEnabled:[15,o],isAReply:[35,o],isFromWamsys:[19,o],isLid:[39,o],isViewOnce:[22,o],mediaCaptionPresent:[8,o],messageDistributionType:[41,Nn],messageForwardAgeT:[14,c],messageIsFanout:[5,o],messageIsFastForward:[13,o],messageIsFirstUserMessage:[26,o],messageIsForward:[4,o],messageIsInternational:[7,o],messageIsInvisible:[29,o],messageIsRevoke:[24,o],messageMediaType:[3,Pn],messageSendOptUploadEnabled:[12,o],messageSendResult:[1,kn],messageSendResultIsTerminal:[17,o],messageSendT:[11,c],messageType:[2,Un],networkWasDisconnected:[37,o],participantCount:[32,s],receiverDefaultDisappearingDuration:[28,s],resendCount:[16,s],retryCount:[6,s],revokeDuration:[33,s],revokeType:[34,Ei],senderDefaultDisappearingDuration:[27,s],stickerIsAvatar:[38,o],stickerIsFirstParty:[18,o],thumbSize:[20,l],typeOfGroup:[36,oa]},[1,1,1],"regular"],MessageTemplateBlocks:[3002,{blockEntryPoint:[3,L],blockReason:[2,k],businessMessageTime:[5,s],businessPhoneNumber:[6,s],didUserReply:[4,o],isUnsubBlock:[7,o],templateId:[1,u]},[1,1,1],"private",113760892],MexEvent:[3782,{isMex:[1,o],mexEventData:[2,u],mexEventDurationT:[12,c],mexEventEndTime:[3,s],mexEventEnvelopeResponseStatus:[13,s],mexEventOperation:[7,u],mexEventPayloadResponseStatus:[14,s],mexEventRequestSize:[8,s],mexEventResponseSize:[9,s],mexEventRetries:[10,s],mexEventStartTime:[11,s]},[1,1,1],"regular"],NetworkApiErrorEvent:[3692,{apiErrorCode:[1,s],apiName:[2,u],client:[3,u],exception:[4,u],graphQlErrorCode:[5,s],metaData:[6,u],stacktrace:[7,u]},[1,1,1],"private",0],NfmLocationReply:[3878,{businessJid:[1,u],locationPermissionPost:[2,Zt],locationPermissionPre:[3,en],locationStatus:[4,tn],preciseLocationPermissionPost:[5,o],preciseLocationPermissionPre:[6,o]},[1,1,1],"private",0],NonMessagePeerDataMediaUpload:[3902,{peerDataErrorCount:[1,s],peerDataExistingDataNoUploadCount:[2,s],peerDataNotFoundCount:[3,s],peerDataRequestCount:[4,s],peerDataRequestSessionId:[5,u],peerDataRequestType:[6,pr],peerDataSuccessUploadCount:[7,s]},[1,1,1],"regular"],NonMessagePeerDataOperationResponse:[3904,{peerDataErrorCount:[1,s],peerDataNotFoundCount:[2,s],peerDataRequestSessionId:[3,u],peerDataRequestType:[4,pr],peerDataResponseCount:[5,s],peerDataSuccessProcessCount:[6,s],peerDataSuccessResponseCount:[7,s]},[1,1,1],"regular"],NonMessagePeerDataRequest:[3906,{peerDataRequestCount:[1,s],peerDataRequestSessionId:[2,u],peerDataRequestType:[3,pr]},[1,1,1],"regular"],NotificationDelivery:[3748,{clientMessageId:[1,u],notificationAction:[2,Kn],notificationDeliveryT:[3,s],notificationDestination:[4,Hn],notificationId:[5,u],notificationSource:[6,Qn],threadId:[7,u],uiNotificationType:[8,Xn]},[1,1,1],"regular"],NotificationEngagement:[3796,{avgNotifEngagementT:[1,c],groupSizeBucket:[2,Ne],groupTypeClient:[3,kt],isAGroup:[4,o],threadId:[5,u],totalNotifMarkAsRead:[6,s],totalNotifMissedCallVoipCallback:[7,s],totalNotifMissedCallVoipMessage:[8,s],totalNotifOthers:[9,s],totalNotifReply:[10,s],totalNotifRtcVoipAccept:[11,s],totalNotifRtcVoipDecline:[12,s],totalNotifShowPreview:[13,s],totalNotifShown:[14,s],totalNotifTapToOpen:[15,s]},[1,1,1],"regular"],NotificationSetting:[3684,{groupReactionNotification:[1,o],groupShowNotification:[2,o],groupSoundTone:[3,Jn],inAppNotificationAlertStyle:[4,Gt],inAppNotificationSound:[5,o],inAppNotificationVibrate:[6,o],messageReactionNotification:[7,o],messageShowNotification:[8,o],messageSoundTone:[9,Jn],showPreview:[10,o]},[1,1,1],"regular"],OfflineResume:[3112,{chatThreadCount:[1,s],expectedOfflineMessageCount:[17,s],expectedOfflineNotificationCount:[18,s],expectedOfflineReceiptCount:[19,s],isOfflineCompleteMissed:[2,o],isResumeInForeground:[13,o],lastStanzaT:[3,c],mailboxAge:[14,s],mainScreenLoadT:[4,c],offlineDecryptErrorCount:[5,s],offlineMessageCount:[6,s],offlineNotificationCount:[7,s],offlinePreviewT:[8,c],offlineProcessingT:[20,c],offlineReceiptCount:[9,s],offlineResumeResult:[21,er],offlineSizeBytes:[10,s],onTrickleMode:[15,o],pageLoadT:[11,c],socketConnectT:[12,c]},[1,1,1],"regular"],OfflineResumeStage:[3536,{chatThreadCount:[4,s],currentOfflineStage:[1,tr],isResumeInForeground:[5,o],mailboxAge:[6,s],offlineDecryptErrorCount:[7,s],offlineMessageCount:[8,s],offlineNotificationCount:[9,s],offlineReceiptCount:[10,s],offlineSessionId:[2,u],offlineStageTimestampMs:[3,s]},[1,1,1],"regular"],OrderDetailsActionsSmb:[3456,{acceptedPayMethods:[1,u],actionCategory:[2,u],extraAttributes:[3,u],hasAddedPrice:[4,o],hasCatalog:[5,o],hasNote:[6,o],orderDetailEntryPoint:[7,u],orderDetailsCreationAction:[8,rr],paymentStatus:[9,o],paymentType:[10,u]},[1,1,1],"regular"],OtpCopyCodeClick:[3080,{businessPhoneNumber:[1,s],otpEntryPoint:[4,ir],otpEventType:[5,or],templateId:[3,u]},[1,1,1],"private",0],OtpRetriever:[3468,{businessPhoneNumber:[1,s],ctaFallbackReason:[2,ze],ctaType:[3,qe],messageReceivedElapsedTimeSeconds:[11,s],otpEventSource:[5,ar],otpEventType:[6,or],otpProductType:[7,sr],otpSessionId:[8,u],thirdPartyPackageNameFromIntent:[9,u],thirdPartyPackageSignatureHash:[10,u]},[1,1,1],"private",0],PaymentsDaily:[2950,{invitedUserCnt:[2,s],invitedUserRegisteredCnt:[3,s],inviterUserCnt:[5,s],invitesReceivedToUserCnt:[4,s],invitesSentToUserCnt:[1,s],startTs:[14,s],totalOneTimeMandateCnt:[15,s],totalRecurringMandateCnt:[16,s],totalTransactionReceivedCnt:[10,s],totalTransactionSentCnt:[6,s],transactionReceivedWithBackgroundAndStickerCnt:[13,s],transactionReceivedWithBackgroundCnt:[12,s],transactionReceivedWithStickerCnt:[11,s],transactionSentWithBackgroundAndStickerCnt:[9,s],transactionSentWithBackgroundCnt:[8,s],transactionSentWithStickerCnt:[7,s]},[1,1,1],"private",113760892],PlaceholderActivity:[1980,{deviceCount:[9,s],deviceSizeBucket:[8,Ri],isLid:[12,o],messageIsRevoke:[7,o],messageKeyHash:[14,u],messageMediaType:[6,Pn],messageType:[5,Un],participantCount:[10,s],placeholderActionInd:[2,fr],placeholderAddReason:[11,gr],placeholderChatTypeInd:[3,hr],placeholderTimePeriod:[4,s],placeholderTypeInd:[1,mr],typeOfGroup:[13,oa]},[1,1,1],"regular"],PnhCagFutureProofBannerAction:[3826,{pnhCagBannerAction:[1,vr]},[1,1,1],"regular"],PnhDaily:[3806,{communityId:[1,u],pnhIndicatorClicksChat:[2,s],pnhIndicatorClicksInfoScreen:[3,s],reactionDeleteCount:[4,s],reactionOpenTrayCount:[5,s],typeOfGroup:[6,oa]},[1,1,1],"regular"],PnhRequestRevealAction:[3808,{pnhAction:[1,Tr],pnhChatParty:[2,Pr],pnhChatType:[3,Ar],pnhEntryPoint:[4,Cr],threadId:[5,u]},[1,1,1],"regular"],PollsActions:[3676,{groupSizeBucket:[1,Ne],isAGroup:[6,o],isAdmin:[2,o],pollAction:[3,Or],pollCreationDs:[4,s],pollOptionsCount:[5,s]},[1,1,1],"regular"],PollsDailyStats:[3680,{groupSizeBucket:[1,Ne],isAGroup:[9,o],optionsCount:[2,s],pollCreationDs:[3,s],pollId:[4,s],pollVoteDeletes:[5,s],pollVotes:[6,s],pollVotesChanged:[7,s],usersParticipated:[8,s]},[1,1,1],"private",0],PrekeysDepletion:[3014,{deviceSizeBucket:[3,Ri],messageType:[2,Un],prekeysFetchReason:[1,br]},[1,1,1],"regular"],PremiumSubscriptions:[3442,{subscriberType:[8,$i],subscriptionAction:[1,d],subscriptionAmount:[9,s],subscriptionAmountCurrency:[13,u],subscriptionAppStoreResult:[10,zi],subscriptionEntryPoint:[2,qi],subscriptionErrorType:[12,Ji],subscriptionLength:[3,s],subscriptionPaymentFailureErrorCode:[14,s],subscriptionProductSku:[4,u],subscriptionSessionId:[6,u],subscriptionType:[7,Qi]},[1,1,1],"regular"],PrivacyAlert:[3800,{privacyAlertCase:[1,Nr],privacyAlertCategory:[2,wr]},[1,1,1],"regular"],PrivacyHighlight:[3296,{highlightCategory:[1,u],highlightSurface:[2,Ut],userActionType:[3,ya]},[1,1,1],"regular"],PrivacyHighlightDaily:[3522,{dialogAppearCount:[1,s],dialogSelectCount:[2,s],narrativeAppearCount:[3,s],privacyHighlightCategory:[4,kr],privacyHighlightSurface:[5,Ur]},[1,1,1],"regular"],PrivacySettingsClick:[3726,{privacyControlEntryPoint:[1,Lr],privacyControlItem:[2,Dr]},[1,1,1],"regular"],ProductSearch:[3548,{catalogOwnerJid:[1,u],catalogSessionId:[2,u],productId:[3,u],searchEntryPoint:[4,Ti],searchResultIndex:[5,s],searchViewAction:[6,vi],sequenceNumber:[7,s]},[1,1,1],"private",0],PsAppLaunch:[3300,{psAppLaunchCpuT:[1,c],psAppLaunchDestination:[2,Yr],psAppLaunchMainPreT:[3,c],psAppLaunchMainRunT:[4,c],psAppLaunchT:[5,c],psAppLaunchTypeT:[6,Kr]},[1,1,1],"private",56300709],PsBufferUpload:[2244,{applicationState:[6,T],psBufferUploadHttpResponseCode:[3,s],psBufferUploadResult:[1,Hr],psBufferUploadT:[2,c],psDitheredT:[11,s],psForceUpload:[10,o],psTokenNotReadyReason:[4,zr],psUploadReason:[9,qr],waConnectedToChatd:[5,o]},[1,1,1],"regular"],PsCrashLog:[3312,{psAndroidAppStateMetadata:[1,u],psAndroidCrashedBuildVersion:[2,u],psCrashContext:[3,u],psCrashCount:[4,s],psCrashReason:[6,u],psCrashType:[7,Wr]},[1,1,1],"private",56300709],PsIdCreate:[2310,{},[1,1,1],"regular"],PsIdUpdate:[2862,{psIdAction:[2,Vr],psIdKey:[1,s],psIdRotationFrequence:[3,s]},[1,1,1],"regular"],PsP2bThreadsV1:[2994,{chatEphemeralityDuration:[11,s],chatMuted:[6,Oe],chatTypeInd:[18,Me],ephemeralMessagesReceived:[13,s],ephemeralMessagesSent:[12,s],groupSize:[3,s],isAContact:[1,o],isAGroup:[2,o],isArchived:[5,o],isPinned:[4,o],messagesReceived:[8,s],messagesSent:[7,s],messagesStarred:[9,s],messagesUnread:[10,s],startTime:[17,s],viewOnceMessagesOpened:[14,s],viewOnceMessagesReceived:[16,s],viewOnceMessagesSent:[15,s]},[1,1,1],"private",113760892],PsPhoneNumberHyperlink:[3266,{isPhoneNumHyperlinkOwner:[1,o],phoneNumHyperlinkAction:[2,_r],phoneNumberStatusOnWa:[3,o],sequenceNumber:[4,s]},[1,1,1],"private",113760892],PsStructuredMessageInteraction:[3052,{bizPlatform:[1,w],businessOwnerJid:[7,u],messageClass:[3,Vi],messageClassAttributes:[5,u],messageInteraction:[4,Yt],messageMediaType:[2,Pn]},[1,1,1],"private",0],PsUserActivitySessionSummary:[3314,{psUserActivityDuration:[1,s],psUserActivityForeground:[2,s],psUserActivitySessionsLength:[3,s],psUserActivityStartTime:[4,s],psUserActivityTimeChange:[5,s],psUserSessionSummarySequence:[6,s]},[1,1,1],"private",113760892],PsWebWamForceFlush:[3284,{collectionId:[1,u],randomIntField:[2,s]},[1,1,1],"private",113760892],Ptt:[458,{pttDraftPlayCnt:[7,s],pttDraftSeekCnt:[8,s],pttDuration:[5,c],pttLock:[4,o],pttPauseCnt:[9,s],pttResult:[1,ri],pttSize:[3,l],pttSource:[2,ii],pttStop:[6,o],pttStopTapCnt:[10,s]},[1,1,1],"regular"],PttDaily:[2938,{pttCancelBroadcast:[9,s],pttCancelGroup:[8,s],pttCancelIndividual:[7,s],pttDraftReviewBroadcast:[15,s],pttDraftReviewGroup:[14,s],pttDraftReviewIndividual:[13,s],pttFastplaybackBroadcast:[21,s],pttFastplaybackGroup:[20,s],pttFastplaybackIndividual:[19,s],pttLockBroadcast:[12,s],pttLockGroup:[11,s],pttLockIndividual:[10,s],pttOutOfChatBroadcast:[29,s],pttOutOfChatGroup:[30,s],pttOutOfChatIndividual:[31,s],pttPausedRecordBroadcast:[22,s],pttPausedRecordGroup:[23,s],pttPausedRecordIndividual:[24,s],pttPlaybackBroadcast:[18,s],pttPlaybackGroup:[17,s],pttPlaybackIndividual:[16,s],pttRecordBroadcast:[3,s],pttRecordGroup:[2,s],pttRecordIndividual:[1,s],pttSendBroadcast:[6,s],pttSendGroup:[5,s],pttSendIndividual:[4,s],pttStopTapBroadcast:[25,s],pttStopTapGroup:[26,s],pttStopTapIndividual:[27,s]},[1,1,1],"regular"],PttLockC:[2984,{},[1,1,1],"regular"],PttPlayback:[2044,{pttDuration:[12,c],pttMainThreadBlock:[7,o],pttMiniPlayerClick:[15,s],pttMiniPlayerClose:[16,o],pttMiniPlayerPauseCnt:[17,s],pttPlayRequestT:[1,c],pttPlaybackFailed:[8,o],pttPlaybackOverallT:[4,c],pttPlaybackSpeed:[10,ti],pttPlaybackSpeedCnt:[11,s],pttPlayedOutOfChat:[18,o],pttPlayedPct:[14,l],pttPlayer:[9,ni],pttPlayerInitT:[2,c],pttPlayerPlayT:[3,c],pttSeekCnt:[13,s],pttTrigger:[5,oi],pttType:[6,ai]},[1,1,1],"regular"],QuickReply:[1468,{attachmentGifCount:[7,s],attachmentImageCount:[5,s],attachmentVideoCount:[6,s],isSmartDefault:[10,o],quickReplyAction:[1,li],quickReplyCount:[2,s],quickReplyEntryPoint:[11,ui],quickReplyKeywordCount:[3,s],quickReplyKeywordMatched:[4,o],quickReplyOrigin:[9,ci],quickReplyTranscodeResult:[8,di]},[1,1,1],"regular"],ReactionActions:[3184,{mediaType:[3,Pn],messageType:[1,Un],reactionAction:[2,_i]},[1,10,20],"regular"],RevokeMessageSend:[3656,{messageSendResultIsTerminal:[1,o],messageType:[2,Un],resendCount:[3,s],retryCount:[4,s],revokeDuration:[5,s],revokeType:[6,Ei]},[1,1,1],"regular"],RoomsCreationFlow:[2202,{entryResult:[3,rt],errorReason:[2,At],roomsEntryPoint:[1,Si]},[1,1,1],"regular"],ScreenLockSettings:[3872,{screenLockDuration:[1,s]},[1,1,1],"private",113760892],SendRevokeMessage:[1348,{messageMediaType:[2,Pn],messageType:[1,Un],revokeSendDelay:[3,s]},[1,1,1],"regular"],SenderKeyExpired:[3130,{chatType:[1,Mn],deviceSizeBucket:[2,Ri],expiryReason:[3,Pt]},[1,1,1],"regular"],SettingsClick:[2214,{settingsItem:[1,Ci]},[1,1,1],"regular"],ShareBizTools:[3444,{isPremiumUser:[1,o],linkType:[2,Pi],shareBusinessAction:[3,Oi]},[1,1,1],"regular"],SignCredential:[2242,{applicationState:[6,T],overallT:[4,c],projectCode:[7,jr],retryCount:[2,s],signCredentialResult:[1,Mi],signCredentialT:[3,c],waConnectedToChatd:[5,o]},[1,1,1],"regular"],SmbOnboardingJourney:[3828,{appInstallSource:[1,u],hasConsumerApp:[2,o],isLoggedInOnConsumerApp:[3,o],sequenceNumber:[4,s],smbOnboardingStep:[5,Ni]},[1,1,1],"private",113760892],SnackbarDeleteUndo:[3628,{isAGroup:[1,o],mediaType:[6,Pn],messagesUndeleted:[2,s],snackbarActionType:[3,wi],threadId:[4,u]},[1,1,1],"regular"],StatusItemView:[1658,{isPosterBiz:[23,o],isPosterInAddressBook:[25,o],mediaType:[4,Pn],psaCampaignId:[17,u],psaCampaignItemIndex:[18,s],psaLinkAvailable:[19,o],psaLinkClick:[22,o],psaLinkLoadTime:[21,c],psaLinkOpenResult:[20,Qr],statusItemImpressionCount:[14,s],statusItemIndex:[16,s],statusItemLength:[7,c],statusItemLoadTime:[5,c],statusItemReplied:[8,s],statusItemUnread:[9,o],statusItemViewCount:[10,s],statusItemViewResult:[3,Di],statusItemViewTime:[6,c],statusRowIndex:[2,s],statusRowSection:[11,Bi],statusViewerSessionId:[1,s],urlStatusClicked:[26,ga],urlStatusType:[27,ma]},[1,1,1],"regular"],StatusReply:[1180,{isPosterBiz:[4,o],isPosterInAddressBook:[6,o],statusReplyMessageType:[3,ki],statusReplyResult:[2,Ui],statusSessionId:[1,s]},[1,1,1],"regular"],StatusReplyReceived:[3560,{statusMediaType:[1,Pn],statusPosterJid:[2,u],statusReplyMessageType:[3,ki]},[1,1,1],"private",0],StatusReportingEvents:[3920,{statusReportInteraction:[1,Gi]},[1,1,1],"regular"],StatusRowView:[1656,{psaCampaigns:[8,u],statusRowEntryMethod:[5,xi],statusRowIndex:[4,s],statusRowSection:[3,Bi],statusRowUnreadItemCount:[7,s],statusRowViewCount:[6,s],statusSessionId:[1,s],statusViewerSessionId:[2,s]},[1,1,1],"regular"],StatusTabOpen:[1172,{psaCampaigns:[5,u],statusAvailableUpdatesCount:[2,s],statusRankT:[3,c],statusSessionId:[1,s],statusTabOpenT:[4,c]},[1,1,1],"regular"],StatusViewerActions:[3688,{fullStatusViewed:[1,o],isFirstViewOfStatus:[2,o],isPosterBiz:[3,o],isPosterInAddressBook:[4,o],statusId:[5,u],statusPosterJid:[6,u],statusViewEntryPoint:[7,Fi],statusViewerNonTrafficActionType:[8,ji],statusViewerSessionId:[9,s]},[1,1,1],"private",0],StatusViewerTrafficActions:[3690,{fullStatusViewed:[1,o],isFirstViewOfStatus:[2,o],isPosterBiz:[3,o],isPosterInAddressBook:[4,o],statusId:[5,u],statusPosterJid:[6,u],statusReplyMessageType:[7,ki],statusViewEntryPoint:[8,Fi],statusViewerSessionId:[9,s],statusViewerTrafficActionType:[10,Yi]},[1,1,1],"private",0],StickerCommonQueryToStaticServer:[2740,{httpResponseCode:[2,s],params:[3,u],queryLatencyMs:[4,c],queryType:[1,si]},[1,1,1],"regular"],StickerDailyAggregatedEvent:[2884,{stickerAddToFavoriteCount:[11,s],stickerMakerCreates:[16,s],stickerMakerSends:[17,s],stickerPackDeleteCount:[12,s],stickerPickerOpenedCount:[13,s],stickerSearchOpenedCount:[14,s],stickerSendCount:[1,s],stickerSendCountForward:[6,s],stickerSendCountIsAnimated:[9,s],stickerSendCountIsFirstParty:[8,s],stickerSendCountIsWeb:[10,s],stickerSendCountStickerPickerTabEmotion:[5,s],stickerSendCountStickerPickerTabFavorites:[3,s],stickerSendCountStickerPickerTabPack:[15,s],stickerSendCountStickerPickerTabRecents:[2,s],stickerSendCountStickerSearch:[7,s]},[1,1,1],"regular"],StickerSend:[1840,{stickerIsAnimated:[3,o],stickerIsAvatar:[6,o],stickerIsFirstParty:[2,o],stickerIsFromStickerMaker:[5,o],stickerSendMessageType:[4,Ki],stickerSendOrigin:[1,Hi]},[1,1,1],"regular"],StrawberryBannerEvent:[3532,{strawberryAction:[1,Wi]},[1,1,1],"private",113760892],StructuredMessageReceive:[3222,{bizPlatform:[1,w],businessOwnerJid:[2,u],messageClass:[3,Vi],messageClassAttributes:[4,u],messageMediaType:[5,Pn]},[1,1,1],"private",0],TemplateTruncation:[1946,{buttonIndex:[3,s],originalLength:[2,s],templateComponent:[1,Zi]},[1,1,1],"regular"],TestAnonymousDaily:[2328,{},[1,1,1],"private",113760892],TestAnonymousDailyId:[2958,{psTestEnumField:[1,$r],psTestFloatField:[2,l]},[1,1,1],"private",248614979],TestAnonymousIdLess:[3004,{psTimeSinceLastEventInMin:[1,s]},[1,1,1],"private",0],TestAnonymousMonthlyId:[2960,{},[1,1,1],"private",191000728],TestAnonymousWeeklyId:[2956,{psTestBooleanField:[2,o],psTestStringField:[3,u],psTimeSinceLastEventInMin:[1,s]},[1,1,1],"private",42196056],UiAction:[472,{deviceCount:[5,s],isLid:[8,o],participantCount:[6,s],sizeBucket:[4,Ri],uiActionChatType:[7,sa],uiActionPreloaded:[2,o],uiActionT:[3,c],uiActionType:[1,la]},[1,1,1],"regular"],UiMessageYourselfAction:[3780,{uiMessageYourselfActionSessionId:[1,u],uiMessageYourselfActionType:[2,ua],uiMessageYourselfFunnelName:[3,ca]},[1,1,1],"regular"],UiRevokeAction:[3298,{messageAction:[1,da],uiRevokeActionDuration:[2,s],uiRevokeActionSessionId:[3,u]},[1,1,1],"regular"],UnknownStanza:[3448,{unknownStanzaTag:[1,u],unknownStanzaType:[2,u]},[1,1,1],"regular"],UserActivity:[1384,{userActivityBitmapHigh:[4,s],userActivityBitmapLen:[5,s],userActivityBitmapLow:[3,s],userActivitySessionCum:[7,s],userActivitySessionId:[1,u],userActivitySessionSeq:[6,s],userActivityStartTime:[2,s]},[1,1,1],"regular"],UserActivitySessionSummary:[1502,{ipStr:[7,u],userActivityDuration:[2,s],userActivityForeground:[5,s],userActivitySessionsLength:[3,s],userActivityStartTime:[1,s],userActivityTimeChange:[4,s],userSessionSummarySequence:[6,s]},[1,1,1],"regular"],UserNotice:[2472,{userNoticeContentVersion:[2,s],userNoticeEvent:[3,Sa],userNoticeId:[1,s]},[1,1,1],"regular"],UserNoticeError:[2474,{userNoticeContentVersion:[2,s],userNoticeErrorEvent:[3,Ea],userNoticeId:[1,s]},[1,1,1],"regular"],VideoTranscoder:[1802,{sourceAudioBitRate:[12,l],sourceDuration:[8,c],sourceFileSize:[7,l],sourceFormat:[14,Ca],sourceFrameRate:[13,l],sourceHeight:[10,l],sourceVideoBitRate:[11,l],sourceWidth:[9,l],targetAudioBitRate:[20,l],targetDuration:[16,c],targetFileSize:[15,l],targetFormat:[22,Pa],targetFrameRate:[21,l],targetHeight:[18,l],targetVideoBitRate:[19,l],targetWidth:[17,l],transcoderAlgorithm:[1,va],transcoderContainsVideocomposition:[5,o],transcoderHasEdits:[6,o],transcoderIsPassthrough:[4,o],transcoderResult:[2,Aa],transcoderT:[3,c]},[1,1,1],"regular"],ViewBusinessProfile:[1522,{bizFbSize:[9,ia],bizIgSize:[10,ia],businessProfileJid:[3,u],catalogSessionId:[6,u],hasCoverPhoto:[12,o],isProfileLinked:[11,o],isSelfView:[7,o],linkedAccount:[5,q],profileEntryPoint:[8,Br],scrollDepth:[4,s],viewBusinessProfileAction:[1,Ia],websiteSource:[2,lo]},[1,1,1],"regular"],ViewOnceScreenshotActions:[3606,{isAGroup:[1,o],threadId:[2,u],voMessageType:[3,ba],voSsAction:[4,Ra]},[1,1,1],"regular"],VnameCertHealthEvent:[1890,{vnameCertHealthEventType:[2,Ma]},[1,1,1],"regular"],WaFsGroupJoinRequestAction:[3944,{groupJid:[1,u],groupJoinRequestAction:[2,Lt],isSuccessful:[3,o],serverResponseTime:[4,c]},[1,1,1],"regular"],WaShopsManagement:[2908,{isShopsProductPreviewVisible:[2,o],shopsManagementAction:[1,Ii],shopsSellerJid:[3,u]},[1,1,1],"regular"],WamTestAnonymous0:[2240,{testAnonymousChatdConnectivity:[2,o],wamTestAnonymous0Field0:[1,u]},[1,1,1],"private",113760892],WebWamForceFlush:[3264,{},[1,1,1],"regular"],WebcAssetLoad:[1358,{webcAssetCacheType:[4,Ua],webcAssetFromCache:[2,o],webcAssetLoadT:[3,c],webcAssetName:[1,u],webcAssetSize:[5,l]},[1,1,1],"regular"],WebcButterbarEvent:[3932,{webcButterbarAction:[1,Ga],webcButterbarType:[2,xa]},[1,1,1],"regular"],WebcChatOpen:[864,{webcChatOpenBeforePaintT:[7,c],webcChatOpenPaintedT:[6,c],webcChatOpenT:[2,c],webcFinalRenderedMessageCount:[5,s],webcRenderedMessageCount:[4,s],webcUnreadCount:[1,l],webcWindowHeightFloat:[8,l]},[1,1,1],"regular"],WebcCpu:[3e3,{cpuSessionSeconds:[2,s],ftsIndexInProgess:[3,o],logInterval:[4,s],percentCpuUsage:[1,s]},[1,1,1],"regular"],WebcDbOpen:[1940,{webcDbName:[1,u],webcDbOpenNumAttempts:[3,s],webcDbOpenWasSuccess:[2,o]},[1,1,1],"regular"],WebcEmojiOpen:[1166,{webcEmojiOpenTab:[1,u]},[1,1,1],"regular"],WebcFingerprint:[1704,{webcCanvasFingerprint:[25,u],webcDocumentDriverEvaluate:[9,o],webcDocumentDriverUnwrapped:[7,o],webcDocumentElementAttrDriver:[14,o],webcDocumentElementAttrSelenium:[12,o],webcDocumentElementAttrWebdriver:[13,o],webcDocumentFxdriverEvaluate:[6,o],webcDocumentFxdriverUnwrapped:[11,o],webcDocumentSeleniumEvaluate:[2,o],webcDocumentSeleniumUnwrapped:[10,o],webcDocumentWebdriverEvaluate:[1,o],webcDocumentWebdriverScriptFn:[5,o],webcDocumentWebdriverScriptFunc:[4,o],webcDocumentWebdriverScriptFunction:[3,o],webcDocumentWebdriverUnwrapped:[8,o],webcWebglFingerprint:[24,u],webcWebglRenderer:[23,u],webcWebglVendor:[22,u],webcWindowSeleniumIdeRecorder:[20,o],webcWindowCallphantom:[18,o],webcWindowCallselenium:[19,o],webcWindowNavigatorWebdriver:[21,so],webcWindowNightmare:[16,o],webcWindowPhantom:[15,o],webcWindowSelenium:[17,o]},[1,1,1],"regular"],WebcFtsEfficiency:[3660,{ftsPrefixBytesStoredToMsgLengthRatio:[1,l]},[100,100,1e4],"regular"],WebcFtsStorage:[3642,{ftsTotalSize:[1,s]},[1,1,1],"regular"],WebcImgError:[1700,{webcImgErrorCode:[1,l]},[1,1,1],"regular"],WebcJobInfo:[3054,{jobName:[1,u],jobPriority:[2,u],jobResultType:[5,Ya],pendingJobsCount:[4,s],scenario:[3,Za],webcJobAddedT:[6,s],webcJobCompletedT:[8,s],webcJobStartedT:[7,s]},[1,1,1],"regular"],WebcLinkPreviewDisplay:[3864,{webcDisplayStatus:[1,Fa]},[1,1,1],"regular"],WebcLinkPreviewResponseHandle:[3860,{isPreviewSuccess:[2,o],previewDurationMs:[4,s],previewSessionId:[3,u]},[1,1,1],"regular"],WebcLogin:[1664,{webcBrowserNetworkType:[14,u],webcBrowserStorageQuotaBytes:[15,s],webcBrowserStorageQuotaUsedBytes:[16,s],webcLoginT:[3,c],webcPersistentLoginEnabled:[17,o],webcQrCodes:[1,s],webcQrLoadT:[2,c],webcSyncChatCount:[8,s],webcSyncChatSize:[10,s],webcSyncChatT:[9,c],webcSyncContactCount:[11,s],webcSyncContactSize:[13,s],webcSyncContactT:[12,c],webcSyncMessageCount:[5,s],webcSyncMessageSize:[7,s],webcSyncMessageT:[6,c],webcSyncT:[4,c]},[1,1,1],"regular"],WebcMediaAnalyzed:[912,{webcMediaAnalyzeT:[3,c],webcMediaExtensions:[2,u],webcMediaSupported:[1,o]},[1,1,1],"regular"],WebcMediaEditorSend:[2890,{blurImageCount:[7,s],editedImageCount:[2,s],emojiLayerCount:[5,s],imageCount:[1,s],paintedImageCount:[3,s],stickerLayerCount:[6,s],textLayerCount:[4,s]},[1,1,1],"regular"],WebcMediaErrorUnknownDetails:[2352,{mediaId:[1,s],webcMediaErrorMessage:[4,u],webcMediaErrorName:[3,u],webcMediaOperation:[2,Ha]},[1,1,1],"regular"],WebcMediaLoad:[1202,{webcMediaLoadResult:[2,Ka],webcMediaLoadT:[1,c]},[1,1,1],"regular"],WebcMediaRmr:[1906,{messageMediaType:[10,Pn],webcBrowserNetworkType:[2,u],webcBrowserStorageQuotaBytes:[11,s],webcBrowserStorageQuotaUsedBytes:[12,s],webcChatPosition:[1,s],webcChatType:[9,Ba],webcMediaRmrError:[8,o],webcMediaRmrT:[6,c],webcMediaSize:[7,s],webcMessageIndex:[3,s],webcMessageT:[5,c],webcRmrReason:[14,Xa],webcRmrStatusCode:[13,s]},[1,1,1],"regular"],WebcMemoryStat:[1188,{hasVerifiedNumber:[12,o],jsHeapSizeLimit:[9,s],numMessages:[8,l],totalJsHeapSize:[10,s],uptime:[6,l],usedJsHeapSize:[11,s]},[1,1,1],"regular"],WebcMenu:[2504,{webcMenuAction:[2,Va],webcMenuItemLabel:[3,Wa]},[1,1,1],"regular"],WebcMessageQuery:[1876,{webcAudioMessageCount:[14,s],webcBrowserNetworkType:[1,u],webcBrowserStorageQuotaBytes:[20,s],webcBrowserStorageQuotaUsedBytes:[21,s],webcChatPosition:[2,s],webcChatType:[13,Ba],webcDocumentMessageCount:[16,s],webcEarliestMessageIndex:[11,s],webcEarliestMessageT:[12,c],webcMessageCount:[4,s],webcMessageQueryTrigger:[19,Qa],webcMessageQueryType:[3,$a],webcOtherMessageCount:[18,s],webcPhotoMessageCount:[7,s],webcPttMessageCount:[15,s],webcQueryT:[9,c],webcResponseBytes:[10,s],webcStickerMessageCount:[17,s],webcTextMessageCount:[5,s],webcVideoMessageCount:[6,s]},[1,1,1],"regular"],WebcMessageSend:[2072,{messageIsForward:[3,o],messageMediaType:[2,Pn],messageSendT:[4,c],messageType:[1,Un]},[1,1,1],"regular"],WebcNativeUpsellCta:[3934,{webcNativeUpsellCtaSource:[1,za]},[1,1,1],"regular"],WebcOfflineResume:[2628,{chatThreadCount:[9,s],decryptErrorCount:[4,s],isOfflineCompleteMissed:[11,o],offlineMessageCount:[2,s],offlineNotificationCount:[12,s],offlineReceiptCount:[3,s],offlineSizeBytes:[8,s],webcLastStanzaT:[10,c],webcMainScreenLoadT:[7,c],webcOfflinePreviewT:[6,c],webcPageLoadT:[1,c],webcSocketConnectT:[5,c]},[1,1,1],"regular"],WebcPageLoad:[642,{webcAppcacheStatus:[29,ka],webcCached:[30,o],webcConnectEnd:[10,c],webcConnectStart:[9,c],webcDomComplete:[19,c],webcDomContentLoadedEventEnd:[18,c],webcDomContentLoadedEventStart:[17,c],webcDomInteractive:[16,c],webcDomLoading:[15,c],webcDomainLookupEnd:[8,c],webcDomainLookupStart:[7,c],webcExeDone:[23,c],webcExeStart:[22,c],webcFetchStart:[6,c],webcInitialMountT:[38,c],webcInitialNavMountT:[39,c],webcInitialPanel:[42,u],webcInitialPanelMountStartT:[43,c],webcInitialPanelMountT:[40,c],webcInitialPanelRenderT:[46,c],webcJsLoadT:[37,c],webcLoadEventEnd:[21,c],webcLoadEventStart:[20,c],webcLoadInForeground:[53,o],webcMainScriptEnd:[45,c],webcMainScriptStart:[44,c],webcNativeLoadT:[36,c],webcNavigation:[32,qa],webcPageLoadT:[34,c],webcParallellyFetched:[41,o],webcQrCode:[31,o],webcRedirectCount:[33,l],webcRedirectEnd:[5,c],webcRedirectStart:[4,c],webcRequestStart:[12,c],webcResponseEnd:[14,c],webcResponseStart:[13,c],webcSecureConnectionStart:[11,c],webcUnloadEventEnd:[3,c],webcUnloadEventStart:[2,c],webcWsAttempts:[28,l],webcWsNormal:[27,c],webcWsOpening:[24,c],webcWsPairing:[25,c],webcWsSyncing:[26,c]},[1,1,1],"regular"],WebcPageResume:[884,{webcResumeCount:[1,s]},[1,1,1],"regular"],WebcPhoneDisconnected:[878,{webcPhoneBbarShownT:[2,c],webcPhoneDisconnectedT:[1,c]},[1,1,1],"regular"],WebcProgressiveImage:[2226,{webcFirstRenderScans:[1,s],webcFirstRenderT:[2,c],webcFullQualityT:[4,c],webcMidQualityT:[3,c]},[1,1,10],"regular"],WebcQplHealth:[3134,{webcQplHealthEventData:[1,u],webcQplHealthEventType:[2,Ja]},[1,1,1],"regular"],WebcRawPlatforms:[2416,{webcRawPlatform:[1,u]},[1,1,1],"regular"],WebcResourceLoad:[688,{webcResourceCached:[3,o],webcResourceDuration:[2,c],webcResourceName:[1,u]},[1,1,1],"regular"],WebcStatusSession:[1880,{webcStatusMutedItemCount:[4,s],webcStatusMutedRowCount:[7,s],webcStatusRecentItemCount:[2,s],webcStatusRecentRowCount:[5,s],webcStatusSessionId:[1,s],webcStatusViewedItemCount:[3,s],webcStatusViewedRowCount:[6,s]},[1,1,1],"regular"],WebcStatusSync:[1878,{webcStatusMutedItemCount:[4,s],webcStatusMutedRowCount:[7,s],webcStatusRecentItemCount:[2,s],webcStatusRecentRowCount:[5,s],webcStatusSyncT:[1,c],webcStatusViewedItemCount:[3,s],webcStatusViewedRowCount:[6,s]},[1,1,1],"regular"],WebcStatusView:[1882,{webcIsPosterBiz:[11,o],webcIsPostersAddressBook:[12,o],webcStatusLoadT:[6,c],webcStatusLoaded:[4,o],webcStatusMediaType:[5,eo],webcStatusPlaybackT:[8,c],webcStatusReplyCount:[9,s],webcStatusRowIndex:[3,s],webcStatusRowSection:[2,to],webcStatusSessionId:[1,s],webcStatusUnread:[10,o],webcStatusViewT:[7,c]},[1,1,1],"regular"],WebcStickerMakerEvents:[3104,{stickerMakerEventName:[1,no]},[1,1,1],"regular"],WebcStorageStat:[1504,{webcStorageQuota:[2,s],webcStorageUsage:[1,s]},[1,1,1],"regular"],WebcStreamModeChange:[770,{webcStreamMode:[1,ro]},[1,1,1],"regular"],WebcUiFreeze:[1836,{webcUiFreezeFps:[1,l],webcUiFreezeT:[2,c]},[1,1,1],"regular"],WebcWapRequest:[2006,{webcWapRequestAckT:[3,c],webcWapRequestDestination:[6,io],webcWapRequestKind:[5,ao],webcWapRequestName:[8,u],webcWapRequestRecvT:[4,c],webcWapRequestResponseSize:[2,s],webcWapRequestSize:[7,s],webcWapRequestStatus:[9,s]},[1,1,10],"regular"]});var ho=(0,i.default)((0,i.default)({},a.events),{METRICS:a.metrics,Global:fo,WamEvent:a.WamEvent,PrivateStatsAllIds:[{key:"DefaultPsId",keyHashInt:113760892,rotationPeriodDays:-1},{key:"IdPreMetrics",keyHashInt:56300709,rotationPeriodDays:-1},{key:"IdTtl90Days",keyHashInt:37887164,rotationPeriodDays:90},{key:"IdTtlDaily",keyHashInt:248614979,rotationPeriodDays:1},{key:"IdTtlMonthly",keyHashInt:191000728,rotationPeriodDays:30},{key:"IdTtlWeekly",keyHashInt:42196056,rotationPeriodDays:7}],ACTION:d,ACTION_CONDUCTED:p,ADV_DECODE_ERROR_TYPE:_,ADV_DECODE_PROTO_TYPE:f,AEC_MODE:h,AGC_MODE:g,ANDROID_CAMERA2_SUPPORT_LEVEL:m,ANDROID_CAMERA_API:y,ANDROID_KEYSTORE_STATE_TYPE:E,APP_BUILD_TYPE:S,APPLICATION_STATE:T,AUDIO_ENGINE_TYPE:v,AUDIO_OUTPUT_ROUTE:A,AUTO_MUTE_ACTION_TYPE:C,AUTO_REPLY_ACTION:P,BACKEND_STORE_TYPE:O,BACKUP_NETWORK_SETTING:I,BACKUP_SCHEDULE:M,BANNER_OPERATIONS:b,BANNER_TYPES:R,BIZ_CATALOG_TYPE:N,BIZ_PLATFORM:w,BLOCK_ENTRY_POINT:L,BLOCK_EVENT_ACTION_TYPE:D,BLOCK_REASON:k,BOOTSTRAP_APP_STATE_DATA_STAGE_CODE:U,BUSINESS_INTERACTION_ACTION_TYPE:G,BUSINESS_INTERACTION_ENTRY_POINT_APP:x,BUSINESS_INTERACTION_ENTRY_POINT_SOURCE:B,BUSINESS_INTERACTION_INTERNAL_ENTRY_POINT:F,BUSINESS_INTERACTION_TARGET_SCREEN_TYPE:j,BUSINESS_PREVIEW_ACTION_TYPE:Y,BUSINESS_PROFILE_ENTRY_POINT:K,BUSINESS_PROFILE_FIELD:H,BUSINESS_PROFILE_VIEW_ACTION:W,BUSINESS_PROFILE_WEBSITE_SOURCE_TYPE:V,BUSINESS_TOOLS_ENTRY_POINT_TYPE:$,BUSINESS_TOOLS_ITEM_TYPE:z,BUSINESS_TOOLS_LINKED_ACCOUNT_TYPE:q,CADMIN_DEMOTE_ORIGIN_TYPE:J,CADMIN_DEMOTE_RESULT_TYPE:Q,CALL_FROM_UI:X,CALL_NETWORK_MEDIUM:Z,CALL_RELAY_BIND_STATUS:ee,CALL_RESULT_TYPE:te,CALL_SETUP_ERROR_TYPE:ne,CALL_SIDE:re,CALL_TERM_REASON:ie,CALL_TEST_INTEGER:ae,CALL_TRANSPORT_TYPE:oe,CALL_VIDEO_STATE:se,CALL_WAKEUP_SOURCE:le,CAMERA_PREVIEW_MODE:ue,CAMERA_START_MODE_PARAMS:ce,CATALOG_BIZ_ACTION:de,CATALOG_ENTRY_POINT:pe,CATALOG_VIEW_ACTION:_e,CATEGORY_BROWSING_ENTRY_POINT:fe,CATEGORY_TYPE:he,CHAT_ASSIGNMENT_ACTION_TYPE:ge,CHAT_ASSIGNMENT_CHAT_TYPE:me,CHAT_ASSIGNMENT_ENTRY_POINT_TYPE:ye,CHAT_COMPOSER_ACTION_TARGETS:Ee,CHAT_COMPOSER_ACTION_TYPES:Se,CHAT_FILTER_ACTION_TYPES:Te,CHAT_FILTER_TARGET_SCREEN:ve,CHAT_FILTER_TYPES:Ae,CHAT_GATED_REASON:Ce,CHAT_MUTE_NOTIFICATION_CHOICE:Pe,CHAT_MUTED_TYPE:Oe,CHAT_SEARCH_RESULT_TYPE:Ie,CHAT_TYPE:Me,CHATS_FOLDER_TYPE:be,CLICKABLE_EVENT:Re,CLIENT_GROUP_SIZE_BUCKET:Ne,CLIENT_MESSAGE_SEND_STAGE:we,COLLECTION:Le,COMMERCE_ACTION:De,COMMERCE_ENTRY_POINT:ke,COMMERCE_PERF_ENTRY_POINT:Ue,COMMERCE_PERF_MARKER:Ge,COMMERCE_PERF_VIEW:xe,COMMUNITY_CREATION_ACTION_TAKEN_TYPE:Be,COMMUNITY_CREATION_CURRENT_SCREEN_TYPE:Fe,COMMUNITY_FEATURE_UI_ACTION_TAKEN_TYPE:je,COMMUNITY_UI_FEATURE_TYPE:Ye,CONNECTION_ORIGIN_TYPE:Ke,CONNECTION_TYPE:He,CONTACT_SEND_CHANNEL:We,CONTACT_US_EXIT_STATE:Ve,CRASH_TYPE:$e,CTA_FALLBACK_REASON:ze,CTA_TYPE:qe,CTWA_CHAT_CREATION_MODE:Je,CTWA_CONVERSION_TYPE:Qe,CTWA_USER_JOURNEY_OPERATION_TYPE:Xe,DEEP_LINK_ACTION:Ze,DEEP_LINK_OPEN_FROM:et,DEEP_LINK_TYPE:tt,DELETE_ACTION_TYPE:nt,DESTINATION:rt,DEVICE_TYPE:it,DISAPPEARING_CHAT_INITIATOR_TYPE:at,DISAPPEARING_MODE_ENTRY_POINT_TYPE:ot,DISAPPEARING_MODE_SETTING_EVENT_NAME_TYPE:st,DM_CHAT_PICKER_ENTRY_POINT_TYPE:lt,DM_CHAT_PICKER_EVENT_NAME_TYPE:ut,DM_SCREEN_ENTRY_POINT_TYPE:ct,DOWNLOAD_ORIGIN_TYPE:dt,DOWNLOAD_QUALITY_TYPE:pt,DSM_ERROR:_t,E2E_CIPHERTEXT_TYPE:ft,E2E_DESTINATION:ht,E2E_FAILURE_REASON:gt,E2E_SENDER_TYPE:mt,E2EE_SIZE_BUCKET:yt,EDIT_PROFILE_ACTION:Et,END_CALL_CONFIRMATION_TYPE:St,ENTRY_POINT_CONVERSION_TYPE:Tt,EPHEMERAL_SETTING_ENTRY_POINT_TYPE:vt,ERROR_REASON:At,ERROR_TYPE:Ct,EXPIRY_REASON:Pt,FIELD_STATS_ROW_TYPE:Ot,FORCE_UPGRADE_USER_ACTION_TYPE_V2:It,GA_STATUS:Mt,GIF_SEARCH_PROVIDER:bt,GRAPHQL_CATALOG_ENDPOINT:Rt,GRAPHQL_REQUEST_RESULT:Nt,GROUP_INFO_SETTING_TYPE:wt,GROUP_JOIN_REQUEST_ACTION_TYPE:Lt,GROUP_PROFILE_ACTION_TYPE:Dt,GROUP_TYPE_CLIENT:kt,HIGHLIGHT_SURFACE:Ut,IN_APP_NOTIFICATION_ALERT_STYLE:Gt,INCOMING_CALL_UI_ACTION_TYPE:xt,INIT_BWE_SOURCE:Bt,INLINE_VIDEO_CTA_CLICK:Ft,INLINE_VIDEO_TYPE:jt,INTERACTION_TYPE:Yt,KIC_ACTION_NAME_TYPE:Kt,KIC_ACTION_TYPE:Ht,KIC_ACTOR_TYPE:Wt,KIC_ENTRY_POINT_TYPE:Vt,KIC_ERROR_CODE_TYPE:$t,KIC_NUX_ACTION_NAME_TYPE:zt,KIC_REQUEST_TYPE_TYPE:qt,LABEL_OPERATIONS:Jt,LABEL_TARGETS:Qt,LOADING_MESSAGE_TYPE_SHOWN:Xt,LOCATION_PERMISSION_POST:Zt,LOCATION_PERMISSION_PRE:en,LOCATION_STATUS:tn,LOGIN_RESULT_TYPE:nn,MARKETING_OPT_OUT_EVENT_TYPE:rn,MD_APP_STATE_KEY_ROTATION_REASON_CODE:an,MD_BOOTSTRAP_HISTORY_PAYLOAD_TYPE:on,MD_BOOTSTRAP_PAYLOAD_TYPE:sn,MD_BOOTSTRAP_SOURCE:ln,MD_BOOTSTRAP_STEP_RESULT:un,MD_CHAT_ASSIGNMENT_ASSIGNMENT_TYPE:cn,MD_CHAT_ASSIGNMENT_CHAT_TYPE:dn,MD_CHAT_ASSIGNMENT_SECONDARY_ACTION_TYPE:pn,MD_CHAT_ASSIGNMENT_SOURCE_TYPE:_n,MD_FEATURE_CODE:fn,MD_LINK_DEVICE_COMPANION_STAGE:hn,MD_PUSHNAME_VALIDATION_STAGE_CODE:gn,MD_SYNCD_CRITICAL_EVENT_CODE:mn,MD_SYNCD_FATAL_ERROR_CODE:yn,MD_SYNCD_FATAL_ERROR_SOURCE:En,MD_VALIDATION_CALLER_CHANNEL:Sn,MD_VALIDATION_WEB_PLATFORM:Tn,MEDIA_DOWNLOAD_MODE_TYPE:vn,MEDIA_DOWNLOAD_RESULT_TYPE:An,MEDIA_PICKER_ORIGIN_TYPE:Cn,MEDIA_TYPE:Pn,MEDIA_UPLOAD_MODE_TYPE:On,MEDIA_UPLOAD_RESULT_TYPE:In,MESSAGE_CHAT_TYPE:Mn,MESSAGE_CONTEXT_MENU_ACTION_TYPE:bn,MESSAGE_CONTEXT_MENU_OPTION_TYPE:Rn,MESSAGE_DISTRIBUTION_ENUM_TYPE:Nn,MESSAGE_LEVEL_ACTION:wn,MESSAGE_SECRET_ALLOWED_TYPE:Ln,MESSAGE_SECRET_ERROR_TYPE:Dn,MESSAGE_SEND_RESULT_TYPE:kn,MESSAGE_TYPE:Un,MISSING_PROTO_TYPE:Gn,MULTIDEVICE_ACTION_TYPE:xn,MUTATION_COUNT_BUCKET:Bn,MUTE_CHAT_TYPE:Fn,MUTE_ENTRY_POINT:jn,NETWORK_STACK_TYPE:Yn,NOTIFICATION_ACTION_TYPE:Kn,NOTIFICATION_DESTINATION_TYPE:Hn,NOTIFICATION_PREFERRED_LINK_TYPE:Wn,NOTIFICATION_PREFERRED_LINK_TYPE_BUTTON_1:Vn,NOTIFICATION_PREFERRED_LINK_TYPE_BUTTON_2:$n,NOTIFICATION_PREFERRED_LINK_TYPE_BUTTON_3:zn,NOTIFICATION_SETTING_TYPE:qn,NOTIFICATION_SOUND_TONE:Jn,NOTIFICATION_SOURCE_TYPE:Qn,NOTIFICATION_TYPE_ENUM:Xn,NS_MODE:Zn,OFFLINE_RESUME_RESULT_TYPE:er,OFFLINE_RESUME_STAGES:tr,OPTIMISTIC_FLAG_TYPE:nr,ORDER_DETAILS_CREATION_ACTION:rr,OTP_ENTRY_POINT:ir,OTP_EVENT_SOURCE:ar,OTP_EVENT_TYPE:or,OTP_PRODUCT_TYPE:sr,OVERALL_LAST_UPLOAD_RETRY_PHASE_TYPE:lr,OVERALL_MEDIA_KEY_REUSE_TYPE:ur,OWNER_TYPE:cr,PEER_CALL_NETWORK_MEDIUM:dr,PEER_DATA_REQUEST_TYPE:pr,PHONE_NUM_HYPERLINK_ACTION_TYPE:_r,PLACEHOLDER_ACTION:fr,PLACEHOLDER_CHAT_TYPE:hr,PLACEHOLDER_REASON_TYPE:gr,PLACEHOLDER_TYPE:mr,PLATFORM_TYPE:yr,PLAYBACK_ORIGIN_TYPE:Er,PLAYBACK_STATE_TYPE:Sr,PNH_ACTION_TYPE:Tr,PNH_CAG_BANNER_ACTION_TYPE:vr,PNH_CHAT_TYPE_TYPE:Ar,PNH_ENTRY_POINT_TYPE:Cr,PNH_MESSAGE_CHAT_PARTY:Pr,POLL_ACTION_TYPE:Or,PRECISE_SIZE_BUCKET:Ir,PREFERRED_LINK_TYPE:Mr,PREKEYS_FETCH_CONTEXT:br,PRIMARY_IDENTITY_MISSING_PROTO_TYPE:Rr,PRIVACY_ALERT_CASE:Nr,PRIVACY_ALERT_CATEGORY:wr,PRIVACY_CONTROL_ENTRY_POINT_TYPE:Lr,PRIVACY_CONTROL_ITEM_TYPE:Dr,PRIVACY_HIGHLIGHT_CATEGORY_ENUM:kr,PRIVACY_HIGHLIGHT_SURFACE_ENUM:Ur,PRIVACY_SETTINGS_CONTACTS_BUCKETS:Gr,PRIVACY_SETTINGS_VALUE_TYPE:xr,PROFILE_ENTRY_POINT:Br,PROFILE_PICTURE_TYPE:Fr,PROJECT_CODE:jr,PS_APP_LAUNCH_DESTINATION_TYPE:Yr,PS_APP_LAUNCH_TYPE:Kr,PS_BUFFER_UPLOAD_RESULT:Hr,PS_CRASH_TYPE:Wr,PS_ID_ACTION:Vr,PS_TEST_ENUM_FIELD:$r,PS_TOKEN_NOT_READY_REASON:zr,PS_UPLOAD_REASON:qr,PSA_BLOCK_REASON:Jr,PSA_LINK_OPEN_RESULT:Qr,PSA_MESSAGE_ACTION_TYPE:Xr,PSA_MESSAGE_REMOVE_ACTION:Zr,PSA_MESSAGE_REMOVE_ENTRY_POINT:ei,PTT_PLAYBACK_SPEED_TYPE:ti,PTT_PLAYER_TYPE:ni,PTT_RESULT_TYPE:ri,PTT_SOURCE_TYPE:ii,PTT_STREAM_TYPE:ai,PTT_TRIGGER_TYPE:oi,QUERY_TYPE:si,QUICK_REPLY_ACTION:li,QUICK_REPLY_ENTRY_POINT:ui,QUICK_REPLY_ORIGIN:ci,QUICK_REPLY_TRANSCODE_RESULT:di,RADIO_TYPE:pi,REACTION_ACTION_TYPE:_i,READ_ENTRY_POINT:fi,READ_SOURCE:hi,RELIABILITY_ACTION_TYPE:gi,RESPONSE_TYPE:mi,RETRY_REJECT_REASON:yi,REVOKE_TYPE:Ei,ROOMS_ENTRY_POINT:Si,SEARCH_ENTRY_POINT:Ti,SEARCH_VIEW_ACTION:vi,SENDER_TYPE:Ai,SETTINGS_ITEM_TYPE:Ci,SHARE_BIZ_TOOLS_LINK_TYPE:Pi,SHARE_BUSINESS_ACTION_TYPE:Oi,SHOPS_MANAGEMENT_ACTION:Ii,SIGN_CREDENTIAL_RESULT:Mi,SIGNATURE_TYPE:bi,SIZE_BUCKET:Ri,SMB_ONBOARDING_STEP_TYPE:Ni,SNACKBAR_ACTION_TYPE:wi,SRTP_LIBRARY_VERSION:Li,STATUS_ITEM_VIEW_RESULT:Di,STATUS_REPLY_MESSAGE_TYPE:ki,STATUS_REPLY_RESULT:Ui,STATUS_REPORT_INTERACTION:Gi,STATUS_ROW_ENTRY_METHOD:xi,STATUS_ROW_SECTION:Bi,STATUS_VIEW_ENTRY_POINT:Fi,STATUS_VIEWER_NON_TRAFFIC_ACTION_TYPE:ji,STATUS_VIEWER_TRAFFIC_ACTION_TYPE:Yi,STICKER_SEND_MESSAGE_TYPE:Ki,STICKER_SEND_ORIGIN_TYPE:Hi,STRAWBERRY_ACTION_TYPE:Wi,STRUCTURED_MESSAGE_CLASS:Vi,SUBSCRIBER_TYPE:$i,SUBSCRIPTION_APP_STORE_RESULT:zi,SUBSCRIPTION_ENTRY_POINT:qi,SUBSCRIPTION_ERROR_TYPE:Ji,SUBSCRIPTION_TYPE:Qi,SW_AEC_TYPE:Xi,TEMPLATE_COMPONENT:Zi,THREAD_ACTION_ENTRY_POINT:ea,THREAD_LEVEL_ACTION:ta,TRIGGER_TYPE:na,TRUST_BANNER_ACTION:ra,TRUST_SIGNAL_BUCKETS:ia,TS_LOG_UPLOAD_RESULT:aa,TYPE_OF_GROUP_ENUM:oa,UI_ACTION_CHAT_TYPE:sa,UI_ACTION_TYPE:la,UI_MESSAGE_YOURSELF_ACTION_TYPE:ua,UI_MESSAGE_YOURSELF_FUNNEL_NAME:ca,UI_REVOKE_ACTION_TYPE:da,UPLOAD_ORIGIN_TYPE:pa,UPLOAD_SOURCE_TYPE:_a,UPNP_ADD_RESULT_CODE:fa,UPNP_REMOVE_RESULT_CODE:ha,URL_STATUS_CLICKED:ga,URL_STATUS_TYPE:ma,USER_ACTION_TYPE:ya,USER_NOTICE_ERROR_EVENT:Ea,USER_NOTICE_EVENT:Sa,VERIFICATION_STATE:Ta,VIDEO_TRANSCODER_ALGORITHM_TYPE:va,VIDEO_TRANSCODER_RESULT_TYPE:Aa,VIDEO_TRANSCODER_SOURCE_FORMAT_TYPE:Ca,VIDEO_TRANSCODER_TARGET_FORMAT_TYPE:Pa,VIEW_ACTION:Oa,VIEW_BUSINESS_PROFILE_ACTION:Ia,VNAME_CERT_HEALTH_EVENT_TYPE:Ma,VO_MESSAGE_TYPE:ba,VO_SS_ACTION:Ra,VPX_LIB:Na,WA_OFFICIAL_ACCOUNT_NAME:wa,WA_VOIP_HISTORY_CALL_REDIAL_STATUS:La,WA_VOIP_HISTORY_SAVE_CALL_RECORD_CONDITION_CHECK_STATUS:Da,WEBC_APPCACHE_STATUS_CODE:ka,WEBC_ASSET_CACHE_TYPE_CODE:Ua,WEBC_BUTTERBAR_ACTION_TYPE:Ga,WEBC_BUTTERBAR_BB_TYPE:xa,WEBC_CHAT_TYPE:Ba,WEBC_DISPLAY_STATUS_TYPE:Fa,WEBC_ENV_CODE:ja,WEBC_JOB_RESULT_TYPE_CODE:Ya,WEBC_MEDIA_LOAD_RESULT_CODE:Ka,WEBC_MEDIA_OPERATION_CODE:Ha,WEBC_MENU_ITEM_LABEL:Wa,WEBC_MENU_TYPE:Va,WEBC_MESSAGE_QUERY_DIRECTION:$a,WEBC_NATIVE_UPSELL_CTA_SOURCE_TYPE:za,WEBC_NAVIGATION_TYPE:qa,WEBC_QPL_HEALTH_EVENT_TYPE:Ja,WEBC_QUERY_TRIGGER_TYPE:Qa,WEBC_RMR_REASON_CODE:Xa,WEBC_SCENARIO_TYPE:Za,WEBC_STATUS_MEDIA_TYPE:eo,WEBC_STATUS_ROW_SECTION:to,WEBC_STICKER_MAKER_EVENT_NAME_TYPE:no,WEBC_STREAM_MODE_CODE:ro,WEBC_WAP_REQUEST_DESTINATION_CODE:io,WEBC_WAP_REQUEST_KIND_CODE:ao,WEBC_WEB_PLATFORM_TYPE:oo,WEBC_WINDOW_NAVIGATOR_WEBDRIVER_TYPE:so,WEBSITE_SOURCE_TYPE:lo,WELCOME_MESSAGE_ACTION_TYPE:uo,WELCOME_MESSAGE_ERROR_TYPE:co,XMPP_STATUS:po,XOR_CIPHER_MODE:_o});t.default=ho},702011:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.WamEvent=t.TYPES=t.Metric=t.GlobalMetric=void 0,t.defineEvents=function(e){for(const n in e){var t;const r=e[n],i=r[2];let a=1;a=i[2];const o=null!==(t=r[3])&&void 0!==t?t:"regular",s=5===r.length?r[4]:-1;S({name:n,id:r[0],props:r[1],weight:a,wamChannel:o,privateStatsIdInt:s})}},t.defineGlobal=function(e){const t={};for(const n in e){const r=e[n],[i,a,o=["regular"]]=r,s=g.defineGlobal(n,i,a,o);t[n]={type:s.validator,set(e){this.commitOnSet&&(d?d.set(s,e):p(s,e))}}}return new((0,l.defineTypeHash)("Global",t,T))},t.metrics=t.events=void 0,t.setWamImpl=function(e){d=e,c.map((e=>{if(e[0]){const t=e[1];d.commit(t,!!e[2])}else{const t=e[1];d.set(t,e[2])}}))};var i=r(n(722205)),a=r(n(163137)),o=r(n(132375)),s=r(n(854251)),l=(n(824194),n(623703));const u=Object.freeze({BOOLEAN:"boolean",INTEGER:"integer",NUMBER:"number",STRING:"string",TIMER:"timer"});t.TYPES=u;const c=[];let d;function p(e,t){c.push([!1,e,t])}function _(e){return"number"==typeof e&&e===Math.floor(e)}class f{constructor(e,t,n){this.name=e,this.id=t,this.type=n,this.setValidator()}setValidator(){const e=this.type;if("object"==typeof e){const t=(0,a.default)(e);this.validator=e=>e in t}else e===u.INTEGER||e===u.TIMER?this.validator=_:this.validator=e}}t.Metric=f;class h extends f{constructor(e,t,n,r){super(e,t,n),this.channels=r}}t.GlobalMetric=h;const g=new class{constructor(){this._events={},this._globalMetrics=new Map}_key(e,t){return`${e}::${t}`}getEvent(e,t){const n=this._key(e,t);return(0,o.default)(this._events[n],n)}define(e,t,n,r){const i=this._key(e,t);return i in this._events||(this._events[i]=new f(t,n,r)),this._events[i]}defineGlobal(e,t,n,r){return this._globalMetrics.has(e)||this._globalMetrics.set(e,new h(e,t,n,r)),(0,o.default)(this._globalMetrics.get(e),e)}getGlobal(e){return(0,o.default)(this._globalMetrics.get(e),e)}};t.metrics=g;let m=1;class y extends l.TypeHash{constructor(){super(),this.instanceId=m++,this.eventTime=Date.now(),this.commitTime=void 0,this.startMarkers={}}commit(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return d?d.commit(this,e):(function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];c.push([!0,e,t])}(this,e),Promise.resolve())}setTime(e){this.eventTime=e||Date.now()}setSequenceNumber(e){this.sequenceNumber=e}}t.WamEvent=y;const E={};function S(e){let{name:t,id:n,weight:r,props:a,wamChannel:o,privateStatsIdInt:c}=e;const d={id:n,weight:r,wamChannel:o,privateStatsIdInt:c},p={},_=[];for(const e in a){const n=a[e],r=g.define(t,e,n[0],n[1]);p[e]=r.validator,n[1]===u.TIMER&&_.push(e)}const f=(0,l.defineTypeHash)(t,p,y);_.forEach((e=>{d["mark"+(0,s.default)(e)]=function(t){var n,r;const{startMarkers:i,eventTime:a}=this;this[e]=Date.now()-(null!==(n=null===(r=i[e])||void 0===r?void 0:r.ts)&&void 0!==n?n:a),null==t||t.showInTimeline,this.startMark},d[`start${(0,s.default)(e)}`]=function(t){const n=Date.now();this.startMarkers[e]={ts:n},null==t||t.showInTimeline}})),(0,i.default)(f.prototype,d),E[t]=f}t.events=E;class T extends l.TypeHash{constructor(){super(...arguments),this.commitOnSet=!0}}},342310:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e<32?a.LT32:e<64?a.LT64:e<128?a.LT128:e<256?a.LT256:e<512?a.LT512:e<1024?a.LT1024:e<1500?a.LT1500:e<2e3?a.LT2000:e<2500?a.LT2500:e<3e3?a.LT3000:e<3500?a.LT3500:e<4e3?a.LT4000:e<4500?a.LT4500:e<5e3?a.LT5000:a.LARGEST_BUCKET};var i=r(n(571834));const{SIZE_BUCKET:a}=i.default},209983:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.OfflineResumeReporter=void 0;var i=r(n(348926)),a=n(710038),o=n(15842),s=n(990445),l=n(287461),u=n(316348),c=n(555622),d=n(673168),p=r(n(571834));class _{start(){(0,l.getABPropConfigValue)("web_offline_resume_qpl_enabled")&&(this._qplEvent=c.QPL.markerStart(u.QuickLogMarkerId.OFFLINE_RESUME))}end(){var e;null===(e=this._qplEvent)||void 0===e||e.end(o.QuickLogActionType.SUCCESS)}drop(){var e;null===(e=this._qplEvent)||void 0===e||e.drop()}_addPoint(e,t){var n;const r=null!=t?{data:t}:{};null===(n=this._qplEvent)||void 0===n||n.addPoint(e,r)}markOfflinePreviewReceived(){this._addPoint("offlinePreviewReceived")}markMainScreenLoad(){this._addPoint("mainScreenLoad")}markSocketConnect(){this._addPoint("socketConnect")}setAnnotations(e){var t;null===(t=this._qplEvent)||void 0===t||t.annotate({int:{messageCount:e.messageCount,receiptCount:e.receiptCount,notificationCount:e.notificationCount,sizeBytes:e.sizeBytes,chatThreadCount:e.chatThreadCount,decryptErrorCount:e.decryptErrorCount}})}}class f{constructor(){this._sessionId=this._generateOfflineSessionId(),this._pageLoadT=performance.now()}_generateOfflineSessionId(){return`${(0,a.randomHex)(4)}${(0,s.unixTimeWithoutClockSkewCorrection)()}`}_commitOfflineStage(e){const t=new p.default.OfflineResumeStage({offlineSessionId:this._sessionId,offlineStageTimestampMs:Math.floor(performance.now()-this._pageLoadT),currentOfflineStage:e});this._addOfflineMetadata(t),t.commit()}logPageLoad(){this._pageLoadT=performance.now()}logSocketConnect(){this._commitOfflineStage(p.default.OFFLINE_RESUME_STAGES.SOCKET_CONNECT)}logProcessComplete(){this._commitOfflineStage(p.default.OFFLINE_RESUME_STAGES.PROCESS_COMPLETE)}logScreenLoad(){this._commitOfflineStage(p.default.OFFLINE_RESUME_STAGES.SCREEN_LOAD)}logOfflineCount(e){this._offlineMessageCount=(this._offlineMessageCount||0)+e.message,this._offlineReceiptCount=(this._offlineReceiptCount||0)+e.receipt,this._offlineNotificationCount=(this._offlineNotificationCount||0)+e.notification}logOfflineDecryptionErrorCount(e){this._offlineDecryptErrorCount=e}logOfflineChatThreadCount(e){this._chatThreadCount=e}_addOfflineMetadata(e){null!=this._offlineMessageCount&&(e.offlineMessageCount=h(this._offlineMessageCount,10)),null!=this._offlineReceiptCount&&(e.offlineReceiptCount=h(this._offlineReceiptCount,10)),null!=this._offlineNotificationCount&&(e.offlineNotificationCount=h(this._offlineNotificationCount,10)),null!=this._offlineDecryptErrorCount&&(e.offlineDecryptErrorCount=this._offlineDecryptErrorCount),null!=this._chatThreadCount&&(e.chatThreadCount=h(this._chatThreadCount,10))}}function h(e,t){return Math.round(e/t)*t}const g=new class{constructor(){this.isInitialSync=!1,this.oldestStanzaTs=0,this.offlineResume=new p.default.OfflineResume,this.offlineResume.offlineMessageCount=0,this.offlineResume.offlineReceiptCount=0,this.offlineResume.offlineNotificationCount=0,this.offlineResume.offlineDecryptErrorCount=0,this.offlineResume.offlineSizeBytes=0,this.offlineResume.chatThreadCount=0,this.offlineResume.isOfflineCompleteMissed=!1,this.qpl=new _,this.offlineStage=new f}logOldestStanzaTime(e){null!=this.offlineResume&&(0===this.oldestStanzaTs||this.oldestStanzaTs>e)&&(this.oldestStanzaTs=e)}countDays(){if(null==this.offlineResume||0===this.oldestStanzaTs)return 0;const e=(0,s.unixTime)()-this.oldestStanzaTs;return Math.round(e/s.DAY_SECONDS)}logOfflineCount(e){this.offlineStage.logOfflineCount(e),this.offlineResume&&(this.offlineResume.offlineMessageCount+=e.message,this.offlineResume.offlineReceiptCount+=e.receipt,this.offlineResume.offlineNotificationCount+=e.notification)}logOfflineDecryptionErrorCount(e){this.offlineStage.logOfflineDecryptionErrorCount(e),this.offlineResume&&(this.offlineResume.offlineDecryptErrorCount=e)}logAddOfflineSizeBytes(e){this.offlineResume&&(this.offlineResume.offlineSizeBytes+=e)}logOfflineChatThreadCount(e){this.offlineStage.logOfflineChatThreadCount(e);const t=h(e,10);this.offlineResume&&(this.offlineResume.chatThreadCount=t)}_logPerformanceT(e){const t=Math.floor(performance.now());null!=this.offlineResume&&(this.offlineResume[e]=t)}logLastStanzaT(){this._logPerformanceT("lastStanzaT"),this.isInitialSync||this.offlineStage.logProcessComplete()}logMainScreenLoadT(){this._logPerformanceT("mainScreenLoadT"),this.qpl.markMainScreenLoad(),this.isInitialSync||this.offlineStage.logScreenLoad()}logOfflinePreviewT(){this._logPerformanceT("offlinePreviewT"),this.qpl.markOfflinePreviewReceived()}logPageLoadT(){this.qpl.start(),this._logPerformanceT("pageLoadT"),this.offlineStage.logPageLoad(),window.document&&this.offlineResume&&(this.offlineResume.isResumeInForeground=!document.hidden,document.addEventListener("visibilitychange",this.logResumeInBackground))}logSocketConnectT(){this._logPerformanceT("socketConnectT"),this.qpl.markSocketConnect(),this.isInitialSync||this.offlineStage.logSocketConnect()}logMissedOfflineComplete(){this.offlineResume&&(this.offlineResume.isOfflineCompleteMissed=!0)}setIsInitialSync(){this.isInitialSync=!0}logResumeInBackground(){this.offlineResume&&document.hidden&&(this.offlineResume.isResumeInForeground=!1)}commit(){var e=this;return(0,i.default)((function*(){const t=e.offlineResume;t&&(t.offlineSizeBytes=h(t.offlineSizeBytes,1e3),t.offlineMessageCount=h(t.offlineMessageCount,10),t.offlineReceiptCount=h(t.offlineReceiptCount,10),t.offlineNotificationCount=h(t.offlineNotificationCount,10),t.mailboxAge=e.countDays(),yield(0,d.setRecentMailboxAgeDays)(t.mailboxAge),__LOG__(2)`======== offline resume perf ========
message: ${t.offlineMessageCount}
receipt: ${t.offlineReceiptCount}
notification: ${t.offlineNotificationCount}
chatThreadCount: ${t.chatThreadCount}
offlineSizeBytes: ${t.offlineSizeBytes}
decryptError: ${t.offlineDecryptErrorCount}
lastStanzaT: ${t.lastStanzaT}
pageLoadT: ${t.pageLoadT}
connectionT: ${t.socketConnectT}
offlinePreviewT: ${t.offlinePreviewT}
screenLoadT: ${t.mainScreenLoadT}
isResumeInForeground: ${t.isResumeInForeground}
mailboxAge: ${t.mailboxAge}
======================================`,e.isInitialSync?e.qpl.drop():(t.commit(),e.qpl.setAnnotations({messageCount:t.offlineMessageCount,receiptCount:t.offlineReceiptCount,notificationCount:t.offlineNotificationCount,chatThreadCount:t.chatThreadCount,decryptErrorCount:t.offlineDecryptErrorCount,sizeBytes:t.offlineSizeBytes}),e.qpl.end()),e.offlineResume=null,window.document&&document.removeEventListener("visibilitychange",e.logResumeInBackground))}))()}};t.OfflineResumeReporter=g},115383:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.mainScriptTimer=t.initialScreenTimer=t.exeTimer=t.PageLoad=void 0,t.onInitialRenderComplete=function(){_()},t.saveInitialPanelMountTime=function(e){c=e},t.setInitialScreen=function(e){if(null==d)return;d.set({webcInitialPanel:e})},t.streamInfoChange=function(e,t,n){const r=Math.floor(window.performance.now());p[e]=r,n&&(p.socketSequence=t,f())};var i=r(n(132375)),a=n(154378),o=r(n(571834)),s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(824194)),l=r(n(24650));function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}let c,d=new o.default.WebcPageLoad;const p={};let _,f;const h=new Promise((e=>_=e)),g=new Promise((e=>f=e));let m,y=!1;function E(e){return window.performance&&window.performance.timing&&window.performance.timing.navigationStart?e-window.performance.timing.navigationStart:null}function S(){d&&document.hidden&&(m=!1)}function T(){var e;if(!(null===(e=window.performance)||void 0===e?void 0:e.timing)||!window.performance.navigation)return void __LOG__(2)`MetricReporter:logPageLoad metrics not provided by browser!`;if(!d)return;const t=d,n=window.performance.timing,r=window.performance.navigation,i=n.navigationStart,a=n.loadEventEnd-i;if(a<=0)return __LOG__(2)`MetricReporter:logPageLoad delayed`,void setTimeout(T,1e4);function o(e){const t=n[e];return t&&E(t)}t.set({webcPageLoadT:a,webcUnloadEventStart:o("unloadEventStart"),webcUnloadEventEnd:o("unloadEventEnd"),webcRedirectStart:o("redirectStart"),webcRedirectEnd:o("redirectEnd"),webcFetchStart:o("fetchStart"),webcDomainLookupStart:o("domainLookupStart"),webcDomainLookupEnd:o("domainLookupEnd"),webcConnectStart:o("connectStart"),webcConnectEnd:o("connectEnd"),webcSecureConnectionStart:o("secureConnectionStart"),webcRequestStart:o("requestStart"),webcResponseStart:o("responseStart"),webcResponseEnd:o("responseEnd"),webcDomLoading:o("domLoading"),webcDomInteractive:o("domInteractive"),webcDomContentLoadedEventStart:o("domContentLoadedEventStart"),webcDomContentLoadedEventEnd:o("domContentLoadedEventEnd"),webcDomComplete:o("domComplete"),webcLoadEventStart:o("loadEventStart"),webcLoadEventEnd:o("loadEventEnd"),webcCached:n.fetchStart===n.domainLookupEnd,webcNavigation:r.type,webcRedirectCount:r.redirectCount,webcWsOpening:p.OPENING,webcWsPairing:p.PAIRING,webcWsSyncing:p.SYNCING,webcWsNormal:p.NORMAL,webcWsAttempts:p.socketSequence,webcQrCode:!p.SYNCING,webcInitialPanelMountT:c-i,webcLoadInForeground:m}),t.commit(),window.document&&document.removeEventListener("visibilitychange",S),d=null}window.document&&(m=!document.hidden,document.addEventListener("visibilitychange",S)),Promise.all([h,g]).then((()=>{T(),(0,l.default)(),y||(y=!0,a.Wam.resumeJobs())}));class v{constructor(e){this._hasStarted=!1,this._label=e.label,this._startProperty=e.startProperty,this._endProperty=e.endProperty}start(){this._hasStarted=!0,null!=d&&(d.set({[this._startProperty]:E(Date.now())}),this._measure=s.startMeasure(this._label))}end(){null!=d&&(d.set({[this._endProperty]:E(Date.now())}),(0,i.default)(this._measure,"this._measure").end())}hasStarted(){return this._hasStarted}}const A=new v({label:"PageLoad.webcExe",startProperty:"webcExeStart",endProperty:"webcExeDone"});t.exeTimer=A;const C=new v({label:"PageLoad.webcMainScript",startProperty:"webcMainScriptStart",endProperty:"webcMainScriptEnd"});t.mainScriptTimer=C;const P=new v({label:"PageLoad.webcInitialPanelRender",startProperty:"webcInitialPanelMountStartT",endProperty:"webcInitialPanelRenderT"});t.initialScreenTimer=P;const O=(0,i.default)(d,"_PageLoad");t.PageLoad=O},824194:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.formatMeasureLabel=function(e){return`💬 ${e}`},t.startMeasure=function(e){return r};const r={end(){}};(null===(n=performance)||void 0===n?void 0:n.mark)&&performance.measure,new Map},350906:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WAM_PLATFORM=void 0;t.WAM_PLATFORM="WEB"},359151:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getLatestPrivateStatsIdValueFromKey=function(e){if("regular"===e)throw new Error("tried to get psId for regular channel event");if(null==h)throw new Error("can't call getLatestPrivateStatsIdValueFromKey without initializing");return f[e].value},t.getPrivateStatsIdsForCoreWam=m,t.getPrivateStatsKeyFromInt=function(e){if(null==h)throw new Error("can't call getPrivateStatsKeyFromInt without initializing");return p[e]},t.initPrivateStats=function(){return g.apply(this,arguments)},t.maybeRotatePsIds=function(){return y.apply(this,arguments)};var i=r(n(348926)),a=n(710038),o=n(827653),s=n(990445),l=n(323321),u=r(n(571834)),c=r(n(32223)),d=n(965259);const p={},_={},f={};u.default.PrivateStatsAllIds.map((e=>{p[e.keyHashInt]=e.key,_[e.key]=e.keyHashInt,f[e.key]={value:e.keyHashInt,rotationPeriodDays:e.rotationPeriodDays}})),p[0]="none",_.none=0,f.none={value:"none",rotationPeriodDays:-1};let h=null;function g(){return(g=(0,i.default)((function*(){if(null!=h)return h.promise;h=new o.Resolvable,yield T();const e=[],t=yield c.default.getPsMeta(),n=new Set;t.map((t=>{n.add(t.key),void 0===f[t.key]?e.push(t.key):f[t.key].value=t.value}));const r=Object.keys(f).filter((e=>!n.has(e))).map((e=>("none"!==e&&(f[e].value=(0,a.randomHex)(16)),{key:e,value:f[e].value,rotateInDays:f[e].rotationPeriodDays,creationTs:(0,s.unixTime)()})));yield c.default.addPsMeta(r),yield c.default.removePsMeta(e),r.map((e=>(0,d.logPsIdUpdate)(u.default.PS_ID_ACTION.CREATED,_[e.key],e.rotateInDays))),e.map((e=>(0,d.logPsIdUpdate)(u.default.PS_ID_ACTION.DELETED,_[e],f[e].rotationPeriodDays))),h.resolve()}))).apply(this,arguments)}function m(){const e=new Map;return u.default.PrivateStatsAllIds.forEach((t=>{e.set(t.keyHashInt,String(f[t.key].value))})),e}function y(){return(y=(0,i.default)((function*(){const e=[];if(null==h)throw new Error("can't call maybeRotatePsIds without initializing");try{yield h.promise;const t=yield c.default.getPsMeta();yield Promise.all(t.map(function(){var t=(0,i.default)((function*(t){try{const{key:n,rotateInDays:r,creationTs:i}=t;A(i,r)&&(e.push(n),yield E(n))}catch(e){__LOG__(3)`error while rotating PS id for key ${t.key}`}}));return function(){return t.apply(this,arguments)}}()))}catch(e){__LOG__(3)`error while rotating PS ids ${e}`}try{e.length>0&&(0,l.updatePrivateStatIdsToCore)(m())}catch(e){}return e}))).apply(this,arguments)}function E(){return S.apply(this,arguments)}function S(){return(S=(0,i.default)((function*(e){const t=(0,a.randomHex)(16);f[e].value=t,yield c.default.updatePsMeta({key:e,rotateInDays:f[e].rotationPeriodDays,value:t,creationTs:(0,s.unixTime)()}),(0,d.logPsIdUpdate)(u.default.PS_ID_ACTION.ROTATED,_[e],f[e].rotationPeriodDays)}))).apply(this,arguments)}function T(){return v.apply(this,arguments)}function v(){return(v=(0,i.default)((function*(){const e=[];(yield c.default.getPsMeta()).map((t=>{null!=t.lastRotationTimeUtc&&e.push(t.key)})),yield c.default.removePsMeta(e)}))).apply(this,arguments)}function A(e,t){if(-1===t||null==e)return!1;const n=t*s.DAY_SECONDS;return e<Math.floor((0,s.unixTime)()/n)*n}},818674:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.logDailyPrivateStatsTestEvents=function(){new a.default.TestAnonymousDaily({}).commit(),(0,i.getABPropConfigValue)("web_ps_v3_enabled")&&(new a.default.TestAnonymousWeeklyId({}).commit(),new a.default.TestAnonymousIdLess({}).commit())},t.logUiActionShadowPrivateStatsTestEvents=function(){(0,i.getABPropConfigValue)("web_ps_v3_enabled")&&(new a.default.TestAnonymousDailyId({}).commit(),new a.default.TestAnonymousMonthlyId({}).commit())};var i=n(287461),a=r(n(571834))},256695:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=new class{constructor(){this._resetNextSet=!1,this._value=0}get(){return this._value}_checkReset(){this._resetNextSet&&(this._resetNextSet=!1,this._value=0,this.initialDisplayDate=null)}inc(){return this._checkReset(),this.set(this._value+1)}set(e){if(this._checkReset(),this._value!==e)return 1===e&&(this.initialDisplayDate=Math.floor(window.performance.now())),this._value=e,this.get()}reset(){this._resetNextSet=!0}};t.default=n},24650:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e;if(!(null===(e=window.performance)||void 0===e?void 0:e.timing)||!window.performance.getEntriesByType)return void __LOG__(2)`MetricReporter:logResourceLoads metrics not provided by browser!`;const t=window.performance.timing.fetchStart===window.performance.timing.domainLookupEnd,n=window.performance.getEntriesByType("resource"),r=document.createElement("a");n.forEach((function(e){"xmlhttprequest"!==e.initiatorType&&(r.href=e.name,new i.default.WebcResourceLoad({webcResourceName:r.pathname+r.search+r.hash,webcResourceDuration:Math.round(e.duration),webcResourceCached:t}).commit())}))};var i=r(n(571834))},32223:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=r(n(482904));t.default=class{static add(e,t,n){return(0,i.default)((function*(){return(yield a.default.idb()).wam.add({key:e,buffer:n,channel:t},e).catch((e=>{__LOG__(2)`add failed: ${e}\n${null==e?void 0:e.stack}`}))}))()}static update(e,t,n){return(0,i.default)((function*(){let r=0;try{r=yield a.default.idb().then((r=>r.wam.update(e,{key:e,buffer:n,channel:t})))}catch(e){__LOG__(2)`update failed: ${e}\n${null==e?void 0:e.stack}`}return 0!==r}))()}static deleteAll(e){return(0,i.default)((function*(){const t={};try{yield a.default.idb().then((n=>n.wam.where("channel").equals(e).modify((function(e){t[e.key]=e.buffer,delete this.value}))))}catch(e){__LOG__(2)`deleteAll failed: ${e}\n${null==e?void 0:e.stack}`}return t}))()}static getNextSequenceNumberForStream(e){return(0,i.default)((function*(){let t=-1;try{const n=yield a.default.idb();yield n.transaction("rw",["wam_meta"],(0,i.default)((function*(){0===(yield n.wam_meta.where("streamId").equals(e).count())?(yield n.wam_meta.add({streamId:e,seqNum:1}),t=1):yield n.wam_meta.where("streamId").equals(e).modify((function(e){return t=e.seqNum+1,t>=65536&&(t=1),e.seqNum=t,e}))})))}catch(e){__LOG__(2)`getNextSequenceNumberForStream failed: ${e}\n${null==e?void 0:e.stack}`}if(-1===t)throw new Error(`could not get seq number for streamId ${e}`);return t}))()}static removePsMeta(e){return a.default.idb().then((t=>t.ps_meta.bulkDelete(e))).catch((e=>{__LOG__(2)`removePsMeta failed: ${e}\n${null==e?void 0:e.stack}`}))}static getPsMeta(){return a.default.idb().then((e=>e.ps_meta.toArray())).catch((e=>(__LOG__(2)`getPsMeta failed: ${e}\n${null==e?void 0:e.stack}`,[])))}static addPsMeta(e){return a.default.idb().then((t=>t.ps_meta.bulkPut(e))).catch((e=>{__LOG__(2)`addPsMeta failed: ${e}\n${null==e?void 0:e.stack}`}))}static updatePsMeta(e){return a.default.idb().then((t=>t.ps_meta.update(e.key,e))).catch((e=>{__LOG__(2)`updatePsMeta failed: ${e}\n${null==e?void 0:e.stack}`}))}static getPsToken(){return a.default.idb().then((e=>e.ps_tokens.get("token"))).catch((e=>{__LOG__(2)`getPsToken failed: ${e}\n${null==e?void 0:e.stack}`}))}static savePsToken(e){return a.default.idb().then((t=>t.transaction("rw",["ps_tokens"],(()=>t.ps_tokens.put(e))))).catch((e=>{__LOG__(2)`savePsToken failed: ${e}\n${null==e?void 0:e.stack}`}))}static addCoreWamBuffer(e,t){return(0,i.default)((function*(){const n=yield a.default.idb();return n.transaction("rw",["core_wam","core_wam_meta"],(()=>n.core_wam.put(t).then((()=>n.core_wam_meta.put(e)))))}))()}static finishAllCoreWamBuffers(e){return(0,i.default)((function*(){return(yield a.default.idb()).core_wam.where("streamId").equals(e).modify({finished:!0})}))()}static getCoreWamStartingSequenceNumber(e){return(0,i.default)((function*(){return(yield a.default.idb()).core_wam_meta.get({streamId:e})}))()}static getAllCoreWamBuffers(){return(0,i.default)((function*(){return(yield a.default.idb()).core_wam.toArray()}))()}static nukeAllCoreWamBuffers(){return(0,i.default)((function*(){const e=yield a.default.idb();return e.transaction("rw",["core_wam","core_wam_meta"],(()=>e.core_wam.clear().then((()=>e.core_wam_meta.clear()))))}))()}static removeWamBufferByKey(e){return(0,i.default)((function*(){return(yield a.default.idb()).core_wam.delete(e)}))()}}},623703:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHash=void 0,t.defineTypeHash=function(e,t,i){const a={$className:{value:e}};for(const i in t){let o=t[i];if("string"!=typeof o&&"function"!=typeof o||(o={type:o}),!o||"object"!=typeof o)throw new Error(`${e} specified with non-object ${o}`);a[i]={enumerable:!0,get:n(i),set:r(i,o)}}class o extends i{constructor(e){super(),this.all={},e&&this.set(e)}}return Object.defineProperties(o.prototype,a),o};function n(e){return function(){return this.all[e]}}function r(e,t){const n=t.type,r=t.set;return function(t){if(t!==this.all[e]){if(null==t);else if("function"==typeof n){if(!n(t))throw __LOG__(2)`type-validator fails ${t}`,new TypeError(`${this.$className}.${e} type-validator failed`)}else if(typeof t!==n)throw new TypeError(`${this.$className}.${e} requires type ${n}, got ${String(t)}`);r&&r.call(this,t),this.all[e]=t}}}t.TypeHash=class{set(e){for(const t in e)this[t]=e[t]}}},965259:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.forceFlushAllWamBuffers=function(){return(new i.default.WebWamForceFlush).commit(!0)},t.logPsIdUpdate=function(e,t,n){new i.default.PsIdUpdate({psIdAction:e,psIdKey:t,psIdRotationFrequence:n}).commit()};var i=r(n(571834))},205600:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.WamContext=void 0;var i=n(417405),a=n(551168),o=n(404021),s=n(184274),l=r(n(571834)),u=n(359151);t.WamContext=class{constructor(e,t,n){this.bufferKey=e,this.buffer=new a.Binary(void 0,!0),this.buffer.writeString("WAM"),this.buffer.writeUint8(o.WAM_PROTOCOL_VERSION),this.buffer.writeUint8(1),this.buffer.writeUint16(t),"regular"===this.bufferKey?this.buffer.writeUint8(0):this.buffer.writeUint8(2),this.eventsWritten=0,this.prevGlobals={},this.dirtyGlobals={},this.unsavedPortion=null,this.saveKey=String(1e9*Math.random()|0),n&&this._setAll(n)}size(){return this.buffer.size()}set(e,t){this.dirtyGlobals[String(e)]=t,this.unsavedPortion&&this.unsavedPortion.set(e,t)}write(e){const t=this.buffer;this.set(47,e.commitTime),this.set(3433,e.sequenceNumber),"private"===e.wamChannel&&this.set(6005,(0,u.getLatestPrivateStatsIdValueFromKey)(this.bufferKey).toString()),this._flushGlobals();const n=e.all,r=Object.keys(n);let i=-1,a=!1;for(let e=0;e<r.length;e++){null!=n[r[e]]&&(i=e,a=!0)}(0,s.writeEvent)(t,e.id,-e.weight,a);for(let o=0;o<=i;o++){const u=r[o],{id:c,type:d}=l.default.METRICS.getEvent(e.$className,u);let p=n[u];null!=p&&("boolean"==typeof p&&(p=p?1:0),a=o<i,"timer"===d&&p>2147483647?(__LOG__(4,void 0,new Error,!0)`wam: invalid value for timer field ${e.$className}.${u}`,SEND_LOGS("wam-event-validation-error")):(0,s.writeField)(t,c,p,a))}this.eventsWritten++,this.unsavedPortion&&this.unsavedPortion.write(e)}stringBuffer(){return this.eventsWritten>0?(0,i.encodeB64)(this.buffer.peek((e=>e.readByteArray()))):""}getBuffer(){return this.buffer}_setAll(e){const t="regular"===this.bufferKey?"regular":"private";for(const n in e){const r=e[n],i=l.default.METRICS.getGlobal(n).channels.includes(t);void 0!==r&&i&&this.set(l.default.METRICS.getGlobal(n).id,r)}}_flushGlobals(){const e=this.dirtyGlobals,t=this.prevGlobals;for(const n in e){let r=e[n];if("boolean"==typeof r)r=r?1:0;else if(void 0===r)r=null;else if(Number.isNaN(r))continue;if(r!==t[n]||n===String(47)||n===String(6005)){t[n]=r;const e=parseInt(n,10);(0,s.writeGlobalAttribute)(this.buffer,e,r)}}this.dirtyGlobals={}}upgradeWamHeaderFromV3ToV5(e){if(!n(287461).getABPropConfigValue("web_wam_v5_enabled")||this.buffer.size()<4)return this.buffer;const[t,r]=this.buffer.peek((e=>[e.readString(3),e.readUint8()]));if(3===r){const n=new a.Binary(void 0,!0);n.writeString(t),n.writeUint8(5),n.writeUint8(1),n.writeUint16(e),"regular"===this.bufferKey?n.writeUint8(0):n.writeUint8(2);const r=this.buffer.peek((e=>e.readByteArray())).slice(4);n.write(r),this.buffer=n}return this.buffer}}},184274:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.writeEvent=function(e,t,n,r){return i(e,t,n,r?1:5)},t.writeField=function(e,t,n,r){return i(e,t,n,r?2:6)},t.writeGlobalAttribute=function(e,t,n){return i(e,t,n,0)};var r=n(551168);function i(e,t,n,i){if(null==n)0===i&&a(e,t,i);else if("number"==typeof n&&n===(0|n))0===n?a(e,t,16|i):1===n?a(e,t,32|i):-128<=n&&n<128?(a(e,t,48|i),e.writeInt8(n)):-32768<=n&&n<32768?(a(e,t,64|i),e.writeInt16(n)):(a(e,t,80|i),e.writeInt32(n));else if("number"==typeof n)a(e,t,112|i),e.writeFloat64(n);else if("string"==typeof n){const o=(0,r.numUtf8Bytes)(n);o<256?(a(e,t,128|i),e.writeUint8(o)):o<65536?(a(e,t,144|i),e.writeUint16(o)):(a(e,t,160|i),e.writeUint32(o)),e.writeString(n)}}function a(e,t,n){t<256?(e.writeUint8(n),e.writeUint8(t)):(e.writeUint8(8|n),e.writeUint16(t))}},566509:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MessageSendPerfReporter=void 0;var i=r(n(571834));t.MessageSendPerfReporter=class{constructor(e){let{chatWid:t,mediaType:n,messageType:r}=e;this._isRevokeMessage=!1,this._isDirectedMessage=!1,this._groupData=null,this._messageIsInvisible=!1,this._messageIsFirstUserMessage=!1,this._startTime=Date.now(),this._stagesMap=new Map,this._mediaType=n,this._messageType=r,this._chatWid=t}setFetchedPrekeyCount(e){this._fetchedPrekeyCount=e}setSenderKeyDistributionCount(e){this._senderKeyDistributionCount=e}setMessageIsInvisible(e){this._messageIsInvisible=e}setMessageIsFirstUserMessage(e){this._messageIsFirstUserMessage=e}setIsRevokeMessage(e){this._isRevokeMessage=e}setIsDirectedMessage(e){this._isDirectedMessage=e}setGroupData(e){this._groupData=e}startRenderedStage(){this._start(i.default.CLIENT_MESSAGE_SEND_STAGE.CLIENT_RENDERED)}postRenderedStage(){this._post(i.default.CLIENT_MESSAGE_SEND_STAGE.CLIENT_RENDERED)}startSavedStage(){this._start(i.default.CLIENT_MESSAGE_SEND_STAGE.CLIENT_SAVED)}postSavedStage(){this._post(i.default.CLIENT_MESSAGE_SEND_STAGE.CLIENT_SAVED)}startPrekeysFetchStage(){this._start(i.default.CLIENT_MESSAGE_SEND_STAGE.CLIENT_PREKEYS_FETCH)}postPrekeysFetchStage(){this._post(i.default.CLIENT_MESSAGE_SEND_STAGE.CLIENT_PREKEYS_FETCH)}startWrittenWireStage(){this._start(i.default.CLIENT_MESSAGE_SEND_STAGE.CLIENT_WRITTEN_WIRE)}postWrittenWireStage(){this._post(i.default.CLIENT_MESSAGE_SEND_STAGE.CLIENT_WRITTEN_WIRE)}startWaitingToEncryptStage(){this._start(i.default.CLIENT_MESSAGE_SEND_STAGE.CLIENT_WAITING_TO_ENCRYPT)}postWaitingToEncryptStage(){this._post(i.default.CLIENT_MESSAGE_SEND_STAGE.CLIENT_WAITING_TO_ENCRYPT)}startReadyToSendStage(){this._start(i.default.CLIENT_MESSAGE_SEND_STAGE.CLIENT_READY_TO_SEND)}postReadyToSendStage(){this._post(i.default.CLIENT_MESSAGE_SEND_STAGE.CLIENT_READY_TO_SEND)}startClientEncryptStage(){this._start(i.default.CLIENT_MESSAGE_SEND_STAGE.CLIENT_ENCRYPT)}postClientEncryptStage(){this._post(i.default.CLIENT_MESSAGE_SEND_STAGE.CLIENT_ENCRYPT)}_start(e){const t=new i.default.AndroidMessageSendPerf({sendStage:e});return this._stagesMap.set(e,t),t}_post(e){var t,n,r,a,o;const s=this._stagesMap.get(e)||this._start(e);if(s.mediaType=this._mediaType,s.messageType=this._messageType,s.messageIsInvisible=this._messageIsInvisible,s.messageIsFirstUserMessage=this._messageIsFirstUserMessage,s.durationRelative=Date.now()-this._startTime,s.fetchPrekeys=null!=this._fetchedPrekeyCount&&this._fetchedPrekeyCount>0,s.isRevokeMessage=this._isRevokeMessage,s.isDirectedMessage=this._isDirectedMessage,null!=(null===(t=this._groupData)||void 0===t?void 0:t.isLid)?s.isLid=this._groupData.isLid:this._messageType===i.default.MESSAGE_TYPE.INDIVIDUAL&&(s.isLid=this._chatWid.isLid()),null!=(null===(n=this._groupData)||void 0===n?void 0:n.wamTypeOfGroup)&&(s.typeOfGroup=this._groupData.wamTypeOfGroup),null!=(null===(r=this._groupData)||void 0===r?void 0:r.participantCount)&&(s.participantCount=this._groupData.participantCount),null!=(null===(a=this._groupData)||void 0===a?void 0:a.deviceSizeBucket)&&(s.deviceSizeBucket=this._groupData.deviceSizeBucket),null!=(null===(o=this._groupData)||void 0===o?void 0:o.deviceCount)){const e=this._groupData.deviceCount;s.deviceCount=e,null!=this._fetchedPrekeyCount&&e>0&&(s.fetchPrekeysPercentage=Math.round(this._fetchedPrekeyCount/e*100)),null!=this._senderKeyDistributionCount&&e>0&&(s.senderKeyDistributionCountPercentage=Math.round(this._senderKeyDistributionCount/e*100))}null!=s.fetchPrekeysPercentage&&s.fetchPrekeysPercentage>=50||s.messageIsFirstUserMessage?s.weight=0:null!=s.senderKeyDistributionCountPercentage&&s.senderKeyDistributionCountPercentage>=50?s.weight=20:s.deviceSizeBucket!==i.default.SIZE_BUCKET.LT5000&&s.deviceSizeBucket!==i.default.SIZE_BUCKET.LARGEST_BUCKET||(s.weight=100),s.markDurationAbs(),s.commit()}}},141797:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MessageSendReporter=void 0;var i=n(287461),a=n(97858),o=n(973480),s=n(373070),l=n(459857),u=n(869513),c=r(n(571834)),d=r(n(342310));t.MessageSendReporter=class{constructor(e,t){this._isPosted=!1,this._wid=e.to;let r=Boolean(e.caption);if((0,a.documentWithCaptionsSendEnabled)()&&e.type===s.MSG_TYPE.DOCUMENT&&(r=e.isCaptionByUser),this._metric=new c.default.MessageSend({messageType:e.getWamMessageType(),messageMediaType:e.getWamMediaType(),mediaCaptionPresent:r,fastForwardEnabled:!0,messageIsFanout:!0,messageIsForward:Boolean(e.isForwarded),messageIsRevoke:Boolean(e.isRevoke),isViewOnce:Boolean(e.isViewOnce),isAReply:(0,o.isReplyMsg)(e),e2eBackfill:Boolean(null==t?void 0:t.isResend)}),null!=e.ephemeralDuration&&(this._metric.ephemeralityDuration=e.ephemeralDuration),!e.isGroupMsg){this._metric.isLid=e.to.isLid();const t=(0,l.getMaybeMeUser)(),r=n(298592).getDisappearingModeSettingForUser,i=r(t);null!=i&&(this._metric.senderDefaultDisappearingDuration=i.duration);const a=r(e.to);null!=a&&(this._metric.receiverDefaultDisappearingDuration=a.duration)}e.isRevoke&&(this._metric.revokeType="admin_revoke"===e.subtype?c.default.REVOKE_TYPE.ADMIN:c.default.REVOKE_TYPE.SENDER,this._metric.revokeDuration=e.revokeDuration);const i=e.getWamDisappearingModeInitiator();null!=i&&(this._metric.disappearingChatInitiator=i),null!=(null==t?void 0:t.groupData)&&this.setGroupData(t.groupData)}setDeviceCount(e){this._metric.deviceCount=(0,u.capCount)(e),this._metric.deviceSizeBucket=(0,d.default)(e)}setGroupData(e){null!=e.isLid&&(this._metric.isLid=e.isLid),null!=e.wamTypeOfGroup&&(this._metric.typeOfGroup=e.wamTypeOfGroup),null!=e.participantCount&&(this._metric.participantCount=e.participantCount),null!=e.deviceCount&&(this._metric.deviceCount=e.deviceCount),null!=e.deviceSizeBucket&&(this._metric.deviceSizeBucket=e.deviceSizeBucket)}postSuccess(){this._metric.messageSendResult=c.default.MESSAGE_SEND_RESULT_TYPE.OK,this._metric.messageSendResultIsTerminal=!1,this._post()}postFailure(e){let{result:t,isTerminal:n}=e;this._metric.messageSendResult=t,this._metric.messageSendResultIsTerminal=n,this._post()}_commitRevokeMessageSend(){new c.default.RevokeMessageSend({messageSendResultIsTerminal:this._metric.messageSendResultIsTerminal,messageType:this._metric.messageType,resendCount:this._metric.resendCount,retryCount:this._metric.retryCount,revokeDuration:this._metric.revokeDuration,revokeType:this._metric.revokeType}).commit()}_post(){this._isPosted?__LOG__(3)`MessageSendReporter: skip posting, metric has already been posted`:(this._isPosted=!0,this._metric.markMessageSendT(),this._metric.commit(),this._metric.messageIsRevoke&&this._metric.messageType!==c.default.MESSAGE_TYPE.STATUS&&(0,i.getABPropConfigValue)("revokes_logging_unsampled")&&this._commitRevokeMessageSend())}}},567538:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.logMessageCounts=function(e,t){e.webcMessageCount+=t.length;for(let n=0,r=t[n];n<t.length;++n,r=t[n])switch(r.type){case i.MSG_TYPE.CHAT:case i.MSG_TYPE.LOCATION:case i.MSG_TYPE.PAYMENT:case i.MSG_TYPE.VCARD:case i.MSG_TYPE.CIPHERTEXT:case i.MSG_TYPE.MULTI_VCARD:case i.MSG_TYPE.REVOKED:case i.MSG_TYPE.OVERSIZED:e.webcTextMessageCount+=1;break;case i.MSG_TYPE.IMAGE:case i.MSG_TYPE.PRODUCT:e.webcPhotoMessageCount+=1;break;case i.MSG_TYPE.VIDEO:e.webcVideoMessageCount+=1;break;case i.MSG_TYPE.AUDIO:e.webcAudioMessageCount+=1;break;case i.MSG_TYPE.PTT:e.webcPttMessageCount+=1;break;case i.MSG_TYPE.STICKER:e.webcStickerMessageCount+=1;break;case i.MSG_TYPE.DOCUMENT:e.webcDocumentMessageCount+=1;break;default:e.webcOtherMessageCount+=1}},t.newMessageQueryEvent=function(e){return new a.default.WebcMessageQuery({webcResponseBytes:0,webcMessageCount:0,webcTextMessageCount:0,webcVideoMessageCount:0,webcPhotoMessageCount:0,webcAudioMessageCount:0,webcPttMessageCount:0,webcStickerMessageCount:0,webcDocumentMessageCount:0,webcOtherMessageCount:0,webcMessageQueryTrigger:e})};var i=n(373070),a=r(n(571834))},204412:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.postMdDeviceSyncAckMetric=function(e,t,n){const r=new a.default.MdDeviceSyncAck({revoke:(0,i.isRevokeMsg)(t)});e.isGroup()?(r.chatType=a.default.MESSAGE_CHAT_TYPE.GROUP,null!=(null==n?void 0:n.isLid)&&(r.isLid=n.isLid),null!=(null==n?void 0:n.wamTypeOfGroup)&&(r.typeOfGroup=n.wamTypeOfGroup)):e.isBroadcast()?r.chatType=a.default.MESSAGE_CHAT_TYPE.BROADCAST:e.isUser()&&(r.chatType=a.default.MESSAGE_CHAT_TYPE.INDIVIDUAL,r.isLid=e.isLid());r.commit()};var i=n(608182),a=r(n(571834))},967762:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_RETRY=void 0,t.maybePostMessageHighRetryCountMetric=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(257845),o=n(459857),s=n(440401),l=r(n(571834)),u=r(n(124928));function c(){return(c=(0,i.default)((function*(e,t){if(e<5)return;const n=new l.default.MessageHighRetryCount({retryCount:e}),r=d(t.type);null!=r&&(n.messageType=r);const i=p(t.author);null!=i&&(n.e2eSenderType=i);const a=t.chat;if(null==a?void 0:a.isGroup()){const e=yield(0,s.getGroupMetrics)(a);null!=(null==e?void 0:e.deviceSizeBucket)&&(n.deviceSizeBucket=e.deviceSizeBucket)}n.commit()}))).apply(this,arguments)}function d(e){switch(e){case a.MESSAGE_TYPE.CHAT:return l.default.MESSAGE_TYPE.INDIVIDUAL;case a.MESSAGE_TYPE.GROUP:return l.default.MESSAGE_TYPE.GROUP;case a.MESSAGE_TYPE.PEER_BROADCAST:case a.MESSAGE_TYPE.OTHER_BROADCAST:return l.default.MESSAGE_TYPE.BROADCAST;case a.MESSAGE_TYPE.DIRECT_PEER_STATUS:case a.MESSAGE_TYPE.OTHER_STATUS:return l.default.MESSAGE_TYPE.STATUS;default:return null}}function p(e){var t;return e instanceof u.default?e.user===(null===(t=(0,o.getMaybeMeUser)())||void 0===t?void 0:t.user)?e.isCompanion()?l.default.E2E_SENDER_TYPE.MY_COMPANION:l.default.E2E_SENDER_TYPE.MY_PRIMARY:e.isCompanion()?l.default.E2E_SENDER_TYPE.OTHER_COMPANION:l.default.E2E_SENDER_TYPE.OTHER_PRIMARY:null}t.MAX_RETRY=5},311110:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.maybePostPrekeysDepletionMetric=function(e){let{count:t,prekeysFetchReason:n,messageType:r,deviceSizeBucket:a}=e;if(null==t||0===t)return;const o={};null!=n&&(o.prekeysFetchReason=n);null!=r&&(o.messageType=r);null!=a&&(o.deviceSizeBucket=a);setTimeout((()=>{for(let e=0;e<t;e++)new i.default.PrekeysDepletion(o).commit()}),0)};var i=r(n(571834))},437695:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.postSenderKeyExpiredMetric=function(e){let{chatId:t,expiryReason:n,deviceCount:r}=e;const s=new i.default.SenderKeyExpired;null!=n&&(s.expiryReason=n);if(null!=t){const e=(0,o.createWidFromWidLike)(t);e.isGroup()?s.chatType=i.default.MESSAGE_CHAT_TYPE.GROUP:e.isBroadcast()?s.chatType=i.default.MESSAGE_CHAT_TYPE.BROADCAST:e.isUser()&&(s.chatType=i.default.MESSAGE_CHAT_TYPE.INDIVIDUAL)}null!=r&&r>0&&(s.deviceSizeBucket=(0,a.default)(r));s.commit()};var i=r(n(571834)),a=r(n(342310)),o=n(669050)},629919:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.syncdCriticalBootstrapStageLogger=function(e){if("SUCCESS"!==e.stage)return;const t=(0,i.convertSyncdCriticalBootstrapStageFromAnnotations)(e.annotations);if(null==t)return;(0,s.logCriticalBootstrapStageIfNecessary)(function(e){switch(e){case i.SyncdCriticalBootstrapStageType.ABOUT_TO_APPLY_MUTATIONS:return o.default.BOOTSTRAP_APP_STATE_DATA_STAGE_CODE.ABOUT_TO_APPLY_MUTATIONS;case i.SyncdCriticalBootstrapStageType.APPLIED_MUTATIONS:return o.default.BOOTSTRAP_APP_STATE_DATA_STAGE_CODE.APPLIED_MUTATIONS;case i.SyncdCriticalBootstrapStageType.MUTATIONS_DECRYPTED:return o.default.BOOTSTRAP_APP_STATE_DATA_STAGE_CODE.MUTATIONS_DECRYPTED;case i.SyncdCriticalBootstrapStageType.REQUEST_BUILT:return o.default.BOOTSTRAP_APP_STATE_DATA_STAGE_CODE.REQUEST_BUILT;case i.SyncdCriticalBootstrapStageType.RESPONSE_RECEIVED:return o.default.BOOTSTRAP_APP_STATE_DATA_STAGE_CODE.RESPONSE_RECEIVED;case i.SyncdCriticalBootstrapStageType.RESPONSE_PARSED_VALID:return o.default.BOOTSTRAP_APP_STATE_DATA_STAGE_CODE.RESPONSE_PARSED_VALID;case i.SyncdCriticalBootstrapStageType.ENTERED_RETRY_MODE:return o.default.BOOTSTRAP_APP_STATE_DATA_STAGE_CODE.ENTERED_RETRY_MODE;case i.SyncdCriticalBootstrapStageType.MISSING_KEYS_RECEIVED:return o.default.BOOTSTRAP_APP_STATE_DATA_STAGE_CODE.MISSING_KEYS_RECEIVED}}(t.type))},t.syncdDecryptMutationsMetricsLogger=function(e){const{stage:t,annotations:n}=e;if("SUCCESS"!==t)return;const r=(0,i.convertSyncdDecryptMutationsMetricsFromAnnotations)(n);if(null==r)return;r.decryptedMutationMessageRangeCountArray.forEach((e=>(0,a.logMetricsForMutationLength)(e)))};var i=n(43959),a=n(372088),o=r(n(571834)),s=n(398384)},806841:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.syncdFatalErrorLogger=function(e){const{stage:t,annotations:n}=e;if("FAIL"!==t)return;const r=(0,i.convertSyncdFatalErrorFromAnnotations)(n);if(null==r)return void(0,a.uploadFatalErrorMetric)(o.default.MD_SYNCD_FATAL_ERROR_CODE.UNKNOWN,null);(0,a.uploadFatalErrorMetric)(function(e){switch(e){case i.SyncdFatalErrorType.PATCH_PROTOBUF_SERIALIZATION_FAILED:return o.default.MD_SYNCD_FATAL_ERROR_CODE.PATCH_PROTOBUF_SERIALIZATION_FAILED;case i.SyncdFatalErrorType.MUTATIONS_PROTOBUF_SERIALIZATION_FAILED:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MUTATIONS_PROTOBUF_SERIALIZATION_FAILED;case i.SyncdFatalErrorType.ACTION_DATA_PROTOBUF_SERIALIZATION_FAILED:return o.default.MD_SYNCD_FATAL_ERROR_CODE.ACTION_DATA_PROTOBUF_SERIALIZATION_FAILED;case i.SyncdFatalErrorType.ENCRYPTION_FAILED:return o.default.MD_SYNCD_FATAL_ERROR_CODE.ENCRYPTION_FAILED;case i.SyncdFatalErrorType.MISSING_SNAPSHOT_VERSION:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MISSING_SNAPSHOT_VERSION;case i.SyncdFatalErrorType.MISSING_SNAPSHOT_MAC:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MISSING_SNAPSHOT_MAC;case i.SyncdFatalErrorType.MISSING_SNAPSHOT_KEY_ID:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MISSING_SNAPSHOT_KEY_ID;case i.SyncdFatalErrorType.MISSING_PATCH_VERSION:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MISSING_PATCH_VERSION;case i.SyncdFatalErrorType.PATCH_WITH_BOTH_INLINE_AND_EXTERNAL_MUTATIONS:return o.default.MD_SYNCD_FATAL_ERROR_CODE.PATCH_WITH_BOTH_INLINE_AND_EXTERNAL_MUTATIONS;case i.SyncdFatalErrorType.MISSING_PATCH_SNAPSHOT_MAC:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MISSING_PATCH_SNAPSHOT_MAC;case i.SyncdFatalErrorType.MISSING_PATCH_MAC:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MISSING_PATCH_MAC;case i.SyncdFatalErrorType.MISSING_PATCH_KEY_ID:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MISSING_PATCH_KEY_ID;case i.SyncdFatalErrorType.MISSING_EXTERNAL_BLOB_REFERENCE_MEDIA_KEY:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MISSING_EXTERNAL_BLOB_REFERENCE_MEDIA_KEY;case i.SyncdFatalErrorType.MISSING_EXTERNAL_BLOB_REFERENCE_DIRECT_PATH:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MISSING_EXTERNAL_BLOB_REFERENCE_DIRECT_PATH;case i.SyncdFatalErrorType.MISSING_EXTERNAL_BLOB_REFERENCE_FILE_SHA256:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MISSING_EXTERNAL_BLOB_REFERENCE_FILE_SHA256;case i.SyncdFatalErrorType.MISSING_EXTERNAL_BLOB_REFERENCE_FILE_ENC_SHA256:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MISSING_EXTERNAL_BLOB_REFERENCE_FILE_ENC_SHA256;case i.SyncdFatalErrorType.MISSING_MUTATION_OPERATION:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MISSING_MUTATION_OPERATION;case i.SyncdFatalErrorType.MISSING_MUTATION_RECORD:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MISSING_MUTATION_RECORD;case i.SyncdFatalErrorType.MISSING_MUTATION_INDEX:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MISSING_MUTATION_INDEX;case i.SyncdFatalErrorType.MISSING_MUTATION_VALUE:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MISSING_MUTATION_VALUE;case i.SyncdFatalErrorType.MISSING_MUTATION_KEY_ID:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MISSING_MUTATION_KEY_ID;case i.SyncdFatalErrorType.EXTERNAL_BLOB_REFERENCE_PROTOBUF_DESERIALIZATION_FAILED:return o.default.MD_SYNCD_FATAL_ERROR_CODE.EXTERNAL_BLOB_REFERENCE_PROTOBUF_DESERIALIZATION_FAILED;case i.SyncdFatalErrorType.SNAPSHOT_PROTOBUF_DESERIALIZATION_FAILED:return o.default.MD_SYNCD_FATAL_ERROR_CODE.SNAPSHOT_PROTOBUF_DESERIALIZATION_FAILED;case i.SyncdFatalErrorType.PATCH_PROTOBUF_DESERIALIZATION_FAILED:return o.default.MD_SYNCD_FATAL_ERROR_CODE.PATCH_PROTOBUF_DESERIALIZATION_FAILED;case i.SyncdFatalErrorType.MUTATIONS_PROTOBUF_DESERIALIZATION_FAILED:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MUTATIONS_PROTOBUF_DESERIALIZATION_FAILED;case i.SyncdFatalErrorType.ACTION_DATA_PROTOBUF_DESERIALIZATION_FAILED:return o.default.MD_SYNCD_FATAL_ERROR_CODE.ACTION_DATA_PROTOBUF_DESERIALIZATION_FAILED;case i.SyncdFatalErrorType.MISSING_ACTION_INDEX:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MISSING_ACTION_INDEX;case i.SyncdFatalErrorType.MISSING_ACTION_VERSION:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MISSING_ACTION_VERSION;case i.SyncdFatalErrorType.SNAPSHOT_MAC_MISMATCH_IN_SNAPSHOT:return o.default.MD_SYNCD_FATAL_ERROR_CODE.SNAPSHOT_MAC_MISMATCH_IN_SNAPSHOT;case i.SyncdFatalErrorType.SNAPSHOT_MAC_MISMATCH_IN_PATCH:return o.default.MD_SYNCD_FATAL_ERROR_CODE.SNAPSHOT_MAC_MISMATCH_IN_PATCH;case i.SyncdFatalErrorType.MAC_MISMATCH_PATCH:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MAC_MISMATCH_PATCH;case i.SyncdFatalErrorType.DECRYPTION_FAILED:return o.default.MD_SYNCD_FATAL_ERROR_CODE.DECRYPTION_FAILED;case i.SyncdFatalErrorType.DUPLICATE_PATCH_VERSION_IN_COLLECTION:return o.default.MD_SYNCD_FATAL_ERROR_CODE.DUPLICATE_PATCH_VERSION_IN_COLLECTION;case i.SyncdFatalErrorType.SAME_INDEX_FOR_MULTIPLE_MUTATIONS_IN_PATCH:return o.default.MD_SYNCD_FATAL_ERROR_CODE.SAME_INDEX_FOR_MULTIPLE_MUTATIONS_IN_PATCH;case i.SyncdFatalErrorType.SAME_INDEX_FOR_MULTIPLE_MUTATIONS_IN_SNAPSHOT:return o.default.MD_SYNCD_FATAL_ERROR_CODE.SAME_INDEX_FOR_MULTIPLE_MUTATIONS_IN_SNAPSHOT;case i.SyncdFatalErrorType.MISSING_ACTION_VALUE:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MISSING_ACTION_VALUE;case i.SyncdFatalErrorType.MISSING_ACTION_TIMESTAMP:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MISSING_ACTION_TIMESTAMP;case i.SyncdFatalErrorType.XMPP_BAD_REQUEST_FOR_COLLECTION:return o.default.MD_SYNCD_FATAL_ERROR_CODE.XMPP_BAD_REQUEST_FOR_COLLECTION;case i.SyncdFatalErrorType.XMPP_NOT_FOUND_FOR_COLLECTION:return o.default.MD_SYNCD_FATAL_ERROR_CODE.XMPP_NOT_FOUND_FOR_COLLECTION;case i.SyncdFatalErrorType.CYCLIC_MUTATION_DEPENDENCY_IN_PATCH:return o.default.MD_SYNCD_FATAL_ERROR_CODE.CYCLIC_MUTATION_DEPENDENCY_IN_PATCH;case i.SyncdFatalErrorType.SERVER_DID_NOT_SEND_ALL_PATCHES:return o.default.MD_SYNCD_FATAL_ERROR_CODE.SERVER_DID_NOT_SEND_ALL_PATCHES;case i.SyncdFatalErrorType.TERMINAL_PATCH_MISSING_DATA:return o.default.MD_SYNCD_FATAL_ERROR_CODE.TERMINAL_PATCH_MISSING_DATA;case i.SyncdFatalErrorType.TERMINAL_PATCH_DESERIALIZATION_ERROR:return o.default.MD_SYNCD_FATAL_ERROR_CODE.TERMINAL_PATCH_DESERIALIZATION_ERROR;case i.SyncdFatalErrorType.TERMINAL_PATCH_UNKNOWN:return o.default.MD_SYNCD_FATAL_ERROR_CODE.TERMINAL_PATCH_UNKNOWN;case i.SyncdFatalErrorType.INVALID_ACTION_INDEX:return o.default.MD_SYNCD_FATAL_ERROR_CODE.INVALID_ACTION_INDEX;case i.SyncdFatalErrorType.XMPP_BAD_REQUEST_GLOBAL_ERROR:return o.default.MD_SYNCD_FATAL_ERROR_CODE.XMPP_BAD_REQUEST_GLOBAL_ERROR;case i.SyncdFatalErrorType.XMPP_NOT_FOUND_GLOBAL_ERROR:return o.default.MD_SYNCD_FATAL_ERROR_CODE.XMPP_NOT_FOUND_GLOBAL_ERROR;case i.SyncdFatalErrorType.XMPP_BAD_METHOD_GLOBAL_ERROR:return o.default.MD_SYNCD_FATAL_ERROR_CODE.XMPP_BAD_METHOD_GLOBAL_ERROR;case i.SyncdFatalErrorType.XMPP_NOT_ACCEPTABLE_GLOBAL_ERROR:return o.default.MD_SYNCD_FATAL_ERROR_CODE.XMPP_NOT_ACCEPTABLE_GLOBAL_ERROR;case i.SyncdFatalErrorType.TOO_MANY_INTERNAL_SERVER_ERRORS_IN_7D:return o.default.MD_SYNCD_FATAL_ERROR_CODE.TOO_MANY_INTERNAL_SERVER_ERRORS_IN_7D;case i.SyncdFatalErrorType.TIMEOUT_WHILE_WAITING_FOR_MISSING_KEY:return o.default.MD_SYNCD_FATAL_ERROR_CODE.TIMEOUT_WHILE_WAITING_FOR_MISSING_KEY;case i.SyncdFatalErrorType.MISSING_KEY_ON_ALL_CLIENTS:return o.default.MD_SYNCD_FATAL_ERROR_CODE.MISSING_KEY_ON_ALL_CLIENTS}}(r.type),null==r.collection?null:r.collection,null==r.patchSnapshotMutationCount?void 0:r.patchSnapshotMutationCount,null==r.patchVersion?void 0:r.patchVersion,null==r.isFatal?void 0:r.isFatal)};var i=n(493635),a=n(22383),o=r(n(571834))},377795:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.initializePREMetrics=function(){(0,a.subscribe)(g),l.Cmd.on("logout",s.forceCommitAppState)};var i=n(755907),a=n(865979),o=n(637463),s=n(573166),l=n(780549),u=n(372088),c=n(230591),d=n(629919),p=n(806841),_=r(n(571834)),f=n(971277),h=n(46167);function g(e){const{name:t}=e;switch(t){case i.PRE_METRIC.SYNCD_FATAL_ERROR:(0,p.syncdFatalErrorLogger)(e);break;case i.PRE_METRIC.APP_STATE_SYNC_DAILY:!function(e){const{stage:t,annotations:n}=e;if("SUCCESS"!==t)return;const r=(0,s.convertAppStateSyncDailyFromAnnotations)(n||{}),i=new _.default.MdAppStateSyncDaily;r.mutationCount>0&&(i.mutationCount=r.mutationCount);r.invalidActionCount>0&&(i.invalidActionCount=r.invalidActionCount);r.unsupportedActionCount>0&&(i.unsupportedActionCount=r.unsupportedActionCount);r.keyRotationRemoveCount>0&&(i.keyRotationRemoveCount=r.keyRotationRemoveCount);r.storedMutationCount>0&&(i.storedMutationCount=r.storedMutationCount);r.uploadConflictCount>0&&(i.uploadConflictCount=r.uploadConflictCount);r.unsetActionCount>0&&(i.unsetActionCount=r.unsetActionCount);r.missingKeyCount>0&&(i.missingKeyCount=r.missingKeyCount);i.commit()}(e);break;case i.PRE_METRIC.SYNCD_CRITICAL_EVENT:!function(e){if("FAIL"!==e.stage)return;const t=(0,o.convertSyncdCriticalEventFromAnnotations)(e.annotations);if(null==t)return;(0,h.uploadCriticalEventMetric)(function(e){switch(e){case o.SyncdCriticalEventType.MISSING_MUTATION_TO_REMOVE:return _.default.MD_SYNCD_CRITICAL_EVENT_CODE.MISSING_MUTATION_TO_REMOVE}}(t.type),t.collection)}(e);break;case i.PRE_METRIC.SYNCD_CRITICAL_BOOTSTRAP_STAGE:(0,d.syncdCriticalBootstrapStageLogger)(e);break;case i.PRE_METRIC.SYNCD_BOOTSTRAP_APP_STATE_DOWNLOAD:!function(e){if("FAIL"!==e.stage&&"SUCCESS"!==e.stage)return;const t=(0,o.convertSyncdBootstrapAppStateDownloadFromAnnotations)(e.annotations);if(null==t)return;(0,c.commitBootstrapAppStateDownloadMetric)(t.collection,t.downloadStartTs,t.downloadSize,t.isSuccess)}(e);break;case i.PRE_METRIC.SYNCD_DECRYPT_MUTATIONS:(0,d.syncdDecryptMutationsMetricsLogger)(e);break;case i.PRE_METRIC.SYNCD_BOOTSTRAP_DATA_APPLIED:!function(e){if("SUCCESS"!==e.stage)return;const t=(0,o.convertSyncdBootstrapDataAppliedFromAnnotations)(e.annotations);if(null==t)return;(0,u.logMetricsForDataApplied)(t.collection,t.snapshotUsed,t.durationMs)}(e);break;case i.PRE_METRIC.SYNCD_KEY_ROTATION:!function(e){if("SUCCESS"!==e.stage)return;const t=(0,o.convertSyncdKeyRotationEventFromAnnotations)(e.annotations);if(null==t)return;new _.default.MdAppStateKeyRotation({mdAppStateKeyRotationReason:m(t.type)}).commit()}(e);break;case i.PRE_METRIC.SYNCD:!function(e){const{instanceKey:t,annotations:n}=e;if("START"===e.stage){const e=new f.SyncdQPL;return e.start(),void y.set(t,e)}const r=y.get(t);if(null==r)return void __LOG__(4,void 0,new Error)`[syncd] Unknown syncd PRE instance key: ${t}`;switch(e.stage){case"POINT":r.markAnnotations(e.reason,n);break;case"SUCCESS":r.end(),y.delete(t);break;case"FAIL":r.end(!0),y.delete(t)}}(e);break;case i.PRE_METRIC.DECRYPT_MESSAGE_FINAL:case i.PRE_METRIC.DELETE_THREAD:case i.PRE_METRIC.DOWNLOAD_AND_DECRYPT:case i.PRE_METRIC.FRANKING_VALIDATION:case i.PRE_METRIC.GET_DEVICES:case i.PRE_METRIC.MEDIA_DOWNLOAD:case i.PRE_METRIC.MEDIA_UPLOAD:case i.PRE_METRIC.MESSAGE_DECRYPTION:case i.PRE_METRIC.MESSAGE_ENCRYPTION:case i.PRE_METRIC.OFFLINE_QUEUE:case i.PRE_METRIC.OFFLINE_RETRY:case i.PRE_METRIC.QUERY_GROUP:case i.PRE_METRIC.QUERY_GROUPS:case i.PRE_METRIC.RETRY_RECEIPTS_SENT:case i.PRE_METRIC.SAVE_SESSION_RETRIES:case i.PRE_METRIC.SAVE_SIGNAL_SESSION_RETRIES:case i.PRE_METRIC.SEND_MESSAGE:case i.PRE_METRIC.REMOVE_PARTICIPANTS:case i.PRE_METRIC.CREATE_GROUP:case i.PRE_METRIC.RECEIVE_MESSAGE:case i.PRE_METRIC.TEST_MAW_ENCRYPT_MESSAGE:case i.PRE_METRIC.TEST_MAW_WA_SEND_MESSAGE:case i.PRE_METRIC.TEST_RECEIVE_MESSAGE:case i.PRE_METRIC.WA_FAILURE_STANZA:case i.PRE_METRIC.ICDC_ERROR:case i.PRE_METRIC.WA_JOBS_ORCHESTRATOR:case i.PRE_METRIC.WA_JOB_MANAGER:case i.PRE_METRIC.WA_DISCONNECT:__LOG__(4,void 0,new Error)`Unhandled metric event: ${t}`}}function m(e){switch(e){case o.SyncdKeyRotationEventType.APP_STATE_SYNC_KEY_EXPIRY:return _.default.MD_APP_STATE_KEY_ROTATION_REASON_CODE.APP_STATE_SYNC_KEY_EXPIRY;case o.SyncdKeyRotationEventType.DEVICE_DEREGISTERATION:return _.default.MD_APP_STATE_KEY_ROTATION_REASON_CODE.DEVICE_DEREGISTERATION;case o.SyncdKeyRotationEventType.NO_KEYS:return _.default.MD_APP_STATE_KEY_ROTATION_REASON_CODE.NO_KEYS}}const y=new Map},854379:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.chatJidToChatWid=function(e){return(0,i.toChatWid)((0,i.createWid)(e))},t.deviceJidToDeviceWid=function(e){return(0,i.createDeviceWid)(e)},t.deviceJidToUserWid=function(e){return(0,i.toUserWid)((0,i.createWid)(e))},t.groupJidToWid=function(e){return(0,i.createWid)(e)},t.jidWithTypeToWid=function(e){const t=(0,r.extractJidFromJidWithType)(e);return(0,i.createWid)(t)},t.userJidToUserWid=function(e){return(0,i.createUserWid)(e)};var r=n(714443),i=n(669050)},124928:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(616310),a=n(425315),o=r(n(143589)),s=n(323389);const l="16505361212@c.us",u=["name","short","notify"];class c{constructor(e,t){let{intentionallyUsePrivateConstructor:n}=t;if(!n)throw new Error("You should use WidFactory.createWid() instead of the Wid constructor. If you absolutely must use the constructor, pass {intentionallyUsePrivateConstructor: true} as a second parameter.");const r=(0,s.validateAndGetParts)(e);if(null==r)throw __LOG__(2)`Invalid wid: ${e}`,new Error("wid error: invalid wid");const i=[],a=r.userPart,o=r.devicePart,l=r.serverPart.toLowerCase();let u;switch(l){case"s.whatsapp.net":u="c.us";break;default:u=l}if(this.server=u,null==a)throw __LOG__(2)`wid represents server and should not be used: ${e}`,new Error("wid error: wid represents server and should not be used");if(this.user=a,i.push(this.user),null!=o){if("c.us"!==this.server&&"lid"!==this.server)throw __LOG__(2)`wrong server for wid with device present: ${e}`,new Error("wid error: wrong server for wid with device present");const t=parseInt(o,10);t&&(i.push(":"),i.push(t),this.device=t)}i.push("@"),i.push(this.server),this._serialized=i.join("")}getUserPartForLog(){if(this.isGroup()){const e=this.user.split("-");if(2===e.length){const[t,n]=e;return`${t.slice(-4)}-${n}`}}return this.user.slice(-4)}toString(e){if(e){let t,n;const r=e.legacy&&"c.us"===this.server?"s.whatsapp.net":this.server;e.formatFull?(n=`:${this.device||0}`,t=".0"):n=null!=this.device&&0!==this.device?`:${this.device}`:"";const i=e.forLog?this.getUserPartForLog():this.user;if(e.formatFull||e.legacy&&"c.us"===this.server||e.forLog)return[i,t,n,"@",r].join("")}return this._serialized}toLogString(){return this.toString({forLog:!0,legacy:!1})}toJid(){return this.toString({legacy:!0})}getJidServer(){return"c.us"===this.server?i.WA_USER_JID_SUFFIX:this.server}getSignalAddress(){const e=null!=this.device&&0!==this.device?`:${this.device}`:"",t=this.isLid()?"@lid":"";return[this.user,e,t].join("")}getDeviceId(){const e=this.device;return null==e?0:e}equals(e){return e instanceof c&&this.toString()===e.toString()}isLessThan(e){return e instanceof c&&this.toString()<e.toString()}isGreaterThan(e){return e instanceof c&&this.toString()>e.toString()}isCompanion(){return null!=this.device&&this.device!==i.DEFAULT_DEVICE_ID}isSameAccount(e){return this.server===e.server&&this.user===e.user}isUser(){return"c.us"===this.server||"lid"===this.server}isLid(){return"lid"===this.server}isUserNotPSA(){return this.isUser()&&!this.isPSA()}isBroadcast(){return"broadcast"===this.server}isOfficialBizAccount(){return this.toString()===l}isGroup(){return"g.us"===this.server}isGroupCall(){return"call"===this.server}isServer(){return"server"===this.user.toLowerCase()&&"c.us"===this.server}isPSA(){return"0"===this.user&&"c.us"===this.server}isIAS(){return"16508638904"===this.user&&"c.us"===this.server}isStatusV3(){return"status"===this.user.toLowerCase()&&"broadcast"===this.server}isSupportAccount(){return(0,o.default)(this.user)}toJSON(){return this.toString()}static isXWid(e,t){return(0,a.isString)(t)?t.split("@")[1]===e:t instanceof c?t.server===e:(void 0!==t&&__LOG__(2)`wid:isXWid called on nonstring: + ${String(t)}`,!1)}static isUser(e){return c.isXWid("c.us",e)||c.isXWid("lid",e)}static isLid(e){return c.isXWid("lid",e)}static isBroadcast(e){return c.isXWid("broadcast",e)}static isGroup(e){return c.isXWid("g.us",e)}static isGroupCall(e){return c.isXWid("call",e)}static isWid(e){return(0,a.isString)(e)?(0,s.validateWid)(e):e instanceof c}static canBeWid(e){return!e||!u.includes(e)}static isServer(e){return(0,a.isString)(e)?"server@c.us"===e.toLowerCase():e instanceof c&&e.isServer()}static isPSA(e){return(0,a.isString)(e)?"0@c.us"===e.toLowerCase():e instanceof c&&e.isPSA()}static isIAS(e){return(0,a.isString)(e)?"16508638904@c.us"===e.toLowerCase():e instanceof c&&e.isIAS()}static isStatusV3(e){return(0,a.isString)(e)?e.toLowerCase()===i.STATUS_JID:e instanceof c&&e.isStatusV3()}static isSupportAccount(e){return(0,a.isString)(e)?(0,o.default)(e.split("@")[0]):e instanceof c&&e.isSupportAccount()}static isOfficialBizAccount(e){return(0,a.isString)(e)?e.toLowerCase()===l:e instanceof c&&e.isOfficialBizAccount()}static user(e){return(0,a.isString)(e)?e.split("@")[0]:e instanceof c?e.user:void 0}static equals(e,t){return e instanceof c||t instanceof c?e instanceof c&&e.equals(t):e===t}static isLessThan(e,t){return e instanceof c&&t instanceof c&&e.toString()<t.toString()}static isGreaterThan(e,t){return e instanceof c&&t instanceof c&&e.toString()>t.toString()}}t.default=c},669050:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.createDeviceWid=u,t.createDeviceWidFromDeviceListPk=function(e,t){const[n,r="c.us"]=e.split("@");return l(n,r,t)},t.createDeviceWidFromUserAndDevice=l,t.createUserWid=c,t.createWid=s,t.createWidFromWidLike=function(e){if(e instanceof a.default)return e;if("string"==typeof e)return s(e);return s(e._serialized)},t.isWidlike=function(e){return!!e&&(!!a.default.isWid(e)||!(!e||"object"!=typeof e||!a.default.isWid(e._serialized)))},t.toChatWid=function(e){if(e.isUser())return d(e);return e},t.toGroupWid=function(e){if(e.isUser())throw new Error("toGroupWid: wid is a user wid");return e},t.toUserWid=d;var i=n(425315),a=r(n(124928)),o=r(n(306002));function s(e){let t;return(null===o.default||void 0===o.default?void 0:o.default.cache)?(t=o.default.cache[e],t||(t=new a.default(e,{intentionallyUsePrivateConstructor:!0}),o.default.cache[e]=t)):t=new a.default(e,{intentionallyUsePrivateConstructor:!0}),t}function l(e,t,n){return u(`${e}:${n}@${t}`)}function u(e){return s(e)}function c(e,t){let n;if(n=(0,i.isString)(e)&&(e.endsWith("@c.us")||e.endsWith("@s.whatsapp.net")||e.endsWith("@lid"))?e:`${e}@${t||"c.us"}`,n=s(n),null==n.device||0===n.device)return n;throw __LOG__(4,void 0,new Error)`createUserWid: ${e} is not a valid user jid`,new Error("createUserWid is called with invalid user string")}function d(e){if(!e.isUser())throw new Error("asUserWid: wid is not a user wid");return null==e.device||0===e.device?e:c(e.user,e.server)}},931019:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.widToFormattedUser=function(e){if(e instanceof u.default)return e.isLid()?(__LOG__(3,void 0,void 0,!0)`widToFormattedUser should not be lid`,SEND_LOGS("widToFormattedUser-wid-lid"),""):d(e.user);if((0,s.isString)(e))return e.endsWith(a.LID_DOMAIN)?(__LOG__(3,void 0,void 0,!0)`widToFormattedUser should not be lid`,SEND_LOGS("widToFormattedUser-string-lid"),""):d(e.split("@")[0]);return""};var i=r(n(288306)),a=n(616310),o=n(8525),s=n(425315),l=r(n(932325)),u=r(n(124928));const c=(0,i.default)((e=>"Server"===e?e:(0,o.formatPhone)(e)));function d(e){return l.default.isRTL()?l.default.isolateLTR(c(e)):c(e)}},933173:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.default.isWid,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a.createWid,o=t;switch(e){case"author":case"broadcast":case"chat":case"descOwner":case"from":case"gid":case"id":case"jid":case"owner":case"participant":case"quotedRemoteJid":case"quotedParticipant":case"remote":case"subjectOwner":case"s_o":case"to":case"wid":case"changeNumberNewJid":case"changeNumberOldJid":case"recipient":case"paymentMessageReceiverJid":case"parentGroup":case"revokeSender":n(t)&&(o=r(t));break;default:const i=parseInt(e,10);!isNaN(i)&&n(t)&&(o=r(t))}return o};var i=r(n(124928)),a=n(669050)},306002:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;const n={cache:{},delete(){n.cache={}}};var r=n;t.default=r},574819:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.widToChatJid=function(e){const t=a(e);if("group"===t.jidType)return t.groupJid;if("phoneUser"===t.jidType||"lidUser"===t.jidType)return t.userJid;throw __LOG__(4,void 0,new Error)`widToChatJid: "${e.toString()}" is not a ChatJid`,new Error("widToChatJid: can not convert wid to ChatJid")},t.widToDeviceJid=o,t.widToGroupJid=function(e){const t=a(e);if("group"===t.jidType)return t.groupJid;throw __LOG__(4,void 0,new Error)`widToGroupJid: "${e.toString()}" is not a GroupJid`,new Error("widToGroupJid: can not convert wid to GroupJid")},t.widToJidWithType=a,t.widToMyJids=function(e){if(null!=e){const t=o(e);return{userJid:(0,r.extractUserJid)(t),deviceJid:t}}},t.widToPhoneDeviceJid=function(e){const t=a(e);if("phoneDevice"===t.jidType)return t.deviceJid;if("phoneUser"===t.jidType)return(0,r.toPhoneDeviceJid)((0,r.toPhoneUserJid)(e.user),e.getDeviceId());throw __LOG__(4,void 0,new Error)`widToPhoneDeviceJid: "${e.toString()}" is not a PhoneDeviceJid`,new Error("widToPhoneDeviceJid: can not convert wid to PhoneDeviceJid")},t.widToUserJid=function(e){const t=a(e);if("phoneUser"===t.jidType||"lidUser"===t.jidType)return t.userJid;throw __LOG__(4,void 0,new Error)`widToUserJid: "${e.toString()}" is not a UserJid`,new Error("widToUserJid: can not convert wid to UserJid")};var r=n(616310),i=n(714443);function a(e){const t=e.toJid(),n=(0,i.interpretAndValidateJid)(t);if("unknown"===n.jidType)throw __LOG__(4,void 0,new Error)`widToJidWithType: "${t}" is not a valid jid`,new Error("widToJidWithType: unknown jid type");return n}function o(e){const t=a(e);if("phoneDevice"===t.jidType||"lidDevice"===t.jidType)return t.deviceJid;if("phoneUser"===t.jidType)return(0,i.defaultDeviceJidForUser)(t.userJid);if("lidUser"===t.jidType)return(0,i.defaultLidDeviceJidForLidUserJid)(t.userJid);throw __LOG__(4,void 0,new Error)`widToDeviceJid: "${e.toString()}" is not a DeviceJid`,new Error("widToDeviceJid: can not convert wid to DeviceJid")}},323389:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Domains=void 0,t.validateAndGetParts=function(e){if(null==e)return null;const t=e.match(/(.*)@(.*)/);if(null==t)return"call"===e||"s.whatsapp.net"===e?{serverPart:e}:null;const n=t[1],i=r.cast(t[2]);if(null==i)return __LOG__(3)`validateAndGetParts: Domain not supported`,null;const a=n.match(d[t[2]]);if(!a)return null;switch(i){case r.BROADCAST:return{serverPart:r.BROADCAST,userPart:a[1]};case r.CALL:return{serverPart:r.CALL,userPart:a[1]};case r.G_US:return{serverPart:r.G_US,userPart:a[1]};case r.C_US:return{serverPart:r.C_US,userPart:a[1],devicePart:a[3]};case r.S_WHATSAPP_NET:return{serverPart:r.S_WHATSAPP_NET,userPart:a[1],devicePart:a[3]};case r.LID:return{serverPart:r.LID,userPart:a[1],devicePart:a[3]};case r.MSGR:return{serverPart:r.LID,userPart:a[1],devicePart:a[2]}}return null},t.validateWid=function(e){if(null==e)return!1;const t=e.match(/(.*)@(.*)/);if(null==t)return"call"===e||"s.whatsapp.net"===e;const n=t[1],r=t[2];if(null==d[r])return!1;return d[r].test(n)};const r=n(76672)({BROADCAST:"broadcast",CALL:"call",C_US:"c.us",G_US:"g.us",LID:"lid",MSGR:"msgr",S_WHATSAPP_NET:"s.whatsapp.net"});t.Domains=r;const i=/[0-9]{1,2}/,a=/0/,o=/[1-9][0-9]{0,19}/,s=/(?!10)[1-9][0-9]{4,19}/,l=new RegExp(`^(${s.source}[-]${/[1-9][0-9]{9}/.source}$|^${o.source})$`),u=new RegExp(`^(${o.source}$|${["status","location","chat"].map((e=>"^"+e+"$")).join("|")})`,"i"),c=new RegExp(`^(0$|^${s.source})([.]${a.source})?(?:[:](${i.source}))?$`),d={broadcast:u,call:/^([0-9a-f]{18,32})$/i,"c.us":c,"g.us":l,lid:new RegExp(`^(${/[1-9][0-9]{0,14}/.source})([.]${a.source})?(?:[:](${i.source}))?$`),msgr:new RegExp(`^(${o.source})(?:[:](${/[1-9][0-9]{0,2}/.source}))?$`),"s.whatsapp.net":c}},616491:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.invalidateChatPollMsgs=function(){return s.apply(this,arguments)};var i=r(n(348926)),a=n(671598),o=n(203829);function s(){return(s=(0,i.default)((function*(e){if((0,a.isPollsReceivingEnabled)())try{yield(0,o.invalidateChatPolls)(e.id),e.msgs.filter((e=>e.asPollCreation&&!e.pollInvalidated)).forEach((e=>{e.pollInvalidated=!0}))}catch(e){__LOG__(4,void 0,new Error)`[POLLS] Failed to invalidate polls with error: ${e}`}}))).apply(this,arguments)}},426750:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.compressPollOptions=function(e){return null==e?void 0:e.slice().sort(((e,t)=>e.localId-t.localId)).map(((e,t)=>{let{localId:n,name:r}=e;return(0,a.default)(n===t,"Unexpected local ID"),{name:r}}))},t.expandPollOptions=function(e){return null==e?void 0:e.map(((e,t)=>{let{name:n}=e;return{name:(0,i.default)(n,"name"),localId:t}}))};var i=r(n(132375)),a=r(n(441143))},923544:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.parseWebMsgInfoPollUpdates=function(){return h.apply(this,arguments)};var i=r(n(348926)),a=n(478337),o=r(n(132375)),s=n(523930),l=r(n(565754)),u=n(373070),c=n(823980),d=n(671598),p=n(705769),_=n(459857),f=n(669050);function h(){return(h=(0,i.default)((function*(e,t){try{if(!(0,d.isPollsReceivingEnabled)())return[];if(null==e||null==e.pollUpdates)return[];if(null==t||t.type!==u.MSG_TYPE.POLL_CREATION)return[];const n=t,r=yield(0,c.createOptionLocalIdMap)(n.pollOptions);return e.pollUpdates.map((e=>{try{const t=(0,o.default)(e.pollUpdateMessageKey,"pollUpdate.pollUpdateMessageKey"),i=(0,o.default)(e.vote,"pollUpdate.vote"),u=(0,o.default)(t.fromMe,"pollUpdateMessageKey.fromMe"),c=(0,s.strictDecodeJid)(t.remoteJid),d=!u&&(null==c?void 0:c.isGroup())?(0,f.createUserWid)((0,o.default)(t.participant,"pollUpdateMessageKey.participant")):void 0,h=new l.default({fromMe:(0,o.default)(t.fromMe,"pollUpdateMessageKey.fromMe"),remote:(0,f.createWid)((0,o.default)(t.remoteJid,"pollUpdateMessageKey.remoteJid")),id:(0,o.default)(t.id,"pollUpdateMessageKey.id"),participant:d}),g=(0,_.getMeUser)(),m=h.participant||h.remote,y=!0===h.fromMe?g:(0,f.toUserWid)(m),E=null==e.serverTimestampMs?null:Math.floor((0,a.numberOrThrowIfTooLarge)(e.serverTimestampMs)/1e3);return(0,p.voteFromProtobuf)({voteProtobuf:i,pollVoteMsgKey:h,parentMsgKey:n.id,sender:y,senderTimestampMs:(0,a.numberOrThrowIfTooLarge)((0,o.default)(e.senderTimestampMs,"pollUpdate.senderTimestampMs")),t:E,optionLocalIdMap:r,ack:null})}catch(e){return __LOG__(4,void 0,new Error,!0)`[history sync] Failed to parse pollUpdate with error ${e}`,SEND_LOGS("parseWebMsgInfoPollUpdates-vote-parse-error"),null}})).filter(Boolean)}catch(e){return __LOG__(4,void 0,new Error,!0)`[history sync] parseWebMsgInfoPollUpdates failed with error ${null==e?void 0:e.name} and stack ${null==e?void 0:e.stack}`,SEND_LOGS("parseWebMsgInfoPollUpdates-error"),[]}}))).apply(this,arguments)}},990356:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.extractVotes=function(){return _.apply(this,arguments)};var i=r(n(348926)),a=r(n(132375)),o=n(147980),s=n(177205),l=n(823980),u=n(705769),c=n(227749),d=r(n(571834)),p=n(669050);function _(){return(_=(0,i.default)((function*(e){return(yield Promise.allSettled(Array.from(e.entries()).map((e=>{let[t,n]=e;return f(t,n)})))).map((e=>{switch(e.status){case"fulfilled":return e.value;case"rejected":const{reason:t}=e;if(t instanceof s.PollVoteValidationError)return __LOG__(4,void 0,new Error,!0)`Poll vote extraction failed: ${t.code}`,void SEND_LOGS(t.code);__LOG__(4,void 0,new Error,!0)`Poll vote extraction failed: ${t.message}\n${t.stack}`,SEND_LOGS("poll-vote-extraction-unknown-error")}})).filter(Boolean)}))).apply(this,arguments)}function f(){return h.apply(this,arguments)}function h(){return(h=(0,i.default)((function*(e,t){if(null==t.messageSecret)throw new d.default.MessageSecretErrors({messageSecretAllowedList:d.default.MESSAGE_SECRET_ALLOWED_TYPE.MESSAGE_POLL,messageSecretError:d.default.MESSAGE_SECRET_ERROR_TYPE.MISSING_MESSAGE_SECRET}).commit(),new s.PollCreationValidationError(s.PollCreationValidationErrorCode.MISSING_MESSAGE_SECRET);const n=(0,a.default)(t.messageSecret,"parentMsg.messageSecret"),r=(0,a.default)(t.pollSelectableOptionsCount,"parentMsg.pollSelectableOptionsCount"),i=(0,a.default)(t.pollOptions,"parentMsg.pollOptions"),_=(0,a.default)(e.encPollVote,"pollUpdateMsg.encPollVote");if(32!==n.byteLength)throw new d.default.MessageSecretErrors({messageSecretAllowedList:d.default.MESSAGE_SECRET_ALLOWED_TYPE.MESSAGE_POLL,messageSecretError:d.default.MESSAGE_SECRET_ERROR_TYPE.WRONG_LENGTH}).commit(),new s.PollVoteValidationError(s.PollVoteValidationErrorCode.INVALID_MESSAGE_SECRET);const f=(0,p.toUserWid)((0,o.getSender)(e)),h=yield(0,c.decryptVote)({encryptedVote:_.encPayload,iv:_.encIv,messageSecret:n,stanzaId:t.id.id,pollCreationOriginalSender:(0,o.getOriginalSender)(t),voteSender:f}),g=h.selectedOptions.length;if(g>i.length||0!==r&&g>r)throw new s.PollVoteValidationError(s.PollVoteValidationErrorCode.INVALID_OPTIONS_COUNT);if(h.selectedOptions.some((e=>32!==e.byteLength)))throw new s.PollVoteValidationError(s.PollVoteValidationErrorCode.INVALID_OPTION);const m=yield(0,l.createOptionLocalIdMap)(i);if(!m.includesHashes(h.selectedOptions))throw new s.PollVoteValidationError(s.PollVoteValidationErrorCode.OPTION_NOT_FOUND);return(0,u.voteFromProtobuf)({voteProtobuf:h,pollVoteMsgKey:e.id,parentMsgKey:(0,a.default)(e.pollUpdateParentKey,"pollUpdateMsg.pollUpdateParentKey"),sender:f,senderTimestampMs:(0,a.default)(e.senderTimestampMs,"pollUpdateMsg.senderTimestampMs"),t:(0,a.default)(e.t,"pollUpdateMsg.t"),optionLocalIdMap:m,ack:e.ack})}))).apply(this,arguments)}},471293:(e,t,n)=>{"use strict";t.Z=void 0;var r=n(373070),i=n(471751),a=n(929660);var o={type:r.MSG_TYPE.POLL_CREATION,parseProtobuf:a.parsePollCreationMessageProto,generateProtobuf:i.generatePollCreationMessageProto};t.Z=o},472748:(e,t,n)=>{"use strict";t.Z=void 0;var r=n(373070),i=n(471751),a=n(929660);var o={type:r.MSG_TYPE.POLL_UPDATE,subtype:"poll_vote",parseProtobuf:a.parsePollUpdateVoteMessageProto,generateProtobuf:i.generatePollUpdateMessageProto};t.Z=o},471751:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.generatePollCreationMessageProto=function(e){let{msgContext:t,contextInfo:n,json:r}=e;const a="quoted"===t?{name:r.pollName,options:[]}:{name:r.pollName,options:r.pollOptions.map((e=>{let{name:t}=e;return{optionName:t}})),selectableOptionsCount:r.pollSelectableOptionsCount};return{pollCreationMessage:n?(0,i.default)((0,i.default)({},a),{},{contextInfo:n}):a}},t.generatePollUpdateMessageProto=function(e){let{json:t}=e;if(!(0,o.isPollsReceivingEnabled)())return{};return{pollUpdateMessage:{pollCreationMessageKey:(0,a.encodeKey)(t.pollUpdateParentKey),vote:t.encPollVote,senderTimestampMs:t.senderTimestampMs}}};var i=r(n(81109)),a=n(523930),o=n(671598)},929660:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.parsePollCreationMessageProto=function(e){let{message:t,messageContextInfo:n,msgContext:r}=e;const{pollCreationMessage:i}=t;if(!i)return null;const a=function(e,t,n){if(!(0,l.isPollsReceivingEnabled)())return{type:s.MSG_TYPE.UNKNOWN,subtype:s.MSG_TYPE.POLL_CREATION};const{name:r,options:i,selectableOptionsCount:a}=e;if(null==r)throw new o.PollCreationValidationError(o.PollCreationValidationErrorCode.MISSING_NAME);if(0===r.length||r.length>(0,l.getMaxPollNameLengthForIncomingMessages)())throw new o.PollCreationValidationError(o.PollCreationValidationErrorCode.INVALID_NAME);if("quoted"===n)return{type:s.MSG_TYPE.POLL_CREATION,pollName:r};const c=null==t?void 0:t.messageSecret;if(null==c)throw new u.default.MessageSecretErrors({messageSecretAllowedList:u.default.MESSAGE_SECRET_ALLOWED_TYPE.MESSAGE_POLL,messageSecretError:u.default.MESSAGE_SECRET_ERROR_TYPE.MISSING_MESSAGE_SECRET}).commit(),new o.PollCreationValidationError(o.PollCreationValidationErrorCode.MISSING_MESSAGE_SECRET);if(32!==c.byteLength)throw new u.default.MessageSecretErrors({messageSecretAllowedList:u.default.MESSAGE_SECRET_ALLOWED_TYPE.MESSAGE_POLL,messageSecretError:u.default.MESSAGE_SECRET_ERROR_TYPE.WRONG_LENGTH}).commit(),new o.PollCreationValidationError(o.PollCreationValidationErrorCode.INVALID_MESSAGE_SECRET);if(null==i)throw new o.PollCreationValidationError(o.PollCreationValidationErrorCode.MISSING_OPTIONS);if(null==a)throw new o.PollCreationValidationError(o.PollCreationValidationErrorCode.MISSING_SELECTABLE_OPTIONS_COUNT);const d=new Set,p=i.map((e=>{let{optionName:t}=e;if(null==t||0===t.length||t.length>(0,l.getMaxPollOptionLengthForIncomingMessages)())throw new o.PollCreationValidationError(o.PollCreationValidationErrorCode.INVALID_OPTION);if(d.has(t))return __LOG__(3,void 0,void 0,!0,["polls"])`PollCreationValidationWarning: ${o.PollCreationValidationWarningCode.DUPLICATE_OPTIONS}`,SEND_LOGS(o.PollCreationValidationWarningCode.DUPLICATE_OPTIONS),null;const n=d.size;return d.add(t),{name:t,localId:n}})).filter(Boolean);if(p.length<2||p.length>(0,l.getMaxPollOptionCount)())throw new o.PollCreationValidationError(o.PollCreationValidationErrorCode.INVALID_OPTIONS_COUNT);if(a<0||a>p.length)throw new o.PollCreationValidationError(o.PollCreationValidationErrorCode.INVALID_SELECTABLE_OPTIONS_COUNT);return{type:s.MSG_TYPE.POLL_CREATION,pollName:r,pollOptions:p,pollSelectableOptionsCount:a}}(i,n,r);return{contextInfo:i.contextInfo,msgData:a}},t.parsePollUpdateVoteMessageProto=function(e){let{message:t,baseMessage:n}=e;const{pollUpdateMessage:r}=t;if(!r)return null;const{$$unknownFieldCount:u=0,vote:c,senderTimestampMs:d}=r;if(u>0)return null;if(!(0,l.isPollVoteProcessingEnabled)())return{msgData:{type:s.MSG_TYPE.UNKNOWN,subtype:s.MSG_TYPE.POLL_UPDATE,futureproofType:s.MSG_TYPE.POLL_UPDATE,futureproofSubtype:"poll_vote"},contextInfo:null};if(null==r.pollCreationMessageKey)throw new o.PollUpdateValidationError(o.PollUpdateValidationErrorCode.MISSING_POLL_MESSAGE_KEY);if(null==d)throw new o.PollUpdateValidationError(o.PollUpdateValidationErrorCode.MISSING_SENDER_TIMESTAMP);if(null==c)throw new o.PollUpdateValidationError(o.PollUpdateValidationErrorCode.MISSING_UPDATE);const{encPayload:p,encIv:_}=c;if(null==p)throw new o.PollUpdateValidationError(o.PollUpdateValidationErrorCode.MISSING_VOTE_ENC_PAYLOAD);if(null==_)throw new o.PollUpdateValidationError(o.PollUpdateValidationErrorCode.MISSING_VOTE_ENC_IV);if(12!==_.byteLength)throw new o.PollUpdateValidationError(o.PollUpdateValidationErrorCode.INVALID_VOTE_ENC_IV);return{msgData:{type:s.MSG_TYPE.POLL_UPDATE,subtype:"poll_vote",pollUpdateParentKey:(0,a.getMsgKey)(r.pollCreationMessageKey,n),encPollVote:{encPayload:p,encIv:_},senderTimestampMs:(0,i.numberOrThrowIfTooLarge)(d)},contextInfo:null}};var i=n(478337),a=n(523930),o=n(177205),s=n(373070),l=n(671598),u=r(n(571834))},823980:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.createOptionLocalIdMap=function(){return s.apply(this,arguments)};var i=r(n(348926)),a=n(710038),o=r(n(132375));function s(){return(s=(0,i.default)((function*(e){const t=yield Promise.all(e.map(function(){var e=(0,i.default)((function*(e){const t=yield l(e);return{hash:t,hexHash:(0,a.toHex)(new Uint8Array(t)),localId:e.localId}}));return function(){return e.apply(this,arguments)}}())),n=new Map,r=new Map;for(const{hash:e,hexHash:i,localId:a}of t)n.set(i,a),r.set(a,e);return{getLocalIdForHash:e=>(0,o.default)(n.get((0,a.toHex)(new Uint8Array(e))),"hexHashesToLocalIds.get(toHex(new Uint8Array(hash)))"),getHashForLocalId:e=>(0,o.default)(r.get(e),"localIdsToHexHashes.get(localId)"),includesHashes:e=>e.every((e=>n.has((0,a.toHex)(new Uint8Array(e)))))}}))).apply(this,arguments)}function l(e){return self.crypto.subtle.digest("SHA-256",(new TextEncoder).encode(e.name))}},331765:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getVoteKey=function(e){return`${e.parentMsgKey.toString()},${e.sender.toString()}`}},705769:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.protobufFromVote=function(){return l.apply(this,arguments)},t.voteFromProtobuf=function(e){let{voteProtobuf:t,pollVoteMsgKey:n,parentMsgKey:r,sender:i,senderTimestampMs:s,t:l,optionLocalIdMap:u,ack:c}=e;return{msgKey:n,parentMsgKey:(0,o.default)(r,"parentMsgKey"),selectedOptionLocalIds:t.selectedOptions.map(u.getLocalIdForHash),senderTimestampMs:(0,a.numberOrThrowIfTooLarge)(s),t:(0,a.maybeNumberOrThrowIfTooLarge)(l),sender:i,ack:c}};var i=r(n(348926)),a=n(478337),o=r(n(132375)),s=n(823980);function l(){return(l=(0,i.default)((function*(e,t){const n=yield(0,s.createOptionLocalIdMap)(t),r=e.selectedOptionLocalIds.map(n.getHashForLocalId);return{selectedOptions:0===r.length?null:r}}))).apply(this,arguments)}},521109:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTimestamp=function(e){return null==e.t?e.senderTimestampMs:1e3*e.t}},227749:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.decryptVote=function(){return _.apply(this,arguments)},t.encryptVote=function(){return p.apply(this,arguments)};var i=r(n(348926)),a=n(177467),o=n(722796),s=n(533494),l=r(n(571834)),u=n(574819),c=n(309512),d=n(653313);function p(){return(p=(0,i.default)((function*(e){try{const{vote:t,messageSecret:n,iv:r,stanzaId:i,pollCreationOriginalSender:l,voteSender:c}=e,p=(0,u.widToUserJid)(c),_=yield(0,o.createUseCaseSecret)({messageSecret:n,stanzaId:i,parentMsgOriginalSender:(0,u.widToUserJid)(l),modificationSender:p,modificationType:o.UseCaseSecretModificationType.POLL_VOTE}),f=(0,d.encodeProtobuf)(s.Message$PollVoteMessageSpec,t).readBuffer();return(0,a.gcmEncrypt)(_,r,f,`${i}\0${p}`)}catch(e){throw new l.default.MessageSecretErrors({messageSecretAllowedList:l.default.MESSAGE_SECRET_ALLOWED_TYPE.MESSAGE_POLL,messageSecretError:l.default.MESSAGE_SECRET_ERROR_TYPE.ENCRYPTION_ERROR}).commit(),e}}))).apply(this,arguments)}function _(){return(_=(0,i.default)((function*(e){try{const{encryptedVote:t,messageSecret:n,iv:r,stanzaId:i,pollCreationOriginalSender:l,voteSender:d}=e,p=(0,u.widToUserJid)(d),_=yield(0,o.createUseCaseSecret)({messageSecret:n,stanzaId:i,parentMsgOriginalSender:(0,u.widToUserJid)(l),modificationSender:p,modificationType:o.UseCaseSecretModificationType.POLL_VOTE}),f=yield(0,a.gcmDecrypt)(_,r,t,`${i}\0${p}`);return(0,c.decodeProtobuf)(s.Message$PollVoteMessageSpec,f)}catch(e){throw new l.default.MessageSecretErrors({messageSecretAllowedList:l.default.MESSAGE_SECRET_ALLOWED_TYPE.MESSAGE_POLL,messageSecretError:l.default.MESSAGE_SECRET_ERROR_TYPE.DECRYPTION_ERROR}).commit(),e}}))).apply(this,arguments)}},671598:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arePollsFastFollowsEnabled=o,t.getMaxPollNameLength=function(){return Math.min((0,r.getABPropConfigValue)("poll_name_length"),500)},t.getMaxPollNameLengthForIncomingMessages=function(){return 5e3},t.getMaxPollOptionCount=function(){return Math.min((0,r.getABPropConfigValue)("poll_option_count"),20)},t.getMaxPollOptionLength=function(){return Math.min((0,r.getABPropConfigValue)("poll_option_length"),255)},t.getMaxPollOptionLengthForIncomingMessages=function(){return 2500},t.isPollResultDetailsViewEnabled=function(){return(0,r.getABPropConfigValue)("poll_result_details_view_enabled")},t.isPollVoteProcessingEnabled=function(){return a()||i()||(0,r.getABPropConfigValue)("poll_vote_processing_enabled")},t.isPollsCancelationPromptEnabled=function(){return o()},t.isPollsChatlistPreviewEnabled=function(){return o()},t.isPollsCreationEnabled=i,t.isPollsCreationEnabledInOneOnOneChats=function(){return i()&&(0,r.getABPropConfigValue)("poll_creation_one_on_one_chats_enabled")},t.isPollsReceivingEnabled=a,t.isPrefillPollQuestionEnabled=function(){return o()};var r=n(287461);function i(){return(0,r.getABPropConfigValue)("poll_creation_enabled")}function a(){return!!i()||(0,r.getABPropConfigValue)("poll_receiving_enabled")}function o(){return(0,r.getABPropConfigValue)("polls_fast_follow_enabled")}},48907:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.PollVoteCollectionImpl=t.PollVoteCollection=t.GroupedPollVoteCollection=void 0,t.createPollVoteModel=function(e){return new s.PollVote((0,i.default)({id:c(e.msgKey)},e))};var i=r(n(81109)),a=r(n(132375)),o=n(594534),s=n(596715);class l extends o.BaseCollection{getVoteFromSender(e){return this.findFirst((t=>t.sender.equals(e)))}}t.GroupedPollVoteCollection=l,l.model=s.PollVote;class u extends o.BaseCollection{constructor(){super(...arguments),this._parentMsgKeyToCollection=new Map}add(e,t){const n=super.add(e,t),r=p(n.filter(Boolean));for(const[e,t]of r)this.getForParent(e).add(t);return n}remove(e,t){const n=super.remove(e,t),r=p(n.filter(Boolean));for(const[e,t]of r)this.getForParent(e).remove(t);return n}reset(){super.reset();for(const e of this._parentMsgKeyToCollection.values())e.reset();this._parentMsgKeyToCollection.clear()}getForParent(e){let t=this._parentMsgKeyToCollection.get(e.toString());return null==t&&(t=new l,t.add(this.filter((t=>t.parentMsgKey.equals(e)))),this._parentMsgKeyToCollection.set(e.toString(),t)),t}getByMsgKey(e){return this.get(c(e))}}function c(e){return`!!${e.toString()}`}t.PollVoteCollectionImpl=u,u.model=s.PollVote;const d=new u;function p(e){const t=new Map;return e?(e.forEach((e=>{const n=e.parentMsgKey;t.has(n)||t.set(n,[]),(0,a.default)(t.get(n),"parentKeyToVotes.get(key)").push(e)})),t):t}t.PollVoteCollection=d},596715:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.PollVote=void 0;var i=r(n(132375)),a=n(402994),o=n(552112),s=n(54918),l=n(121977),u=n(521109),c=n(459857);class d extends o.AddOnBaseModel{constructor(){super(...arguments),this.id=(0,s.prop)(),this.msgKey=(0,s.prop)(),this.parentMsgKey=(0,s.prop)(),this.selectedOptionLocalIds=(0,s.prop)(),this.senderTimestampMs=(0,s.prop)(),this.t=(0,s.prop)(),this.sender=(0,s.prop)(),this.parentMsg=(0,s.derived)((function(){var e;const{MsgCollection:t}=n(301460);return(0,i.default)(null===(e=t.get(this.parentMsgKey))||void 0===e?void 0:e.asPollCreation,"MsgCollection.get(this.parentMsgKey)?.asPollCreation")})),this.senderObj=(0,s.derived)((function(){return l.ContactCollection.gadd(this.sender)})),this.isUnvote=(0,s.derived)((function(){return 0===this.selectedOptionLocalIds.length}),["selectedOptionLocalIds"]),this.isFailed=(0,s.derived)((function(){return(0,c.isMeAccount)(this.sender)&&null!=this.ack&&this.ack<a.ACK.CLOCK||Boolean(this.isSendFailure)}),["ack","isSendFailure"]),this.timestamp=(0,s.derived)((function(){return(0,u.getTimestamp)(this)}),["t","senderTimestampMs"])}getData(){return{msgKey:this.msgKey,parentMsgKey:this.parentMsgKey,selectedOptionLocalIds:this.selectedOptionLocalIds,senderTimestampMs:this.senderTimestampMs,t:this.t,sender:this.sender,ack:this.ack}}}d.Proxy="poll_vote";const p=(0,s.defineModel)(d);t.PollVote=p},475726:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getParentMessages=function(){return l.apply(this,arguments)};var i=r(n(348926)),a=r(n(132375)),o=n(484777),s=n(373070);function l(){return(l=(0,i.default)((function*(e){const t=new Set(e.map(u)),n=yield(0,o.getMsgsByMsgKey)(Array.from(t)),r=new Map(n.map((e=>[e.id.toString(),e]))),i=new Map,a=[];for(const t of e){const e=r.get(u(t));null==e||e.type===s.MSG_TYPE.UNKNOWN?a.push(t):i.set(t,e)}return{pollUpdateMsgsToParentMsgs:i,orphans:a}}))).apply(this,arguments)}function u(e){return(0,a.default)(e.pollUpdateParentKey,"pollUpdateMsgData.pollUpdateParentKey").toString()}},203829:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.invalidateChatPolls=function(e){return(0,o.getStorage)().lock(["message"],function(){var t=(0,i.default)((function*(t){let[n]=t;const r=yield n.between(["internalId"],(0,a.beginningOfChat)(e),(0,a.endOfChat)(e));yield n.bulkCreateOrMerge(r.filter((e=>e.type===s.MSG_TYPE.POLL_CREATION&&!e.pollInvalidated)).map((e=>({id:e.id,pollInvalidated:!0}))))}));return function(){return t.apply(this,arguments)}}())};var i=r(n(348926)),a=n(878685),o=n(605316),s=n(373070)},479261:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.upsertVotes=function(e){const t=(0,a.maxPerGroup)(e,(e=>e.senderTimestampMs),l.getVoteKey);return(0,o.getStorage)().lock(["poll-votes"],function(){var e=(0,i.default)((function*(e){let[n]=e;const r=yield n.anyOf(["parentMsgKey","sender"],t.map((e=>[e.parentMsgKey.toString(),e.sender.toString()]))),i=new Map;for(const e of r)i.set((0,l.getVoteKey)(e),e);const a=t.filter((e=>{const t=i.get((0,l.getVoteKey)(e));return null==t||e.senderTimestampMs>=t.senderTimestampMs}));0!==a.length&&(yield n.bulkCreateOrReplace(a.map(s.dbRowFromVote)))}));return function(){return e.apply(this,arguments)}}())};var i=r(n(348926)),a=n(976885),o=n(605316),s=n(125167),l=n(331765)},125167:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.dbRowFromVote=function(e){const t={msgKey:e.msgKey.toString(),parentMsgKey:e.parentMsgKey.toString(),selectedOptionLocalIds:new Uint8Array(e.selectedOptionLocalIds).buffer,senderTimestampMs:e.senderTimestampMs,sender:e.sender.toString()};null!=e.t&&(t.t=e.t);null!=e.ack&&(t.ack=e.ack);return t},t.voteFromDbRow=function(e){return{msgKey:i.default.fromString(e.msgKey),parentMsgKey:i.default.fromString(e.parentMsgKey),selectedOptionLocalIds:Array.from(new Uint8Array(e.selectedOptionLocalIds)),senderTimestampMs:e.senderTimestampMs,t:e.t,sender:(0,a.createUserWid)(e.sender),ack:e.ack}};var i=r(n(565754)),a=n(669050)},816990:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("poll-votes").version((0,a.pollVotesCreateTable)(),[new u.default(["parentMsgKey","sender"]),new o.default("msgKey"),new l.default("parentMsgKey"),new s.AddEncryptedColumn("selectedOptionLocalIds",s.ENCRYPTED_VALUE_TYPE.ARRAY_BUFFER),new o.default("senderTimestampMs"),new o.default("ack"),new o.default("t")]).version((0,a.pollVotesAddMsgKeyIndex)(),[new l.default("msgKey")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("poll-votes")};var i=n(605316),a=n(526456),o=r(n(372407)),s=n(345632),l=r(n(599395)),u=r(n(277631))},921698:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.processRecentStickers=function(e,t){if(null==e.recentStickers)return void __LOG__(3)`Recent Stickers: received empty recentStickers protobuf`;if((0,o.getABPropConfigValue)("recent_sticker_rollout_phase")<3)return void(0,u.setNonCriticalDataSyncStatus)({[c.NON_CRITIAL_DATA_SYNC_STATUS_TYPE.RECENT_STICKER_INITIALIZED]:c.RECENT_STICKER_INITIALIZED_STATUS_TYPE.NEED_REQUEST_BOOTSTRAP});__LOG__(2)`Recent Stickers: processing recent stickers from history. total of ${e.recentStickers.length} stickers received.`;const d=e.recentStickers.map((e=>{var t;const n=e.fileSha256;if(null==n)return __LOG__(3)`Recent Stickers: Got an empty filehash from initial sticker history`,null;const o=e.fileEncSha256,s=e.mediaKey;return null!=o&&null!=s||__LOG__(2)`Recent Stickers: Got an empty fileEncSha256 or mediaKey from initial sticker history`,[{id:(0,r.encodeB64)(n),directPath:e.directPath,filehash:(0,r.encodeB64)(n),encFilehash:null!=o?(0,r.encodeB64)(o):null,mediaKey:null!=s?(0,r.encodeB64)(s):"",mediaKeyTimestamp:(0,a.unixTime)(),width:e.width,height:e.height,mimetype:e.mimetype,type:l.OUTWARD_TYPES.STICKER,index:0,weight:e.weight},null!==(t=(0,i.maybeNumberOrThrowIfTooLarge)(e.lastStickerSentTs))&&void 0!==t?t:0,null]})).filter(Boolean);__LOG__(2)`Recent Stickers: ${d.length} stickers need to be added after sticker construction.`;n(951220).RecentStickerCollectionMd.replaceAndEnqueue(d,!0),(0,u.setNonCriticalDataSyncStatus)({[c.NON_CRITIAL_DATA_SYNC_STATUS_TYPE.RECENT_STICKER_INITIALIZED]:c.RECENT_STICKER_INITIALIZED_STATUS_TYPE.SUCCESS}),__LOG__(2)`[History sync] Recent Stickers completed, ${(0,s.getHistorySyncLogDebugString)(t)}`};var r=n(417405),i=n(478337),a=n(990445),o=n(287461),s=n(889877),l=n(172259),u=n(673168),c=n(128378)},142202:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.handleUploadStickerPeerDataOperationRequest=function(){return S.apply(this,arguments)},t.handleUploadStickerPeerDataOperationRequestResponse=function(e,t){if(0===t.length)return void(0,p.logNonMessagePeerDataResponse)(f.Message$PeerDataOperationRequestType.UPLOAD_STICKER,e,0,0,0,0,0);const n=t.length;let r=0,i=0,s=0,l=0;const c=new Map;t.forEach((e=>{e.mediaUploadResult===h.MediaRetryNotification$ResultType.SUCCESS?r++:e.mediaUploadResult===h.MediaRetryNotification$ResultType.NOT_FOUND?l++:s++;const t=e.stickerMessage;if(null==t)return void __LOG__(2)`non-message data request: get null as stickerMessage in result`;const{fileSha256:n,fileEncSha256:d,mediaKey:p,directPath:f,mediaKeyTimestamp:m}=t;if(null==n)return void __LOG__(2)`non-message data request: get null as fileSha256 in result`;const E=(0,a.encodeB64)(n);if(e.mediaUploadResult!==h.MediaRetryNotification$ResultType.SUCCESS)return __LOG__(2)`non message data request: the mediaUploadResult ${e.mediaUploadResult} is not success`,void(e.mediaUploadResult!==h.MediaRetryNotification$ResultType.NOT_FOUND&&c.set(E,(0,o.default)(e.mediaUploadResult,"result.mediaUploadResult")));if(null==d||null==p)return void __LOG__(2)`non-message data request: get null as media fields in result`;i++;const S=g.RecentStickerCollectionMd.get(E),T=u.default.get(E);if(_.inFlightStickerRequests.has(E)&&_.inFlightStickerRequests.delete(E),S||T){var v;const e=null!=S?S.sticker:(0,o.default)(T,"existingStickerInFavorite").sticker;if(f===e.directPath&&(0,a.encodeB64)(d)===e.encFilehash&&(0,a.encodeB64)(p)===e.mediaKey)return;var A,C;if(null===(v=e.mediaObject)||void 0===v?void 0:v.entries.entries)null===(A=e.mediaObject)||void 0===A||null===(C=A.entries)||void 0===C||C.clearEntries();const t=new y.StickerModel({id:e.filehash,directPath:null!=f?f:e.directPath,filehash:e.filehash,encFilehash:(0,a.encodeB64)(d),mediaKey:(0,a.encodeB64)(p),mediaKeyTimestamp:null!=m?Number(m):e.mediaKeyTimestamp,width:e.width,height:e.height,size:e.size,mimetype:e.mimetype,type:e.type,index:0});S&&g.RecentStickerCollectionMd.updateRecentStickerWithNewSticker(E,t),T&&u.default.updateFavoriteStickerWithNewSticker(E,t)}})),(0,_.insertResponseError)(c,f.Message$PeerDataOperationRequestType.UPLOAD_STICKER),(0,p.logNonMessagePeerDataResponse)(f.Message$PeerDataOperationRequestType.UPLOAD_STICKER,e,n,r,i,s,l)};var i=r(n(348926)),a=n(417405),o=r(n(132375)),s=n(990445),l=r(n(507511)),u=r(n(788788)),c=n(709089),d=n(97858),p=n(758771),_=n(734173),f=n(533494),h=n(229479),g=n(951220),m=n(152413),y=n(164832),E=r(n(571834));function S(){return(S=(0,i.default)((function*(e,t){if(!(0,d.isStickerRmrSyncEnabled)())return;const n=t.length;let r=0,i=0,g=0,S=0;const T=(0,s.unixTime)(),v=[],A=t.map((e=>{const t=e.fileSha256;if(null==t)return g++,void v.push({mediaUploadResult:h.MediaRetryNotification$ResultType.GENERAL_ERROR});const n=u.default.get(t);return null==n?(S++,void v.push({mediaUploadResult:h.MediaRetryNotification$ResultType.NOT_FOUND,stickerMessage:{fileSha256:(0,a.decodeB64)(t)}})):n})).filter((e=>null!=e)),C=new Set,P=A.map((e=>{const t=(0,o.default)(null==e?void 0:e.sticker,"favoriteSticker?.sticker"),n=t.mediaObject;if(null==n)return{kind:c.UploadMediaResultKind.ERROR};if((0,_.shouldSkipMediaUploadWithSuccess)(t.filehash,f.Message$PeerDataOperationRequestType.UPLOAD_STICKER,T)){const e=n.entries.getDownloadEntry();if(null!=e)return i++,C.add(t.filehash),{kind:c.UploadMediaResultKind.SUCCESS,mediaEntry:e}}if((0,_.shouldSkipMediaUploadWithCancellation)(t.filehash,f.Message$PeerDataOperationRequestType.UPLOAD_STICKER,T))return C.add(t.filehash),{kind:c.UploadMediaResultKind.CANCELLATION};const r=n.entries.getUploadEntry(),a=r?{key:r.mediaKey,timestamp:r.mediaKeyTimestamp}:(0,l.default)();return(0,c.uploadMedia)({mimetype:t.mimetype,mediaObject:n,mediaType:"sticker",forwardedFromWeb:!1,uploadOrigin:E.default.UPLOAD_ORIGIN_TYPE.STICKER_WEB,mediaKeyInfo:a,isViewOnce:!0})})),O=yield Promise.all(P),I=new Map;for(let e=0;e<O.length;e++){var M,b;const{kind:t,mediaEntry:n}=O[e],i=(0,o.default)(A[e],"favoriteStickers[i]"),s=(0,o.default)(null==i?void 0:i.sticker,"favoriteSticker?.sticker");if(t===c.UploadMediaResultKind.SUCCESS&&null!=n){if(r++,!C.has(s.filehash)){var R,N,w;if(null===(R=s.mediaObject)||void 0===R?void 0:R.entries.entries)null===(N=s.mediaObject)||void 0===N||null===(w=N.entries)||void 0===w||w.clearEntries();const e=new y.StickerModel({id:s.filehash,directPath:n.directPath,filehash:s.filehash,encFilehash:n.encFilehash,mediaKey:n.mediaKey,mediaKeyTimestamp:n.mediaKeyTimestamp,width:s.width,height:s.height,size:s.size,mimetype:s.mimetype,type:s.type,index:0});u.default.updateFavoriteStickerWithNewSticker(s.filehash,e),I.set(s.filehash,t)}v.push({mediaUploadResult:h.MediaRetryNotification$ResultType.SUCCESS,stickerMessage:{fileSha256:(0,a.decodeB64)(s.filehash),fileEncSha256:(0,a.decodeB64)(null!==(M=n.encFilehash)&&void 0!==M?M:""),mediaKey:(0,a.decodeB64)(n.mediaKey),mimetype:s.mimetype,height:s.height,width:s.width,directPath:null!==(b=n.directPath)&&void 0!==b?b:"",mediaKeyTimestamp:n.mediaKeyTimestamp}})}else g++,v.push({mediaUploadResult:h.MediaRetryNotification$ResultType.GENERAL_ERROR,stickerMessage:{fileSha256:(0,a.decodeB64)(s.filehash)}}),C.has(s.filehash)||I.set(s.filehash,t)}(0,m.sendPeerDataOperationRequestResponseMessage)(e,f.Message$PeerDataOperationRequestType.UPLOAD_STICKER,v),(0,_.insertMediaUploadResult)(I,T),(0,p.logMediaUpload)(f.Message$PeerDataOperationRequestType.UPLOAD_STICKER,e,n,r,i,g,S)}))).apply(this,arguments)}},932444:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(417405),o=n(819416),s=n(616310),l=n(715739),u=n(94439),c=n(797666),d=n(155172),p=r(n(788788)),_=n(97858),f=n(164832);class h extends u.SyncActionBase{constructor(){super(...arguments),this.version=7,this.action=d.Actions.FavoriteSticker}applyMutations(e){return(0,i.default)((function*(){if(!(0,_.isFavoriteStickersEnabled)())return __LOG__(3)`syncd: favorite sticker sync operation not supported`,e.map((()=>({actionState:d.SyncActionState.Unsupported})));return e.map((e=>{try{if("set"!==e.operation)return __LOG__(3)`syncd: favorite sticker sync: operation not supported`,{actionState:d.SyncActionState.Unsupported};const{indexParts:t,value:n,timestamp:r}=e,[,i]=t;if(!i)return{actionState:d.SyncActionState.Malformed};const o=n.stickerAction;if(null==o)return __LOG__(3)`syncd: favorite sticker sync: malformed mutation`,{actionState:d.SyncActionState.Malformed};const{fileEncSha256:s,mediaKey:l,mimetype:u,height:c,width:_,directPath:h,isFavorite:g,deviceIdHint:m}=o;if(null==g)return __LOG__(3)`syncd: favorite sticker sync: malformed mutation`,{actionState:d.SyncActionState.Malformed};if(g){if(p.default.get(i))return __LOG__(3)`syncd: favorite sticker sync: skipping adding recent sticker since it has been added`,{actionState:d.SyncActionState.Success};const e=new f.StickerModel({id:i,directPath:h,filehash:i,encFilehash:s?(0,a.encodeB64)(s):"",mediaKey:null!=l?(0,a.encodeB64)(l):"",mediaKeyTimestamp:r,width:_,height:c,mimetype:u});p.default.addOrUpdateStickers([e],r,m)}else{if(!p.default.get(i))return{actionState:d.SyncActionState.Success};p.default.removeAndSave(i)}return{actionState:d.SyncActionState.Success}}catch(e){return{actionState:d.SyncActionState.Failed}}}))}))()}generateFavoriteSyncMutation(e,t,n){var r,i;const u={stickerAction:{fileEncSha256:(0,a.decodeB64)(null!==(r=e.encFilehash)&&void 0!==r?r:""),mediaKey:(0,a.decodeB64)(null!==(i=e.mediaKey)&&void 0!==i?i:""),mimetype:e.mimetype,height:e.height,width:e.width,directPath:null!=e.directPath?e.directPath:void 0,isFavorite:t,deviceIdHint:(0,s.interpretAsNumber)((0,s.extractDeviceId)((0,o.getMyDeviceJid)()))}};return(0,c.buildPendingMutation)({collection:d.CollectionName.RegularLow,indexArgs:[e.filehash],operation:l.SyncdMutation$SyncdOperation.SET,version:this.version,value:u,timestamp:n,action:this.action})}}const g=new h;Object.freeze(g);var m=g;t.default=m},102997:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(478337),o=n(715739),s=n(94439),l=n(797666),u=n(155172),c=n(990445),d=n(97858);class p extends s.SyncActionBase{constructor(){super(...arguments),this.version=7,this.action=u.Actions.RemoveRecentSticker}applyMutations(e){return(0,i.default)((function*(){return(0,d.isRecentStickersMDEnabled)()?e.map((e=>{var t;if("set"!==e.operation)return __LOG__(3)`syncd: remove recent sticker sync: operation not supported`,{actionState:u.SyncActionState.Unsupported};const[,r]=e.indexParts;if(null==r)return __LOG__(3)`syncd: no sticker hash provided`,{actionState:u.SyncActionState.Malformed};const i=null===(t=e.value.removeRecentStickerAction)||void 0===t?void 0:t.lastStickerSentTs,o=n(951220).RecentStickerCollectionMd,s=o.get(r);if(!s)return{actionState:u.SyncActionState.Orphan};const l=(0,a.maybeNumberOrThrowIfTooLarge)(i);return(null==l||(0,a.numberOrThrowIfTooLarge)(s.timestamp)<=l)&&o.removeAndSave(s),{actionState:u.SyncActionState.Success}})):(__LOG__(3)`syncd: remove recent sticker operation not supported`,e.map((()=>({actionState:u.SyncActionState.Unsupported}))))}))()}generateRemoveStickerMutation(e){const t=(0,c.unixTimeMs)(),n={removeRecentStickerAction:{lastStickerSentTs:e.timestamp}};return(0,l.buildPendingMutation)({collection:u.CollectionName.RegularLow,indexArgs:[e.sticker.filehash],operation:o.SyncdMutation$SyncdOperation.SET,version:this.version,value:n,timestamp:t,action:this.action})}}const _=new p;Object.freeze(_);var f=_;t.default=f},937715:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.fetchFirstPartyStickerPack=function(){return E.apply(this,arguments)},t.fetchFirstPartyStickerPacks=function(){return y.apply(this,arguments)};var i=r(n(348926)),a=r(n(932325)),o=n(486392),s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=_(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),l=r(n(219368)),u=r(n(665810)),c=r(n(79291)),d=n(459857),p=r(n(571834));function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(_=function(e){return e?n:t})(e)}const f="https://static.whatsapp.net/sticker";function h(){return g.apply(this,arguments)}function g(){return(g=(0,i.default)((function*(e,t){const n=c.default.build(f,e),r=new p.default.StickerCommonQueryToStaticServer;r.startQueryLatencyMs();const i=yield(0,l.default)(n,{signal:t.signal});if(r.markQueryLatencyMs(),r.set({httpResponseCode:i.status,params:new u.default(e).toString(),queryType:p.default.QUERY_TYPE.STICKER_PACK_DATA}),r.commit(),!i.ok)throw new s.InvalidServerResponseError(n,i.status.toString(),"Invalid response from WhatsApp stickers endpoint");const a=yield i.json();if(null==a||0===a.length)throw new s.InvalidServerResponseError(n,i.status.toString(),`Invalid response from WhatsApp stickers endpoint: ${JSON.stringify(a)}`);return a}))).apply(this,arguments)}function m(e,t){const n={id:e["sticker-pack-id"],name:e.name,publisher:e.publisher,description:e.description,fileSize:Number(e["file-size"]),imageDataHash:e["image-data-hash"],animated:1===e.animated,previewImageIds:e["preview-image-ids"],trayImageId:e["tray-image-id"],trayImagePreview:e["tray-image-preview"]};return null!=t&&(n.index=t),n}function y(){return(y=(0,i.default)((function*(e){var t;const n=a.default.getLocale(),r=(0,o.getCountryShortcodeByPhone)(null===(t=(0,d.getMaybeMeUser)())||void 0===t?void 0:t.user)||"default";return(yield h({cat:"sticker_store_data",id:"all",lg:n,country:r},{signal:e.signal})).map(((e,t)=>m(e,t)))}))).apply(this,arguments)}function E(){return(E=(0,i.default)((function*(e){const t=a.default.getLocale(),n={cat:"sticker_pack_data",id:e.id,lg:t};return m((yield h(n,{signal:e.signal}))[0])}))).apply(this,arguments)}},65754:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.fetchFirstPartyStickers=function(){return _.apply(this,arguments)};var i=r(n(348926)),a=r(n(932325)),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=d(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),s=r(n(219368)),l=r(n(665810)),u=r(n(79291)),c=r(n(571834));function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(d=function(e){return e?n:t})(e)}const p="https://static.whatsapp.net/sticker";function _(){return(_=(0,i.default)((function*(e,t){const n={cat:"sticker_pack_data",id:e,lg:a.default.getLocale()},r=u.default.build(p,n),i=new c.default.StickerCommonQueryToStaticServer;i.startQueryLatencyMs();const d=yield(0,s.default)(r,{signal:null==t?void 0:t.signal});if(i.markQueryLatencyMs(),i.set({httpResponseCode:d.status,params:new l.default(n).toString(),queryType:c.default.QUERY_TYPE.STICKER_PACK_DATA}),i.commit(),!d.ok)throw new o.InvalidServerResponseError(r,d.status.toString(),"Invalid response from WhatsApp stickers endpoint");const _=yield d.json();if(null==_||0===_.length)throw new o.InvalidServerResponseError(r,d.status.toString(),`Invalid response from WhatsApp stickers endpoint: ${JSON.stringify(_)}`);return _[0].stickers.map(((e,t)=>({mimetype:e.mimetype,width:e.width,height:e.height,index:t,filehash:e["file-hash"],directPath:e["direct-path"],mediaKey:e["media-key"],id:e["file-hash"],deprecatedMms3Url:e.url,encFilehash:e["enc-file-hash"],mediaKeyTimestamp:0})))}))).apply(this,arguments)}},955851:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.searchFirstPartyStickers=function(){return g.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(486392),s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=f(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),l=r(n(219368)),u=r(n(665810)),c=n(164832),d=r(n(79291)),p=n(459857),_=r(n(571834));function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(f=function(e){return e?n:t})(e)}const h="https://static.whatsapp.net/sticker";function g(){return(g=(0,a.default)((function*(e,t){var n;const r=(0,o.getCountryShortcodeByPhone)(null===(n=(0,p.getMaybeMeUser)())||void 0===n?void 0:n.user)||"default";let a=0,f=0;for(;a<=250;)a+=3+encodeURIComponent(e[f++]).length;const g=e.slice(0,f-1).join(","),m={country:r},y=d.default.build(h,(0,i.default)({cat:"sticker_search",terms:g},m)),E=new _.default.StickerCommonQueryToStaticServer;E.startQueryLatencyMs();const S=yield(0,l.default)(y,{signal:null==t?void 0:t.signal});if(E.markQueryLatencyMs(),E.set({httpResponseCode:S.status,params:new u.default(m).toString(),queryType:_.default.QUERY_TYPE.STICKER_SEARCH}),E.commit(),!S.ok)throw new s.InvalidServerResponseError(y,S.status.toString(),"Invalid response from WhatsApp stickers endpoint");const T=yield S.json();if(null==T)throw new s.InvalidServerResponseError(y,S.status.toString(),`Invalid response from WhatsApp stickers endpoint: ${JSON.stringify(T)}`);return T.map(((e,t)=>new c.StickerModel({mimetype:e.mimetype,width:e.width,height:e.height,filehash:e["file-hash"],directPath:e["direct-path"],mediaKey:e["media-key"],id:e["file-hash"],encFilehash:e["enc-file-hash"],mediaKeyTimestamp:0,index:t})))}))).apply(this,arguments)}},788788:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(819416),o=n(616310),s=n(594534),l=r(n(43085)),u=n(806279),c=n(719621),d=n(76469),p=n(164832),_=r(n(608938));class f extends s.BaseCollection{constructor(){super(...arguments),this._hasInitializedFromCache=!1}_comparator(e,t){return e.timestamp<t.timestamp?1:-1}_addSaveTask(){this._idleTaskId&&u.IdleCallbackTasks.isInQueue(this._idleTaskId)||(this._idleTaskId=u.IdleCallbackTasks.enqueue((()=>{this._saveToDb()})))}_saveToDb(){var e=this;return(0,i.default)((function*(){const t=e.toArray().map((e=>{const t=e.sticker.toDbData();return{id:e.id,timestamp:e.timestamp,sticker:{index:t.index,width:t.width,height:t.height,size:t.size,mimetype:t.mimetype,filehash:t.filehash,directPath:t.directPath,mediaKey:t.mediaKey,mediaKeyTimestamp:t.mediaKeyTimestamp,encFilehash:t.encFilehash,deprecatedMms3Url:t.deprecatedMms3Url,type:"sticker"},stickerHashWithoutMeta:e.stickerHashWithoutMeta,isFavorite:e.isFavorite,deviceId:e.deviceId}}));__LOG__(2)`Favorite Stickers: need to save stickers in DB with length: ${t.length}`;try{const e=(0,d.getFavoriteStickersTable)();let n=yield e.count();__LOG__(2)`Favorite Stickers: before save, stickers in DB with length: ${n}`,yield e.clear(),yield e.bulkCreateOrReplace(t),n=yield e.count(),__LOG__(2)`Favorite Stickers: after save, stickers in DB with length: ${n}`}catch(e){__LOG__(4,void 0,new Error,!0)`FavoriteStickerCollection attempt to save to database failed`,SEND_LOGS(e)}}))()}_dbDataToModel(e){return new l.default({id:e.id,timestamp:e.timestamp,stickerHashWithoutMeta:e.stickerHashWithoutMeta,sticker:new p.StickerModel(e.sticker)})}_getStickerHashWithoutMeta(e){return(0,i.default)((function*(){const t=yield c.LruMediaStore.get(e);return null==t?e:(0,_.default)(t)}))()}addOrUpdateStickers(e,t){var n=this;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(0,o.interpretAsNumber)((0,o.extractDeviceId)((0,a.getMyDeviceJid)()));return(0,i.default)((function*(){const a=e.filter((e=>!n.get(e.id)));if(__LOG__(2)`Favorite Stickers: length of stickers will be enqueued: ${e.length}`,0===a.length)return;const o=yield Promise.all(a.map(function(){var e=(0,i.default)((function*(e){return new l.default({id:e.filehash,sticker:e,stickerHashWithoutMeta:yield n._getStickerHashWithoutMeta(e.filehash),timestamp:t,isFavorite:!0,deviceId:r})}));return function(){return e.apply(this,arguments)}}()));n.addAndSort(o),n._hasInitializedFromCache&&(__LOG__(2)`Favorite Stickers: need to save collection to DB.`,n._addSaveTask())}))()}addAndSort(e){this.add(e),this.sort()}removeAndSave(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.remove(e,t);return n.length&&this._addSaveTask(),n}initializeFromCache(e){__LOG__(2)`Favorite Stickers: need to initialize stickers from DB with length: ${e.length}`;const t=e.map((e=>this._dbDataToModel(e)));this.addAndSort(t);const n=this.toArray();if(n.length>0){const e=new Set(t.map((e=>e.id)));n.some((t=>!e.has(t)))&&this._addSaveTask()}this._hasInitializedFromCache=!0}updateFavoriteStickerWithNewSticker(e,t){const n=this.get(e);null!=n&&(n.sticker=new p.StickerModel(t),this.set([n],{remove:!1,add:!1,silent:!0,sort:!1}),this._addSaveTask())}}f.model=l.default;var h=new f;t.default=h},43085:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(54918);class i extends r.BaseModel{constructor(){super(...arguments),this.id=(0,r.prop)(),this.sticker=(0,r.prop)(),this.timestamp=(0,r.prop)(),this.stickerHashWithoutMeta=(0,r.prop)(),this.isFavorite=(0,r.prop)(),this.deviceId=(0,r.prop)()}}i.Proxy="favoriteSticker";var a=(0,r.defineModel)(i);t.default=a},647912:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.RecentStickerCollectionImpl=t.RecentStickerCollection=t.RECENT_STICKERS_LIMIT=void 0;var i=r(n(348926)),a=r(n(132375)),o=n(594534),s=n(266888),l=n(97858),u=n(828770),c=n(164832);const d=32;t.RECENT_STICKERS_LIMIT=d;class p extends o.BaseCollection{constructor(){super(...arguments),this._checksum="",this._syncStatus="NONE",this._weightMap=new Map,this._sortTrimScale=()=>{const e=this.length;if(!e)return;if(this.sort(),e>d){for(let t=d;t<e;t++)this._weightMap.delete((0,a.default)(this.at(t),"this.at(i)").id);this.remove(this.slice(d))}const t=this.head(),n=this.last();t&&n&&this._getWeight(t)<10&&this._getWeight(n)>.01||this.forEach(((t,n)=>{this._weightMap.set(t.id,1+(e-n)/e*3)}))}}_comparator(e,t){return s.Conn.platform===u.PLATFORMS.ANDROID?this._getWeight(t)-this._getWeight(e):e.index>t.index?1:-1}_getWeight(e){return(0,a.default)(this._weightMap.get(e.id),"this._weightMap.get(sticker.id)")}_findQuery(){return(0,l.isRecentStickersEnabled)()?Promise.reject(new Error("This call is only supported in non-MD mode")):Promise.reject(new Error("gk recent sticker sync unsupported"))}enqueue(e){(0,l.isRecentStickersEnabled)()&&0!==e.length&&(s.Conn.platform===u.PLATFORMS.ANDROID?this._enqueueAndroid(e):this._enqueueiOS(e))}addStickerWithMediaData(e){const t=new c.StickerModel(e);t.id||(t.id=t.filehash),this.enqueue([t])}_enqueueAndroid(e){e.forEach((e=>{this.get(e.id)||(this._weightMap.set(e.id,0),this.add(e)),this.forEach((t=>{let n=this._getWeight(t);t.id===e.id?n+=1:n*=.9,this._weightMap.set(t.id,Math.round(1e3*n)/1e3)}))})),this._sortTrimScale()}_enqueueiOS(e){this.forEach(((e,t)=>{e.index=d+t}));const t=new Set(e.map((e=>e.id)));e.reduce(((e,n)=>t.has(n.id)?(t.delete(n.id),[n].concat(e)):e),[]).slice(0,d).forEach(((e,t)=>{const n=this.get(e.id);n?n.index=t:this.add({id:e.id,deprecatedMms3Url:e.deprecatedMms3Url,directPath:e.directPath,filehash:e.filehash,encFilehash:e.encFilehash,mediaKey:e.mediaKey,mediaKeyTimestamp:e.mediaKeyTimestamp,width:e.width,height:e.height,size:e.size,mimetype:e.mimetype,type:e.type,index:t})})),this.sort(),this.remove(this.slice(d))}setChecksum(e){this._checksum=e}sync(e){var t=this;return(0,i.default)((function*(){(0,l.isRecentStickersEnabled)()&&(null!=e&&e===t._checksum||(yield t._sync()))}))()}_sync(){var e=this;return(0,i.default)((function*(){if("INPROGRESS"!==e._syncStatus){e._syncStatus="INPROGRESS";try{yield e.findQuery({},{set:!0}),e.sort(),e._syncStatus="SUCCESS"}catch(t){__LOG__(3)`collection:recent_sticker:_sync error `,e._syncStatus="FAILURE"}}}))()}isSynced(){return"SUCCESS"===this._syncStatus||"FAILURE"===this._syncStatus}reset(){return this._syncStatus="NONE",this._weightMap.clear(),super.reset()}}t.RecentStickerCollectionImpl=p,p.model=c.StickerModel;const _=new p;t.RecentStickerCollection=_},951220:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.RecentStickerCollectionMd=t.RecentStickerCollection=t.RECENT_STICKERS_LIMIT=void 0;var i=r(n(348926)),a=n(990445),o=n(594534),s=n(806279),l=n(231385),u=n(76469),c=n(301460),d=r(n(389779)),p=n(164832);t.RECENT_STICKERS_LIMIT=32;class _ extends o.BaseCollection{constructor(){super(...arguments),this._hasInitializedFromCache=!1}_comparator(e,t){return e.weight!==t.weight?e.weight<t.weight?1:-1:e.timestamp<t.timestamp?1:-1}_dbDataToModel(e){var t;return new d.default({id:e.id,timestamp:e.timestamp,msgId:e.msgId,sticker:new p.StickerModel(e.sticker),weight:null!==(t=e.weight)&&void 0!==t?t:1,isNewSticker:e.isNewSticker})}_addSaveTask(){this._idleTaskId&&s.IdleCallbackTasks.isInQueue(this._idleTaskId)||(this._idleTaskId=s.IdleCallbackTasks.enqueue((()=>{this._saveToDb()})))}_saveToDb(){var e=this;return(0,i.default)((function*(){const t=e.toArray().map((e=>{const t=e.sticker.toDbData();return{id:e.id,timestamp:e.timestamp,msgId:e.msgId,weight:e.weight,sticker:{id:t.id,index:t.index,width:t.width,height:t.height,size:t.size,mimetype:t.mimetype,filehash:t.filehash,directPath:t.directPath,mediaKey:t.mediaKey,mediaKeyTimestamp:t.mediaKeyTimestamp,encFilehash:t.encFilehash,deprecatedMms3Url:t.deprecatedMms3Url,type:"sticker"}}}));__LOG__(2)`Recent Stickers: need to save stickers in DB with length: ${t.length}`;try{const e=(0,u.getRecentStickersTable)();let n=yield e.count();__LOG__(2)`Recent Stickers: before save, stickers in DB with length: ${n}`,yield e.clear(),yield e.bulkCreateOrReplace(t),n=yield e.count(),__LOG__(2)`Recent Stickers: after save, stickers in DB with length: ${n}`}catch(e){__LOG__(4,void 0,new Error,!0)`RecentStickerCollection attempt to save to database failed`,SEND_LOGS(e)}}))()}addStickerWithMediaData(e,t,n){this.addNewSticker(new p.StickerModel(e),t,n)}addNewSticker(e,t,n){e.id||(e.id=e.filehash);const r=null==this.get(e.id);this.addStickersAndPersistToDB([[e,null!=n?n:(0,a.unixTimeMs)(),t]],r)}addStickersAndPersistToDB(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(__LOG__(2)`Recent Stickers: length of stickers will be enqueued: ${e.length}`,0===e.length)return;const n=new Set(e.map((e=>e[0].id))),r=e.reduce(((e,t)=>{let[r,i,a]=t;return n.has(r.id)?(n.delete(r.id),[[r,i,a]].concat(e)):e}),[]),i=[],a=[];r.forEach((e=>{let[n,r,o]=e;const s=this.get(n.id);if(s)s.timestamp<=r&&(s.timestamp=r),a.push(s);else{const e=this._dbDataToModel({id:n.id,timestamp:r,sticker:{id:n.id,index:n.index,width:n.width,height:n.height,size:n.size,mimetype:n.mimetype,filehash:n.filehash,directPath:n.directPath,mediaKey:n.mediaKey,mediaKeyTimestamp:n.mediaKeyTimestamp,encFilehash:n.encFilehash,deprecatedMms3Url:n.deprecatedMms3Url,type:"sticker"},msgId:o,weight:null!=n.weight?Number(n.weight.toFixed(2)):1,isNewSticker:t});i.push(e),a.push(e)}})),a.length>0&&(__LOG__(2)`Recent Stickers: adjust weight and resort stickers.`,this.adjustWeight(a),this.addAndSort(i),this._hasInitializedFromCache&&(__LOG__(2)`Recent Stickers: need to save collection to DB.`,this._addSaveTask()))}replaceAndEnqueue(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.length>0){const e=this.map((e=>e.id));this.remove(e)}0!==e.length?this.addStickersAndPersistToDB(e,t):this._addSaveTask()}updateDirectPath(e,t){const n=this.get(e);(null==n?void 0:n.sticker)?(n.sticker.directPath=t,this.set([n],{remove:!1,add:!1,silent:!0,sort:!1}),this._addSaveTask()):__LOG__(4,void 0,new Error)`updateDirectPaths called with a stickerId that doesn't match any in the collection`}updateStickerMediaData(e,t){const n=this.get(e);null!=t&&null!=n&&(null!=t.directPath&&(n.sticker.directPath=t.directPath),null!=t.encFilehash&&(n.sticker.encFilehash=t.encFilehash),t.mediaKey&&(n.sticker.mediaKey=t.mediaKey),t.mediaKeyTimestamp&&(n.sticker.mediaKeyTimestamp=t.mediaKeyTimestamp),this.set([n],{remove:!1,add:!1,silent:!0,sort:!1}),this._addSaveTask())}updateRecentStickerWithNewSticker(e,t){const n=this.get(e);null!=n&&(n.sticker=new p.StickerModel(t),this.set([n],{remove:!1,add:!1,silent:!0,sort:!1}),this._addSaveTask())}stickersMissingDirerctPath(e){return e.filter((e=>null==e.sticker.directPath))}associateStickerWithMsg(e,t){return(0,i.default)((function*(){var n;const{messages:r}=yield c.MsgCollection.getMessagesById([t]),i=(null===(n=e.mediaObject)||void 0===n?void 0:n.associatedMsgs())||[];!e.mediaObject||0!==i.length&&r.some((e=>i.includes(e)))||(0,l.associateMediaWithMsg)(e.mediaObject,r[r.length-1])}))()}initializeFromCache(e){this._hasInitializedFromCache=!0;const t=e.map((e=>{const t=this._dbDataToModel(e);return null!=t.msgId&&this.associateStickerWithMsg(t.sticker,t.msgId),t})),n=this.toArray();if(n.length>0&&t.forEach((e=>e.weight=Number((e.weight*.9**n.length).toFixed(2)))),this.addAndSort(t),n.length){const e=new Set(t.map((e=>e.id)));n.some((t=>!e.has(t)))&&this._addSaveTask()}}addAndSort(e){this.add(e),this.sort(),this.length>32&&this._hasInitializedFromCache&&(__LOG__(2)`Recent Stickers: stickers length ${this.length} is over the limit.`,this.set(this.toArray().slice(0,32)))}removeAndSave(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.remove(e,t);return n.length&&this._addSaveTask(),__LOG__(2)`Recent Stickers: stickers length ${this.length} after remove.`,n}delete(){super.delete()}adjustWeight(e){const t=new Set(e.map((e=>e.id)));this.filter((e=>!t.has(e.id))).forEach((e=>e.weight=Number((.9*e.weight).toFixed(2)))),e.forEach((e=>{!0===e.isNewSticker?e.isNewSticker=void 0:e.weight=Number((e.weight+1).toFixed(2))}))}}t.RecentStickerCollection=_,_.model=d.default;const f=new _;t.RecentStickerCollectionMd=f},389779:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(54918);class i extends r.BaseModel{constructor(){super(...arguments),this.id=(0,r.prop)(),this.sticker=(0,r.prop)(),this.timestamp=(0,r.prop)(),this.msgId=(0,r.prop)(),this.weight=(0,r.prop)(),this.isNewSticker=(0,r.prop)()}}i.Proxy="recentSticker";var a=(0,r.defineModel)(i);t.default=a},301876:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StickerCollectionImpl=t.StickerCollection=t.FETCH_STATE=void 0;var r=n(594534),i=n(164832);t.FETCH_STATE={PENDING:"PENDING",SUCCESS:"SUCCESS",ERROR:"ERROR"};class a extends r.BaseCollection{fetch(){throw new Error(`${this.constructor.name}.fetch is not implemented`)}}t.StickerCollectionImpl=a,a.model=i.StickerModel;const o=new a;t.StickerCollection=o},164832:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.StickerModel=t.Sticker=void 0;var i=r(n(751463)),a=n(990445),o=n(54918),s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(644234)),l=r(n(116253)),u=n(172259);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}const d=(0,i.default)((()=>new f({id:"placeholder",isPlaceholder:!0}))),p=(0,i.default)((()=>new f({id:"createButton",isCreateButton:!0})));class _ extends o.BaseModel{constructor(){super(...arguments),this.id=(0,o.prop)(),this.mediaData=(0,o.session)(),this.mediaObject=(0,o.prop)(),this.deprecatedMms3Url=(0,o.prop)(),this.directPath=(0,o.prop)(),this.filehash=(0,o.prop)(),this.height=(0,o.prop)(),this.index=(0,o.prop)(),this.mediaKey=(0,o.prop)(),this.mediaKeyTimestamp=(0,o.prop)(),this.mimetype=(0,o.prop)(),this.size=(0,o.prop)(),this.type=(0,o.prop)(u.OUTWARD_TYPES.STICKER),this.encFilehash=(0,o.prop)(),this.width=(0,o.prop)(),this.weight=(0,o.prop)(),this.stickerPackId=(0,o.prop)(),this.stickerPackName=(0,o.prop)(),this.stickerPackPublisher=(0,o.prop)(),this.isPlaceholder=(0,o.prop)(),this.isCreateButton=(0,o.prop)()}initialize(){super.initialize(),this.addChild("mediaData",new l.default),this.isPlaceholder||this.isCreateButton||s.registerSticker(this)}downloadMedia(e){return s.downloadStickerOrStickerPackIcon(this,"STICKER",e).catch((e=>{__LOG__(4,void 0,new Error,!0,["non-sad"])`id: ${this.id}, error: ${String(e.stack||e)}`,SEND_LOGS("sticker-panel:sticker download failed")}))}toDbData(){return{id:this.id||this.filehash,index:this.index||0,width:this.width,height:this.height,size:this.size,mimetype:this.mimetype,filehash:this.filehash,directPath:this.directPath,mediaKey:this.mediaKey,mediaKeyTimestamp:null!=this.mediaKeyTimestamp?this.mediaKeyTimestamp:(0,a.unixTime)(),encFilehash:this.encFilehash,deprecatedMms3Url:this.deprecatedMms3Url,type:u.OUTWARD_TYPES.STICKER,weight:this.weight}}delete(){super.delete(),s.deregisterSticker(this)}}t.Sticker=_,_.Proxy="sticker",_.getPlaceholder=d,_.getCreateButton=p;const f=(0,o.defineModel)(_);t.StickerModel=f,f.getPlaceholder=d},425192:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.StickerPackCollectionMd=t.StickerPackCollection=t.FETCH_STATE=void 0;var a=i(n(348926)),o=n(88237),s=n(990445),l=n(594534),u=n(937715),c=i(n(932325)),d=n(432938),p=n(604281);const _=n(76672).Mirrored(["INITIAL","PENDING","SUCCESS","ERROR"]);t.FETCH_STATE=_;class f extends l.BaseCollection{constructor(){super(),this.fetchState=_.INITIAL,this.packFetchState=new Map,this._fetchTimestamp=null,this._packFetchTimestamp=new Map,this._abortController=null,this._packAbortController=new Map,this.listenTo(c.default,"locale_change",(()=>this._resetState()))}_resetState(){this._resetStickerPacksFetchState(),this.reset()}_resetStickerPacksFetchState(){var e;null===(e=this._abortController)||void 0===e||e.abort(),this._abortController=null,this._packAbortController.forEach((e=>e.abort())),this._packAbortController.clear(),this._resetFetchState(),this._resetPackFetchState(),this._fetchTimestamp=null,this._packFetchTimestamp.clear()}_setFetchState(e){e!==this.fetchState&&(this.fetchState=e,this.trigger("change:fetchState",e))}_resetFetchState(){this._setFetchState(_.INITIAL)}_setPackFetchState(e,t){t!==this.packFetchState.get(e)&&(this.packFetchState.set(e,t),this.trigger("change:packFetchState",e,t))}_resetPackFetchState(){this.packFetchState.clear(),this.trigger("change:packFetchState")}_resetRange(e,t,n){this._forEachInRange(e,t,((t,r)=>{const i=n[r-e];if(t)if(i)t.id!==i.id||t.imageDataHash===i.imageDataHash&&t.index===i.index?(this.remove(t),this.add(i)):(this.remove(t,{silent:!0}),this.add(i));else{let e=t;for(;e;)this.remove(e),e=this.at(r)}else i&&this.add(i)})),this._resetPackFetchState(),this._packFetchTimestamp.clear()}_forEachInRange(e,t,n){for(let r=e;r<t;r++){n(this.at(r),r)}}fetch(){var e=this;return(0,a.default)((function*(){var t;if(!(e.fetchState===_.PENDING||e.fetchState===_.SUCCESS&&(0,s.unixTime)()-(null!==(t=e._fetchTimestamp)&&void 0!==t?t:0)<d.STICKER_PACK_FETCH_TIMEOUT)){e._setFetchState(_.PENDING),e._fetchTimestamp=(0,s.unixTime)(),e._abortController=new r;try{const t=yield(0,u.fetchFirstPartyStickerPacks)({signal:e._abortController.signal}),n=Math.max(e.length,t.length);e._resetRange(0,n,t),e._setFetchState(_.SUCCESS)}catch(t){if(e._setFetchState(_.ERROR),t.name===o.ABORT_ERROR)return void __LOG__(2)`First party sticker packs request cancelled`;__LOG__(3,void 0,void 0,!0)`First party sticker packs request failed: error: ${t}`,SEND_LOGS("sticker-packs-fetch-request-failed")}}}))()}fetchStickerPack(e){var t=this;return(0,a.default)((function*(){var n;if(!e)return;if(t.get(e))return;const i=t.packFetchState.get(e),a=null!==(n=t._packFetchTimestamp.get(e))&&void 0!==n?n:0;if(i===_.PENDING||i===_.SUCCESS&&(0,s.unixTime)()-a<d.STICKER_PACK_FETCH_TIMEOUT)return;t._setPackFetchState(e,_.PENDING),t._packFetchTimestamp.set(e,(0,s.unixTime)());const l=new r;t._packAbortController.set(e,l);try{const n=yield(0,u.fetchFirstPartyStickerPack)({id:e,signal:l.signal});t._setPackFetchState(e,_.SUCCESS),t.add(n)}catch(n){if(t._setPackFetchState(e,_.ERROR),n.name===o.ABORT_ERROR)return void __LOG__(2)`First party sticker pack request cancelled`;__LOG__(3,void 0,void 0,!0)`First party sticker pack request failed: error: ${n}`,SEND_LOGS("sticker-packs-fetch-request-failed")}}))()}delete(){super.delete(),this.stopListening(),this._resetStickerPacksFetchState()}}t.StickerPackCollection=f,f.model=p.StickerPackModel,f.comparator=(e,t)=>e.index<t.index?-1:e.index>t.index?1:0;const h=new f;t.StickerPackCollectionMd=h},745482:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.StickerPackModel=t.StickerPack=t.PRE_PLACEHOLDER_ID=void 0;var i=n(54918),a=r(n(116253)),o=n(172259),s=r(n(961252));const l="placeholder:";t.PRE_PLACEHOLDER_ID=l;const u=e=>{let{index:t,page:n}=e;return new d({id:`placeholder:${t}`,index:t,page:n})};class c extends i.BaseModel{constructor(){super(...arguments),this.id=(0,i.prop)(),this.index=(0,i.prop)(),this.name=(0,i.prop)(),this.page=(0,i.prop)(),this.url=(0,i.prop)(),this.mimetype=(0,i.prop)("image/png"),this.mediaData=(0,i.session)(),this.mediaObject=(0,i.prop)(),this.directPath=(0,i.prop)(),this.filehash=(0,i.prop)(),this.mediaKey=(0,i.prop)(),this.mediaKeyTimestamp=(0,i.prop)(),this.size=(0,i.prop)(),this.type=(0,i.prop)(o.OUTWARD_TYPES.IMAGE),this.encFilehash=(0,i.prop)(),this.deprecatedMms3Url=(0,i.derived)((function(){return this.isFirstParty?"":this.url}),["isFirstParty"]),this.stickers=(0,i.derived)((function(){return this._stickers=this._stickers||new s.default(this.id.split("#")[0],this.isFirstParty),this._stickers}),["id"]),this.isPlaceholder=(0,i.derived)((function(){return c.isPlaceholderId(this.id)}),["id"]),this.isFirstParty=(0,i.derived)((function(){return Boolean(this.url)&&!this.mediaKey}),["url","mediaKey"])}initialize(){super.initialize(),this.isPlaceholder||this.isFirstParty||(this.addChild("mediaData",new a.default({renderableUrl:""})),n(644234).registerStickerPackIcon(this))}downloadMedia(){return this.isPlaceholder||this.isFirstParty?Promise.resolve():n(644234).downloadStickerOrStickerPackIcon(this,"STICKER_PACK").catch((e=>{__LOG__(4,void 0,new Error,!0)`id: ${this.id}, error: ${String(e.stack||e)}`,SEND_LOGS("sticker-panel:sticker-pack download failed")}))}delete(){super.delete(),n(644234).deregisterStickerPackIcon(this)}}t.StickerPack=c,c.Proxy="stickerPack",c.createPlaceholder=u,c.isPlaceholderId=e=>new RegExp("^placeholder:").test(e);const d=(0,i.defineModel)(c);t.StickerPackModel=d,d.createPlaceholder=u,d.isPlaceholderId=c.isPlaceholderId},604281:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.StickerPackModel=t.StickerPack=void 0;var i=n(54918),a=r(n(961252));class o extends i.BaseModel{constructor(){super(...arguments),this.index=(0,i.prop)(),this.id=(0,i.prop)(),this.name=(0,i.prop)(),this.publisher=(0,i.prop)(),this.description=(0,i.prop)(),this.fileSize=(0,i.prop)(),this.imageDataHash=(0,i.prop)(),this.animated=(0,i.prop)(),this.previewImageIds=(0,i.prop)(),this.trayImageId=(0,i.prop)(),this.trayImagePreview=(0,i.prop)(),this.stickers=(0,i.derived)((function(){const e=this.id;return this._stickers=this._stickers||new a.default(e,!0),this._stickers}),["id"])}}t.StickerPack=o,o.Proxy="stickerPackMd";const s=(0,i.defineModel)(o);t.StickerPackModel=s},961252:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=r(n(478718)),o=n(990445),s=n(65754),l=n(301876),u=n(432938);class c extends l.StickerCollectionImpl{constructor(e,t){super(),this._parseStickersRes=e=>{if(200!==e.status||!e.data)throw new Error("sticker pack stickers query error");return e.data.map(((e,t)=>(0,i.default)((0,i.default)({},(0,a.default)(e,["directPath","mimetype","mediaKey","filehash","width","height"])),{},{index:t,id:e.filehash,deprecatedMms3Url:e.url,encFilehash:e.encFilehash,mediaKeyTimestamp:0})))},this.stickerPackId=e,this.isFirstParty=t,this._firstPartyFetchTimestamp=null;const n=c._cache[this.stickerPackId];if(n)return n;let r;const o=this;Object.defineProperty(this,"fetchState",{get:()=>r,set(e){r!==e&&(r=e,o.trigger("change:fetchState",e))}})}fetch(e){var t;const r=this.isFirstParty&&(0,o.unixTime)()-(null!==(t=this._firstPartyFetchTimestamp)&&void 0!==t?t:0)>=u.STICKER_PACK_FETCH_TIMEOUT;if((e||r)&&this.fetchState!==l.FETCH_STATE.PENDING&&delete this._fetchPromise,this._fetchPromise)return this._fetchPromise;this.fetchState=l.FETCH_STATE.PENDING;if(n(745482).StickerPackModel.isPlaceholderId(this.stickerPackId))return this._fetchPromise=new Promise((()=>{})),this._fetchPromise;let i;return this.isFirstParty?(this._firstPartyFetchTimestamp=(0,o.unixTime)(),i=(0,s.fetchFirstPartyStickers)(this.stickerPackId),this._fetchPromise=i.then((e=>{const t=Math.max(this.length||e.length);this._resetRange(0,t,e),this.fetchState=l.FETCH_STATE.SUCCESS})).catch((()=>{this.fetchState=l.FETCH_STATE.ERROR})),this._fetchPromise):Promise.resolve()}_resetRange(e,t,n){this._forEachInRange(e,t,((t,r)=>{const i=n[r-e];t?i?t.id===i.id?t.set(i):(this.remove(t),this.add(i)):this.remove(t):i&&this.add(i)}))}_forEachInRange(e,t,n){for(let r=e;r<t;r++){n(this.at(r),r)}}}t.default=c,c._cache={},c.comparator=(e,t)=>e.index<t.index?-1:e.index>t.index?1:0},441051:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.StickerSearchCollectionImpl=t.StickerSearchCollection=void 0;var i=r(n(348926)),a=n(594534),o=(n(227926),n(955851)),s=n(164832),l=n(429334),u=n(356451);const c={HAPPY:["😂","🤣","😀","😁","😆","🙂","😇","☺️","😄","😃"],LOVE:["😍","😘","❤️","💕","🥰","😗","😙","😻","👩‍❤️‍👩","💐","💌","💛","💚","💙","💜","💓","💘","💏","💑","🌹","🤟","🏩"],GREETINGS:["👋","😂","🤣","🙏","✋","🧕","🚶‍♀️","🚶","👠","🥾","🙈","🦛","🌺","⚡","🎯","🚄","🚅","💒","🛕","🛣️","🕉️","🔊"],SAD:["😭","😔","😢","😞","😟","😕","🙁","☹️","😖","😫","😩","🥺","😥","😓","😪","😿","💧","💔"],ANGRY:["😠","😡","😤","👺","💢","🗯️","👿"],CELEBRATE:["🥳","🥂","🎈","🎊","🎉"]};class d extends a.BaseCollection{constructor(){super(...arguments),this._cache=new Map,this._hasFetched=!1,this._isFetching=!0}isFetchingData(){return this._isFetching}hasFetchedData(){return this._hasFetched}setStartFetching(){this._isFetching=!0,this.trigger("start_fetching")}setStopFetching(){this._isFetching=!1,this.trigger("stop_fetching")}search(e){var t=()=>super.delete,n=this;return(0,i.default)((function*(){n._lastQuery!==e&&n._hasFetched&&t().call(n);const r=e.trim().toUpperCase();if(n._cache.has(e)){const t=n._cache.get(e);if(null!=t)return n.add(t),void(n._lastQuery=e);__LOG__(2)`StickerMoodCollection cache was invalid, re-searching.`}const i=[];if(c.hasOwnProperty(r))i.push(...c[r]);else{const a=l.EmojiUtil.containsOnlyEmoji(r)?l.EmojiUtil.splitEmojis(r):(0,u.emojiKeywordToUnicodeSearch)(r);if(null==a||0===a.length)return n._lastQuery=e,n.setStopFetching(),void t().call(n);i.push(...a)}n.setStartFetching();let a=[];try{a=yield(0,o.searchFirstPartyStickers)(i)}catch(e){return __LOG__(3,void 0,void 0,!0)`Sticker search request failed: error: ${e}`,SEND_LOGS("sticker-search-request-failed"),void n.setStopFetching()}n._cache.set(e,a),n._hasFetched=!0,n._lastQuery=e,n.add(a),n.setStopFetching()}))()}searchMood(e){return this.search(e)}delete(){super.delete(),this._cache=new Map,this._hasFetched=!1,this._isFetching=!1}}t.StickerSearchCollectionImpl=d,d.model=s.StickerModel;const p=new d;t.StickerSearchCollection=p},432938:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.STICKER_PADDING=t.STICKER_PACK_FETCH_TIMEOUT=t.STICKER_MAKER_IMAGE_PADDING=t.STICKER_LIST_ITEM_HEIGHT=t.STICKER_DIMENSION=t.STICKER_BORDER_WIDTH=void 0;t.STICKER_DIMENSION=512;t.STICKER_BORDER_WIDTH=8;t.STICKER_PADDING=36;t.STICKER_LIST_ITEM_HEIGHT=156;t.STICKER_MAKER_IMAGE_PADDING=20;t.STICKER_PACK_FETCH_TIMEOUT=86400},135630:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.LOAD_PRIORITY=t.AssetLoaderImpl=void 0;var a=i(n(348926)),o=i(n(252628)),s=i(n(618446)),l=n(88237),u=n(989211),c=i(n(132375)),d=i(n(287802)),p=i(n(589970)),_=i(n(861474)),f=i(n(729519)),h=i(n(219314)),g=n(343168),m=n(325568),y=i(n(571834)),E=n(429334),S=n(224007),T=i(n(441143)),v=i(n(631873));const A={INITIAL_EMOJI_LOAD:1,INITIAL_ASSET_LOAD:2,THEME_ASSET_LOAD:2,HELP_ANIMATED_DOODLE:2,LAZY_LOAD_EMOJI:2,NOTIFICATION_ICON:2};t.LOAD_PRIORITY=A;t.AssetLoaderImpl=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:90;this._assetStyle=new f.default("asset-style"),this._requestedAssets={},this._loadingDataMap={},this._getEmojiForPlatform=null,this._currentResolution=_.default.currentRes,this._currentlyLoadingCount=0,this._queue=new d.default((e=>-e.priority)),this._hasLoggedDecrementBelowZero=!1,this.loadAssetsForCurrentDpi=()=>{const e=_.default.currentRes,t=this._currentResolution;e!==t&&(this._currentResolution=e,Object.keys(this._requestedAssets).forEach((e=>{this._cancelLoad(e,t)})),this._loadAssets((0,o.default)(this._requestedAssets),A.INITIAL_EMOJI_LOAD,{forceCheck:!1}).catch((0,l.catchAbort)((()=>{}))))},this._maxConcurrentRequests=e}initEmojiAsset(e){this._getEmojiForPlatform=e}loadInitialAssets(e){const t=new y.default.WebcAssetLoad({webcAssetName:"initial-assets",webcAssetFromCache:!1,webcAssetCacheType:y.default.WEBC_ASSET_CACHE_TYPE_CODE.UNCACHED});this._loadAssets(e,A.INITIAL_ASSET_LOAD,{estimateStorage:!0}).then((()=>{t.markWebcAssetLoadT(),t.commit();const e=t.webcAssetLoadT;__LOG__(2)`AssetLoader:loadInitialAssets complete in ${e}ms`})).catch((0,l.catchAbort)((()=>{__LOG__(2)`AssetLoader:loadInitialAssets cancelled by more recent request.`})))}loadEmoji(e,t){if(this._getEmojiForPlatform&&this._currentPlatform){const n=this._getEmojiForPlatform(this._currentPlatform),r=E.EmojiUtil.getBucket(e),i=this._getEmojiPrefix(),a=n.get(`${i}b${r}`),o=this._currentResolution;return a?this.loadAsset(a,t,!1).catch((0,l.catchAbort)((()=>{__LOG__(2)`AssetLoader: loadEmoji Cancelled by more recent request: ${a.id}-${o}`}))):Promise.reject(new Error("The given emoji glyph id was not found"))}return Promise.reject(new Error("emojiForPlatform or currentPlatform are not set"))}loadEmojis(){const e=(0,c.default)(this._currentPlatform,"this._currentPlatform");(0,T.default)(null!=this._getEmojiForPlatform,"Emojis were loaded before initializing the emoji assets!");const t=Array.from(this._getEmojiForPlatform(e).values()),n=new y.default.WebcAssetLoad({webcAssetName:"emojis",webcAssetFromCache:!1,webcAssetCacheType:y.default.WEBC_ASSET_CACHE_TYPE_CODE.UNCACHED});this._loadAssets(t,A.INITIAL_EMOJI_LOAD,{estimateStorage:!0}).then((()=>{n.markWebcAssetLoadT(),n.commit();const e=n.webcAssetLoadT;__LOG__(2)`AssetLoader:loadEmojis complete in ${e}ms`})).catch((0,l.catchAbort)((()=>{__LOG__(2)`AssetLoader:loadEmojis cancelled by more recent request.`})))}loadAsset(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const{id:i}=e,a=_.default.currentRes,o=this._requestedAssets[i];if(o&&!(0,s.default)(e,o))return Promise.reject(new Error(["Attempted to load an asset using an already used ID"].join("\n")));this._requestedAssets[i]=e,this._loadingDataMap[i]=this._loadingDataMap[i]||{};const u="high"===a?"low":"high";this._cancelLoad(i,u);const c=this._loadingDataMap[i][a];if(c&&!n)return c.promise;const d=new h.default(e,a,t),p=new r,{signal:f}=p,g=this._buildPromise(d,p).then((t=>{if(f.aborted)throw new l.AbortError;const{selectors:n}=e;return n&&this._assetStyle.setRule(`${n.join(", ")}`,{"background-image":`url('${t}')`}),t})).catch((e=>{const t=this._loadingDataMap[i][a],n=m!==t;if(n||(this._loadingDataMap[i][a]=null),e.name===l.ABORT_ERROR&&(__LOG__(2)`Asset load cancelled by more recent request: ${i}-${a}`,n&&t))return t.promise;throw e}));d.setConsumerPromise(g);const m={promise:g,abort:e=>{this._abortUrlPromise(d,e)}};return this._loadingDataMap[i][a]=m,c&&c.abort(!1),this._startLoad(),g}_buildPromise(e,t){const n=new Promise((n=>{e.setConsumerPromiseResolve(n,t),this._queue.push(e)}));return(0,p.default)(n,t.signal)}_startLoad(){if(!(this._currentlyLoadingCount>=this._maxConcurrentRequests))for(let e=0;e<this._maxConcurrentRequests-this._currentlyLoadingCount;e++){const e=this._queue.pull();if(!e)return;this._currentlyLoadingCount+=1,(0,m.loadUrl)(e).then((()=>{this._decrementCurrentlyLoadingCount(),this._startLoad()})).catch((0,l.catchAbort)((()=>{this._decrementCurrentlyLoadingCount(),this._startLoad()}))).catch((t=>{this._decrementCurrentlyLoadingCount(),e.retryCount+=1;const n=(0,u.expBackoff)(e.retryCount,12e4,1e3,.1);setTimeout((()=>{this._queue.push(e),this._startLoad()}),n),this._startLoad(),(0,m.getSupportedImageFormatUrl)(e).then((e=>{const n=e.split("/");__LOG__(3)`Asset: ${n[n.length-1]} failed. Retrying... ${t.toString()}`}))}))}}_abortUrlPromise(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.getLoadUrlPromise()){e.abortLoadUrlPromise();const n=e.getConsumerPromise();t&&n&&e.abortConsumerPromise()}this._startLoad()}_cancelLoad(e,t){var n;const r=null===(n=this._loadingDataMap[e])||void 0===n?void 0:n[t];r&&(this._loadingDataMap[e][t]=null,r.abort(!0))}setPlatform(e){if(e===this._currentPlatform)return;this._currentPlatform=e;const t=((0,g.getEmojiTypeFromPlatform)(e)===S.EMOJI_TYPE.APPLE?S.EMOJI_TYPE.WHATSAPP:S.EMOJI_TYPE.APPLE)===S.EMOJI_TYPE.APPLE?"emoji-apple-":"emoji-wa-";if(Object.keys(this._requestedAssets).forEach((e=>{e.startsWith(t)&&(this._cancelLoad(e,"high"),this._cancelLoad(e,"low"))})),null==this._getEmojiForPlatform)return;const n=Array.from(this._getEmojiForPlatform(e).values());this._loadAssets(n,A.INITIAL_EMOJI_LOAD,{forceCheck:!1})}_getEmojiPrefix(){return(0,g.getEmojiTypeFromPlatform)(this._currentPlatform)===S.EMOJI_TYPE.APPLE?"emoji-apple-":"emoji-wa-"}_loadAssets(e,t,n){var r=this;return(0,a.default)((function*(){const i=!1!==(null==n?void 0:n.forceCheck),a=!0===(null==n?void 0:n.estimateStorage),s=yield Promise.all(e.map((e=>r.loadAsset(e,t,i))));return v.default&&(0,v.default)({keep:(0,o.default)(r._requestedAssets),estimateStorage:a}),s}))()}_decrementCurrentlyLoadingCount(){this._currentlyLoadingCount<=0&&!this._hasLoggedDecrementBelowZero&&(this._hasLoggedDecrementBelowZero=!0,__LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("Tried to decrease _loadingCount below zero, would have been negative.")),this._currentlyLoadingCount=Math.max(0,this._currentlyLoadingCount-1)}}},861474:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;const n={LOW:"low",HIGH:"high"},r=window.matchMedia("\n only screen and (-webkit-min-device-pixel-ratio: 2),\n only screen and (min-device-pixel-ratio: 2),\n only screen and (min-resolution: 2dppx)\n"),i={RES:n,currentRes:r.matches?n.HIGH:n.LOW};r.addListener((function(e){const t=e.matches?n.HIGH:n.LOW;if(t===i.currentRes)return;i.currentRes=t;const r=document.createEvent("Event");r.initEvent("dpichange",!0,!0),window.dispatchEvent(r)}));var a=i;t.default=a},729519:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(402525)),a=r(n(435161)),o=r(n(873955)),s=r(n(185681));t.default=class{constructor(e){this.rules={},this.styleSheet=this.createStyleSheet(e)}createStyleSheet(e){const t=e||(0,o.default)("dynamic-style-");let n=document.createElement("style");return n.id=t,n.type="text/css",document.head&&document.head.appendChild(n),n=n.sheet,n}addRule(e,t){const n=this.styleSheet.cssRules.length,r=(0,a.default)(t,((e,t)=>`${t}: ${e};`)).join(" ");return this.styleSheet.insertRule(`${e} { ${r} }`,n),this.rules[e]=this.styleSheet.cssRules[n],this.rules[e]}updateRule(e,t){const n=this.rules[e];return(0,i.default)(t,((e,t)=>{n.style[(0,s.default)(t)]=e})),n}setRule(e,t){return this.rules[e]?this.updateRule(e,t):this.addRule(e,t)}}},789379:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLoader=void 0;const r=new(n(135630).AssetLoaderImpl);t.AssetLoader=r,window.addEventListener("dpichange",(()=>{r.loadAssetsForCurrentDpi()}))},219314:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=class{constructor(e,t,n){this.retryCount=0,this.asset=e,this.resolution=t,this.priority=n}getLoadUrlPromise(){return this._loadUrlPromise}setLoadUrlPromise(e,t){this._loadUrlPromise=e,this._loadUrlAbortController=t}abortLoadUrlPromise(){var e;null===(e=this._loadUrlAbortController)||void 0===e||e.abort()}getConsumerPromise(){return this._consumerPromise}setConsumerPromise(e){this._consumerPromise=e}getConsumerPromiseResolve(){return this._consumerPromiseResolve}setConsumerPromiseResolve(e,t){this._consumerPromiseResolve=e,this._consumerAbortController=t}abortConsumerPromise(){var e;null===(e=this._consumerAbortController)||void 0===e||e.abort()}}},631873:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!n(478885).default.supported)return;const t=!0===e.estimateStorage,r=n(537152).default,d=n(647349).default,p=navigator.serviceWorker;(0,s.detectWebpSupport)().then((t=>{const n=(0,i.default)(e.keep,(e=>[e[a.default.RES.LOW],e[a.default.RES.HIGH]])).map((e=>{var n;const r=null===(n=e[t&&e[c]?c:u])||void 0===n?void 0:n.split("/");return null!=r?r[r.length-1]:null}));(null==p?void 0:p.controller)&&r.request(p.controller,d.CLEAN_ASSETS,n).catch((()=>{}))})).then((()=>t?(0,o.default)():null)).then((e=>{e&&new l.default.WebcStorageStat({webcStorageUsage:e.usage,webcStorageQuota:e.quota}).commit()}))};var i=r(n(594654)),a=r(n(861474)),o=r(n(495976)),s=n(868607),l=r(n(571834));(0,r(n(441143)).default)(!0,"service worker builds only");const u="default",c="webp"},343168:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.emojiAssetMapCreator=function(e){return t=>c(t,e)},t.getEmojiTypeFromPlatform=d;var i=r(n(252628)),a=r(n(944908)),o=r(n(288306)),s=n(828770),l=n(429334),u=n(224007);const c=(0,o.default)(((e,t)=>{const n=new Map,r=d(e),o=t[r],s=o.SELECTOR,c=Math.ceil((0,a.default)((0,i.default)(o.UNICODE_TO_EMOJI)).length/u.BUCKET_SIZE);for(let e=0;e<c;e+=1){const t=`emoji-${s}-b${e}`,i=40;n.set(t,{id:t,selectors:[`.emoji.${s}.b${e}`,`.emojik.${s}.b${e}`],low:{webp:l.EmojiUtil.getSpritesPath(r,e,i,"webp"),default:l.EmojiUtil.getSpritesPath(r,e,40,"png")},high:{default:l.EmojiUtil.getSpritesPath(r,e,64,"png"),webp:l.EmojiUtil.getSpritesPath(r,e,64,"webp")}})}return n}));function d(e){switch(e){case s.PLATFORMS.IPHONE:case s.PLATFORMS.SMBI:case s.PLATFORMS.IPAD:return u.EMOJI_TYPE.APPLE;default:return u.EMOJI_TYPE.WHATSAPP}}},413677:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.emojiCompletionTracker=t.InitialEmojisCompletionContext=t.EmojiCompletionTracker=void 0;var r=n(789379),i=n(667294);class a{constructor(){var e=this;this._loadingEmojisCount=0,this._hasTriggeredEmojiPreload=!1,this._firstRun=!1,this.beginPreload=function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e._hasTriggeredEmojiPreload||(e._hasTriggeredEmojiPreload=!0,window.setTimeout((()=>{r.AssetLoader.loadEmojis()}),t?1e3:0))},this.beginPreloadFallback=()=>{window.setTimeout((()=>{this.beginPreload(!1)}),5e3)},this.incrementLoadingEmojisCount=()=>{this._hasTriggeredEmojiPreload||(this._firstRun||(this._firstRun=!0,this._firstRunTiming=performance.now()),this._loadingEmojisCount+=1)},this.decrementLoadingEmojisCount=()=>{this._hasTriggeredEmojiPreload||(this._loadingEmojisCount-=1,0===this._loadingEmojisCount&&this._firstRun&&(this.beginPreload(!0),__LOG__(2)`EmojiCompletionTracker:firstScreenEmojis complete in ${Math.ceil(performance.now()-this._firstRunTiming)} ms`))}}}t.EmojiCompletionTracker=a;const o=new a;t.emojiCompletionTracker=o;const s=(0,i.createContext)(o);t.InitialEmojisCompletionContext=s},325568:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.LoadUrlError=void 0,t.getSupportedImageFormatUrl=f,t.loadUrl=function(e){const t=new r,n=f(e).then(function(){var n=(0,a.default)((function*(n){yield c.default.waitIfOffline({signal:t.signal});const r=Date.now(),i=yield(0,u.extendedFetch)(n,{signal:t.signal}),a=e.getConsumerPromiseResolve();if(!i.ok||!a)throw new _(n,i.status,Date.now()-r);a(n)}));return function(){return n.apply(this,arguments)}}());return e.setLoadUrlPromise(n,t),n};var a=i(n(348926)),o=n(643930),s=i(n(132375)),l=n(868607),u=n(754424),c=i(n(99398));const d="default",p="webp";class _ extends((0,o.customError)("LoadUrlError")){constructor(e,t,n){super(`Failed to load url. StatusCode: ${t}. Duration: ${n} ms`),this.url=e,this.statusCode=t}}function f(){return h.apply(this,arguments)}function h(){return(h=(0,a.default)((function*(e){const t=yield(0,l.detectWebpSupport)(),{asset:n,resolution:r}=e,i=t&&n[r][p]?p:d;return(0,s.default)(n[r][i],"asset[resolution][format]")}))).apply(this,arguments)}t.LoadUrlError=_},698052:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatAssignmentEntryPointType=void 0;const r=n(76672).Mirrored(["CONTACT_INFO_SCREEN","CONVERSATION_MENU","MULTI_SELECT","SYSTEM_MESSAGE"]);t.ChatAssignmentEntryPointType=r},2772:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.logChatAssignment=function(e,t,n,r,a){if(!(0,s.chatAssignmentEnabled)())return;let l;l=""===t?p.default.CHAT_ASSIGNMENT_ACTION_TYPE.ACTION_UNASSIGNED:n?p.default.CHAT_ASSIGNMENT_ACTION_TYPE.ACTION_REASSIGNED:p.default.CHAT_ASSIGNMENT_ACTION_TYPE.ACTION_ASSIGNED;(function(e,t,n){var r,a,s;const l=_(),u=o.AgentCollection.get(t),f=(0,d.assertGetMe)().getDeviceId(),h=t===(null==l?void 0:l.id);return new p.default.MdChatAssignment((0,i.default)({assignerMdId:f,assignerAgentId:null!==(r=null==l?void 0:l.id)&&void 0!==r?r:"",assignerBrowserId:c.default.persistentExpiringId(),chatAssignmentAgentId:null!==(a=null==u?void 0:u.id)&&void 0!==a?a:"",chatAssignmentMdId:null!==(s=null==u?void 0:u.deviceId)&&void 0!==s?s:-1,chatAssignmentBrowserId:h?c.default.persistentExpiringId():"",chatAssignmentChatType:e.getChatAssignmentChatType()},n))})(e,t,{chatAssignmentAction:l,chatAssignmentEntryPoint:h(r),chatsCnt:a}).commit()},t.logChatStatusTickerShown=function(e){if(!(0,s.chatAssignmentEnabled)())return;const t=u.ChatCollection.get(e);if(null==t)return;f(t,{mdChatAssignmentSecondaryActionType:p.default.MD_CHAT_ASSIGNMENT_SECONDARY_ACTION_TYPE.ACTION_CHAT_STATUS_TICKER_SHOWN,mdChatAssignmentSecondaryActionSource:p.default.MD_CHAT_ASSIGNMENT_SOURCE_TYPE.NONE}).commit()},t.logNuxShown=function(e){if(!(0,s.chatAssignmentEnabled)())return;f(e,{mdChatAssignmentSecondaryActionType:p.default.MD_CHAT_ASSIGNMENT_SECONDARY_ACTION_TYPE.ACTION_TOOLTIP_SHOWN,mdChatAssignmentSecondaryActionSource:p.default.MD_CHAT_ASSIGNMENT_SOURCE_TYPE.NONE}).commit()},t.logSystemMessageFailedToGenerate=function(e){if(!(0,s.chatAssignmentEnabled)())return;f(e,{mdChatAssignmentSecondaryActionType:p.default.MD_CHAT_ASSIGNMENT_SECONDARY_ACTION_TYPE.ACTION_SYSTEM_MESSAGE_CREATION_ERROR,mdChatAssignmentSecondaryActionSource:p.default.MD_CHAT_ASSIGNMENT_SOURCE_TYPE.NONE,mdChatAssignmentSecondaryActionAssignmentType:null==e.assignedAgent?p.default.MD_CHAT_ASSIGNMENT_ASSIGNMENT_TYPE.ASSIGNED:p.default.MD_CHAT_ASSIGNMENT_ASSIGNMENT_TYPE.UNASSIGNED}).commit()},t.logSystemMessageGeneratedFromCompanion=function(e){if(!(0,s.chatAssignmentEnabled)())return;f(e,{mdChatAssignmentSecondaryActionType:p.default.MD_CHAT_ASSIGNMENT_SECONDARY_ACTION_TYPE.ACTION_SYSTEM_MESSAGE_ADDED_TO_CHAT_HISTORY,mdChatAssignmentSecondaryActionSource:p.default.MD_CHAT_ASSIGNMENT_SOURCE_TYPE.BOOTSTRAP,mdChatAssignmentSecondaryActionAssignmentType:null==e.assignedAgent?p.default.MD_CHAT_ASSIGNMENT_ASSIGNMENT_TYPE.ASSIGNED:p.default.MD_CHAT_ASSIGNMENT_ASSIGNMENT_TYPE.UNASSIGNED}).commit()};var i=r(n(81109)),a=n(287461),o=n(268392),s=(n(98671),n(72696)),l=n(698052),u=n(965012),c=(n(413497),r(n(524173))),d=n(459857),p=r(n(571834));function _(){const e=(0,d.assertGetMe)().getDeviceId();return o.AgentCollection.getModelsArray().find((t=>t.deviceId===e))}function f(e,t){var n,r;const o=_();return(0,a.getABPropConfigValue)("smb_md_agent_chat_assignment_system_messages_logging_v2_enabled")||delete t.mdChatAssignmentSecondaryActionAssignmentType,new p.default.MdChatAssignmentSecondaryAction((0,i.default)({mdChatAssignmentSecondaryActionChatType:null==e?void 0:e.getMdChatAssignmentChatType(),mdChatAssignmentSecondaryActionMdId:null!==(n=null==o?void 0:o.deviceId)&&void 0!==n?n:-1,mdChatAssignmentSecondaryActionAgentId:null!==(r=null==o?void 0:o.id)&&void 0!==r?r:"",mdChatAssignmentSecondaryActionBrowserId:c.default.persistentExpiringId()},t))}function h(e){switch(e){case l.ChatAssignmentEntryPointType.MULTI_SELECT:return p.default.CHAT_ASSIGNMENT_ENTRY_POINT_TYPE.MULTI_SELECT;case l.ChatAssignmentEntryPointType.SYSTEM_MESSAGE:return p.default.CHAT_ASSIGNMENT_ENTRY_POINT_TYPE.SYSTEM_MESSAGE;case l.ChatAssignmentEntryPointType.CONVERSATION_MENU:return p.default.CHAT_ASSIGNMENT_ENTRY_POINT_TYPE.CONVERSATION_OVERFLOW_MENU;case l.ChatAssignmentEntryPointType.CONTACT_INFO_SCREEN:return p.default.CHAT_ASSIGNMENT_ENTRY_POINT_TYPE.CONTACT_INFO_SCREEN}}},129363:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Labels=function(e){const{labels:t,showName:n,renderAsCircle:r}=e,p=(0,_.default)(),y=(0,d.useMemo)((()=>g(t)),[t]);if((0,f.useListener)(null!=y?s.LabelCollection:null,`label_updated_${null!=y?y:""}`,p),!(0,i.canDisplayLabel)())return null;const E=function(e){const t=g(e);return null==t?null:s.LabelCollection.get(t)}(t);if(!E||!E.name)return null;if(1===t.length){const t=n?(0,h.jsx)("span",{className:u.default.name,children:(0,h.jsx)(o.EmojiText,{text:E.name})}):null,i=(0,c.default)((0,a.cx)({[u.default.container]:!n&&!r,[u.default.containerCircleIconFull]:!!r,[u.default.containerFull]:n&&!r,[u.default.labelFilter]:"label-filter"===e.theme,[u.default.drawerTitle]:"drawer-title"===e.theme})),s=r?{backgroundColor:E.hexColor}:{},d=r?(0,h.jsx)(l.LabelIcon,{className:u.default.icon}):m(E.hexColor);return(0,h.jsxs)("div",{className:i,children:[(0,h.jsx)("div",{className:(0,c.default)(u.default.iconContainer,(0,a.cx)({[u.default.circleIcon]:r})),style:s,children:d}),t]})}return(0,h.jsx)("div",{className:u.default.container,children:(0,h.jsxs)("svg",{width:"18px",height:"15px",viewBox:"0 0 18 15",children:[(0,h.jsx)("path",{fill:E.hexColor,d:"M11.208,3.925H2.236C1.556,3.925,1,4.565,1,5.357v7.213C1,13.362,1.556,14,2.236,14h8.972 c0.414,0,0.785-0.237,1.007-0.604l2.701-4.433L12.215,4.53C11.993,4.162,11.622,3.925,11.208,3.925z"}),(0,h.jsx)("path",{fill:"currentColor",d:"M15.541,7.832L13.164,3.93 c-0.423-0.698-1.15-1.142-1.956-1.142H2.595V2.432C2.595,1.64,3.151,1,3.831,1h9.1c0.414,0,0.782,0.237,1.005,0.605l2.696,4.433 L15.541,7.832z"})]})})},t.getVisibleLabelId=g,t.renderLabelSvg=m;var i=n(72696),a=n(113704),o=n(305521),s=n(478353),l=n(106789),u=r(n(800158)),c=r(n(120992)),d=n(667294),p=r(n(156720)),_=r(n(229439)),f=n(148725),h=n(785893);function g(e){if(0===e.length)return;const t=Math.max(...e.map((e=>parseInt(e,10))));return isNaN(t)?e[0]:t.toString()}function m(e,t){return(0,h.jsx)("svg",{width:"18px",height:"12px",viewBox:"0 0 18 12",className:(0,c.default)(u.default.icon,(0,p.default)(t)),children:(0,h.jsx)("path",{fill:e||"#ffffff",d:"M11.208,0.925H2.236C1.556,0.925,1,1.565,1,2.357V9.57C1,10.362,1.556,11,2.236,11h8.972 c0.414,0,0.785-0.237,1.007-0.604l2.701-4.433L12.215,1.53C11.993,1.162,11.622,0.925,11.208,0.925z"})},2)}},899841:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PRODUCT_LIST_ITEM_HEIGHT=t.MAX_REPLY_PRODUCT_TITLE_LENGTH=t.MAX_REPLY_PRODUCT_DESC_LENGTH=t.CART_PRODUCT_LIST_ITEM_HEIGHT=void 0;t.PRODUCT_LIST_ITEM_HEIGHT=96;t.CART_PRODUCT_LIST_ITEM_HEIGHT=104;t.MAX_REPLY_PRODUCT_TITLE_LENGTH=40;t.MAX_REPLY_PRODUCT_DESC_LENGTH=95},2754:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SEARCH_FILTERS=void 0;const r=n(76672)({UNREAD:"unread",GROUP:"group",BROADCAST:"broadcast",CONTACT:"contact",NON_CONTACT:"non_contact",ASSIGNED_TO_YOU:"assigned_to_you"});t.SEARCH_FILTERS=r},564128:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,s.jsxs)("span",{className:(0,o.default)(!e.inline&&l.block),children:[(0,s.jsx)(a.default,{dataTab:e.dataTab,onClick:e.action,children:(0,s.jsx)("span",{className:(0,o.default)(l.actionText),children:e.children})}),(0,s.jsx)(i.ChevronRightTextIcon,{className:(0,o.default)(l.chevron),directional:!0})]})};var i=n(881006),a=r(n(625903)),o=r(n(156720)),s=n(785893);const l={block:{display:"f804f6gw"},actionText:{":hover":{textDecoration:"edeob0r2",cursor:"t94efhq2"}},chevron:{display:"l7jjieqr",marginTop:"hymafltn",marginStart:"k6y3xtnu",verticalAlign:"fewfhwl7"}}},407013:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const{action:t=null,onDismiss:n,type:r,text:N}=e,w=(0,O.default)(C.default.butterbar,(0,h.cx)({[C.default.computer]:"computer"===r||"generalAlert"===r||"updateWarning"===r||"electronDeprecationNoticeDownload"===r,[C.default.phone]:"phone"===r,[C.default.notification]:"notification"===r||"updateNotification"===r||"electronDeprecationAwareness"===r,[C.default.battery]:"battery"===r,[C.default.update]:"update"===r||"updatePrimaryDevice"===r,[C.default.notice]:"notice"===r&&!f.Conn.isSMB,[C.default.noticeSmb]:"notice"===r&&f.Conn.isSMB,[C.default.fatal]:"fatal"===r,[C.default.nuxGreen]:"nuxGreen"===r,[C.default.nuxBlue]:"nuxBlue"===r||"announcement"===r,[C.default.resumeProgress]:"resumeProgress"===r,[C.default.webDesktopUpsell]:"webDesktopUpsell"===r||"electronDeprecationQrAwareness"===r,[C.default.invalidPoll]:"invalidPoll"===r})),L=n?(0,M.jsx)("div",{className:C.default.controls,children:(0,M.jsx)(T.default,{className:C.default.controlsIcon,"aria-label":P.fbt._("Close",null,{hk:"19Jpec"}),Icon:A.XIcon,onClick:n})}):null,D=e.title?(0,M.jsx)("div",{className:C.default.title,children:e.title}):null,k={computer:a.AlertComputerIcon,phone:u.AlertPhoneIcon,notification:l.AlertNotificationIcon,announcement:o.AlertIcon,updateNotification:c.AlertUpdateIcon,updateWarning:c.AlertUpdateIcon,battery:i.AlertBatteryIcon,update:c.AlertUpdateIcon,notice:s.AlertNoticeIcon,fatal:o.AlertIcon,generalAlert:o.AlertIcon,nuxGreen:p.BusinessDescriptionIcon,nuxBlue:_.CollectionsFolderIcon,updatePrimaryDevice:d.AlertUpdatePrimaryIcon,electronDeprecationAwareness:y.ElectronDeprecationDownloadNativeIcon,electronDeprecationNoticeDownload:y.ElectronDeprecationDownloadNativeIcon,electronDeprecationQrAwareness:m.ElectronDeprecationDownloadNativeGreenIcon,webDesktopUpsell:y.ElectronDeprecationDownloadNativeIcon,resumeProgress:S.OfflineMessageLoadIcon,invalidPoll:v.WarningIcon}[e.type],U=(0,M.jsx)(k,{"aria-label":e.iconDescription}),G=e.iconSvg&&(0,g.sanitizeNoticeSVG)(e.iconSvg),x=G?(0,M.jsx)("span",{"aria-label":e.iconDescription,dangerouslySetInnerHTML:{__html:G}}):U;let B;switch(e.type){case"notice":B=(0,M.jsx)(E.FlexRow,{className:C.default.noticeSvgWrapper,align:"center",justify:"center",children:x});break;case"fatal":B=(0,M.jsx)(E.FlexRow,{className:C.default.fatalSvgWrapper,align:"center",justify:"center",children:(0,M.jsx)(k,{})});break;case"resumeProgress":case"nuxGreen":B=(0,M.jsx)(E.FlexRow,{className:C.default.nuxGreenSvgWrapper,align:"center",justify:"center",children:(0,M.jsx)(k,{})});break;case"nuxBlue":case"announcement":B=(0,M.jsx)(E.FlexRow,{className:C.default.nuxBlueSvgWrapper,align:"center",justify:"center",children:(0,M.jsx)(k,{})});break;case"generalAlert":B=(0,M.jsx)(E.FlexRow,{className:C.default.fatalSvgWrapper,align:"center",justify:"center",children:(0,M.jsx)(k,{width:36,height:36})});break;case"invalidPoll":B=(0,M.jsx)(E.FlexRow,{className:(0,I.default)(R),align:"center",justify:"center",children:(0,M.jsx)(k,{width:24,height:21})});break;default:B=(0,M.jsx)(k,{})}return(0,M.jsx)("div",{className:C.default.wrapper,children:(0,M.jsxs)("div",{className:w,children:[(0,M.jsx)("div",{className:(0,O.default)((0,h.cx)({[C.default.icon]:!0,[C.default.action]:t})),onClick:t,children:B}),(0,M.jsxs)("div",{className:(0,O.default)((0,h.cx)({[C.default.body]:!0,[C.default.action]:t})),onClick:t,children:[D,(0,M.jsx)(b,{isNotice:"notice"===r,text:N})]}),L]})})};var i=n(433224),a=n(384824),o=n(559261),s=n(695273),l=n(972894),u=n(376242),c=n(852246),d=n(350240),p=n(718620),_=n(910648),f=n(266888),h=n(113704),g=n(694209),m=n(309285),y=n(355716),E=n(690495),S=n(406405),T=r(n(397778)),v=n(609392),A=n(341386),C=r(n(248651)),P=n(548360),O=r(n(120992)),I=r(n(156720)),M=n(785893);function b(e){let{isNotice:t,text:n}=e;return n?t?(0,M.jsx)("div",{dangerouslySetInnerHTML:{__html:(0,g.sanitizeNoticeText)(n)},className:C.default.text}):(0,M.jsx)("div",{className:C.default.text,children:n}):null}const R={width:"dyxdk6fi",height:"m3o1wsh7",borderTopStartRadius:"ig3kka7n",borderTopEndRadius:"a57u14ck",borderBottomEndRadius:"a4bg1r4i",borderBottomStartRadius:"h1a3x9ys",backgroundColor:"mx3ldrxl",color:"pahbacuu"}},444467:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DesktopUpsellButterBar=function(e){const{title:t,action:n}=T(),r=function(){var e=(0,i.default)((function*(){n()}));return function(){return e.apply(this,arguments)}}();return(0,E.jsx)(_.default,{type:"webDesktopUpsell",title:t,text:(0,E.jsxs)(E.Fragment,{children:[f.fbt._("Make voice and video group calls, get a faster app experience, and more!",null,{hk:"NEJNy"}),(0,E.jsx)(p.default,{children:f.fbt._("Download now",null,{hk:"2alUYB"})})]}),action:r,onDismiss:e.onDismiss},"web_desktop_upsell")},t.getCommonDesktopUpsellUiContent=T,t.useCanUserDownloadUwp=v,t.useShouldShowDesktopUpsellButterbar=function(){const[e,t,n]=(0,m.default)(u.NUX.DESKTOP_UPSELL),r=(0,g.useABPropConfigValue)("desktop_upsell_win_butterbar"),i=v();let o=!(0,l.isSMB)()&&i&&e&&r;if(o){const e=C();null==e?d.userPreferencesStore.set(c.KEYS.FIRST_SEEN_DESKTOP_UPSELL_BBAR,(0,a.unixTime)()):o=(0,a.happenedWithin)(e,S)}const s=(0,h.useCallback)((()=>{o&&n()}),[o,n]);return(0,y.useAlarm)(s,function(){const e=C();if(null==e)return(0,a.unixTime)();return(0,a.futureUnixTime)(S,e)}(),{immediate:!0,isGlobal:!0}),[o,n]},t.useShouldShowDesktopUpsellIntroPanelCTA=function(){const e=(0,g.useABPropConfigValue)("desktop_upsell_win_ctas"),t=v();return e&&t},t.useShowDektopUpsellChatlistDropdownMenuButton=function(){const e=(0,g.useABPropConfigValue)("desktop_upsell_win_dropdown_btn"),t=(0,s.isWebUserOnSupportedWindowsOSForUWPSync)();return e&&!0===t};var i=r(n(348926)),a=n(990445),o=n(753233),s=n(97858),l=n(828770),u=n(95589),c=n(94872),d=n(53575),p=(r(n(571834)),r(n(564128))),_=r(n(407013)),f=n(548360),h=n(667294),g=n(906131),m=r(n(409413)),y=n(85284),E=n(785893);const S=14*a.DAY_SECONDS;function T(){return{title:f.fbt._("Introducing the new desktop app",null,{hk:"38Tsvq"}),action:()=>{(0,o.openExternalLink)(o.WINDOWS_STORE_URI,{target:o.ExternalLinkTarget.DEEPLINK_IN_CURRENT_TAB})}}}function v(){const[e,t]=(0,h.useState)(!1);return(0,h.useEffect)((()=>{(0,s.isWebUserOnSupportedWindowsOSForUWPAsync)().then((e=>{t(e)}))}),[]),e}let A=null;function C(){if(null!=A)return A;const e=parseInt(d.userPreferencesStore.get(c.KEYS.FIRST_SEEN_DESKTOP_UPSELL_BBAR),10);return Number.isNaN(e)||(A=(0,a.castToUnixTime)(e)),A}},328620:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ActionToast=function(e){const{settleDuration:t=_,toastPosition:n=f.LEFT,initialAction:i,pendingAction:a,id:h}=e,[g,m]=(0,c.useState)(i),[y,E]=(0,c.useState)(i),[S,T]=(0,c.useState)(!0),v=(0,d.default)(g),A=(0,c.useRef)(null),C=()=>{y&&y.handler&&y.handler().catch((()=>{}))};(0,c.useEffect)((()=>{i!==v&&(m(i),E(i),T(!0))}),[i,v]);const P=()=>{u.ToastManager.close(h)};if((0,c.useEffect)((()=>{(e=>{A.current&&A.current.controller.abort();const n=new r,i=n.signal,a=e.then((e=>{if(i.aborted)throw new o.AbortError;E(e),T(!1)})).catch((e=>{if(e.name===o.ABORT_ERROR)throw e;E(e),T(!1)})).then((()=>(0,s.delayMs)(t))).then((()=>{if(i.aborted)throw new o.AbortError;u.ToastManager.close(h)})).catch((0,o.catchAbort)((()=>{})));A.current={promise:a,controller:n}})(a)}),[a]),!y)return null;let O,I;y.action&&y.handler&&(O=(0,p.jsx)(l.ToastActionBtn,{buttonText:y.action,onClick:C}));S||(I=(0,p.jsx)(l.ToastDismissBtn,{onClick:P}));return(0,p.jsx)(l.ToastBody,{toastPosition:n,actionText:y.text,actionButtons:O,dismissButton:I})},t.ToastPosition=t.ActionType=void 0,t.genId=function(e){return(0,a.default)(e||"action_toast")};var a=i(n(873955)),o=n(88237),s=n(36530),l=n(625786),u=n(390737),c=n(667294),d=i(n(207100)),p=n(785893);const _=5e3,f={LEFT:"LEFT",RIGHT:"RIGHT"};t.ToastPosition=f;t.ActionType=class{constructor(e,t){if(!e)throw new Error("ActionType must have text!");this.text=e,t&&(this.action=t.actionText,this.handler=t.actionHandler)}}},731792:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const{className:t}=e;return(0,s.jsx)("div",{className:(0,a.default)((0,o.default)(l),t),children:(0,s.jsx)(i.Spinner,{size:50,stroke:3,color:"solidwhite"})})};var i=n(956113),a=r(n(120992)),o=r(n(156720)),s=n(785893);const l={position:"lhggkp7q",top:"qq0sjtgm",start:"tkdu00h0",display:"p357zi0d",alignItems:"gndfcl4n",justifyContent:"ac2vgrno",width:"ln8gz9je",height:"ppled2lx",backgroundColor:"epdck8xl",borderTopStartRadius:"g9p5wyxn",borderTopEndRadius:"i0tg5vk9",borderBottomEndRadius:"aoogvgrq",borderBottomStartRadius:"o2zu3hjb"}},692629:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{testid:t,children:n,className:r,xstyle:m,disabled:y,onClick:E,nowrap:S,spinner:T,type:v}=e;const[A,C]=(0,f.default)(E,{disabled:y}),[P,O]=(0,p.default)(),I=(0,_.default)(A,P);let M;switch(v){case"primary":M="white";break;case"secondary":case"plain-white":case"simplified":M="highlight";break;default:M="default"}y&&(M="default");return(0,h.jsx)("div",(0,i.default)((0,i.default)({},C),{},{"data-testid":t,className:(0,c.default)(u.default.button,(0,a.cx)({[u.default.primary]:"primary"===v,[u.default.secondary]:"secondary"===v,[u.default.plainWhite]:"plain-white"===v,[u.default.disabled]:y,[u.default.nowrap]:S,[u.default.simplified]:"simplified"===v,[u.default.warning]:"warning"===v,[u.default.solidWarning]:"solidWarning"===v,[u.default.strong]:"strong"===v,[u.default.strongPrimary]:"strong-primary"===v,[u.default.warningSecondary]:"warning-secondary"===v,[u.default.itemFocused]:O}),r,(0,d.default)(m)),ref:I,children:(0,h.jsxs)(o.FlexRow,{align:"center",justify:"center",children:[(0,h.jsx)(s.default,{testid:"content",children:null!=n?n:null}),T?(0,h.jsx)(s.default,{testid:"spinner",xstyle:g.spinner,children:(0,h.jsx)(l.Spinner,{color:M,size:16})}):null]})}))};var i=r(n(81109)),a=n(113704),o=n(690495),s=r(n(469733)),l=n(956113),u=r(n(703010)),c=r(n(120992)),d=r(n(156720)),p=r(n(380362)),_=r(n(676185)),f=r(n(415917)),h=n(785893);const g={spinner:{paddingStart:"mhcwslh8"}}},950987:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.FocusTheme=t.Clickable=void 0;var i=r(n(83162)),a=r(n(395967)),o=r(n(120992)),s=n(667294),l=r(n(156720)),u=r(n(676185)),c=n(785893);const d=n(76672).Mirrored(["Default","Image"]);t.FocusTheme=d;const p={imageFocus:{":focus":{borderTopStartRadius:"mmjxyicr",borderTopEndRadius:"r1jx4bdh",borderBottomEndRadius:"f9yclydc",borderBottomStartRadius:"mtzt60z0",boxShadow:"esbo3we0",filter:"gegvef6x"}},defaultFocus:{":focus":{borderTopStartRadius:"mmjxyicr",borderTopEndRadius:"r1jx4bdh",borderBottomEndRadius:"f9yclydc",borderBottomStartRadius:"mtzt60z0",boxShadow:"esbo3we0"}}};function _(e,t){let{onClick:n,role:r="button",tabIndex:_=0,ariaLabel:f,dataTestId:h,className:g,children:m,focusTheme:y=d.Default,inlineStyle:E}=e;const{isKeyboardUser:S}=(0,a.default)(),T=(0,s.useRef)(null),v=(0,u.default)(t,T);return(0,c.jsx)("div",{onClick:n,role:r,tabIndex:_,"data-testid":h,"aria-label":f,ref:v,className:(0,o.default)(g,(0,l.default)(S&&d.Default===y&&p.defaultFocus,S&&d.Image===y&&p.imageFocus)),onKeyDown:e=>{var t;(0,i.default)(e)&&n&&(null===(t=T.current)||void 0===t||t.click())},style:E,children:m})}const f=(0,s.forwardRef)(_);t.Clickable=f},196554:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;const{children:n,href:r,onClick:l,title:u,className:c,tabIndex:d,xstyle:p}=e;return(0,o.jsx)("a",{"data-testid":null!==(t=e.testid)&&void 0!==t?t:"clickable-link",className:(0,i.default)(c,(0,a.default)(s),(0,a.default)(p)),href:null!=r?r:void 0,onClick:e=>{null!=r&&(e.metaKey||e.altKey)||(e.preventDefault(),l(e))},role:"button",rel:"noreferrer noopener",target:"_blank",title:u,tabIndex:null!=d?d:void 0,children:n})};var i=r(n(120992)),a=r(n(156720)),o=n(785893);const s={cursor:"ajgl1lbb"}},152730:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Type=t.ContextMenuManager=void 0;var i=r(n(81109)),a=n(780549),o=n(664149),s=r(n(932325)),l=r(n(8073)),u=r(n(114078)),c=r(n(844453)),d=n(667294),p=n(148725),_=n(785893);const f={MENU:"MENU",TOOLTIP:"TOOLTIP"};function h(e,t){const n=(0,d.useRef)(null),r=(0,d.useRef)(null),[h,g]=(0,d.useState)(null),[y,E]=(0,d.useState)(null);(0,p.useListener)(a.Cmd,e.type===f.MENU?"open_context_menu":"open_tooltip",((e,t)=>{var n,a,l,u,c,d,p,_,f;null==h||h.uim.pop(),r.current=t;const{menuOptions:m,uim:y}=e,{event:S}=m;null==S||S.stopPropagation();const T=null==S?0:10;E(null),g((0,i.default)((0,i.default)({},m),{},{type:null!==(n=m.type)&&void 0!==n?n:o.MenuType.Dropdown,originX:null!==(a=null!==(l=null==S?void 0:S.clientX)&&void 0!==l?l:m.offsetX)&&void 0!==a?a:0,originY:null!==(u=null!==(c=null==S?void 0:S.clientY)&&void 0!==c?c:m.offsetY)&&void 0!==u?u:0,offsetX:null!==(d=m.offsetX)&&void 0!==d?d:T,offsetY:null!==(p=m.offsetY)&&void 0!==p?p:T,dirX:null!==(_=m.dirX)&&void 0!==_?_:s.default.isRTL()?o.DirX.LEFT:o.DirX.RIGHT,dirY:null!==(f=m.dirY)&&void 0!==f?f:o.DirY.BOTTOM,key:Math.random(),uim:y}))})),(0,p.useListener)(a.Cmd,e.type===f.MENU?"close_context_menu":"close_tooltip",(e=>{null!=e&&(null==h?void 0:h.uim)!==e||(g(null),E(null))})),(0,d.useLayoutEffect)((()=>{const e=n.current;if(null==h||null==e)return;if(null!=y)return;const t=e.clientWidth,r=e.clientHeight+10;E(function(e){const{anchor:t,temporaryMenuPosition:n,menuWidth:r,menuHeight:i}=e,a=window.innerWidth,s=window.innerHeight,{originX:l,originY:u,offsetX:c,offsetY:d,dirX:p,dirY:_}=n;let f=l,h=l,g=u,y=u,E=0;if(t&&t instanceof HTMLElement){const e=t.getBoundingClientRect();f=e.left,h=e.right,y=e.bottom,g=e.top,E=t.offsetWidth}let S=p;S===o.DirX.RIGHT&&f+r>a&&h-r>0?S=o.DirX.LEFT:S===o.DirX.LEFT&&h-r<0&&f+r<a?S=o.DirX.RIGHT:S===o.DirX.CENTER&&(h+r/2>a?S=o.DirX.LEFT:f-r/2<0&&(S=o.DirX.RIGHT));let T,v=_;v===o.DirY.BOTTOM&&y+i+d>s&&g-i>0?v=o.DirY.TOP:v===o.DirY.TOP&&g-0-i<0&&y+i+d<s&&(v=o.DirY.BOTTOM);T=v===o.DirY.TOP?g:y;let A=c,C=d;t||(S===o.DirX.LEFT&&(A=0),v===o.DirY.TOP&&(C=0));return{dirX:S,dirY:v,originX:m(S,f,h,E),originY:T,offsetX:A,offsetY:C}}({anchor:h.anchor,temporaryMenuPosition:h,menuWidth:t,menuHeight:r}))}),[h,y]),(0,d.useImperativeHandle)(t,(()=>({isOpen:()=>null!=h})));const S=(0,d.useCallback)((e=>{var t;null!=e&&(null===(t=r.current)||void 0===t||t.call(r,e.getElement()),r.current=null)}),[]);let T;if(null==h)T=(0,_.jsx)(c.default,{transitionName:"dropdown"});else{const{menu:e,key:t,type:r,autoFocus:i,findFirstItem:a,horizontal:s,theme:l,tooltipColorScheme:p}=h,{originX:f,originY:g,offsetX:m,offsetY:E,dirX:v,dirY:A}=null!=y?y:h,C=Array.isArray(e)?e.map((e=>(0,d.cloneElement)(e,{theme:l}))):e;T=(0,_.jsx)(c.default,{transitionName:r===o.MenuType.Picker?"dropdown-picker":"dropdown",children:(0,_.jsx)(o.Dropdown,{ref:n,origin:{x:f+m,y:g+E},type:r,dirX:v,dirY:A,horizontal:s,autoFocus:i,findFirstItem:a,isTemporaryRender:null==y,tooltipColorScheme:p,children:(0,_.jsx)(u.default,{ref:S,children:C})},`key-${t}`)})}return(0,_.jsx)(l.default.Consumer,{children:e=>(0,_.jsx)(l.default.Provider,{value:(null==h?void 0:h.uim)||e,children:T})})}t.Type=f;const g=(0,d.forwardRef)(h);function m(e,t,n,r){switch(e){case o.DirX.RIGHT:return t;case o.DirX.LEFT:return n;case o.DirX.CENTER:return t+r/2}}t.ContextMenuManager=g},23641:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultIcon=J,t.DefaultIconThemeType=void 0,t.DetailImage=function(e){const{id:t,size:n,quality:r=Y.Low,loader:a,onClick:o,onLoad:s,quoted:d,shape:_,border:f,waitIdle:h,ephemeralIcon:g,theme:m,alt:T,xstyle:A,authorColor:O,loadPicture:M=!0,loadAnimation:b=!0,tabIndex:U,ariaLabel:x}=e,F=(0,k.default)(),V=(0,L.useRef)(null),Q=(0,L.useMemo)((()=>l.ChatCollection.get(t)),[t]);let X;(0,G.useListener)((null==Q?void 0:Q.isGroup)?Q.groupMetadata:Q,"change:ephemeralDuration",F),X="number"==typeof n?n>0?n:j.Small:null!=n?n:j.Small;const Z={height:q(X),width:q(X)};o&&(Z.cursor="pointer");let ee;if((0,C.communitiesEnabled)())if(null!=Q){var te;if(Q.isGroup)ee=null===(te=Q.groupMetadata)||void 0===te?void 0:te.groupType}else{const e=I.default.get(t.toString());ee=null==e?void 0:e.groupType}const ne=(0,w.default)(R.default.avatar,(0,p.cx)({[R.default.status_v3]:"status_v3"===m,[R.default.avatarSquare]:_===K.Square,[R.default.avatarBorder]:f,[R.default.avatarSquircle]:_===K.Squircle,[R.default.avatarDefaultAnnouncementGroup]:ee===E.GroupType.DEFAULT_ANNOUNCEMENT_GROUP,[R.default.avatarProfileRingBorder]:"status_v3_profile_photo_ring"===m,[(0,D.default)(W.dimmed)]:(0,u.isIntegritySuspendedCommunity)(Q),[R.default.inviteModal]:"invite_modal"===m,[R.default.polls]:"polls_sender"===m||"polls_receiver"===m,[R.default.pollsSender]:"polls_sender"===m,[R.default.pollsReceiver]:"polls_receiver"===m,[R.default.groupProfilePicture]:"group_profile_picture"===m,[R.default.detailButton]:null!=o}),(0,D.default)(A)),re=null!=o?{tabIndex:U,role:"button","aria-label":x,onKeyDown:e=>{var t;(0,v.default)(e)&&(null===(t=V.current)||void 0===t||t.click())}}:{},ie=(0,B.jsx)(J,{id:t,quoted:d,groupType:ee,theme:"group_profile_picture"===m?H.GroupChatProfilePicture:null,authorColor:O}),ae=(0,B.jsx)(S.default,{id:t,onComplex:()=>{let e,n=null;return e=M?P.ProfilePicThumbCollection.gadd(t):P.ProfilePicThumbCollection.get(t),n=e?r===Y.High?(0,B.jsx)($,{profilePicThumb:e,defaultIcon:ie,loader:a,onLoad:s,alt:T}):(0,B.jsx)(z,{profilePicThumb:e,defaultIcon:ie,loader:a,onLoad:s,alt:T,loadingAnimation:b}):ie,(0,B.jsxs)("div",(0,i.default)((0,i.default)({ref:V},re),{},{className:ne,style:Z,onClick:o,children:[null,n,null]}))},waitIdle:h,children:(0,B.jsx)("div",(0,i.default)((0,i.default)({ref:V},re),{},{className:ne,style:Z,onClick:o,children:ie}))});let oe;null!=g&&Q&&(0,c.isEphemeralSettingOn)(Q)&&(oe=(0,B.jsxs)("div",{className:R.default.wrapper,"aria-label":N.fbt._("Profile picture, disappearing messages on",null,{hk:"2Riroy"}),children:[(0,B.jsx)("div",{className:(0,w.default)(R.default.badge,(0,p.cx)({[R.default.chatList]:"chat-list"===g,[R.default.conversationHeader]:"conversation-header"===g})),children:(0,B.jsx)(y.DisappearingIcon,{className:R.default.badgeIcon})}),ae]}));return oe||ae},t.DetailImageCommon=V,t.DetailImageSize=t.DetailImageShape=t.DetailImageQuality=void 0,t.getSize=q;var i=r(n(81109)),a=n(201063),o=n(474518),s=r(n(731792)),l=n(965012),u=n(909450),c=n(299261),d=n(247365),p=n(113704),_=n(191170),f=n(998266),h=n(999784),g=n(412213),m=n(273415),y=n(951387),E=n(862159),S=r(n(373347)),T=r(n(488922)),v=r(n(83162)),A=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=F(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),C=n(97858),P=n(292390),O=n(411067),I=r(n(56992)),M=(n(459857),n(709333)),b=r(n(124928)),R=r(n(631680)),N=n(548360),w=r(n(120992)),L=n(667294),D=r(n(156720)),k=r(n(229439)),U=r(n(470649)),G=n(148725),x=n(990144),B=n(785893);function F(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(F=function(e){return e?n:t})(e)}const j=n(76672).Mirrored(["ExtraSmall","Small","Medium","Large","None"]);t.DetailImageSize=j;const Y=n(76672).Mirrored(["Low","High"]);t.DetailImageQuality=Y;const K=n(76672).Mirrored(["Circle","Square","Squircle"]);t.DetailImageShape=K;const H=n(76672).Mirrored(["GroupChatProfilePicture"]);t.DefaultIconThemeType=H;const W={announcementSpeaker:{color:"jn5oezdz"},communitySquircle:{color:"bk9ojlrj"},avatarDefaultPSA:{borderTopStartRadius:"g9p5wyxn",borderTopEndRadius:"i0tg5vk9",borderBottomEndRadius:"aoogvgrq",borderBottomStartRadius:"o2zu3hjb"},dimmed:{opacity:"kaq19mkm"}};function V(e){const{profilePicThumbImg:t,spinnerClassName:n,imgClassName:r,alt:o,onLoad:l,profilePicThumb:u,loader:c=!1,theme:d,loadingAnimation:_=!0}=e,[f,h]=(0,L.useState)(!0),[g,m]=(0,L.useState)(!1),[y,E]=(0,L.useState)(!1),[S,v]=(0,L.useState)(t),C=(0,L.useRef)(Boolean(t)),P=(0,L.useRef)(!1),I="business"!==d,M=(0,U.default)((()=>c&&I?new a.ShiftTimer((()=>{E(!0)})):null));t!==S&&(v(t),h(!0),m(!1),E(!1));const b=()=>{var e;null===(e=M.current)||void 0===e||e.cancel(),h(!1),m(!0),null==l||l()},N=e=>{var t;if(null===(t=M.current)||void 0===t||t.cancel(),e instanceof A.ServerStatusError)switch(e.status){case 403:u.markStale({eurl:!0}),P.current||(P.current=!0,u.validate());break;case 410:u.markStale()}h(!1),m(!1)};(0,L.useEffect)((()=>{var e;const t=M;return null===(e=t.current)||void 0===e||e.onOrAfter(100),()=>{var e;null===(e=t.current)||void 0===e||e.cancel()}}),[u,M]);let D={[R.default.isLoaded]:!f};r&&(D=(0,i.default)((0,i.default)({},D),{},{[r]:"string"==typeof r}));const k=(0,w.default)(R.default.avatarImage,(0,p.cx)(D),(0,p.cx)({[R.default.avatarImageNoTransition]:!1===_&&C.current}));let G,x;!I||!c||!y||!f||!(0,O.unproxy)(u).stale&&!S||(G=(0,B.jsx)(s.default,{className:n},"spinner")),S&&(x=(0,B.jsx)(T.default,{src:S,hasPrivacyChecks:!0,crossOrigin:!1,className:k,draggable:!1,onLoad:b,onError:N,alt:o},"image"));let F=g?null:e.defaultIcon;return!1===_&&(F=null!=x?null:e.defaultIcon),(0,B.jsxs)(B.Fragment,{children:[G,F,x]})}function $(e){const t=(0,x.useModelValues)(e.profilePicThumb,["imgFull"]);return(0,B.jsx)(V,(0,i.default)((0,i.default)({},e),{},{profilePicThumbImg:t.imgFull}))}function z(e){const t=(0,x.useModelValues)(e.profilePicThumb,["img"]);return(0,B.jsx)(V,(0,i.default)((0,i.default)({},e),{},{profilePicThumbImg:t.img}))}function q(e){if("string"!=typeof e)return e;switch(e){case j.ExtraSmall:return 40;case j.Small:return 49;case j.Medium:return 100;case j.Large:return 200;case j.None:return}}function J(e){let{id:t,quoted:n,groupType:r,theme:i,authorColor:a}=e,s=(0,B.jsx)(g.DefaultUserIcon,{});b.default.isUser(t)&&!b.default.isPSA(t)&&n?s=(0,B.jsx)(m.DefaultUserSquareIcon,{}):b.default.isGroup(t)?s=r===E.GroupType.DEFAULT_ANNOUNCEMENT_GROUP?(0,B.jsx)(o.AnnouncementSpeakerIcon,{iconXstyle:W.announcementSpeaker,directional:!0}):r===E.GroupType.COMMUNITY?(0,B.jsx)(d.CommunitySquircleIcon,{iconXstyle:W.communitySquircle}):(0,B.jsx)(f.DefaultGroupIcon,{}):b.default.isBroadcast(t)?s=(0,B.jsx)(_.DefaultBroadcastIcon,{}):b.default.isPSA(t)&&(s=(0,B.jsx)(M.WaChatPsaIcon,{iconXstyle:W.avatarDefaultPSA}));let l=(0,B.jsx)("div",{className:R.default.avatarDefault,children:s},"default");return i===H.GroupChatProfilePicture&&(l=(0,B.jsx)("div",{className:R.default.groupProfilePicturePlaceholderContainer,children:(0,B.jsx)(h.DefaultUserColorIcon,{className:`color-${null!=a?a:1}`})},"default")),l}},225148:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=(0,d.useContext)(s.InitialEmojisCompletionContext);(0,d.useEffect)((()=>{const n=f(e.emoji);null!=n&&(t.incrementLoadingEmojisCount(),a.AssetLoader.loadEmoji(n,i.LOAD_PRIORITY.LAZY_LOAD_EMOJI).finally((()=>{t.decrementLoadingEmojisCount()})))}),[t,e.emoji]);const{className:n,element:r,emoji:u,selectable:m,selected:y,size:E,src:S,onLoad:T,tabIndex:v,xstyle:A}=e,C=f(u);if(null==C)return null;let P,O;S||(P=h(C,E),O=g(C,E));const I=(0,c.default)(n,O,(0,o.cx)({selected:y}),(0,p.default)(A));if("span"===r)return(0,_.jsx)("span",{"data-testid":u,"data-emoji":u,className:I,"aria-label":u,style:P,onLoad:T,tabIndex:v,"data-unicode":e["data-unicode"],"data-variant":e["data-variant"],"data-emoji-index":e["data-emoji-index"]});return(0,_.jsx)(l.default,{alt:u,className:I,draggable:!1,onLoad:T,plainText:u,selectable:m,style:P,src:S})};var i=n(135630),a=n(789379),o=n(113704),s=n(413677),l=r(n(488922)),u=n(429334),c=r(n(120992)),d=n(667294),p=r(n(156720)),_=n(785893);const{getGlyphId:f,getStyle:h,getCssClasses:g}=u.EmojiUtil},305521:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.EmojiText=t.EMOJI_SIZE=void 0;var i=r(n(81109)),a=r(n(23279)),o=v(n(553272)),s=r(n(132375)),l=n(780549),u=n(306703),c=r(n(146375)),d=v(n(675886)),p=r(n(893874)),_=r(n(932325)),f=n(696430),h=n(368170),g=n(429334),m=r(n(120992)),y=n(667294),E=r(n(156720)),S=n(785893);function T(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(T=function(e){return e?n:t})(e)}function v(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=T(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}const A={breakWord:{wordBreak:"cw3vfol9"},clickable:{cursor:"ajgl1lbb",":hover":{textDecoration:"edeob0r2"}},dirMismatch:{display:"f804f6gw",width:"ln8gz9je"},ellipsify:{flexGrow:"ggj6brxn",overflowX:"gfz4du6o",overflowY:"r7fjleex",position:"g0rxnol2",textOverflow:"lhj4utae",whiteSpace:"le5p0ye3"},inlineblock:{display:"l7jjieqr"},multiline:{whiteSpace:"i033jvx7"},preformatted:{whiteSpace:"ag95hn57",width:"boenfpwf",display:"l7jjieqr"}},C={SMALL:"SMALL",LARGE:"LARGE"};t.EMOJI_SIZE=C;const P=4096;function O(e){return g.EmojiUtil.containsEmoji(e.substring(0,P))}class I extends y.PureComponent{constructor(){super(...arguments),this.state={text:String(this.props.text||""),ellipsified:null},this.refContainer=(0,y.createRef)(),this._registeredListener=!1,this._recompute=(0,a.default)((()=>{this.setState({ellipsified:null},this.ellipsify)}),10),this._buildBidiModel=e=>e.reduce(((e,t)=>{if("string"==typeof t){const n=t.split(/(\r?\n|\r)/g).map((e=>({dir:o.dir(e),content:e})));return e.concat(n)}return e.push({content:t}),e}),[]),this.ellipsify=()=>{const e=this.refContainer.current;if(!e)return;const t=(0,s.default)(e.parentElement,"node.parentElement"),n=e.querySelectorAll("img");if(!n.length)return;const r=e.clientWidth;e.style.overflow="visible";const i=e.clientWidth!==r;if(e.style.overflow="hidden",!i)return;const a=Boolean(_.default.isRTL())===Boolean(this.props.dirMismatch),o=n[function(e,t,n){let r=0;for(;r<e.length;){const i=e[r];if(n&&i.offsetLeft+i.clientWidth>=t)break;if(!n&&i.offsetLeft<=t)break;r++}return r}(n,a?t.clientWidth-function(e,t){let n=0;const{childNodes:r}=e;for(let e=0;e<r.length;e++){const i=r[e];if(i===t)break;n+=i instanceof Element?i.clientWidth:0}return n}(t,e)-12:12,a)];this.setState({ellipsified:b(e,o)})},this._ellipsifyCheck=()=>O(this.state.text)&&this.ellipsify(),this._explodeOutputByLines=(e,t)=>{const{direction:n}=this.props,r=[],i=this._buildBidiModel(e);let a=[],o=n;"auto"!==n&&"inherit"!==n||(o=null);const s=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=null==o||null==n||o===n,s=i?null:o,l=!i||"rtl"===o!==_.default.isRTL(),u=l?(0,E.default)(A.dirMismatch):null;r.push((0,S.jsxs)("span",{dir:s,className:u,children:[a,t?"…":null]},e))};for(let e=0;e<i.length;e++){const t=i[e];o!==t.dir&&null!=o&&void 0!==t.dir&&(s(e),a=[]),void 0!==t.dir&&(o=t.dir),a.push(t.content)}return s(i.length,t),r},this._registerResizeListener=()=>{this._registeredListener||(this._registeredListener=!0,this.props.listeners.add(window,"resize",this._recompute),this.props.listeners.add(l.Cmd,"resize",this._recompute))},this.componentDidMount=()=>{!h.UA.supportsEmojiEllipsification&&this.props.ellipsify&&O(this.state.text)&&this._registerResizeListener(),!h.UA.supportsEmojiEllipsification&&this.props.ellipsify&&this._ellipsifyCheck()},this._unregisterResizeListener=()=>{this._registeredListener&&(this._registeredListener=!1,this.props.listeners.remove(window,"resize",this._recompute),this.props.listeners.remove(l.Cmd,"resize",this._recompute))},this.render=()=>{var e,t;if(!this.state.text)return null;const{onClick:n,ellipsify:r,dirMismatch:i,inferLinesDirection:a,inlineblock:o,direction:s,textLimit:l,multiline:_,preformatted:f,breakWord:h,emojiXstyle:g}=this.props,y=this.state.ellipsified?this.state.ellipsified:this.state.text,T="inherit"===s?null:s||"auto",v=!!this.props.selectable,C=this.props.formatters||d.EmojiOnly({selectable:v,emojiXstyle:g});let O=l||1/0;r&&y.length>P&&O>P&&(O=P);const I=(0,m.default)(this.props.className,(0,E.default)(!!r&&A.ellipsify,!!o&&A.inlineblock,!!n&&A.clickable,i&&!a&&A.dirMismatch,_&&A.multiline,f&&A.preformatted,h&&A.breakWord,this.props.xstyle)),M=(0,c.default)(y,C,p.default,void 0,O),b=!!this.state.ellipsified||y.length>O,R=this.props.inferLinesDirection?this._explodeOutputByLines(M,b):M,N=null!==(e=this.props.title)&&void 0!==e?e:this.state.text,w=null!==(t=this.props.ariaLabel)&&void 0!==t?t:"";return(0,S.jsx)(u.Selectable,{"data-testid":this.props.testid,className:I,dir:T,element:this.props.element,onClick:n,ref:this.refContainer,selectable:v,title:this.props.titlify?N:void 0,"aria-label":w,children:R})}}getContainerElement(){return this.refContainer.current}static getDerivedStateFromProps(e,t){var n;let r=null;const a=String(null!==(n=e.text)&&void 0!==n?n:"");return a!==t.text&&(r={text:a}),h.UA.supportsEmojiEllipsification||!e.ellipsify||null==r||O(a)||(r=(0,i.default)((0,i.default)({},r),{},{ellipsified:null})),r}getWidth(){const e=this.refContainer.current;return e?e.getBoundingClientRect().width:0}componentDidUpdate(e,t){!h.UA.supportsEmojiEllipsification&&this.props.ellipsify&&t.text!==this.state.text&&(O(this.state.text)?(this._recompute(),this._registerResizeListener()):this._unregisterResizeListener())}componentWillUnmount(){this._recompute.cancel()}}I.defaultProps={element:"span",emojiSize:C.SMALL,textLimit:1/0};const M=(0,f.ListenerHOC)(I);function b(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{found:!1};if(e===t)return n.found=!0,"";if(e instanceof HTMLImageElement)return e.alt;if(e.nodeType===Node.TEXT_NODE)return e.nodeValue;const r=R(e);let i="",a=0;for(;a<e.childNodes.length&&(i+=b(e.childNodes[a],t,n),!n.found);)a++;if(null==r)return i;const[o,s]=r;return`${o}${i}${s}`}function R(e){if(e instanceof Element)switch(e.tagName){case"CODE":return["```","```"];case"STRONG":return["*","*"];case"EM":return["_","_"];case"DEL":return["~","~"];case"LI":return["* ",""];default:return null}return null}t.EmojiText=class extends M{getWidth(){return this.getComponent().getWidth()}getContainerElement(){return this.getComponent().getContainerElement()}}},753233:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.WINDOWS_STORE_URI=t.ExternalLinkTarget=t.ExternalLink=void 0,t.isOpeningDeeplinkInCurrentTab=function(){return h},t.openExternalLink=function(e,t){if(e!==f&&!s.default.hasValidUrlScheme(e))return void(e.toLowerCase().startsWith("javascript:")&&(__LOG__(4,void 0,new Error,!0)`Bad url: ${e}`,SEND_LOGS("URL error")));const{target:n=g.NEW_TAB}=null!=t?t:{},r=document.createElement("a");r.href=e,n===g.NEW_TAB?r.target="_blank":n===g.DEEPLINK_IN_CURRENT_TAB&&(h=!0);r.rel="noopener noreferrer",r.style.display="none",document.body&&document.body.appendChild(r);r.click(),document.body&&document.body.removeChild(r);n===g.DEEPLINK_IN_CURRENT_TAB&&setTimeout((()=>{h=!1}),1e3)};var i=n(203910),a=r(n(846870)),o=r(n(83162)),s=r(n(79291)),l=(r(n(641523)),r(n(120992))),u=n(667294),c=r(n(156720)),d=n(785893);function p(e){const t=(0,u.useRef)(),n=e=>{var n;(0,o.default)(e)&&(null===(n=t.current)||void 0===n||n.click())},{children:r,className:p,href:_,isLongTemplateUrl:f,onClick:h,testid:g,"aria-label":m,xstyle:y}=e;if(!s.default.hasValidUrlScheme(_))return _.toLowerCase().startsWith("javascript:")&&(__LOG__(4,void 0,new Error,!0)`Bad url: ${_}`,SEND_LOGS("URL error")),null;const E=(0,l.default)(p,(0,c.default)(y));return f?(0,d.jsxs)("a",{ref:t,rel:"noopener noreferrer",className:E,href:_,target:"_blank",onClick:h,onKeyDown:n,"aria-label":m,children:[(0,i.substring)(_,0,a.default.TEMPLATE_URL_START),(0,d.jsx)("span",{children:"…"}),(0,i.substring)(_,_.length-a.default.TEMPLATE_URL_END,_.length)]}):(0,d.jsx)("a",{ref:t,rel:"noopener noreferrer",className:E,href:_,target:"_blank",onClick:h,onKeyDown:n,"data-testid":g,"aria-label":m,children:r})}const _=(0,u.memo)(p);t.ExternalLink=_;const f="ms-windows-store://pdp/?productid=9NKSQGP7F2NH&mode=mini";t.WINDOWS_STORE_URI=f;let h=!1;const g=n(76672).Mirrored(["NEW_TAB","DEEPLINK_IN_CURRENT_TAB"]);t.ExternalLinkTarget=g},520538:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultFavicon=function(e){let{children:t}=e;return(0,i.useEffect)((()=>{(0,r.setTitleAndIcon)(0)}),[]),t},t.ErrorFavicon=function(e){let{children:t}=e;return(0,i.useEffect)((()=>{(0,r.setTitleAndIcon)(-1)}),[]),t};var r=n(309435),i=n(667294)},690495:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.FlexRow=t.FlexContainer=t.FlexColumn=void 0;var i=r(n(81109)),a=r(n(506479)),o=r(n(120992)),s=n(667294),l=r(n(156720)),u=n(785893);const c=["testid","align","as","direction","justify","wrap","children","className","xstyle","style"],d={flex:{display:"p357zi0d",minWidth:"ktfrpxia",minHeight:"nu7pwgvd"},directionHorizontal:{flexDirection:"sap93d0t"},directionVertical:{flexDirection:"f8m0rgwh"},directionHorizontalReverse:{flexDirection:"v76qf5v1"},directionVerticalReverse:{flexDirection:"qzvtbs9h"},justifyStart:{justifyContent:"fhf7t426"},justifyCenter:{justifyContent:"ac2vgrno"},justifyEnd:{justifyContent:"kcgo1i74"},justifyAll:{justifyContent:"o4u7okr9"},justifyAround:{justifyContent:"j1p1mz06"},justifyEvenly:{justifyContent:"s1e5xcja"},alignCenter:{alignItems:"gndfcl4n"},alignStart:{alignItems:"r15c9g6i"},alignEnd:{alignItems:"r6jd426a"},alignStretch:{alignItems:"elxb2u3l"},alignBaseline:{alignItems:"e4eao3g2"},wrap:{flexWrap:"lkhkxwyq"},wrapReverse:{flexWrap:"ns59xd2u"}},p=(0,s.forwardRef)((function(e,t){const{testid:n,align:r="start",as:s="div",direction:p,justify:_="start",wrap:f="nowrap",children:h,className:g,xstyle:m,style:y}=e,E=(0,a.default)(e,c);return(0,u.jsx)(s,(0,i.default)((0,i.default)({className:(0,o.default)((0,l.default)(d.flex,"start"===_&&d.justifyStart,"center"===_&&d.justifyCenter,"end"===_&&d.justifyEnd,"all"===_&&d.justifyAll,"around"===_&&d.justifyAround,"evenly"===_&&d.justifyEvenly,"vertical"===p&&d.directionVertical,"horizontal"===p&&d.directionHorizontal,"vertical-reverse"===p&&d.directionVerticalReverse,"horizontal-reverse"===p&&d.directionHorizontalReverse,"start"===r&&d.alignStart,"center"===r&&d.alignCenter,"end"===r&&d.alignEnd,"stretch"===r&&d.alignStretch,"baseline"===r&&d.alignBaseline,"wrap"===f&&d.wrap,"wrap-reverse"===f&&d.wrapReverse,m),g),ref:t,style:y,"data-testid":n},E),{},{children:h}))}));t.FlexContainer=p,p.displayName="FlexContainer";const _=(0,s.forwardRef)((function(e,t){return(0,u.jsx)(p,(0,i.default)((0,i.default)({},e),{},{direction:"horizontal",ref:t,children:e.children}))}));t.FlexRow=_,_.displayName="FlexRow";const f=(0,s.forwardRef)((function(e,t){return(0,u.jsx)(p,(0,i.default)((0,i.default)({},e),{},{direction:"vertical",ref:t,children:e.children}))}));t.FlexColumn=f,f.displayName="FlexColumn"},469733:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=r(n(731058)),o=n(667294),s=r(n(156720)),l=n(785893);const u={flexItem:{flexGrow:"tvf2evcx",flexShrink:"m0h2a7mj",flexBasis:"lb5m6g5c",order:"j7l1k36l",minWidth:"ktfrpxia",minHeight:"nu7pwgvd"},alignAuto:{alignSelf:"gjuq5ydh"},alignStart:{alignSelf:"ex3gcxaf"},alignCenter:{alignSelf:"o2es7gts"},alignEnd:{alignSelf:"rwlvdxyg"},alignStretch:{alignSelf:"l33m68ws"}},c=(0,o.forwardRef)((function(e,t){const{testid:n,align:r="auto",as:o="div",basis:c,xstyle:d,children:p,order:_,grow:f,shrink:h,style:g}=e,m={flexBasis:"string"==typeof c||null==c?c:`${c}px`,flexGrow:f,flexShrink:h,order:_};return(0,l.jsx)(o,{className:(0,s.default)(u.flexItem,"auto"===r&&u.alignAuto,"start"===r&&u.alignStart,"center"===r&&u.alignCenter,"end"===r&&u.alignEnd,"stretch"===r&&u.alignStretch,d),"data-testid":n,ref:t,style:(0,i.default)((0,i.default)({},g),(0,a.default)(m)),children:p})}));c.displayName="FlexItem";var d=c;t.default=d},373347:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const{children:t,onComplex:n,waitIdle:r,id:c}=e,[d,p]=(0,o.useState)((()=>i.UIBusyTasks.isBusy())),_=()=>{p(!1)},f=(0,s.default)((()=>r?i.UIBusyTasks.enqueue(_):null)),h=(0,l.default)(c);return(0,o.useEffect)((()=>()=>{r&&null!=f.current&&i.UIBusyTasks.dequeue(f.current)}),[]),(0,o.useEffect)((()=>{if(!a.default.equals(h,c)||!r){d&&null!=f.current&&i.UIBusyTasks.dequeue(f.current);const e=i.UIBusyTasks.isBusy();e&&r&&(f.current=i.UIBusyTasks.enqueue(_)),p(e)}}),[c,f,d,h,r]),d&&r?(0,u.jsx)(u.Fragment,{children:t}):n()};var i=n(806279),a=r(n(124928)),o=n(667294),s=r(n(470649)),l=r(n(207100)),u=n(785893)},825158:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const{onClick:t,wrapInHiddenToken:n=!0,id:r,plural:c,params:d,className:p,tabIndex:_}=e;return(0,l.jsx)(a.SelectableSpan,{dir:o.default.isRTL()?"rtl":"ltr",selectable:!n,onClick:t,className:p,tabIndex:_,children:(()=>{const e=o.default.t(r,{_plural:c});if(!d||(0,i.default)(d))return e;let t,n;const a=[];for(;t=u.exec(e);){const e=t;a.push(e[1]);const r=e[2];if(r&&null!=d[r]){const e=Array.isArray(d[r])?d[r].map(((e,t)=>(0,l.jsx)(s.Fragment,{children:e},`child_${t}`))):(0,l.jsx)(s.Fragment,{children:d[r]},r);a.push(e)}n=e.index+e[0].length}return"number"==typeof n&&n<e.length&&a.push(e.slice(n)),0===a.length?e:a})()})};var i=r(n(441609)),a=n(306703),o=r(n(932325)),s=n(667294),l=n(785893);const u=/(.*?)__(\w+?)__/g},247390:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.LabelPill=function(e){let{children:t}=e;return(0,a.jsx)("div",{className:(0,i.default)(o),children:(0,a.jsx)("b",{className:(0,i.default)(s),children:t})})};var i=r(n(156720)),a=n(785893);const o={display:"ew8mgplc",marginTop:"m3ct2rho",marginBottom:"ec1z5skj",marginStart:"g9zvcdbd"},s={paddingTop:"qomlamqu",paddingEnd:"ft2m32mm",paddingBottom:"bxcbqipq",paddingStart:"nu34rnf1",fontSize:"r8knbtme",fontWeight:"wvgvrgjz",lineHeight:"omzt3tek",color:"pm5hny62",verticalAlign:"neme6l2y",background:"p1bddo5c",borderTopStartRadius:"hr3av0uk",borderTopEndRadius:"io9rddya",borderBottomEndRadius:"osk001mr",borderBottomStartRadius:"swewzx26"}},898755:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const{showWhatsAppLogo:t=!0}=e;return(0,o.jsxs)("div",{className:"landing-header",children:[(0,o.jsx)(l,{}),(0,o.jsx)("div",{className:"landing-headerTitle",children:i.default.t(427)})]})};var i=r(n(932325)),a=r(n(156720)),o=n(785893);const s={display:"l7jjieqr",verticalAlign:"fewfhwl7"};const l=()=>(0,o.jsx)("span",{className:(0,a.default)(s),children:(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"39",height:"39",viewBox:"0 0 39 39",children:[(0,o.jsx)("path",{fill:"#00E676",d:"M10.7 32.8l.6.3c2.5 1.5 5.3 2.2 8.1 2.2 8.8 0 16-7.2 16-16 0-4.2-1.7-8.3-4.7-11.3s-7-4.7-11.3-4.7c-8.8 0-16 7.2-15.9 16.1 0 3 .9 5.9 2.4 8.4l.4.6-1.6 5.9 6-1.5z"}),(0,o.jsx)("path",{fill:"#FFF",d:"M32.4 6.4C29 2.9 24.3 1 19.5 1 9.3 1 1.1 9.3 1.2 19.4c0 3.2.9 6.3 2.4 9.1L1 38l9.7-2.5c2.7 1.5 5.7 2.2 8.7 2.2 10.1 0 18.3-8.3 18.3-18.4 0-4.9-1.9-9.5-5.3-12.9zM19.5 34.6c-2.7 0-5.4-.7-7.7-2.1l-.6-.3-5.8 1.5L6.9 28l-.4-.6c-4.4-7.1-2.3-16.5 4.9-20.9s16.5-2.3 20.9 4.9 2.3 16.5-4.9 20.9c-2.3 1.5-5.1 2.3-7.9 2.3zm8.8-11.1l-1.1-.5s-1.6-.7-2.6-1.2c-.1 0-.2-.1-.3-.1-.3 0-.5.1-.7.2 0 0-.1.1-1.5 1.7-.1.2-.3.3-.5.3h-.1c-.1 0-.3-.1-.4-.2l-.5-.2c-1.1-.5-2.1-1.1-2.9-1.9-.2-.2-.5-.4-.7-.6-.7-.7-1.4-1.5-1.9-2.4l-.1-.2c-.1-.1-.1-.2-.2-.4 0-.2 0-.4.1-.5 0 0 .4-.5.7-.8.2-.2.3-.5.5-.7.2-.3.3-.7.2-1-.1-.5-1.3-3.2-1.6-3.8-.2-.3-.4-.4-.7-.5h-1.1c-.2 0-.4.1-.6.1l-.1.1c-.2.1-.4.3-.6.4-.2.2-.3.4-.5.6-.7.9-1.1 2-1.1 3.1 0 .8.2 1.6.5 2.3l.1.3c.9 1.9 2.1 3.6 3.7 5.1l.4.4c.3.3.6.5.8.8 2.1 1.8 4.5 3.1 7.2 3.8.3.1.7.1 1 .2h1c.5 0 1.1-.2 1.5-.4.3-.2.5-.2.7-.4l.2-.2c.2-.2.4-.3.6-.5s.4-.4.5-.6c.2-.4.3-.9.4-1.4v-.7s-.1-.1-.3-.2z"})]})})},858867:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){const[e,t]=(0,C.useState)(""),[n,r]=(0,C.useState)(!1),[R,N]=(0,C.useState)(!1),[w,L]=(0,C.useState)(!1),[D,k,U]=(0,I.default)(T.MD_KEYS.SCREEN_UNLOCK_TRY_COUNT);(0,O.useListener)(l.Cmd,"correct_passcode_lock_screen",(()=>{U()})),(0,O.useListener)(l.Cmd,"incorrect_passcode_lock_screen",(()=>{k(),N(!0),L(!1)}));const G=function(){var t=(0,i.default)((function*(){if(L(!0),yield(0,a.delayMs)(400),""===e)return r(!0),void L(!1);r(!1),h.LockScreenResolvable.enterPasscode(e)}));return function(){return t.apply(this,arguments)}}(),x=D>=(0,o.getABPropConfigValue)("web_screen_lock_max_retries");return(0,M.jsxs)("div",{className:"landing-wrapper",children:[(0,M.jsx)("div",{className:"landing-wrapper-before"}),(0,M.jsx)(f.default,{}),(0,M.jsx)("div",{className:"landing-window","data-testid":"lock-screen-landing-window",children:(0,M.jsx)("div",{className:(0,P.default)(b.box),children:(0,M.jsxs)(p.FlexColumn,{align:"center",className:"landing-main",children:[(0,M.jsx)(_.default,{xstyle:[S.uiMargin.top16,S.uiMargin.bottom24],children:(0,M.jsx)(m.default,{thumb:(0,v.getCachedProfilePicEURL)(),size:82,quality:c.DetailImageQuality.High})}),(0,M.jsx)(E.Text,{as:"div",size:"19",color:"dark",xstyle:b.pushnameText,children:(0,M.jsx)(d.EmojiText,{text:u.Conn.pushname,ellipsify:!0,titlify:!0})}),(0,M.jsxs)(_.default,{xstyle:[b.passcodeContainer,S.uiMargin.bottom24],children:[(0,M.jsx)(E.Text,{as:"div",size:"14",color:"dark",xstyle:b.passcodeInputLabel,children:A.fbt._("",null,{hk:"42rurn"})}),(0,M.jsx)(g.default,{onChange:e=>{t(e.currentTarget.value)},onKeyDown:e=>{x||"Enter"!==e.key||G()},required:!0,placeholder:A.fbt._("",null,{hk:"3EzL8R"}).toString(),testid:"password-input"}),(0,M.jsxs)(E.Text,{as:"div",size:"13",color:"danger",xstyle:[b.incorrectPasscode,S.uiMargin.top4,S.uiMargin.bottom10],children:[n&&!x&&A.fbt._("",null,{hk:"3wuLXl"}),R&&!n&&!x&&A.fbt._("",null,{hk:"4AFZLZ"}),x&&A.fbt._("",null,{hk:"1U1DqB"})]})]}),(0,M.jsx)(_.default,{xstyle:b.unlockButton,children:(0,M.jsx)(s.default,{type:"primary",onClick:()=>{G()},disabled:w||x,spinner:w,testid:"unlock-button",children:A.fbt._("",null,{hk:"1ZDB3i"})})}),(0,M.jsx)(s.default,{type:"secondary",onClick:()=>y.Socket.logout(),children:A.fbt._("",null,{hk:"3J8zAh"})})]})})})]})};var i=r(n(348926)),a=n(36530),o=n(287461),s=r(n(692629)),l=n(780549),u=n(266888),c=n(23641),d=n(305521),p=n(690495),_=r(n(469733)),f=r(n(898755)),h=n(804334),g=r(n(783301)),m=r(n(145632)),y=n(6961),E=n(180519),S=n(50010),T=n(94872),v=n(673168),A=n(548360),C=n(667294),P=r(n(156720)),O=n(148725),I=r(n(359944));n(465381);var M=n(785893);const b={box:{backgroundColor:"p1zdgkh6",minWidth:"d8ddvuix",height:"lffynu9d","@media screen and (max-width: 850px)":{minWidth:"gdbw3fpr"},"@media screen and (max-width: 660px)":{minWidth:"inad9r27"}},pushnameText:{marginBottom:"fhelu9n7"},passcodeContainer:{width:"rtue7xhx"},passcodeInputLabel:{lineHeight:"e4qy2s3t",marginBottom:"ngycyvoj"},incorrectPasscode:{height:"jdwybkuq",lineHeight:"l0vqccxk"},unlockButton:{marginBottom:"cwh5h8h7"}}},804334:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LockScreenResolvable=void 0;var r=n(827653),i=n(780549),a=n(114850);const o=new class{constructor(){this.deferred=new r.Resolvable}waitForPasscode(){var e;return i.Cmd.openLockScreenModal(),null===(e=this.deferred)||void 0===e?void 0:e.promise}waitForPasscodeAfterIncorrectAttempt(){var e;return this.deferred=new r.Resolvable,i.Cmd.incorrectPasscodeLockScreen(),null===(e=this.deferred)||void 0===e?void 0:e.promise}enterPasscode(e){this.deferred.resolve(e)}correctPasscodeEntered(){i.Cmd.correctPasscodeLockScreen(),a.ModalManager.close()}};t.LockScreenResolvable=o},181064:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){const e=(0,o.getPrevLogoutReasonCode)();if(null==e)return null;const[t,n]=function(e){let t=null,n=null;switch(e){case s.LOGOUT_REASON_CODE.CLIENT_FATAL:t=c.fbt._("A database error occurred on your browser. Please relink your device.",null,{hk:"2607fW"}).toString(),n=(0,a.getDBErrorFaqUrl)();break;case s.LOGOUT_REASON_CODE.SYNC_FAIL:t=c.fbt._("Your device could not link due to a sync issue. Please relink your device.",null,{hk:"2VkiMf"}).toString(),n=(0,a.getLinkDeviceFaqUrl)();break;case s.LOGOUT_REASON_CODE.INITIAL_HISTORY_SYNC_TIMEOUT:t=c.fbt._("Couldn't link device. Keep WhatsApp open on your phone when your device is linking.",null,{hk:"2DAi9E"}).toString(),n=(0,a.getLinkDeviceFaqUrl)()}return[t,n]}(e);if(null==t||""===t)return null;const r=e===s.LOGOUT_REASON_CODE.CLIENT_FATAL,_=null!=n?(0,p.jsxs)(u.default,{action:()=>{(0,i.openExternalLink)(n)},children:[" ",c.fbt._("Learn more",null,{hk:"2S4fxr"})]}):null;return(0,p.jsxs)("div",{className:(0,d.default)(l.default.wrapper,r?l.default.error:l.default.warn),children:[r?(0,p.jsx)("span",{className:l.default.icon,children:(0,p.jsx)("svg",{width:"44",height:"44",viewBox:"0 0 44 44",xmlns:"http://www.w3.org/2000/svg",children:(0,p.jsx)("path",{d:"M22.0002 0.314301C10.0422 0.314301 0.314453 10.0421 0.314453 22C0.314453 33.958 10.0422 43.6857 22.0002 43.6857C33.9581 43.6857 43.6859 33.958 43.6859 22C43.6859 10.0421 33.9581 0.314301 22.0002 0.314301ZM30.1502 28.5196L28.5197 30.1501L22.0002 23.6305L15.4806 30.1501L13.8501 28.5196L20.3709 22L13.8501 15.4805L15.4806 13.85L22.0002 20.3695L28.521 13.85L30.1515 15.4805L23.6307 22L30.1502 28.5196Z",fill:"currentColor"})})}):(0,p.jsx)("span",{className:l.default.icon,children:(0,p.jsx)("svg",{width:"44",height:"44",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",children:(0,p.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24 46C36.1503 46 46 36.1503 46 24C46 11.8497 36.1503 2 24 2C11.8497 2 2 11.8497 2 24C2 36.1503 11.8497 46 24 46ZM34.6473 31.164L25.2436 14.2344C25.1138 13.9995 24.9312 13.8053 24.7134 13.6705C24.4956 13.5357 24.2499 13.4649 24 13.4649C23.7501 13.4649 23.5044 13.5357 23.2866 13.6705C23.0687 13.8053 22.8861 13.9995 22.7564 14.2344L13.3527 31.164C13.2177 31.4068 13.144 31.6848 13.1392 31.9694C13.1344 32.254 13.1986 32.5349 13.3253 32.783C13.452 33.0312 13.6366 33.2377 13.86 33.3813C14.0834 33.5249 14.3376 33.6004 14.5964 33.6H33.4036C33.6624 33.6004 33.9166 33.5249 34.14 33.3813C34.3634 33.2377 34.548 33.0312 34.6747 32.783C34.8014 32.5349 34.8656 32.254 34.8608 31.9694C34.856 31.6848 34.7823 31.4068 34.6473 31.164ZM25.0909 19.2V26.4H22.9091V19.2H25.0909ZM22.9091 31.2V28.8H25.0909V31.2H22.9091Z",fill:"currentColor"})})}),(0,p.jsxs)("div",{className:l.default.textWrapper,children:[(0,p.jsx)("div",{children:t}),_]})]})};var i=n(753233),a=n(258105),o=n(383047),s=n(332108),l=r(n(523437)),u=r(n(564128)),c=n(548360),d=r(n(120992)),p=n(785893)},21645:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ContactAndGroupName=function(e){const{chat:t,contact:n,xstyle:r}=e;return(0,S.jsxs)("span",{className:(0,y.default)(r),children:[(0,S.jsx)(b,{contact:n,useShortName:!0}),(0,S.jsx)("span",{children:" • "}),(0,S.jsx)(M,{chat:t,groupMetadata:t.groupMetadata})]})},t.ContactName=I,t.GroupName=M,t.Name=b;var i=r(n(81109)),a=r(n(506479)),o=r(n(104563)),s=r(n(807035)),l=n(719731),u=n(113704),c=n(305521),d=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=C(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(675886)),p=n(129363),_=n(376355),f=n(459857),h=r(n(437151)),g=n(548360),m=r(n(120992)),y=r(n(156720)),E=n(990144),S=n(785893);const T=["chat"],v=["chat"],A=["contact"];function C(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(C=function(e){return e?n:t})(e)}const P={disableGrow:{flexGrow:"tvf2evcx"},spaceBefore:{"::before":{content:"seopfc61",whiteSpace:"i539y0ga"}}},O=e=>{const t=(0,f.assertGetMe)().getDeviceId();let n;if(e.some((e=>e.deviceId===t))){const e=g.fbt._("Assigned to you",null,{hk:"E3cIM"});n=(0,S.jsx)(l.ChatAssignmentIcon,{width:18,height:12,className:(0,m.default)(h.default.chatAssignmentIcon,h.default.chatAssignmentIconAssignedToYou),title:e})}else if(e.length>0){const t=g.fbt._("Assigned to {agentName}",[g.fbt._param("agentName",e[0].name)],{hk:"3DMd8d"});n=(0,S.jsx)(l.ChatAssignmentIcon,{width:18,height:12,className:(0,m.default)(h.default.chatAssignmentIcon,h.default.chatAssignmentIconAssignedToOthers),title:t})}else n=null;return n};function I(e){const{element:t="span",highlightText:n,titlify:r,ellipsify:i,breakWord:a,you:l=!1,selectable:u,useShortName:f=!1,useDisplayName:y=!1,onClick:T,showLabel:v,showBusinessCheckmark:A,showNotifyName:C=!1,useVerifiedName:I=!1,firstLabel:M,xstyle:b,showChatAssignmentIcon:R=!1,assignedAgents:N=[],skipCheckMark:w=!1,showMessageYourselfName:L=!1,testid:D}=e,k=(0,E.useModelValues)(e.contact,["isPSA","isIAS","formattedUser","formattedName","formattedShortName","formattedPhone","displayName","labels","name","notifyName","isMe","verifiedName"]);let U;n&&(U=d.SearchName({terms:[n]}));const G=(e=>{let{contact:t,showNotifyName:n,useDisplayName:r,useShortName:i,useVerifiedName:a,you:o,showMessageYourselfName:s}=e;var l;return s&&t.isMe?g.fbt._("{nameOrPhoneNumber}",[g.fbt._param("nameOrPhoneNumber",a?t.verifiedName:null!==(l=t.name)&&void 0!==l?l:t.formattedPhone)],{hk:"2leim6"}):r&&t.displayName?t.displayName:i&&t.formattedShortName?t.formattedShortName:a&&t.verifiedName?t.verifiedName:o&&t.isMe?t.formattedName:n&&!t.name&&null!=t.notifyName?`~${t.notifyName}`:t.formattedUser})({contact:k,showNotifyName:C,useDisplayName:y,useShortName:f,useVerifiedName:I,you:l,showMessageYourselfName:L});if(!G)return __LOG__(4,void 0,new Error,!0)`displayName:${G},
formattedName:${k.formattedName},
name:${k.name},
formattedShortName:${k.formattedShortName},
formattedUser:${k.formattedUser}`,SEND_LOGS("display name is null or undefined"),"";const x=(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(c.EmojiText,{text:(0,s.default)(G.toString()),element:t,className:(0,m.default)(null,e.className),formatters:U,titlify:r,ellipsify:i,breakWord:a,direction:"auto",selectable:u,inlineblock:!0,onClick:T,xstyle:[b,L&&P.disableGrow],testid:D}),L&&(0,S.jsx)(c.EmojiText,{testid:"you-label",text:g.fbt._("(You)",null,{hk:"1CQza2"}),xstyle:P.spaceBefore})]}),B=e.labels||k.labels;B&&M&&(0,o.default)(B,M);const F=v&&B?(0,S.jsx)(p.Labels,{labels:B,showName:!1}):null;if(!w&&(k.isPSA||k.isIAS||A))return(0,S.jsxs)("span",{className:h.default.verified,children:[x,(0,S.jsx)("div",{className:h.default.icon,children:(0,S.jsx)(_.PsaVerifiedIcon,{})}),(0,S.jsx)("div",{className:h.default.labels,children:F})]});const j=R?O(N):null;return j||F?(0,S.jsxs)("span",{className:h.default.hasLabels,children:[x,(0,S.jsxs)("div",{className:h.default.labels,children:[j,F]})]}):x}function M(e){const{element:t,highlightText:n,titlify:r,ellipsify:i,breakWord:a,onClick:l,showLabel:f,firstLabel:g,className:T,xstyle:v,showChatAssignmentIcon:A=!1,assignedAgents:C=[],testid:P}=e;let I;const M=(0,E.useModelValues)(e.chat,["formattedTitle","labels"]),b=(0,E.useModelValues)(e.groupMetadata,["support"]);n&&(I=d.SearchName({terms:[n]}));const R=e.labels||M.labels;R&&g&&(0,o.default)(R,g);const N=f&&R?(0,S.jsx)(p.Labels,{labels:R,showName:!1}):null,w=(0,S.jsx)(c.EmojiText,{text:(0,s.default)(M.title()),element:t,className:(0,m.default)(T,(0,y.default)(v)),formatters:I,titlify:r,ellipsify:i,breakWord:a,direction:"auto",inlineblock:!0,onClick:l,testid:P});if(b.support)return(0,S.jsxs)("div",{className:(0,m.default)((0,u.cx)({[h.default.verified]:!0,[h.default.hasLabels]:!!N})),children:[w,(0,S.jsx)("div",{className:h.default.icon,children:(0,S.jsx)(_.PsaVerifiedIcon,{})}),(0,S.jsx)("div",{className:h.default.labels,children:N})]});const L=A?O(C):null;return L||N?(0,S.jsxs)("span",{className:h.default.hasLabels,children:[w,(0,S.jsxs)("div",{className:h.default.labels,children:[L,N]})]}):w}function b(e){if(e.chat&&!e.chat.isUser){const{chat:t}=e,n=(0,a.default)(e,T);return(0,S.jsx)(M,(0,i.default)({chat:t,groupMetadata:t.groupMetadata},n))}let t,n;if(e.chat){const{chat:r}=e,i=(0,a.default)(e,v);t=r.contact,n=i}else{const{contact:r}=e;t=r,n=(0,a.default)(e,A)}return(0,S.jsx)(I,(0,i.default)({contact:t},n))}},783301:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const[t,n]=(0,p.default)(!1),[r,h]=(0,u.useState)(!1),g=(0,c.useFocus)({onFocusChange:h});return(0,_.jsxs)("div",{className:(0,d.default)([f.container,r&&f.focusedContainer]),children:[(0,_.jsx)("input",{ref:g,className:(0,d.default)(f.inputField),type:t?"text":"password",value:e.value,onChange:e.onChange,onKeyDown:e.onKeyDown,required:e.required,pattern:e.pattern,title:e.title,placeholder:e.placeholder,"data-testid":e.testid}),(0,_.jsx)(i.default,{xstyle:f.toggleButton,onClick:n,type:"simplified",children:t?(0,_.jsx)(s.VisibilityOnIcon,{"aria-label":l.fbt._("",null,{hk:"3QhoQq"}),color:a.SvgColorProp.TEAL}):(0,_.jsx)(o.VisibilityOffIcon,{"aria-label":l.fbt._("",null,{hk:"SOUsm"}),color:a.SvgColorProp.TEAL})})]})};var i=r(n(692629)),a=n(615647),o=n(700848),s=n(479846),l=n(548360),u=n(667294),c=n(162488),d=r(n(156720)),p=r(n(346787)),_=n(785893);const f={container:{position:"g0rxnol2",display:"p357zi0d",backgroundColor:"f6cvynhn",minWidth:"lu4oe39f",borderBottom:"d311eqfx",paddingBottom:"a15vwmim"},focusedContainer:{borderBottom:"ggdspdaz",paddingBottom:"przvwfww"},inputField:{fontSize:"enbbiyaj",color:"tviruh8d",flexGrow:"ggj6brxn",borderTop:"d27kr2rt",borderEnd:"q2i1o5qz",borderBottom:"r40aedaz",borderStart:"g9ebf9yp",outline:"gk6igrwd",backgroundColor:"f6cvynhn",overflowX:"gfz4du6o",overflowY:"r7fjleex"},toggleButton:{minWidth:"h3jhcnxg",color:"kzxpayn5",":hover":{color:"glk0grvq"}}}},525481:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(722074)),a=n(785893);t.default=e=>{let{max:t=100,value:n}=e;return(0,a.jsx)("progress",{value:n,max:t,className:i.default.progress})}},859031:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){const e=(0,p.useRef)(null),[t,n]=(0,p.useState)(m.FIRST_OPEN);(0,_.default)();const r=()=>{n(m.READY)},E=e=>{n(m.LOADING),e.stopPropagation(),e.preventDefault()},S=()=>{n(m.REPLAY);const t=e.current;t&&t.play()};let T,v;t===m.FIRST_OPEN&&(T=(0,f.jsx)("div",{className:c.default.overlay,children:(0,f.jsx)(l.Spinner,{size:32})}),v=r);const A=t===m.FIRST_OPEN||t===m.READY||t===m.LOADING?(0,f.jsx)(o.default,{className:(0,d.default)(c.default.poster,(0,a.cx)({[c.default.hidden]:t===m.FIRST_OPEN})),src:g[i.default.currentRes],onLoad:v},"poster"):null;let C,P;const O=h[i.default.currentRes],I=t!==m.FIRST_OPEN&&t!==m.READY?(0,f.jsx)("video",{autoPlay:!0,className:c.default.player,controls:!0,controlsList:"nodownload",onCanPlayThrough:()=>{t===m.LOADING&&n(m.FIRST_PLAY)},onEnded:()=>{n(m.ENDED)},ref:e,children:(0,f.jsx)("source",{src:O,type:"video/mp4"})},i.default.currentRes):null;switch(t){case m.READY:P=E,C=(0,f.jsx)(y,{});break;case m.LOADING:C=(0,f.jsx)(l.Spinner,{color:"white",size:32});break;case m.ENDED:P=S,C=(0,f.jsx)(s.RefreshLargeIcon,{});break;default:C=null,P=null}const M=C?(0,f.jsx)("div",{className:c.default.overlay,role:"button",onClick:P,children:(0,f.jsx)("div",{className:c.default.button,children:C})}):null;return(0,f.jsx)("div",{className:c.default.video,children:(0,f.jsxs)("div",{className:c.default.container,children:[(0,f.jsxs)(u.default,{transitionName:"fade",children:[T,M,A]}),I]})})};var i=r(n(861474)),a=n(113704),o=r(n(488922)),s=n(590387),l=n(956113),u=r(n(844453)),c=r(n(173176)),d=r(n(120992)),p=n(667294),_=r(n(976353)),f=n(785893);const h={low:n(815109),high:n(326252)},g={low:n(215767),high:n(977152)},m=n(76672).Mirrored(["FIRST_OPEN","READY","LOADING","FIRST_PLAY","ENDED","REPLAY"]);const y=()=>(0,f.jsx)("div",{className:c.default.play,children:(0,f.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"34",viewBox:"0 0 28 34",children:(0,f.jsx)("path",{fill:"#FFF",d:"M1 4.983v24.034a2.982 2.982 0 0 0 4.564 2.53L24.792 19.53a2.981 2.981 0 0 0 0-5.058L5.563 2.454A2.983 2.983 0 0 0 1 4.983z"})})})},731138:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){(0,G.useQRScreenKillswitchValue)(E.Killswitch.ELECTRON_WINDOWS_APP_EXPIRED),(0,G.useQRScreenKillswitchValue)(E.Killswitch.ELECTRON_WINDOWS_PREVENT_LOGIN);const[t,n]=(0,D.useState)(A.Socket.state===v.SOCKET_STATE.UNPAIRED_IDLE),[r,i]=(0,D.useState)(!y.default.online),[a,o]=(0,D.useState)(A.Socket.state===v.SOCKET_STATE.UNPAIRED);(0,U.useListener)(A.Socket,"change:state change:online",(()=>{n(A.Socket.state===v.SOCKET_STATE.UNPAIRED_IDLE),i(!y.default.online),o(A.Socket.state===v.SOCKET_STATE.UNPAIRED)})),(0,D.useEffect)((()=>{}),[]);const u=()=>{s.Cmd.refreshQR()};let c,_;c=r?(0,B.jsx)(Y,{children:(0,B.jsxs)("div",{className:b.default.qrButton,children:[(0,B.jsx)("div",{className:b.default.qrButtonIcon,children:(0,B.jsx)(l.ConnectionIcon,{})}),f.default.t(177)]},"expiry")}):t?(0,B.jsx)(Y,{children:(0,B.jsxs)("button",{className:b.default.qrButton,onClick:u,children:[(0,B.jsx)("div",{className:b.default.qrButtonIcon,children:(0,B.jsx)(S.RefreshLargeIcon,{})}),w.fbt._("Click to reload QR code",null,{hk:"pEkpW"})]},"expiry")}):a?(0,B.jsx)(Y,{}):(0,B.jsx)("div",{className:b.default.qrcode,children:(0,B.jsx)(C.Spinner,{})});if(e.apiCmd)switch(e.apiCmd.resultType){case R.APICmd.GROUP_INVITE:_=(0,B.jsx)("div",{className:b.default.groupInviteTip,children:(0,B.jsx)("div",{className:b.default.tip,children:w.fbt._("Log in to WhatsApp Web to join this WhatsApp group",null,{hk:"3OnLb2"})})});break;case R.APICmd.MSG_SEND:_=(0,B.jsx)("div",{className:b.default.groupInviteTip,children:(0,B.jsx)("div",{className:b.default.tip,children:w.fbt._("Log in to WhatsApp Web to share",null,{hk:"2k3JEY"})})})}const T=(0,B.jsx)("strong",{children:(0,B.jsx)(h.default,{id:422,params:{android_menu_icon:(0,B.jsx)(K,{})}})}),P=(0,B.jsx)("strong",{children:(0,B.jsx)(h.default,{id:424,params:{iphone_settings_icon:(0,B.jsx)(H,{})}})}),O=(0,B.jsx)("strong",{children:w.fbt._("Linked Devices",null,{hk:"Nqq5i"})}),I=(0,B.jsx)(h.default,{id:425,params:{android_menu:T,iphone_settings:P,whatsapp_web_menu_item:O}}),M=(0,B.jsx)("strong",{children:w.fbt._("Link a Device",null,{hk:"v9hB7"})}),N=(0,B.jsx)(h.default,{id:426,params:{login_step_3_md_link_device:M}});let k;x.default&&(k=(0,B.jsx)(x.default,{}));return(0,B.jsxs)("div",{className:"landing-wrapper",children:[(0,B.jsx)("div",{className:"landing-wrapper-before"}),(0,B.jsx)(g.default,{}),(0,B.jsxs)("div",{className:"landing-window",children:[(0,B.jsxs)("div",{className:"landing-main",children:[(0,B.jsx)(m.default,{}),(0,B.jsx)(F,{}),(0,B.jsx)(j,{}),(0,B.jsxs)("div",{className:b.default.qrWrapper,children:[(0,B.jsxs)("div",{className:b.default.text,children:[(0,B.jsx)("div",{className:(0,L.default)("landing-title",b.default.headline),children:w.fbt._("To use WhatsApp on your computer:",null,{hk:"3aGbOX"})}),(0,B.jsxs)("ol",{className:b.default.list,children:[(0,B.jsx)("li",{className:b.default.listItem,children:w.fbt._("Open WhatsApp on your phone",null,{hk:"3hHeUI"})}),(0,B.jsx)("li",{className:b.default.listItem,children:I}),(0,B.jsx)("li",{className:b.default.listItem,children:N}),(0,B.jsx)("li",{className:b.default.listItem,children:w.fbt._("Point your phone to this screen to capture the code",null,{hk:"2SaWOV"})})]})]}),(0,B.jsxs)("div",{className:b.default.qr,children:[_,c]}),(0,B.jsx)(d.ExternalLink,{href:(0,p.getLoginFaqUrl)(),className:b.default.hint,children:f.default.t(423)})]})]}),k,null]})]})};var i=r(n(348926)),a=n(417405),o=n(678002),s=n(780549),l=n(746445),u=n(266888),c=(n(306703),n(113704)),d=n(753233),p=n(258105),_=n(914368),f=r(n(932325)),h=r(n(825158)),g=r(n(898755)),m=r(n(181064)),y=(n(114850),r(n(99398))),E=n(430252),S=n(590387),T=n(326314),v=n(226562),A=n(6961),C=n(956113),P=n(65410),O=(n(459857),r(n(844453))),I=r(n(256695)),M=r(n(637360)),b=r(n(803306)),R=n(251780),N=n(444467),w=(n(744259),n(548360)),L=r(n(120992)),D=n(667294),k=r(n(461993)),U=n(148725),G=n(261575),x=r(n(859031)),B=n(785893);function F(){return(0,G.useQRScreenKillswitchValue)(E.Killswitch.ELECTRON_WINDOWS_QR_BANNER),null}function j(){const e=(0,G.useQRScreenKillswitchValue)(E.Killswitch.DESKTOP_UPSELL_WINDOWS_QR_BANNER),t=(0,N.useCanUserDownloadUwp)();return!0===e&&t?(0,B.jsx)("div",{className:b.default.desktopUpsellBanner,children:(0,B.jsx)(N.DesktopUpsellButterBar,{})}):null}function Y(e){const t=e.children,[n,r]=(0,D.useState)(!1),l=(0,k.default)((()=>{r(!0)}),100),d=(0,D.useRef)(null),p=(0,D.useRef)(null),f=()=>{if(u.Conn.connected)return Promise.resolve(void 0);const e=u.Conn.ref;return T.waSignalStore.getRegistrationInfo().then(function(){var t=(0,i.default)((function*(t){const n=yield P.waNoiseInfo.get();if(!n||!n.staticKeyPair||!t)return __LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("Empty noiseInfo or empty regInfo"),null;const r=(0,a.encodeB64)(n.staticKeyPair.pubKey),i=(0,a.encodeB64)(t.identityKeyPair.pubKey),s=yield(0,o.getADVSecretKey)();return e+","+r+","+i+","+s}));return function(){return t.apply(this,arguments)}}())},h=function(){var e=(0,i.default)((function*(){const e=d.current,t=p.current;if(null==e)return Promise.resolve();const n=yield f();n&&(I.default.inc(),t?t.makeCode(n):p.current=new M.default(e,{text:n,colorDark:"#122e31",width:_.QR_EDGE,height:_.QR_EDGE,correctLevel:M.default.CorrectLevel.L}),e.removeAttribute("title"),e.setAttribute("data-ref",n))}));return function(){return e.apply(this,arguments)}}();(0,U.useListener)(u.Conn,"change:ref",h),(0,D.useEffect)((()=>(h(),s.Cmd.initialLoadReady(),()=>{I.default.reset()})),[]);const g=(0,L.default)(b.default.qrcode,(0,c.cx)({[b.default.idle]:!!t})),m=n&&null==t?{cursor:"none"}:null;return(0,B.jsxs)("div",{ref:d,"data-testid":"qrcode",className:g,onContextMenu:null,style:m,onMouseMove:()=>{n&&r(!1),l()},onMouseLeave:()=>{l.cancel(),r(!1)},children:[(0,B.jsx)(O.default,{transitionName:"scale",children:t}),(0,B.jsx)("div",{className:b.default.codeLogo,children:(0,B.jsx)(W,{})})]})}const K=()=>(0,B.jsx)("span",{className:b.default.icon,children:(0,B.jsxs)("svg",{height:"24px",viewBox:"0 0 24 24",width:"24px",children:[(0,B.jsx)("rect",{fill:"#f2f2f2",height:"24",rx:"3",width:"24"}),(0,B.jsx)("path",{d:"m12 15.5c.825 0 1.5.675 1.5 1.5s-.675 1.5-1.5 1.5-1.5-.675-1.5-1.5.675-1.5 1.5-1.5zm0-2c-.825 0-1.5-.675-1.5-1.5s.675-1.5 1.5-1.5 1.5.675 1.5 1.5-.675 1.5-1.5 1.5zm0-5c-.825 0-1.5-.675-1.5-1.5s.675-1.5 1.5-1.5 1.5.675 1.5 1.5-.675 1.5-1.5 1.5z",fill:"#818b90"})]})}),H=()=>(0,B.jsx)("span",{className:b.default.icon,children:(0,B.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:[(0,B.jsx)("rect",{fill:"#F2F2F2",width:"24",height:"24",rx:"3"}),(0,B.jsx)("path",{d:"M12 18.69c-1.08 0-2.1-.25-2.99-.71L11.43 14c.24.06.4.08.56.08.92 0 1.67-.59 1.99-1.59h4.62c-.26 3.49-3.05 6.2-6.6 6.2zm-1.04-6.67c0-.57.48-1.02 1.03-1.02.57 0 1.05.45 1.05 1.02 0 .57-.47 1.03-1.05 1.03-.54.01-1.03-.46-1.03-1.03zM5.4 12c0-2.29 1.08-4.28 2.78-5.49l2.39 4.08c-.42.42-.64.91-.64 1.44 0 .52.21 1 .65 1.44l-2.44 4C6.47 16.26 5.4 14.27 5.4 12zm8.57-.49c-.33-.97-1.08-1.54-1.99-1.54-.16 0-.32.02-.57.08L9.04 5.99c.89-.44 1.89-.69 2.96-.69 3.56 0 6.36 2.72 6.59 6.21h-4.62zM12 19.8c.22 0 .42-.02.65-.04l.44.84c.08.18.25.27.47.24.21-.03.33-.17.36-.38l.14-.93c.41-.11.82-.27 1.21-.44l.69.61c.15.15.33.17.54.07.17-.1.24-.27.2-.48l-.2-.92c.35-.24.69-.52.99-.82l.86.36c.2.08.37.05.53-.14.14-.15.15-.34.03-.52l-.5-.8c.25-.35.45-.73.63-1.12l.95.05c.21.01.37-.09.44-.29.07-.2.01-.38-.16-.51l-.73-.58c.1-.4.19-.83.22-1.27l.89-.28c.2-.07.31-.22.31-.43s-.11-.35-.31-.42l-.89-.28c-.03-.44-.12-.86-.22-1.27l.73-.59c.16-.12.22-.29.16-.5-.07-.2-.23-.31-.44-.29l-.95.04c-.18-.4-.39-.77-.63-1.12l.5-.8c.12-.17.1-.36-.03-.51-.16-.18-.33-.22-.53-.14l-.86.35c-.31-.3-.65-.58-.99-.82l.2-.91c.03-.22-.03-.4-.2-.49-.18-.1-.34-.09-.48.01l-.74.66c-.39-.18-.8-.32-1.21-.43l-.14-.93a.426.426 0 00-.36-.39c-.22-.03-.39.05-.47.22l-.44.84-.43-.02h-.22c-.22 0-.42.01-.65.03l-.44-.84c-.08-.17-.25-.25-.48-.22-.2.03-.33.17-.36.39l-.13.88c-.42.12-.83.26-1.22.44l-.69-.61c-.15-.15-.33-.17-.53-.06-.18.09-.24.26-.2.49l.2.91c-.36.24-.7.52-1 .82l-.86-.35c-.19-.09-.37-.05-.52.13-.14.15-.16.34-.04.51l.5.8c-.25.35-.45.72-.64 1.12l-.94-.04c-.21-.01-.37.1-.44.3-.07.2-.02.38.16.5l.73.59c-.1.41-.19.83-.22 1.27l-.89.29c-.21.07-.31.21-.31.42 0 .22.1.36.31.43l.89.28c.03.44.1.87.22 1.27l-.73.58c-.17.12-.22.31-.16.51.07.2.23.31.44.29l.94-.05c.18.39.39.77.63 1.12l-.5.8c-.12.18-.1.37.04.52.16.18.33.22.52.14l.86-.36c.3.31.64.58.99.82l-.2.92c-.04.22.03.39.2.49.2.1.38.08.54-.07l.69-.61c.39.17.8.33 1.21.44l.13.93c.03.21.16.35.37.39.22.03.39-.06.47-.24l.44-.84c.23.02.44.04.66.04z",fill:"#818b90"})]})}),W=()=>(0,B.jsx)("span",{className:b.default.icon,children:(0,B.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 64 64",children:[(0,B.jsx)("path",{fill:"#FFF",d:"M6.525 43.936a29.596 29.596 0 0 1-3.039-13.075C3.494 14.568 16.755 1.313 33.05 1.313c7.904.004 15.328 3.082 20.91 8.666 5.581 5.586 8.653 13.01 8.65 20.907-.007 16.294-13.266 29.549-29.558 29.549a29.648 29.648 0 0 1-12.508-2.771L1.391 62.687l5.134-18.751z"}),(0,B.jsx)("path",{fill:"#123033",d:"M50.801 13.135c-4.739-4.742-11.039-7.354-17.752-7.357-13.837 0-25.094 11.253-25.099 25.085a25.039 25.039 0 0 0 3.349 12.541l-3.56 12.999 13.304-3.488a25.084 25.084 0 0 0 11.996 3.054h.011c13.83 0 25.088-11.256 25.095-25.087.002-6.703-2.607-13.005-7.344-17.747zM33.05 51.733h-.008a20.866 20.866 0 0 1-10.62-2.906l-.762-.452-7.894 2.07 2.108-7.694-.497-.789a20.802 20.802 0 0 1-3.189-11.097c.004-11.496 9.361-20.85 20.87-20.85a20.73 20.73 0 0 1 14.746 6.115 20.733 20.733 0 0 1 6.104 14.752c-.006 11.497-9.363 20.851-20.858 20.851z"}),(0,B.jsx)("path",{fill:"#123033",d:"M25.429 19.26a8.65 8.65 0 0 0-1.028.011 2.352 2.352 0 0 0-.95.255c-.221.114-.427.277-.75.582-.305.288-.481.54-.668.782a6.974 6.974 0 0 0-1.443 4.291l.001.003a8.243 8.243 0 0 0 .844 3.607c1.043 2.307 2.763 4.746 5.035 7.008a24.676 24.676 0 0 0 1.657 1.6 24.145 24.145 0 0 0 9.814 5.229s.751.179 1.391.218c.021.001.04.003.061.003a9.207 9.207 0 0 0 1.422-.033 5.086 5.086 0 0 0 2.129-.59c.423-.225.623-.337.978-.561 0 0 .11-.072.319-.23.345-.257.558-.438.845-.736.211-.22.394-.479.534-.772.2-.417.401-1.213.481-1.874.061-.505.042-.781.036-.952-.011-.275-.238-.558-.487-.678l-1.486-.668s-2.222-.967-3.581-1.587a1.278 1.278 0 0 0-.452-.104c-.341-.021-.723.068-.966.324v-.004c-.013-.001-.182.145-2.031 2.385-.102.122-.341.387-.754.362a1.086 1.086 0 0 1-.185-.029 3.402 3.402 0 0 1-.49-.17c-.316-.134-.427-.185-.643-.278l-.013-.006a15.361 15.361 0 0 1-4.013-2.556 15.88 15.88 0 0 1-.927-.885c-1.074-1.041-1.953-2.148-2.607-3.24-.035-.06-.09-.146-.15-.242-.107-.174-.225-.381-.262-.523-.095-.376.157-.678.157-.678s.622-.68.911-1.05c.278-.356.518-.704.671-.952.301-.484.39-.982.238-1.37a216.767 216.767 0 0 0-2.219-5.215c-.156-.339-.598-.589-1.005-.636a6.284 6.284 0 0 0-.414-.041"})]})})},359599:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=class{constructor(e){this.cache=new Map,this.howBig=0,this.fn=e}getKeyString(e){return"string"==typeof e?e:e.join("_")}getRefSetter(e){const t=this.getKeyString(e);let n=this.cache.get(t);return n||(n=n=>{this.fn(e,n),n||this.cache.delete(t)},this.cache.set(t,n),Math.floor(this.cache.size/500)>this.howBig&&(__LOG__(4,void 0,new Error)`[SetRefCache] Large cache detected with ${this.cache.size} entries`,this.howBig=Math.floor(this.cache.size/500))),n}}},237889:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(441609)),a=r(n(395654));class o extends a.default{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"next";super(),this.list=e,this.index=-1,this.value=void 0,this.getter=t,this.deleteDir=n}init(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.list=n,null!=this.value)if((0,i.default)(n))this.unset();else{if(e=n.indexOf(this.value),e>-1){if(e===this.index)return;t=!0,r=!1}else if(!r||this.index<0)e=-1;else{const r="prev"===this.deleteDir?-1:0;e=this.index+r,e=Math.max(e,0),e=Math.min(e,n.length-1),t=e>-1}this.set(e,r,t)}}unset(){const e=this.value;this.value=void 0,this.index=-1,null!=e&&this.trigger(this.getter(e),!1)}reset(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.index<0||null!=this.value&&this.trigger(this.getter(this.value),"focus",e)}set(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!this.list.length)return;const r=Math.min(Math.max(e,-1),this.list.length-1),i=this.value,a=r>-1?this.list[r]:void 0;null!=a?(this.value=a,this.trigger(this.getter(a),!0===t?"focus":"select")):!0===n&&(this.value=void 0),!0===n&&null!=i&&i!==a&&this.trigger(this.getter(i),!1),this.index=r}getVal(){return this.value}setVal(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=this.list.indexOf(e);n>-1?this.set(n,t):(this.unset(),this.value=e)}setFirst(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];(0,i.default)(this.list)||this.set(0,e,!0)}setLast(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];(0,i.default)(this.list)||this.set(this.list.length-1,e,!0)}setPrev(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];(0,i.default)(this.list)||this.set(this.prev(),e,!0)}setNext(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];(0,i.default)(this.list)||this.set(this.next(),e,!0)}prev(){return(0,i.default)(this.list)||-1===this.index?-1:this.index-1}next(){return(0,i.default)(this.list)?-1:Math.min(this.index+1,this.list.length-1)}}var s=o;t.default=s},76892:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(196554)),a=n(753233),o=r(n(932325)),s=r(n(79291)),l=n(785893);t.default=()=>{const e=s.default.build("https://www.whatsapp.com/legal/small-business-terms/",{lg:o.default.getLocale()});return(0,l.jsx)(i.default,{href:e,onClick:t=>{t.preventDefault(),setTimeout((()=>(0,a.openExternalLink)(e)),10)},children:o.default.t(394)})}},956113:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.RADIUS=void 0,t.Spinner=function(e){const{size:t=65,stroke:n=4,color:r=l.default,outgoingMsg:i,max:u=100,value:d}=e,p=function(e,t){if(null==e)return null;const n=Math.max(Math.min(e,t),0);return Math.ceil(100*n/t)}(d,u),_=40+n;return(0,o.jsxs)("svg",{className:(0,a.default)(null==p&&s.container||s.rotate),width:t,height:t,viewBox:`0 0 ${_} ${_}`,role:"status",children:[null!=p?(0,o.jsx)(c,{viewBoxSide:_,stroke:n,outgoingMsg:i,color:"default",progress:u}):null,(0,o.jsx)(c,{progress:p,viewBoxSide:_,stroke:n,outgoingMsg:i,color:r})]})},t.colorOptions=void 0;var i=r(n(599001)),a=r(n(156720)),o=n(785893);const s={accent:{stroke:"dba1p600"},container:{animationName:"gdrnme8s",animationDuration:"hbnrezoj",animationTimingFunction:"f8mos8ky",animationIterationCount:"tkmeqcnu",zIndex:"b9fczbqn"},default:{stroke:"a5uym4to"},wdsSecondaryLighter:{stroke:"ml8t9l8k"},highlight:{stroke:"sku37djt"},progress:{stroke:"gibn6ev6"},in:{stroke:"ptcoeott"},noop:{visibility:"g5crjs6l"},out:{stroke:"mbixqzja"},rounded:{strokeLinecap:"bvgz89zs"},path:{animationName:"nmreelbr",animationDuration:"sw4r90y6",animationTimingFunction:"gaqnkt02",animationIterationCount:"tkmeqcnu",strokeDasharray:"kzgl1sas",strokeDashoffset:"fwna6xbl"},solidwhite:{stroke:"ad0o4787"},white:{stroke:"qaop2s2o"},rotate:{transform:"bwjm0vhl",transformOrigin:"sx61ek5s"}},l=(0,i.default)({default:null,wdsSecondaryLighter:null,highlight:null,solidwhite:null,white:null,accent:null,progress:null});t.colorOptions=l;function u(e){if(null==e)return null;const t=Math.ceil(40*Math.PI);return{strokeDasharray:`${t} ${t}`,strokeDashoffset:t-e/100*t}}function c(e){let{stroke:t,viewBoxSide:n,progress:r,color:i,outgoingMsg:l}=e;return(0,o.jsx)("circle",{style:u(r),className:(0,a.default)(s.rounded,null==r&&s.path,s[i],!1===l&&s.in,l&&s.out),cx:n/2,cy:n/2,r:20,fill:"none",strokeWidth:t})}t.RADIUS=20},397778:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const{Icon:t,disabled:n,onClick:r,type:c,title:d,"aria-label":p}=e,_=(0,a.default)(e,l);return(0,s.jsx)(o.default,{xstyle:!0===n&&u.disabled,disabled:n,onClick:r,"aria-label":p,title:d,type:c,children:(0,s.jsx)(t,(0,i.default)({},_))})};var i=r(n(81109)),a=r(n(506479)),o=r(n(625903)),s=(r(n(156720)),n(785893));const l=["Icon","disabled","onClick","type","title","aria-label"],u={disabled:{opacity:"aiwu9bi8"}}},583017:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.SVGBase=void 0,t.loadSVGData=T,t.loadSpecificSVG=function(){return v.apply(this,arguments)};var i=r(n(81109)),a=r(n(506479)),o=r(n(348926)),s=n(88237),l=n(989211),u=r(n(132375)),c=n(36530),d=n(962833),p=r(n(120992)),_=n(667294),f=r(n(156720)),h=r(n(189957)),g=n(785893);const m=["aria-label","aria-hidden","name","isRTL","className","display","containerRef","height","width","viewBox","xstyle","iconXstyle"],y={reverse:{display:"f804f6gw",transform:"n4o0o7gj"},inline:{display:"l7jjieqr",verticalAlign:"fewfhwl7"}};let E,S;function T(e){return S||(S=(0,d.promiseLoop)(((t,r,i)=>{if(null==e?void 0:e.aborted)throw new s.AbortError;const a=(0,c.delayMs)((0,l.expBackoff)(i,12e4,1e3,.1));return n.e(5512).then(n.bind(n,281478)).then((e=>{E=e.default,t()})).catch((()=>a))})))}function v(){return(v=(0,o.default)((function*(e){return yield T(),(0,u.default)(E,"SVGData")[e]}))).apply(this,arguments)}function A(e){const t=e.split("-");for(let e=1;e<t.length;e++)t[e]=t[e].charAt(0).toUpperCase()+t[e].slice(1).toLowerCase();return t.join("")}function C(e){if(null==e)return{};const t=e.attributes;return t.length>0?function(e){const t={};for(const n of e){let e=n.name;e.startsWith("xmlns")||(e.includes("-")?e=A(e):"class"===e&&(e="className"),t[e]=n.value)}return t}(t):{}}function P(e){var t;const[n,r]=(0,_.useState)(!!E),o=(0,h.default)();(0,_.useEffect)((()=>{n||T(o).then((()=>{if(o.aborted)throw new s.AbortError;r(!0)})).catch((()=>{}))}),[]);const{"aria-label":l,"aria-hidden":u,name:c,isRTL:d,className:S,display:v,containerRef:A,height:P,width:O,viewBox:I,xstyle:M,iconXstyle:b}=e,R=(0,a.default)(e,m);if(E&&!E[c])throw new Error("Missing SVG for '"+c+"'!");const N=null===(t=E)||void 0===t?void 0:t[c],w=(0,_.useMemo)((()=>function(e){if(null==e)return null;const t=document.createElement("div");t.innerHTML=e;const n=t.firstElementChild;return"svg"===(null==n?void 0:n.tagName)?(t.removeChild(n),n):null}(N)),[N]),L=(0,_.useMemo)((()=>C(w)),[w]);if(I){const{x:e=0,y:t=0,width:n=0,height:r=0}=I;L.viewBox=[e,t,n,r].join(" ")}const D={};return null==P&&null==O||(D.height=P,D.width=O,D.preserveAspectRatio="xMidYMid meet"),(0,g.jsx)("span",(0,i.default)((0,i.default)({"data-testid":c,"aria-hidden":u,"aria-label":l,ref:A,"data-icon":c,className:(0,p.default)(S,(0,f.default)(d&&y.reverse,"inline"===v&&y.inline,M))},R),{},{children:(0,g.jsx)("svg",(0,i.default)((0,i.default)((0,i.default)({},L),D),{},{className:(0,f.default)(b),dangerouslySetInnerHTML:{__html:null==w?void 0:w.innerHTML}}))}))}const O=(0,_.memo)(P);t.SVGBase=O},615647:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.BaseSvgSpan=function(e){if(null==e.children||"svg"!==e.children.type)throw new Error("Cannot use BaseSvgSpan without SVG children");const{"aria-label":t,"aria-hidden":n,className:r,directional:_,displayInline:f,containerRef:h,height:g,width:m,xstyle:y,color:E,name:S,children:T}=e,v=(0,a.default)(e,c),A=!0===_&&o.default.isRTL();let C;if(null!=E)switch(E){case p.GRAY:C=d.grayColor;break;case p.SECONDARY:C=d.secondaryColor;break;case p.TEAL:C=d.tealColor}const P=(0,l.default)(A&&d.reverse,!0===f&&d.inline,C,y),O={};null==g&&null==m||(O.height=g,O.width=m,O.preserveAspectRatio="xMidYMid meet");return(0,u.jsx)("span",(0,i.default)((0,i.default)({"data-testid":S,"aria-hidden":n,"aria-label":t,ref:h,"data-icon":S,className:(0,s.default)(r,P)},v),{},{children:T}))},t.SvgColorProp=void 0;var i=r(n(81109)),a=r(n(506479)),o=r(n(932325)),s=r(n(120992)),l=r(n(156720)),u=n(785893);const c=["aria-label","aria-hidden","className","directional","displayInline","containerRef","height","width","xstyle","color","name","children"],d={secondaryColor:{color:"aft2yglh"},tealColor:{color:"jq3rn4u7"},grayColor:{color:"hsqj3bek"},reverse:{display:"f804f6gw",transform:"n4o0o7gj"},inline:{display:"l7jjieqr",verticalAlign:"fewfhwl7"}},p=n(76672)({SECONDARY:"secondaryColor",TEAL:"tealColor",GRAY:"grayColor"});t.SvgColorProp=p},614495:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(395654));class a extends i.default{constructor(){super(),this.mediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.theme=this.getCurrentTheme(),this.handleThemeChange=()=>{const e=this.getCurrentTheme();e!==this.theme&&(this.theme=e,this.trigger("system_theme_change",e))},this.mediaQuery.addListener(this.handleThemeChange)}getCurrentTheme(){return this.mediaQuery.matches?"dark":"light"}}var o=new a;t.default=o},180519:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Text=p,t.TextDiv=function(e){return(0,u.jsx)(p,(0,a.default)({as:"div"},e))},t.TextHeader=function(e){const{level:t="1"}=e,n=(0,i.default)(e,c);return(0,u.jsx)(p,(0,a.default)({as:_[t]},n))},t.TextLabel=function(e){let{htmlFor:t}=e,n=(0,i.default)(e,d);return(0,u.jsx)(p,(0,a.default)((0,a.default)({as:"label"},n),{},{extras:{htmlFor:t}}))},t.TextParagraph=function(e){return(0,u.jsx)(p,(0,a.default)({as:"p"},e))},t.TextSpan=function(e){return(0,u.jsx)(p,(0,a.default)({as:"span"},e))};var i=r(n(506479)),a=r(n(81109)),o=r(n(808561)),s=r(n(120992)),l=r(n(156720)),u=n(785893);const c=["level"],d=["htmlFor"];function p(e){var t,n,r,i;const c=null!==(t=e.as)&&void 0!==t?t:"span",d=e.theme?o.default[e.theme]:null,p=e.color?o.default[`color-${e.color}`]:null,_=o.default[`weight-${null!==(n=e.weight)&&void 0!==n?n:"normal"}`],f=null!=e.customSize||null!=(null!==(r=e.xstyle)&&void 0!==r?r:{}).fontSize?null:null!==(i=e.size)&&void 0!==i?i:"14",h=null!=f?o.default[`size-${f}`]:null;let g;return null!=e.customSize&&(g={fontSize:"string"==typeof e.customSize?e.customSize:`${e.customSize}px`}),(0,u.jsx)(c,(0,a.default)((0,a.default)({},e.extras),{},{className:(0,s.default)(d,p,h,_,e.className,(0,l.default)(e.xstyle)),style:g,"data-testid":e.testid,children:e.children}))}const _={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6"}},625786:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ToastDismissBtn=t.ToastBody=t.ToastActionBtn=t.Toast=void 0,t.genId=function(e){return(0,i.default)(e||"toast")};var i=r(n(873955)),a=n(390737),o=n(50010),s=n(992934),l=n(667294),u=r(n(156720)),c=n(85284),d=n(785893);const p=4e3,_={btnSuccess:{color:"j5au4wul",fontWeight:"nbipi2bn"},button:{color:"dud78hvd",cursor:"ajgl1lbb",fontSize:"f8jlpxt4",lineHeight:"a4ywakfo",flexShrink:"oq44ahr5"},close:{color:"afo7vhit"},right:{right:"grt5ktjy"},toast:{alignItems:"gndfcl4n",backgroundColor:"cqvkqxai",borderTopStartRadius:"cynldqnp",borderTopEndRadius:"l5pmshjt",borderBottomEndRadius:"ecxr5yey",borderBottomStartRadius:"lysxvg3k",color:"k17s6i4e",display:"p357zi0d",fontSize:"f8jlpxt4",lineHeight:"a4ywakfo"}};const f=(0,l.forwardRef)(((e,t)=>{const{msg:n,action:r,onDismiss:i,id:o,duration:s=p}=e,[u]=(0,c.useTimeout)((()=>{a.ToastManager.close(o)}),s,{immediate:!0}),_=()=>{a.ToastManager.close(o),null==i||i()};let f;if((0,l.useImperativeHandle)(t,(()=>({restartDelay:u}))),r){f=(Array.isArray(r)?r:[r]).map(((e,t)=>(0,d.jsx)(h,{buttonText:e.actionText,onClick:e.dismiss?_:e.onAction,theme:e.theme},e.actionText.toString()+t)))}return(0,d.jsx)(g,{actionText:n,actionButtons:f})}));t.Toast=f;const h=e=>{let{buttonText:t,onClick:n,theme:r}=e;return(0,d.jsx)("button",{className:(0,u.default)(_.button,o.uiMargin.start15,"success"===r&&_.btnSuccess),onClick:n,children:t})};t.ToastActionBtn=h;t.ToastDismissBtn=e=>{let{buttonText:t,onClick:n}=e;return(0,d.jsx)("button",{className:(0,u.default)(_.close,o.uiMargin.start15),onClick:n,children:(0,d.jsx)(s.XAltIcon,{})})};const g=e=>{let{toastPosition:t,actionText:n,actionButtons:r,dismissButton:i}=e;return(0,d.jsxs)("div",{className:(0,u.default)(_.toast,o.uiPadding.vert12,o.uiPadding.horiz16,"RIGHT"===t&&_.right),"data-testid":"toast-body",children:[(0,d.jsx)("span",{children:n}),r,i]})};t.ToastBody=g},625903:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=r(n(506479)),o=r(n(120992)),s=n(667294),l=r(n(156720)),u=r(n(380362)),c=r(n(676185)),d=n(785893);const p=["testid","className","children","dataTab","disabled","onClick","onMouseEnter","onMouseLeave","onMouseDown","title","type","onFocus","xstyle","tabIndex"],_={button:{paddingTop:"i5tg98hk",paddingEnd:"f9ovudaz",paddingBottom:"przvwfww",paddingStart:"gx1rr48f",fontFamily:"shdiholb",fontSize:"phqmzxqs",color:"gtscxtjd",cursor:"ajgl1lbb",backgroundColor:"thr4l2wc",borderTop:"cc8mgx9x",borderEnd:"eta5aym1",borderBottom:"d9802myq",borderStart:"e4xiuwjv"},focused:{borderTopStartRadius:"dntxsmpk",borderTopEndRadius:"ixn6u0rb",borderBottomEndRadius:"s2vc4xk1",borderBottomStartRadius:"o0wkt7aw",boxShadow:"lgxs6e1q"},disabled:{cursor:"rcg4vxlo"}};function f(e,t){let{testid:n,className:r,children:s,dataTab:f,disabled:h,onClick:g,onMouseEnter:m,onMouseLeave:y,onMouseDown:E,title:S,type:T="button",onFocus:v,xstyle:A,tabIndex:C=0}=e,P=(0,a.default)(e,p);const[O,I]=(0,u.default)(),M=(0,c.default)(t,O),b={};return null!=P["aria-label"]&&(b["aria-label"]=P["aria-label"]),null!=P["aria-pressed"]&&(b["aria-pressed"]=P["aria-pressed"]),(0,d.jsx)("button",(0,i.default)((0,i.default)({className:(0,o.default)((0,l.default)(_.button,I&&_.focused,h&&_.disabled,A),r),tabIndex:C,"data-tab":null!=f?f:void 0,"data-testid":n,disabled:!0===h,onClick:g,onMouseEnter:m,onMouseLeave:y,onMouseDown:E,onFocus:v,ref:M,title:S,type:T},b),{},{children:s}))}var h=(0,s.forwardRef)(f);t.default=h},905225:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHAT_WALLPAPER=void 0,t.colorExistsInTheme=function(e,t){const n=d(t);return e===i||n.some((t=>t.toUpperCase()===e.toUpperCase()))},t.getDoodleAssetName=function(e,t){if(r.ServerProps.wallpapersV2&&"light"===t&&e!==i){const n=p(e,t,"doodle");if(n)return`data-asset-chat-background-${n}`}let n=`data-asset-chat-background-${t}`;"light"===t&&e===i&&(n="data-asset-chat-background-dark");return n},t.getDoodleOpacity=function(e,t){if(r.ServerProps.wallpapersV2){const n=p(e,t,"opacity");if(n)return n}if("light"===t&&e===i)return"0.4";return"0.06"},t.getWallpaperColorPropValue=p,t.getWallpaperColors=d,t.invertTransparentWallpaperColors=function(e,t){if(r.ServerProps.wallpapersV2)return"light"===e&&t!==i&&!!p(t,e,"invertTransparentWallpaperColors");const n=o.includes(t);return!!d(e).includes(t)&&(n?"light"===e:"dark"===e)},t.toggleWallpaperColor=function(e,t){const n=d(t);if(e===i)return i;if(r.ServerProps.wallpapersV2){const r=n.findIndex((t=>t.toUpperCase()===e.toUpperCase()));if(-1!==r)return"light"===t?c[r]:u[r]}return e};var r=n(241588);const i="default_chat_wallpaper";t.DEFAULT_CHAT_WALLPAPER=i;const a=["#ccebdc","#aed8c7","#7acba5","#c7e9eb","#a9dbd8","#68d5d9","#6ec3d4","#f2dad5","#f2d5e1","#fbcad2","#ffa7a8","#cbdaec","#d7d3eb","#e5c0eb","#d0deb1","#dee0b4","#e6dfa8","#f7e9a8","#ffd1a4","#ff8a8c","#ff5978","#f56056","#dc6e4f","#e6e365","#73c780","#2293a4","#219ed9","#2b5aa6","#74676a","#48324d","#dee3e9","#d9dade","#c0c1c4","#7e90a3","#55626f","#243640","#162127"],o=["#ff8a8c","#ff5978","#f56056","#dc6e4f","#73c780","#2293a4","#219ed9","#2b5aa6","#74676a","#48324d","#7e90a3","#55626f","#243640","#162127"],s={"#BBE4E5":{doodle:"dark",opacity:"0.42"},"#AED8C7":{doodle:"dark",opacity:"0.3"},"#7ACBA5":{doodle:"dark",opacity:"0.26"},"#CBDAEC":{doodle:"dark",opacity:"0.42"},"#66D2D5":{doodle:"dark",opacity:"0.26"},"#63BDCF":{doodle:"dark",opacity:"0.26"},"#D6D0F0":{doodle:"dark",opacity:"0.36"},"#CECECE":{doodle:"dark",opacity:"0.36"},"#D1DABE":{doodle:"dark",opacity:"0.36"},"#E6E1B1":{doodle:"dark",opacity:"0.42"},"#FEEFA9":{doodle:"light",opacity:"0.06"},"#FED297":{doodle:"dark",opacity:"0.42"},"#FD9A9B":{doodle:"dark",opacity:"0.26"},"#FD6769":{doodle:"dark",opacity:"0.26"},"#FB4668":{doodle:"dark",opacity:"0.26"},"#922040":{doodle:"dark",opacity:"0.17",invertTransparentWallpaperColors:!0},"#DC6E4F":{doodle:"dark",opacity:"0.2"},"#644D52":{doodle:"dark",opacity:"0.13",invertTransparentWallpaperColors:!0},"#517E7E":{doodle:"dark",opacity:"0.13"},"#3190BB":{doodle:"dark",opacity:"0.13"},"#35558A":{doodle:"dark",opacity:"0.1",invertTransparentWallpaperColors:!0},"#55626F":{doodle:"dark",opacity:"0.1",invertTransparentWallpaperColors:!0},"#1D2326":{doodle:"dark",opacity:"0.1",invertTransparentWallpaperColors:!0},"#301E34":{doodle:"dark",opacity:"0.1",invertTransparentWallpaperColors:!0},"#ECF0F1":{doodle:"light",opacity:"0.06"},"#FFFEA2":{doodle:"light",opacity:"0.06"},"#E7E8D2":{doodle:"light",opacity:"0.06"}},l={"#0F2424":{doodle:"dark",opacity:"0.05"},"#12261F":{doodle:"dark",opacity:"0.055"},"#11241C":{doodle:"dark",opacity:"0.055"},"#111E27":{doodle:"dark",opacity:"0.06"},"#0F2224":{doodle:"dark",opacity:"0.06"},"#0E2125":{doodle:"dark",opacity:"0.055"},"#1F1D25":{doodle:"dark",opacity:"0.06"},"#212121":{doodle:"dark",opacity:"0.055"},"#1F211C":{doodle:"dark",opacity:"0.055"},"#23231B":{doodle:"dark",opacity:"0.055"},"#262419":{doodle:"dark",opacity:"0.055"},"#261F17":{doodle:"dark",opacity:"0.055"},"#261717":{doodle:"dark",opacity:"0.055"},"#260F10":{doodle:"dark",opacity:"0.06"},"#260A10":{doodle:"dark",opacity:"0.07"},"#19050B":{doodle:"dark",opacity:"0.075"},"#21100C":{doodle:"dark",opacity:"0.07"},"#0F0C0C":{doodle:"dark",opacity:"0.065"},"#101919":{doodle:"dark",opacity:"0.06"},"#0A1D25":{doodle:"dark",opacity:"0.055"},"#0D1523":{doodle:"dark",opacity:"0.065"},"#0D0F11":{doodle:"dark",opacity:"0.07"},"#0A0C0D":{doodle:"dark",opacity:"0.07"},"#110B12":{doodle:"dark",opacity:"0.07"},"#1E1F1F":{doodle:"dark",opacity:"0.055"},"#262618":{doodle:"dark",opacity:"0.055"},"#23231F":{doodle:"dark",opacity:"0.055"}},u=Object.keys(s),c=Object.keys(l);function d(e){return r.ServerProps.wallpapersV2?"light"===e?u:c:a}function p(e,t,n){const r="light"===t?s:l;for(const t in r)if(t.toUpperCase()===e.toUpperCase())return r[t][n];return null}},791429:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Clipboard=t.APP_TEXT_MIMETYPE=void 0;var i=r(n(396026)),a=r(n(616579)),o=r(n(552747)),s=n(175448),l=n(306703),u=r(n(562815)),c=r(n(554676)),d=r(n(52755));t.APP_TEXT_MIMETYPE="application/whatsapp";class p{constructor(e){this._value=e||""}append(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return this._value=[this.toString(),e].filter((e=>e)).join(t),this}prepend(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return this._value=[e,this.toString()].filter((e=>e)).join(t),this}toString(){return this._value}}class _{static fromEl(e){const t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,s.isCopyable)(e))?(0,s.getAppTextTemplateData)(e):null;return new _("",t)}static getTemplate(e){let t=e;if(!t)return null;if(!(t instanceof HTMLElement)){if(!t.parentElement)return null;t=t.parentElement}let n=new _("${appText}"),r=t,i=5,a=0,o=!1;for(;r&&a<i;)r instanceof HTMLElement&&(0,s.isCopyable)(r)?(n=_.fromEl(r,!0).append(n.toString()),o=o||!n.isPlainText(),i=5):a++,r=r.parentElement;return o?n.toString():null}constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;this._innerAppText=new p(e),this._appTextTemplate=t}append(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return this._innerAppText.append(e,t),this}prepend(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return this._innerAppText.prepend(e,t),this}isPlainText(){return Boolean(!this._appTextTemplate&&""!==this._appTextTemplate)}toString(){return this._appTextTemplate||""===this._appTextTemplate?this._appTextTemplate.replace(/\$\{appText\}/g,this._innerAppText.toString()):this._innerAppText.toString()}}class f{constructor(e,t){const n=e||"";this._plainText=new p(n),t&&(this._appText=new _(n,t))}static _copyableChildrenToClipboard(e){const t=(0,s.findCopyableChildren)(e);return(0,a.default)(t,((e,t)=>e.prepend(this.fromEl(t),"\n")),new f)}static _pruneRangeNodes(e,t,n){let r=t.cloneContents().childNodes,i=(0,d.default)(t);const a=[],o=[];for(let t=0;t<r.length;t++){const s=r[t],u=i[t].parentElement;(n||(0,l.isSelectable)(i[t])||(0,l.hasSelectableChildren)(s))&&(e.contains(i[t])||u&&u.contains(e))&&(a.push(s),o.push(i[t]))}r=a,i=o;let s=n;if(1===r.length){const e=r[0];s=s||(0,l.isSelectable)(i[0]),s||(r=(0,l.findSelectableChildren)(e,s),s=!1)}return{rangeNodes:r,parentIsSelectable:s}}static fromCopyableEl(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=(0,s.getPrePlainTextData)(e)||"",r=new f(n),i=(0,s.getPlainTextData)(e),o=(0,s.getAppTextTemplateData)(e),c=new f("",o);return i||""===i?(c.appendPlainText(i),r.append(c)):t||(0,l.isSelectable)(e)?(0,u.default)(e,"br")?r.appendPlainText("\n"):((0,a.default)(e.childNodes,((e,t)=>{const n=(0,u.default)(t,"div")?"\n":"";return e.prepend(this.fromSelectableNode(t),n)}),c),r.append(c)):(c.append(this._copyableChildrenToClipboard(e)),r.append(c))}static fromEl(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,s.isCopyable)(e)||t?this.fromCopyableEl(e,t):this._copyableChildrenToClipboard(e)}static fromNode(e,t){return e instanceof HTMLElement?this.fromEl(e,t):t?this.fromSelectableNode(e):new f}static fromRange(e,t){const n=t.commonAncestorContainer,r=_.getTemplate(n),i=new f("",r),o=(0,l.isSelectAll)(n)?n:(0,l.findSelectAllParent)(n);if(o instanceof HTMLElement)return i.append(this.fromCopyableEl(o));const{parentIsSelectable:s,rangeNodes:u}=this._pruneRangeNodes(e,t,(0,l.isSelectable)(n));return(0,a.default)(u,((e,t)=>{const n=this.fromNode(t,s),r=s||n.toAppString().endsWith("\n")?"":"\n";return e.prepend(n,r)}),i)}static fromSelectableNode(e){if((0,c.default)(e))return new f(e.textContent);if(!(e instanceof HTMLElement))return new f;const t=new f;return(0,o.default)(e,(e=>(0,c.default)(e)||(0,s.isCopyable)(e)?[]:Array.from(e.childNodes)),(n=>{let r;(0,s.isCopyable)(n)&&n instanceof HTMLElement?(r=this.fromCopyableEl(n,!0),t.append(r)):(0,c.default)(n)?t.appendPlainText(n.textContent):(0,u.default)(e,"br")&&t.appendPlainText("\n")})),t}static fromSelection(e,t){const n=new f;return(0,i.default)(t.rangeCount).map((n=>{const r=t.getRangeAt(n);return this.fromRange(e,r)})).reduce(((e,t)=>e.append(t,"\n")),n)}append(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.hasAppText()?(this._appText=this._appText||new _(this.toPlainString()),this._appText.append(e.toAppString(),t)):this.hasAppText()&&this._appText.append(e.toAppString(),t),this._plainText.append(e.toPlainString(),t),this}appendPlainText(e){return this.append(new f(e)),this}prepend(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.hasAppText()?(this._appText=this._appText||new _(this.toPlainString()),this._appText.prepend(e.toAppString(),t)):this.hasAppText()&&this._appText.prepend(e.toAppString(),t),this._plainText.prepend(e.toPlainString(),t),this}hasAppText(){return Boolean(this._appText)}toAppText(){return this.hasAppText()?this._appText:new _(this.toPlainString())}toPlainString(){return this._plainText.toString()}toAppString(){return this.hasAppText()?this._appText.toString():this.toPlainString()}}t.Clipboard=f},175448:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Copyable=t.COPYABLE_CSS_SELECTOR=t.COPYABLE_CSS_CLASS=void 0,t.CopyableCode=function(e){return(0,d.jsx)("code",(0,a.default)({},O(e)))},t.CopyableDel=function(e){return(0,d.jsx)("del",(0,a.default)({},O(e)))},t.CopyableDiv=function(e){return(0,d.jsx)("div",(0,a.default)({},O(e)))},t.CopyableEm=function(e){return(0,d.jsx)("em",(0,a.default)({},O(e)))},t.CopyableImg=void 0,t.CopyableLink=function(e){const t=O(e),n=t.href;if(n&&!l.default.hasValidUrlScheme(n))return(0,d.jsx)("span",{});return(0,d.jsx)("a",(0,a.default)({},t))},t.CopyableSpan=function(e){return(0,d.jsx)("span",(0,a.default)({},O(e)))},t.CopyableStrong=function(e){return(0,d.jsx)("strong",(0,a.default)({},O(e)))},t.CopyableUl=function(e){return(0,d.jsx)("ul",(0,a.default)({},O(e)))},t.PLAIN_TEXT_DATA_ATTR=void 0,t.findCopyableChildren=function(e){const t=Array.from(e.querySelectorAll(g));return t.filter((e=>!t.some((t=>t!==e&&t.contains(e)))))},t.getAppTextTemplateData=function(e){return e.dataset[v]},t.getPlainTextData=function(e){return e.dataset[y]},t.getPrePlainTextData=function(e){return e.dataset[S]},t.isCopyable=function(e){return e instanceof HTMLElement&&(0,s.default)(e,g)};var i=r(n(506479)),a=r(n(81109)),o=r(n(489376)),s=r(n(216114)),l=r(n(79291)),u=r(n(120992)),c=n(667294),d=n(785893);const p=["forwardedRef"],_=["element"],f=["plainText","prePlainText","appTextTemplate"],h="copyable-text";t.COPYABLE_CSS_CLASS=h;const g=".copyable-text";t.COPYABLE_CSS_SELECTOR=g;const m="data-plain-text",y=(0,o.default)(m);t.PLAIN_TEXT_DATA_ATTR=y;const E="data-pre-plain-text",S=(0,o.default)(E),T="data-app-text-template",v=(0,o.default)(T);const A=(0,c.forwardRef)(((e,t)=>{var n;let{forwardedRef:r}=e;const o=O((0,i.default)(e,p));return(0,d.jsx)("img",(0,a.default)((0,a.default)({ref:null!=r?r:t},o),{},{alt:null!==(n=o.alt)&&void 0!==n?n:""}))}));function C(e,t){let{element:n}=e,r=(0,i.default)(e,_);return(0,d.jsx)(n,(0,a.default)((0,a.default)({},O(r)),{},{ref:t}))}t.CopyableImg=A;const P=(0,c.forwardRef)(C);function O(e){let{plainText:t,prePlainText:n,appTextTemplate:r}=e,o=(0,i.default)(e,f);const s=(0,a.default)({},o);return s.className=(0,u.default)(o.className,h),null!=t&&(s[m]=t),null!=n&&(s[E]=n),null!=r&&(s[T]=r),s}t.Copyable=P},152583:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=r(n(506479)),o=n(791429),s=r(n(12783)),l=r(n(120992)),u=n(667294),c=n(785893);const d=["canCut","children","className","testid"];function p(e,t){let{canCut:n,children:r,className:o,testid:u}=e,p=(0,a.default)(e,d);const _=(0,i.default)((0,i.default)({},p),{},{className:(0,l.default)(o,s.default.noop,"copyable-area"),onCopy:h,onCut:n?g:void 0});return(0,c.jsx)("div",(0,i.default)((0,i.default)({},_),{},{ref:t,"data-testid":u,children:r}))}var _=(0,u.forwardRef)(p);function f(e){const t=e.currentTarget;if(!(t instanceof HTMLElement))return!1;const n=o.Clipboard.fromSelection(t,window.getSelection());e.clipboardData.setData("text/plain",n.toPlainString());try{e.clipboardData.setData(o.APP_TEXT_MIMETYPE,n.toAppString())}catch(e){}return!0}function h(e){f(e,window.getSelection())&&(e.stopPropagation(),e.preventDefault())}function g(e){const t=window.getSelection();f(e)&&(t.deleteFromDocument(),e.stopPropagation(),e.preventDefault(),e.target.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})))}t.default=_},306703:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Selectable=t.SELECTABLE_INPUT_CSS_CLASS=t.SELECTABLE_CSS_SELECTOR=t.SELECTABLE_CSS_CLASS=void 0,t.SelectableCode=function(e){const t=b(e);return e.selectable?(0,_.jsx)(o.CopyableCode,(0,a.default)({},t)):(0,_.jsx)("code",(0,a.default)({},t))},t.SelectableDel=function(e){const t=b(e);return e.selectable?(0,_.jsx)(o.CopyableDel,(0,a.default)({},t)):(0,_.jsx)("del",(0,a.default)({},t))},t.SelectableDiv=function(e){const t=b(e);return e.selectable?(0,_.jsx)(o.CopyableDiv,(0,a.default)({},t)):(0,_.jsx)("div",(0,a.default)({},t))},t.SelectableEm=function(e){const t=b(e);return e.selectable?(0,_.jsx)(o.CopyableEm,(0,a.default)({},t)):(0,_.jsx)("em",(0,a.default)({},t))},t.SelectableImg=void 0,t.SelectableLink=function(e){const t=b(e),n=e.href;if(n&&!u.default.hasValidUrlScheme(n))return(0,_.jsx)("span",{});return e.selectable?(0,_.jsx)(o.CopyableLink,(0,a.default)({},t)):(0,_.jsx)("a",(0,a.default)({},t))},t.SelectableSpan=function(e){const t=b(e);return e.selectable?(0,_.jsx)(o.CopyableSpan,(0,a.default)({},t)):(0,_.jsx)("span",(0,a.default)({},t))},t.SelectableStrong=function(e){const t=b(e);return e.selectable?(0,_.jsx)(o.CopyableStrong,(0,a.default)({},t)):(0,_.jsx)("strong",(0,a.default)({},t))},t.SelectableUl=function(e){const t=b(e);return e.selectable?(0,_.jsx)(o.CopyableUl,(0,a.default)({},t)):(0,_.jsx)("ul",(0,a.default)({},t))},t.createSelectableElement=function(e,t){const n=document.createElement(e);n.setAttribute("class",y),(t||""===t)&&(n.dataset[o.PLAIN_TEXT_DATA_ATTR]=t);return n},t.findSelectAllParent=function(e){if(!P(e))return null;let t,n=e,r=0;for(;n&&r<5;){if(C(n)&&n instanceof HTMLElement){t=n;break}n=n.parentElement,r++}return t},t.findSelectableChildren=function(e,t){if(!(e instanceof HTMLElement))return[];if(t||A(e))return Array.from(e.childNodes);const n=Array.from(e.querySelectorAll(E));return n.filter((e=>!n.some((t=>t!==e&&t.contains(e)))))},t.hasSelectableChildren=function(e){if(!(e instanceof HTMLElement))return!1;return!!e.querySelector(E)},t.isSelectAll=C,t.isSelectable=A;var i=r(n(506479)),a=r(n(81109)),o=n(175448),s=n(113704),l=r(n(216114)),u=r(n(79291)),c=r(n(352204)),d=r(n(120992)),p=n(667294),_=n(785893);const f=["forwardedRef"],h=["element"],g=["className","plainText","prePlainText","appTextTemplate","selectable","selectAll"],m="selectable-text";t.SELECTABLE_CSS_CLASS=m;const y=`${o.COPYABLE_CSS_CLASS} selectable-text`,E=".selectable-text";t.SELECTABLE_CSS_SELECTOR=E;const S=y;t.SELECTABLE_INPUT_CSS_CLASS=S;const T="select-all",v=".select-all";function A(e){if(!e)return!1;if(!(e instanceof HTMLElement)){return A(e.parentElement)}return(0,l.default)(e,E)||(0,l.default)(e,".selectable-text *")}function C(e){return!!e&&(e instanceof HTMLElement?(0,l.default)(e,v):C(e.parentElement))}function P(e){return!!e&&(e instanceof HTMLElement?(0,l.default)(e,".select-all *"):P(e.parentElement))}const O=(0,p.forwardRef)(((e,t)=>{var n;let{forwardedRef:r}=e,s=(0,i.default)(e,f);const l=b(s);return s.selectable?(0,_.jsx)(o.CopyableImg,(0,a.default)({forwardedRef:t},l)):(0,_.jsx)("img",(0,a.default)((0,a.default)({ref:t},l),{},{alt:null!==(n=s.alt)&&void 0!==n?n:""}))}));function I(e,t){let{element:n}=e,r=(0,i.default)(e,h);const s=b(r);return r.selectable?(0,_.jsx)(o.Copyable,(0,a.default)((0,a.default)({element:n},s),{},{ref:t})):(0,_.jsx)(n,(0,a.default)((0,a.default)({},s),{},{ref:t}))}t.SelectableImg=O;const M=(0,p.forwardRef)(I);function b(e){let{className:t,plainText:n,prePlainText:r,appTextTemplate:a,selectable:o,selectAll:l}=e;const u=(0,i.default)(e,g);return o&&(u.plainText=n,u.prePlainText=r,u.appTextTemplate=a),u.className=(0,d.default)(t,c.default.noop,(0,s.cx)({[m]:o,[T]:o&&l})),u}t.Selectable=M},694209:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.sanitizeNoticeSVG=function(e){return i.default.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0}})},t.sanitizeNoticeText=function(e){return i.default.sanitize(e,{ALLOWED_TAGS:["b","i","a","#text"],ALLOWED_ATTR:["href"],KEEP_CONTENT:!1})};var i=r(n(827856))},489376:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,i.default)(e.replace(/^data-/,""))};var i=r(n(185681))},562815:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return e instanceof HTMLElement&&e.tagName.toLowerCase()===t.toLowerCase()}},216114:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!(e instanceof HTMLElement))return!1;return n.call(e,t)};const n=Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector},554676:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return Boolean(e&&3===e.nodeType)}},52755:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(e.collapsed)return[];if(e.startContainer===e.endContainer)return(0,i.default)(e.startContainer)?[e.startContainer]:Array.prototype.slice.call(e.startContainer.childNodes,e.startOffset,e.endOffset);const t=e.commonAncestorContainer.childNodes;let n,r;n=e.commonAncestorContainer===e.startContainer?t[0]:o(e.commonAncestorContainer,e.startContainer);(0,a.default)(n,"range is invalid: start missing"),r=e.commonAncestorContainer===e.endContainer?t[t.length-1]:o(e.commonAncestorContainer,e.endContainer);(0,a.default)(r,"range is invalid: end missing");const s=r,l=e=>null==e?void 0:e.nextSibling,u=[];let c=n;for(;c&&c!==s;)u.push(c),c=l(c)||l(c.parentNode);return u.push(s),u};var i=r(n(554676)),a=r(n(441143));function o(e,t){let n=t;for(;n.parentNode!==e;){if(!n.parentNode)return null;n=n.parentNode}return n}},664149:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.TooltipColorScheme=t.MenuType=t.EMOJI_PICKER_WIDTH=t.Dropdown=t.DirY=t.DirX=void 0;var i=r(n(81109)),a=r(n(132375)),o=n(780549),s=n(474296),l=n(113704),u=r(n(988410)),c=r(n(335540)),d=n(81644),p=r(n(932325)),_=n(97858),f=r(n(270284)),h=r(n(120992)),g=n(667294),m=r(n(676185)),y=r(n(155793)),E=n(785893);const S=parseInt(f.default["-emoji-picker-width"].replace(/px$/,""),10);t.EMOJI_PICKER_WIDTH=S;const T=n(76672).Mirrored(["Dropdown","DropdownMenu","DropdownText","AttachMenu","Picker","EmojiPicker","StickerPicker","ColorPicker","Tooltip","ReactionDetailsPane","ReactionSendTray","ReactionPicker"]);t.MenuType=T;const v=n(76672).Mirrored(["Default","Highlight"]);t.TooltipColorScheme=v;const A=n(76672).Mirrored(["LEFT","CENTER","RIGHT"]);t.DirX=A;const C=n(76672).Mirrored(["TOP","BOTTOM"]);function P(e){switch(e){case A.RIGHT:return A.LEFT;case A.LEFT:return A.RIGHT;case A.CENTER:return A.CENTER}}function O(e,t,n){return e!==A.CENTER||null==t||null==n?null:{left:t.offsetWidth/2-n.offsetWidth/2}}t.DirY=C;const I=(0,g.forwardRef)(((e,t)=>{const{type:n=T.Dropdown,dirX:r=A.RIGHT,dirY:S=C.BOTTOM,children:I,flipOnRTL:b,origin:R,style:N,horizontal:w,isTemporaryRender:L,autoFocus:D,findFirstItem:k,onDefault:U,testid:G,tooltipColorScheme:x}=e,[B,F]=(0,g.useState)(!1),[j,Y]=(0,g.useState)(null),K=(0,g.useRef)(null),H=(0,g.useRef)(),W=(0,g.useRef)(),V=(0,m.default)(t,K),$=(0,y.default)(),z=(0,g.useMemo)((()=>n!==T.EmojiPicker&&n!==T.ReactionDetailsPane&&n!==T.ReactionSendTray&&n!==T.StickerPicker&&n!==T.ColorPicker&&n!==T.ReactionPicker&&n!==T.DropdownText),[n]);(0,g.useEffect)((()=>{if(z)if(D){var e;const t=null===(e=W.current)||void 0===e?void 0:e.querySelector("[tabindex]");let n;k&&t||W.current&&W.current.firstChild instanceof HTMLDivElement&&t?n=t:W.current&&W.current.children.length>0?n=W.current.children[0]:null!=I&&(n=g.Children.toArray(I)[0]),c.default.focus(n),F(!0),Y(n)}else c.default.focus(K.current)}),[]),(0,g.useEffect)((()=>{W.current&&K.current&&!L&&o.Cmd.floaterEscapeOverlap(K.current,10)}),[L]);const q=(0,g.useMemo)((()=>{const e={},t=null!=N?N:{},[n,a]=function(e,t,n){return[n&&p.default.isRTL()?P(e):e,t]}(r,S,b);if(e[(0,s.compatPrefix)("transformOrigin")]=function(e,t){const n=P(e);return`${t===C.TOP?C.BOTTOM:C.TOP} ${n}`}(n,a),!R)return(0,i.default)((0,i.default)({},t),e);const o=function(e,t,n,r){var i,a;const o={};switch(e){case A.RIGHT:o.left=Math.min(window.innerWidth-(null!==(i=null==r?void 0:r.offsetWidth)&&void 0!==i?i:0)-32,n.x);break;case A.LEFT:o.right=window.innerWidth-n.x;break;case A.CENTER:o.left=n.x-(null!==(a=null==r?void 0:r.offsetWidth)&&void 0!==a?a:0)/2,o.marginLeft=0,o.marginRight=0}switch(t){case C.BOTTOM:{o.top=n.y;const e=null==r?void 0:r.offsetHeight;if(null!=e){const t=window.innerHeight-e-32;o.top=Math.min(t,n.y),o.top<0&&(o.top=0,o.height=window.innerHeight-32,o.overflowY="auto")}break}case C.TOP:o.bottom=window.innerHeight-n.y}return o}(n,a,R,K.current);return(0,i.default)((0,i.default)((0,i.default)({},t),e),o)}),[r,S,b,R,N]),J=()=>{c.default.focus(K.current),F(!1)},Q=(e,t)=>{const n=(t<0?e.length-1:t)%e.length;c.default.focus(e[n]),F(!0),Y(e[n])},X=()=>{const e=Array.from((0,a.default)(W.current,"listRef.current").querySelectorAll("li:not(.dropdown-item-disabled)"));return{activeChildren:e,currentlyFocusedIndex:e.indexOf(j)}},Z=e=>{M(e);const{activeChildren:t,currentlyFocusedIndex:n}=X();0!==t.length&&Q(t,n-1)},ee=e=>{M(e);const{activeChildren:t,currentlyFocusedIndex:n}=X();0!==t.length&&Q(t,n+1)},te=e=>{M(e);const{activeChildren:t,currentlyFocusedIndex:n}=X();if(0===t.length)return;if(t.length>12||6===t.length)return void ee(e);let r;const i=(t.length-2)/2,a=i,o=t.length-3;r=-1===n?0:n>=a&&n<=o?n-i:n>=0&&n<=i-1?n:a,Q(t,r)},ne=e=>{M(e);const{activeChildren:t,currentlyFocusedIndex:n}=X();if(0===t.length)return;if(t.length>12||6===t.length)return void Z(e);let r;const i=(t.length-2)/2,a=t.length-3;r=n>=i&&n<=a?a+1:n>=0&&n<=i-1?n+i:n,Q(t,r)},re=e=>{e.preventDefault(),null==$||$.requestDismiss()},ie=e=>{U&&(u.default.shouldIndicateFocus(),null==$||$.requestDismiss(),U(e))},ae=e=>{e.stopPropagation(),c.default.focus(K.current),Y(void 0)},oe=(0,h.default)((0,l.cx)({[f.default.container]:n===T.Dropdown||n===T.DropdownMenu||n===T.EmojiPicker||n===T.StickerPicker||n===T.ColorPicker||n===T.ReactionDetailsPane||n===T.ReactionSendTray||n===T.ReactionPicker||n===T.DropdownText,[f.default.right]:n===T.DropdownMenu,[f.default.attachMenu]:n===T.AttachMenu,[f.default.picker]:n===T.Picker,[f.default.emoji]:n===T.EmojiPicker,[f.default.sticker]:n===T.StickerPicker,[f.default.colorPicker]:n===T.ColorPicker,[f.default.reactionDetails]:n===T.ReactionDetailsPane,[f.default.reactionSendTray]:n===T.ReactionSendTray,[f.default.reactionPicker]:n===T.ReactionPicker,[f.default.text]:n===T.DropdownText,[f.default.tooltip]:n===T.Tooltip,[f.default.tooltipHighlight]:x===v.Highlight,[f.default.inverse]:(n===T.Picker||n===T.EmojiPicker||n===T.StickerPicker||n===T.ColorPicker||n===T.ReactionDetailsPane||n===T.ReactionSendTray||n===T.ReactionPicker||n===T.DropdownText||n===T.Tooltip)&&r===A.LEFT,[f.default.inverseVertical]:(n===T.EmojiPicker||n===T.StickerPicker||n===T.ColorPicker||n===T.ReactionDetailsPane||n===T.ReactionSendTray||n===T.ReactionPicker||n===T.DropdownText)&&S===C.TOP})),se=n===T.Picker||n===T.EmojiPicker||n===T.StickerPicker||n===T.DropdownText||n===T.Tooltip?(0,E.jsx)("div",{"data-testid":"tooltip-nib",ref:H,className:f.default.nib,"data-animate-dropdown-nib":!0,style:O(r,K.current,H.current)}):null;if(z){const e={enter:ie,tab:M,"shift+tab":M,up:()=>{},down:()=>{}};let t,r;return(0,_.multiSkinToneEmojiPickerEnabled)()&&n===T.Picker?p.default.isRTL()?(t=ne,r=te):(t=te,r=ne):(t=Z,r=ee),w?(e[p.default.LR("left","right")]=Z,e[p.default.LR("right","left")]=ee,e[p.default.LR("up","down")]=t,e[p.default.LR("down","up")]=r):(n===T.AttachMenu?(e.up=ee,e.down=Z):(e.up=Z,e.down=ee),e[p.default.LR("left","right")]=re,e[p.default.LR("right","left")]=ie),(0,E.jsxs)(d.HotKeys,{ref:V,handlers:e,role:"application",className:oe,style:q,onMouseMove:B?J:null,onMouseUp:ae,children:[(0,E.jsx)("ul",{"data-testid":G,ref:W,className:f.default.items,children:I}),se]})}return(0,E.jsxs)("div",{ref:V,className:oe,style:q,"data-testid":G,children:[I,se]})}));function M(e){e.stopPropagation(),e.preventDefault()}t.Dropdown=I,I.displayName="Dropdown"},675085:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DropdownItem=function(e){const{children:t,tooltip:n,type:r="text",disabled:_=!1,theme:S,action:T,testid:v,tabIndex:A,addSpacing:C=!1,ariaLabel:P,selected:O=!1,pillText:I,showTooltipOnOverflow:M=!1}=e,[b,R]=(0,f.useState)(!1),[N,w]=(0,f.useState)(!1),L=(0,f.useRef)(),D=(0,g.default)(),k=e=>{if(!T)return;!1===T(e)||D&&D.requestDismiss()},U=e=>{e.repeat||k(e)};let G=(b||N)&&null!=n?(0,m.jsx)("div",{children:n}):null;M&&!(()=>{if(null==L.current)return!1;const e=L.current.style.overflow;e&&"visible"!==e||(L.current.style.overflow="hidden");const t=L.current.clientWidth<L.current.scrollWidth||L.current.clientHeight<L.current.scrollHeight;return L.current.style.overflow=e,t})()&&(G=null);const x=(0,l.isStringOrFbt)(t)||C?(0,m.jsxs)("div",{ref:L,className:(0,p.default)(d.default.ellipsify,d.default.action,(0,o.cx)({[d.default.compact]:S===y.COMPACT}),(0,h.default)(e.xstyle)),role:"button","aria-label":null!=P?P:t,children:[t,O&&(0,m.jsx)(a.CheckmarkIcon,{className:d.default.checkmark,color:c.SvgColorProp.TEAL}),null!=I?(0,m.jsx)(u.LabelPill,{children:I}):null]}):t,B=(0,p.default)(d.default.item,d.default.shortcut,(0,o.cx)({[d.default.hover]:b||N,[d.default.text]:"text"===r,[d.default.emoji]:"emoji"===r||"emoji-grid"===r||"emoji-preview"===r,[d.default.emojiGrid]:"emoji-grid"===r,[d.default.emojiPreview]:"emoji-preview"===r,[d.default.icon]:"icon"===r,[d.default.disabled]:_||S===y.MUTED})),F=_?{}:{handlers:{enter:U,space:U},onContextMenu:E,onMouseDown:E,onClick:e=>{k(e)},onMouseEnter:()=>{R(!0)},onMouseLeave:()=>{R(!1)},onFocus:()=>{w(!0)},onBlur:()=>{w(!1)}};return(0,m.jsxs)(s.HotKeys,(0,i.default)((0,i.default)({component:"li",className:B,"data-animate-dropdown-item":!0,"data-testid":v,tabIndex:null!=A?A:0},F),{},{children:[x,G]}))},t.ThemeOptions=void 0;var i=r(n(81109)),a=n(969579),o=n(113704),s=n(81644),l=n(317259),u=n(247390),c=n(615647),d=r(n(750687)),p=r(n(120992)),_=r(n(599001)),f=n(667294),h=r(n(156720)),g=r(n(155793)),m=n(785893);const y=(0,_.default)({COMPACT:null,MUTED:null});function E(e){e.preventDefault()}t.ThemeOptions=y},488922:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(88237),a=n(924583),o=r(n(846870)),s=n(306703),l=r(n(322337)),u=r(n(632515)),c=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=g(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),d=r(n(79291)),p=n(667294),_=r(n(676185)),f=r(n(189957)),h=n(785893);function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(g=function(e){return e?n:t})(e)}const m=new u.default;function y(e,t){const{alt:n,className:r,crossOrigin:u=!0,draggable:g,onClick:y,onMouseMove:E,plainText:S,selectable:T,style:v,renderLoading:A,renderError:C,disableContextMenu:P=!1,noXHR:O=!1,hasPrivacyChecks:I=!0,onError:M,onLoad:b}=e,R=(0,p.useRef)(null),N=(0,_.default)(t,R),w=(0,p.useRef)(null),[L,D]=(0,p.useState)(e.src),[k,U]=(0,p.useState)(!0),[G,x]=(0,p.useState)(null),[B,F]=(0,p.useState)(!0),j=(0,f.default)();if(e.src!==L&&(D(e.src),U(!0)),(0,p.useEffect)((()=>{if(!L)return;const e=R.current;return e&&!e.complete&&(e.style.visibility="hidden"),()=>{const e=w.current;if(e){e.release()&&m.remove(e)}}}),[L]),G&&C)return C(G);const Y=Boolean(k&&L);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s.SelectableImg,{ref:N,plainText:S||"",selectable:Boolean(T),crossOrigin:u?"anonymous":void 0,onError:Y?t=>{if(U(!1),!L||!function(e){return"/"===e[0]||d.default.isHttp(e)}(L))return void x(t.error);const n=w.current;let r;if(n)if(s=e,(o=n).src===s.src&&o.crossOrigin===s.crossOrigin&&o.noXHR===s.noXHR&&o.hasPrivacyChecks===s.hasPrivacyChecks){if(!n.noXHR)return;r=n}else{n.release()&&m.remove(n),r=new l.default(L,u,O,I)}else r=new l.default(L,u,O,I);var o,s;w.current=r;m.enqueue(r).then((()=>{r==r&&(j.aborted||U(!0))})).catch((0,a.filteredCatch)([c.ServerStatusError,c.GaveUpRetry],(e=>{r==r&&(j.aborted||(U(!1),x(e),M&&M(e)))}))).catch((0,a.filteredCatch)(c.Unmount,(()=>{}))).catch((0,i.catchAbort)((()=>{})))}:()=>{},onLoad:Y?e=>{if(e.target instanceof HTMLImageElement){const t=R.current;(null==t?void 0:t.complete)&&(t.style.visibility="visible"),b&&b(e),F(!1)}}:()=>{},src:Y&&null!=L?L:o.default.ONE_BY_ONE_TRANS_GIF,alt:n,className:r,draggable:g,onClick:y,onMouseMove:E,style:v,onContextMenu:e=>{P&&e.preventDefault()}}),B&&(null==A?void 0:A())]})}var E=(0,p.forwardRef)(y);t.default=E},322337:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(88237),o=n(975175),s=(n(827653),function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057))),l=i(n(571834)),u=i(n(794938));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}t.default=class{constructor(e,t,n,r){this.src=e,this.crossOrigin=t,this.noXHR=n,this.hasPrivacyChecks=r,this.generation=0,this.refCount=0,this.inProgress=!1}key(){return`co:${this.crossOrigin?"Y":"N"},noXHR:${this.noXHR?"Y":"N"},src:${this.src}`}sendXHR(){if(this.noXHR)return Promise.resolve(!0);const e=this.src;this.inProgress=!0;const t=new r,n=(0,o.promiseTimeout)(u.default.get(e,void 0,void 0,t.signal),3e4,"ImgRetryTimeout");return this._xhrRequest={promise:n,controller:t},this._xhrRequest.promise.then((t=>{const{status:n}=t;if(n>=200&&n<400)return!0;if(n>=500){__LOG__(2)`Img:Retry ${e} failed with error code ${n}. Retrying.`;return new l.default.WebcImgError({webcImgErrorCode:n}).commit(),!1}__LOG__(2)`Img:Retry ${e} failed with error code ${n}. Not retrying.`;throw new l.default.WebcImgError({webcImgErrorCode:n}).commit(),new s.ServerStatusError(null,e,n)})).catch((e=>{if(e instanceof s.ServerStatusError)throw e;if(e.name===a.ABORT_ERROR)throw e;return!1})).finally((()=>{this.inProgress=!1}))}release(){return this.refCount--,this.refCount<=0&&(this._xhrRequest&&this._xhrRequest.controller.abort(),!0)}shouldRetain(){return this.refCount>0}}},632515:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(88237),o=n(989211),s=i(n(132375)),l=i(n(589970)),u=n(827653),c=n(806279),d=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=_(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),p=i(n(99398));function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(_=function(e){return e?n:t})(e)}class f{constructor(){this._queue=new Map,this._inDelay=new Map,this._numInProgress=0}static maxInProgressRetry(){return 20}enqueue(e){const t=this._queue.get(e.key());if(t){if(e.hasPrivacyChecks!==t.hasPrivacyChecks){const t=`Img:hasPrivacyChecks shouldn't change ${e.key()}`;return Promise.reject(t)}return t.refCount++,t.deferred.promise}return e.deferred=new u.Resolvable,e.refCount++,this._addToQueue(e),e.deferred.promise}remove(e){const t=e.key();this._queue.delete(t);const n=this._inDelay.get(t);n&&(n.controller.abort(),this._inDelay.delete(t))}_addToQueue(e){const t=e.generation;if(e.generation++,t>10){const t=`Stop retrying ${e.src} after 10 times`;throw new d.GaveUpRetry(t)}const n=e.key();if(0===t)this._queue.set(n,e),this._startProcessing();else{const i=new r,s=i.signal,u=(0,l.default)((0,o.expDelaySec)(t,60,0),s).catch((0,a.catchAbort)((()=>{})));this._inDelay.set(e.key(),{promise:u,controller:i}),u.then((()=>{this._inDelay.delete(n),s.aborted||this._queue.set(n,e),this._startProcessing()}))}}_startProcessing(){this._waitPromise||(this._waitPromise=p.default.waitIfOffline({signal:(new r).signal}).then((()=>{this._waitPromise=null,c.UIBusyTasks.enqueue((()=>{this._processRetries()}))})))}_processRetries(){const e=this._queue.values();let t;for(;(t=e.next())&&!t.done&&!(this._numInProgress>f.maxInProgressRetry());){const e=t.value;this._processRetry((0,s.default)(e,"retry"))}}_processRetry(e){e.inProgress||(e.deferred.resolveWasCalled()?this._queue.delete(e.key()):(this._numInProgress++,e.sendXHR().then((t=>{this._queue.delete(e.key()),t?e.deferred.resolve():e.shouldRetain()&&this._addToQueue(e)})).catch((t=>{this._queue.delete(e.key()),e.deferred.reject(t)})).finally((()=>{this._numInProgress--}))))}}t.default=f},591748:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=(0,n(667294).createContext)({isKeyboardUser:!1,setIsKeyboardUser:()=>{}});t.default=r},81644:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.SpecialKeyMap=t.HotKeys=void 0;var i=r(n(81109)),a=r(n(506479)),o=r(n(252628)),s=n(238669),l=n(667294),u=r(n(156720)),c=r(n(676185)),d=r(n(864135)),p=n(785893);const _=["component","handlers","children","xstyle","onFocus","onBlur"],f={alt:"Alt",ctrl:"Control",meta:"Meta",shift:"Shift"},h=(0,o.default)(f),g={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,capslock:20,esc:27,space:32,pageup:33,pagedown:34,end:35,home:36,left:37,up:38,right:39,down:40,ins:45,del:46,meta:224};t.SpecialKeyMap=g;const m={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},y={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+"},E=(0,l.forwardRef)(((e,t)=>{const{component:n="div",handlers:r,children:o,xstyle:f,onFocus:h=(()=>{}),onBlur:g=(()=>{})}=e,y=(0,a.default)(e,_),E=(0,l.useRef)(!1),v=(0,l.useRef)(null),A=(0,c.default)(t,v);(0,d.default)((()=>{if(E.current){const e=document.activeElement;v.current===e&&s.UIM.Manager.refocusTopUie()}}));const C=r&&Object.keys(r).some((e=>null!=r[e]));return(0,p.jsx)(n,(0,i.default)((0,i.default)({ref:A,tabIndex:"-1",onKeyPress:C?e=>{r&&Object.keys(r).forEach((t=>{const n=r[t];if(null==n)return;const i=T(t),[a]=i;m[a]||S(i,e)&&n(e)}))}:null,onKeyDown:C?e=>{r&&Object.keys(r).forEach((t=>{const n=r[t];if(null==n)return;const i=T(t),[a]=i;m[a]&&S(i,e)&&n(e)}))}:null,className:(0,u.default)(f)},y),{},{onFocus:e=>{E.current=!0,h(e)},onBlur:e=>{E.current=!1,g(e)},children:o}))}));function S(e,t){let[n,r]=e;return n===t.which&&h.every((e=>r&&e===r?t.getModifierState(r):!t.getModifierState(e)))}function T(e){let[t,n]=e.toLowerCase().split("+");y[t]&&(t=y[t]),y[n]&&(n=y[n]);let r,i=t;return n?(i=n,r=f[t],void 0===r?__LOG__(3)`Invalid HotKey Modifier: ${t}`:void 0===i&&__LOG__(3)`Invalid HotKey Key: ${n}`):void 0===i&&__LOG__(3)`Invalid HotKey Key: ${t}`,[g[i]||i.charCodeAt(0),r]}t.HotKeys=E,E.displayName="HotKeys"},83162:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let t=0;const n=e.charCode,r=e.keyCode;null!=n&&0!==n?t=n:null!=r&&0!==r&&(t=r);return i.has(t)};var r=n(81644);const i=new Set([r.SpecialKeyMap.enter,r.SpecialKeyMap.space])},817646:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.RotateFocus=void 0;var i=r(n(988410)),a=r(n(335540)),o=n(368156),s=n(299950),l=r(n(395967)),u=n(667294),c=r(n(156720)),d=r(n(676185)),p=n(785893);const _={position:"lhggkp7q",top:"qq0sjtgm",end:"ebjesfe0",bottom:"jxacihee",start:"tkdu00h0"};function f(e,t){const{focusType:n}=e,r=(0,u.useRef)(null),f=(0,d.default)(t,r),{setIsKeyboardUser:h}=(0,l.default)();return(0,p.jsx)("div",{ref:f,style:e.style,className:(0,c.default)(_),onKeyDown:e=>{if(e.metaKey||e.ctrlKey)return;const t=r.current;let l;var u;(e.key===o.KEYBOARD_EVENT_KEY_VALUE.TAB?(e.stopPropagation(),e.preventDefault(),h(!0),i.default.shouldIndicateFocus(),null!=t&&(l=(0,s.getNextTabbableElement)(t,e.shiftKey?s.TabDirection.BACKWARD:s.TabDirection.FORWARD,n))):null!=t&&t===document.activeElement&&(l=(0,s.getNextTabbableElement)(t,s.TabDirection.FORWARD,n,(e=>"input"===e.nodeName.toLowerCase()))),null!=l)&&(i.default.shouldIndicateFocus(),(u=l).restoreFocus?u.restoreFocus():a.default.focus(u))},tabIndex:"-1",children:e.children})}const h=(0,u.forwardRef)(f);t.RotateFocus=h},241115:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(368156),a=n(299950),o=n(667294),s=r(n(156720)),l=r(n(676185)),u=n(785893);const c={position:"lhggkp7q",top:"qq0sjtgm",end:"ebjesfe0",bottom:"jxacihee",start:"tkdu00h0"};function d(e,t){const n=(0,o.useRef)(null),r=(0,l.default)(t,n);return(0,u.jsx)("div",{ref:r,className:(0,s.default)(c),onKeyDown:e=>{if(!e.metaKey&&!e.ctrlKey)return e.key===i.KEYBOARD_EVENT_KEY_VALUE.TAB?(e=>{const t=n.current;if(!t)return;const r=e.shiftKey?a.TabDirection.BACKWARD:a.TabDirection.FORWARD,i=(0,a.getNextTabbableElement)(t,r,a.FocusType.TABBABLE);null!=i&&(e.preventDefault(),i.focus())})(e):void 0},tabIndex:"-1",onBlur:e.onBlur,role:"dialog",children:e.children})}var p=(0,o.forwardRef)(d);t.default=p},299950:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.TabDirection=t.FocusType=void 0,t.getNextTabbableElement=function(e){let t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l.FORWARD,d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s.CUSTOM,p=arguments.length>3&&void 0!==arguments[3]?arguments[3]:()=>!0;d===s.TABBABLE?(t=(0,o.tabbable)(e),n=()=>!0):(t=(0,i.default)(Array.from(e.querySelectorAll("[data-tab]")),(e=>parseInt(e.getAttribute("data-tab"),10)||0)),n=c);const _=r===l.FORWARD?1:-1;let f=0;const{activeElement:h}=document;if(h){let e=t.findIndex((e=>e.contains(h)));if((0,a.messageListA11yRedesignEnabled)()){const n=t.findIndex((e=>e===h));n>0&&(e=n)}f=-1===e?0:u(e+_,t.length)}for(let e=0;e<t.length;e++){const r=u(f+e*_,t.length),i=t[r];if(n(i)&&p(i))return i}return null};var i=r(n(189734)),a=n(97858),o=n(388388);const s=n(76672).Mirrored(["CUSTOM","TABBABLE"]);t.FocusType=s;const l=n(76672).Mirrored(["FORWARD","BACKWARD"]);function u(e,t){return(e+t)%t}function c(e){if(e.disabled)return!1;const t=parseInt(e.dataset.tab,10);return!("number"!=typeof t||t<0)&&!function(e){if("hidden"===getComputedStyle(e).visibility)return!0;let t=e;for(;t;){if("none"===getComputedStyle(t).display)return!0;t=t.parentElement}return!1}(e)}t.TabDirection=l},395967:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return(0,a.useContext)(i.default)};var i=r(n(591748)),a=n(667294)},309435:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.setIcon=p,t.setTitleAndIcon=function(e){let t=l.default.t(869);e>0&&(t="("+l.default.n(e)+") "+l.default.t(869));clearTimeout(c),document.title=document.title+" ",c=setTimeout((()=>{document.title=t}),0),p(e)};var i=n(88237),a=r(n(424646)),o=n(135630),s=n(789379),l=r(n(932325)),u=n(368170);let c;const d=new a.default;function p(e){if(u.UA.isSafari)return;let t,r;-1===e?(t="favicon-error2",r={low:n(819528),high:n(477238)}):0===e?(t="favicon",r={low:n(429242),high:n(56216)}):e<10?(t="f0"+e,r={low:n(363509)(`./${t}.png`),high:n(276554)(`./${t}.png`)}):e<100?(t="f"+e,r={low:n(363509)(`./${t}.png`),high:n(276554)(`./${t}.png`)}):(t="f00",r={low:n(192256),high:n(211372)});const a={id:t,low:{default:r.low},high:{default:r.high}};d.enqueue(s.AssetLoader.loadAsset(a,o.LOAD_PRIORITY.NOTIFICATION_ICON,!1)).then((e=>e)).then((e=>{const n=document.getElementById("favicon");var r;(null==(r=n)?void 0:r.parentNode)&&r.parentNode.removeChild(r);const i=document.createElement("link");i.setAttribute("id","favicon"),i.setAttribute("rel","shortcut icon"),i.setAttribute("type","image/png"),i.setAttribute("href",e),i.setAttribute("src",e);const a=document.getElementsByTagName("head");(null==a?void 0:a[0])&&a[0].appendChild(i),__LOG__(2)`Favicon updated: ${t}`})).catch((0,i.catchAbort)((()=>{})))}},171612:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDoNotDisturb=function(){try{return!1}catch(e){__LOG__(3)`getDoNotDisturb failed with error ${e}`}return!1};n(76672).Mirrored(["UNKNOWN","SESSION_SCREEN_IS_LOCKED","SESSION_ON_CONSOLE_KEY","QUNS_NOT_PRESENT","QUNS_BUSY","QUNS_RUNNING_D3D_FULL_SCREEN","QUNS_PRESENTATION_MODE","QUNS_ACCEPTS_NOTIFICATIONS","QUNS_QUIET_TIME","QUNS_APP","UNKNOWN_ERROR"]),n(76672).Mirrored(["NOT_SUPPORTED","FAILED","OFF","PRIORITY_ONLY","ALARMS_ONLY"])},227926:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertTabToMood=t.ValidMoods=t.StickerTabs=t.SCROLL_THROTTLE_TIME=t.SCROLL_CLICK_TIME_GAP=t.MINIMUM_LOADING_TIME=t.INPUT_SHOW_POINT=t.INPUT_HIDE_POINT=t.INPUT_BAR_TOTAL_HEIGHT=t.INPUT_BAR_SCROLL_SENSITIVITY=t.INPUT_BAR_SCROLL_FAST=void 0;t.SCROLL_CLICK_TIME_GAP=1e3;t.SCROLL_THROTTLE_TIME=100;t.INPUT_BAR_TOTAL_HEIGHT=63;t.INPUT_BAR_SCROLL_SENSITIVITY=5;t.INPUT_BAR_SCROLL_FAST=15;t.INPUT_HIDE_POINT=44.099999999999994;t.INPUT_SHOW_POINT=94.5;const r=n(76672).Mirrored(["LOVE","GREETINGS","HAPPY","SAD","ANGRY","CELEBRATE"]);t.ValidMoods=r;const i=n(76672).Mirrored(["RECENTS","FAVORITES","LOVE","GREETINGS","HAPPY","SAD","ANGRY","CELEBRATE","STORE"]);t.StickerTabs=i;t.convertTabToMood=e=>{const t=e;return r.isValid(t)?r.cast(t):null};t.MINIMUM_LOADING_TIME=1500},243382:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(609390),i=n(54918),a=n(976484),o=n(841273);n(495296);t.default=class{constructor(e,t,n,i){let o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this.componentName=e,this.name=t,this._isStrong=i,this.keys=n;const s=a.ProxyStates[t];s||(__LOG__(4,void 0,new Error,!0)`Unknown StateHOC concern type "${t}"`,SEND_LOGS("state-hoc-error")),this._proxyClass=s,this._limitedAccessProxyClass=function(e,t,n,i){const a={$ProxyState$ComponentName:{value:e},proxyBitMask:{value:(0,r.genBitMask)(t.prototype.mirrorMask,n)}};for(const t of n){const n={enumerable:!0};n.get=function(){return this.$ProxyState$state.get(t)},n.set=function(){__LOG__(4,void 0,new Error)`READ ONLY: Cannot write to proxied property "${t}", created in <${e} />, it is not writable.`},i||(n.set=function(e){this.$ProxyState$state.set(t,e)}),a[t]=n}function o(e){t.call(this,e)}return o.prototype=Object.create(t.prototype,a),o.prototype.constructor=o,o}(e,s,n,o)}getModel(e){return e instanceof this._proxyClass?e.$ProxyState$state:e}getModelAndValidate(e){const t=e instanceof this._proxyClass?e.$ProxyState$state:e;return t?t instanceof i.BaseModel?t:(__LOG__(4,void 0,new Error,!0)`${this.componentName} given invalid object for ${this.name}: ${n=t,"string"==typeof n?n:n.toString?n.toString():"Invalid Object"}`,SEND_LOGS("state-hoc-error"),null):(o.Stream.mode===o.StreamMode.MAIN&&(__LOG__(4,void 0,new Error,!0)`${this.componentName} was not supplied the ${this.name} model with keys ${String(this.keys)}.`,SEND_LOGS("state-hoc-error")),null);var n}createProxy(e){return new this._limitedAccessProxyClass(e)}attachConcern(e,t,n){e.incObservers(!this._isStrong),e.mirror.addListener(n,t,this)}detachConcern(e,t){e.decObservers(),e.mirror.removeListener(t)}}},433224:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.AlertBatteryIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=48,h=48;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"alert-battery"},p),{},{children:(0,l.jsx)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 48 48",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 48 48",xmlSpace:"preserve",children:(0,l.jsx)("path",{fill:"currentColor",d:"M24.154,2C11.919,2,2,11.924,2,24.165S11.919,46.33,24.154,46.33s22.154-9.924,22.154-22.165 S36.389,2,24.154,2z M29.868,33.457H18.201V15.46h2.851v-1.99h5.866v1.99h2.949v17.997H29.868z M23.04,29.187h1.982v-1.982H23.04 V29.187z M23.04,25.224h1.982V19.28H23.04V25.224z"})})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},384824:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.AlertComputerIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=48,h=48;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"alert-computer"},p),{},{children:(0,l.jsx)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 48 48",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 48 48",xmlSpace:"preserve",children:(0,l.jsx)("path",{fill:"currentColor",d:"M24.154,2C11.919,2,2,11.924,2,24.165S11.919,46.33,24.154,46.33 s22.154-9.924,22.154-22.165S36.389,2,24.154,2z M23.985,34.138L12.976,19.459c3.028-2.294,6.881-3.67,11.009-3.67 c4.129,0,7.982,1.376,11.009,3.67L23.985,34.138z M23.04,28.488h1.981v-1.981H23.04V28.488z M23.04,24.526h1.981v-5.017H23.04 V24.526z"})})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},559261:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.AlertIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=10,h=11;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"alert"},p),{},{children:(0,l.jsx)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 11 10",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),version:"1.1",children:(0,l.jsx)("path",{fill:"currentColor",d:"M1.3,10h8.3c0.8,0,1.3-0.6,1.3-1.3c0-0.2-0.1-0.4-0.2-0.6L6.7,0.7C6.4,0.2,6,0,5.5,0C5,0,4.6,0.2,4.3,0.7L0.2,8 C0.1,8.2,0,8.4,0,8.6C0,9.4,0.5,10,1.3,10z M5.5,6.4C5.2,6.4,5,6.2,5,5.9L4.9,3.5C4.9,3.2,5.2,3,5.5,3c0.3,0,0.6,0.2,0.6,0.6L6,5.9 C6,6.2,5.8,6.4,5.5,6.4z M5.5,8.3c-0.4,0-0.6-0.2-0.6-0.6c0-0.3,0.3-0.6,0.6-0.6c0.4,0,0.6,0.2,0.6,0.6S5.9,8.3,5.5,8.3z"})})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},695273:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.AlertNoticeIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=27,h=23;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"alert-notice"},p),{},{children:(0,l.jsxs)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 23 27",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),version:"1.1",children:[(0,l.jsx)("title",{children:"Icon"}),(0,l.jsx)("desc",{children:"Created with Sketch."}),(0,l.jsx)("g",{id:"Icon",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",children:(0,l.jsx)("path",{d:"M15.640126,1 C16.2819117,1 16.9007426,1.2387741 17.3761961,1.66985758 L21.1514547,5.0852422 C21.6918098,5.57517064 22,6.27060743 22,7 L22,23.5 C22,24.9413889 20.8792026,26 19.5,26 L3.5,26 C2.12037664,26 1,24.9413889 1,23.5 L1,3.62070707 C1,2.17931818 2.12843851,1 3.50806187,1 L15.640126,1 Z M16.4803419,20.2547009 L6.1965812,20.2547009 C5.86426627,20.2547009 5.59487179,20.5240953 5.59487179,20.8564103 C5.59487179,21.1729007 5.83922053,21.4323204 6.14955796,21.4563093 L6.1965812,21.4581197 L16.4803419,21.4581197 C16.8126568,21.4581197 17.0820513,21.1887252 17.0820513,20.8564103 C17.0820513,20.5240953 16.8126568,20.2547009 16.4803419,20.2547009 Z M16.4803419,16.6444444 L6.1965812,16.6444444 C5.86426627,16.6444444 5.59487179,16.9138389 5.59487179,17.2461538 C5.59487179,17.5626443 5.83922053,17.822064 6.14955796,17.8460529 L6.1965812,17.8478632 L16.4803419,17.8478632 C16.8126568,17.8478632 17.0820513,17.5784688 17.0820513,17.2461538 C17.0820513,16.9138389 16.8126568,16.6444444 16.4803419,16.6444444 Z M16.4803419,13.034188 L12.5145299,13.034188 C12.182215,13.034188 11.9128205,13.3035825 11.9128205,13.6358974 C11.9128205,13.9523878 12.1571692,14.2118075 12.4675067,14.2357965 L12.5145299,14.2376068 L16.4803419,14.2376068 C16.8126568,14.2376068 17.0820513,13.9682124 17.0820513,13.6358974 C17.0820513,13.319407 16.8377026,13.0599873 16.5273651,13.0359984 L16.4803419,13.034188 Z M7.90140596,8.22051282 C9.05437989,8.22051282 9.61845092,9.13246919 9.57784553,10.7993151 L9.63396397,10.7996117 C9.94091258,10.7996117 10.1897436,11.0484427 10.1897436,11.3553913 L10.1897436,14.2835366 C10.1897436,14.5904852 9.94091258,14.8393162 9.63396397,14.8393162 L6.15065142,14.8393162 C5.84370281,14.8393162 5.59487179,14.5904852 5.59487179,14.2835366 L5.59487179,11.3553913 C5.59487179,11.0484427 5.84370281,10.7996117 6.15065142,10.7996117 L6.2055298,10.7994219 C6.17841546,9.13157671 6.74911991,8.22051282 7.90140596,8.22051282 Z M7.90140596,8.83404295 C7.09074488,8.83404295 6.70795386,9.43809785 6.73692553,10.7992567 L9.0463233,10.7991512 C9.08764605,9.43694268 8.71124276,8.83404295 7.90140596,8.83404295 Z M16.4803419,9.42393162 C16.8126568,9.42393162 17.0820513,9.6933261 17.0820513,10.025641 C17.0820513,10.357956 16.8126568,10.6273504 16.4803419,10.6273504 L12.5145299,10.6273504 C12.182215,10.6273504 11.9128205,10.357956 11.9128205,10.025641 C11.9128205,9.6933261 12.182215,9.42393162 12.5145299,9.42393162 L16.4803419,9.42393162 Z",id:"Shape",fill:"currentColor"})})]})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},972894:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.AlertNotificationIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=48,h=48;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"alert-notification"},p),{},{children:(0,l.jsx)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 48 48",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 48 48",xmlSpace:"preserve",children:(0,l.jsx)("path",{fill:"currentColor",d:"M24.154,2C11.919,2,2,11.924,2,24.165S11.919,46.33,24.154,46.33 s22.154-9.924,22.154-22.165S36.389,2,24.154,2z M23.41,17.428V16.81c0-0.706,0.618-1.324,1.324-1.324s1.323,0.618,1.323,1.324 v0.618c2.559,0.618,4.412,2.823,4.412,5.559v3.176l-8.294-8.294C22.527,17.692,22.969,17.516,23.41,17.428z M24.733,33.134 c-0.971,0-1.765-0.794-1.765-1.765h3.529C26.498,32.34,25.704,33.134,24.733,33.134z M31.969,32.251l-1.765-1.765H17.233v-0.882 l1.765-1.765v-4.853c0-1.059,0.265-2.029,0.794-2.912l-2.559-2.559l1.147-1.147l14.735,14.736L31.969,32.251z"})})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},376242:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.AlertPhoneIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=48,h=48;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"alert-phone"},p),{},{children:(0,l.jsxs)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 48 48",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 48 48",xmlSpace:"preserve",children:[(0,l.jsx)("path",{fill:"currentColor",d:"M24.154,2C11.919,2,2,11.924,2,24.165S11.919,46.33,24.154,46.33 s22.154-9.924,22.154-22.165S36.389,2,24.154,2z"}),(0,l.jsx)("path",{className:"icon-shape",fill:"#FFBC00",d:"M19.352,30.776c0.809-0.008,1.626,0,2.443,0c0.008-2.05,0.008-4.109,0-6.159h-2.451 C19.336,26.667,19.328,28.725,19.352,30.776z M15.876,22.102l1.928-1.928l1.929,1.928l0.964-0.964l-1.929-1.929l1.929-1.928 l-0.964-0.964l-1.929,1.928l-1.928-1.928l-0.965,0.964l1.929,1.928l-1.929,1.929L15.876,22.102z M15.635,27.1 c0.008,1.225,0.008,2.443,0,3.668c0.825,0.016,1.642,0,2.467,0.008c0.008-1.233,0-2.459,0-3.692 C17.277,27.084,16.452,27.052,15.635,27.1z M30.42,17.232c0,4.517-0.008,9.026,0,13.544c0.825-0.008,1.642,0.008,2.467-0.008 c-0.008-4.509-0.008-9.01,0-13.52C32.07,17.2,31.245,17.24,30.42,17.232z M26.72,20.131c0.008,3.548-0.008,7.096,0.008,10.644 c0.817,0,1.634-0.008,2.443,0c0.032-3.684,0-7.377,0.016-11.061c-0.809-0.056-1.626,0-2.435-0.032 C26.728,19.827,26.72,19.979,26.72,20.131z M23.052,22.15c-0.024,0.152-0.024,0.312-0.024,0.464 c0.008,2.723-0.008,5.438,0.008,8.161h2.451c0.016-0.961,0-1.914,0.008-2.875c-0.016-1.914,0.024-3.836-0.016-5.751 C24.67,22.158,23.861,22.158,23.052,22.15z"})]})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},852246:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.AlertUpdateIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=48,h=48;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"alert-update"},p),{},{children:(0,l.jsx)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 48 48",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 48 48",xmlSpace:"preserve",children:(0,l.jsx)("path",{fill:"currentColor",d:"M24.154,2C11.919,2,2,11.924,2,24.165S11.919,46.33,24.154,46.33 s22.154-9.924,22.154-22.165S36.389,2,24.154,2z M31.701,23.037h-6.738l3.08-3.08c-1.059-1.059-2.406-1.733-4.043-1.733 c-3.176,0-5.775,2.599-5.775,5.775c0,3.177,2.599,5.776,5.775,5.776c2.503,0,4.62-1.637,5.391-3.85h2.021 c-0.866,3.273-3.85,5.776-7.412,5.776c-4.235,0-7.701-3.465-7.701-7.701c0-4.235,3.465-7.701,7.701-7.701 c2.118,0,4.043,0.866,5.391,2.31l2.31-2.31C31.701,16.299,31.701,23.037,31.701,23.037z"})})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},350240:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.AlertUpdatePrimaryIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=49,h=49;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"alert-update-primary"},p),{},{children:(0,l.jsxs)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 49 49",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),fill:"none",children:[(0,l.jsx)("circle",{cx:24.5,cy:24.5,r:24.5,fill:"#02A698"}),(0,l.jsx)("path",{d:"M16 13.5455V36.4545C16 37.8545 17.0929 39 18.4286 39H30.5714C31.9071 39 33 37.8545 33 36.4545V13.5455C33 12.1455 31.9071 11 30.5714 11H18.4286C17.0929 11 16 12.1455 16 13.5455ZM30.5714 32.6364H18.4286V17.3636H30.5714V32.6364ZM29.3571 25H25.7143V19.9091H23.2857V25H19.6429L24.5 30.0909L29.3571 25Z",fill:"white"})]})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},474518:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.AnnouncementSpeakerIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=212,h=212;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"announcement-speaker"},p),{},{children:(0,l.jsx)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 212 212",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),fill:"currentColor",children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M89.5827 83.703C89.5827 82.9635 89.9699 82.278 90.6032 81.8962L119.16 64.6781C122.059 62.8863 125.902 64.8549 125.902 68.1319V137.101C125.902 140.308 122.206 142.288 119.301 140.639L90.6507 124.368C89.9905 123.993 89.5827 123.293 89.5827 122.534V83.703ZM46 96.2616C46 88.6676 52.5042 82.5114 60.5276 82.5114H80.209C81.3743 82.5114 82.3189 83.4561 82.3189 84.6213V121.652C82.3189 122.817 81.3743 123.762 80.209 123.762H75.6957L82.4837 147.779C83.0001 149.606 81.9267 151.465 80.0861 151.931L72.2787 153.908C70.4381 154.374 68.5274 153.271 68.0111 151.443L60.2202 123.878C60.2089 123.838 60.1983 123.798 60.1886 123.758C52.3218 123.588 46 117.498 46 110.012V96.2616ZM161.187 71.6946C160.374 70.6624 158.814 70.5245 157.751 71.3468L154.102 74.1721C153.034 74.9983 152.876 76.4799 153.682 77.5251C159.328 84.8487 162.362 93.7105 162.303 102.817C162.244 111.919 159.096 120.741 153.361 127.996C152.536 129.039 152.66 130.516 153.704 131.345L157.352 134.241C158.396 135.07 159.964 134.936 160.799 133.901C167.981 125.002 171.926 114.114 171.999 102.874C172.072 91.624 168.263 80.6813 161.187 71.6946ZM145.914 81.0162C145.113 79.9754 143.55 79.8499 142.494 80.6798L138.867 83.5311C137.806 84.3649 137.664 85.8456 138.444 86.9079C141.82 91.5035 143.641 96.9856 143.626 102.62C143.612 108.251 141.767 113.72 138.373 118.298C137.582 119.364 137.702 120.84 138.746 121.669L142.394 124.564C143.438 125.393 145.009 125.261 145.823 124.211C150.664 117.973 153.303 110.423 153.323 102.642C153.342 94.8522 150.735 87.2808 145.914 81.0162Z"})})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},718620:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.BusinessDescriptionIcon=function(e){const{iconXstyle:t,height:n,width:r,viewBox:c}=e,d=(0,a.default)(e,u);let p;if(c){const{x:e=0,y:t=0,width:n=0,height:r=0}=c;p=[e,t,n,r].join(" ")}{var _;let e=24,a=24;return null==n&&null==r||(e=n,a=r),(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"business-description"},d),{},{children:(0,l.jsxs)("svg",{viewBox:null!==(_=p)&&void 0!==_?_:"0 0 24 24",height:e,width:a,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(t),version:"1.1",children:[(0,l.jsx)("title",{children:"business-description"}),(0,l.jsx)("desc",{children:"Created with Sketch."}),(0,l.jsx)("defs",{}),(0,l.jsxs)("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",children:[(0,l.jsx)("path",{d:"M3.55479575,5.11130106 L20.4434947,5.11130106 L20.4434947,3 L3.55479575,3 L3.55479575,5.11130106 Z M3.55479575,6.16780637 L2.5,11.4469138 L2.5,13.5582149 L3.55479575,13.5582149 L3.55479575,19.8904085 L14.1095915,19.8904085 L14.1095915,13.5582149 L18.3339032,13.5582149 L18.3339032,19.8904085 L20.4452042,19.8904085 L20.4452042,13.5582149 L21.5,13.5582149 L21.5,11.4469138 L20.4452042,6.16780637 L3.55479575,6.16780637 Z M5.66609681,17.780817 L11.9982904,17.780817 L11.9982904,13.5582149 L5.66609681,13.5582149 L5.66609681,17.780817 Z",id:"Page-1-Copy",fill:"currentColor"}),(0,l.jsx)("g",{id:"slices",transform:"translate(0.000000, -198.000000)"})]})]})}))}};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},719731:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ChatAssignmentIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=16,h=20;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"chat-assignment"},p),{},{children:(0,l.jsxs)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 20 16",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),fill:"none",children:[(0,l.jsx)("path",{d:"M12.7 7.9998C14.7 7.9998 16.3 6.3998 16.3 4.3998C16.3 2.3998 14.7 0.799805 12.7 0.799805C10.7 0.799805 9.1 2.3998 9.1 4.3998C9.1 6.3998 10.7 7.9998 12.7 7.9998ZM12.7 9.7998C10.3 9.7998 5.5 10.9998 5.5 13.3998V15.1998H20V13.3998C19.9 10.9998 15.1 9.7998 12.7 9.7998Z",fill:"currentColor"}),(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.09961 8.06427H0.0996094V6.25781H7.09961V8.06427Z",fill:"currentColor"}),(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.85521 7.11619L3.51172 4.7727L4.77368 3.51074L8.37912 7.11619L4.77368 10.7216L3.51172 9.45968L5.85521 7.11619Z",fill:"currentColor"})]})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},969579:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.CheckmarkIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=24,h=24;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"checkmark"},p),{},{children:(0,l.jsx)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 24 24",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 24 24",xmlSpace:"preserve",children:(0,l.jsx)("path",{fill:"currentColor",d:"M9,17.2l-4-4l-1.4,1.3L9,19.9L20.4,8.5L19,7.1L9,17.2z"})})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},881006:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ChevronRightTextIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=12,h=8;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"chevron-right-text"},p),{},{children:(0,l.jsx)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 8 12",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 8 12",xmlSpace:"preserve",children:(0,l.jsx)("path",{fill:"currentColor",d:"M2.173,1l4.584,4.725L2.142,10.34L1.039,9.237l3.512-3.512L1,2.173L2.173,1z"})})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},910648:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.CollectionsFolderIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=40,h=40;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"collections_folder"},p),{},{children:(0,l.jsxs)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 56 56",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),fill:"none",children:[(0,l.jsxs)("g",{clipPath:"url(#clip0)",children:[(0,l.jsx)("path",{d:"M4.48047 16.8052C4.48047 14.3302 6.4869 12.3237 8.96195 12.3237H44.8138C47.2889 12.3237 49.2953 14.3302 49.2953 16.8052V44.8145C49.2953 47.2895 47.2889 49.296 44.8138 49.296H8.96195C6.48689 49.296 4.48047 47.2895 4.48047 44.8145V16.8052Z",fill:"currentColor"}),(0,l.jsx)("path",{d:"M8.96094 8.96244C8.96094 6.48738 10.9674 4.48096 13.4424 4.48096H40.3313C42.8064 4.48096 44.8128 6.48738 44.8128 8.96244V8.96244H8.96094V8.96244Z",fill:"currentColor"})]}),(0,l.jsx)("defs",{children:(0,l.jsx)("clipPath",{id:"clip0",children:(0,l.jsx)("rect",{width:44.8148,height:44.8148,fill:"white",transform:"translate(4.48047 4.4812)"})})})]})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},247365:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.CommunitySquircleIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=180,h=180;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"community-squircle"},p),{},{children:(0,l.jsxs)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 180 180",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),fill:"none",children:[(0,l.jsx)("path",{className:"background",d:"M90 0C1.43051e-05 0 0 0 0 90C0 180 1.43051e-05 180 90 180C180 180 180 180 180 90C180 0 180 0 90 0Z",fill:"currentColor"}),(0,l.jsx)("path",{className:"primary",transform:"translate(30, 52)",fillRule:"evenodd",clipRule:"evenodd",d:"M86.0728 25.3655C86.1287 25.7634 86.2023 26.1501 86.2934 26.5313C86.3389 26.7247 86.3886 26.9126 86.4426 27.0949C86.5491 27.4658 86.6736 27.831 86.8156 28.1888C87.0246 28.7152 87.2706 29.2248 87.5516 29.7138C87.7381 30.0342 87.939 30.3491 88.1538 30.6475C88.7962 31.5513 89.5655 32.3502 90.4362 33.0177C91.0223 33.4638 91.6483 33.8505 92.3056 34.1725C92.8094 34.4169 93.3294 34.6237 93.8617 34.7913C94.2205 34.9018 94.5877 34.9957 94.9632 35.0731C95.7326 35.2269 96.5143 35.3046 97.2978 35.3051C103.567 35.3051 108.649 30.0362 108.649 23.5368C108.649 17.0373 103.567 11.7684 97.2978 11.7684C96.5142 11.7662 95.7322 11.8439 94.9632 12.0005C94.5915 12.0741 94.2238 12.1682 93.8617 12.2822C93.3296 12.448 92.8095 12.6529 92.3056 12.8955C90.663 13.6984 89.2368 14.9092 88.1538 16.4205C87.9406 16.7244 87.7381 17.0338 87.5516 17.3598C87.2695 17.8481 87.0235 18.3579 86.8156 18.8847C86.6755 19.2383 86.5492 19.6029 86.4426 19.9731C86.3883 20.161 86.3385 20.3488 86.2934 20.5367C86.2023 20.9179 86.1287 21.3046 86.0728 21.7024C85.9037 22.9172 85.9037 24.1508 86.0728 25.3655ZM33.9272 25.3655C33.8739 25.7634 33.7977 26.1501 33.7071 26.5313C33.6617 26.7247 33.6119 26.9126 33.5579 27.0949C33.4514 27.4658 33.3269 27.8309 33.1849 28.1888C32.9755 28.7151 32.7294 29.2247 32.4484 29.7138C32.2624 30.0342 32.0615 30.3491 31.8467 30.6475C31.204 31.551 30.4347 32.3499 29.5642 33.0177C28.9782 33.4638 28.3521 33.8505 27.6948 34.1725C27.191 34.4169 26.6709 34.6237 26.1387 34.7913C25.7795 34.9018 25.4123 34.9957 25.0371 35.0731C24.2677 35.2268 23.486 35.3045 22.7024 35.3051C16.4334 35.3051 11.3514 30.0362 11.3514 23.5368C11.3514 17.0373 16.4334 11.7684 22.7024 11.7684C23.4861 11.7663 24.2681 11.844 25.0371 12.0005C25.4089 12.0742 25.7765 12.1682 26.1387 12.2822C26.6708 12.448 27.1908 12.6529 27.6948 12.8955C29.3375 13.6984 30.7636 14.9092 31.8467 16.4205C32.0599 16.7244 32.2624 17.0338 32.4484 17.3598C32.7304 17.8482 32.9766 18.3579 33.1849 18.8847C33.325 19.2383 33.4513 19.6029 33.5579 19.9731C33.6116 20.161 33.6613 20.3488 33.7071 20.5367C33.7977 20.9179 33.8718 21.3046 33.9272 21.7024C34.0963 22.9172 34.0963 24.1508 33.9272 25.3655ZM119.343 54.0764C119.204 53.836 119.05 53.5733 118.862 53.2826C118.66 52.9695 118.432 52.6341 118.171 52.2764C117.909 51.9186 117.62 51.5385 117.295 51.1472C116.97 50.7559 116.615 50.3534 116.224 49.9398C114.625 48.2625 112.798 46.8262 110.799 45.6746C110.168 45.3056 109.497 44.9591 108.788 44.6292C108.767 44.6181 108.748 44.6125 108.728 44.6013C100.676 41.1728 91.6054 41.1728 83.5538 44.6013C83.4404 44.6516 83.3336 44.7075 83.2235 44.7634C83.0429 44.8472 82.8778 44.9423 82.7027 45.0317C82.8007 45.0876 82.9003 45.1379 82.9978 45.1938C84.9925 46.3455 86.8856 47.6696 88.6562 49.1516C89.8126 50.1167 90.913 51.1488 91.952 52.2428C92.5945 52.9136 93.1818 53.5788 93.7185 54.2273C94.269 54.8925 94.7513 55.513 95.1817 56.1055C95.6249 56.7148 96.0075 57.2794 96.3488 57.7993C96.6719 58.3024 96.9455 58.7496 97.1817 59.1633C97.6294 59.9211 97.9634 60.7426 98.1726 61.6005L98.2601 62.2042H116.6C118.478 62.2042 120 60.682 120 58.8042V55.3676C119.81 54.9225 119.591 54.491 119.343 54.0764ZM77.6389 15.6162C77.5508 14.9906 77.435 14.382 77.292 13.7846C77.2208 13.4859 77.1425 13.1873 77.0577 12.8942C76.8886 12.3081 76.6929 11.7389 76.4727 11.181C76.1444 10.3541 75.7576 9.55357 75.3153 8.78587C75.0228 8.27866 74.7075 7.78837 74.3694 7.31498C72.6729 4.93631 70.4305 3.03412 67.8456 1.78084C67.0544 1.39541 66.2367 1.07141 65.3992 0.811523C64.8349 0.63682 64.2576 0.48466 63.6683 0.366313C62.4595 0.123014 61.231 0 59.9997 0C49.8923 0 42.1622 8.01379 42.1622 18.496C42.1622 28.9781 49.8923 36.9863 59.9997 36.9863C61.231 36.9863 62.4595 36.8633 63.6683 36.62C64.2576 36.5016 64.8349 36.3495 65.3992 36.1748C66.2367 35.9149 67.0544 35.5909 67.8456 35.2055C70.4305 33.9522 72.6729 32.05 74.3694 29.6713C74.7072 29.1979 75.0225 28.7076 75.3153 28.2004C75.7576 27.4327 76.1444 26.6322 76.4727 25.8053C76.6902 25.2474 76.8886 24.6726 77.0577 24.0921C77.1425 23.799 77.2208 23.5004 77.292 23.2017C77.435 22.6043 77.5508 21.9957 77.6389 21.3701C77.9042 19.462 77.9042 17.5243 77.6389 15.6162ZM93.0965 61.4246C92.8978 61.0703 92.6696 60.6818 92.4021 60.2532C92.1144 59.7961 91.7847 59.299 91.4118 58.7733C91.039 58.2476 90.623 57.6876 90.1612 57.1162C89.6993 56.5448 89.1905 55.9448 88.6326 55.3448C87.7365 54.3736 86.7887 53.456 85.7938 52.5964C84.2613 51.2774 82.6237 50.0979 80.8992 49.0708C79.999 48.5337 79.0431 48.0195 78.0315 47.5395C78.0039 47.522 77.9751 47.5067 77.9453 47.4938C73.2477 45.2653 67.3414 43.7111 59.9989 43.7111C52.6564 43.7111 46.7496 45.2653 42.0526 47.4938C41.8888 47.5681 41.7398 47.6538 41.5803 47.7338C40.8941 48.0709 40.2347 48.4252 39.6009 48.7851C39.2573 48.9851 38.9214 49.1851 38.5931 49.3851C37.0554 50.3392 35.5882 51.4126 34.204 52.5964C33.209 53.4558 32.2612 54.3734 31.3652 55.3448C30.8084 55.9448 30.3001 56.5391 29.8367 57.1162C29.3732 57.6933 28.9583 58.2419 28.5854 58.7733C28.2126 59.3047 27.8834 59.7961 27.5957 60.2532C27.3282 60.6818 27.1 61.0703 26.9018 61.4246C26.8833 61.4521 26.8664 61.4807 26.8511 61.5103C26.6425 61.8817 26.4728 62.2074 26.3385 62.476C26.0699 63.0131 25.9459 63.3159 25.9459 63.3159V70.5726C25.9459 72.4504 27.4682 73.9726 29.3459 73.9726H90.6541C92.5318 73.9726 94.0541 72.4504 94.0541 70.5726V63.3159C93.7702 62.6666 93.4505 62.035 93.0965 61.4246ZM21.7773 61.6062C21.8277 61.1833 21.9651 60.7758 22.1807 60.4102C22.3487 60.086 22.4749 59.6948 22.7367 59.2421C23.0271 58.7447 23.2558 58.3032 23.5732 57.8057C23.9132 57.2804 24.2785 56.7159 24.7161 56.1179C25.1536 55.5199 25.6319 54.8883 26.1698 54.24C26.7076 53.5917 27.2983 52.921 27.9447 52.2392C30.4236 49.6351 33.2397 47.3846 36.3159 45.5492C36.6355 45.3592 36.965 45.1692 37.2973 44.9847C37.1535 44.9121 37.0218 44.8339 36.8724 44.7668C36.7622 44.7109 36.652 44.655 36.5418 44.6047C32.5724 42.8404 28.2751 41.9636 23.9418 42.0338C19.6088 41.9636 15.3116 42.8405 11.3424 44.6047C11.3215 44.6159 11.3028 44.6215 11.2818 44.6326C10.5721 44.9624 9.90032 45.3089 9.26825 45.6778C8.05739 46.376 6.90772 47.1782 5.83185 48.0754C5.1338 48.66 4.46803 49.2832 3.83757 49.9421C3.44632 50.3557 3.08887 50.7581 2.76521 51.1493C2.44064 51.5406 2.14858 51.9206 1.88682 52.2783C1.62507 52.636 1.39363 52.9713 1.19139 53.2843C1.00403 53.5749 0.826588 53.8376 0.68717 54.0779C0.224832 54.8716 0 55.369 0 55.369V58.8042C0 60.682 1.52223 62.2042 3.4 62.2042H21.7371L21.7773 61.6062Z",fill:"#fff"})]})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},746445:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=32,h=32;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"connection"},p),{},{children:(0,l.jsx)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 32 32",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 32 32",xmlSpace:"preserve",children:(0,l.jsx)("path",{fill:"currentColor",d:"M15.95,27.369L1.808,8.512c3.89-2.947,8.839-4.714,14.142-4.714 c5.304,0,10.254,1.768,14.142,4.714L15.95,27.369z M14.736,19.447h2.545v-2.545h-2.545V19.447z M14.736,14.357h2.545V7.912h-2.545 V14.357z"})})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},191170:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultBroadcastIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=212,h=212;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"default-broadcast"},p),{},{children:(0,l.jsxs)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 212 212",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 212 212",xmlSpace:"preserve",children:[(0,l.jsx)("path",{fill:"#DFE5E7",className:"background",d:"M106.251,0.5C164.653,0.5,212,47.846,212,106.25S164.653,212,106.25,212C47.846,212,0.5,164.654,0.5,106.25 S47.846,0.5,106.251,0.5z"}),(0,l.jsx)("path",{fill:"#FFFFFF",className:"primary",d:"M152.168,54.014l-11.66,4.364v95.453l11.744,4.161L152.168,54.014z M49.742,121.662l18.892,6.698 c0,0.14-0.021,0.274-0.021,0.414c0,14.507,11.782,26.269,26.318,26.269c8.39,0,15.849-3.935,20.669-10.039l18.328,6.495v-90.66 L49.742,92.355V121.662L49.742,121.662z M108.302,142.417c-3.455,3.371-8.169,5.458-13.371,5.458 c-9.818,0-17.921-7.419-19.005-16.934L108.302,142.417z"})]})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},998266:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultGroupIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=212,h=212;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"default-group"},p),{},{children:(0,l.jsxs)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 212 212",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),fill:"none",children:[(0,l.jsx)("path",{className:"background",d:"M105.946 0.25C164.318 0.25 211.64 47.596 211.64 106C211.64 164.404 164.318 211.75 105.945 211.75C47.571 211.75 0.25 164.404 0.25 106C0.25 47.596 47.571 0.25 105.946 0.25Z",fill:"#DFE5E7"}),(0,l.jsx)("path",{className:"primary",fillRule:"evenodd",clipRule:"evenodd",d:"M102.282 77.2856C102.282 87.957 93.8569 96.5713 83.3419 96.5713C72.827 96.5713 64.339 87.957 64.339 77.2856C64.339 66.6143 72.827 58 83.3419 58C93.8569 58 102.282 66.6143 102.282 77.2856ZM150.35 80.1427C150.35 89.9446 142.612 97.857 132.954 97.857C123.296 97.857 115.5 89.9446 115.5 80.1427C115.5 70.3409 123.296 62.4285 132.954 62.4285C142.612 62.4285 150.35 70.3409 150.35 80.1427ZM83.3402 109.428C68.5812 109.428 39 116.95 39 131.928V143.714C39 147.25 41.8504 148 45.3343 148H121.346C124.83 148 127.68 147.25 127.68 143.714V131.928C127.68 116.95 98.0991 109.428 83.3402 109.428ZM126.804 110.853C127.707 110.871 128.485 110.886 129 110.886C143.759 110.886 174 116.95 174 131.929V141.571C174 145.107 171.15 148 167.666 148H134.854C135.551 146.007 135.995 143.821 135.995 141.571L135.75 131.071C135.75 121.51 130.136 117.858 124.162 113.971C122.772 113.067 121.363 112.15 120 111.143C119.981 111.123 119.962 111.098 119.941 111.07C119.893 111.007 119.835 110.931 119.747 110.886C121.343 110.747 124.485 110.808 126.804 110.853Z"})]})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},999784:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultUserColorIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=212,h=212;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"default-user-color"},p),{},{children:(0,l.jsxs)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 212 212",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 212 212",xmlSpace:"preserve",children:[(0,l.jsx)("path",{fill:"currentColor",className:"background",d:"M106.251,0.5C164.653,0.5,212,47.846,212,106.25S164.653,212,106.25,212C47.846,212,0.5,164.654,0.5,106.25 S47.846,0.5,106.251,0.5z"}),(0,l.jsxs)("g",{children:[(0,l.jsx)("path",{fill:"#FFFFFF",className:"primary",d:"M173.561,171.615c-0.601-0.915-1.287-1.907-2.065-2.955c-0.777-1.049-1.645-2.155-2.608-3.299 c-0.964-1.144-2.024-2.326-3.184-3.527c-1.741-1.802-3.71-3.646-5.924-5.47c-2.952-2.431-6.339-4.824-10.204-7.026 c-1.877-1.07-3.873-2.092-5.98-3.055c-0.062-0.028-0.118-0.059-0.18-0.087c-9.792-4.44-22.106-7.529-37.416-7.529 s-27.624,3.089-37.416,7.529c-0.338,0.153-0.653,0.318-0.985,0.474c-1.431,0.674-2.806,1.376-4.128,2.101 c-0.716,0.393-1.417,0.792-2.101,1.197c-3.421,2.027-6.475,4.191-9.15,6.395c-2.213,1.823-4.182,3.668-5.924,5.47 c-1.161,1.201-2.22,2.384-3.184,3.527c-0.964,1.144-1.832,2.25-2.609,3.299c-0.778,1.049-1.464,2.04-2.065,2.955 c-0.557,0.848-1.033,1.622-1.447,2.324c-0.033,0.056-0.073,0.119-0.104,0.174c-0.435,0.744-0.79,1.392-1.07,1.926 c-0.559,1.068-0.818,1.678-0.818,1.678v0.398c18.285,17.927,43.322,28.985,70.945,28.985c27.678,0,52.761-11.103,71.055-29.095 v-0.289c0,0-0.619-1.45-1.992-3.778C174.594,173.238,174.117,172.463,173.561,171.615z"}),(0,l.jsx)("path",{fill:"#FFFFFF",className:"primary",d:"M106.002,125.5c2.645,0,5.212-0.253,7.68-0.737c1.234-0.242,2.443-0.542,3.624-0.896 c1.772-0.532,3.482-1.188,5.12-1.958c2.184-1.027,4.242-2.258,6.15-3.67c2.863-2.119,5.39-4.646,7.509-7.509 c0.706-0.954,1.367-1.945,1.98-2.971c0.919-1.539,1.729-3.155,2.422-4.84c0.462-1.123,0.872-2.277,1.226-3.458 c0.177-0.591,0.341-1.188,0.49-1.792c0.299-1.208,0.542-2.443,0.725-3.701c0.275-1.887,0.417-3.827,0.417-5.811 c0-1.984-0.142-3.925-0.417-5.811c-0.184-1.258-0.426-2.493-0.725-3.701c-0.15-0.604-0.313-1.202-0.49-1.793 c-0.354-1.181-0.764-2.335-1.226-3.458c-0.693-1.685-1.504-3.301-2.422-4.84c-0.613-1.026-1.274-2.017-1.98-2.971 c-2.119-2.863-4.646-5.39-7.509-7.509c-1.909-1.412-3.966-2.643-6.15-3.67c-1.638-0.77-3.348-1.426-5.12-1.958 c-1.181-0.355-2.39-0.655-3.624-0.896c-2.468-0.484-5.035-0.737-7.68-0.737c-21.162,0-37.345,16.183-37.345,37.345 C68.657,109.317,84.84,125.5,106.002,125.5z"})]})]})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},412213:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultUserIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=212,h=212;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"default-user"},p),{},{children:(0,l.jsxs)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 212 212",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 212 212",xmlSpace:"preserve",children:[(0,l.jsx)("path",{fill:"#DFE5E7",className:"background",d:"M106.251,0.5C164.653,0.5,212,47.846,212,106.25S164.653,212,106.25,212C47.846,212,0.5,164.654,0.5,106.25 S47.846,0.5,106.251,0.5z"}),(0,l.jsxs)("g",{children:[(0,l.jsx)("path",{fill:"#FFFFFF",className:"primary",d:"M173.561,171.615c-0.601-0.915-1.287-1.907-2.065-2.955c-0.777-1.049-1.645-2.155-2.608-3.299 c-0.964-1.144-2.024-2.326-3.184-3.527c-1.741-1.802-3.71-3.646-5.924-5.47c-2.952-2.431-6.339-4.824-10.204-7.026 c-1.877-1.07-3.873-2.092-5.98-3.055c-0.062-0.028-0.118-0.059-0.18-0.087c-9.792-4.44-22.106-7.529-37.416-7.529 s-27.624,3.089-37.416,7.529c-0.338,0.153-0.653,0.318-0.985,0.474c-1.431,0.674-2.806,1.376-4.128,2.101 c-0.716,0.393-1.417,0.792-2.101,1.197c-3.421,2.027-6.475,4.191-9.15,6.395c-2.213,1.823-4.182,3.668-5.924,5.47 c-1.161,1.201-2.22,2.384-3.184,3.527c-0.964,1.144-1.832,2.25-2.609,3.299c-0.778,1.049-1.464,2.04-2.065,2.955 c-0.557,0.848-1.033,1.622-1.447,2.324c-0.033,0.056-0.073,0.119-0.104,0.174c-0.435,0.744-0.79,1.392-1.07,1.926 c-0.559,1.068-0.818,1.678-0.818,1.678v0.398c18.285,17.927,43.322,28.985,70.945,28.985c27.678,0,52.761-11.103,71.055-29.095 v-0.289c0,0-0.619-1.45-1.992-3.778C174.594,173.238,174.117,172.463,173.561,171.615z"}),(0,l.jsx)("path",{fill:"#FFFFFF",className:"primary",d:"M106.002,125.5c2.645,0,5.212-0.253,7.68-0.737c1.234-0.242,2.443-0.542,3.624-0.896 c1.772-0.532,3.482-1.188,5.12-1.958c2.184-1.027,4.242-2.258,6.15-3.67c2.863-2.119,5.39-4.646,7.509-7.509 c0.706-0.954,1.367-1.945,1.98-2.971c0.919-1.539,1.729-3.155,2.422-4.84c0.462-1.123,0.872-2.277,1.226-3.458 c0.177-0.591,0.341-1.188,0.49-1.792c0.299-1.208,0.542-2.443,0.725-3.701c0.275-1.887,0.417-3.827,0.417-5.811 c0-1.984-0.142-3.925-0.417-5.811c-0.184-1.258-0.426-2.493-0.725-3.701c-0.15-0.604-0.313-1.202-0.49-1.793 c-0.354-1.181-0.764-2.335-1.226-3.458c-0.693-1.685-1.504-3.301-2.422-4.84c-0.613-1.026-1.274-2.017-1.98-2.971 c-2.119-2.863-4.646-5.39-7.509-7.509c-1.909-1.412-3.966-2.643-6.15-3.67c-1.638-0.77-3.348-1.426-5.12-1.958 c-1.181-0.355-2.39-0.655-3.624-0.896c-2.468-0.484-5.035-0.737-7.68-0.737c-21.162,0-37.345,16.183-37.345,37.345 C68.657,109.317,84.84,125.5,106.002,125.5z"})]})]})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},273415:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultUserSquareIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=212,h=212;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"default-user-square"},p),{},{children:(0,l.jsxs)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 212 212",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 212 212",xmlSpace:"preserve",children:[(0,l.jsx)("path",{fill:"#DFE5E7",className:"background",d:"M0,0h212v212H0V0z"}),(0,l.jsx)("path",{fill:"#FFFFFF",className:"primary",d:"M106,125.5c2.6,0,5.2-0.3,7.7-0.7c1.2-0.2,2.4-0.5,3.6-0.9c1.8-0.5,3.5-1.2,5.1-2c2.2-1,4.2-2.3,6.1-3.7 c2.9-2.1,5.4-4.6,7.5-7.5c0.7-1,1.4-1.9,2-3c0.9-1.5,1.7-3.2,2.4-4.8c0.5-1.1,0.9-2.3,1.2-3.5c0.2-0.6,0.3-1.2,0.5-1.8 c0.3-1.2,0.5-2.4,0.7-3.7c0.3-1.9,0.4-3.8,0.4-5.8s-0.1-3.9-0.4-5.8c-0.2-1.3-0.4-2.5-0.7-3.7c-0.1-0.6-0.3-1.2-0.5-1.8 c-0.4-1.2-0.8-2.3-1.2-3.5c-0.7-1.7-1.5-3.3-2.4-4.8c-0.6-1-1.3-2-2-3c-2.1-2.9-4.6-5.4-7.5-7.5c-1.9-1.4-4-2.6-6.1-3.7 c-1.6-0.8-3.3-1.4-5.1-2c-1.2-0.4-2.4-0.7-3.6-0.9c-2.5-0.5-5-0.7-7.7-0.7c-21.2,0-37.3,16.2-37.3,37.3 C68.7,109.3,84.8,125.5,106,125.5z M175,173.9c-0.4-0.7-0.9-1.5-1.4-2.3c-0.6-0.9-1.3-1.9-2.1-3c-0.8-1-1.6-2.2-2.6-3.3 s-2-2.3-3.2-3.5c-1.7-1.8-3.7-3.6-5.9-5.5c-3-2.4-6.3-4.8-10.2-7c-1.9-1.1-3.9-2.1-6-3.1c-0.1,0-0.1-0.1-0.2-0.1 c-9.8-4.4-22.1-7.5-37.4-7.5s-27.6,3.1-37.4,7.5c-0.3,0.2-0.7,0.3-1,0.5c-1.4,0.7-2.8,1.4-4.1,2.1c-0.7,0.4-1.4,0.8-2.1,1.2 c-3.4,2-6.5,4.2-9.1,6.4c-2.2,1.8-4.2,3.7-5.9,5.5c-1.2,1.2-2.2,2.4-3.2,3.5s-1.8,2.2-2.6,3.3c-0.8,1-1.5,2-2.1,3 c-0.6,0.8-1,1.6-1.4,2.3c0,0.1-0.1,0.1-0.1,0.2v0.1c-9.6,15-9.6,32.9-9.6,32.9s61.2,0,78.7,0h0.1c17.4,0,78.8,0,78.8,0 S184.7,189,175,173.9z"})]})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},951387:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DisappearingIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=36,h=36;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"disappearing"},p),{},{children:(0,l.jsxs)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 36 36",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),fill:"none",children:[(0,l.jsx)("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M18 31.5C18.0909 31.5 18.1817 31.4991 18.2722 31.4973C19.1005 31.4809 19.7586 30.7961 19.7422 29.9679C19.7258 29.1396 19.041 28.4815 18.2128 28.4979C18.142 28.4993 18.0711 28.5 18 28.5V31.5ZM18 7.5C18.0711 7.5 18.142 7.5007 18.2128 7.50211C19.041 7.51853 19.7258 6.86039 19.7422 6.03213C19.7586 5.20387 19.1005 4.51912 18.2722 4.5027C18.1817 4.5009 18.0909 4.5 18 4.5V7.5ZM24.5153 6.17374C23.7901 5.77341 22.8776 6.03683 22.4772 6.76211C22.0769 7.48739 22.3403 8.39988 23.0656 8.8002C23.1891 8.86838 23.3111 8.93898 23.4316 9.01195C24.1401 9.44118 25.0625 9.21475 25.4917 8.5062C25.921 7.79765 25.6945 6.87529 24.986 6.44605C24.8311 6.35223 24.6742 6.26144 24.5153 6.17374ZM29.554 11.014C29.1247 10.3055 28.2024 10.079 27.4938 10.5083C26.7852 10.9375 26.5588 11.8599 26.9881 12.5684C27.061 12.6889 27.1316 12.8109 27.1998 12.9344C27.6001 13.6597 28.5126 13.9231 29.2379 13.5228C29.9632 13.1224 30.2266 12.2099 29.8263 11.4847C29.7386 11.3258 29.6478 11.1689 29.554 11.014ZM31.4973 17.7278C31.4809 16.8995 30.7961 16.2414 29.9679 16.2578C29.1396 16.2742 28.4815 16.959 28.4979 17.7872C28.4993 17.858 28.5 17.9289 28.5 18C28.5 18.0711 28.4993 18.142 28.4979 18.2128C28.4815 19.041 29.1396 19.7258 29.9679 19.7422C30.7961 19.7586 31.4809 19.1005 31.4973 18.2722C31.4991 18.1817 31.5 18.0909 31.5 18C31.5 17.9091 31.4991 17.8183 31.4973 17.7278ZM29.8263 24.5153C30.2266 23.7901 29.9632 22.8776 29.2379 22.4772C28.5126 22.0769 27.6001 22.3403 27.1998 23.0656C27.1316 23.1891 27.061 23.3111 26.9881 23.4316C26.5588 24.1401 26.7852 25.0625 27.4938 25.4917C28.2024 25.921 29.1247 25.6945 29.554 24.986C29.6478 24.8311 29.7386 24.6742 29.8263 24.5153ZM24.986 29.554C25.6945 29.1247 25.921 28.2024 25.4917 27.4938C25.0625 26.7852 24.1401 26.5588 23.4316 26.9881C23.3111 27.061 23.1891 27.1316 23.0656 27.1998C22.3403 27.6001 22.0769 28.5126 22.4772 29.2379C22.8776 29.9632 23.7901 30.2266 24.5153 29.8263C24.6742 29.7386 24.8311 29.6478 24.986 29.554Z"}),(0,l.jsx)("path",{fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd",d:"M18.0001 4.5C18 4.5 17.9999 4.5 17.9998 4.5C10.5439 4.5 4.49976 10.5442 4.49976 18C4.49976 25.4558 10.5439 31.5 17.9998 31.5C17.9999 31.5 18 31.5 18.0001 31.5V28.5C18 28.5 17.9999 28.5 17.9998 28.5C12.2008 28.5 7.49976 23.799 7.49976 18C7.49976 12.201 12.2008 7.5 17.9998 7.5C17.9999 7.5 18 7.5 18.0001 7.5V4.5Z"}),(0,l.jsx)("path",{fill:"currentColor",d:"M23.3247 12.0107C23.669 11.7525 24.1507 11.7867 24.455 12.091V12.091C24.7593 12.3953 24.7935 12.877 24.5353 13.2213L19.9714 19.3066C19.2589 20.2566 17.8701 20.3553 17.0304 19.5156V19.5156C16.1907 18.6759 16.2894 17.2871 17.2394 16.5746L23.3247 12.0107Z"})]})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},309285:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ElectronDeprecationDownloadNativeGreenIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=48,h=48;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"electron-deprecation-download-native-green"},p),{},{children:(0,l.jsxs)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 48 48",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),fill:"none",children:[(0,l.jsx)("path",{d:"M2 24.165C2 11.924 11.919 2 24.154 2C36.389 2 46.308 11.924 46.308 24.165C46.308 36.406 36.389 46.33 24.154 46.33C11.919 46.33 2 36.406 2 24.165Z",fill:"#00A884"}),(0,l.jsx)("path",{d:"M30.3252 22.4417H26.6585V17.0333H21.2502V22.4417H17.5835L23.9085 28.7667L30.3252 22.4417V22.4417ZM17.6752 30.6V32.4333H30.4168V30.6H17.6752Z",fill:"currentColor"})]})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},355716:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ElectronDeprecationDownloadNativeIcon=function(e){const{iconXstyle:t,height:n,width:r,viewBox:c}=e,d=(0,a.default)(e,u);let p;if(c){const{x:e=0,y:t=0,width:n=0,height:r=0}=c;p=[e,t,n,r].join(" ")}{var _;let e=48,a=48;return null==n&&null==r||(e=n,a=r),(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"electron-deprecation-download-native"},d),{},{children:(0,l.jsxs)("svg",{viewBox:null!==(_=p)&&void 0!==_?_:"0 0 48 48",height:e,width:a,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(t),fill:"none",children:[(0,l.jsx)("path",{d:"M2 24.165C2 11.924 11.919 2 24.154 2C36.389 2 46.308 11.924 46.308 24.165C46.308 36.406 36.389 46.33 24.154 46.33C11.919 46.33 2 36.406 2 24.165Z",fill:"#00A884"}),(0,l.jsx)("path",{d:"M30.3252 22.4417H26.6585V17.0333H21.2502V22.4417H17.5835L23.9085 28.7667L30.3252 22.4417V22.4417ZM17.6752 30.6V32.4333H30.4168V30.6H17.6752Z",fill:"currentColor"})]})}))}};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},106789:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.LabelIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=24,h=24;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"label"},p),{},{children:(0,l.jsx)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 24 24",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 24 24",xmlSpace:"preserve",children:(0,l.jsx)("path",{fill:"currentColor",d:"M5.81,6.899c-0.507,0-0.919,0.41-0.919,0.911v8.379c0,0.501,0.413,0.911,0.92,0.911l9.583,0.008 c0.302,0,0.58-0.146,0.749-0.385L19.494,12l-3.352-4.725c-0.168-0.238-0.446-0.384-0.748-0.384L5.81,6.899z M15.393,5 c0.921,0,1.774,0.447,2.292,1.182L21.812,12l-0.466,0.657l-3.66,5.159C17.166,18.553,16.314,19,15.393,19L5.81,18.992 C4.262,18.992,3,17.738,3,16.19V7.81c0-1.549,1.262-2.802,2.809-2.802L15.393,5z"})})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},406405:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.OfflineMessageLoadIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=12,h=17;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"offline-message-load"},p),{},{children:(0,l.jsx)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 17 12",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),fill:"none",children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.708496 2.46777C0.708496 1.56814 1.44753 0.831299 2.35175 0.831299H16.646C16.9646 0.831299 17.0698 1.03474 16.879 1.28571L14.0882 5.15382V10.174C14.0882 11.0745 13.3492 11.8105 12.445 11.8105H2.35175C1.44753 11.8105 0.708496 11.0745 0.708496 10.174V2.46777ZM10.6252 4.37297C10.8208 4.37297 10.9793 4.53153 10.9793 4.72713V5.43547C10.9793 5.63107 10.8208 5.78963 10.6252 5.78963H4.25016C4.05456 5.78963 3.896 5.63107 3.896 5.43547V4.72713C3.896 4.53153 4.05456 4.37297 4.25016 4.37297H10.6252ZM9.56266 6.85213C9.75826 6.85213 9.91683 7.0107 9.91683 7.2063V7.91463C9.91683 8.11023 9.75826 8.2688 9.56266 8.2688H4.25016C4.05456 8.2688 3.896 8.11023 3.896 7.91463V7.2063C3.896 7.0107 4.05456 6.85213 4.25016 6.85213H9.56266Z",fill:"white"})})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},376355:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.PsaVerifiedIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=18,h=18;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"psa-verified"},p),{},{children:(0,l.jsxs)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 18 18",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 18 18",xmlSpace:"preserve",children:[(0,l.jsx)("polygon",{id:"Star-2",fill:"#00DA60",points:"9,16 7.1,16.9 5.8,15.2 3.7,15.1 3.4,13 1.5,12 2.2,9.9 1.1,8.2 2.6,6.7 2.4,4.6 4.5,4 5.3,2 7.4,2.4 9,1.1 10.7,2.4 12.7,2 13.6,4 15.6,4.6 15.5,6.7 17,8.2 15.9,9.9 16.5,12 14.7,13 14.3,15.1 12.2,15.2 10.9,16.9 "}),(0,l.jsx)("polygon",{id:"Check-Icon",fill:"#FFFFFF",points:"13.1,7.3 12.2,6.5 8.1,10.6 5.9,8.5 5,9.4 8,12.4 "})]})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},590387:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.RefreshLargeIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=48,h=48;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"refresh-large"},p),{},{children:(0,l.jsxs)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 48 48",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),version:"1.1",children:[(0,l.jsx)("title",{children:"refresh-l-light"}),(0,l.jsx)("desc",{children:"Created with Sketch."}),(0,l.jsx)("defs",{}),(0,l.jsx)("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",children:(0,l.jsx)("g",{id:"ic_refresh_black_24px",fill:"currentColor",fillRule:"nonzero",children:(0,l.jsx)("path",{d:"M35.3,12.7 C32.4,9.8 28.42,8 24,8 C15.16,8 8.02,15.16 8.02,24 C8.02,32.84 15.16,40 24,40 C31.46,40 37.68,34.9 39.46,28 L35.3,28 C33.66,32.66 29.22,36 24,36 C17.38,36 12,30.62 12,24 C12,17.38 17.38,12 24,12 C27.32,12 30.28,13.38 32.44,15.56 L26,22 L40,22 L40,8 L35.3,12.7 Z",id:"Shape"})})})]})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},700848:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.VisibilityOffIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=24,h=24;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"visibility-off"},p),{},{children:(0,l.jsx)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 24 24",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),fill:"none",children:(0,l.jsx)("path",{d:"M12 7C14.76 7 17 9.24 17 12C17 12.65 16.87 13.26 16.64 13.83L19.56 16.75C21.07 15.49 22.26 13.86 22.99 12C21.26 7.61 16.99 4.5 11.99 4.5C10.59 4.5 9.25 4.75 8.01 5.2L10.17 7.36C10.74 7.13 11.35 7 12 7ZM2 4.27L4.28 6.55L4.74 7.01C3.08 8.3 1.78 10.02 1 12C2.73 16.39 7 19.5 12 19.5C13.55 19.5 15.03 19.2 16.38 18.66L16.8 19.08L19.73 22L21 20.73L3.27 3L2 4.27ZM7.53 9.8L9.08 11.35C9.03 11.56 9 11.78 9 12C9 13.66 10.34 15 12 15C12.22 15 12.44 14.97 12.65 14.92L14.2 16.47C13.53 16.8 12.79 17 12 17C9.24 17 7 14.76 7 12C7 11.21 7.2 10.47 7.53 9.8ZM11.84 9.02L14.99 12.17L15.01 12.01C15.01 10.35 13.67 9.01 12.01 9.01L11.84 9.02Z",fill:"currentColor"})})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},479846:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.VisibilityOnIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=24,h=24;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"visibility-on"},p),{},{children:(0,l.jsx)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 24 24",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),fill:"none",children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 4.5C7 4.5 2.73 7.61 1 12C2.73 16.39 7 19.5 12 19.5C17 19.5 21.27 16.39 23 12C21.27 7.61 17 4.5 12 4.5ZM12 17C9.24 17 7 14.76 7 12C7 9.24 9.24 7 12 7C14.76 7 17 9.24 17 12C17 14.76 14.76 17 12 17ZM9 12C9 10.34 10.34 9 12 9C13.66 9 15 10.34 15 12C15 13.66 13.66 15 12 15C10.34 15 9 13.66 9 12Z",fill:"currentColor"})})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},709333:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.WaChatPsaIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=360,h=360;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"wa-chat-psa"},p),{},{children:(0,l.jsxs)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 360 360",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),version:"1.1",id:"Layer_1",x:"0px",y:"0px",enableBackground:"new 0 0 360 360",xmlSpace:"preserve",children:[(0,l.jsx)("path",{fill:"#25D366",opacity:1,stroke:"none",d:" M173.000000,361.000000 C115.353172,361.000000 58.206341,361.000000 1.029757,361.000000 C1.029757,241.061493 1.029757,121.122963 1.029757,1.092220 C120.896820,1.092220 240.793732,1.092220 360.845337,1.092220 C360.845337,120.999847 360.845337,240.999893 360.845337,361.000000 C298.456329,361.000000 235.978165,361.000000 173.000000,361.000000 M197.063446,92.379547 C195.411438,92.174431 193.762665,91.937508 192.106949,91.768898 C156.937073,88.187309 128.342728,100.457565 108.074654,129.217316 C87.867386,157.890823 86.575523,188.910645 101.408730,220.531891 C102.965797,223.851242 103.232262,226.553955 102.266563,229.950317 C98.463707,243.324921 94.899605,256.767395 91.084465,270.781311 C93.123474,270.351715 94.548683,270.112305 95.941422,269.748505 C108.650543,266.428864 121.320129,262.946716 134.088593,259.875153 C136.551529,259.282684 139.727280,259.569855 142.010056,260.646881 C157.967712,268.175995 174.705978,270.917206 192.102615,268.776276 C234.755585,263.527069 268.624664,226.903122 270.011841,184.898880 C271.516479,139.337418 241.558502,101.014793 197.063446,92.379547 z"}),(0,l.jsx)("path",{fill:"#FCFEFD",opacity:1,stroke:"none",d:" M197.474182,92.506378 C241.558502,101.014793 271.516479,139.337418 270.011841,184.898880 C268.624664,226.903122 234.755585,263.527069 192.102615,268.776276 C174.705978,270.917206 157.967712,268.175995 142.010056,260.646881 C139.727280,259.569855 136.551529,259.282684 134.088593,259.875153 C121.320129,262.946716 108.650543,266.428864 95.941422,269.748505 C94.548683,270.112305 93.123474,270.351715 91.084465,270.781311 C94.899605,256.767395 98.463707,243.324921 102.266563,229.950317 C103.232262,226.553955 102.965797,223.851242 101.408730,220.531891 C86.575523,188.910645 87.867386,157.890823 108.074654,129.217316 C128.342728,100.457565 156.937073,88.187309 192.106949,91.768898 C193.762665,91.937508 195.411438,92.174431 197.474182,92.506378 M253.181854,196.536774 C255.711929,186.169617 256.004150,175.664429 253.541946,165.353546 C246.119568,134.271210 226.847565,114.125397 195.518936,107.758392 C164.775314,101.510277 138.969528,111.918282 120.761078,137.417480 C102.516304,162.967529 102.122711,190.360199 117.175308,217.804871 C119.110695,221.333557 119.630486,224.226303 118.452988,227.999252 C116.305588,234.880005 114.631348,241.908432 112.534187,249.714706 C121.244263,247.449783 128.886383,245.269287 136.634216,243.571182 C138.823502,243.091385 141.697876,243.342087 143.623520,244.406097 C187.851929,268.844574 240.426270,246.301453 253.181854,196.536774 z"}),(0,l.jsx)("path",{fill:"#26D367",opacity:1,stroke:"none",d:" M253.113434,196.950668 C240.426270,246.301453 187.851929,268.844574 143.623520,244.406097 C141.697876,243.342087 138.823502,243.091385 136.634216,243.571182 C128.886383,245.269287 121.244263,247.449783 112.534187,249.714706 C114.631348,241.908432 116.305588,234.880005 118.452988,227.999252 C119.630486,224.226303 119.110695,221.333557 117.175308,217.804871 C102.122711,190.360199 102.516304,162.967529 120.761078,137.417480 C138.969528,111.918282 164.775314,101.510277 195.518936,107.758392 C226.847565,114.125397 246.119568,134.271210 253.541946,165.353546 C256.004150,175.664429 255.711929,186.169617 253.113434,196.950668 M159.161896,144.300629 C157.596588,142.566147 156.289551,139.760483 154.415009,139.308472 C149.758347,138.185654 145.465286,139.125748 141.936844,143.335083 C135.938049,150.491486 133.889008,158.646042 136.794312,167.095337 C139.180939,174.036118 142.985977,180.714874 147.247849,186.742218 C159.314850,203.807953 175.066055,216.142273 195.540466,221.815857 C205.004898,224.438538 213.684128,223.322174 221.218109,216.594635 C225.301636,212.948212 226.861237,207.950836 225.754288,203.034790 C225.255310,200.818695 221.393539,199.207153 218.857986,197.645233 C216.319427,196.081421 213.584717,194.800613 210.844025,193.606903 C202.134613,189.813538 203.863739,189.749985 198.366028,196.614182 C197.431046,197.781570 196.301865,198.814072 195.495682,200.059845 C193.532318,203.093781 191.249756,202.866211 188.234161,201.544495 C177.255371,196.732590 168.560989,189.383530 161.641464,179.587280 C158.640030,175.338043 158.010895,172.193756 162.204178,168.482956 C166.102249,165.033386 166.959518,160.921555 164.134537,156.022842 C162.157837,152.595093 161.014969,148.686508 159.161896,144.300629 z"}),(0,l.jsx)("path",{fill:"#FCFEFD",opacity:1,stroke:"none",d:" M159.330811,144.646652 C161.014969,148.686508 162.157837,152.595093 164.134537,156.022842 C166.959518,160.921555 166.102249,165.033386 162.204178,168.482956 C158.010895,172.193756 158.640030,175.338043 161.641464,179.587280 C168.560989,189.383530 177.255371,196.732590 188.234161,201.544495 C191.249756,202.866211 193.532318,203.093781 195.495682,200.059845 C196.301865,198.814072 197.431046,197.781570 198.366028,196.614182 C203.863739,189.749985 202.134613,189.813538 210.844025,193.606903 C213.584717,194.800613 216.319427,196.081421 218.857986,197.645233 C221.393539,199.207153 225.255310,200.818695 225.754288,203.034790 C226.861237,207.950836 225.301636,212.948212 221.218109,216.594635 C213.684128,223.322174 205.004898,224.438538 195.540466,221.815857 C175.066055,216.142273 159.314850,203.807953 147.247849,186.742218 C142.985977,180.714874 139.180939,174.036118 136.794312,167.095337 C133.889008,158.646042 135.938049,150.491486 141.936844,143.335083 C145.465286,139.125748 149.758347,138.185654 154.415009,139.308472 C156.289551,139.760483 157.596588,142.566147 159.330811,144.646652 z"})]})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},609392:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.WarningIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=18,h=20;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"warning"},p),{},{children:(0,l.jsx)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 20 18",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),fill:"none",children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.5301 17.5046C19.0701 17.5046 20.0301 15.8346 19.2601 14.5046L11.7301 1.49457C10.9601 0.16457 9.04012 0.16457 8.27012 1.49457L0.740121 14.5046C-0.0298788 15.8346 0.930121 17.5046 2.47012 17.5046H17.5301ZM10.0001 10.5046C9.45012 10.5046 9.00012 10.0546 9.00012 9.50457V7.50457C9.00012 6.95457 9.45012 6.50457 10.0001 6.50457C10.5501 6.50457 11.0001 6.95457 11.0001 7.50457V9.50457C11.0001 10.0546 10.5501 10.5046 10.0001 10.5046ZM9.00012 12.5046V14.5046H11.0001V12.5046H9.00012Z",fill:"currentColor"})})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},992934:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.XAltIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=24,h=24;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"x-alt"},p),{},{children:(0,l.jsx)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 24 24",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 24 24",xmlSpace:"preserve",children:(0,l.jsx)("path",{fill:"currentColor",d:"M17.25,7.8L16.2,6.75l-4.2,4.2l-4.2-4.2L6.75,7.8l4.2,4.2l-4.2,4.2l1.05,1.05l4.2-4.2l4.2,4.2l1.05-1.05 l-4.2-4.2L17.25,7.8z"})})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},341386:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.XIcon=function(e){var t;const{iconXstyle:n,height:r,width:c,viewBox:d}=e,p=(0,a.default)(e,u);let _;if(d){const{x:e=0,y:t=0,width:n=0,height:r=0}=d;_=[e,t,n,r].join(" ")}let f=24,h=24;null==r&&null==c||(f=r,h=c);return(0,l.jsx)(o.BaseSvgSpan,(0,i.default)((0,i.default)({name:"x"},p),{},{children:(0,l.jsx)("svg",{viewBox:null!==(t=_)&&void 0!==t?t:"0 0 24 24",height:f,width:h,preserveAspectRatio:"xMidYMid meet",className:(0,s.default)(n),fill:"currentColor",enableBackground:"new 0 0 24 24",xmlSpace:"preserve",children:(0,l.jsx)("path",{d:"M19.6004 17.2L14.3004 11.9L19.6004 6.60005L17.8004 4.80005L12.5004 10.2L7.20039 4.90005L5.40039 6.60005L10.7004 11.9L5.40039 17.2L7.20039 19L12.5004 13.7L17.8004 19L19.6004 17.2Z"})})}))};var i=r(n(81109)),a=r(n(506479)),o=n(615647),s=r(n(156720)),l=n(785893);const u=["iconXstyle","height","width","viewBox"]},390737:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ToastPosition=t.ToastManager=void 0;var i=r(n(395654));const a=n(76672)({LEFT:"LEFT",CENTER:"CENTER",RIGHT:"RIGHT"});t.ToastPosition=a;class o extends i.default{open(e,t){this.trigger("open_toast",e,t)}close(e){this.trigger("close_toast",e)}}const s=new o;t.ToastManager=s},91640:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ToastManagerComponent=function(){const e=(0,m.default)((()=>new Map)),t=(t,n)=>{n?e.current.set(t,n):e.current.delete(t)},n=(0,m.default)((()=>new c.default(t))),r=(0,h.useRef)(null),[v,A]=(0,h.useState)({}),C=(0,E.default)(v),P=(t,n)=>{const r=t.props.id,a=e.current.get(r);var o;a?null===(o=a.restartDelay)||void 0===o||o.call(a):A((0,i.default)((0,i.default)({},v),{},{[r]:{toast:t,position:n}}))};(0,y.useListener)(p.ToastManager,"open_toast",P),(0,y.useListener)(p.ToastManager,"close_toast",(e=>{v[e]&&A((0,o.default)(v,e))}));(0,y.useListener)(null,"window_error",(e=>{const t=e.length>200?`${e.slice(0,200)}...`:e;P((0,S.jsx)(d.Toast,{msg:`🛑 ${t}`,id:(0,d.genId)(),action:[{actionText:"Copy",onAction:()=>{(0,s.default)(e)}},{actionText:"Report",onAction:()=>{(0,u.openBugReportForm)(e)}}]}))})),(0,y.useListener)(null,"ping_sent",(e=>{P((0,S.jsx)(d.Toast,{msg:e,id:(0,d.genId)()}))})),(0,h.useEffect)((()=>{r.current=Object.keys(null!=C?C:{}).length>Object.keys(v).length}),[v,C]);const O=r.current,I=(0,a.default)(v,["toast","id"]).reverse().map(((e,t)=>{let{toast:r,position:i}=e;return(0,S.jsx)("div",{className:(0,g.default)(T.wrapper,i===p.ToastPosition.CENTER&&T.center,i===p.ToastPosition.RIGHT&&T.right,0===t&&O&&T.slide0,1===t&&T.slide1,2===t&&T.slide2,t>=3&&T.slide3),children:(0,S.jsx)("div",{className:(0,g.default)(i===p.ToastPosition.CENTER&&(l.default.isRTL()?T.transformRight:T.transformLeft)),children:(0,h.cloneElement)(r,{ref:n.current.getRefSetter(r.props.id)})})},r.props.id)})),M=_.UA.isTrident?"fade_sifo":"toast-transition";return(0,S.jsx)(f.default,{transitionName:M,children:I})};var i=r(n(81109)),a=r(n(189734)),o=r(n(957557)),s=(n(780549),r(n(719838))),l=r(n(932325)),u=n(615459),c=r(n(359599)),d=n(625786),p=n(390737),_=n(368170),f=r(n(844453)),h=n(667294),g=r(n(156720)),m=r(n(470649)),y=n(148725),E=r(n(207100)),S=n(785893);const T={slide0:{transform:"qdd0en2n"},slide1:{transform:"gqonocmn"},slide2:{transform:"b5bqnu92"},slide3:{opacity:"axi1ht8l",transform:"j7iro104"},wrapper:{opacity:"bs7a17vp",bottom:"jxacihee",lineHeight:"d53pemmv",marginTop:"fgtikrv0",marginEnd:"gqi0zhd6",marginBottom:"dblt22a0",marginStart:"nzcjdldu",minHeight:"ocs0cmsa",position:"lhggkp7q",zIndex:"pglj95m3",transition:"byw3xhqn"},center:{start:"m7kgcvyw",marginStart:"svoq16ka",marginEnd:"jnwc1y2a",maxWidth:"culzvsue"},transformLeft:{transform:"t9w6h8zt"},transformRight:{transform:"ajuzgosp"},right:{end:"ebjesfe0"}}},238669:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.UIMState=t.UIM=void 0;var i=r(n(84753)),a=r(n(82729)),o=r(n(953268));const s=n(76672).Mirrored(["ACTIVE","PASSIVE","INACTIVE","DEAD"]);t.UIMState=s;class l{static maybePreventScroll(e){var t;const n=null===(t=l.Manager.getTop())||void 0===t?void 0:t.getNode();e.target instanceof HTMLElement&&n&&!n.contains(e.target)&&(e.preventDefault(),e.stopPropagation())}constructor(e,t){this.shouldRequestFocus=!0,this.parent=t||this,t||(l.Manager.root&&(__LOG__(4,void 0,new Error,!0)`Attempting to set multiple UIM tree roots. Expecting only one.`,SEND_LOGS("multiple-uim-roots")),l.Manager.root=this),this.displayName=e.displayName,this.popable=e.popable,this.escapable=e.escapable,this.requestFocus=e.requestFocus,this.requestDismiss=e.requestDismiss,this.getNode=e.getNode,this.dismissOnWindowResize=e.dismissOnWindowResize,this.children=[],this.setState(e.uimState)}getState(){return this._state}setState(e){switch(e){case s.ACTIVE:this.lastActive=Date.now(),l.Manager.setTop(this);break;case s.PASSIVE:this.lastActive=Date.now(),this._state!==s.ACTIVE&&l.Manager.setTop(l.findMostRecentlyActiveFocusable());break;case s.INACTIVE:this._state&&this._state!==e&&l.Manager.setTop(l.findMostRecentlyActiveFocusable());break;case s.DEAD:}this._state=e}activate(){this.setState(this._state)}branch(e){const t=new l(e,this);return this.children.push(t),l.pprint(),t}pop(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.getState()===s.DEAD)return;this._invalidateAndDismissChildren(this.children,e),(0,a.default)(this.parent.children,(e=>e===this));const n=l.findMostRecentlyActiveFocusable(this);n&&(n.shouldRequestFocus=t),l.Manager.setTop(n),l.pprint()}_invalidateAndDismissChildren(e,t){e.forEach((e=>{e.setState(s.DEAD),e.requestDismiss(t),this._invalidateAndDismissChildren(e.children,t)}))}static findMostRecentlyActiveFocusable(e){const{root:t}=l.Manager;if(t)return u(t,e,(e=>{const t=e.getState();return t===s.ACTIVE||t===s.PASSIVE}))}static findMostRecentlyActiveDismissable(e){const{root:t}=l.Manager;if(t)return u(t,e,(e=>e.getState()===s.ACTIVE))||u(t,e,(e=>e.getState()===s.PASSIVE))}static pprint(e){if(!e&&!l.Manager.verbose)return;const{root:t}=l.Manager;t&&__LOG__(2)`${d(t,[])}`}}function u(e,t,n){if(!e.children.length)return e;const r=e.children.filter((e=>e!==t)).map((e=>u(e,t,n))).concat([e]).filter(Boolean).filter(n);return(0,i.default)(r,"lastActive")}t.UIM=l,l.State=s,l.Manager=new class{constructor(){this.verbose=!1}setTop(e){var t;e&&(e.lastActive=Date.now()),e&&this._top!==e&&e.getState()!==s.INACTIVE&&e.getState()!==s.DEAD&&e.shouldRequestFocus&&e.requestFocus(),e&&(e.shouldRequestFocus=!0),(null===(t=this._top)||void 0===t?void 0:t.popable)&&window.removeEventListener("wheel",l.maybePreventScroll,{passive:!1,capture:!0}),(null==e?void 0:e.popable)&&window.addEventListener("wheel",l.maybePreventScroll,{passive:!1,capture:!0}),this._top=e}getTop(){return this._top}refocusTopUie(){setTimeout((()=>{null!=this._top&&document.activeElement===document.body&&this._top.requestFocus()}),0)}};function c(e,t,n,r){let i;i=n&&r?"├─┬":n&&!r?"├──":!n&&r?"└─┬":"└──",e===l.Manager.root&&(i="▶");let a=e.displayName;e===l.Manager.getTop()&&(a=`${a} ⬥`);const o=`(${function(e){switch(e){case s.ACTIVE:return"A";case s.PASSIVE:return"P";case s.INACTIVE:return"I";case s.DEAD:return"D"}}(e.getState())})${r?"\n":""}`;return`${t.join("")}${i} ${a} ${o}`}function d(e,t,n){return c(e,t,n,!!e.children.length)+e.children.map(((r,i)=>{const a=i<e.children.length-1;return d(r,n?t.concat(["│ "]):t.concat([" "]),a)})).join("\n")}window.addEventListener("keydown",(e=>{if(e.keyCode!==o.default.ESC)return;const t=l.Manager.getTop(),n=(null==t?void 0:t.getState())===s.ACTIVE?t:l.findMostRecentlyActiveDismissable();(null==n?void 0:n.escapable)&&(e.stopPropagation(),e.preventDefault(),n.requestDismiss(!1))}),{capture:!0}),window.addEventListener("resize",(()=>{const e=l.Manager.getTop(),t=(null==e?void 0:e.getState())===s.ACTIVE?e:l.findMostRecentlyActiveDismissable();(null==t?void 0:t.dismissOnWindowResize)&&(null==t?void 0:t.escapable)&&t.requestDismiss(!1)}));let p=null;function _(e,t){const n=e&&e.getState()===s.ACTIVE&&e.popable?e:l.findMostRecentlyActiveDismissable();if(!n||!n.popable)return null;const r=n.getNode();return r&&t.target instanceof Node&&r.contains(t.target)?null:n}window.addEventListener("mousedown",(e=>{if(p=null,!e.screenX||!e.screenY)return;const t=_(l.Manager.getTop(),e);t&&2===e.button?t.requestDismiss():p=t}),{capture:!0}),window.addEventListener("mouseup",(e=>{if(!e.screenX||!e.screenY)return void(p=null);const t=_(l.Manager.getTop(),e);t&&t===p&&setTimeout((()=>t.requestDismiss()),0),p=null}),{capture:!0})},8073:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=(0,n(667294).createContext)(null);t.default=r},392632:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.UIE=void 0;var i=n(238669),a=r(n(8073)),o=n(667294),s=r(n(470649)),l=r(n(864135)),u=r(n(28916)),c=r(n(155793)),d=r(n(189957)),p=n(785893);let _=null;const f=(0,o.forwardRef)(((e,t)=>{const{uimState:n=i.UIMState.ACTIVE,requestRecentFocusOnUnmount:r=!0,popable:f=!1,escapable:h=!1,displayName:g,children:m,dismissOnWindowResize:y=!1}=e,E=(0,c.default)(),S=function(e){const t=(0,d.default)(),n=(0,o.useRef)(!1),r=(0,o.useRef)(null),i=()=>{e&&(_&&clearTimeout(_),r.current=_=setTimeout((()=>{e(),r.current=_=null}),0))},a=(0,u.default)((()=>{e&&!t.aborted?i():n.current=!0}));return(0,o.useEffect)((()=>(n.current&&i(),()=>{_&&r.current===_&&(clearTimeout(_),_=null)})),[]),a}(e.requestFocus),T=(0,u.default)(e.requestDismiss),v=(0,o.useRef)(null),A=(0,o.useCallback)((()=>{const e=v.current;if(null!=e)return e instanceof HTMLElement?e:e.getElement()}),[]),C=(0,s.default)((()=>{var e;const t={displayName:g,popable:f,escapable:h,uimState:n,requestFocus:S,requestDismiss:T,getNode:A,dismissOnWindowResize:y};return null!==(e=null==E?void 0:E.branch(t))&&void 0!==e?e:new i.UIM(t)}));if((0,o.useEffect)((()=>{C.current.setState(n)}),[n,C]),(0,l.default)((()=>{C.current.pop(!0,r)})),(0,o.useImperativeHandle)(t,(()=>({activate(){C.current.activate()},getElement:A}))),!m)return null;const P=(0,o.cloneElement)(m,{ref:e=>{var t,n;const r=null!==(t=null==e||null===(n=e.getComponent)||void 0===n?void 0:n.call(e))&&void 0!==t?t:e;v.current=r;const i=m.ref;i&&("function"==typeof i?i(r):i.current=r)}});return(0,p.jsx)(a.default.Provider,{value:C.current,children:P})}));t.UIE=f,f.displayName="UIE"},114078:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(667294),i=n(785893),a=(0,r.forwardRef)((function(e,t){let{children:n}=e;const a=(0,r.useRef)();return(0,r.useImperativeHandle)(t,(()=>({getElement:()=>a.current}))),(0,i.jsx)("div",{ref:a,children:n})}));t.default=a},37875:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(132375)),a=n(780549),o=n(667294),s=r(n(155793));function l(e,t){const{contextMenu:n}=e,r=(0,s.default)(),l=(0,o.useRef)(null);(0,o.useEffect)((()=>(a.Cmd.openContextMenu({menuOptions:n,uim:(0,i.default)(r,"uim")},(e=>{l.current=e})),()=>{a.Cmd.closeContextMenu(r)})),[]);const u=()=>l.current;return(0,o.useImperativeHandle)(t,(()=>({getElement:u}))),null}var u=(0,o.forwardRef)(l);t.default=u},877171:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ComposeBoxActions=void 0;var i=r(n(395654)),a=n(411067);class o extends i.default{focus(e){const t=(0,a.unproxy)(e);t?this.trigger("focus_"+t.id.toString()):this.trigger("focus")}send(e){const t=(0,a.unproxy)(e);this.trigger("send_"+t.id.toString())}paste(e,t){const n=(0,a.unproxy)(e);this.trigger("paste_"+n.id.toString(),t)}sendPaste(e,t){const n=(0,a.unproxy)(e);this.trigger("send_paste_"+n.id.toString(),t)}toggleQuickReplies(){this.trigger("toggle_quick_replies")}addMsgSendingLogAttributes(e,t){this.trigger("add_sending_log_attributes_"+e.id.toString(),t)}setCtwaContextLinkData(e,t){this.trigger("set_ctwa_context_link_data_"+e.id.toString(),t)}}const s=new o;t.ComposeBoxActions=s},116594:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.LargeEmoji=function(e){const{emoji:t,size:n=v.MEDIUM,animation:r=!1,element:d="div",selectable:p,xstyle:A}=e,C=(0,g.default)(),P=(0,f.useCallback)((()=>{const t=y(e.emoji);return Boolean(null!=t&&T(t))}),[e.emoji]),[O,I]=(0,f.useState)(P);(0,f.useEffect)((()=>{I(P())}),[C,P]);const M=(0,_.default)((0,s.cx)({[c.default.medium]:n===v.MEDIUM,[c.default.large]:n===v.LARGE,[c.default.xlarge]:n===v.XLARGE}));let b;b=n===v.XLARGE||"high"===i.default.currentRes?64:40;const R=E(t,b);if(null==R)return null;if(O&&r)return(0,m.jsxs)(d,{className:(0,_.default)(c.default.animation,(0,h.default)(A)),children:[(0,m.jsx)(o.SelectableImg,{alt:t,className:(0,_.default)(c.default.highRes,M),draggable:!1,plainText:t,selectable:Boolean(p),src:a.default.ONE_BY_ONE_TRANS_GIF}),(0,m.jsx)(u.default,{className:(0,_.default)(c.default.highRes,M,c.default.heartbeat),draggable:!1,selectable:!1,src:R})]});const N=O?void 0:(0,m.jsx)(l.default,{className:(0,_.default)(c.default.lowRes,M),emoji:t,xstyle:A,selectable:p},"low-res"),w=(0,m.jsx)(l.default,{className:(0,_.default)(c.default.highRes,M,(0,s.cx)({[c.default.invisible]:!O})),emoji:t,xstyle:A,selectable:p,src:R,onLoad:()=>{const e=y(t);null!=e&&S(e),I(!0)}},"high-res");return(0,m.jsxs)("span",{className:c.default.wrapper,children:[N,w]})},t.SIZE=void 0;var i=r(n(861474)),a=r(n(846870)),o=n(306703),s=n(113704),l=r(n(225148)),u=r(n(488922)),c=r(n(430157)),d=n(429334),p=n(224007),_=r(n(120992)),f=n(667294),h=r(n(156720)),g=r(n(976353)),m=n(785893);const{getGlyphId:y,getGlyphPath:E,markGlyphCached:S,isGlyphCached:T}=d.EmojiUtil,v=p.LARGE_EMOJI_SIZE;t.SIZE=v},145632:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const{theme:t,wid:n}=e,[r,m]=(0,_.useState)(null),[y,E]=(0,_.useState)(null),S=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};m(e.img)},T=(0,h.default)();if((0,_.useEffect)((()=>{n&&c.ProfilePicThumbCollection.find(n).then((e=>(0,i.delayMs)(0).then((()=>e)))).then((e=>{T.aborted||(E(e),S(e))})).catch((()=>{}))}),[]),(0,f.useListener)(y,"change:img",S),r&&e.wid)return(0,g.jsx)(l.DetailImage,{id:e.wid,quoted:e.quoted,size:e.size,shape:e.shape,border:e.border,quality:e.quality});let v;v="number"==typeof e.size&&0!==e.size||"number"!=typeof e.size&&null!=e.size?e.size:l.DetailImageSize.Small;const A=(0,l.getSize)(v)||void 0,C=e.thumbs?e.thumbs:[e.thumb],P=C.map(((t,n)=>{if(t)return(0,g.jsx)("img",{className:d.default.image,src:t,alt:""},n);const r=A&&A/(C.length>2&&n>0?2:1),i=!0===e.quoted?s.DefaultUserSquareIcon:o.DefaultUserIcon;return(0,g.jsx)(u.FlexRow,{className:d.default.default,justify:"center",align:"center",children:(0,g.jsx)(i,{style:{width:r,height:r},className:d.default.icon})},n)}));let O;O=1===P.length?P[0]:2===P.length?(0,g.jsxs)(u.FlexRow,{className:d.default.row,justify:"stretch",align:"stretch",children:[P[0],P[1]]}):(0,g.jsxs)(u.FlexRow,{className:d.default.row,justify:"stretch",align:"stretch",children:[P[0],(0,g.jsxs)(u.FlexColumn,{className:d.default.col,justify:"stretch",align:"stretch",children:[P[1],P[2]]})]});return(0,g.jsx)(u.FlexRow,{className:(0,p.default)(d.default.container,(0,a.cx)({[d.default.square]:e.shape===l.DetailImageShape.Square,[d.default.hasBorder]:e.border,[d.default.hasInnerBorder]:"voip"===t||"voip-dimmed"===t,[d.default.hasLargeInnerBorder]:"voip-large"===t||"voip-large-dimmed"===t,[d.default.dimmed]:"voip-dimmed"===t||"voip-large-dimmed"===t})),style:{width:A,height:A},children:O})};var i=n(36530),a=n(113704),o=n(412213),s=n(273415),l=n(23641),u=n(690495),c=n(292390),d=(n(890213),r(n(88137))),p=r(n(120992)),_=n(667294),f=n(148725),h=r(n(189957)),g=n(785893)},860888:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.STATUS_IMAGE_RATIO_THRESHOLD=t.HQ_PREVIEW_LIFESPAN=void 0,t.displayHighQualityLinkPreview=function(e,t){if(!Boolean(e.thumbnailDirectPath||e.thumbnailHQ)||null==e.thumbnailHeight||null==e.thumbnailWidth)return!1;if(o(e.t))return!1;if(t===i.DISPLAY_TYPE.GALLERY)return!1;if(t===i.DISPLAY_TYPE.STATUS&&null!=e.thumbnailHeight&&null!=e.thumbnailWidth)return e.thumbnailWidth/e.thumbnailHeight>=1.4;return!0},t.hqLinkPreviewExpired=o;var r=n(990445),i=n(356097);const a=2592e3;function o(e){return(0,r.unixTime)()-e>a}t.HQ_PREVIEW_LIFESPAN=a;t.STATUS_IMAGE_RATIO_THRESHOLD=1.4},328861:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=(0,n(667294).createContext)(null);t.default=r},513922:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.emojiPrefixHash=void 0;t.emojiPrefixHash="2617e32ba41ae37a81350005624747b8"},224007:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VARIATION_CATEGORY=t.ORDERED_CATEGORY_IDS=t.LARGE_EMOJI_SIZE=t.HEART_EMOJIS=t.EMOJI_WIDTH=t.EMOJI_TYPE=t.CATEGORY_ORDERING=t.CATEGORY_MAPPING=t.CATEGORIES=t.BUCKET_SIZE=void 0;t.BUCKET_SIZE=25;t.CATEGORIES={SMILEYS_PEOPLE:"SMILEYS_PEOPLE",ANIMALS_NATURE:"ANIMALS_NATURE",FOOD_DRINK:"FOOD_DRINK",ACTIVITY:"ACTIVITY",TRAVEL_PLACES:"TRAVEL_PLACES",OBJECTS:"OBJECTS",SYMBOLS:"SYMBOLS",FLAGS:"FLAGS"};t.CATEGORY_MAPPING={"Smileys & People":"SMILEYS_PEOPLE","Animals & Nature":"ANIMALS_NATURE","Food & Drink":"FOOD_DRINK",Activity:"ACTIVITY","Travel & Places":"TRAVEL_PLACES",Objects:"OBJECTS",Symbols:"SYMBOLS",Flags:"FLAGS"};const r=["SMILEYS_PEOPLE","ANIMALS_NATURE","FOOD_DRINK","ACTIVITY","TRAVEL_PLACES","OBJECTS","SYMBOLS","FLAGS"];t.ORDERED_CATEGORY_IDS=r;t.EMOJI_TYPE={APPLE:"APPLE",WHATSAPP:"WHATSAPP"};t.EMOJI_WIDTH={small:20,large:32};const i=n(76672).Mirrored(["MEDIUM","LARGE","XLARGE"]);t.LARGE_EMOJI_SIZE=i;const a=[...r,"VARIATION"];t.CATEGORY_ORDERING=a;const o=a.indexOf("VARIATION");t.VARIATION_CATEGORY=o;t.HEART_EMOJIS=["❤️","♥️","🤎","💖","🖤","💚","💜","💗","💓","💙","🤍","💛","💕","🧡","❤️‍🔥"]},356451:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.emojiKeywordToUnicodeSearch=function(e){return(0,f.emojiSearch)(e,(0,l.default)(g,"Emoji Trie expected to be loaded."))},t.updateEmojiTrie=E;var i=r(n(348926)),a=r(n(944908)),o=r(n(98017)),s=n(989211),l=r(n(132375)),u=n(36530),c=n(962833),d=r(n(799132)),p=r(n(932325)),_=n(841273),f=n(707149);const h=new Set(["ar","bn","cs","de","en","es","fa","fr","gu","he","hi","hu","id","it","mr","ms","nl","pl","pt","pt-BR","ro","ru","sk","th","tr","uk","ur","zh-CN","zh-TW","zh-HK"]);let g=null;let m=null,y=[];function E(){const e=(0,a.default)(["en",p.default.getLocale()]).filter((e=>h.has(e)));if((0,o.default)(y,e))return;y=e;const t=Promise.all(e.map((e=>function(e){return(0,c.promiseLoop)(function(){var t=(0,i.default)((function*(t,r,i){const a=(0,u.delayMs)((0,s.expBackoff)(i,12e4,1e3,.1));let o=yield n(826299)(`./${e}`);try{const[,,e]=yield o.default();return t(e)}catch(e){return a}}));return function(){return t.apply(this,arguments)}}()).catch((()=>({})))}(e)))).then((e=>{m===t&&(g=(0,f.emojiLocaleDictsToTrie)(e))})).catch((()=>{})).finally((()=>{m===t&&(m=null)}));m=t}p.default.on("locale_change",(()=>{E()})),(0,d.default)(_.Stream,"change:mode",(()=>_.Stream.mode===_.StreamMode.MAIN)).then((()=>{E()}))},707149:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.emojiLocaleDictsToTrie=function(e){let t=e[0];e.length>1&&(t=(0,i.default)((0,i.default)({},t),e[1]));return function(e,t){const n=p.default.fromForwardsStrings(e.map((e=>e[t])),e);return{getMatches:e=>n.search(e)}}((0,a.default)(t,((e,t)=>{const n=t.toLowerCase(),r=n.substring(0,5);return{value:e,keyword:n,shortKeyword:r}})),"shortKeyword")},t.emojiSearch=function(e,t){let n=[];if(e){const r=function(e,t){const n=function(e,t){if(!t)return[];if(e.length<=5)return t.getMatches(e);const n=e.substring(0,5).trim();let r=t.getMatches(n);return r=(0,c.default)(r,(t=>t.keyword.startsWith(e))),r}(e,t),r=m((0,u.default)(n,(e=>e.value))),i=m((0,u.default)(n.filter((t=>t.keyword===e)),(e=>e.value))),a=(0,l.default)(m(_.RecentEmojiCollection.map((e=>e.id))),r),o=(0,l.default)(m(h),r),d=(0,l.default)((0,s.default)(a,o),i);return(0,s.default)(d,E(i),a,o,E(r))}(e.toLowerCase(),t);n=(0,d.default)(r)}return n};var i=r(n(81109)),a=r(n(435161)),o=r(n(751463)),s=r(n(393386)),l=r(n(225325)),u=r(n(594654)),c=r(n(763105)),d=r(n(944908)),p=r(n(478102)),_=n(896472),f=n(429334);const h=["😂","🤣","❤","🥺","🥰","😘","😭","😍","😁","🙏","😅","😆","😊","🙂","😔","🥳","😒","☺","🎂","👍","💖","😢","🙄","😏","😎","💋","😞","😉","👏","🙃","😡","😀","😄","😇","🤩","😌","🤔","🌹","😋","💗","🤗","💕","💔","😚","☹","😃","🎉","🔥","🥴","😳"],g=["SMILEYS_PEOPLE","ANIMALS_NATURE","FOOD_DRINK","ACTIVITY","TRAVEL_PLACES","OBJECTS","SYMBOLS","FLAGS","VARIATION"];function m(e){return e.map(f.EmojiUtil.normalizeEmoji).filter(Boolean)}const y=(0,o.default)((()=>{const e=new Map;let t=0;for(const n of g){const r=f.EmojiUtil.getEmojisInCategory(n);for(const n of r)e.set(n,t),t++}return e}));function E(e){const t=y();return[...e].sort(((e,n)=>{var r,i;return(null!==(r=t.get(e))&&void 0!==r?r:Number.MAX_SAFE_INTEGER)-(null!==(i=t.get(n))&&void 0!==i?i:Number.MAX_SAFE_INTEGER)}))}},725872:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={APPLE:["32a30af","3a7e53f","ec6bb14","94a2e21","8c21a8c","b0507cf","befc1d0","ebb7a96","00a5124","aa6eedf","e902c0e","344f6c1","f40657c","74753d0","fe9dcb9","cc8364d","d83de91","44bdba6","28e9240","6448baf","a01adcb","757927d","7549f4c","c0b9305","1966597","e2dc05e","d254460","e8ae21f","b83ef0f","2193ddc","696bb37","c89d3de","1f309a5","a447d85","4888034","b1a0476","3fb07ef","2162be9","fc63eef","fad8dca","653542d","ac37ddd","12838c0","532aaee","aafbaf4","6a7d3d1","5683c13","57fc08c","d89e349","12ff63a","d4c24f6","719c98c","3878383","7b154af","1d58fe9","8ce9e32","d92f0cb","97ada66","8c20533","0920b1e","16f40bc","ffe54b9","7bdda7b","26b497d","20d4f7c","0e773a4","62606a7","415eb03","d2b8fa3","66ea70f","6aeefba","8160b69","e584edf","502bcd5","6a46b87","79049b2","7d94a64","8ac9d05","6ca633b","f8c49e4","4b2c635","4de91aa","ce2cfdf","0f75930","f207bb2","749317b","c7279c3","5167ad7","1281297","a2d9288","49d2787","bb7fe67","ada8625","24f0522","445645a","e2989ad","c161968","01b04da","d44de1e","45780e0","c9dcb02","ebbdba4","120d9f5","a02c535","94b66bb","6eb4719","f9c18da","91132ba","68b9217","5e4a4d8","e934172","45c6790","7395b9b","8d949b0","cc03e24","bf93019","c9e6acd","50c81e4","034b464","0dd9a97","3447a33","8fda624","4485d1a","f9f2aa7","d0054de","04b3171","ffdf3e5","e77f0f2","7a2ec61","2b902cc","24294b3","111eb5c","4c43927","d865fac","2569644","8ed708f","be1db04","f63258c","8a82267","5306cdc","0525c28","dfe814f","f979eac","0fb12d2","1e5b446","5a1cff9"],WHATSAPP:["5acfb0b","8b08ff4","ed53db9","b11078f","78639f7","cf53449","1de31e0","e239476","9f8e3ba","4ab3ac1","752facf","6b95d49","d9c6a60","fee0e88","d64c38c","5a05f43","ef5204c","4556c67","238de89","18ef0e5","5566f14","70e0482","1267b03","ad22422","e6343e5","aa1b7c4","3ea7a20","bc0a084","794fe85","840ee23","9f9ff3a","b71d330","765d209","f8bc50b","95b0aa0","b96bb59","bcf821b","e3230b6","27114fe","deaed36","c505ee2","203058a","9dce20f","ebb6125","b7d55b2","dcc1550","f9e9329","53cf97d","0298390","b592ceb","b6820c8","2ff4c5b","5cdb802","9ea6b52","7ddf68a","c37eb5e","303d753","8d4de3d","fc9c637","80c3581","2493ae4","17e20f1","eef8b24","f067ff0","8732587","8f39da8","d74d5c0","bc349d2","366d240","d35c5cd","8793169","959a828","3a735aa","bacaeba","d2c8697","51d393b","d2ab53e","7281b3b","df3a2b5","94aabbd","826b5e7","cfa013d","16f44b7","31cc406","9fe4994","129f5ca","2c85b8c","8c08f48","f4a6a53","b07ea77","bfe3df4","3a3044c","392e1a7","5b3b0e0","3ab7358","88e0e67","d154eda","3bf0eb9","88dc6b2","e15ae1c","d48ed26","00b60ba","6861794","8eeb509","d252d87","3614d2b","7796ea9","e88d6f1","ef68e3c","acc22ba","fa5e529","dec013f","9ac620c","dcba913","b2087de","4705da5","e1c1dd9","194ba5c","a0cbfd7","892e8b7","a213123","848e79e","538da3d","d0b83e6","188268a","e98933e","2e69ed7","1d7d7fd","c3216b8","22b551e","e101502","5a941ba","a0b6e70","388edcb","23b2a4b","58993c4","8b99645"]}},87566:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getEmojiSpritesPath=function(e,t,n,r){const a=(0,i.default)(o.default[e][t],"emojiSpriteHashes[emojiType][bucketId]");return`${l}/emoji-${t}-${n}_${a}.${r}`},t.getGlyphPath=function(e,t,n){return function(e,t){let n=null;return n=s,`${n}/${a.emojiPrefixHash}_${t.toLowerCase().slice(0,1)}_${e}`}(`${t}-${n}.png`,e)};var i=r(n(132375)),a=n(513922),o=r(n(725872));const s="/img",l="/img"},696939:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEmojiSpritesExperimentalPath=function(e,t,n,r){return o("sprite",e,n,`${t}.${r}`)},t.getGlyphExperimentalPath=function(e,t,n){return function(e,t,n,r){const i=function(e){return Array.from(e).map((e=>e.codePointAt(0).toString(16).padStart(6,"0"))).join("_")}(e);return o("single",n,t,`${i}.${r}`)}(e,n,t,"png")};const n="https://web.whatsapp.com/emoji/v1",r=0,i=0,a=0;function o(e,t,o,s){return[n,r,i,a,e,t.toLowerCase().slice(0,1),o,s].join("/")}},429334:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getPermutations=t.WOMEN_HOLDING_HANDS=t.WOMAN_AND_MAN_HOLDING_HANDS=t.PEOPLE_HOLDING_HANDS=t.OPEN_BOX_CHAR=t.MEN_HOLDING_HANDS=t.KISS_WOMAN_WOMAN=t.KISS_WOMAN_MAN=t.KISS_PERSON_PERSON=t.KISS_MAN_MAN=t.KISS=t.HANDSHAKE=t.EmojiUtil=t.COUPLE_WITH_HEART_WOMAN_WOMAN=t.COUPLE_WITH_HEART_WOMAN_MAN=t.COUPLE_WITH_HEART_PERSON_PERSON=t.COUPLE_WITH_HEART_MAN_MAN=t.COUPLE_WITH_HEART=void 0,t.isBaseMultiSkinToneEmoji=function(e){return L.has(e)};var i=r(n(288306)),a=r(n(568588)),o=r(n(132375)),s=r(n(624487)),l=n(97858),u=n(224007),c=n(87566),d=n(696939),p=r(n(254552)),_=r(n(441143)),f=r(n(120992)),h=r(n(257008));t.OPEN_BOX_CHAR="□";const g=["🏻","🏼","🏽","🏾","🏿"],m=new RegExp(g.join("|"),"g"),y="🧑‍🤝‍🧑";t.PEOPLE_HOLDING_HANDS=y;const E="👭";t.WOMEN_HOLDING_HANDS=E;const S="👬";t.MEN_HOLDING_HANDS=S;const T="👫";t.WOMAN_AND_MAN_HOLDING_HANDS=T;const v="👩‍❤️‍💋‍👨";t.KISS_WOMAN_MAN=v;const A="👩‍❤️‍💋‍👩";t.KISS_WOMAN_WOMAN=A;const C="👨‍❤️‍💋‍👨";t.KISS_MAN_MAN=C;const P="🧑‍❤️‍💋‍🧑";t.KISS_PERSON_PERSON=P;const O="💏";t.KISS=O;const I="👩‍❤️‍👨";t.COUPLE_WITH_HEART_WOMAN_MAN=I;const M="👩‍❤️‍👩";t.COUPLE_WITH_HEART_WOMAN_WOMAN=M;const b="👨‍❤️‍👨";t.COUPLE_WITH_HEART_MAN_MAN=b;const R="🧑‍❤️‍🧑";t.COUPLE_WITH_HEART_PERSON_PERSON=R;const N="💑";t.COUPLE_WITH_HEART=N;const w="🤝";t.HANDSHAKE=w;const L=new Set([y,E,S,T,v,A,C,O,I,M,b,N,w]),D=u.HEART_EMOJIS.map((e=>e)),k=new Set(["","","","","","","","","","","","","","","",""]),U=e=>e.replace(/\uFE0F/g,""),G=(0,i.default)(((e,t)=>function n(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(r.length===t)return[r];let i=[];for(let t=0;t<e.length;t++){const a=[...r];a.push(e[t]),i=i.concat(n(a))}return i}()),((e,t)=>e.toString()+t));t.getPermutations=G;function x(e){return e.every((t=>t===e[0]))?e[0]:e.join("")}const B=new class{constructor(){var e=this;this.skinToneVariations=g,this.emojiRegex=()=>{const e=this._createEmojiRegexIfNeeded();return e.lastIndex=0,e},this._createEmojiRegexIfNeeded=(0,s.default)((()=>{const e=this._getEmojiRegexSource();return new RegExp("("+e+")","g")})),this.onlyEmojiRegex=()=>{const e=this._createOnlyEmojiRegexIfNeeded();return e.lastIndex=0,e},this._createOnlyEmojiRegexIfNeeded=(0,s.default)((()=>{const e=this._getEmojiRegexSource();return new RegExp("^("+e+")+$","g")})),this.splitEmojis=e=>!1===this.containsOnlyEmoji(e)?null:e.split(this.emojiRegex()).filter(Boolean),this.containsEmoji=e=>this.emojiRegex().test(e),this.containsOnlyEmoji=e=>this.onlyEmojiRegex().test(e),this.matchLargeEmojiPattern=e=>{if(e.length>50||e.includes(" "))return null;const t=this._getLargeEmojisRegex().exec(e);return t?t.filter(Boolean).slice(1):null},this.normalizeEmojiFromString=e=>this.normalizeEmoji(e),this.normalizeEmoji=e=>{const t=U(e),{unqualifiedToNormalizedEmoji:n}=this._getDerivedMaps();return n.get(t)},this.normalizeAllEmojis=(0,i.default)((e=>e?e.replace(this.emojiRegex(),((e,t)=>{var n;return k.has(t)?"":null!==(n=this.normalizeEmoji(t))&&void 0!==n?n:"□"})):"")),this.getSkinToneVariant=(e,t)=>{const n=this._getBaseToSkinToneEmojis().get(e);if(null==n)return null;const r=x(t);return n.get(r)},this._getDerivedMaps=(0,s.default)((()=>{const{orderedEmojis:e,legacyToEmoji:t}=this._getConfig(),n=new Map,r=new Map,i=new Map;let a=0;return e.forEach(((e,t)=>{if(""===e||null==e)return;(Array.isArray(e)?e:[e]).forEach((e=>{r.set(e,t);const n=U(e);i.set(n,e)})),n.set(t,a),a++})),(0,h.default)(t).forEach((e=>{let[t,n]=e;r.set(t,n);const a=U(t);i.set(a,t)})),{emojiToGlyphId:r,glyphIdToIndex:n,unqualifiedToNormalizedEmoji:i}})),this._getBaseToSkinToneEmojis=(0,s.default)((()=>{const{emojiToGlyphId:e}=this._getDerivedMaps(),t=new Map;for(const n of e.keys()){let e;const r=n.replace(m,(t=>(null==e&&(e=[]),e.push(t),"")));if(null==e)continue;const i=e;let a;a="👩‍🤝‍👩"===r?E:"👨‍🤝‍👨"===r?S:"👩‍🤝‍👨"===r?T:r===R?N:r===P?O:"🫱‍🫲"===r?w:r;const o=this.normalizeEmoji(a);if(null==o)continue;let s=t.get(o);null==s&&(s=new Map,s.set("",o),t.set(o,s));const l=x(i);s.set(l,n)}return t})),this._getSkinToneEmojisToBase=(0,s.default)((()=>{const e=new Map;for(const[t,n]of this._getBaseToSkinToneEmojis().entries())for(const r of n.values())e.set(r,t);return e})),this._getEmojiRegexSource=(0,s.default)((()=>{const{emojiToGlyphId:e}=this._getDerivedMaps();return(0,p.default)([...Array.from(e.keys()),...Array.from(k)].filter(Boolean))})),this._createLargeEmojisRegexIfNeeded=(0,s.default)((()=>{const e=this._getEmojiRegexSource();return new RegExp(`^(${e})(${e})?(${e})?$`)})),this.getEmojisInCategory=e=>{var t;return null!==(t=this._getConfig().categorizedEmojis[e])&&void 0!==t?t:[]},this._getEmojiToCategory=(0,s.default)((()=>{const{categorizedEmojis:e}=this._getConfig(),t=new Map;return Object.keys(e).forEach((n=>{const r=u.CATEGORY_ORDERING.indexOf(n);e[n].forEach((e=>{const n=this.normalizeEmoji(e);null!=n&&t.set(n,r)}))})),t})),this.getGlyphId=e=>{const t=this.normalizeEmoji(e);if(null==t)return null;const{emojiToGlyphId:n}=this._getDerivedMaps();return n.get(t)},this.getGlyphPath=(e,t)=>{const n=this.normalizeEmojiFromString(e);if(null==n)return null;const{emojiToGlyphId:r}=this._getDerivedMaps(),i=r.get(n);if(null==i)return null;if((0,l.experimentalEmojiAPIEnabled)())return(0,d.getGlyphExperimentalPath)(n,this._getConfig().emojiType,t);let a;return a=t>40?64:40,(0,c.getGlyphPath)(this._getConfig().emojiType,i,a)},this.getSpritesPath=(e,t,n,r)=>(0,l.experimentalEmojiAPIEnabled)()?(0,d.getEmojiSpritesExperimentalPath)(e,t,n,r):(0,c.getEmojiSpritesPath)(e,t,n,r),this.isGlyphCached=e=>{const t=this._getGlyphIndex(e);return this._getCachedGlyphs().get(t)},this.markGlyphCached=e=>{const t=this._getGlyphIndex(e);this._getCachedGlyphs().set(t)},this._getCachedGlyphs=(0,s.default)((()=>new a.default(this._getGlyphCount()))),this.getCssClasses=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"small";return(0,f.default)(`b${e.getBucket(t)}`,"small"===n?"emoji":"emojik",e._getConfig().emojiType===u.EMOJI_TYPE.APPLE?"apple":"wa")},this.getStyle=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"small";const{xpos:r,ypos:i}=e._getCoordinates(t,n);return{backgroundPosition:`-${r}px -${i}px`}},this.getBucket=e=>{const t=this._getGlyphIndex(e);return`${Math.floor(t/u.BUCKET_SIZE)}`},this.getHeartEmojis=(0,s.default)((()=>D.map(this.normalizeEmoji).filter(Boolean))),this._getLastBucketId=(0,s.default)((()=>{const e=this._getGlyphCount();return e-e%u.BUCKET_SIZE})),this._getLastBucketCols=(0,s.default)((()=>Math.floor(Math.sqrt(this._getGlyphCount()-this._getLastBucketId()))))}configure(e){e!==this._config&&(this._config=e,this.getHeartEmojis.reset(),this._createEmojiRegexIfNeeded.reset(),this._createLargeEmojisRegexIfNeeded.reset(),this._createOnlyEmojiRegexIfNeeded.reset(),this._getEmojiRegexSource.reset(),this._getCachedGlyphs.reset(),this._getSkinToneEmojisToBase.reset(),this._getBaseToSkinToneEmojis.reset(),this._getEmojiToCategory.reset(),this._getLastBucketId.reset(),this._getLastBucketCols.reset(),this._getDerivedMaps.reset())}_getConfig(){return(0,_.default)(null!=this._config,"Attempt to use EmojiUtil before it's been configured"),this._config}isEmoji(e){return null!=this.normalizeEmoji(e)}getSkinToneBase(e){var t;const n=this.normalizeEmoji(e);return null==n?null:null!==(t=this._getSkinToneEmojisToBase().get(n))&&void 0!==t?t:null}_getLargeEmojisRegex(){const e=this._createLargeEmojisRegexIfNeeded();return e.lastIndex=0,e}_getGlyphCount(){const{glyphIdToIndex:e}=this._getDerivedMaps();return e.size}_getCoordinates(e,t){const n=this._getGlyphIndex(e),r=n%u.BUCKET_SIZE,i=n>=this._getLastBucketId()?this._getLastBucketCols():Math.floor(Math.sqrt(u.BUCKET_SIZE)),a=u.EMOJI_WIDTH[t],o=Math.floor(r/i);return{xpos:Math.floor(r%i)*a,ypos:o*a,width:a}}_getGlyphIndex(e){const{glyphIdToIndex:t}=this._getDerivedMaps();return(0,o.default)(t.get(e),"glyphIdToIndex.get(glyphId)")}getEmojiAggregate(e){const t=this.getNormalizedOrTofu(e),n=this.getSkinToneBase(t);return null!=n?n:U(t)}getNormalizedOrTofu(e){return this.normalizeEmojiFromString(e)?e:"□"}};t.EmojiUtil=B},850589:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.OpenChatFlow=void 0,t.clearChatIdCorrectionCache=function(){b.clear()};var a=i(n(348926)),o=n(88237),s=n(36530),l=n(450491),u=n(578001),c=n(780549),d=n(877171),p=n(855309),_=i(n(329982)),f=i(n(932325)),h=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=M(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(446303)),g=i(n(524173)),m=n(956113),y=n(459857),E=i(n(571834)),S=i(n(57681)),T=n(485330),v=n(672604),A=n(71870),C=n(82560),P=n(744259),O=n(548360),I=n(785893);function M(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(M=function(e){return e?n:t})(e)}const b=new Map;function R(){return(R=(0,a.default)((function*(e){if(!e.isUser())return e;const t=b.get(e.user);if(t)return t;const n=yield(0,v.queryExists)(e),r=null==n?e:n.wid;return b.set(e.user,r),r}))).apply(this,arguments)}class N extends _.default{constructor(){super(...arguments),this._cancel=()=>{this._queryChat&&this._queryChat.controller.abort(),this._queryChat=void 0,this.end()},this.error=()=>{this.push((0,I.jsx)(P.ConfirmPopup,{onOK:()=>this.end(),okText:O.fbt._("OK",null,{hk:"2KEeHb"}),children:f.default.t(479)}))}}componentDidMount(){var e=this;return(0,a.default)((function*(){let t=!1;const n=new r;(0,s.delayMs)(250).then((()=>{if(n.signal.aborted)throw new o.AbortError;t=!0,e.push((0,I.jsx)(P.ConfirmPopup,{title:O.fbt._("Starting chat",null,{hk:"NHBK3"}),onCancel:e._cancel,cancelText:O.fbt._("Cancel",null,{hk:"H0gNq"}),children:(0,I.jsx)("div",{className:S.default.spinner,children:(0,I.jsx)(m.Spinner,{stroke:6,size:24})})}))})).catch((0,o.catchAbort)((()=>{})));const i=Date.now(),u=new r,c=u.signal,{pnForLid:d}=e.props,_=d?yield(0,T.getExisting)(d):null,f=_?d:yield e.getChatWid();if(null==f){const{fallbackURL:t}=e.props;return null!=t&&g.default.open(t),void e.end()}const h=E.default.PNH_MESSAGE_CHAT_PARTY.BIZ;!_&&f.isLid()&&null!=d&&(0,A.testLidWaMeLinkEnabled)()&&((0,C.logPnhRequestRevealActionHelper)(E.default.PNH_CHAT_TYPE_TYPE.CTWA,h,E.default.PNH_ACTION_TYPE.SEE_MASKED_PN_AT_CHAT_CREATION,E.default.PNH_ENTRY_POINT_TYPE.CHAT_CREATION),yield(0,l.updateLidChatState)(f.user,!1),yield(0,l.createOrReplaceLidPnMappings)([{lid:f.user,pn:d.user}]));const y=function(){return R.apply(this,arguments)}(f).then((e=>(0,p.findChat)(e,!0))).then(function(){var r=(0,a.default)((function*(r){if(c.aborted)throw new o.AbortError;t||n.abort();const a=Date.now()-i,l=t?Math.max(750-a,0):0;e.openChat(r),yield(0,s.delayMs)(l),e.end(),e.props.onSuccess(r)}));return function(){return r.apply(this,arguments)}}()).catch((0,o.catchAbort)((()=>{}))).catch((()=>{n.abort(),e.error()}));e._queryChat={controller:u,promise:y}}))()}getChatWid(){var e=this;return(0,a.default)((function*(){const{chatId:t,customURL:n}=e.props;if(null!=t)return t;if(null!=n){return yield(0,u.getWidfromPath)(n)}__LOG__(4,void 0,new Error)`OpenChatFlow chatWid couldn't be created from provided props.`}))()}openChat(e){let{msgText:t,ctwaContextLinkData:n}=this.props;if(n){const e=h.findLink(n.sourceUrl||"",!1,(0,y.getMaybeMeUser)());(null==e?void 0:e.suspiciousCharacters)&&e.suspiciousCharacters.size>0&&(n=null)}n&&(t=n.icebreaker),e.active&&t?(d.ComposeBoxActions.paste(e,t),n&&d.ComposeBoxActions.setCtwaContextLinkData(e,n)):(t&&e.setComposeContents({text:t}),c.Cmd.openChatFromUnread(e).then((t=>{t&&(d.ComposeBoxActions.focus(e),n&&d.ComposeBoxActions.setCtwaContextLinkData(e,n))}))),null!=this.props.sendLogAttributes&&d.ComposeBoxActions.addMsgSendingLogAttributes(e,this.props.sendLogAttributes)}}t.OpenChatFlow=N,N.defaultProps={removeTopDrawer:!0,pushTransition:"none",popTransition:"none",displayName:"OpenChatFlow"}},146375:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1/0;return(0,a.default)(n,(0,i.parse)(e,t,o),r)};var i=n(161494),a=r(n(887819))},675886:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UntrustedGroupDesc=t.TrustedGroupDesc=t.StatusV3Text=t.StatusV3Caption=t.SearchName=t.Search=t.RawNotification=t.RawGroupNotification=t.QuotedMention=t.QuickReply=t.LastMessage=t.LargeEmojiOnly=t.HeaderAndFooter=t.FormattedNotification=t.FormattedGroupNotification=t.Format=t.FTSMessage=t.EmojiOnly=t.Conversation=t.Compatibility=t.BoldedContactName=void 0;n(650201);var r=n(233985),i=n(918715);t.EmojiOnly=function(){let{selectable:e,emojiXstyle:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[[[r.Emoji,{selectable:e,emojiXstyle:t}]]]};t.LargeEmojiOnly=function(){let{selectable:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[[[r.Emoji,{selectable:e,size:"large"}]]]};t.StatusV3Text=function(){let{links:e,selectable:t,emojiXstyle:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[[[r.Code,{selectable:t}]],[[(0,i.statusV3LinkPreviewEnabled)()?r.StatusLink:r.Link,{links:e,selectable:t}]],[[r.Bold,{selectable:t}],[r.Italic,{selectable:t}],[r.Strikethrough,{selectable:t}]],[[r.Emoji,{selectable:t,size:"xlarge",emojiXstyle:n}]]]};t.StatusV3Caption=function(){let{selectable:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[[[r.Code,{selectable:e}]],[[r.Bold,{selectable:e}],[r.Italic,{selectable:e}],[r.Strikethrough,{selectable:e}]],[[r.Emoji,{selectable:e}]]]};t.Compatibility=function(){let{selectable:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[[[r.Emoji,{selectable:e}]]]};t.Conversation=function(){let{mentions:e,links:t,phoneNumbers:n,selectable:i,trusted:a,fromMe:o}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s=a&&n.length>0?[[r.PhoneNumber,{phoneNumbers:n,selectable:i,fromMe:o}]]:null;return[[[r.Code,{selectable:i}]],null,null,a?[[r.Link,{links:t,selectable:i}]]:null,e?[[r.Mention,{mentions:e,selectable:i}]]:null,null,s,[[r.Bold,{selectable:i}],[r.Italic,{selectable:i}],[r.Strikethrough,{selectable:i}]],[[r.Emoji,{selectable:i}]]].filter(Boolean)};t.Search=e=>{let{boundary:t,terms:n,selectable:i,mentions:a}=e;return[[[r.TextMention,{mentions:a,selectable:i}]],[[r.Bold,{selectable:i}],[r.Italic,{selectable:i}],[r.Strikethrough,{selectable:i}]],[[r.Highlight,{terms:n,boundary:t,selectable:i,ignoreDiacritics:!0}]],[[r.Emoji,{selectable:i}]]]};t.SearchName=e=>{let{terms:t}=e;return[[[r.Highlight,{terms:t,ignoreDiacritics:!0}]],[[r.Emoji,{selectable:!1}]]]};t.LastMessage=function(){let{mentions:e,selectable:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[[[r.Code,{selectable:t}]],null,null,e?[[r.TextMention,{mentions:e,selectable:t}]]:null,[[r.Bold,{selectable:t}],[r.Italic,{selectable:t}],[r.Strikethrough,{selectable:t}]],[[r.Emoji,{selectable:t}]]].filter(Boolean)};t.FTSMessage=e=>{let{boundary:t,mentions:n,terms:i,selectable:a}=e;return[[[r.Code,{selectable:a}]],[[r.TextMention,{mentions:n,selectable:a}]],[[r.Bold,{selectable:a}],[r.Italic,{selectable:a}],[r.Strikethrough,{selectable:a}]],[[r.Highlight,{terms:i,boundary:t,selectable:a}]],[[r.Emoji,{selectable:a}]]]};t.QuickReply=function(){let{selectable:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[[[r.Code,{selectable:e}]],[[r.Bold,{selectable:e}],[r.Italic,{selectable:e}],[r.Strikethrough,{selectable:e}]],[[r.Emoji,{selectable:e}]]]};t.Format=e=>{let{mentions:t,selectable:n}=e;return[[[r.Code,{selectable:n}]],null,null,[[r.TextMention,{mentions:t,selectable:n}]],[[r.Bold,{selectable:n}],[r.Italic,{selectable:n}],[r.Strikethrough,{selectable:n}]],[[r.Emoji,{selectable:n}]]].filter(Boolean)};t.QuotedMention=e=>{let{mentions:t,selectable:n}=e;return[[[r.Code,{selectable:n}]],null,null,[[r.TextMention,{mentions:t,selectable:n,theme:{quoted:!0}}]],[[r.Bold,{selectable:n}],[r.Italic,{selectable:n}],[r.Strikethrough,{selectable:n}]],[[r.Emoji,{selectable:n}]]].filter(Boolean)};t.RawNotification=e=>{let{mentions:t,selectable:n}=e;return[[[r.RawMention,{mentions:t,selectable:n}]]]};t.FormattedNotification=e=>{let{mentions:t,selectable:n}=e;return[[[r.Code,{selectable:n}]],null,null,[[r.RawMention,{mentions:t,selectable:n}]],[[r.Bold,{selectable:n}],[r.Italic,{selectable:n}],[r.Strikethrough,{selectable:n}]]].filter(Boolean)};t.RawGroupNotification=e=>{let{mentions:t,selectable:n,groupMetadata:i}=e;return[[[r.RawGroupMention,{mentions:t,selectable:n,groupMetadata:i}]]]};t.FormattedGroupNotification=e=>{let{mentions:t,selectable:n,groupMetadata:i}=e;return[[[r.Code,{selectable:n}]],null,null,[[r.RawGroupMention,{mentions:t,selectable:n,groupMetadata:i}]],[[r.Bold,{selectable:n}],[r.Italic,{selectable:n}],[r.Strikethrough,{selectable:n}]]].filter(Boolean)};t.TrustedGroupDesc=e=>{let{links:t}=e;const n=!0;return[[[r.Code,{selectable:n}]],[[r.Link,{links:t,selectable:n}]],[[r.Bold,{selectable:n}],[r.Italic,{selectable:n}],[r.Strikethrough,{selectable:n}]],null,[[r.Emoji,{selectable:n}]]].filter(Boolean)};t.UntrustedGroupDesc=()=>{const e=!0;return[[[r.Code,{selectable:e}]],[[r.Bold,{selectable:e}],[r.Italic,{selectable:e}],[r.Strikethrough,{selectable:e}]],null,[[r.Emoji,{selectable:e}]]].filter(Boolean)};t.HeaderAndFooter=function(){let{links:e,selectable:t,trusted:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[n?[[r.Link,{links:e,selectable:t}]]:null,[[r.Emoji,{selectable:t}]]].filter(Boolean)};t.BoldedContactName=e=>{let{selectable:t}=e;return[[[r.BoldFirstWord,{selectable:t}]],[[r.Emoji,{selectable:t}]]]}},496964:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;class n{static match(){throw new Error("Subclasses of `Mutator` must override `match()`")}static mutate(e){return e}}t.default=n,n.nestable=()=>!0,n.format=!0,n.fragment=!1,n.compatibility=!1,n.mutates=!1},887819:(e,t)=>{"use strict";function n(e,t,r){return t.reduce(((t,i)=>(t.push(function(e,t,r){if(t.type){const{value:n}=t;switch(t.type){case"text":return e.onText(n,r);case"delimiter":return e.onDelimiter(n,r);default:throw new Error("Invalid node type")}}return e.onMutator(t.mutator,n(e,t.children,r),t.match[5],t.opts,r)}(e,i,r)),t)),[])}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){return e.onRoot(n(e,t.children,r),r)}},17542:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=class{static onMutator(){throw new Error("Subclasses of `Serializer` must override `onMutator()`")}static onRoot(){throw new Error("Subclasses of `Serializer` must override `onRoot()`")}static onText(){throw new Error("Subclasses of `Serializer` must override `onText()`")}static onDelimiter(){throw new Error("Subclasses of `Serializer` must override `onDelimiter()`")}}},504583:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(t,n){const r=2*e.length+t[1].length,i=t[0].length-r;return i>0&&(t.index+=i,t[0]=t[0].slice(i)),n.lastIndex--,t}}},793951:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;return class extends a.default{static match(r){return(0,i.default)(r,e,t,n)}}};var i=r(n(84652)),a=r(n(496964))},819659:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const{index:n}=e,[r]=e,i=n+r.length-1,a=[n,n,i,i,e];if(t){const i=e[t];a[1]=n+r.indexOf(i),a[2]=a[1]+i.length-1}return a}},84652:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0;const a=[];let o;t.lastIndex=0;for(;(o=t.exec(e))&&t.lastIndex>0;)r&&(o=r(o,t)),o&&a.push((0,i.default)(o,n));return a};var i=r(n(819659))},720934:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.formatNFMText=o,t.formatNFMTextPreview=function(e){if(e.nativeFlowName===a.default.ORDER_DETAILS){const t=(0,i.formatOrderDetailsMessagePreview)(e);if(null!=t)return t}return o(e)};var i=n(468776),a=r(n(753110));function o(e){if(e.nativeFlowName===a.default.ORDER_STATUS){const t=(0,i.formatOrderStatusMessage)(e);if(null!=t)return t}return e.caption||""}},752858:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(517557)),a=r(n(793951)),o=n(785893);const s=(0,a.default)(/^(\w*)\b/g);t.default=class extends s{static jsx(e,t,n){let{selectable:r=!1}=n;return(0,o.jsx)(i.default,{selectable:r,children:e})}}},7748:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(504583)),a=r(n(517557)),o=r(n(793951)),s=n(785893);const l=(0,i.default)("*"),u=(0,o.default)(/(?:^|[\s\W_])\*([^\s\u20e3]|[^\s\u20e3][^\n]*?\S)\*(?=$|[[\s\W_])/g,1,l);t.default=class extends u{static jsx(e,t,n){let{selectable:r=!1}=n;return(0,s.jsx)(a.default,{selectable:r,children:e})}}},789437:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.removeCodeBlocks=t.isInsideCodeBlock=t.Code=void 0;var i=r(n(758287)),a=r(n(793951)),o=n(785893);const s=/```([\s\S]*?\S[\s\S]*?)```/g,l=(0,a.default)(s,1),u=new Set(["ListItem","List"]);class c extends l{static jsx(e,t,n){let{selectable:r=!1}=n;return(0,o.jsx)(i.default,{selectable:r,children:e})}}t.Code=c,c.nestable=e=>u.has(e),c.format=!1;t.isInsideCodeBlock=e=>{const t=e.split(s).pop();return/```/.test(t)};t.removeCodeBlocks=e=>e.replace(s," ")},82436:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(203910),a=r(n(357220)),o=r(n(84652)),s=r(n(496964)),l=n(429334),u=n(785893);class c extends s.default{static jsx(e,t,n){let[r]=t,{size:i,selectable:o=!1,emojiXstyle:s}=n;return(0,u.jsx)(a.default,{emoji:r,size:i,selectable:o,xstyle:s})}static match(e,t,n){const r=null!=n&&0!==n?n:e.length,a=(0,i.firstNCodepoints)(e,r);return(0,o.default)(a,l.EmojiUtil.emojiRegex(),0,d)}}function d(e){return l.EmojiUtil.getGlyphId(e[0])?e:null}t.default=c,c.compatibility=!0},233985:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Bold",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(t,"BoldFirstWord",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"Code",{enumerable:!0,get:function(){return o.Code}}),Object.defineProperty(t,"Emoji",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"Highlight",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"Intern",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(t,"Italic",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"Link",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(t,"List",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(t,"ListItem",{enumerable:!0,get:function(){return _.ListItem}}),Object.defineProperty(t,"Mention",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(t,"PhoneNumber",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(t,"RawGroupMention",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(t,"RawMention",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(t,"StatusLink",{enumerable:!0,get:function(){return S.StatusLink}}),Object.defineProperty(t,"Strikethrough",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(t,"TextMention",{enumerable:!0,get:function(){return y.default}});var i=r(n(752858)),a=r(n(7748)),o=n(789437),s=r(n(82436)),l=r(n(643049)),u=r(n(464150)),c=r(n(586658)),d=r(n(679384)),p=r(n(944568)),_=n(102458),f=r(n(629116)),h=r(n(436971)),g=r(n(721502)),m=r(n(497194)),y=r(n(731386)),E=r(n(565387)),S=n(174084)},643049:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(103522)),a=r(n(84652)),o=r(n(496964)),s=r(n(759710)),l=r(n(932325)),u=n(785893);class c extends o.default{static match(e,t){if(!t)return[];const{terms:n,boundary:r=!1,ignoreDiacritics:o=!1}=t;if(!n.length)return[];const s=o&&l.default.isLatinAlphabetLanguage(e)&&n.every((e=>l.default.isLatinAlphabetLanguage(e)))&&!l.default.isRTL(),u=s?l.default.removeAccents(e):e;return(0,a.default)(u,function(e,t,n){const r=(n?e.map((e=>l.default.removeAccents(e))):e).map(i.default).join("|");if(l.default.isRTL())return new RegExp(`${t?"(?:^|\\b)":""}(\\S+)?(${r})(\\S+)?`,"ig");return new RegExp(`${t?"(?:^|\\b)":""}(${r})`,"ig")}(n,r,s))}}t.default=c,c.jsx=(e,t,n)=>{let{selectable:r}=n;return(0,u.jsx)(s.default,{selectable:r,children:e})}},464150:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(793951)),a=r(n(229838)),o=n(785893);const s=(0,i.default)(/(^|\b|\s)(((#|t|T|d|D|p|P|s|S)([0-9]{3,16}))|([0-9a-fA-F]{8,40}))(?=$|\b)/g,2,(function(e){const[,t,,,,,n]=e;if(n&&(!l.test(n)||!u.test(n)))return null;t&&(e.index+=t.length,e[0]=e[0].slice(t.length));return e}));t.default=class extends s{static jsx(e,t,n){let{selectable:r=!1}=n;const i=function(e){let[,,,,t,n,r]=e;if(r)return`${c}${r.toLowerCase()}`;switch(t){case"T":case"t":case"#":return`${d}${n}`;case"D":case"d":return`${p}${n}`;case"P":case"p":return`${_}${n}`;case"S":case"s":return`${f}${n}`;default:return`${h}${t}${n}`}}(t);return(0,o.jsx)(a.default,{href:i,selectable:r,children:e})}};const l=/[a-fA-F]/,u=/[0-9]/;const c="https://internalfb.com/intern/bunny/?q=hash%20",d="https://internalfb.com/intern/tasks/?t=",p="https://internalfb.com/intern/diff/D",_="https://internalfb.com/intern/paste/P",f="https://internalfb.com/intern/sevmanager/view/s/",h="https://internalfb.com/intern/"},586658:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(504583)),a=r(n(793951)),o=r(n(826246)),s=n(785893);const l=(0,i.default)("_"),u=(0,a.default)(/(?:^|\s|_|[^\w\\])_(\S|\S[^\n]*?\S)_(?=$|[[\s\W_])/g,1,l);t.default=class extends u{static jsx(e,t,n){let{selectable:r=!1}=n;return(0,s.jsx)(o.default,{selectable:r,children:e})}}},679384:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(7748)),a=r(n(496964)),o=r(n(586658)),s=r(n(927001)),l=r(n(497194)),u=r(n(68420)),c=n(785893);class d extends a.default{static jsx(e,t,n){let{selectable:r=!1}=n;const{href:i,suspiciousCharacters:a}=t;return(null==a?void 0:a.size)?(0,c.jsx)(u.default,{link:t,selectable:r,children:e}):(0,c.jsx)(s.default,{href:i,selectable:r,children:e})}}function p(e){const{index:t,url:n}=e,r=t+n.length-1;return[t,t,r,r,e]}function _(e,t){let n=0,r=0;for(;n<e.length&&r<t.length;){const i=t[r][3]-e[n][3];if(i>0)n++;else if(i<0)r++;else{e[n][2]--,e[n][3]--;const t=e[n][5];t.href=t.href.slice(0,-1),t.path=t.path&&t.path.slice(0,-1),t.url=t.url.slice(0,-1),r++,n++}}}t.default=d,d.format=!1,d.match=(e,t)=>{if(!t)return[];const{links:n=[]}=t;return n.map(p)},d.conflictResolvers=new Map([[i.default,_],[o.default,_],[l.default,_]])},944568:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(793951)),a=r(n(262696)),o=n(785893);const s=(0,i.default)(/((?:^)(?:\* (?:[^\n]+)(?:\n(?:\* [^\n]+)){0,})(?:\n|$))/gm,0);class l extends s{static jsx(e,t,n){let{selectable:r=!1,inline:i}=n;const s=0===t.index;return(0,o.jsx)(a.default,{inline:i,isAtStart:s,selectable:r,children:e})}}t.default=l,l.nestable=()=>!1},102458:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ListItem=t.LIST_ITEM_DELIMITER=t.LAST_LIST_ITEM_REGEX=void 0;var i=r(n(793951)),a=r(n(951748)),o=n(785893);t.LIST_ITEM_DELIMITER="* ";t.LAST_LIST_ITEM_REGEX=/(?:^|\n)\* [^\n]+$/;const s=(0,i.default)(/(?:^)\* ([^\n]+(?:$))/gm,1),l=new Set(["List"]);class u extends s{static jsx(e,t,n){let{selectable:r=!1,inline:i}=n;return(0,o.jsx)(a.default,{inline:i,selectable:r,children:e})}}t.ListItem=u,u.nestable=e=>l.has(e),u.unformatDecorations={pre:"• "}},629116:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(103522)),a=r(n(441609)),o=r(n(84652)),s=r(n(496964)),l=r(n(577527)),u=n(785893);class c extends s.default{static match(e,t){if(!t)return[];const{mentions:n,groupMetadata:r}=t;if(!n||(0,a.default)(n))return[];const s=function(e){const t=Object.keys(e).map(i.default).join("|");return new RegExp(`(${t})`,"g")}(n),l=(0,o.default)(e,s);for(let e=0;e<l.length;++e)l[e][4]={contact:n[l[e][4][0]],groupMetadata:r};return l}static jsx(e,t,n){let{selectable:r}=n;return(0,u.jsx)(l.default,{mentionMeta:t,selectable:r})}}t.default=c,c.format=!1},436971:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(496964)),a=r(n(400017)),o=n(785893);class s extends i.default{static jsx(e,t,n){let{selectable:r=!1,fromMe:i}=n;const{phone:s}=t;return(0,o.jsx)(a.default,{phoneNumber:s,selectable:r,fromMe:i})}}function l(e){const{index:t,phone:n}=e,r=t+n.length-1;return[t,t,r,r,e]}t.default=s,s.format=!1,s.match=(e,t)=>{if(!t)return[];const{phoneNumbers:n=[]}=t;return n.map(l)}},565387:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(493928),a=r(n(629116));class o extends a.default{}t.default=o,o.mutates=!0,o.mutate=(e,t)=>{const{contact:n,groupMetadata:r}=t;return(0,i.isDropLastNameEnabled)()&&r&&r.hasUniqueShortNameMention(n)?`@${n.shortName}`:`@${n.displayName}`}},721502:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(629116));class a extends i.default{}t.default=a,a.mutates=!0,a.mutate=(e,t)=>{let{contact:n}=t;return`@${n.displayName}`}},174084:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.StatusLink=void 0,t.cleanUrl=l,t.redactUrl=u;var i=r(n(679384)),a=n(958971),o=n(785893);function s(e,t){return t.length>12||t.length+e.length>34?t.slice(0,function(e,t){const n=Math.min(t.length,Math.max(t.length-12,t.length+e.length-34));return t.length-n}(e,t)):t}function l(e){let{domain:t,path:n}=e;return[t.replace(/^www\./,""),null==n||1===n.length?"":n]}function u(e,t){const n=s(e,t),r=e+(1===n.length?"":n);return(r.length>34?`...${r.slice(r.length-34)}`:r)+(t!==n?"...":"")}class c extends i.default{static jsx(e,t,n){const[r,i]=l(t),s=u(r,i);var c;return s!==r+i?(0,o.jsx)(a.LongLink,{selectable:null!==(c=n.selectable)&&void 0!==c&&c,link:t,children:s}):super.jsx([r+i],t,n)}}t.StatusLink=c},497194:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(504583)),a=r(n(793951)),o=r(n(725229)),s=n(785893);const l=(0,i.default)("_"),u=(0,a.default)(/(?:^|[\s\W_])~(\S|\S[^\n]*?\S)~(?=$|[[\s\W_])/g,1,l);t.default=class extends u{static jsx(e,t,n){let{selectable:r}=n;return(0,s.jsx)(o.default,{selectable:r,children:e})}}},731386:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(629116)),a=r(n(58684)),o=n(785893);class s extends i.default{static jsx(e,t,n){let{contact:r}=t,{selectable:i,theme:s}=n;return(0,o.jsx)(a.default,{contact:r,selectable:i,theme:s})}}t.default=s},517557:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{children:t="",selectable:n}=e;return(0,i.jsx)(r.SelectableStrong,{selectable:n,appTextTemplate:"*${appText}*",children:t})};var r=n(306703),i=n(785893)},386481:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const{onClick:t,theme:n,selectable:r}=e,_=(0,d.useModelValues)(e.contact,["id","displayName"]),f=_.id,h=!!n&&n.quoted,g=_.displayName,m=(0,i.dir)(g)||"auto",y=(0,l.default)(g,[[[s.default,{selectable:r}]]],u.default,void 0,1/0);return(0,p.jsx)(p.Fragment,{children:(0,p.jsxs)(a.SelectableSpan,{"data-jid":f.toString(),"data-display":g,className:(0,c.default)("matched-mention",(0,o.cx)({"quoted-mention":h,"inactive-mention":!t||h})),onClick:t,plainText:`@${g}`,selectable:r,selectAll:!0,appTextTemplate:`${f.toString()}`,children:[(0,p.jsx)("span",{className:"at-symbol",children:"@"}),(0,p.jsx)("span",{dir:m,children:y})]})})};var i=n(553272),a=n(306703),o=n(113704),s=r(n(82436)),l=r(n(146375)),u=r(n(893874)),c=r(n(120992)),d=n(990144),p=n(785893)},758287:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{children:t="",selectable:n}=e;return(0,i.jsx)(r.SelectableCode,{selectable:n,appTextTemplate:"```${appText}```",children:t})};var r=n(306703),i=n(785893)},357220:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(225148)),a=n(116594),o=n(785893);t.default=e=>{let{emoji:t,selectable:n,size:r,xstyle:s}=e;return"xlarge"===r?(0,o.jsx)(a.LargeEmoji,{emoji:t,xstyle:s,size:a.SIZE.XLARGE,element:"span",selectable:n}):(0,o.jsx)(i.default,{emoji:t,xstyle:s,selectable:n,size:r})}},186479:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const{onClick:t,theme:n,selectable:r}=e,f=(0,p.useModelValues)(e.contact,["id","displayName","shortName","isMyContact"]),h=(0,p.useModelValues)(e.groupMetadata,["uniqueShortNameMap"]),g=f.id,m=!!n&&n.quoted,y=(0,a.isDropLastNameEnabled)()&&h&&h.hasUniqueShortNameMention(f)?f.shortName:f.displayName,E=(0,i.dir)(y)||"auto",S=(0,u.default)(y,[[[l.default,{selectable:r}]]],c.default,void 0,1/0);return(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)(o.SelectableSpan,{"data-jid":g.toString(),"data-display":y,className:(0,d.default)("matched-mention",(0,s.cx)({"quoted-mention":m,"inactive-mention":!t||m})),onClick:t,plainText:`@${y}`,selectable:r,selectAll:!0,appTextTemplate:`${g.toString()}`,children:[(0,_.jsx)("span",{className:"at-symbol",children:"@"}),(0,_.jsx)("span",{dir:E,children:S})]})})};var i=n(553272),a=n(493928),o=n(306703),s=n(113704),l=r(n(82436)),u=r(n(146375)),c=r(n(893874)),d=r(n(120992)),p=n(990144),_=n(785893)},759710:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{children:t="",selectable:n}=e;return(0,i.jsx)(r.SelectableSpan,{className:"matched-text",selectable:n,children:t})};var r=n(306703),i=n(785893)},229838:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,o.jsx)(a.default,(0,i.default)((0,i.default)({},e),{},{children:e.children}))};var i=r(n(81109)),a=r(n(927001)),o=n(785893)},826246:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{children:t="",selectable:n}=e;return(0,i.jsx)(r.SelectableEm,{selectable:n,appTextTemplate:"_${appText}_",children:t})};var r=n(306703),i=n(785893)},927001:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{children:t="",href:n,selectable:a}=e;return(0,i.jsx)(r.SelectableLink,{href:n,title:n,target:"_blank",rel:"noopener noreferrer",selectable:a,children:t})};var r=n(306703),i=n(785893)},951748:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{children:t="",inline:n,selectable:r}=e;return(0,l.jsx)("li",{className:(0,s.default)((0,a.cx)({[o.default.inline]:n})),children:(0,l.jsx)(i.SelectableSpan,{selectable:r,appTextTemplate:"* ${appText}",children:t})})};var i=n(306703),a=n(113704),o=r(n(364071)),s=r(n(120992)),l=n(785893)},262696:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{children:t="",inline:n,isAtStart:r,selectable:u}=e;return(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(i.SelectableUl,{appTextTemplate:r?"${appText}":"\n${appText}",className:(0,s.default)((0,a.cx)({[o.default.inline]:n}),o.default.ul),selectable:u,children:t})})};var i=n(306703),a=n(113704),o=r(n(906524)),s=r(n(120992)),l=n(785893)},958971:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.LongLink=function(e){var t;let{link:n,children:r="",selectable:f}=e;const{statusItemViewEventRef:h}=(0,c.useContext)(s.StatusV3StatusContext);if(null===(t=n.suspiciousCharacters)||void 0===t?void 0:t.size)return(0,p.jsx)(l.default,{link:n,selectable:f,children:r});return(0,p.jsx)(a.SelectableLink,{href:n.href,onClick:e=>{e.preventDefault(),o.ModalManager.open((0,p.jsx)(u.LongLinkPopup,{link:n,statusItemViewEventRef:h})),i.Cmd.openLongLinkModal()},selectable:f,className:(0,d.default)(_),children:r})};var i=n(780549),a=n(306703),o=n(114850),s=n(547821),l=r(n(68420)),u=n(552897),c=n(667294),d=r(n(156720)),p=n(785893);const _={cursor:"ajgl1lbb"}},577527:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const{mentionMeta:t,theme:n,selectable:r}=e;return(0,a.jsx)(i.default,{contact:t.contact,theme:n,selectable:r})};var i=r(n(575993)),a=n(785893)},400017:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const{phoneNumber:t,selectable:n,fromMe:r}=e;return(0,a.jsx)(i.default,{selectable:n,phoneNumber:t,fromMe:r})};var i=r(n(12274)),a=n(785893)},12274:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{selectable:t,phoneNumber:n,fromMe:r}=e;const[E,S]=(0,g.useState)(null),[T,v]=(0,g.useState)(null),[A,C]=(0,g.useState)(null);function P(e,t){const i=[];if(null==e?void 0:e.wid){const t=(0,a.formatPhone)(e.wid.user);i.push((0,m.jsx)(s.DropdownItem,{testid:"mi-message-on-whatsapp",xstyle:y.menuItem,action:t=>(0,c.handleOpenChat)(t,e.wid,r),children:h.fbt._("Chat with {chat-with-phoneJid}",[h.fbt._param("chat-with-phoneJid",(0,m.jsx)("span",{dir:"ltr",children:t}))],{hk:"2zFU2R"})},"message-on-whatsapp"))}i.push((0,m.jsx)(s.DropdownItem,{testid:"mi-copy-phone-number",xstyle:y.menuItem,action:()=>(0,c.handleCopyPhoneNumber)(n,null==e?void 0:e.wid,r),children:h.fbt._("Copy phone number",null,{hk:"CCcUf"})},"copy-phone-number")),S(null),S({menu:i,event:t}),C(null==e?void 0:e.wid),(0,c.logClickOnPhoneNumber)(null==e?void 0:e.wid,r)}let O=null;E&&(O=(0,m.jsx)(_.UIE,{displayName:"ContextMenu",escapable:!0,popable:!0,dismissOnWindowResize:!0,requestDismiss:()=>{S(null),(0,c.logCloseDialog)(A,r)},children:(0,m.jsx)(f.default,{contextMenu:E})}));return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(o.SelectableLink,{onClick:function(e){let t;function r(){return(r=(0,i.default)((function*(e,n){try{P(yield t.getOrRun(e),n)}catch(e){P(null,n),C(null),__LOG__(4,void 0,new Error,!0)`handlePhoneClick getUsync failed with exceptions ${e}`,SEND_LOGS("handlePhoneClick-getUsync")}}))).apply(this,arguments)}T&&T.isCached(n)?t=T:(t=(0,u.usyncContactCached)(),v(t)),t.isCached(n)||function(e){const t=(0,m.jsxs)(l.FlexColumn,{xstyle:y.spinnerContainer,align:"center",justify:"center",children:[(0,m.jsx)(d.Spinner,{size:50,stroke:4,color:"highlight"}),(0,m.jsx)(p.TextSpan,{xstyle:y.spinnerText,theme:"small",children:h.fbt._("Checking phone number...",null,{hk:"2cfR2e"})},"phone_number_wrapper_loading_text")]});S({menu:t,event:e})}(e),function(){r.apply(this,arguments)}(n,e)},selectable:t,style:{cursor:"pointer"},children:n}),O]})};var i=r(n(348926)),a=n(8525),o=n(306703),s=n(675085),l=n(690495),u=n(677159),c=n(702410),d=n(956113),p=n(180519),_=n(392632),f=r(n(37875)),h=n(548360),g=n(667294),m=(r(n(156720)),n(785893));const y={spinnerContainer:{width:"snzbljq1",height:"ra71746h"},spinnerText:{marginTop:"eg3lofc5",paddingStart:"f78eapp6",paddingEnd:"kyc7k6mt",textAlign:"qfejxiq4"},menuItem:{paddingStart:"nqtxkp62",paddingEnd:"btzf6ewn"}}},725229:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{children:t="",selectable:n}=e;return(0,i.jsx)(r.SelectableDel,{selectable:n,appTextTemplate:"~${appText}~",children:t})};var r=n(306703),i=n(785893)},68420:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{children:t="",link:n,selectable:r}=e;return(0,l.jsx)(a.SelectableLink,{onClick:()=>{o.ModalManager.open((0,l.jsx)(s.default,{link:n})),i.Cmd.openLongLinkModal()},selectable:r,style:{cursor:"pointer"},children:t})};var i=n(780549),a=n(306703),o=n(114850),s=r(n(46668)),l=n(785893)},58684:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=(0,_.useContext)(u.default),n=(0,_.useContext)(p.default);let r=(0,h.jsx)(o.default,(0,i.default)({},e));(0,a.isDropLastNameEnabled)()&&t&&(r=(0,h.jsx)(c.default,(0,i.default)((0,i.default)({},e),{},{groupMetadata:t})));if((0,d.messageListA11yRedesignEnabled)()&&n===l.DISPLAY_TYPE.CONVERSATION)return(0,h.jsx)(s.Clickable,{className:(0,f.default)(g),onClick:e.onClick,children:r});return r};var i=r(n(81109)),a=n(493928),o=r(n(386481)),s=n(950987),l=n(356097),u=r(n(477466)),c=r(n(186479)),d=n(97858),p=r(n(328861)),_=n(667294),f=r(n(156720)),h=n(785893);const g={display:"l7jjieqr"}},575993:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{contact:t,theme:n,selectable:r}=e;const{isMe:u}=(0,s.useModelValues)(t,["id","isMe"]),c=u?void 0:()=>{(0,a.findChat)(t.id).then((e=>i.Cmd.openChatBottom(e)))};return(0,l.jsx)(o.default,{contact:t,theme:n,selectable:r,onClick:c})};var i=n(780549),a=n(855309),o=r(n(58684)),s=n(990144),l=n(785893)},536150:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(1===e.length)return e;const n=[];let r;for(;r=e.pop();){const[e,,,i,a]=r,[{nestable:o,compatibility:s},,l]=t[a];let u=!0;const{length:c}=n;for(let r=c-1;r>=0;--r){const[,,a,c,d]=n[r];if(e>c)break;const[{mutates:p,format:_,compatibility:f,name:h},,g]=t[d];if(i>a){if(l<g&&n.splice(r,1))continue;u=!1;break}if(p&&!(u=!1))break;if(s)break;if((o(h)||f||!(l<g)||!n.splice(r,1))&&(!s&&!_)){u=!1;break}}u&&n.push(r)}return n}},486638:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=[];for(let n=0;n<e.length;++n)for(let r=0;r<e[n].length;++r){const[i,a]=e[n][r];t.push([i,a,n])}return t}},592583:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0;const r=[];for(let i=0;i<t.length;++i){const[a,o]=t[i],s=a.match(e,o,n),l=[],{length:u}=s;for(let e=0,t=s[e];e<u;t=s[++e])l[e]=[t[0],t[1],t[2],t[3],i,t[4]];l.length&&r.push(l)}for(let e=0;e<r.length;e++){const{conflictResolvers:n}=t[r[e][0][4]][0];if(n)for(let i=0;i<r.length;i++){const a=t[r[i][0][4]][0],o=n.get(a);null==o||o(r[e],r[i])}}const i=[];for(let e=0;e<r.length;++e)i[e]=r[e].length-1;const a=[];let o=0;for(;r.length;){for(let e=0,t=-1;e<r.length;++e)r[e][i[e]][0]>t&&(o=e,t=r[e][i[e]][0]);a.push(r[o][i[o]]),--i[o]<0&&(r.splice(o,1),i.splice(o,1))}return a}},161494:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t._parse=u,t.parse=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0;return u(e,(0,o.default)(t),n)};var i=n(203910),a=r(n(536150)),o=r(n(486638)),s=r(n(592583)),l=r(n(356900));function u(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0;const r=(0,s.default)(e,t,n),o=r.length?(0,l.default)(e,(0,a.default)(r,t),t):{children:[{type:"text",value:e}]},u=(0,i.numCodepoints)(e);return n<u&&c(o,{limit:n}),o}function c(e,t){if(t.limit<=0)return;if(e.type&&"text"===e.type){if(e.value.length>=t.limit){let n=(0,i.toArray)(e.value);n.length>=t.limit&&(n=n.slice(0,t.limit)),e.value=n.join(""),t.limit=t.limit-n.length}else t.limit=t.limit-e.value.length;return}if(e.type&&"delimiter"===e.type)return;let n=0;for(;n<e.children.length&&(c(e.children[n],t),!(t.limit<=0));)n++;e.children=e.children.slice(0,n+1)}},356900:(e,t,n)=>{"use strict";function r(e,t,n){let{format:r}=e;const i=[],a=function(e){let t=e;const n=[];do{t.mutator&&n.push(t.mutator)}while(t.parent&&(t=t.parent));return n}(n);for(let e=0;e<t.length;++e)(r||t[e][0].compatibility)&&(a.includes(t[e][0])||i.push(t[e]));return i}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,i){const a={children:[]};let o=0,s=a,l=0;for(let a=0;a<t.length;++a){const u=t[a],[c,d]=u;for(;s.parent&&c>(l=s.match[2]);){if(o<=l&&s.children.push({type:"text",value:e.substring(o,l+1)}),o=s.match[3]+1,s.mutator.fragment){const{children:e}=s.parent;e.pop(),e.push.apply(e,s.children)}l!==s.match[3]&&s.parent.children.push({type:"delimiter",value:e.substring(l+1,o)}),s=s.parent}o<c&&s.children.push({type:"text",value:e.substring(o,c)});const[p,_]=i[u[4]],{mutates:f}=p;o=d,c!==d&&s.children.push({type:"delimiter",value:e.substring(c,d)});const h={children:[],match:u,mutator:p,opts:_,parent:s};if(f){const t=e.substring(u[1],u[2]+1),a=p.mutate(t,u[5]),s=r(p,i,h),l=(0,n(161494)._parse)(a,s);h.children=l.children,o=u[2]+1}s.children.push(h),s=h}do{if(!s.match)continue;const[,,t,n]=s.match;if(o<=t&&s.children.push({type:"text",value:e.substring(o,t+1)}),o=n+1,s.mutator.fragment){const{children:e}=s.parent;e.pop(),e.push.apply(e,s.children)}t!==n&&s.parent.children.push({type:"delimiter",value:e.substring(t+1,o)})}while(s.parent&&(s=s.parent)&&s.parent);o!==e.length&&s.children.push({type:"text",value:e.substring(o)});return a}},893874:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(17542)),a=r(n(216593)),o=n(667294);class s extends i.default{}function l(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(void 0===r)continue;if("string"==typeof r){t.push(r);continue}const i=`jsx-child-${n}`;t.push((0,o.cloneElement)(r,{key:i}))}return t}t.default=s,s.onText=a.default,s.onDelimiter=()=>{},s.onRoot=e=>l(e),s.onMutator=(e,t,n,r)=>e.jsx(l(t),n,r)},216593:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default=e=>e},631588:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.SYNC_LOADING=t.SYNC_IN_PROGRESS_CONTEXTUAL_SYSTEM_MESSAGE_TEXT=t.SYNC_IN_PROGRESS_CONTEXTUAL_DRAWER=t.SYNCING_PAUSED_POPUP_TITLE=t.SYNCING_PAUSED_POPUP_DESC=t.SYNCING_PAUSED_GLOBAL_SETTINGS_TITLE=t.SYNCING_PAUSED_GLOBAL_SETTINGS_SUBTITLE=t.SYNCING_PAUSED_CONTEXTUAL_TEXT=t.SYNCING_PAUSED_CONTEXTUAL_SYSTEM_MESSAGE_TEXT=t.SYNCING_OLDER_MESSAGES_SETTINGS_TITLE=t.SYNCING_OLDER_MESSAGES_SETTINGS_PERCENT_COMPLETE=t.SYNCING_OLDER_MESSAGES_MODAL_TITLE=t.SYNCING_OLDER_MESSAGES_MODAL_TEXT=t.SYNCING_OLDER_MESSAGES_MODAL_PERCENT=t.MESSAGE_HISTORY_FAQ_LINK=void 0;var i=r(n(932325)),a=n(548360),o=r(n(156720)),s=n(785893);t.SYNC_LOADING=()=>a.fbt._("Loading your chats",null,{hk:"3MKQFN"});const l={color:"o0rubyzf"};t.SYNC_IN_PROGRESS_CONTEXTUAL_DRAWER=e=>a.fbt._("Syncing older messages. {=m2}",[a.fbt._implicitParam("=m2",(0,s.jsx)("button",{className:(0,o.default)(l),onClick:e,children:a.fbt._("See progress.",null,{hk:"4CKjfo"})}))],{hk:"2cSiNF"});t.SYNC_IN_PROGRESS_CONTEXTUAL_SYSTEM_MESSAGE_TEXT=()=>a.fbt._("Syncing older messages. Click to see progress.",null,{hk:"1oO7fI"});t.SYNCING_OLDER_MESSAGES_MODAL_TITLE=()=>a.fbt._("Syncing older messages",null,{hk:"1vqx6P"});t.SYNCING_OLDER_MESSAGES_MODAL_TEXT=()=>a.fbt._("Keep WhatsApp open on your phone while syncing older messages. To see your full chat history, check your phone.",null,{hk:"wyKZj"});t.SYNCING_OLDER_MESSAGES_MODAL_PERCENT=e=>a.fbt._("{percentage}%",[a.fbt._param("percentage",i.default.n(e))],{hk:"3H6Dmy"});t.SYNCING_OLDER_MESSAGES_SETTINGS_TITLE=()=>a.fbt._("Syncing older messages",null,{hk:"1Xai8l"});t.SYNCING_OLDER_MESSAGES_SETTINGS_PERCENT_COMPLETE=e=>a.fbt._("{percentage}% complete",[a.fbt._param("percentage",i.default.n(e))],{hk:"4atZtF"});t.SYNCING_PAUSED_CONTEXTUAL_SYSTEM_MESSAGE_TEXT=()=>a.fbt._("Syncing paused. Open WhatsApp on your phone to continue syncing.",null,{hk:"ggemw"});t.SYNCING_PAUSED_CONTEXTUAL_TEXT=()=>a.fbt._("Syncing paused. Open WhatsApp on your phone to continue syncing.",null,{hk:"3QYMEE"});t.SYNCING_PAUSED_GLOBAL_SETTINGS_TITLE=()=>a.fbt._("Syncing paused",null,{hk:"2BDp2y"});t.SYNCING_PAUSED_GLOBAL_SETTINGS_SUBTITLE=()=>a.fbt._("Open WhatsApp on your phone",null,{hk:"t4E8m"});t.SYNCING_PAUSED_POPUP_TITLE=()=>a.fbt._("Syncing paused",null,{hk:"4nq42Y"});t.SYNCING_PAUSED_POPUP_DESC=()=>a.fbt._("Syncing of older messages has paused. Open WhatsApp on your phone to continue syncing. You can still send and receive messages here.",null,{hk:"2pa5qD"});t.MESSAGE_HISTORY_FAQ_LINK="https://faq.whatsapp.com/web/chats/about-message-history-on-linked-devices"},329982:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(132375)),a=r(n(8073)),o=n(392632),s=r(n(844453)),l=r(n(720132)),u=n(667294),c=n(785893);class d extends u.Component{constructor(){var e;super(...arguments),e=this,this.state={_stack:[],_transition:"default",_activeKey:0,_ended:!1,isPushed:!1},this.setRefUIE=e=>{this.refUIE=e},this.getElement=()=>{var e;return null===(e=this.refUIE)||void 0===e?void 0:e.getElement()},this.popAndUpdate=(e,t)=>{const n=this.state._stack;if(n.length<2)return void this.pop(t);const r=(0,u.cloneElement)(n[n.length-2],e);n[n.length-2]=r,this.pop(t)},this.push=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.props.pushTransition;e.setState((e=>({_stack:e._stack.concat(t),_transition:n,_activeKey:++e._activeKey,_ended:!1,isPushed:!0})))},this.pop=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.props.popTransition;const n=e.state._stack.slice(0,-1);n.length?e.setState((e=>({_stack:n,_transition:t,_activeKey:--e._activeKey,isPushed:!1}))):e.state._ended||e.setState({_ended:!0},e.end)},this.end=e=>{this.props.onEnd?this.props.onEnd(e):(0,i.default)(this.context,"this.context").requestDismiss(e)},this.stackSize=()=>this.state._stack.length,this.requestFocus=()=>{this.props.requestFocus&&this.props.requestFocus()}}handleRequestDismiss(){this.pop()}render(){const{_stack:e,_transition:t,_activeKey:n,isPushed:r}=this.state;if(0===e.length)return null;let i=e[e.length-1];return i=(0,u.cloneElement)(i,{isPushed:r}),i=(0,c.jsx)(o.UIE,{displayName:`${this.props.displayName}-${n}`,escapable:!0,ref:this.setRefUIE,requestFocus:this.requestFocus,requestDismiss:this.handleRequestDismiss.bind(this),children:i},n),(0,c.jsx)(s.default,{transitionName:t,className:l.default.container,children:this.props.removeTopDrawer?i:e})}}t.default=d,d.contextType=a.default,d.defaultProps={removeTopDrawer:!0,pushTransition:"flow-transition-drawer-push",popTransition:"flow-transition-drawer-pop",displayName:"FlowDrawer"},d.displayName="FlowComponent"},107153:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return"string"==typeof e?e:e&&(e.displayName||e.name)||"Component"}},12:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.WrappedComponent=void 0,t._getComponent=function(){const e=this.component||this.refs.component;if("function"==typeof e._getComponent)return e._getComponent();return e};var i=r(n(81109)),a=r(n(132375)),o=n(667294);class s extends o.Component{constructor(e){super(e),this.setComponent=e=>{this.component=e},this.state=(0,i.default)({},this.state)}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){__LOG__(4,void 0,new Error,!0)`${e.stack}\n${t.componentStack}`,SEND_LOGS("component-did-catch")}getComponent(){return this.component instanceof s?this.component.getComponent():(0,a.default)(this.component,"this.component")}}t.WrappedComponent=s},696430:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ListenerHOC=function(e){var t,n;return(t=class extends c.WrappedComponent{constructor(){super(...arguments),this.listeners=new _}componentDidMount(){this.listeners.internalUseOnlyMarkMounted()}componentWillUnmount(){this.listeners.internalUseOnlyMarkUnmounted()}_getComponent(){return c._getComponent.call(this)}render(){return this.state.hasError?null:(0,p.jsx)(e,(0,a.default)((0,a.default)({ref:this.setComponent},this.props),{},{listeners:this.listeners}))}}).defaultProps=null!==(n=e.defaultProps)&&void 0!==n?n:void 0,t.displayName=`Listener(${(0,u.default)(e)})`,t.wrappedComponent=null,t},t.Listeners=void 0;var a=i(n(81109)),o=n(88237),s=n(780549),l=n(493288),u=i(n(107153)),c=n(12),d=n(337159),p=n(785893);class _{constructor(){this._mounted=!1,this._unmounted=!1,this._listeners=new Set,this._remove=e=>{e.disengage(),this._listeners.delete(e)}}_add(e){this._unmounted?__LOG__(3)`Listener added after unmounting`:(this._listeners.add(e),this._mounted&&e.engage())}internalUseOnlyMarkMounted(){this._mounted=!0,this._listeners.forEach((e=>{e.engage()}))}internalUseOnlyMarkUnmounted(){this._unmounted=!0,this._listeners.forEach(this._remove),this._abortController&&this._abortController.abort()}add(e,t,n,r){const i=this,a=new d.Listener(e,t,(function(){i._unmounted||n.apply(this,arguments)}),r,n);this._add(a)}addOnce(e,t,n,r){const i=this,a=new d.Listener(e,t,(function(){i._remove(a),i._unmounted||n.apply(this,arguments)}),r,n);this._add(a)}remove(e,t,n,r){this._listeners.forEach((i=>{i.represents(e,t,n,r)&&this._remove(i)}))}uiIdle(e){s.Cmd.uiBusy?this.addOnce(s.Cmd,"ui_idle",e):(this._abortController=this._abortController||new r,(0,l.documentFlushed)({signal:this._abortController.signal}).then((()=>{e()}),(e=>{if(e.name!==o.ABORT_ERROR)throw e})))}testsOnlyGetListeners(){return this._listeners}}t.Listeners=_},906131:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.useABPropConfigValue=function(e){return(0,o.default)(a.Cmd,"on_ab_props_update",(()=>(0,i.getABPropConfigValue)(e)))};var i=n(287461),a=n(780549),o=r(n(209561))},461993:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){const r=(0,o.default)(e),{leading:s,trailing:l,maxWait:u}=null!=n?n:{},c=(0,a.useMemo)((()=>(0,i.default)(r,t,n)),[t,s,u,l,r]);return(0,a.useEffect)((()=>c.cancel),[c]),c};var i=r(n(23279)),a=n(667294),o=r(n(28916))},976353:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){const[e,t]=(0,a.useState)((()=>o().getValue()));return(0,a.useEffect)((()=>o().subscribe((e=>{t(e)}))),[]),e};var i=r(n(751463)),a=n(667294);const o=(0,i.default)((()=>new s));class s{constructor(){this._subscribers=new Set}subscribe(e){if(this._subscribers.has(e))throw new Error("Callback can only be added once.");return this._subscribers.add(e),this._updateListener(),()=>{this._subscribers.delete(e),this._updateListener()}}getValue(){var e;return null!==(e=window.devicePixelRatio)&&void 0!==e?e:1}_updateListener(){var e;if(0===this._subscribers.size)return void(null===(e=this._destroyListener)||void 0===e||e.call(this));if(null!=this._destroyListener)return;const t=matchMedia(`(resolution: ${this.getValue()}dppx)`),n=()=>{var e;null===(e=this._destroyListener)||void 0===e||e.call(this);const t=this.getValue();this._subscribers.forEach((e=>{e(t)})),this._updateListener()};t.addListener(n),this._destroyListener=()=>{t.removeListener(n),this._destroyListener=null}}}},209561:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){let r,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];r=null==e?[]:Array.isArray(e)?e:[e];const u=(0,a.useRef)(!0),c=(0,s.default)((()=>n())),[d,p]=(0,a.useState)((()=>c()));(0,o.useListeners)(r.map((e=>({source:e,eventOrEvents:t,callback:()=>{p(c())}}))));const _=r.map(i.default).join(" ");return(0,a.useEffect)((()=>{u.current?u.current=!1:p(c())}),[_,c,...l]),d};var i=r(n(886651)),a=n(667294),o=n(148725),s=r(n(28916))},380362:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){const[e,t]=(0,r.useState)(!1),n=(0,a.useFocusVisibility)();return[(0,i.useFocus)({onFocusChange:t}),e&&n]};var r=n(667294),i=n(162488),a=n(922885)},229439:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){const[,e]=(0,r.useReducer)((e=>e+1),0);return e};var r=n(667294)},133805:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;const{immediate:r=!1}=null!=n?n:{},o=(0,a.default)(e),s=(0,i.useRef)(),l=(0,i.useCallback)((()=>{s.current&&clearInterval(s.current)}),[]),u=(0,i.useCallback)((()=>{l(),s.current=setInterval(o,t)}),[l,t,o]);return(0,i.useEffect)((()=>(r&&u(),l)),[r,u,l]),[u,l]};var i=n(667294),a=r(n(28916))},470649:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=(0,r.useRef)(),n=(0,r.useRef)(!1);n.current||(t.current=e(),n.current=!0);return t};var r=n(667294)},148725:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.useAddListenerOnce=function(){const e=(0,s.useRef)(),t=(0,s.useCallback)(((t,n,r,a)=>{e.current=u(t,n,r,(0,i.default)((0,i.default)({},a),{},{once:!0}))}),[]),n=(0,s.useCallback)((()=>{var t;null===(t=e.current)||void 0===t||t.call(e)}),[]);return(0,s.useEffect)((()=>n),[n]),[t,n]},t.useListener=function(e,t,n,r){const i=(0,l.default)(n),a=c(t);(0,s.useLayoutEffect)((()=>{if(null!=n)return u(e,t,i,r)}),[e,null==n,a])},t.useListeners=function(e){const t=e.map((e=>{let{callback:t}=e;return t})),n=(0,s.useRef)(t);n.current=t;const r=e.map((e=>{let{source:t,eventOrEvents:n}=e;return`${(0,a.default)(t)},${c(n)}`})).join("-");(0,s.useLayoutEffect)((()=>{const t=e.map(((e,t)=>{let{source:r,eventOrEvents:i,opts:a}=e;return u(r,i,(function(){for(var e,r,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return null===(e=(r=n.current)[t])||void 0===e?void 0:e.call(r,...a)}),a)}));return()=>t.forEach((e=>e()))}),[r])};var i=r(n(81109)),a=r(n(886651)),o=n(337159),s=n(667294),l=r(n(28916));function u(e,t,n,r){if(null==e)return()=>{};const i=function(e,t){if(Array.isArray(t))return(0,o.isEventsType)(e)?[t.join(" ")]:t;return[t]}(e,t).map((t=>new o.Listener(e,t,(function(){(null==r?void 0:r.once)&&a(),n(...arguments)}),r)));i.forEach((e=>{e.engage()}));const a=()=>{i.forEach((e=>{e.disengage()}))};return a}function c(e){return Array.isArray(e)?e.join("\0"):e}},676185:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(48313).useMergeRefs;t.default=r},990144:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.StateHookMissingModelError=void 0,t.useModelValues=function(e,t,n){if(null==e)throw __LOG__(4,void 0,new Error,!0)`useModelValues hook received an unexpected \`null\` model`,SEND_LOGS("state-hook-null-model"),new u("Unknown");const r=c(e,t,n);return(0,a.default)(r,"values")},t.useOptionalModelValues=c;var i=n(643930),a=r(n(132375)),o=r(n(243382)),s=n(411067),l=n(667294);class u extends((0,i.customError)("StateHookMissingModelError")){constructor(e){super(`Received a null value for model key: ${e}`)}}function c(e,t,n){const{isStrong:r=!0,componentName:i}=null!=n?n:{},a=e?(0,s.unproxy)(e):null,u=(0,l.useRef)();function c(){if(null==u.current){if(!a)return null;u.current=new o.default(null!=i?i:"Hook(useModelValues)",a.proxyName,t,r,!0)}return u.current}const[d,p]=(0,l.useState)((()=>{const e=c();if(!e)return null;const t=e.getModelAndValidate(a);return t?e.createProxy(t):null})),_=(0,l.useCallback)(((e,t)=>{const n=e.getModelAndValidate(t);p(n?e.createProxy(n):null)}),[]);(0,l.useEffect)((()=>{const e=c();if(!e||!d)return;const t=e.getModel(a);return e.attachConcern(t,d.proxyBitMask,_),()=>{e.detachConcern(t,_)}}),[a,d,_]);const[f,h]=(0,l.useState)(a),g=c();if(f!==a&&g){f&&g.detachConcern(f,_);const e=g.getModelAndValidate(a);h(e),p(e?g.createProxy(e):null)}return d}t.StateHookMissingModelError=u},409413:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const[t,n]=(0,a.useState)((()=>(0,i.shouldShowNUX)(e)));(0,a.useEffect)((()=>{null==(0,i.getNUX)(e)&&((0,i.setNUX)(e,{views:0}),n((0,i.shouldShowNUX)(e)))}),[e]);const s=(0,a.useCallback)((()=>{(0,r.viewNux)(e),n((0,i.shouldShowNUX)(e))}),[e]),l=(0,a.useCallback)((()=>{(0,r.dismissNux)(e),n((0,i.shouldShowNUX)(e))}),[e]),u=(0,a.useCallback)((()=>{(0,r.resetNux)(e),n((0,i.shouldShowNUX)(e))}),[e]);return(0,o.useListener)(i.NuxPrefsEvent,e,(()=>{n((0,i.shouldShowNUX)(e))})),[t,s,l,u]};var r=n(44925),i=n(377773),a=n(667294),o=n(148725)},864135:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=(0,a.default)(e);(0,i.useEffect)((()=>t),[t])};var i=n(667294),a=r(n(28916))},359944:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const[t,n]=(0,i.useState)((()=>{var t;return null!==(t=r.userPreferencesStore.get(e))&&void 0!==t?t:0})),a=(0,i.useCallback)((()=>{r.userPreferencesStore.set(e,t+1),n(t+1)}),[e,t]),o=(0,i.useCallback)((()=>{r.userPreferencesStore.set(e,0),n(0)}),[e]);return[t,a,o]};var r=n(53575),i=n(667294)},207100:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=(0,r.useRef)();return(0,r.useEffect)((()=>{t.current=e})),t.current};var r=n(667294)},261575:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.useQRScreenKillswitchValue=function(e){const[t,n]=(0,a.useState)(null),r=(0,o.default)();return(0,a.useEffect)((()=>{(0,i.getKillswitchValue)(e).then((e=>{r.aborted||n(e)}))}),[e,r]),t};var i=n(430252),a=n(667294),o=r(n(189957))},28916:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=(0,r.useRef)(e);t.current=e;return(0,r.useCallback)((function(){for(var e,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return null===(e=t.current)||void 0===e?void 0:e.call(t,...r)}),[])};var r=n(667294)},415917:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n;const r=(0,a.useRef)(),s=!0===(null==t?void 0:t.disabled),l=s?o:e;return[e=>{r.current=e},{"aria-disabled":null!==(n=null==t?void 0:t.disabled)&&void 0!==n?n:void 0,onClick:l,onKeyPress:function(e){var t;(0,i.default)(e)&&(e.stopPropagation(),e.preventDefault(),null===(t=r.current)||void 0===t||t.click())},role:"button",tabIndex:s?-1:0}]};var i=r(n(83162)),a=n(667294);function o(){}},85284:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.useAlarm=function(e,t,n){const{immediate:r=!1,isGlobal:l=!1}=null!=n?n:{},[u,c]=function(e){const t=(0,s.default)(e),n=(0,o.useRef)(),r=(0,o.useCallback)((()=>{null!=n.current&&a.default.clearTimeout(n.current)}),[]),l=(0,o.useCallback)(((e,r)=>{n.current=r?a.default.setGlobalTimeout(t,(0,i.castUnixTimeToMillisTime)(e),n.current):a.default.setLocalTimeout(t,(0,i.castUnixTimeToMillisTime)(e),n.current)}),[t]);return(0,o.useEffect)((()=>r),[r]),[l,r]}(e),d=(0,o.useCallback)((()=>u(t,l)),[u,t,l]);return(0,o.useEffect)((()=>{r&&d()}),[r,d]),[d,c]},t.useManualTimeout=l,t.useTimeout=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;const{immediate:r=!1}=null!=n?n:{},[i,a]=l(e),s=(0,o.useCallback)((()=>i(t)),[i,t]);return(0,o.useEffect)((()=>{r&&s()}),[r,s]),[s,a]};var i=n(990445),a=r(n(164325)),o=n(667294),s=r(n(28916));function l(e){const t=(0,s.default)(e),n=(0,o.useRef)(),r=(0,o.useCallback)((()=>{n.current&&clearTimeout(n.current)}),[]),i=(0,o.useCallback)((e=>{r(),n.current=setTimeout(t,e)}),[r,t]);return(0,o.useEffect)((()=>r),[r]),[i,r]}},346787:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const n=(0,a.default)(t),[r,o]=(0,i.useState)(e),s=(0,i.useCallback)((()=>o((e=>{const t=!e;return n(t),t}))),[n]);return[r,s]};var i=n(667294),a=r(n(28916))},155793:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return(0,a.useContext)(i.default)};var i=r(n(8073)),a=n(667294)},189957:(e,t,n)=>{"use strict";var r=n(170315).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){const[e]=(0,i.useState)((()=>new r));return(0,i.useEffect)((()=>()=>e.abort()),[e]),e.signal};var i=n(667294)},65889:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.requireCallCollection=function(){return y.apply(this,arguments)},t.requireChatCollection=function(){return h.apply(this,arguments)},t.requireClearAppStates=function(){return p.apply(this,arguments)},t.requireContactCollection=function(){return l.apply(this,arguments)},t.requireEmojiAssetMapCreator=function(){return c.apply(this,arguments)},t.requireEmojiConfig=function(){return u.apply(this,arguments)},t.requireHandleVideoStreamingRequest=function(){return _.apply(this,arguments)},t.requireLabelCollection=function(){return f.apply(this,arguments)},t.requireMain=function(){return s.apply(this,arguments)},t.requireMsgCollection=function(){return g.apply(this,arguments)},t.requireSetFrontendHandlers=function(){return T.apply(this,arguments)},t.requireSetWorkerSafeHandlers=function(){return v.apply(this,arguments)},t.requireStatusV3Collection=function(){return d.apply(this,arguments)},t.requireStickerPackCollection=function(){return m.apply(this,arguments)},t.requireVoip=function(){return E.apply(this,arguments)},t.requireVoipCommonDisabled=function(){return S.apply(this,arguments)},t.setMainBundleModules=function(e){return a.resolve(e),e};var i=r(n(348926));const a=new(n(827653).Resolvable);function o(){return a.promise}function s(){return(s=(0,i.default)((function*(){return(yield o()).requireMain()}))).apply(this,arguments)}function l(){return(l=(0,i.default)((function*(){return(yield o()).requireContactCollection()}))).apply(this,arguments)}function u(){return(u=(0,i.default)((function*(){return(yield o()).requireEmojiConfig()}))).apply(this,arguments)}function c(){return(c=(0,i.default)((function*(){return(yield o()).requireEmojiAssetMapCreator()}))).apply(this,arguments)}function d(){return(d=(0,i.default)((function*(){return(yield o()).requireStatusV3Collection()}))).apply(this,arguments)}function p(){return(p=(0,i.default)((function*(){return(yield o()).requireClearAppStates()}))).apply(this,arguments)}function _(){return(_=(0,i.default)((function*(){return(yield o()).requireHandleVideoStreamingRequest()}))).apply(this,arguments)}function f(){return(f=(0,i.default)((function*(){return(yield o()).requireLabelCollection()}))).apply(this,arguments)}function h(){return(h=(0,i.default)((function*(){return(yield o()).requireChatCollection()}))).apply(this,arguments)}function g(){return(g=(0,i.default)((function*(){return(yield o()).requireMsgCollection()}))).apply(this,arguments)}function m(){return(m=(0,i.default)((function*(){return(yield o()).requireStickerPackCollection()}))).apply(this,arguments)}function y(){return(y=(0,i.default)((function*(){return(yield o()).requireCallCollection()}))).apply(this,arguments)}function E(){return(E=(0,i.default)((function*(){return(yield o()).requireVoip()}))).apply(this,arguments)}function S(){return(S=(0,i.default)((function*(){return(yield o()).requireVoipCommonDisabled()}))).apply(this,arguments)}function T(){return(T=(0,i.default)((function*(){return(yield o()).requireSetFrontendHandlers()}))).apply(this,arguments)}function v(){return(v=(0,i.default)((function*(){return(yield o()).requireSetWorkerSafeHandlers()}))).apply(this,arguments)}},981433:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.initModules=function(){u()};var a=i(n(751463)),o=n(209733),s=n(65889);const l={minTimeout:1e3,maxTimeout:12e4,retries:1/0,signal:(new r).signal};const u=(0,a.default)((function(){return(0,o.exponentialBackoff)(l,((e,t)=>Promise.all([n.e(9821),n.e(179)]).then(n.bind(n,570477)).catch((n=>(__LOG__(3)`failed to load main bundle`,10===t&&(__LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("failed to load main bundle")),e(n)))))).then((e=>(0,s.setMainBundleModules)(e)))}))},287866:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=r(n(530988)),o=r(n(618446)),s=n(490836),l=r(n(31579)),u=r(n(780246)),c=r(n(527539)),d=n(477540),p=n(427698),_=n(950079),f=n(272802),h=r(n(70469)),g=n(319983);class m{static create(){const{backgroundColor:e,tintColor:t}=g.DEFAULT_DOMINANT_COLOR.getBackgroundAndTintColors();return new m({id:Math.random(),frame:new u.default({origin:new l.default({x:0,y:0}),size:new c.default({width:0,height:0}),rotation:0,scale:0}),layers:[],paintLayer:new p.DrawLayer({size:c.default.empty(),type:p.DrawLayerType.Paint}),outlineLayer:new p.DrawLayer({size:c.default.empty(),type:p.DrawLayerType.Outline}),background:null,selectedLayer:null,backgroundColor:e,tintColor:t,rotation:0,cropFrame:new u.default({origin:new l.default({x:0,y:0}),size:new c.default({width:0,height:0}),rotation:0,scale:0})})}constructor(e){this._props=Object.freeze((0,i.default)({},e)),Object.freeze(this)}_update(e){const t=(0,i.default)({},this._props);return null!=e.layers&&(t.layers=e.layers),void 0!==e.paintLayer&&(t.paintLayer=e.paintLayer),void 0!==e.outlineLayer&&(t.outlineLayer=e.outlineLayer),void 0!==e.background&&(t.background=e.background),void 0!==e.frame&&(t.frame=e.frame,t.frame&&(t.cropFrame=t.cropFrame.updateXYWidthHeight({x:0,y:0,width:t.frame.width,height:t.frame.height}))),void 0!==e.cropFrame&&(t.cropFrame=e.cropFrame),void 0!==e.selectedLayer&&(t.selectedLayer=e.selectedLayer),null!=e.backgroundColor&&(t.backgroundColor=e.backgroundColor),null!=e.tintColor&&(t.tintColor=e.tintColor),null!=e.rotation&&(t.rotation=e.rotation),(0,o.default)(this._props,t)?this:new m(t)}updateLayer(e,t){if(e instanceof f.TextLayer&&!(t instanceof f.TextLayer)||e instanceof _.ImageLayer&&!(t instanceof _.ImageLayer))throw new TypeError("MediaEditorData: calling _updateLayer with two different layer types");if(e===t)return this;const n=this.layers.map((n=>n===e?t:n));let r=this.selectedLayer;return r===e&&(r=t),this._update({layers:n,selectedLayer:r})}setBackground(e,t){const{fitToSquare:n=!1,scale:r=1}=null!=t?t:{},i=_.ImageLayer.create({type:_.ImageLayerType.Background,origin:new l.default({x:0,y:0}),image:e,editable:!0,scale:r}),a=i.frame.dimension,o=n?u.default.create({x:0,y:0,width:a,height:a,scale:1,rotation:0}):i.frame,s=new l.default({x:(o.width-i.width)/2,y:(o.height-i.height)/2}),c=i.setScale(r).setOrigin(s),d=(0,g.getDominantColor)(e),{backgroundColor:f,tintColor:h}=d.getBackgroundAndTintColors(),m=new p.DrawLayer({size:o.size,type:p.DrawLayerType.Paint}),y=new p.DrawLayer({size:o.size,type:p.DrawLayerType.Outline});return this._update({background:c,frame:o,backgroundColor:f,tintColor:h,paintLayer:m,outlineLayer:y})}updateBackground(e,t,n,r){var i;const a=null===(i=this.background)||void 0===i?void 0:i.setImage(e).setOrigin(t).setRotation(n).setScale(r);return this._update({background:a,selectedLayer:a}).setBlurLayerBackground(null==a?void 0:a.frame,e)}addImageLayer(e){const t=_.ImageLayer.create(e),n=[...this.layers,t];return this._update({layers:n,selectedLayer:t})}addImageLayerToCenter(e){const t=this.toCanvasPoint(new l.default({x:this.screenWidth/2,y:this.screenHeight/2})),n=new l.default({x:t.x-e.image.width/2,y:t.y-e.image.height/2}),r=(0,i.default)({origin:n,rotation:-this.rotation},e);return this.addImageLayer(r)}addBlurLayer(e){const t=d.BlurLayer.create(e),n=[...this.layers,t];return this._update({layers:n,selectedLayer:t})}addBlurLayerToCenter(e){var t,n,r,a;const o=this.toCanvasPoint(new l.default({x:this.screenWidth/2,y:this.screenHeight/2})),s=new l.default({x:o.x-(null!==(t=null===(n=e.size)||void 0===n?void 0:n.width)&&void 0!==t?t:e.image.width)/2,y:o.y-(null!==(r=null===(a=e.size)||void 0===a?void 0:a.height)&&void 0!==r?r:e.image.height)/2}),u=(0,i.default)({origin:s},e);return this.addBlurLayer(u)}setBlurLayerBackground(e,t){const n=this.layers.map((n=>{let r=n;return r instanceof d.BlurLayer&&(null!=t&&(r=r.setImage(t)),null!=e&&(r=r.setBlurBackgroundFrame(e))),r}));return this._update({layers:n})}addTextLayer(e){const t=e instanceof f.TextLayer?e:f.TextLayer.create((0,i.default)((0,i.default)({},e),{},{rotation:-this.rotation})),n=[...this.layers,t];return this._update({layers:n,selectedLayer:t})}setText(e,t){return this.updateLayer(e,e.setText(t))}setTextColor(e,t){return this.updateLayer(e,e.setTextColor(t))}setTextBackground(e,t){return this.updateLayer(e,e.setTextBackground(t))}setFont(e,t){return this.updateLayer(e,e.setFont(t))}setAlignment(e,t){return this.updateLayer(e,e.setAlignment(t))}setBlurMode(e,t){return this.updateLayer(e,e.setBlurMode(t))}setBlurRadius(e,t){return this.updateLayer(e,e.setBlurRadius(t))}setBlurBackgroundFrame(e,t){return this.updateLayer(e,e.setBlurBackgroundFrame(t))}setRotation(e){if(e%90!=0)throw new Error("canvas can only be rotated at a 90 degrees interval");return this._update({rotation:e%360})}setCrop(e,t){if(e.x<0||e.y<0||e.x+t.width>this.width||e.y+t.height>this.height)throw new Error("canvas crop must stays within the frame bound");const n=new u.default({origin:e,size:t,rotation:0,scale:0});return this._update({cropFrame:n})}addEmptyTextLayer(e,t){const n={origin:new l.default({x:this.width/4,y:this.height/2}),text:"",textColor:e,textBackground:!1,font:t,alignment:s.TextAlignment.CENTER};return this.addTextLayer(n)}addPaintPath(e){const t=this.paintLayer.addPath(e);return this._update({paintLayer:t})}addOutlinePath(e){const t=this.outlineLayer.addPath(e);return this._update({outlineLayer:t})}cropToOutline(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;if(this.outlineLayer.isEmpty())return this;const n=this.outlineLayer.getAllPoints(),r=(0,h.default)(n,this.frame.rotation,this.frame.scale),i=null!=t?t:r.size.dimension,a=e*r.size.dimension/i,o=r.addPadding(a,this.frame);return this.setCrop(o.origin,o.size)}clearOutlinePaths(){const e=this.outlineLayer.clearPaths();return this._update({outlineLayer:e})}translateLayer(e,t){return this.updateLayer(e,e.setOrigin(t))}translateBackground(e){var t;const n=null===(t=this.background)||void 0===t?void 0:t.setOrigin(e);return this._update({background:n,selectedLayer:n}).setBlurLayerBackground(null==n?void 0:n.frame)}transformLayer(e,t,n,r){let i=e;return null!=r&&e instanceof d.BlurLayer&&(i=e.setFrame(r)),i=i.setRotation(t).setScale(n),this.updateLayer(e,i)}transformBackground(e,t){var n;const r=null===(n=this.background)||void 0===n?void 0:n.setRotation(e).setScale(t);return this._update({background:r,selectedLayer:r}).setBlurLayerBackground(null==r?void 0:r.frame)}setSelectedLayer(e){return this._update({selectedLayer:e})}moveToTop(e){if(this.layers[this.layers.length-1]===e)return this;const t=[...this.layers.filter((t=>t!==e)),e];return this._update({layers:t})}clearSelectedLayer(){return this._update({selectedLayer:null})}deleteLayer(e){e.delete();let t={layers:this.layers.filter((t=>t!==e))};return e===this.selectedLayer&&(t=(0,i.default)((0,i.default)({},t),{},{selectedLayer:null})),this._update(t)}deleteAllLayers(){return this.layers.forEach((e=>e.delete())),this._update({layers:[],paintLayer:new p.DrawLayer({size:this.size,type:p.DrawLayerType.Paint}),outlineLayer:new p.DrawLayer({size:this.size,type:p.DrawLayerType.Outline}),selectedLayer:null})}hasEdits(){return!this.paintLayer.isEmpty()||!this.outlineLayer.isEmpty()||this.layers.length>0||0!==this.rotation||!this.size.equals(this._props.cropFrame.size)}get layers(){return this._props.layers}get lastTextLayer(){const e=(0,a.default)(this.layers,(e=>e instanceof f.TextLayer));return e instanceof f.TextLayer?e:null}get paintLayer(){return this._props.paintLayer}get outlineLayer(){return this._props.outlineLayer}get background(){return this._props.background}get selectedLayer(){return this._props.selectedLayer}get backgroundColor(){return this._props.backgroundColor}get tintColor(){return this._props.tintColor}get size(){return this._props.frame.size}get frame(){return this._props.frame}get width(){return this._props.frame.width}get height(){return this._props.frame.height}get cropWidth(){return this._props.cropFrame.width}get cropHeight(){return this._props.cropFrame.height}get cropOrigin(){return this._props.cropFrame.origin}get cropSize(){return this._props.cropFrame.size}get cropCenter(){return this._props.cropFrame.getCenter()}get screenWidth(){return this.rotation%180==0?this.cropWidth:this.cropHeight}get screenHeight(){return this.rotation%180==0?this.cropHeight:this.cropWidth}get canvasCenter(){return new l.default({x:this.width/2,y:this.height/2})}get rotation(){return this._props.rotation}get id(){return this._props.id}toScreenPoint(e){const t=Math.max(this.width,this.height),n=new l.default({x:t/2,y:t/2}),r=new l.default({x:e.x+(t-this.width)/2,y:e.y+(t-this.height)/2}).rotate(n,this.rotation),i=new l.default({x:this.cropCenter.x+(t-this.width)/2,y:this.cropCenter.y+(t-this.height)/2}).rotate(n,this.rotation),a=new l.default({x:i.x-this.screenWidth/2,y:i.y-this.screenHeight/2});return new l.default({x:r.x-a.x,y:r.y-a.y})}toCanvasPoint(e){const t=Math.max(this.width,this.height),n=new l.default({x:t/2,y:t/2}),r=this.cropCenter.rotate(n,this.rotation),i=new l.default({x:r.x-this.screenWidth/2,y:r.y-this.screenHeight/2}),a=new l.default({x:e.x+i.x,y:e.y+i.y}).rotate(n,-this.rotation);return new l.default({x:a.x,y:a.y})}resetCropRotate(){return this.setRotation(0).setCrop(new l.default({x:0,y:0}),new c.default({width:this.width,height:this.height}))}isRotated(){return 0!==this.rotation}isCropped(){return!this.cropOrigin.equals(new l.default({x:0,y:0}))||!this.cropSize.equals(this.size)}isOutlined(){return!this.outlineLayer.isEmpty()}}t.default=m},358369:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.COLORS=void 0,t.getAllColors=function(){return Object.keys(i)},t.getColorValue=function(e){return a[e]};var r=n(102826);const i=Object.freeze({BLACK:"BLACK",GRAY:"GRAY",WHITE:"WHITE",BLUE:"BLUE",GREEN:"GREEN",PURPLE:"PURPLE",ORANGE:"ORANGE",RED:"RED"});t.COLORS=i;const a={[i.BLACK]:r.Color.fromHex("#434343"),[i.GRAY]:r.Color.fromHex("#9DA0A9"),[i.WHITE]:r.Color.fromHex("#FFFFFF"),[i.BLUE]:r.Color.fromHex("#33CEFF"),[i.GREEN]:r.Color.fromHex("#64DC2F"),[i.PURPLE]:r.Color.fromHex("#BD73FF"),[i.ORANGE]:r.Color.fromHex("#F49226"),[i.RED]:r.Color.fromHex("#FF4A4A")}},490836:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TextAlignment=t.FONTS=void 0,t.getAllFonts=function(){return Object.keys(i)},t.getFontStyle=function(e){return a[e]},t.getFontTranslation=function(e){switch(e){case i.SANS_SERIF:return r.fbt._("Sans Serif",null,{hk:"oqthG"});case i.SERIF:return r.fbt._("Serif",null,{hk:"1EWGvo"});case i.NORICAN_REGULAR:return r.fbt._("Norican",null,{hk:"RU2yb"});case i.BRYNDAN_WRITE:return r.fbt._("Bryndan Write",null,{hk:"2d40Ei"});case i.OSWALD_HEAVY:return r.fbt._("Oswald",null,{hk:"vyZEQ"});default:throw new Error("Unsupported font")}};var r=n(548360);const i=Object.freeze({SANS_SERIF:"SANS_SERIF",SERIF:"SERIF",NORICAN_REGULAR:"NORICAN_REGULAR",BRYNDAN_WRITE:"BRYNDAN_WRITE",OSWALD_HEAVY:"OSWALD_HEAVY"});t.FONTS=i;const a={[i.SANS_SERIF]:{fontFamily:"sans-serif"},[i.SERIF]:{fontFamily:'"Droid Serif", serif'},[i.NORICAN_REGULAR]:{fontFamily:'"Norican"'},[i.BRYNDAN_WRITE]:{fontFamily:'"Bryndan-Write"'},[i.OSWALD_HEAVY]:{fontFamily:'"Oswald"',fontWeight:"bold"}},o=n(76672).Mirrored(["LEFT","CENTER","RIGHT"]);t.TextAlignment=o},256883:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;class n{constructor(e){const{points:t,color:n,thickness:r,smoothing:i}=e;this._points=[...t],this._color=n,this._thickness=r,this._smoothing=i,Object.freeze(this)}update(e){let t=this.points,r=this.color,i=this.thickness,a=this.smoothing;return null!=e.points&&(t=e.points),null!=e.color&&(r=e.color),null!=e.thickness&&(i=e.thickness),null!=e.smoothing&&(a=e.smoothing),new n({points:t,color:r,thickness:i,smoothing:a})}clone(){const e={points:[...this.points],color:this.color.clone(),thickness:this.thickness,smoothing:this.smoothing};return new n(e)}toString(){return`points: [${this.points.map((e=>e.toString())).join(", ")}]\ncolor: ${this.color.toString()}\nthickness: ${this.thickness}`}equals(e){return this.color.equals(e.color)&&Math.abs(this.thickness-e.thickness)<Number.EPSILON&&this.points.length===e.points.length&&this.points.every(((t,n)=>t.equals(e.points[n])))}isDrag(){return this.points.length>1}isSmooth(){return this.smoothing||this.isDrag()}isStraight(){return!this.isSmooth()}get points(){return this._points}get color(){return this._color}get thickness(){return this._thickness}get smoothing(){return this._smoothing}}t.default=n},31579:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=r(n(618446));class o{constructor(e){this._props=Object.freeze((0,i.default)({},e)),Object.freeze(this)}update(e){const t=(0,i.default)({},this._props);return null!=e.x&&(t.x=e.x),null!=e.y&&(t.y=e.y),(0,a.default)(this._props,t)?this:new o(t)}clone(){return new o(this._props)}toString(){return`(${this.x}x, ${this.y}y)`}equals(e){return Math.abs(this.x-e.x)<Number.EPSILON&&Math.abs(this.y-e.y)<Number.EPSILON}distance(e){return Math.sqrt((e.x-this.x)**2+(e.y-this.y)**2)}rotate(e,t){const n=t*Math.PI/180,r=this.x-e.x,i=this.y-e.y,a=Math.cos(n)*r-Math.sin(n)*i+e.x,s=Math.sin(n)*r+Math.cos(n)*i+e.y;return new o({x:Math.round(100*a)/100,y:Math.round(100*s)/100})}get x(){return this._props.x}get y(){return this._props.y}}t.default=o},780246:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=r(n(618446)),o=r(n(31579)),s=r(n(527539));class l{static create(e){return new l({origin:new o.default({x:e.x,y:e.y}),size:new s.default({width:e.width,height:e.height}),rotation:e.rotation,scale:e.scale})}constructor(e){this._props=Object.freeze((0,i.default)({},e)),Object.freeze(this)}updateXYWidthHeight(e){const t=(0,i.default)({},this._props);return null==e.x&&null==e.y||(t.origin=t.origin.update({x:e.x,y:e.y})),null==e.width&&null==e.height||(t.size=t.size.update({width:e.width,height:e.height})),null!=e.rotation&&(t.rotation=e.rotation),null!=e.scale&&(t.scale=e.scale),this.update(t)}update(e){const t=(0,i.default)({},this._props);return null!=e.origin&&(t.origin=e.origin),null!=e.size&&(t.size=e.size),null!=e.rotation&&(t.rotation=e.rotation),null!=e.scale&&Math.abs(t.scale-e.scale)>1e-6&&(t.scale=e.scale),(0,a.default)(this._props,t)?this:new l(t)}clone(){return new l(this._props)}addPadding(e,t){const n=this.getTopLeft(),r=t.getTopLeft(),i=new o.default({x:Math.max(r.x,n.x-e),y:Math.max(r.y,n.y-e)}),a=this.getBottomRight(),s=t.getBottomRight(),l=new o.default({x:Math.min(s.x,a.x+e),y:Math.min(s.y,a.y+e)}),u=l.x-i.x,c=l.y-i.y;return this.updateXYWidthHeight({x:i.x,y:i.y,width:u,height:c})}toString(){return`(${this.origin.toString()}, ${this.size.toString()}, ${this.rotation}r)`}equals(e){return this.origin.equals(e.origin)&&this.size.equals(e.size)&&this.rotation===e.rotation&&this.scale===e.scale}contains(e){return e.x>=this.x&&e.y>=this.y&&e.x<this.x+this.width&&e.y<this.y+this.height}getTopLeft(){return new o.default({x:this.x,y:this.y})}getTopCenter(){return new o.default({x:this.x+this.width/2,y:this.y})}getTopRight(){return new o.default({x:this.x+this.width,y:this.y})}getLeftCenter(){return new o.default({x:this.x,y:this.y+this.height/2})}getCenter(){return new o.default({x:this.x+this.width/2,y:this.y+this.height/2})}getRightCenter(){return new o.default({x:this.x+this.width,y:this.y+this.height/2})}getBottomLeft(){return new o.default({x:this.x,y:this.y+this.height})}getBottomCenter(){return new o.default({x:this.x+this.width/2,y:this.y+this.height})}getBottomRight(){return new o.default({x:this.x+this.width,y:this.y+this.height})}get origin(){return this._props.origin}get size(){return this._props.size}get x(){return this.origin.x}get y(){return this.origin.y}get width(){return this.size.width}get height(){return this.size.height}get rotation(){return this._props.rotation}get scale(){return this._props.scale}get dimension(){return this.size.dimension}}t.default=l},527539:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=r(n(618446));class o{constructor(e){const{width:t,height:n}=e;if(t<0)throw new RangeError("MediaEditor:Size width cannot be negative");if(n<0)throw new RangeError("MediaEditor:Size height cannot be negative");this._props=Object.freeze({width:t,height:n}),Object.freeze(this)}update(e){const t=(0,i.default)({},this._props);return null!=e.width&&(t.width=e.width),null!=e.height&&(t.height=e.height),(0,a.default)(this._props,t)?this:new o(t)}clone(){return new o(this._props)}toString(){return`(${this.width}w, ${this.height}h)`}equals(e){return Math.abs(this.width-e.width)<Number.EPSILON&&Math.abs(this.height-e.height)<Number.EPSILON}isEmpty(){return this.equals(o.empty())}static empty(){return new o({width:0,height:0})}get width(){return this._props.width}get height(){return this._props.height}get dimension(){return Math.max(this.width,this.height)}}t.default=o},477540:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.BlurMode=t.BlurLayer=void 0;var i=r(n(81109)),a=r(n(618446)),o=r(n(780246)),s=n(674394);const l=n(76672).Mirrored(["Pixelate","Smooth"]);t.BlurMode=l;class u{static create(e){const t=e.image.width,n=e.image.height;if(!t||!n)throw new Error("Image must have valid width and height");return new u({id:(0,s.generateLayerId)("blur"),image:e.image,editable:!0,frame:new o.default({origin:e.origin,size:e.size,rotation:0,scale:1}),radius:e.radius,mode:e.mode,backgroundFrame:e.backgroundFrame,confirmed:!1})}constructor(e){this._props=Object.freeze((0,i.default)({},e)),Object.freeze(this)}delete(){}setOrigin(e){return this._update({frame:this.frame.update({origin:e})})}setRotation(e){return this._update({frame:this.frame.update({rotation:e})})}setScale(e){return this._update({frame:this.frame.update({scale:e})})}setFrame(e){return this._update({frame:e})}setImage(e){return this._update({image:e})}setEditable(e){return this._update({editable:e})}setBlurMode(e){return this._update({mode:e})}setBlurRadius(e){return this._update({radius:e})}setBlurBackgroundFrame(e){return this._update({backgroundFrame:e})}setConfirmed(){return this._update({confirmed:!0})}_update(e){const t=(0,i.default)({},this._props);return null!=e.image&&(t.image=e.image),null!=e.editable&&(t.editable=e.editable),null!=e.frame&&(t.frame=e.frame),null!=e.radius&&(t.radius=e.radius),null!=e.mode&&(t.mode=e.mode),null!=e.backgroundFrame&&(t.backgroundFrame=e.backgroundFrame),null!=e.confirmed&&(t.confirmed=e.confirmed),(0,a.default)(this._props,t)?this:new u(t).setConfirmed()}get image(){return this._props.image}get editable(){return this._props.editable}get id(){return this._props.id}get frame(){return this._props.frame}get origin(){return this._props.frame.origin}get size(){return this._props.frame.size}get x(){return this._props.frame.x}get y(){return this._props.frame.y}get width(){return this._props.frame.width}get height(){return this._props.frame.height}get rotation(){return this._props.frame.rotation}get scale(){return this._props.frame.scale}get mode(){return this._props.mode}get radius(){return this._props.radius}get backgroundFrame(){return this._props.backgroundFrame}get confirmed(){return this._props.confirmed}}t.BlurLayer=u},427698:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DrawLayerType=t.DrawLayer=void 0;var i=r(n(256883)),a=r(n(31579)),o=r(n(780246)),s=n(674394);const l=n(76672).Mirrored(["Paint","Outline"]);t.DrawLayerType=l;class u{constructor(e){if(this._type=e.type,null!=e.size){const t=e.size;this._frame=new o.default({origin:new a.default({x:0,y:0}),size:t,rotation:0,scale:1}),this._paths=[]}else null!=e.frame&&null!=e.paths&&(this._frame=e.frame,this._paths=e.paths);e.id?this._id=e.id:this._id=(0,s.generateLayerId)(e.type),Object.freeze(this)}delete(){}_update(e){let t=this._paths;null!=e.paths&&(t=e.paths);const n=this._frame,r=this._type;return new u({id:this.id,paths:t,frame:n,type:r})}setOrigin(){throw new TypeError("MediaEditor:DrawLayer resetting origin is not allowed")}setRotation(){throw new TypeError("MediaEditor:DrawLayer resetting rotation is not allowed")}setScale(){throw new TypeError("MediaEditor:DrawLayer resetting scale is not allowed")}addPath(e){const t=new i.default(e),n=[...this._paths,t];return this._update({paths:n})}clearPaths(){return this._update({paths:[]})}isEmpty(){return 0===this._paths.length}getAllPoints(){return this.paths.reduce(((e,t)=>(!t.smoothing&&e.length&&e.push(e[e.length-1]),t.isDrag()&&e.push(t.points[0]),e.push(...t.points.flatMap((e=>t.isSmooth()?[e]:[e,e]))),e)),[])}get paths(){return this._paths}get editable(){return!1}get id(){return this._id}get type(){return this._type}get frame(){return this._frame}get origin(){return this._frame.origin}get size(){return this._frame.size}get x(){return this._frame.x}get y(){return this._frame.y}get width(){return this._frame.width}get height(){return this._frame.height}get rotation(){return this._frame.rotation}get scale(){return this._frame.scale}}t.DrawLayer=u},950079:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ImageLayerType=t.ImageLayer=void 0;var i=r(n(81109)),a=r(n(618446)),o=r(n(780246)),s=r(n(527539)),l=n(674394);const u=n(76672).Mirrored(["Image","Emoji","Sticker","Background"]);t.ImageLayerType=u;class c{static create(e){var t;const n=e.image.width,r=e.image.height;if(!n||!r)throw new Error("Image must have valid width and height");return new c({id:(0,l.generateLayerId)("image"),type:e.type,image:e.image,editable:e.editable,frame:new o.default({origin:e.origin,size:new s.default({width:n,height:r}),rotation:null!==(t=e.rotation)&&void 0!==t?t:0,scale:e.scale})})}constructor(e){this._props=Object.freeze((0,i.default)({},e)),Object.freeze(this)}delete(){}setOrigin(e){return this._update({frame:this.frame.update({origin:e})})}setRotation(e){return this._update({frame:this.frame.update({rotation:e})})}setScale(e){return this._update({frame:this.frame.update({scale:e})})}setFrame(e){return this._update({frame:e})}setImage(e){return this._update({image:e})}setEditable(e){return this._update({editable:e})}_update(e){const t=(0,i.default)({},this._props);if(null!=e.image){const n=e.image.width,r=e.image.height;if(!n||!r)throw new Error("Image must have valid width and height");t.image=e.image,t.frame=new o.default({origin:this.frame.origin,size:new s.default({width:n,height:r}),rotation:this.frame.rotation,scale:this.frame.scale})}return null!=e.editable&&(t.editable=e.editable),null!=e.frame&&(t.frame=e.frame),(0,a.default)(this._props,t)?this:new c(t)}get image(){return this._props.image}get editable(){return this._props.editable}get id(){return this._props.id}get frame(){return this._props.frame}get origin(){return this._props.frame.origin}get size(){return this._props.frame.size}get x(){return this._props.frame.x}get y(){return this._props.frame.y}get width(){return this._props.frame.width}get height(){return this._props.frame.height}get rotation(){return this._props.frame.rotation}get scale(){return this._props.frame.scale}isSticker(){return this._props.type===u.Sticker}isEmoji(){return this._props.type===u.Emoji}isBackground(){return this._props.type===u.Background}}t.ImageLayer=c},272802:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.TextLayer=t.DEFAULT_FONT_SIZE=void 0;var i=r(n(81109)),a=r(n(618446)),o=n(358369),s=(n(490836),r(n(31579))),l=r(n(780246)),u=r(n(527539)),c=n(102826),d=n(674394),p=n(385323),_=n(920202);t.DEFAULT_FONT_SIZE=18;const f={lineVerticalPadding:6,lineHorizontalPadding:8,layerPadding:6,backgroundBorderRadius:5,backgroundShadow:{offsetX:0,offsetY:1,radius:6,spread:0,color:new c.Color(0,0,0,.32)}};class h{static create(e){var t;const n=[],r=g(n,f);let i=0;return null!=e.rotation&&(i=e.rotation),new h({id:(0,d.generateLayerId)("text"),text:"",textColor:e.textColor,textBackground:e.textBackground,font:e.font,alignment:e.alignment,lines:n,frame:new l.default({origin:new s.default({x:e.origin.x-r.width/2,y:e.origin.y-r.height/2}),size:r,rotation:i,scale:null!==(t=e.scale)&&void 0!==t?t:1}),maxWidth:0,backgroundPath:""}).setText(e.text)}constructor(e){this._props=Object.freeze((0,i.default)({},e)),Object.freeze(this)}delete(){}setOrigin(e){return this._update({frame:this.frame.update({origin:e})})}setRotation(e){return this._update({frame:this.frame.update({rotation:e})})}setScale(e){return this._update({frame:this.frame.update({scale:e})})}setText(e){return this._update({text:e})}setTextColor(e){return this._update({textColor:e})}setTextBackground(e){return this._update({textBackground:e})}setFont(e){return this._update({font:e})}setAlignment(e){return this._update({alignment:e})}_update(e){const t=(0,i.default)({},this._props);if(null!=e.frame&&(t.frame=e.frame),null!=e.textColor&&(t.textColor=e.textColor),null!=e.textBackground&&(t.textBackground=e.textBackground),null!=e.text&&e.text!==t.text||null!=e.font&&e.font!==t.font){var n,r;t.text=null!==(n=e.text)&&void 0!==n?n:t.text,t.font=null!==(r=e.font)&&void 0!==r?r:t.font,t.lines=(0,_.getLines)(t.text,t.font,18,this._props.maxWidth);const i=g(t.lines,f),a=t.frame.size,o=t.frame.origin,l=new s.default({x:o.x+a.width/2-i.width/2,y:o.y+a.height/2-i.height/2});t.frame=t.frame.update({origin:l,size:i})}if(null!=e.alignment&&(t.alignment=e.alignment),this.font!==t.font||this.text!==t.text||this.alignment!==t.alignment){const e=t.lines.map((e=>e.width));t.backgroundPath=(0,p.generateTextBackgroundPath)(e,t.alignment,{lineVerticalPadding:this.styles.lineVerticalPadding,lineHorizontalPadding:this.styles.lineHorizontalPadding,lineHeight:this.lineHeight,arcSize:this.styles.backgroundBorderRadius})}return(0,a.default)(this._props,t)?this:new h(t)}get lines(){return this._props.lines}get linesOfText(){return this.lines.map((e=>e.text))}get lineWidths(){return this.lines.map((e=>e.width))}get numberOfLines(){return this.lines.length}get fontSize(){return 18}get lineHeight(){return this.fontSize}get styles(){return f}get text(){return this._props.text}get textColor(){return this._props.textColor}get textBackgroundColor(){return this.textColor.isLight()?(0,o.getColorValue)(o.COLORS.BLACK):(0,o.getColorValue)(o.COLORS.WHITE)}get textBackground(){return this._props.textBackground}get font(){return this._props.font}get editable(){return!0}get id(){return this._props.id}get alignment(){return this._props.alignment}get frame(){return this._props.frame}get origin(){return this.frame.origin}get size(){return this.frame.size}get x(){return this.frame.x}get y(){return this.frame.y}get width(){return this.frame.width}get height(){return this.frame.height}get rotation(){return this.frame.rotation}get scale(){return this.frame.scale}get backgroundPath(){return this._props.backgroundPath}}function g(e,t){const n=Math.max(...e.map((e=>e.width)),0)+2*t.lineHorizontalPadding+2*t.layerPadding,r=e.length*(18+2*t.lineVerticalPadding)+2*t.layerPadding;return new u.default({width:n,height:r})}t.TextLayer=h},102826:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Color=void 0,t.cleanHex=s,t.compareHex=function(e,t){if(!e||!t)return!1;const n=s(e),r=s(t);if(n===r)return!0;let i=0,a=0;for(;i<e.length;){if(n[i]!==r[a]||n[i]!==r[a+1])return!1;i+=1,a+=2}return!0},t.isValidHex=function(e){if(!e)return!1;const t=s(e);if(3===t.length)return n.test(t);if(6===t.length)return r.test(t);return!1};const n=/^[0-9A-F]{3}$/i,r=/^[0-9A-F]{6}$/i;class i{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(e<0||e>255)throw new RangeError(`red (${e} given) should be >= 0 and <= 255`);if(t<0||t>255)throw new RangeError(`green (${t} given) should be >= 0 and <= 255`);if(n<0||n>255)throw new RangeError(`blue (${n} given) should be >= 0 and <= 255`);if(r<0||r>1)throw new RangeError(`alpha (${r} given) should be >= 0 and <= 1`);this._red=e,this._green=t,this._blue=n,this._alpha=r}static fromHex(e){let t=e.trim().toLowerCase();if(t.length&&"#"===t[0]&&(t=t.substr(1)),3!==t.length&&6!==t.length)throw new RangeError(`hex ${e} does not have 3 or 6 digits`);3===t.length&&(t=`${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}`);const n=parseInt(t.substr(0,2),16),r=parseInt(t.substr(2,2),16),a=parseInt(t.substr(4,2),16);if(isNaN(n)||isNaN(r)||isNaN(a))throw new RangeError(`hex ${e} is invalid`);return new i(n,r,a,1)}static _fromHsl(e,t,n){let r,o,s;if(0===t||0===n)r=o=s=n;else{const i=n<.5?n*(1+t):n+t-n*t,l=2*n-i;r=a(l,i,e+1/3),o=a(l,i,e),s=a(l,i,e-1/3)}return new i(Math.round(255*r),Math.round(255*o),Math.round(255*s))}toRgb(){return{red:this._red,green:this._green,blue:this._blue}}toRgba(){return{red:this._red,green:this._green,blue:this._blue,alpha:this._alpha}}toRgbString(){return`rgb(${this._red}, ${this._green}, ${this._blue})`}toRgbaString(){return`rgba(${this._red}, ${this._green}, ${this._blue}, ${this._alpha})`}toHex(){return`#${o(this._red.toString(16),2)}${o(this._green.toString(16),2)}${o(this._blue.toString(16),2)}`.toUpperCase()}toHsl(){const e=this._red/255,t=this._green/255,n=this._blue/255,r=Math.max(e,t,n),i=Math.min(e,t,n);let a=(r+i)/2,o=(r+i)/2;const s=(r+i)/2;if(r===i)a=o=0;else{const l=r-i;switch(o=s>.5?l/(2-r-i):l/(r+i),r){case e:a=(t-n)/l+(t<n?6:0);break;case t:a=(n-e)/l+2;break;case n:a=(e-t)/l+4}a/=6}return{hue:a,saturation:o,lightness:s}}getBackgroundAndTintColors(){const{hue:e,saturation:t,lightness:n}=this.toHsl();let r,a;if(n<.55&&t>.1){let o=e;e>.08&&e<.22&&(o=e<.08+.14?.08:.22),r=i._fromHsl(o,t<.01?0:Math.max(t,.75),Math.min(n,.25)),a=new i(255,255,255,1)}else r=i._fromHsl(e,Math.min(t,.33),Math.max(n,.9)),a=i._fromHsl(e,0===t?0:.4,.2);return{backgroundColor:r,tintColor:a}}withAlpha(e){return new i(this._red,this._green,this._blue,e)}isLight(){return.299*this._red+.587*this._green+.114*this._blue>190}isWhite(){const{lightness:e}=this.toHsl();return e>=.996}equals(e){return this._red===e._red&&this._green===e._green&&this._blue===e._blue&&this._alpha===e._alpha}clone(){return new i(this._red,this._green,this._blue,this._alpha)}toString(){return`(${this._red}, ${this._green}, ${this._blue}, ${this._alpha})`}get red(){return this._red}get green(){return this._green}get blue(){return this._blue}get alpha(){return this._alpha}}function a(e,t,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function o(e,t){return e.length>=t?e:"0".repeat(t-e.length)+e}function s(e){let t=e.trim();return"#"===t.substring(0,1)&&(t=t.substring(1).toLowerCase()),t}t.Color=i,i.Black=new i(0,0,0),i.White=new i(255,255,255)},674394:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateLayerId=function(e){const t=Math.random().toString(36).substring(2,10);return`${e}-${t}`}},70469:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){let r=1/0,a=1/0,o=0,s=0;e.forEach((e=>{const t=e.x,n=e.y;t<r&&(r=t),t>o&&(o=t),n<a&&(a=n),n>s&&(s=n)}));const l=o-r,u=s-a;return i.default.create({x:r,y:a,width:l,height:u,rotation:t,scale:n})};var i=r(n(780246))},319983:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_DOMINANT_COLOR=void 0,t.getDominantColor=function(e){const t=function(e){const t=document.createElement("canvas"),n=t.getContext("2d");if(!n)return null;const r=t.height=e.height,i=t.width=e.width;n.drawImage(e,0,0);try{return n.getImageData(0,0,i,r).data}catch(e){return null}}(e);return t?function(e){let t=0,n=0,i=0,a=0,o=0;for(let r=0;r<e.length;r+=20){const s=e[r+3],l=e[r]*s,u=e[r+1]*s,c=e[r+2]*s;t+=l,n+=u,i+=c,a+=s,o++}return a?new r.Color(Math.round(t/a),Math.round(n/a),Math.round(i/a),Math.round(a/o)/255):new r.Color(0,0,0,0)}(t):i};var r=n(102826);const i=new r.Color(220,220,220);t.DEFAULT_DOMINANT_COLOR=i},385323:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateTextBackgroundPath=function(e,t,n){const a=n.arcSize,o=[],s=[],l=Math.max(...e),u=n.lineHeight+2*n.lineVerticalPadding;e.forEach(((i,a)=>{const c=i+2*n.lineHorizontalPadding;let d=0;switch(t){case r.TextAlignment.LEFT:d=0;break;case r.TextAlignment.CENTER:d=(l-i)/2;break;case r.TextAlignment.RIGHT:d=l-i}const p=a*u;o.push({y:p,x:d}),s.push({y:p,x:d+c}),a===e.length-1&&(o.push({y:p+u,x:d}),s.push({y:p+u,x:d+c}))}));let c=[];for(let{left:e,points:t}of[{left:!0,points:o},{left:!1,points:s}]){let n=t,r=!0;for(;r;){t=n,n=[],r=!1;for(let i=0;i<t.length;i++){const o=t[i];if(0===i)n.push(o);else{n.length>=2&&n[n.length-1].x===n[n.length-2].x&&(n.pop(),r=!0);const t=n[n.length-1];o.x!==t.x&&Math.abs(o.x-t.x)<2*a&&(r=!0,e&&t.x<o.x||!e&&t.x>o.x?o.x=t.x:t.x=o.x),n.push(o)}}}const i=[];for(let e=0;e<n.length;e++){const t=n[e];if(0===e||e===n.length-1){i.push(t);continue}const r=n[e-1];if(t.x!==r.x){const e={x:r.x,y:t.y},n=i.length-1;i.length>=2&&i[n].x===e.x&&i[n].x===i[n-1].x&&i.pop(),i.push(e)}i.push(t)}e||i.reverse(),c=c.concat(i)}return function(e,t){function n(t){return 0===t?e[e.length-1]:e[t-1]}function r(t){return t===e.length-1?e[0]:e[t+1]}const a=[];for(let o=0;o<e.length;o++){const{start:s,end:l,clockwise:u}=i(e[o],n(o),r(o),t),c=o===e.length-1?0:o+1,{start:d}=i(e[c],n(c),r(c),t);0===o&&a.push(`M ${s.x},${s.y}`),a.push(`A ${t},${t} 0 0 ${u?1:0} ${l.x},${l.y}`),a.push(`L ${d.x},${d.y}`)}return a.push("Z"),a.join("\n")}(c,a)};var r=n(490836);function i(e,t,n,r){const i=t.y===e.y,a={y:i?e.y:t.y>e.y?e.y+r:e.y-r,x:i?t.x>e.x?e.x+r:e.x-r:e.x},o=e.y===n.y;return{start:a,end:{y:o?e.y:n.y>e.y?e.y+r:e.y-r,x:o?n.x>e.x?e.x+r:e.x-r:e.x},clockwise:i&&(t.y<n.y&&t.x<n.x||t.x>n.x&&t.y>n.y)||!i&&(t.y<n.y&&t.x>n.x||t.x<n.x&&t.y>n.y)}}},920202:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLines=function(e,t,n,r){const a=[];for(const s of e.split("\n")){if(""===s){a.push({text:"",width:0,words:[]});continue}const e=s.split(" ");let l="",u=0,c=[];for(let s=0;s<e.length;s++){const d=(0!==s?" ":"")+e[s],p=l+d,_=o(p,t,n);if(r>0&&_>r&&u>0)a.push({text:l,width:u,words:c}),l="",u=0,c=[],s--;else{l=p,u=_;for(const e of d.split(i.EmojiUtil.emojiRegex())){if(!e)continue;let r=null;i.EmojiUtil.isEmoji(e)&&(r=i.EmojiUtil.getGlyphPath(e,64));const a=o(e,t,n);c.push({text:e,width:a,emojiPath:r})}}}u>0&&a.push({text:l,width:u,words:c})}return a},t.getTextBounds=function(e,t){const n=`${t}px ${(0,r.getFontStyle)(e).fontFamily}`,i=l.get(n);if(null!=i)return i;const a="ABCDEF",u=Math.round(o(a,e,t)),c=t,d=s().getContext("2d");d.textBaseline="middle",d.font=n,d.fillStyle="red",d.fillText(a,0,c/2);const p=d.getImageData(0,0,u,c).data;let _=1/0,f=1/0,h=1/0;for(let e=0;e<u;e++)for(let t=0;t<c;t++){p[4*(t*u+e)+3]>0&&(f=Math.min(f,t),_=Math.min(_,e),h=Math.min(h,c-t))}d.clearRect(0,0,u,c);const g={top:f,left:_,bottom:h};return l.set(d.font,g),g};var r=n(490836),i=n(429334);let a;function o(e,t,n){const a=s().getContext("2d");a.font=`${n}px ${(0,r.getFontStyle)(t).fontFamily}`;let o=0;for(const t of e.split(i.EmojiUtil.emojiRegex()))i.EmojiUtil.isEmoji(t)?o+=n:o+=a.measureText(t).width;return o}function s(){return null==a&&(a=document.createElement("canvas"),a.width=9999,a.height=99),a}const l=new Map},82560:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.logPnhRequestRevealActionHelper=function(){return l.apply(this,arguments)};var i=r(n(348926)),a=n(965012),o=r(n(571834)),s=n(508133);function l(){return(l=(0,i.default)((function*(e,t,n,r){const i=a.ChatCollection.getActive();i&&new o.default.PnhRequestRevealAction({pnhChatType:e,pnhChatParty:t,threadId:yield(0,s.getChatThreadID)(i.id.toJid()),pnhAction:n,pnhEntryPoint:r}).commit()}))).apply(this,arguments)}},276409:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return(0,l.useEffect)((()=>{o.Updater.restart(!0).then((()=>{o.Updater.restart()}))}),[]),(0,c.jsxs)(s.Modal,{cover:!0,title:i.default.t(640),children:[(0,c.jsx)("div",{children:i.default.t(639)}),(0,c.jsx)("div",{className:(0,u.default)(d),children:(0,c.jsx)(a.Spinner,{stroke:4,size:40,color:"highlight"})})]})};var i=r(n(932325)),a=n(956113),o=n(366320),s=n(192961),l=n(667294),u=r(n(156720)),c=n(785893);const d={display:"p357zi0d",justifyContent:"ac2vgrno",marginTop:"nylzjxre",marginEnd:"lfum0007",marginBottom:"bvhm1occ",marginStart:"r6x3u63k"}},827350:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommunityLeaveRetryError=function(e){const{onOK:t}=e;return(0,s.jsx)(a.ConfirmPopup,{onOK:t,okText:o.fbt._("RETRY",null,{hk:"31zj1D"}),onCancel:l,children:(0,s.jsx)(i.TextParagraph,{size:"16",children:o.fbt._("There was a problem leaving all groups in this community. Please try again.",null,{hk:"22x9gm"})})})},t.CommunityLeaveStandardError=function(){return(0,s.jsx)(a.ConfirmPopup,{onOK:l,children:(0,s.jsx)(i.TextParagraph,{size:"16",children:o.fbt._("Could not leave all groups in this community.",null,{hk:"4FoEW5"})})})},t.CommunityLeaveTryAgainLaterError=function(){return(0,s.jsx)(a.ConfirmPopup,{onOK:l,children:(0,s.jsx)(i.TextParagraph,{size:"16",children:o.fbt._("Something went wrong. Please try again later.",null,{hk:"3ScUVF"})})})};var r=n(114850),i=n(180519),a=n(744259),o=n(548360),s=n(785893);function l(){r.ModalManager.close()}},744259:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ConfirmPopupTheme=t.ConfirmPopup=void 0;var i=r(n(81109)),a=r(n(692629)),o=n(690495),s=n(81644),l=n(50010),u=n(192961),c=n(548360),d=n(667294),p=r(n(156720)),_=n(785893);const f=n(76672).Mirrored(["PollsCancelationPrompt"]);t.ConfirmPopupTheme=f;const h=(e,t)=>{var n;const r=t=>{var n;t.stopPropagation(),t.preventDefault(),null===(n=e.onCancel)||void 0===n||n.call(e)},d=e.onOK?(0,_.jsx)(a.default,{testid:"popup-controls-ok",type:e.okButtonType?e.okButtonType:"primary",onClick:t=>{var n;t.stopPropagation(),t.preventDefault(),null===(n=e.onOK)||void 0===n||n.call(e)},disabled:e.okDisabled,spinner:!0===e.okSpinner,xstyle:e.buttonStyle,children:null!=e.okText?e.okText:c.fbt._("OK",null,{hk:"2KEeHb"})}):null,h=e.onCancel?(0,_.jsx)(a.default,{testid:"popup-controls-cancel",type:e.onOK?e.theme===f.PollsCancelationPrompt?"warning-secondary":"secondary":"primary",disabled:e.cancelDisabled,onClick:r,xstyle:e.buttonStyle,children:e.cancelText||c.fbt._("Cancel",null,{hk:"H0gNq"})}):null,m=e.extraButtonProps?(0,_.jsx)(g,(0,i.default)({xstyle:e.buttonStyle},e.extraButtonProps)):null,y={escape:e.onCancel?r:()=>{}};let E;return E=m?(0,_.jsxs)(o.FlexColumn,{align:"end",xstyle:e.buttonContainerStyle,children:[(0,_.jsx)("div",{children:h}),(0,_.jsx)("div",{className:(0,p.default)(l.uiMargin.top12),children:m}),(0,_.jsx)("div",{className:(0,p.default)(l.uiMargin.top12),children:d})]}):(0,_.jsxs)("div",{className:(0,p.default)(e.buttonContainerStyle),children:[h,d]}),(0,_.jsx)(s.HotKeys,{handlers:y,ref:t,children:(0,_.jsx)(u.Modal,{actions:E,children:e.children,cover:e.cover,onDragChange:e.onDragChange,onDrop:e.onDrop,type:e.type,title:e.title,testid:null!==(n=e.testid)&&void 0!==n?n:"confirm-popup"})})};function g(e){const{primary:t=!1,disabled:n=!1,spinner:r=!1,text:i,onClick:o,xstyle:s}=e;return(0,_.jsx)(a.default,{testid:"popup-controls-extra",type:t?"primary":"secondary",onClick:e=>{e.stopPropagation(),e.preventDefault(),o()},disabled:n,spinner:r,xstyle:s,children:i})}const m=(0,d.forwardRef)(h);t.ConfirmPopup=m},248380:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{children:t,cancelText:n,onCancel:a,okText:o,onOK:s}=e;return(0,i.jsx)(r.ConfirmPopup,{cover:!0,children:t,cancelText:n,onCancel:a,okText:o,onOK:s})};var r=n(744259),i=n(785893)},433304:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=r(n(348926)),o=n(36530),s=n(780549),l=n(359484),u=n(6961),c=n(673168),d=n(391186),p=n(667294),_=n(148725),f=r(n(189957)),h=n(785893);const g=n(76672).Mirrored(["INITIAL_LOAD","CONNECTING","FAKE_FILL","DOWNLOADING","ORGANIZING"]),m=n(76672).Mirrored(["NOT_STARTED","STARTED","PAST_MIN_TIME"]);var y=e=>{let{onReady:t,onLogout:n,initialLoadReady:r}=e;const y=(0,f.default)(),E=(0,p.useRef)(!1),[S,T]=(0,p.useState)(r?d.Stage.CONNECTING:d.Stage.INITIAL_LOAD),[v]=(0,p.useState)((0,c.getInitialHistorySyncCompleteLocalStorage)()),[A,C]=(0,p.useState)({INITIAL_LOAD:r?m.PAST_MIN_TIME:m.NOT_STARTED,CONNECTING:m.NOT_STARTED,FAKE_FILL:m.NOT_STARTED,DOWNLOADING:m.NOT_STARTED,ORGANIZING:m.NOT_STARTED}),[P,O]=(0,p.useState)(0),[I,M]=(0,p.useState)(null);(0,_.useListener)(s.Cmd,"offline_progress_update",(()=>{const e=l.OfflineMessageHandler.getHasMessagesToDownload();null==I&&null!=e&&M(e),!0===e&&A.CONNECTING===m.PAST_MIN_TIME&&O(l.OfflineMessageHandler.getOfflineDeliveryProgress())}));const b=(0,p.useCallback)(function(){var e=(0,a.default)((function*(e,t){C((t=>(0,i.default)((0,i.default)({},t),{},{[e]:m.STARTED}))),__LOG__(2)`DebouncedLoadingScreen: ${e} - starts minimum display time`,yield(0,o.delayMs)(t),y.aborted||(C((t=>(0,i.default)((0,i.default)({},t),{},{[e]:m.PAST_MIN_TIME}))),__LOG__(2)`DebouncedLoadingScreen: ${e} - ends minimum display time`)}));return function(){return e.apply(this,arguments)}}(),[y]),{CONNECTING:R,DOWNLOADING:N,ORGANIZING:w,FAKE_FILL:L,INITIAL_LOAD:D}=A;(0,p.useEffect)((()=>{if(w===m.PAST_MIN_TIME)E.current||(t(),E.current=!0);else if(N===m.PAST_MIN_TIME&&P>=100&&w===m.NOT_STARTED)(0,o.delayMs)(450).then((()=>{y.aborted||(T(d.Stage.ORGANIZING),b(g.ORGANIZING,800))}));else if(R===m.PAST_MIN_TIME&&null!=I&&N===m.NOT_STARTED&&L===m.NOT_STARTED){const e=l.OfflineMessageHandler.getFinishedDownloading();I&&!e?(T(d.Stage.DOWNLOADING),O(l.OfflineMessageHandler.getOfflineDeliveryProgress()),b(g.DOWNLOADING,450)):(O(100),b(g.FAKE_FILL,450).then((()=>{y.aborted||(u.Socket.hasSynced?E.current||(t(),E.current=!0):(T(d.Stage.ORGANIZING),b(g.ORGANIZING,800)))})))}else r&&D===m.PAST_MIN_TIME&&R===m.NOT_STARTED?(T(d.Stage.CONNECTING),b(g.CONNECTING,1500)):D===m.NOT_STARTED&&b(g.INITIAL_LOAD,500)}),[P,t,I,b,y,r,R,N,w,L,D]);let k=d.LoadingScreenTheme.MULTI_STAGE;return r&&(k=v?!0===I?d.LoadingScreenTheme.UNIFIED_WITH_PROGRESS:d.LoadingScreenTheme.LOGO:d.LoadingScreenTheme.UNIFIED),(0,h.jsx)(d.LoadingScreen,{stage:S,progress:P,onLogout:n,theme:k})};t.default=y},324761:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(932325)),a=n(332108),o=n(6961),s=n(744259),l=n(548360),u=n(785893);t.default=()=>(0,u.jsx)(s.ConfirmPopup,{cover:!0,cancelText:i.default.t(443),onCancel:o.Socket.logout.bind(o.Socket,!0,a.LogoutReason.UserInitiated),okText:i.default.t(421),onOK:o.Socket.poke.bind(o.Socket),children:l.fbt._('The version of WhatsApp on your phone is too old. Please update to the latest version, then click "LOG IN" to continue using WhatsApp.',null,{hk:"2gorpJ"})})},890732:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(667294),a=r(n(156720)),o=r(n(207100)),s=n(785893);const l={position:"lhggkp7q",top:"qq0sjtgm",start:"tkdu00h0",zIndex:"atxxqlz9",width:"ln8gz9je",height:"ppled2lx"};function u(e,t){const{disableFromWithin:n,onDrop:r,onDragChange:u}=e,[c,d]=(0,i.useState)(!1),[p,_]=(0,i.useState)(!1),[f,h]=(0,i.useState)(!1),g=(0,o.default)(p),m=()=>{n&&d(!0)},y=()=>{n&&d(!1)},E=e=>{e.preventDefault(),e.stopPropagation(),p||c||(_(!0),h(!1),function(e){if(e.dataTransfer){try{if(!e.dataTransfer.dropEffect)return}catch(e){return}e.dataTransfer.effectAllowed&&(e.nativeEvent.dataTransfer.dropEffect="copy")}}(e))};return(0,i.useEffect)((()=>{null!=g&&g!==p&&u&&u(p,f)}),[f,p,u,g]),(0,i.useImperativeHandle)(t,(()=>({onDragStart:m,onDragEnd:y,onDragOver:E}))),(0,s.jsx)("div",{className:(0,a.default)(l),style:p?{}:{display:"none"},onDragLeave:e=>{e.preventDefault(),e.stopPropagation(),p&&(_(!1),h(!1))},onDrop:e=>{e.preventDefault(),e.stopPropagation(),_(!1),h(!0),r&&!c&&r(e)}},"mask")}var c=(0,i.forwardRef)(u);t.default=c},845979:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return(0,p.jsx)(c.ConfirmPopup,{cover:!0,cancelText:i.default.t(443),onCancel:_,okText:d.fbt._("UPDATE",null,{hk:"2YdJcK"}),onOK:f,children:d.fbt._("Please update to the latest version of WhatsApp. This version has expired.",null,{hk:"2Gcdji"})})};var i=r(n(932325)),a=n(332108),o=n(871850),s=n(6961),l=n(366320),u=r(n(571834)),c=n(744259),d=n(548360),p=n(785893);function _(){var e;s.Socket.logout(!0,a.LogoutReason.UserInitiated),new u.default.CompanionForceUpgradeUserActionV2({forceUpgradeUserActionV2:u.default.FORCE_UPGRADE_USER_ACTION_TYPE_V2.LOGOUT,forceUpgradeReasonV2:null!==(e=o.PrimaryForceUpgrade.forceUpgradeReason)&&void 0!==e?e:""}).commit()}function f(){var e;new u.default.CompanionForceUpgradeUserActionV2({forceUpgradeUserActionV2:u.default.FORCE_UPGRADE_USER_ACTION_TYPE_V2.UPGRADE,forceUpgradeReasonV2:null!==(e=o.PrimaryForceUpgrade.forceUpgradeReason)&&void 0!==e?e:""}).commit(),l.Updater.update(null,!0,0)}},900316:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DrawerManager=void 0;var i=r(n(395654));class a extends i.default{setDrawerContext(e,t){this.trigger(`update_context_${e}`,t)}openDrawerRight(e,t){this.trigger("open_drawer_right",e,t)}openDrawerMid(e,t){this.trigger("open_drawer_mid",e,t)}openDrawerLeft(e,t){this.trigger("open_drawer_left",e,t)}existsDrawerRight(e){this.trigger("exists_drawer_right",e)}existsDrawerMid(e){this.trigger("exists_drawer_mid",e)}existsDrawerLeft(e){this.trigger("exists_drawer_left",e)}closeDrawerRight(){this.trigger("close_drawer_right")}closeDrawerMid(){this.trigger("close_drawer_mid")}closeDrawerLeft(){this.trigger("close_drawer_left")}}const o=new a;t.DrawerManager=o},114850:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ModalManager=void 0;var i=r(n(395654));class a extends i.default{open(e,t){this.trigger("open_modal",e,t)}close(e){this.trigger("close_modal",e)}openMedia(e,t){this.trigger("open_media",e,t)}closeMedia(){this.trigger("close_media")}}const o=new a;t.ModalManager=o},391186:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Stage=t.LoadingScreenTheme=t.LoadingScreen=void 0;var i=r(n(692629)),a=n(113704),o=n(631588),s=r(n(932325)),l=r(n(825158)),u=r(n(525481)),c=n(667738),d=r(n(249959)),p=n(548360),_=r(n(120992)),f=n(667294),h=r(n(156720)),g=r(n(229439)),m=n(148725),y=n(785893);const E={position:"g0rxnol2",width:"lk9bdx0e",height:"d9lyu8cj",marginTop:"qlylaf53",transition:"d4g41f7d"},S=n(76672).Mirrored(["INITIAL_LOAD","CONNECTING","DOWNLOADING","ORGANIZING"]);t.Stage=S;const T=n(76672).Mirrored(["MULTI_STAGE","UNIFIED","UNIFIED_WITH_PROGRESS","LOGO"]);t.LoadingScreenTheme=T;const v=e=>{(0,f.useEffect)((()=>{const e=document.getElementById("initial_startup");(null==e?void 0:e.parentNode)&&e.parentNode.removeChild(e)}),[]);const t=(0,g.default)();(0,m.useListener)(s.default,"locale_change",t);const n=e.stage===S.INITIAL_LOAD,r=e.stage===S.CONNECTING,v=e.stage===S.DOWNLOADING,I=e.stage===S.ORGANIZING,{theme:M=T.MULTI_STAGE}=e,b=M===T.LOGO?(0,_.default)(d.default.container,d.default.initialLoad):(0,_.default)(d.default.container,(0,a.cx)({[d.default.containerFixed]:!e.debug,[d.default.initialLoad]:n,[d.default.connecting]:r,[d.default.downloading]:v,[d.default.organizing]:I,[d.default.web]:!0})),R=(0,_.default)(d.default.logout,(0,a.cx)({[d.default.showWarning]:v})),N=(0,_.default)(d.default.warning,(0,a.cx)({[d.default.showWarning]:v}));let w,L;switch(M){case T.MULTI_STAGE:switch(e.stage){case S.INITIAL_LOAD:w=s.default.t(869);break;case S.CONNECTING:w=s.default.t(207);break;case S.DOWNLOADING:w=(0,y.jsx)(l.default,{id:434,params:{progress:e.progress}});break;case S.ORGANIZING:w=p.fbt._("Organizing messages",null,{hk:"2ldft"})}L=(0,y.jsx)(A,{});break;case T.UNIFIED:w=(0,o.SYNC_LOADING)(),L="light"===(0,c.getTheme)()?(0,y.jsx)(P,{}):(0,y.jsx)(O,{});break;case T.UNIFIED_WITH_PROGRESS:switch(L="light"===(0,c.getTheme)()?(0,y.jsx)(P,{}):(0,y.jsx)(O,{}),e.stage){case S.INITIAL_LOAD:case S.CONNECTING:w=(0,o.SYNC_LOADING)();break;case S.DOWNLOADING:case S.ORGANIZING:w=p.fbt._("Loading your chats [{percentage}%]",[p.fbt._param("percentage",s.default.n(e.progress))],{hk:"1lh1uF"})}break;case T.LOGO:L=(0,y.jsx)(A,{}),w=s.default.t(869)}return(0,y.jsxs)("div",{className:b,children:[(0,y.jsx)("div",{className:(0,_.default)(d.default.graphic,(0,a.cx)({[d.default.shimmering]:M===T.LOGO||M===T.MULTI_STAGE&&(n||I)})),children:L}),(0,y.jsx)("div",{className:M!==T.MULTI_STAGE?(0,h.default)(E):d.default.progress,children:(0,y.jsx)(u.default,{value:e.progress,max:100})}),(0,y.jsx)("div",{className:d.default.main,children:w}),(0,y.jsxs)("div",{className:d.default.secondary,children:[(0,y.jsx)(C,{}),"  ",s.default.t(249)]}),null,null!=e.onLogout&&(0,y.jsx)("div",{className:R,children:(0,y.jsx)(i.default,{type:"plain-white",onClick:e.onLogout,children:s.default.t(443)})}),(0,y.jsx)("div",{className:N,children:p.fbt._("Don't close this window. Your messages are downloading.",null,{hk:"23nekH"})})]})},A=()=>(0,y.jsx)("span",{children:(0,y.jsxs)("svg",{width:"250px",height:"52px",viewBox:"0 0 250 52",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[(0,y.jsxs)("g",{className:d.default.dots,children:[(0,y.jsx)("circle",{fill:"#B6B6B6",cx:"65.7636689",cy:"21.1046108",r:"3.65625"}),(0,y.jsx)("circle",{fill:"#B6B6B6",cx:"81.0791876",cy:"19.3283142",r:"3.65625"}),(0,y.jsx)("circle",{fill:"#B6B6B6",cx:"96.3947063",cy:"17.7846275",r:"3.65625"}),(0,y.jsx)("circle",{fill:"#B6B6B6",cx:"111.710225",cy:"17.5274031",r:"3.65625"}),(0,y.jsx)("circle",{fill:"#B6B6B6",cx:"127.025744",cy:"17.6118619",r:"3.65625"}),(0,y.jsx)("circle",{fill:"#B6B6B6",cx:"142.341262",cy:"18.4196288",r:"3.65625"}),(0,y.jsx)("circle",{fill:"#B6B6B6",cx:"157.656781",cy:"19.9893339",r:"3.65625"}),(0,y.jsx)("circle",{fill:"#B6B6B6",cx:"172.9723",cy:"22.0657859",r:"3.65625"})]}),(0,y.jsx)("path",{className:d.default.laptop,d:"M190.14097 4.7518926h48.227869l.281462-.00596781c1.058365-.00288774 2.664865.25185461 2.695721 2.87464716.142823 12.13996425 0 22.28077555 0 34.40910725 0 .06028-.024112.168784-.036168.217008l-16.394805-.0086927c-12.47317.0007215-24.136918.0136044-37.78743-.0033633l-.010915-6.2953341c-.030319-9.5718533-.105914-18.2714581.010915-28.31872515.033356-2.86867935 1.976535-2.91690333 3.013351-2.86867935zm20.097267 4.28597465l-19.256815-.00079524.002426 4.98254029c-.000422 6.5558423-.012657 12.8111695-.002954 19.3619492l.011919 4.9777941h46.536157l.008754-4.9777414c.010547-8.1882109.002637-15.913459.002637-24.3331514l-27.302124-.01059555zM179.195421 44.6572387c.397848-.036168.807752-.024112 1.2056-.024112 9.620684 0 19.241369-.012056 28.862053 0 .132616.4701838.54252 1.6393289 1.036816 1.6393289 3.255119.012056 4.510238 0 7.765357 0 .542519.036168.988591-1.1450331 1.133263-1.6513849 9.910029 0 19.820057.012056 29.730086.012056.084392.012056.265232.036168.349624.048224-.016075.2571945-.016075 1.0085894 0 2.2541846 0 1.4209691-1.193544 1.8201689-1.965128 2.1215688-.421959.1205599-.868031.1326159-1.289991.1928959h-63.560505c-.651024-.072336-1.350272-.108504-1.916904-.4701838-.566631-.2893439-1.000647-.7595278-1.350271-1.2779356v-2.8446419z",fill:"currentColor"}),(0,y.jsx)("path",{className:d.default.logo,d:"M37.7314595,31.1612046 C37.0876293,30.8391042 33.9223475,29.2816062 33.332139,29.0666255 C32.7419305,28.8517683 32.3127104,28.7444016 31.8834903,29.3887258 C31.4542703,30.0332973 30.2204788,31.4835521 29.8447567,31.91339 C29.4692818,32.3428571 29.0936834,32.3968494 28.4499768,32.0745019 C27.8060232,31.7521544 25.7314595,31.0723707 23.272278,28.8787027 C21.3582085,27.171583 20.0661004,25.0632896 19.6905019,24.4185946 C19.315027,23.7741467 19.6505946,23.4257297 19.9729421,23.1046178 C20.2625483,22.8161235 20.6167722,22.352556 20.9386255,21.9767104 C21.2606023,21.6007413 21.3678456,21.3320154 21.5824556,20.9026718 C21.7970657,20.472834 21.6898224,20.0968649 21.528834,19.7746409 C21.3678456,19.452417 20.0801853,16.2831815 19.543722,14.993915 C19.0210965,13.7387491 18.4903166,13.9087567 18.0950733,13.8887413 C17.7199691,13.870085 17.2902548,13.8661313 16.8611583,13.8661313 C16.4319382,13.8661313 15.7343629,14.0272433 15.144278,14.6716911 C14.5540695,15.3163861 12.8908108,16.8740077 12.8908108,20.0429961 C12.8908108,23.2121081 15.1978996,26.2734826 15.5198765,26.7031969 C15.8417297,27.1330348 20.0597992,33.6360772 26.5184865,36.4250193 C28.05461,37.0883707 29.2539305,37.4846023 30.1888494,37.7811274 C31.7312742,38.2713822 33.1348263,38.2021931 34.2440772,38.0363861 C35.4810811,37.8515521 38.0533127,36.478888 38.5898996,34.9750116 C39.1263629,33.470888 39.1263629,32.1818687 38.9653745,31.91339 C38.8045097,31.6447876 38.3752896,31.4835521 37.7314595,31.1612046 M25.9838765,47.2013591 L25.9752278,47.2013591 C22.1322625,47.1998763 18.3629343,46.1674749 15.0745946,44.2160926 L14.2926332,43.7519074 L6.18674906,45.8782394 L8.35027028,37.9751042 L7.84111198,37.1648494 C5.69723552,33.7549343 4.56500386,29.8139923 4.56660833,25.767166 C4.57130502,13.9587954 14.1789652,4.35187645 25.9924016,4.35187645 C31.7128649,4.35385328 37.0902239,6.58458689 41.1338378,10.6327722 C45.1773282,14.680834 47.4028724,20.0618996 47.4007737,25.7843398 C47.3959539,37.5936988 37.7882934,47.2013591 25.9838765,47.2013591 M44.2112742,7.556695 C39.3464092,2.68614672 32.8767258,0.00271814672 25.9836293,0 C11.7809421,0 0.221652509,11.5584247 0.215969112,25.7654363 C0.21411583,30.3069652 1.40058687,34.7397683 3.65553668,38.6475984 L-4.61852778e-14,52 L13.6596757,48.4167413 C17.4233205,50.4695597 21.6607876,51.5516293 25.9733745,51.5531121 L25.9838765,51.5531121 L25.984,51.5531121 C40.1852046,51.5531121 51.7456062,39.9934517 51.7512912,25.7860695 C51.7538842,18.9011274 49.0761392,12.4271197 44.2112742,7.556695",fill:"currentColor"})]})}),C=()=>(0,y.jsx)("span",{children:(0,y.jsx)("svg",{width:"10px",height:"12px",viewBox:"0 0 10 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:(0,y.jsx)("path",{d:"M5.00847986,1.6 C6.38255462,1.6 7.50937014,2.67435859 7.5940156,4.02703389 L7.59911976,4.1906399 L7.599,5.462 L7.75719976,5.46214385 C8.34167974,5.46214385 8.81591972,5.94158383 8.81591972,6.53126381 L8.81591972,9.8834238 C8.81591972,10.4731038 8.34167974,10.9525438 7.75719976,10.9525438 L2.25767996,10.9525438 C1.67527998,10.9525438 1.2,10.4731038 1.2,9.8834238 L1.2,6.53126381 C1.2,5.94158383 1.67423998,5.46214385 2.25767996,5.46214385 L2.416,5.462 L2.41679995,4.1906399 C2.41679995,2.81636129 3.49135449,1.68973395 4.84478101,1.60510326 L5.00847986,1.6 Z M5.00847986,2.84799995 C4.31163824,2.84799995 3.73624912,3.38200845 3.6709675,4.06160439 L3.6647999,4.1906399 L3.663,5.462 L6.35,5.462 L6.35111981,4.1906399 C6.35111981,3.53817142 5.88169076,2.99180999 5.26310845,2.87228506 L5.13749818,2.85416626 L5.00847986,2.84799995 Z",fill:"currentColor"})})}),P=()=>(0,y.jsxs)("svg",{width:"360",height:"189",viewBox:"0 0 360 189",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,y.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M263.973 169.512C296.928 158.399 321.88 127.034 318.305 81.6873C312.874 12.7907 246.61 -4.29994 205.331 15.9952C149.334 43.5266 142.242 48.0401 102.134 48.0401C72.2614 48.0401 41.8454 62.4603 38.0434 101.448C35.2875 129.708 46.373 154.375 87.3951 166.97C162.054 189.892 232.127 180.251 263.973 169.512Z",fill:"#DAF7F3"}),(0,y.jsx)("rect",{x:"0.350314",y:"0.491301",width:"36.3309",height:"71.7205",rx:"6.39808",transform:"matrix(0.986206 0.165525 -0.16491 0.986309 53.5541 83.2331)",fill:"#42CBA5",stroke:"#316474",strokeWidth:"0.853077"}),(0,y.jsx)("rect",{x:"0.353963",y:"0.496419",width:"36.322",height:"71.7116",rx:"6.39363",transform:"matrix(0.986206 0.165525 -0.16491 0.986309 53.9368 80.9482)",fill:"white",stroke:"#316474",strokeWidth:"0.861963"}),(0,y.jsx)("path",{d:"M86.853 93.0759L77.0579 151.659C76.6995 153.803 74.6715 155.249 72.5281 154.889L48.7185 150.893C46.5752 150.533 45.1282 148.504 45.4866 146.36L55.2817 87.7769C55.6401 85.6334 57.6681 84.1873 59.8115 84.5471L63.6109 85.1848L79.8216 87.9056L83.6211 88.5433C85.7644 88.903 87.2114 90.9323 86.853 93.0759Z",fill:"#EEFEFA",stroke:"#316474",strokeWidth:"0.861963"}),(0,y.jsx)("path",{d:"M58.4726 88.8221C58.3721 89.4244 58.7846 90.0018 59.3926 90.1059C60.0037 90.2105 60.5863 89.7985 60.6873 89.193C60.7878 88.5907 60.3753 88.0133 59.7674 87.9092C59.1562 87.8046 58.5736 88.2166 58.4726 88.8221Z",fill:"white",stroke:"#316474",strokeWidth:"0.853077"}),(0,y.jsx)("path",{d:"M111.421 117.587C111.208 115.535 109.372 114.046 107.321 114.262L80.1959 117.113C78.1442 117.329 76.6535 119.167 76.8665 121.219L77.9482 131.641C78.1612 133.693 79.9971 135.182 82.0488 134.966L119.624 131.017C119.884 130.99 119.976 130.658 119.767 130.501L120.285 129.811L119.767 130.501L114.076 126.232C112.861 125.321 112.081 123.944 111.924 122.433L111.421 117.587Z",fill:"#42CBA5",stroke:"#316474",strokeWidth:"1.72407"}),(0,y.jsx)("path",{d:"M81.8041 122.275C81.3306 122.324 80.9866 122.749 81.0358 123.222C81.0849 123.696 81.5086 124.039 81.9821 123.989L81.8041 122.275ZM105.64 121.503C106.113 121.453 106.457 121.029 106.408 120.555C106.359 120.082 105.935 119.738 105.462 119.788L105.64 121.503ZM81.9821 123.989L105.64 121.503L105.462 119.788L81.8041 122.275L81.9821 123.989Z",fill:"#33AF8D"}),(0,y.jsx)("path",{d:"M82.3842 127.866C81.9107 127.916 81.5667 128.34 81.6158 128.814C81.665 129.287 82.0887 129.631 82.5621 129.581L82.3842 127.866ZM106.22 127.094C106.693 127.045 107.037 126.62 106.988 126.147C106.939 125.673 106.515 125.33 106.042 125.38L106.22 127.094ZM82.5621 129.581L106.22 127.094L106.042 125.38L82.3842 127.866L82.5621 129.581Z",fill:"#33AF8D"}),(0,y.jsx)("path",{d:"M125.463 42.5443L286.19 25.6512L297.132 129.758L136.405 146.652L125.463 42.5443Z",fill:"#EEFEFA"}),(0,y.jsx)("path",{d:"M295.928 130.484L138.655 147.014C135.404 147.356 132.479 144.995 132.138 141.75L121.537 40.8838C121.196 37.6393 123.564 34.7219 126.816 34.3801L284.089 17.85C287.343 17.508 290.265 19.8695 290.606 23.114L301.207 123.981C301.548 127.225 299.182 130.142 295.928 130.484Z",fill:"white"}),(0,y.jsx)("path",{d:"M138.655 147.014C135.404 147.356 132.479 144.995 132.138 141.75L121.537 40.8838C121.196 37.6393 123.564 34.7219 126.816 34.3801L284.089 17.85C287.343 17.508 290.265 19.8695 290.606 23.114L301.207 123.981C301.548 127.225 299.182 130.142 295.928 130.484",stroke:"#316474"}),(0,y.jsx)("path",{d:"M290.245 125.898L143.148 141.359C140.368 141.651 137.899 139.694 137.619 137.032L127.978 45.2988C127.698 42.6368 129.705 40.2098 132.486 39.9174L279.583 24.457C282.366 24.1645 284.832 26.1212 285.112 28.7833L294.754 120.517C295.033 123.179 293.028 125.606 290.245 125.898Z",fill:"#EEFEFA",stroke:"#316474"}),(0,y.jsx)("path",{d:"M235.259 137.428L312.949 129.263L313.671 136.134C313.765 137.031 313.618 137.844 313.33 138.429C313.038 139.021 312.643 139.314 312.259 139.354L125.358 158.998C124.974 159.039 124.527 158.835 124.118 158.316C123.714 157.803 123.401 157.039 123.307 156.142L122.585 149.271L200.276 141.105C200.601 142.008 201.075 142.789 201.654 143.357C202.316 144.008 203.148 144.405 204.048 144.31L232.236 141.347C233.135 141.253 233.866 140.692 234.379 139.919C234.827 139.243 235.129 138.38 235.259 137.428Z",fill:"#42CBA5",stroke:"#316474"}),(0,y.jsx)("path",{d:"M235.423 136.375L314.707 128.042L315.153 132.281C315.256 133.261 314.544 134.14 313.564 134.243L122.992 154.273C122.012 154.376 121.133 153.664 121.03 152.684L120.585 148.445L199.87 140.112C200.564 141.391 201.971 142.206 203.517 142.043L232.258 139.023C233.802 138.86 235.009 137.772 235.423 136.375Z",fill:"white",stroke:"#316474"}),(0,y.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M210.616 68.862C214.35 68.4875 218.104 69.5614 221.067 71.8379C224.102 74.1693 226.061 77.5173 226.598 81.2882C227.123 84.9707 226.202 88.7389 224.024 91.7717C221.635 95.0981 218.05 97.241 213.993 97.7845C213.854 97.8031 213.715 97.8198 213.575 97.8344C211.383 98.0649 209.159 97.8031 207.092 97.0715L199.621 99.5614C199.614 99.5636 199.607 99.565 199.6 99.5658C199.533 99.5727 199.473 99.5204 199.475 99.4512L199.962 91.6506C198.649 89.7697 197.797 87.5847 197.49 85.3032C196.972 81.4482 198 77.6213 200.383 74.5271C202.855 71.319 206.478 69.2968 210.544 68.8696L210.616 68.862ZM210.799 71.3833C210.682 71.3955 210.566 71.4094 210.449 71.4252C203.812 72.314 199.133 78.3879 200.017 84.9648C200.287 86.9731 201.068 88.8902 202.274 90.5089L202.536 90.8598L202.125 96.1616L207.191 94.4008L207.604 94.5618C209.408 95.2644 211.374 95.5254 213.311 95.3218C213.426 95.3097 213.541 95.2959 213.656 95.2805C220.292 94.3917 224.972 88.3179 224.088 81.7409C223.219 75.28 217.299 70.7001 210.799 71.3833ZM206.255 76.8888L206.27 76.8876C206.515 76.8694 206.761 76.8505 206.976 76.8437C207.239 76.8348 207.529 76.8254 207.85 77.4125C208.23 78.1097 209.078 79.8609 209.184 80.0365C209.289 80.2121 209.366 80.4206 209.262 80.6734C209.157 80.9259 209.107 81.0825 208.939 81.3091C208.771 81.5359 208.588 81.8135 208.435 81.9892C208.263 82.1849 208.087 82.3967 208.328 82.7458C208.57 83.095 209.396 84.2344 210.561 85.1202C212.058 86.2585 213.195 86.5666 213.65 86.7216C213.814 86.7776 213.948 86.7983 214.062 86.7864C214.218 86.7699 214.336 86.6921 214.443 86.5598C214.647 86.3064 215.25 85.4395 215.501 85.0434C215.633 84.8363 215.762 84.7541 215.911 84.7384C216.03 84.7259 216.162 84.756 216.316 84.7989C216.662 84.8955 218.535 85.6437 218.916 85.7988C219.298 85.9538 219.55 86.0269 219.653 86.172C219.756 86.3178 219.81 87.0481 219.567 87.9227C219.323 88.7976 217.882 89.7311 217.212 89.8421C217.016 89.8745 216.825 89.9223 216.572 89.9489C215.961 90.0131 214.992 89.9537 212.731 89.2576C208.884 88.0733 206.243 84.4473 206.041 84.2178C205.839 83.9878 204.393 82.3511 204.26 80.5558C204.128 78.7607 205.013 77.8072 205.323 77.4171C205.62 77.0429 205.993 76.9162 206.239 76.8903C206.25 76.8892 206.26 76.8883 206.27 76.8876C206.263 76.8881 206.258 76.8885 206.255 76.8888Z",fill:"#316474",fillOpacity:"0.24"}),(0,y.jsx)("path",{d:"M118.422 64.6861C118.641 62.6346 120.481 61.1464 122.533 61.3621L153.583 64.6256C155.635 64.8413 157.122 66.6791 156.903 68.7306L155.569 81.2676C155.351 83.3191 153.51 84.8073 151.459 84.5917L109.005 80.1296C108.745 80.1023 108.654 79.7705 108.864 79.6139L108.348 78.9241L108.864 79.6139L115.614 74.564C116.831 73.6532 117.614 72.2767 117.775 70.7657L118.422 64.6861Z",fill:"#42CBA5",stroke:"#316474",strokeWidth:"1.72407"}),(0,y.jsx)("path",{d:"M151.271 70.4778C151.745 70.5276 152.088 70.9517 152.037 71.4251C151.987 71.8986 151.562 72.242 151.089 72.1922L151.271 70.4778ZM124.871 69.4366C124.397 69.3868 124.054 68.9627 124.104 68.4893C124.155 68.0158 124.579 67.6724 125.053 67.7222L124.871 69.4366ZM151.089 72.1922L124.871 69.4366L125.053 67.7222L151.271 70.4778L151.089 72.1922Z",fill:"#33AF8D"}),(0,y.jsx)("path",{d:"M150.613 76.6728C151.086 76.7225 151.429 77.1467 151.379 77.6201C151.328 78.0935 150.904 78.4369 150.43 78.3872L150.613 76.6728ZM124.212 75.6315C123.738 75.5817 123.395 75.1576 123.446 74.6842C123.496 74.2108 123.921 73.8673 124.394 73.9171L124.212 75.6315ZM150.43 78.3872L124.212 75.6315L124.394 73.9171L150.613 76.6728L150.43 78.3872Z",fill:"#33AF8D"})]}),O=()=>(0,y.jsxs)("svg",{width:"360",height:"189",viewBox:"0 0 360 189",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,y.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M263.973 169.512C296.928 158.399 321.88 127.034 318.305 81.6873C312.874 12.7907 246.61 -4.29994 205.331 15.9952C149.334 43.5266 142.242 48.0401 102.134 48.0401C72.2614 48.0401 41.8454 62.4603 38.0434 101.448C35.2875 129.708 46.373 154.375 87.3951 166.97C162.054 189.892 232.127 180.251 263.973 169.512Z",fill:"white",fillOpacity:"0.1"}),(0,y.jsx)("rect",{x:"0.350314",y:"0.491301",width:"36.3309",height:"71.7205",rx:"6.39808",transform:"matrix(0.986206 0.165525 -0.16491 0.986309 53.5536 83.2332)",fill:"#42CBA5",stroke:"#316474",strokeWidth:"0.853077"}),(0,y.jsx)("rect",{x:"0.353963",y:"0.496419",width:"36.322",height:"71.7116",rx:"6.39363",transform:"matrix(0.986206 0.165525 -0.16491 0.986309 53.9364 80.9482)",fill:"white",stroke:"#316474",strokeWidth:"0.861963"}),(0,y.jsx)("path",{d:"M86.8525 93.0759L77.0574 151.659C76.699 153.803 74.671 155.249 72.5277 154.889L48.718 150.893C46.5747 150.533 45.1277 148.504 45.4861 146.36L55.2812 87.777C55.6396 85.6334 57.6676 84.1873 59.811 84.5471L63.6105 85.1848L79.8212 87.9056L83.6206 88.5433C85.764 88.903 87.2109 90.9323 86.8525 93.0759Z",fill:"#EEFEFA",stroke:"#316474",strokeWidth:"0.861963"}),(0,y.jsx)("path",{d:"M58.4721 88.822C58.3716 89.4244 58.7841 90.0017 59.3921 90.1058C60.0032 90.2105 60.5858 89.7985 60.6868 89.193C60.7873 88.5906 60.3749 88.0133 59.7669 87.9092C59.1557 87.8046 58.5731 88.2166 58.4721 88.822Z",fill:"white",stroke:"#316474",strokeWidth:"0.853077"}),(0,y.jsx)("path",{d:"M111.421 117.587C111.208 115.535 109.372 114.046 107.321 114.262L80.1959 117.113C78.1442 117.329 76.6535 119.167 76.8665 121.219L77.9482 131.641C78.1612 133.693 79.9971 135.182 82.0488 134.966L119.624 131.017C119.884 130.99 119.976 130.658 119.767 130.501L120.285 129.811L119.767 130.501L114.076 126.232C112.861 125.321 112.081 123.944 111.924 122.433L111.421 117.587Z",fill:"#42CBA5",stroke:"#316474",strokeWidth:"1.72407"}),(0,y.jsx)("path",{d:"M81.8036 122.275C81.3301 122.324 80.9861 122.749 81.0353 123.222C81.0844 123.696 81.5081 124.039 81.9816 123.99L81.8036 122.275ZM105.639 121.503C106.113 121.453 106.457 121.029 106.407 120.555C106.358 120.082 105.935 119.738 105.461 119.788L105.639 121.503ZM81.9816 123.99L105.639 121.503L105.461 119.788L81.8036 122.275L81.9816 123.99Z",fill:"#33AF8D"}),(0,y.jsx)("path",{d:"M82.3837 127.866C81.9102 127.916 81.5662 128.34 81.6153 128.814C81.6645 129.287 82.0882 129.631 82.5616 129.581L82.3837 127.866ZM106.219 127.094C106.693 127.045 107.037 126.62 106.988 126.147C106.938 125.673 106.515 125.33 106.041 125.38L106.219 127.094ZM82.5616 129.581L106.219 127.094L106.041 125.38L82.3837 127.866L82.5616 129.581Z",fill:"#33AF8D"}),(0,y.jsx)("path",{d:"M125.463 42.5442L286.19 25.6511L297.132 129.758L136.405 146.651L125.463 42.5442Z",fill:"#EEFEFA"}),(0,y.jsx)("path",{d:"M295.927 130.484L138.654 147.015C135.404 147.356 132.479 144.995 132.138 141.751L121.536 40.8839C121.195 37.6393 123.564 34.7219 126.816 34.3801L284.089 17.85C287.343 17.508 290.264 19.8695 290.605 23.114L301.207 123.981C301.548 127.225 299.181 130.142 295.927 130.484Z",fill:"white"}),(0,y.jsx)("path",{d:"M138.654 147.015C135.404 147.356 132.479 144.995 132.138 141.751L121.536 40.8839C121.195 37.6393 123.564 34.7219 126.816 34.3801L284.089 17.85C287.343 17.508 290.264 19.8695 290.605 23.114L301.207 123.981C301.548 127.225 299.181 130.142 295.927 130.484",stroke:"#316474"}),(0,y.jsx)("path",{d:"M290.245 125.898L143.148 141.359C140.368 141.651 137.899 139.694 137.619 137.032L127.978 45.2989C127.698 42.6369 129.705 40.2098 132.486 39.9175L279.583 24.457C282.366 24.1645 284.832 26.1213 285.112 28.7834L294.754 120.517C295.033 123.179 293.028 125.606 290.245 125.898Z",fill:"#EEFEFA",stroke:"#316474"}),(0,y.jsx)("path",{d:"M235.259 137.428L312.949 129.263L313.671 136.134C313.765 137.031 313.618 137.844 313.33 138.429C313.038 139.021 312.643 139.314 312.259 139.354L125.358 158.998C124.974 159.039 124.527 158.835 124.118 158.316C123.714 157.803 123.401 157.039 123.307 156.142L122.585 149.271L200.276 141.105C200.601 142.008 201.075 142.789 201.654 143.357C202.316 144.008 203.148 144.405 204.048 144.31L232.236 141.347C233.135 141.253 233.866 140.692 234.379 139.919C234.827 139.243 235.129 138.38 235.259 137.428Z",fill:"#42CBA5",stroke:"#316474"}),(0,y.jsx)("path",{d:"M235.423 136.375L314.707 128.042L315.153 132.281C315.256 133.261 314.544 134.14 313.564 134.243L122.992 154.273C122.012 154.376 121.133 153.664 121.03 152.684L120.585 148.445L199.87 140.112C200.564 141.391 201.971 142.206 203.517 142.043L232.258 139.023C233.802 138.86 235.009 137.772 235.423 136.375Z",fill:"white",stroke:"#316474"}),(0,y.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M210.617 68.8619C214.35 68.4875 218.105 69.5614 221.068 71.8378C224.102 74.1693 226.062 77.5173 226.599 81.2882C227.123 84.9707 226.203 88.7389 224.024 91.7717C221.635 95.0981 218.051 97.241 213.993 97.7845C213.854 97.8031 213.715 97.8197 213.576 97.8344C211.383 98.0649 209.159 97.8031 207.093 97.0715L199.622 99.5614C199.614 99.5636 199.607 99.565 199.6 99.5658C199.534 99.5727 199.474 99.5204 199.476 99.4512L199.962 91.6506C198.65 89.7697 197.798 87.5847 197.491 85.3032C196.973 81.4482 198 77.6213 200.384 74.5271C202.856 71.319 206.479 69.2968 210.544 68.8696L210.617 68.8619ZM210.799 71.3833C210.683 71.3955 210.566 71.4094 210.449 71.4252C203.813 72.314 199.133 78.3879 200.018 84.9648C200.288 86.9731 201.068 88.8902 202.274 90.5089L202.536 90.8598L202.126 96.1615L207.191 94.4007L207.604 94.5618C209.408 95.2644 211.374 95.5254 213.311 95.3218C213.426 95.3097 213.542 95.2959 213.656 95.2805C220.293 94.3917 224.972 88.3179 224.088 81.7409C223.219 75.28 217.299 70.7001 210.799 71.3833ZM206.255 76.8888L206.271 76.8876C206.516 76.8694 206.761 76.8505 206.976 76.8437C207.239 76.8348 207.53 76.8254 207.85 77.4125C208.231 78.1097 209.079 79.8609 209.184 80.0365C209.29 80.2121 209.367 80.4206 209.262 80.6734C209.157 80.9259 209.107 81.0825 208.94 81.3091C208.771 81.5359 208.588 81.8135 208.435 81.9892C208.264 82.1849 208.087 82.3967 208.329 82.7458C208.57 83.095 209.396 84.2344 210.561 85.1202C212.059 86.2585 213.196 86.5666 213.651 86.7216C213.815 86.7776 213.949 86.7983 214.062 86.7863C214.218 86.7699 214.336 86.6921 214.443 86.5598C214.647 86.3064 215.251 85.4395 215.502 85.0434C215.633 84.8363 215.763 84.7541 215.912 84.7384C216.031 84.7259 216.162 84.756 216.316 84.7989C216.662 84.8955 218.536 85.6437 218.917 85.7988C219.298 85.9538 219.55 86.0269 219.654 86.172C219.757 86.3178 219.81 87.0481 219.567 87.9227C219.323 88.7976 217.882 89.7311 217.213 89.8421C217.016 89.8745 216.825 89.9223 216.572 89.9489C215.962 90.0131 214.992 89.9537 212.731 89.2576C208.885 88.0733 206.243 84.4473 206.042 84.2178C205.84 83.9878 204.394 82.3511 204.261 80.5558C204.128 78.7607 205.013 77.8072 205.324 77.4171C205.621 77.0429 205.993 76.9162 206.24 76.8903C206.25 76.8892 206.261 76.8883 206.271 76.8876C206.264 76.8881 206.259 76.8885 206.255 76.8888Z",fill:"#316474",fillOpacity:"0.24"}),(0,y.jsx)("path",{d:"M118.423 64.686C118.641 62.6345 120.481 61.1463 122.533 61.3619L153.584 64.6255C155.636 64.8412 157.122 66.679 156.904 68.7305L155.569 81.2675C155.351 83.319 153.511 84.8072 151.459 84.5915L109.006 80.1295C108.746 80.1022 108.655 79.7704 108.864 79.6138L108.348 78.924L108.864 79.6138L115.614 74.5639C116.832 73.653 117.615 72.2766 117.776 70.7656L118.423 64.686Z",fill:"#42CBA5",stroke:"#316474",strokeWidth:"1.72407"}),(0,y.jsx)("path",{d:"M151.271 70.4778C151.744 70.5275 152.087 70.9517 152.037 71.4251C151.987 71.8985 151.562 72.2419 151.088 72.1922L151.271 70.4778ZM124.87 69.4365C124.397 69.3867 124.054 68.9626 124.104 68.4892C124.154 68.0158 124.579 67.6723 125.052 67.7221L124.87 69.4365ZM151.088 72.1922L124.87 69.4365L125.052 67.7221L151.271 70.4778L151.088 72.1922Z",fill:"#33AF8D"}),(0,y.jsx)("path",{d:"M150.613 76.6727C151.086 76.7225 151.429 77.1466 151.379 77.62C151.328 78.0934 150.904 78.4369 150.43 78.3871L150.613 76.6727ZM124.212 75.6314C123.738 75.5817 123.395 75.1575 123.446 74.6841C123.496 74.2107 123.921 73.8673 124.394 73.917L124.212 75.6314ZM150.43 78.3871L124.212 75.6314L124.394 73.917L150.613 76.6727L150.43 78.3871Z",fill:"#33AF8D"})]}),I=(0,f.memo)(v);t.LoadingScreen=I},549971:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(956113),a=n(180519),o=r(n(431230)),s=n(548360),l=n(785893);var u=()=>(0,l.jsx)("div",{className:o.default.background,children:(0,l.jsxs)("div",{className:o.default.mainWrapper,children:[(0,l.jsx)(i.Spinner,{size:50,stroke:4,color:"highlight"}),(0,l.jsx)(a.TextDiv,{className:o.default.logoutTitle,size:"32",children:s.fbt._("Logging Out",null,{hk:"1YEOxc"})}),(0,l.jsx)(a.TextDiv,{theme:"muted",children:s.fbt._("Do not close this window",null,{hk:"14ygD4"})})]})});t.default=u},552897:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.LongLinkPopup=function(e){const{link:t}=e;return(0,d.jsx)(l.ConfirmPopup,{title:c.fbt._("Open in browser",null,{hk:"4nwCde"}),okText:c.fbt._("Open link",null,{hk:"1yYoWm"}),cancelText:c.fbt._("Cancel",null,{hk:"H0gNq"}),onOK:()=>{var n;null!=(null===(n=e.statusItemViewEventRef)||void 0===n?void 0:n.current)&&(e.statusItemViewEventRef.current.urlStatusClicked=s.default.URL_STATUS_CLICKED.TWO_CLICKS),(0,a.openExternalLink)(t.href),o.ModalManager.close()},onCancel:p,type:u.ModalTheme.LinkPopup,children:(0,d.jsx)("div",{children:t.href})})};var i=n(780549),a=n(753233),o=n(114850),s=r(n(571834)),l=n(744259),u=n(192961),c=n(548360),d=n(785893);const p=()=>{o.ModalManager.close(),i.Cmd.closeLongLinkModal(!0)}},192961:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ModalTheme=t.Modal=void 0;var i=r(n(441609)),a=r(n(152583)),o=n(113704),s=r(n(890732)),l=r(n(274196)),u=r(n(120992)),c=n(667294),d=n(785893);const p=n(76672).Mirrored(["Box","BoxLarge","Flex","Guide","Tower","Auto","Invite","InviteNew","ColumnButtons","Multiline","Upgrade","Promote","CommandPalette","QuickReplies","StatusV3ViewerList","LinkPopup","StatusV3Report","ChatAssignment","TowerLarge","HistorySyncProgress","MessageEdit"]);t.ModalTheme=p;const _=(0,c.forwardRef)(((e,t)=>{var n;const r=(0,c.useRef)(null),_=(0,c.useRef)(null),f=null!=e.title?(0,d.jsx)("div",{"data-testid":"popup-title",className:l.default.popupTitle,children:e.title}):null,h=e.type===p.StatusV3ViewerList&&e.dimensions?{height:`${e.dimensions.height}px`,width:`${e.dimensions.width}px`}:null,g=(0,u.default)(l.default.popup,(0,o.cx)({[l.default.popupFlexInvite]:e.type===p.Invite,[l.default.popupFlexInviteNew]:e.type===p.InviteNew,[l.default.popupFlexUpgrade]:e.type===p.Upgrade,[l.default.popupBox]:e.type===p.Box,[l.default.popupBoxLarge]:e.type===p.BoxLarge,[l.default.popupFlex]:e.type===p.Flex,[l.default.popupTower]:e.type===p.Tower||e.type===p.TowerLarge,[l.default.popupAuto]:e.type===p.Auto,[l.default.popupColumnButtons]:e.type===p.ColumnButtons,[l.default.popupMultiline]:e.type===p.Multiline,[l.default.popupStatusV3ViewerList]:e.type===p.StatusV3ViewerList,[l.default.popupPromote]:e.type===p.Promote,[l.default.popupCommandPalette]:e.type===p.CommandPalette,[l.default.popupQuickReplies]:e.type===p.QuickReplies,[l.default.popupChatAssignment]:e.type===p.ChatAssignment,[l.default.popupTowerLarge]:e.type===p.TowerLarge,[l.default.popupHistorySyncProgress]:e.type===p.HistorySyncProgress,[l.default.popupMessageEdit]:e.type===p.MessageEdit})),m=(0,i.default)(e.actions)?null:(0,d.jsx)("div",{className:l.default.popupControls,children:e.actions}),y=(0,u.default)("overlay",l.default.backdrop,(0,o.cx)({[l.default.backdropCover]:e.cover,[l.default.popupGuide]:e.type===p.Guide,[l.default.showOverStatusV3]:e.type===p.StatusV3ViewerList||e.type===p.LinkPopup||e.type===p.StatusV3Report})),E=(0,d.jsx)("div",{ref:_,onClick:t=>{var n;t.target===_.current&&(null===(n=e.onOverlayClick)||void 0===n||n.call(e,t))},className:l.default.popupContainer,"data-testid":null!==(n=e.testid)&&void 0!==n?n:"confirm-popup",children:(0,d.jsx)("div",{className:g,"data-animate-modal-popup":!0,style:h,children:(0,d.jsxs)("div",{className:l.default.popupBody,"data-animate-modal-body":!0,children:[f,(0,d.jsx)("div",{"data-testid":"popup-contents",className:l.default.popupContents,children:e.children}),m]})})});return(0,d.jsxs)(a.default,{className:y,onDragOver:e=>{var t;null===(t=r.current)||void 0===t||t.onDragOver(e)},onDragStart:e=>{var t;null===(t=r.current)||void 0===t||t.onDragStart(e)},onDragEnd:e=>{var t;null===(t=r.current)||void 0===t||t.onDragEnd(e)},ref:t,"data-animate-modal-backdrop":!0,children:[e.onDrop&&(0,d.jsx)(s.default,{ref:r,disableFromWithin:!0,onDragChange:e.onDragChange,onDrop:e.onDrop}),E]})}));t.Modal=_,_.displayName="Modal"},544744:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MediaType=void 0,t.ModalManagerComponent=function(e){const{type:t,contextMenuRef:n}=e,r=(0,_.useRef)(null),S=(0,_.useRef)(!1),[T,v]=(0,_.useState)(void 0),[A,C]=(0,_.useState)(null),[P,O]=(0,_.useState)(m),[I,M]=(0,_.useState)(void 0),[b,R]=(0,_.useState)(!1),N=()=>{if(!r.current)return;const e=r.current.getElement();e&&!e.contains(document.activeElement)&&o.default.focus(e)},w=()=>{if(!r.current)return;const e=r.current.getElement();e&&o.default.focus(e)},L=e=>{(e=>{const t=e.relatedTarget,r=null==n?void 0:n.current,i=!!r&&r.isOpen();return t instanceof HTMLElement&&!e.currentTarget.contains(t)&&!i&&!1===S.current})(e)&&N()},D=e=>{T&&(v(void 0),C(null),e&&O(e),S.current=!0)},k=e=>{e===A&&(D(),u.ModalManager.trigger(`close_${t}`))};let U;(0,h.useListener)(u.ModalManager,`open_${t}`,(function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.transition||m;const{uim:a,blockClose:o}=n;T&&(r=y);const s=(0,i.default)(`ModalManager${t}`);let l=e;t===E&&(l=(0,_.cloneElement)(e,{requestFocus:w})),S.current=!1,f.default.unstable_batchedUpdates((()=>{v(l),C(s),O(r),M(a),R(null!=o&&o)}))})),(0,h.useListener)(u.ModalManager,`close_${t}`,D),T&&(U=(0,g.jsx)(d.UIE,{displayName:`Modal${(0,a.default)(e.type)}`,escapable:!b,ref:r,requestFocus:N,requestDismiss:k.bind(null,A),children:e.type===E?(0,g.jsx)(l.default,{onBlur:L,children:T}):(0,g.jsx)(s.RotateFocus,{children:T})},A));return(0,g.jsx)(c.default.Consumer,{children:e=>(0,g.jsx)(c.default.Provider,{value:I||e,children:(0,g.jsx)(p.default,{transitionName:P,children:U})})})},t.ModalType=void 0;var i=r(n(873955)),a=r(n(854251)),o=r(n(335540)),s=n(817646),l=r(n(241115)),u=n(114850),c=r(n(8073)),d=n(392632),p=r(n(844453)),_=n(667294),f=r(n(973935)),h=n(148725),g=n(785893);const m="modal",y="none",E="modal";t.ModalType=E;t.MediaType="media"},571411:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(932325)),a=n(192961),o=n(548360),s=n(785893);t.default=()=>(0,s.jsx)(a.Modal,{title:o.fbt._("Computer not connected",null,{hk:"300jSy"}),cover:!0,children:i.default.t(430)})},393014:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(753233),a=n(258105),o=r(n(932325)),s=n(744259),l=n(548360),u=n(785893);function c(){(0,i.openExternalLink)((0,a.getCannotConnectFaqUrl)())}t.default=()=>(0,u.jsx)(s.ConfirmPopup,{cover:!0,title:o.default.t(167),okText:o.default.t(394),onOK:c,children:l.fbt._("Your computer is connected to a network that prevents WhatsApp from working correctly",null,{hk:"GhGFR"})})},214642:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=(0,_.default)();let n,r;(0,h.useListener)(s.Stream,"change:displayInfo",t),(0,p.default)(i.Cmd,"ab_props_loaded",(()=>!1));const[y]=(0,f.default)(t,1e3),[E]=(0,g.useTimeout)(y,6e3);let S=s.Stream.displayInfo;(0,d.useEffect)((()=>{E();const e=document.getElementById("initial_startup");(null==e?void 0:e.parentNode)&&e.parentNode.removeChild(e)}),[]);const T=()=>{__LOG__(2)`Startup: user selected logout`,o.Socket.logout()};switch(S){case s.StreamInfo.OPENING:case s.StreamInfo.PAIRING:case s.StreamInfo.TIMEOUT:n=a.default.t(208),r=a.default.t(430);break;case s.StreamInfo.SYNCING:case s.StreamInfo.CONNECTING:return(0,m.jsx)(u.default,{initialLoadReady:e.initialLoadReady,onReady:e.onReady,onLogout:T});case s.StreamInfo.SCREEN_LOCKED:default:return s.Stream.mode===s.StreamMode.MAIN?(0,m.jsx)(u.default,{initialLoadReady:e.initialLoadReady,onReady:e.onReady,onLogout:T}):null}return(0,m.jsxs)(l.ConfirmPopup,{cover:!0,title:n,cancelText:a.default.t(443),onCancel:T,children:[(0,m.jsx)("hr",{className:c.default.divider}),(0,m.jsx)("div",{className:c.default.textTip,children:r})]})};var i=n(780549),a=r(n(932325)),o=(n(97858),n(6961)),s=n(841273),l=(n(65410),n(673168),n(744259)),u=r(n(433304)),c=r(n(430173)),d=n(667294),p=r(n(209561)),_=r(n(229439)),f=r(n(133805)),h=n(148725),g=n(85284),m=n(785893)},547821:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatusV3StatusContext=void 0;const r=(0,n(667294).createContext)({statusItemViewEventRef:null});t.StatusV3StatusContext=r},46668:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const{link:t}=e,{suspiciousCharacters:n,domain:r,href:S}=t,T=r.split("."),v=T.map(((e,t)=>{let r=!1;const i=e.split("").map(((e,i)=>{const a=n&&n.has(e);r=a||r;const o=a?(0,_.default)(g):void 0;return(0,f.jsx)("span",{className:o,children:e},`${t}-${i}-${e}`)})),a=r?(0,_.default)(h):void 0;return(0,f.jsxs)(p.Fragment,{children:[(0,f.jsx)("span",{className:a,children:i}),t+1!==T.length?(0,f.jsx)("span",{children:"."}):null]},`${t}-${e}`)})),[A,C]=S.split(r);return(0,f.jsxs)(u.ConfirmPopup,{title:d.fbt._("Suspicious link",null,{hk:"J2Yam"}),okText:d.fbt._("Cancel",null,{hk:"H0gNq"}),cancelText:d.fbt._("Open link",null,{hk:"1yYoWm"}),onOK:E,onCancel:()=>{const{href:e}=t;(0,a.openExternalLink)(e),l.ModalManager.close(),i.Cmd.closeLongLinkModal(!0)},type:c.ModalTheme.LinkPopup,children:[(0,f.jsxs)("div",{className:(0,_.default)(m),children:[d.fbt._("This link contains unusual characters. It may be trying to appear as another site.",null,{hk:"4ybh1b"})," ",(0,f.jsx)(a.ExternalLink,{href:(0,o.getSuspiciousLinkFaqUrl)(),children:s.default.t(394)})]}),(0,f.jsxs)("div",{className:(0,_.default)(y),children:[A,v,C]})]})};var i=n(780549),a=n(753233),o=n(258105),s=r(n(932325)),l=n(114850),u=n(744259),c=n(192961),d=n(548360),p=n(667294),_=r(n(156720)),f=n(785893);const h={color:"o2sglzf9"},g={fontWeight:"nbipi2bn"},m={marginBottom:"brac1wpa"},y={display:"c32ccnay",maxHeight:"ih8khgda",marginTop:"opp68qpq",overflowX:"gfz4du6o",overflowY:"r7fjleex",lineHeight:"r5qsrrlp",textOverflow:"lhj4utae",overflowWrap:"fd365im1",WebkitLineClamp:"s7u03v8d",WebkitBoxOrient:"aoi073rw"},E=()=>{l.ModalManager.close(),i.Cmd.closeLongLinkModal(!0)}},919570:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,l.jsxs)(s.ConfirmPopup,{cover:!0,cancelText:i.default.t(443),onCancel:o.Socket.logout.bind(o.Socket,!0,a.LogoutReason.UserInitiated),okText:i.default.t(421),onOK:o.Socket.poke.bind(o.Socket),children:[e.description," ",e.children]})};var i=r(n(932325)),a=n(332108),o=n(6961),s=n(744259),l=n(785893)},446709:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.App=function(){return(0,Le.jsx)(He,{})},t.AppWrapper=void 0,t.closeSocketBeforeUnload=function(){(0,o.closeSocketAndPreventRetry)()},t.hasPending=function(){return null!=Ue&&Ue.hasPending()};var i=r(n(348926)),a=r(n(751463)),o=n(911794),s=n(616310),l=r(n(437142)),u=r(n(132375)),c=n(975175),d=n(201063),p=r(n(164325)),_=n(135630),f=n(789379),h=n(72696),g=r(n(875130)),m=n(63014),y=n(780549),E=n(429933),S=n(266888),T=(r(n(846870)),n(152730)),v=n(996588),A=n(113704),C=n(870263),P=n(413677),O=r(n(845294)),I=n(258105),M=n(520538),b=n(697371),R=r(n(591748)),N=n(81644),w=r(n(932325)),L=n(65889),D=n(696430),k=(r(n(858867)),n(591547)),U=n(332108),G=n(114850),x=n(871850),B=n(555622),F=n(497890),j=r(n(731138)),Y=n(94715),K=n(72732),H=n(241588),W=r(n(76892)),V=n(6961),$=n(355701),z=n(841273),q=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=De(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(572946)),J=r(n(614495)),Q=n(667738),X=n(91640),Z=n(368170),ee=n(238669),te=n(392632),ne=n(366320),re=n(343343),ie=r(n(79291)),ae=n(757453),oe=n(627162),se=n(459857),le=n(905225),ue=r(n(571834)),ce=n(209983),de=n(115383),pe=r(n(482904)),_e=n(574819),fe=r(n(346297)),he=(r(n(54099)),n(251780)),ge=n(127714),me=r(n(276409)),ye=n(744259),Ee=r(n(248380)),Se=r(n(324761)),Te=r(n(845979)),ve=r(n(549971)),Ae=n(544744),Ce=r(n(571411)),Pe=r(n(393014)),Oe=r(n(214642)),Ie=r(n(919570)),Me=n(548360),be=r(n(441143)),Re=r(n(120992)),Ne=r(n(730381)),we=n(667294),Le=n(785893);function De(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(De=function(e){return e?n:t})(e)}n(764597);const ke=n(76672).Mirrored(["CLIENT_EXPIRED_DIALOG","ANOTHER_SESSION","UNSUPPORTED_TAKEOVER","QR","SYNCING","OFFLINE","PROXYBLOCK","CONFLICT","TOS_BLOCK","SMB_TOS_BLOCK","DEPRECATED_VERSION","MAIN","STARTUP","TEMP_BAN","LOGOUT","PRIMARY_FORCE_UPGRADE"]);let Ue,Ge=!1,xe=!1;function Be(e){"initialPanelMountTRecorded"===e&&(Ge=!0),"initialPanelRenderTRecorded"===e&&(xe=!0),Ge&&xe&&(0,de.onInitialRenderComplete)()}const Fe=(0,a.default)((()=>{(0,de.saveInitialPanelMountTime)(Date.now()),Be("initialPanelMountTRecorded")}));function je(e){let{cmdAndData:t,isExternal:n,sessionId:r}=e;const{resultType:i,data:a}=t;return __LOG__(2)`main:execApiCmd:${i}`,(0,be.default)(null!=Ue,"Attempted to exec API command before main was loaded"),Ue.execApiCmd({cmd:i,untypedData:a,isExternal:n,sessionId:r})}function Ye(){y.Cmd.logSocketSummary(),__LOG__(2)`Focus at time of upload:`;try{ee.UIM.pprint(!0)}catch(e){__LOG__(3)`UIM Print Failed!`}return{platform:S.Conn.platform,ref:S.Conn.ref}}class Ke extends we.Component{constructor(){super(...arguments),this.contextMenuRef=(0,we.createRef)(),this.animate=!0,this.state={mode:z.Stream.mode,updating:z.Stream.clientExpired,hardExpired:z.Stream.hardExpired,anotherSession:!1,takingOver:!1,isUnsupportedTakeover:!1,apiCmd:void 0,locale:w.default.getLocale(),mainLoaded:!1,socketProgressStep:0,theme:(0,Q.getTheme)(),systemThemeMode:(0,ae.getSystemThemeMode)(),isKeyboardUser:!1,initialLoadReady:!1,startLogout:!1,stayInSync:!V.Socket.hasSynced,primaryForceUpgrade:x.PrimaryForceUpgrade.shouldForceUpgrade},this._setIsKeyboardUser=e=>{this.state.isKeyboardUser!==e&&this.setState({isKeyboardUser:e})},this._handlers={up:()=>this._setIsKeyboardUser(!0),down:()=>this._setIsKeyboardUser(!0),left:()=>this._setIsKeyboardUser(!0),right:()=>this._setIsKeyboardUser(!0),home:()=>this._setIsKeyboardUser(!0),end:()=>this._setIsKeyboardUser(!0),"command+up":()=>this._setIsKeyboardUser(!0),"command+down":()=>this._setIsKeyboardUser(!0),pageUp:()=>this._setIsKeyboardUser(!0),pageDown:()=>this._setIsKeyboardUser(!0),tab:()=>this._setIsKeyboardUser(!0),"shift+tab":()=>this._setIsKeyboardUser(!0),"shift+?":()=>this._setIsKeyboardUser(!0)},this._setWamSystemInfo=null,this._setModeScheduler=new d.ShiftTimer((e=>{e!==this.state.mode&&this.setState({mode:e})})),this._handleStreamModeChange=()=>{const e=z.Stream.mode;this.state.mode!==z.StreamMode.MAIN?this._setModeScheduler.onOrBefore(0,e):this._setModeScheduler.forceRunNow(e)},this._handleClientExpired=()=>{this.state.updating!==z.Stream.clientExpired&&this.setState({updating:z.Stream.clientExpired})},this._handleHardExpired=()=>{this.setState({hardExpired:z.Stream.hardExpired})},this._handleMouseDown=e=>{0!==e.detail&&this._setIsKeyboardUser(!1),y.Cmd.windowMouseDown(e)},this._handleClick=e=>{y.Cmd.windowClick(e)},this._handleWindowClick=e=>{const t=e.target;if(!t)return;if("A"!==t.nodeName)return;const n=t.getAttribute("href");if(!n)return;if(!function(e){let t=e;for(;t;){var n;if(t instanceof HTMLElement&&(null===(n=t.dataset)||void 0===n?void 0:n.nohandle))return!1;t=t.parentElement}return!0}(t))return;const r=(0,ge.parseAPICmd)(n);if("INVALID"===r.resultType)return;const i=this._getDeeplinkSessionId();this._canExecApiCmd()&&je({cmdAndData:r,isExternal:!0,sessionId:i})&&(this._logDeepLinkClickMetric(r,i),e.preventDefault())},this._logDeepLinkClickMetric=(e,t)=>{if(e.resultType===he.APICmd.GROUP_INVITE)new ue.default.DeepLinkClick({deepLinkHasPhoneNumber:!1,deepLinkHasText:!0}).commit();else if(e.resultType===he.APICmd.MSG_SEND){const n=e.data.phone,r=e.data.text;new ue.default.DeepLinkClick({deepLinkHasPhoneNumber:!!n,deepLinkHasText:!!r,deepLinkSessionId:t}).commit()}else(e.resultType===he.APICmd.CATALOG||e.resultType===he.APICmd.PRODUCT)&&new ue.default.DeepLinkClick({deepLinkHasPhoneNumber:!0,deepLinkHasText:!1}).commit()},this._handleSetTheme=e=>{if(this.state.theme!==e){for(const t of Q.THEME_ASSETS[e])f.AssetLoader.loadAsset(t,_.LOAD_PRIORITY.THEME_ASSET_LOAD,!1);if(H.ServerProps.wallpapersV2){const e=g.default.get("defaultPreference");if(e&&le.DEFAULT_CHAT_WALLPAPER!==e.wallpaperColor){const t=(0,le.toggleWallpaperColor)(e.wallpaperColor,this.state.theme);e.set("wallpaperColor",t)}}(0,Q.setTheme)(e),this.setState({theme:e})}},this._handleSetSystemThemeMode=e=>{(0,ae.setSystemThemeMode)(e),this.setState({systemThemeMode:e})},this._mdReloadPageOnTakeOver=()=>{__LOG__(2)`[md takeover] refreshing page on takeover`,window.location.reload()},this._handleReadyForMainScreen=()=>{__LOG__(2)`DebouncedLoadingScreen: Ready for main screen`,this.setState({stayInSync:!1})},this._mdReloadPageWithUnsupportedTakeOver=()=>{__LOG__(2)`[unsupported takeover] refreshing page with unsupported takeover`,window.location.reload()},this._getThemeContextValue=(0,l.default)((e=>{let{theme:t,systemThemeMode:n}=e;return{theme:t,setTheme:this._handleSetTheme,systemThemeMode:n,setSystemThemeMode:this._handleSetSystemThemeMode}}))}componentDidMount(){(0,v.registerCrashlogUploadInformationalLoggingFunction)(Ye);const e=(0,_e.widToMyJids)((0,se.getMe)());(0,b.setGlobals)({config:E.ConfigImpl,jidUtils:(0,s.createJidUtils)({platform:"whatsapp"}),myJids:e,db:C.dbCallbacks,runInTransaction:Y.runInTransaction,qpl:F.qplConfigs});const{theme:t}=this.state;(0,Q.applyThemeToUI)(t),$e().then((e=>{f.AssetLoader.setPlatform(e),f.AssetLoader.loadInitialAssets(Q.THEME_ASSETS[t])})),function(){return We.apply(this,arguments)}().then((()=>{y.Cmd.mainLoaded(),this.setState({mainLoaded:!0})})).then((()=>Promise.all([(0,L.requireEmojiAssetMapCreator)(),(0,L.requireEmojiConfig)(),$e()]))).then((e=>{let[t,n,r]=e;f.AssetLoader.setPlatform(r),f.AssetLoader.initEmojiAsset(t(n)),P.emojiCompletionTracker.beginPreloadFallback()}));const{listeners:r}=this.props;r.add(y.Cmd,"increment_progress",(()=>{this._incProgress()})),r.add(y.Cmd,"initial_load_ready",(()=>{this.setState({initialLoadReady:!0})})),r.add($.StorageCmd,"storage_not_enough_space",(()=>{G.ModalManager.open((0,Le.jsx)(ye.ConfirmPopup,{onOK:()=>{V.Socket.logout(!1,U.LogoutReason.StorageQuotaExceeded)},okText:Me.fbt._("OK",null,{hk:"2KEeHb"}),children:Me.fbt._("Your computer does not have enough space for WhatsApp to run. Please create more storage by deleting unused files from your computer, then log in again.",null,{hk:"3tBII8"})}))})),r.add(y.Cmd,"account_temporarily_banned",(e=>{this.setState({temporaryBan:e})})),r.add(y.Cmd,"starting_logout",(()=>{this.setState({startLogout:!0})})),r.add(x.PrimaryForceUpgrade,"change:shouldForceUpgrade",(()=>{const e=x.PrimaryForceUpgrade.shouldForceUpgrade;this.state.primaryForceUpgrade!==e&&this.setState({primaryForceUpgrade:e})})),B.QPL.throwKillswitch(!1),ce.OfflineResumeReporter.logPageLoadT();{const e=n(889423).Z;r.add(window,"beforeunload",e.unloadMutex.bind(e)),r.add(window,"unload",e.unloadMutex.bind(e)),r.add(window,"storage",(t=>{e.storagePong(t)&&(__LOG__(2)`[md takeover] tab taken over. stopping comms`,(0,o.closeSocketAndPreventRetry)(),k.Logger.onTakeOver(),this.setState({takingOver:!1,anotherSession:!0}))}))}if(r.add(z.Stream,"change:clientExpired",this._handleClientExpired),r.add(z.Stream,"change:hardExpired",this._handleHardExpired),r.add(z.Stream,"change:mode",this._handleStreamModeChange),ie.default.canMuckHistory()){const e=(0,ge.parseAPICmd)(window.location.href);if(e.resultType!==he.APICmd.INVALID){const{url:t}=e.data;delete e.data.url,this._maybeExecApiCmd(e),window.history.replaceState({},"",t)}}var i;r.add(w.default,"locale_change",(e=>{let{loc:t}=e;__LOG__(2)`App:componentDidMount:rerenderUI locale change`,(0,oe.setLangPref)(t),m.Clock.setIs24HourBasedOnLocale(),this.animate=!1,this.setState({locale:`${w.default.getLocale()}#${Ne.default.locale()}`})})),this._registerYesterdayTimer(),__LOG__(2)`App:componentDidMount:visibilityState: ${document.visibilityState}`,"prerender"===document.visibilityState?(0,c.promiseTimeout)((0,O.default)(document,"visibilitychange"),5e3).then((()=>this._beginMutex(0))).catch((()=>this._beginMutex(0))):this._beginMutex(0),this.props.listeners.add(window,"click",this._handleWindowClick,{capture:!0}),this.props.listeners.add(window,"blur",(()=>{this._setIsKeyboardUser(!1)})),re.updatePoll.poll(re.checkForUpdates),this._logFirstRenderMountTime(),document.createElement=(i=document.createElement.bind(document),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("iframe"===e.toLowerCase()){__LOG__(3)`Modified a created iframe element to include sandbox attributes for security fix.`;const n=i(e,t);return n.sandbox=H.ServerProps.webYouTubePlayerEnhancements||H.ServerProps.webPipRedesign?"allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox":"allow-scripts allow-same-origin",n}return i(e,t)}),this.props.listeners.add(J.default,"system_theme_change",(e=>{this.state.systemThemeMode&&this._handleSetTheme(e)}))}componentDidUpdate(e,t){!0===t.anotherSession&&!1===this.state.anotherSession?pe.default.openDB().catch((e=>{__LOG__(3)`Failed to open indexeddb: ${e}`})):!1===t.anotherSession&&!0===this.state.anotherSession&&pe.default.idb().then((e=>{e.close(),__LOG__(2)`db: closed due to take over`})).catch((()=>{})),this._maybeExecApiCmd(this.state.apiCmd),this.state.mode!==z.StreamMode.MAIN&&(this.animate=!0),this._logFirstRenderMountTime()}componentWillUnmount(){this._setModeScheduler.cancel(),this._setWamSystemInfo&&this._setWamSystemInfo.cancel()}_beginMutex(e){var t=this;let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,i.default)((function*(){if(Z.UA.isLocalStorageBroken){if(yield(0,K.isAnotherTabActive)()){k.Logger.onTakeOver(),t.setState({isUnsupportedTakeover:!0});try{(0,o.stopComms)()}catch(e){}return}}(0,K.setTabActive)(),r&&ne.Updater.shouldForceUpdateOnTakeOver()&&ne.Updater.restart();{const i=n(889423).Z,a=r?i.takeoverLocal(e):i.init(e),o=yield a.catch((e=>(t.setState({takingOver:!0}),t._beginMutex(e,!0))));k.Logger.isTakeOver=o,t.setState({takingOver:!1,anotherSession:o})}}))()}_incProgress(){this.setState({socketProgressStep:this.state.socketProgressStep+1})}_maybeExecApiCmd(e){if(e){if(this._canExecApiCmd()){return je({cmdAndData:e,isExternal:!0,sessionId:this._getDeeplinkSessionId()}),void(null!=this.state.apiCmd&&this.setState({apiCmd:null}))}e!==this.state.apiCmd&&this.setState({apiCmd:e})}}_canExecApiCmd(){return null!=Ue&&Ve(this.state)===ke.MAIN}_logFirstRenderMountTime(){this.state.mode!==z.StreamMode.SYNCING&&Fe()}_calculateProgress(){return 20*this.state.socketProgressStep}_registerYesterdayTimer(){p.default.setLocalTimeout((()=>{__LOG__(2)`App:registerYesterdayTimer:rerenderUI relative timestamps`,__LOG__(2)`Local Clock: ${Date.now()}, Skew: ${m.Clock.getSkew()}`,y.Cmd.midnight(),this._registerYesterdayTimer()}),(0,Ne.default)().endOf("day").valueOf())}_getTemporaryBanReason(e){const t=(0,se.getMaybeMeUser)().user;switch(e){case 101:return w.default.t(615,{phone:t});case 102:return Me.fbt._("You're temporarily banned from WhatsApp because too many people blocked you.",null,{hk:"3HhQ7n"});case 103:return w.default.t(616,{phone:t});case 104:return Me.fbt._("You're temporarily banned from WhatsApp because you sent the same message to too many people.",null,{hk:"2r9Adr"});case 106:return Me.fbt._("You're temporarily banned from WhatsApp because you sent too many messages to a broadcast list.",null,{hk:"3QZzJ1"});default:return Me.fbt._("You're temporarily banned from WhatsApp because you may have violated our terms of service.",null,{hk:"1d1rXh"})}}_getUiAndIconCount(){switch(Ve(this.state)){case ke.CLIENT_EXPIRED_DIALOG:return{ui:(0,Le.jsx)(M.DefaultFavicon,{children:(0,Le.jsx)(me.default,{})}),requiresBackendCheck:!1};case ke.ANOTHER_SESSION:{let e,t;return this.state.takingOver?(e=()=>{},t=w.default.t(207)):(e=()=>{this._mdReloadPageOnTakeOver()},t=w.default.t(162)),{ui:(0,Le.jsx)(M.ErrorFavicon,{children:(0,Le.jsx)(Ee.default,{cancelText:Me.fbt._("Close",null,{hk:"19Jpec"}),onCancel:window.open.bind(window,"https://www.whatsapp.com/","_self"),okText:t,onOK:e,children:w.default.t(871)})}),requiresBackendCheck:!1}}case ke.UNSUPPORTED_TAKEOVER:return{ui:(0,Le.jsx)(M.ErrorFavicon,{children:(0,Le.jsx)(Ee.default,{okText:Me.fbt._("Refresh",null,{hk:"3gD6Jh"}),onOK:this._mdReloadPageWithUnsupportedTakeOver,children:Me.fbt._("There is already another active WhatsApp Web tab in this browser. WhatsApp Web does not support multiple active tabs in this browser. Please use the existing tab or close it and refresh this tab.",null,{hk:"xnVvw"})})}),requiresBackendCheck:!1};case ke.TEMP_BAN:const{code:e,expire:t,message:n,url:r}=this.state.temporaryBan||{},i=null!=n?n:this._getTemporaryBanReason(e),a=Ne.default.duration(t,"seconds").humanize();return{ui:(0,Le.jsx)(M.ErrorFavicon,{children:(0,Le.jsxs)(Ee.default,{cancelText:w.default.t(443),onCancel:()=>{__LOG__(2)`Banned accounts: user selected logout`,V.Socket.logout()},okText:Me.fbt._("Learn more",null,{hk:"1L9NkE"}),onOK:window.open.bind(window,null!=r?r:(0,I.getFaqUrl)()),children:[(0,Le.jsx)("div",{children:i}),(0,Le.jsx)("div",{children:w.default.t(614,{duration:a})})]})}),requiresBackendCheck:!0};case ke.QR:return{ui:(0,Le.jsxs)(M.DefaultFavicon,{children:[(0,Le.jsx)(Ae.ModalManagerComponent,{type:Ae.ModalType},"modal-manager"),(0,Le.jsx)(j.default,{apiCmd:this.state.apiCmd},"qr-code")]}),extraClasses:fe.default.isQR,requiresBackendCheck:!0};case ke.STARTUP:case ke.SYNCING:let o=(0,Le.jsx)(Oe.default,{initialLoadReady:this.state.initialLoadReady,onReady:this._handleReadyForMainScreen});return{ui:(0,Le.jsx)(M.DefaultFavicon,{children:o}),requiresBackendCheck:!0};case ke.OFFLINE:return{ui:(0,Le.jsx)(M.ErrorFavicon,{children:(0,Le.jsx)(Ce.default,{})}),requiresBackendCheck:!0};case ke.PROXYBLOCK:return{ui:(0,Le.jsx)(M.ErrorFavicon,{children:(0,Le.jsx)(Pe.default,{})}),requiresBackendCheck:!0};case ke.CONFLICT:return{ui:(0,Le.jsx)(M.ErrorFavicon,{children:(0,Le.jsx)(Ee.default,{cancelText:w.default.t(443),onCancel:()=>V.Socket.logout(),okText:w.default.t(162),onOK:()=>V.Socket.takeover(),children:w.default.t(538)})}),requiresBackendCheck:!0};case ke.TOS_BLOCK:return{ui:(0,Le.jsx)(M.ErrorFavicon,{children:(0,Le.jsx)(Ie.default,{description:Me.fbt._('WhatsApp is updating our Terms and Privacy Policy to reflect new features and comply with the new European Union data protection laws. Open WhatsApp on your phone to read our Terms and Privacy Policy and learn more about the choices you have. If you have accepted the Terms and Privacy Policy, click "LOG IN" to continue using WhatsApp.',null,{hk:"4uxe2b"})})}),requiresBackendCheck:!0};case ke.SMB_TOS_BLOCK:return{ui:(0,Le.jsx)(M.ErrorFavicon,{children:(0,Le.jsx)(Ie.default,{description:Me.fbt._('We are updating our WhatsApp Business Terms of Service. Agree to our new Terms on your phone to continue using WhatsApp Business. If you have accepted the Terms of Service, click "LOG IN" to continue using WhatsApp Business.',null,{hk:"3Ti2sa"}),children:(0,Le.jsx)(W.default,{})})}),requiresBackendCheck:!0};case ke.DEPRECATED_VERSION:return{ui:(0,Le.jsx)(M.ErrorFavicon,{children:(0,Le.jsx)(Se.default,{})}),requiresBackendCheck:!0};case ke.LOGOUT:return{ui:(0,Le.jsxs)(M.DefaultFavicon,{children:[(0,Le.jsx)(Ae.ModalManagerComponent,{type:Ae.ModalType},"modal-manager"),(0,Le.jsx)(ve.default,{},"logout")]}),requiresBackendCheck:!0};case ke.PRIMARY_FORCE_UPGRADE:return{ui:(0,Le.jsx)(M.ErrorFavicon,{children:(0,Le.jsx)(Te.default,{})}),requiresBackendCheck:!0};case ke.MAIN:const{MainComponent:s}=(0,u.default)(Ue,"Main");return{ui:[(0,Le.jsx)(X.ToastManagerComponent,{},"toast-manager"),(0,Le.jsx)(Ae.ModalManagerComponent,{contextMenuRef:this.contextMenuRef,type:Ae.ModalType},"main-modal-manager"),(0,Le.jsx)(Ae.ModalManagerComponent,{type:Ae.MediaType},"media-modal-manager"),(0,Le.jsx)(T.ContextMenuManager,{ref:this.contextMenuRef,type:T.Type.MENU},"context-menu-manager"),(0,Le.jsx)(T.ContextMenuManager,{type:T.Type.TOOLTIP},"tooltip-manager"),(0,Le.jsx)(P.InitialEmojisCompletionContext.Provider,{value:P.emojiCompletionTracker,children:(0,Le.jsx)(s,{conn:S.Conn,animate:this.animate})},"main")],extraClasses:fe.default.isMain,requiresBackendCheck:!0}}}_getDeeplinkSessionId(){return(0,h.smbClickToChatLoggingEnabled)()?Math.floor(2147483648*Math.random()).toString():void 0}render(){!function(e){if(de.initialScreenTimer.hasStarted())return;const t=Ve(e);if(!function(e){return e!==ke.SYNCING}(t))return;(0,de.setInitialScreen)(t),de.initialScreenTimer.start(),window.requestAnimationFrame((()=>{de.initialScreenTimer.end(),Be("initialPanelRenderTRecorded")}))}(this.state);const{isKeyboardUser:e}=this.state,{ui:t,extraClasses:n,requiresBackendCheck:r}=this._getUiAndIconCount(),i=(0,Re.default)(fe.default.wrapper,n,(0,A.cx)({"app-wrapper-native":q.isNative,"app-wrapper-web":q.isWeb,"safari-fix":q.hasSafariFix,"edge-fix":q.hasEdgeFix,"font-fix":q.hasFontFix,"os-ltr":q.isOSLTR,"os-rtl":q.isOSRTL,"os-mac":q.isOSMac,"os-win":q.isOSWin,"keyboard-user":e}));r&&null!=Ue&&!(0,ae.knowsPhone)()&&Ue.notificationBackend.shutdownAsNeeded();const a=Ve(this.state),o=a===ke.STARTUP||a===ke.SYNCING?"loading-screen":this.state.locale;return(0,Le.jsx)(Q.ThemeContext.Provider,{value:this._getThemeContextValue({theme:this.state.theme,systemThemeMode:this.state.systemThemeMode}),children:(0,Le.jsx)(R.default.Provider,{value:{isKeyboardUser:e,setIsKeyboardUser:this._setIsKeyboardUser},children:(0,Le.jsx)(te.UIE,{displayName:"App",uimState:ee.UIMState.INACTIVE,children:(0,Le.jsxs)(N.HotKeys,{handlers:this._handlers,className:i,tabIndex:null,onMouseDownCapture:this._handleMouseDown,onClickCapture:this._handleClick,children:[undefined,undefined,t]},o)})})})}}Ke.displayName="AppImpl";const He=(0,D.ListenerHOC)(Ke);function We(){return(We=(0,i.default)((function*(){const[e,t]=yield Promise.all([(0,L.requireMain)(),$e()]);de.mainScriptTimer.start(),Ue=e(t),de.mainScriptTimer.end()}))).apply(this,arguments)}function Ve(e){var t;const{anotherSession:n,isUnsupportedTakeover:r,updating:i,hardExpired:a,mainLoaded:o,mode:s}=e;if(null===(t=e.temporaryBan)||void 0===t?void 0:t.banned)return ke.TEMP_BAN;if(e.startLogout)return ke.LOGOUT;if(i||a)return ke.CLIENT_EXPIRED_DIALOG;if(r)return ke.UNSUPPORTED_TAKEOVER;if(n)return ke.ANOTHER_SESSION;switch(s){case z.StreamMode.QR:return ke.QR;case z.StreamMode.SYNCING:return ke.SYNCING;case z.StreamMode.OFFLINE:return ke.OFFLINE;case z.StreamMode.PROXYBLOCK:return ke.PROXYBLOCK;case z.StreamMode.CONFLICT:return ke.CONFLICT;case z.StreamMode.TOS_BLOCK:return ke.TOS_BLOCK;case z.StreamMode.SMB_TOS_BLOCK:return ke.SMB_TOS_BLOCK;case z.StreamMode.DEPRECATED_VERSION:return ke.DEPRECATED_VERSION;case z.StreamMode.MAIN:return o?e.stayInSync?ke.SYNCING:e.primaryForceUpgrade?ke.PRIMARY_FORCE_UPGRADE:ke.MAIN:ke.STARTUP}throw new Error(`app:render Error invalid StreamMode: ${s}`)}function $e(){return S.Conn.platform?Promise.resolve(S.Conn.platform):new Promise((e=>{const t=()=>{const{platform:n}=S.Conn;null!=n&&(S.Conn.off("change:platform",t),e(n))};S.Conn.on("change:platform",t)}))}t.AppWrapper=He},856562:(e,t,n)=>{"use strict";var r=n(595318)(n(348926)),i=n(650201),a=n(785893);function o(){return(o=(0,r.default)((function*(){var e;if((0,i.isFeatureEnabled)("native_promise_runtime")){const{loadStackPromisePolyfill:e}=n(752751);e()}else window.Promise=n(225605).Z;const{setupLodashMemoizeCache:t}=n(67819);t(),window.__LOG__=n(591547).log,window.SEND_LOGS=n(996588).sendLogs,window.onerror=n(463812).HC,window.onunhandledrejection=n(463812).TG;const{initializePREMetrics:o}=n(377795);o();const s=n(174285).default;self.URL=self.URL||self.webkitURL,self.AudioContext=self.AudioContext||self.webkitAudioContext,self.requestFileSystem=self.requestFileSystem||self.webkitRequestFileSystem,n(846870).default;const{KEYS:l}=n(94872),{UA:u}=n(368170),c="1"===(null==s?void 0:s.getItem(l.LOGOUT_DIRTY_BIT)),d=!(null==s?void 0:s.getItem(l.LAST_WID_MD))&&!(null==s?void 0:s.getItem(l.LAST_WID)),{deleteAllIdb:p}=n(344611),{initWAWC:_}=n(460888);if(c||d)try{yield p(),yield _()}catch(e){__LOG__(4,void 0,new Error,void 0,["app-wrapper"])`Preemptive db delete failed with error ${e}`}else try{n(591547).Logger.clearLogsPreemptive()}catch(e){}const{copyNoiseInfoValuesToCacheStorage:f}=n(567472);yield f();const h=new(0,n(665810).default)((null!==(e=window.location.search)&&void 0!==e?e:"").toLowerCase());c&&(null==s||s.clear(),h.set("post_logout","1"),window.location.href=`${window.location.pathname}?${h.toString()}`);const g=h.get("logout_reason");if(null!=g){(0,n(383047).setPrevLogoutReasonCode)(g)}if("1"===h.get("post_logout")||null!=g){n(79291).default.canMuckHistory()&&window.history.replaceState({},document.title,"/")}const{initModules:m}=n(981433);m();const{initializeABPropsCache:y}=n(238196);y();const{initWamRuntime:E}=n(154378);E();const{exeTimer:S}=n(115383);S.start();const T=n(132375).default,v=n(973935);n(667294),u.isSafari&&u.browserVersion.startsWith("13.")&&(T(document.body,"document.body").className+=" text-rendering-bug-fix"),n(694114),window.Velocity=n(512641),n(38161),n(959206).registerEffects();const A=n(542137),C=n(403868).Z;A.set(C);const{isFunction:P}=n(425315);["getSelection","open","focus"].forEach((function(e){const t=Object.getPrototypeOf(window)[e];P(t)&&window[e]!==t&&(window[e]=t)})),window.Debug||(window.Debug={});try{if(u.isLocalStorageBroken){const e=n(482904).default;yield e.loadUserIdb()}}finally{const e=n(932325).default;e.init(n(627162).getLangPref()).then((0,r.default)((function*(){const{Clock:e}=yield Promise.resolve().then(n.bind(n,63014));e.setIs24HourBasedOnLocale()}))),n(591547).Logger;const{App:t,hasPending:i}=n(446709);window.Debug.VERSION="2.2246.10",window.Debug.DESKTOP_BETA=!1,window.Debug.BUILD_ID="426861583";const o=n(524173).default;window.onbeforeunload=function(){{const{closeSocketBeforeUnload:t}=n(446709),{isOpeningDeeplinkInCurrentTab:r}=n(753233);if(!i()&&!r())try{t()}catch(e){__LOG__(4,void 0,new Error)`error while stopping comms onbeforeunload: ${e}`}if(o.isDownloading())return void o.clearDownloading();if(__LOG__(2)`webclient close/reload triggered`,__LOG__(2)`latest hash: ${"2689073628a9df07d1ae96a8275ff77478fcdb0c"}`,__LOG__(2)`version: ${"2.2246.10"}`,o.promptUnloadGuards>0)return;if(i())return e.t(193)}},window.addEventListener("dragover",(function(e){e.preventDefault()})),window.addEventListener("drop",(function(e){e.preventDefault()})),n(583017).loadSVGData();(0,n(103375).Z)()||(v.render((0,a.jsx)(t,{}),T(document.getElementById("app"),"document.getElementById('app')")),S.end())}if(window.navigator.serviceWorker&&!window.navigator.serviceWorker.controller)try{window.navigator.serviceWorker.register("/serviceworker.js",{scope:"/"})}catch(e){}}))).apply(this,arguments)}!function(){o.apply(this,arguments)}()},366320:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.UpdaterImpl=t.Updater=void 0;var i=r(n(164325)),a=r(n(524173)),o=n(663893),s=n(885765),l=r(n(478885));class u extends o.UpdaterBase{update(e,t,r){__LOG__(2)`AppUpdate:update current: ${String(this.activeVersion)} latest: ${String(e)}`;const a=++this.latestUpdateIteration,l=null==e?void 0:new s.Version(e);this.clearHardExpiration();const u=n(841273).Stream;return"number"==typeof r&&(this.hardExpirationTimer=i.default.setLocalTimeout((()=>(u.clientExpired=!0,this._update(l).then((e=>{e===o.DownloadState.UPDATE_DOWNLOADED&&this.restart()})))),Date.now()+r)),this.updateInProgress=Promise.resolve(this.updateInProgress).then((()=>this._update(l))).then((e=>{this.updateInProgress=void 0;const n=a!==this.latestUpdateIteration,i=e===o.DownloadState.ERROR,s=e===o.DownloadState.UPDATE_NOT_AVAILABLE;return n||i||s||(!0!==t&&"number"!=typeof r||(u.needsUpdate=!0),"number"==typeof r&&this.listenToAndRun(u,"change:couldForce",(()=>{u.couldForce&&this.restart()}))),e})),this.updateInProgress}_update(e){if(!this.activeVersion.equals(e)&&(null===l.default||void 0===l.default?void 0:l.default.alive))return this._swUpdate();const t=this.activeVersion.equals(e)?o.DownloadState.UPDATE_NOT_AVAILABLE:o.DownloadState.UPDATE_DOWNLOADED;return Promise.resolve(t)}killServiceWorker(){if(!(null===l.default||void 0===l.default?void 0:l.default.alive))return Promise.resolve();const e=navigator.serviceWorker;return e?(__LOG__(2)`Killing service worker`,e.ready.then((e=>e.unregister())).then((e=>{__LOG__(2)`Service worker unregistration status: ${String(e)}`}))):Promise.resolve()}_swUpdate(){{const e=navigator.serviceWorker;if(e)return e.ready.then((t=>new Promise((n=>{function r(e){a(),__LOG__(3)`Unable to update service worker to version. Error: ${String(e)}`}function i(){a(),n(o.DownloadState.UPDATE_DOWNLOADED)}function a(){e.removeEventListener("error",r),e.removeEventListener("controllerchange",i)}e.addEventListener("error",r),e.addEventListener("controllerchange",i),t.update().then((()=>{t.installing||n(o.DownloadState.UPDATE_NOT_AVAILABLE)})).catch((e=>{r(e),n(o.DownloadState.ERROR)}))})))).catch((e=>(__LOG__(3)`Unable to update serviceworker, error: ${e}`,o.DownloadState.ERROR)))}return Promise.resolve(o.DownloadState.ERROR)}restart(e){return!0===e?this.update(void 0,!0,0):(a.default.hardRefresh(void 0,!1),Promise.resolve(o.DownloadState.UPDATE_DOWNLOADED))}}t.UpdaterImpl=u;const c=new u;t.Updater=c},663893:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.UpdaterBase=t.DownloadState=void 0;var i=n(643930),a=n(990445),o=r(n(164325)),s=r(n(395654)),l=r(n(595307)),u=n(885765),c=r(n(482904));const d=n(76672).Mirrored(["UPDATE_DOWNLOADED","UPDATE_NOT_AVAILABLE","ERROR"]);t.DownloadState=d;class p extends s.default{constructor(){super(),this._forceUpdateOnTakeOver=!1,this.latestUpdateIteration=0,this.activeVersion=new u.Version("2.2246.10"),c.default.onVersionChange((()=>this.setForceUpdateOnTakeOver()))}setForceUpdateOnTakeOver(){this._forceUpdateOnTakeOver=!0}shouldForceUpdateOnTakeOver(){const e=this._forceUpdateOnTakeOver;return this._forceUpdateOnTakeOver=!1,!!e}isExpired(){return(0,a.unixTime)()>Number(l.default)}clearHardExpiration(){this.hardExpirationTimer&&(o.default.clearTimeout(this.hardExpirationTimer),this.hardExpirationTimer=void 0),this.stopListening(n(841273).Stream,"change:couldForce")}update(){throw new i.UnimplementedMethod("Updater::update")}restart(){throw new i.UnimplementedMethod("Updater::restart")}manualDownload(){throw new i.UnimplementedMethod("Updater::manualDownload")}killServiceWorker(){throw new i.UnimplementedMethod("Updater::killServiceWorker")}}t.UpdaterBase=p},595307:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;const r=document.getElementById("hard_expire_time");let i=null==r||null===(n=r.dataset)||void 0===n?void 0:n.time;i||(__LOG__(3)`hard expire time not found on dom, using fallback of 1572566400 (2019/11/1)`,i="1572566400");var a=i;t.default=a},343343:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.PLATFORMS=void 0,t.checkForUpdates=function(){return f.apply(this,arguments)},t.updatePoll=t.hasUpdate=void 0;var i=r(n(348926)),a=r(n(391349)),o=r(n(219368)),s=n(366320),l=n(885765),u=n(350906);const c="https://web.whatsapp.com/check-update",d={WEB:"web",DARWIN:"darwin",WIN32:"win32",MACSTORE:"darwin-store",WINSTORE:"win32-store",DARWIN_BETA:"darwin-beta",WIN32_BETA:"win32-beta"};t.PLATFORMS=d;const p=e=>[e.isBroken,e.isBelowSoft,e.isBelowHard,e.beta].some(Boolean);t.hasUpdate=p;const _=new a.default({name:"updater",interval:1800,restingInterval:3600,randomIntervalExtension:180});function f(){return(f=(0,i.default)((function*(){const e=d[u.WAM_PLATFORM],t=l.SANITIZED_VERSION_STR;let r=null;if(!navigator.onLine)return __LOG__(2)`Update check skipped because user is offline.`,!1;try{const n=yield(0,o.default)(`${c}?version=${t}&platform=${e}`);if(!n.ok)throw Error(n.statusText);r=yield n.json();const i=(new Date).toISOString();__LOG__(2)`Updater: Checked at ${i} ${JSON.stringify({response:r,version:t})}`}catch(e){__LOG__(4,void 0,new Error)`Updater: Version check failed`}if(!r||!p(r))return!1;const{isBelowHard:i,isBelowSoft:a,hardUpdateTime:_,currentVersion:f,isBroken:h,beta:g}=r;__LOG__(2)`Updater: App will update. ${JSON.stringify({response:r,version:t})}`;const m=i?_:null;return"web"===e?s.Updater.update(f,a,m):h?n(841273).Stream.needsManualDownload=!0:s.Updater.update(void 0,a,m,g),!0}))).apply(this,arguments)}t.updatePoll=_},885765:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Version=t.SANITIZED_VERSION_STR=void 0,t.sanitizeVersionStr=o;var r=n(643930);class i extends((0,r.customError)("InvalidVersion")){}class a{constructor(e){const t=e.split(".");if(3!==t.length)throw new i("Version format does not contain 3 numbers.");if(this.primary=Number.parseInt(t[0],10),this.secondary=Number.parseInt(t[1],10),this.tertiary=Number.parseInt(t[2],10),Number.isNaN(this.primary)||Number.isNaN(this.secondary)||Number.isNaN(this.tertiary))throw new i("Version contains a non-parseable string.")}lt(e){let t=e;return"string"==typeof t&&(t=new a(t)),this.primary<t.primary||this.primary===t.primary&&this.secondary<t.secondary||this.primary===t.primary&&this.secondary===t.secondary&&this.tertiary<t.tertiary}equals(e){let t=e;return!!t&&("string"==typeof t&&(t=new a(t)),this.primary===t.primary&&this.secondary===t.secondary&&this.tertiary===t.tertiary)}toString(){return`${this.primary}.${this.secondary}.${this.tertiary}`}}function o(e){return e.replace(/\.[di]$/,"")}t.Version=a;const s=o("2.2246.10");t.SANITIZED_VERSION_STR=s},889423:(e,t,n)=>{"use strict";var r=n(595318);t.Z=void 0;var i=r(n(348926)),a=n(643930),o=n(924583),s=n(975175),l=r(n(164325)),u=r(n(845294)),c=r(n(987009)),d=n(6961),p=n(173077);const _=6e5,f="init",h="ping",g="pong",m="local-takeover";var y=new class{init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return(0,i.default)((function*(){const n=t+1;if(n>3)return!0;const r=(0,p.getNoTakeover)();(0,p.setNoTakeover)();if(yield e._pingForOtherLocalSession())return e._updateMutex(),yield(0,c.default)(!r),!1;if(r)return!0;throw n}))()}takeoverLocal(e){return(0,p.getMutex)()?((0,p.setMutex)(m),(0,s.promiseTimeout)((0,u.default)(window,"storage",p.takeoverFilter),3e4,"takeoverLocalTimeout").then((()=>(d.Socket.mustExitLoop=!1,(0,p.removeMutex)(),this.init(e)))).catch((0,o.filteredCatch)(a.TimeoutError,(()=>(__LOG__(3)`app:takeoverLocal timeout`,d.Socket.mustExitLoop=!1,(0,p.removeMutex)(),this.init(e)))))):this.init(e)}unloadMutex(){const e=(0,p.getMutex)();e&&this._ourMutex&&e.includes(this._ourMutex)&&(0,p.removeMutex)()}storagePong(e){if(!(0,p.mutexFilter)(e))return;const t=(0,p.parseMutex)(e.newValue);return t?t===m?(this._clearMutexTimer(),d.Socket.exitLoop(),(0,p.localTakeoverSuccess)(),!0):void(0===t.indexOf(h)&&(0,p.setMutex)(g+Math.random())):void 0}_clearMutexTimer(){this._updateMutexTimerID&&l.default.clearTimeout(this._updateMutexTimerID)}_updateMutex(){this._clearMutexTimer();const e=Date.now();(0,p.setMutex)(this._ourMutex=f+"_"+e),this._updateMutexTimerID=l.default.setLocalTimeout(this._updateMutex.bind(this),e+_)}_pingForOtherLocalSession(){let e=(0,p.getMutex)();if(e){e+="";let t=1e4;if(e.indexOf("_")>0){const n=e.split("."),r=parseInt(n[n.length-1],10);if(Number.isFinite(r)){r<Date.now()-9e5&&(__LOG__(2)`app:_pingForOtherLocalSession stale mutex`,t=1e3)}}const n=(0,s.promiseTimeout)((0,u.default)(window,"storage",p.mutexFilter),t,"waitForOtherLocalSessionTimeout").then((()=>!1)).catch((0,o.filteredCatch)(a.TimeoutError,(()=>(__LOG__(3)`app:_pingForOtherLocalSession mutex timeout`,!0))));return(0,p.setMutex)(h+Math.random()),n}return Promise.resolve(!0)}};t.Z=y},780549:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Revoke=t.CmdImpl=t.Cmd=t.APP_STATE_SYNC_COMPLETED=void 0;var a=i(n(348926)),o=i(n(81109)),s=i(n(23279)),l=n(88237),u=(n(698052),n(493288)),c=i(n(395654)),d=n(390912),p=n(411067),_=(i(n(571834)),i(n(441143)));const f=n(76672).Mirrored(["Sender","Admin"]);t.Revoke=f;t.APP_STATE_SYNC_COMPLETED="app_state_sync_completed";class h extends c.default{constructor(){super(...arguments),this.isMainLoaded=!1,this.uiBusy=0,this.isMainStreamReadyMd=!1,this.isOfflineDeliveryEnd=!1,this._clearUiBusy=(0,s.default)((()=>{this.uiBusy&&(__LOG__(2)`cmd:clearUIBusy uibusy timeout`,this.uiBusy=0,this._triggerIdleEvent())}),1e3,{maxWait:5e3}),this._triggerIdleEvent=function(e){let t;const n=()=>{if(t)return;t=new r;const{signal:n}=t;(0,u.documentFlushed)({signal:n}).then((()=>{n.aborted||(t=null,e())}),(e=>{if(e.name!==l.ABORT_ERROR)throw e}))};return n.cancel=()=>{t&&(t.abort(),t=null)},n}((()=>{(0,_.default)(0===this.uiBusy,`ui_idle triggered when uiBusy is ${this.uiBusy}`),0===this.uiBusy&&(this._clearUiBusy.cancel(),this.trigger("ui_idle"))}))}mainLoaded(){this.isMainLoaded=!0,this.trigger("main_loaded")}incrementProgress(){__LOG__(2)`Cmd: incrementProgress`,this.trigger("increment_progress")}initialLoadReady(){__LOG__(2)`Cmd: initialLoadReady`,this.trigger("initial_load_ready")}logSocketSummary(){this.trigger("log_socket_summary")}muteAll(e,t,n,r){this.trigger("mute_all",e,t,n,r)}muteAllCall(e,t){this.trigger("mute_all_call",e,t)}muteChat(e,t,n){this.trigger("mute_chat",(0,p.unproxy)(e),t,n)}muteChatMultiselect(e,t,n){this.trigger("mute_chat_multiselect",e,t,n)}muteChatFromEntryPoint(e,t,n,r){this.trigger("mute_chat_from_entrypoint",(0,p.unproxy)(e),t,n,r)}muteChats(e,t,n){const r=e.map((e=>(0,p.unproxy)(e)));this.trigger("mute_chats",r,t,n)}assignChat(e,t){this.trigger("assign_chat",(0,p.unproxy)(e),t)}deleteOrExitChat(e,t){this.trigger("delete_or_exit_chat",(0,p.unproxy)(e),t)}deleteOrExitChatFromEntryPoint(e,t,n){this.trigger("delete_or_exit_chat_from_entrypoint",(0,p.unproxy)(e),t,n)}clearChat(e,t){this.trigger("clear_chat",(0,p.unproxy)(e),t)}archiveChat(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.trigger("archive_chat",(0,p.unproxy)(e),t,n)}archiveChatFromEntryPoint(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.trigger("archive_chat_from_entrypoint",(0,p.unproxy)(e),t,n,r)}pinChat(e,t){this.trigger("pin_chat",(0,p.unproxy)(e),t)}pinChats(e,t){const n=e.map((e=>(0,p.unproxy)(e)));this.trigger("pin_chats",n,t)}markChatUnread(e,t){this.trigger("mark_chat_unread",(0,p.unproxy)(e),t)}msgInfoDrawer(e){this.trigger("msg_info_drawer",(0,p.unproxy)(e))}chatSearch(e){this.trigger("chat_search",(0,p.unproxy)(e))}chatInfoDrawer(e,t,n){this.trigger("chat_info_drawer",(0,p.unproxy)(e),t,n)}attachMediaDrawer(e){const t=(0,o.default)((0,o.default)({},e),{},{chat:(0,p.unproxy)(e.chat)});this.trigger("attach_media_drawer",t)}attachProduct(e){this.trigger("attach_product",e)}verificationDrawer(e){this.trigger("verification_drawer",e)}liveLocationDrawer(e,t){this.trigger("live_location_drawer",e,t)}expiredLocationDrawer(e){this.trigger("expired_location_drawer",e)}mediaViewerModal(e){const{msg:t,getZoomNode:n,currentTime:r,highlightedMsgIds:i}=e;this.trigger("media_viewer_modal",{msg:t,getZoomNode:n,currentTime:r,highlightedMsgIds:i})}openMediaViewerForAlbumMedia(e){this.trigger("open_media_viewer_for_album_media",e)}productImageViewerModal(e,t){this.trigger("product_image_viewer_modal",e,t)}ephemeralDrawer(e,t,n){this.trigger("ephemeral_drawer",e,t,n)}openCommunityHome(e,t){this.trigger("open_community_home",e,t)}openCommunityHomeManageGroups(e){this.trigger("open_community_home_manage_groups",e)}openProfileInfoFromNotification(e){this.trigger("open_profile_info_from_notification",e)}communityAddNewGroup(e,t){this.trigger("open_community_add_new_group",e,t)}sendStarMsgs(e,t,n,r){this.trigger("send_star_msgs",(0,p.unproxy)(e),t,n,r)}sendUnstarMsgs(e,t,n,r){this.trigger("send_unstar_msgs",(0,p.unproxy)(e),t,n,r)}sendDeleteMsgs(e,t,n,r,i){this.trigger("send_delete_msgs",(0,p.unproxy)(e),t,n,r,i)}sendRevokeMsgs(e,t,n){this.trigger("send_revoke_msgs",(0,p.unproxy)(e),t,n)}addFavoriteSticker(e){this.trigger("add_favorite_sticker",e)}removeFavoriteSticker(e){this.trigger("remove_favorite_sticker",e)}_openChat(e,t){const n=(0,p.unproxy)(e);return new Promise((e=>{this.trigger("open_chat",n,t,e)})).catch((e=>{throw __LOG__(2)`Unexpected openChat error: ${String(e)}`,e}))}openChatAt(e,t){var n=this;const r=(0,p.unproxy)(e);if(!t)return this.openChatBottom(r);this.setUiBusy(!0,"open_chat_at");const i=this._openChat(r,t).then(function(){var e=(0,a.default)((function*(e){let r,i;const a=null==t.enableAnimation||t.enableAnimation;if(e)if(e.wasVisible)r=()=>n._scrollToFocusedMsg({pos:"offset",offset:e.offset}),i=()=>n._scrollToFocusedMsg({pos:"center",animate:a,duration:400,easing:[.7,0,.3,1]});else switch(r=()=>n._scrollToFocusedMsg({pos:e.alignAt}),e.alignAt){case"top":case"bottom":i=()=>n._scrollToFocusedMsg({pos:"center",animate:a,duration:400,easing:[.88,.64,.13,.99]});break;case"center":default:i=()=>Promise.resolve()}else r=()=>n._scrollToFocusedMsg({pos:"center"}),i=()=>Promise.resolve();return yield r(),i()}));return function(){return e.apply(this,arguments)}}()).then((()=>{this.flashFocusedMsg(t.highlightMentionMsg)})).then((()=>!0)).catch((0,l.catchAbort)((()=>!1)));return i.finally((()=>{this.setUiBusy(!1,"open_chat_at")})),i}openChatFromUnread(e){const t=(0,p.unproxy)(e);let n;if(t.unreadMsgAnchor&&(n={collection:t.unreadMsgAnchor.msgChunk,promise:Promise.resolve(),msg:t.unreadMsgAnchor,isUnreadDivider:t.shouldShowUnreadDivider}),n||t.unreadCount>0){this.setUiBusy(!0,"open_from_unread");const e=this._openChat(t,n).then((()=>this._scrollToFocusedMsg({pos:"top",offset:-120}))).then((()=>!0)).catch((0,l.catchAbort)((()=>!1)));return e.finally((()=>{this.setUiBusy(!1,"open_from_unread")})),e}return this.openChatBottom(t)}openChatBottom(e){const t=(0,p.unproxy)(e);let n;this.setUiBusy(!0,"open_bottom"),t.msgs.length>0&&(n={collection:t.msgs,msg:t.msgs.last(),isUnreadDivider:!1});const r=this._openChat(t,n).then((()=>this._scrollChatToBottom())).then((()=>!0)).catch((0,l.catchAbort)((()=>!1)));return r.finally((()=>{this.setUiBusy(!1,"open_bottom")})),r}scrollToPtt(e){const t=(0,p.unproxy)(e.chat),n={collection:e.chat.msgs,msg:e,key:e.id,highlightMsg:!1};this.setUiBusy(!0,"open_chat_at");const r=this._openChat(t,n).then((()=>this._scrollToFocusedMsg({pos:"center",animate:!0,duration:400,easing:[.7,0,.3,1]}))).then((()=>!0)).catch((0,l.catchAbort)((()=>!1)));return r.finally((()=>{this.setUiBusy(!1,"open_chat_at")})),r}_scrollToFocusedMsg(e){return new Promise((t=>{this.trigger("scroll_to_focused_msg",t,e)})).catch((e=>{__LOG__(3)`Unexpected scrollToFocusedMsg error: ${String(e)}`}))}_scrollChatToBottom(){return new Promise((e=>{this.trigger("scroll_chat_to_bottom",e)})).catch((e=>{__LOG__(3)`Unexpected scrollChatToBottom error: ${String(e)}`}))}flashFocusedMsg(e){setTimeout((()=>{this.trigger("flash_focused_msg"),e&&this.trigger("flash_mention_msg")}),0)}updateChatlistSelection(e){const t=(0,p.unproxy)(e);this.trigger("update_chatlist_selection",t)}closeChat(e){const t=(0,p.unproxy)(e);this.trigger("close_chat",t)}focusShowMsg(e){this.trigger("focus_show_msg",e)}focusNextChat(e){this.trigger("focus_next_chat",e)}focusPrevChat(e){this.trigger("focus_prev_chat",e)}focusChatList(){this.trigger("focus_chat_list")}focusChatSearch(){this.trigger("focus_chat_search")}startGroupCall(e,t){const n=(0,p.unproxy)(e);this.trigger("voip_start_group_call",n,t)}closeStatusViewer(){this.trigger("close_status_viewer")}openComposeBoxPanel(e){this.trigger("open_compose_box_panel",e)}login(e){this.trigger("login",e)}logout(){d.LegacyPhoneFeatures.resetFeatures(),this.trigger("logout")}openContextMenu(e,t){this.trigger("open_context_menu",e,t)}closeContextMenu(e){this.trigger("close_context_menu",e)}openTooltip(e,t){this.trigger("open_tooltip",e,t)}closeTooltip(e){this.trigger("close_tooltip",e)}alertNewMsg(e){this.trigger("alert_new_msg",e)}alertNewReactionMsg(e){this.trigger("alert_new_reaction_msg",e)}newMediaMsg(e){this.trigger("new_media_msg",e)}alertCall(e,t,n,r,i){this.trigger("alert_call",{wid:e,mid:t,isVideo:n,isGroup:r,canHandleLocally:i})}cancelCall(e){this.trigger("cancel_call",e)}windowError(){}sentPing(){}onPanesWillChange(e){this.trigger("panes_will_change",e)}onPanesDidChange(e){this.trigger("panes_did_change",e)}openGroupInviteModal(e){this.trigger("open_group_invite_modal",e)}reactionChangeLastMessage(){this.trigger("reaction_changed_last_msg")}openGroupsV4InviteRequestFlow(e,t,n,r){this.trigger("open_groups_v4_invite_request_flow",e,t,n,r)}openCommandPalette(){this.trigger("open_command_palette")}closeCommandPalette(){this.trigger("close_command_palette")}uiResize(){this.trigger("resize")}setUiBusy(e){let t=this.uiBusy||0;e?(++t,this._clearUiBusy(),this._triggerIdleEvent.cancel()):t&&--t,this.uiBusy=t,0===t&&(this._clearUiBusy.cancel(),this._triggerIdleEvent())}windowMouseDown(e){this.trigger("window_mousedown",e)}windowClick(e){this.trigger("window_click",e)}midnight(){this.trigger("midnight")}textsizeChange(e){this.trigger("textsize_change",e)}scrollMessages(){this.trigger("scroll_messages")}getConversationHeaderOffset(e){this.trigger("get_conversation_header_offset",e)}floaterEscapeOverlap(e,t){this.trigger("floater_escape_overlap",e,t)}autoplayPTT(e){this.trigger("sequential_playback_ptt",e)}refreshMessages(){this.trigger("refresh_messages")}readyForMainStreamModeLegacy(){this.trigger("main_stream_mode_ready_legacy")}storageInitializationError(){this.trigger("storage_initialization_error")}refreshQR(){this.trigger("md_refresh_qr")}setSocketState(e){this.trigger("set_socket_state",e)}socketStreamDisconnected(){this.trigger("socket_stream_disconnected")}openSocketStream(){this.trigger("open_socket_stream")}openLongLinkModal(){this.trigger("open_long_link_modal")}closeLongLinkModal(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.trigger("close_long_link_modal",e)}openLockScreenModal(){this.trigger("open_lock_screen_modal")}correctPasscodeLockScreen(){this.trigger("correct_passcode_lock_screen")}incorrectPasscodeLockScreen(){this.trigger("incorrect_passcode_lock_screen")}offlineDeliveryEnd(){this.isOfflineDeliveryEnd=!0,this.trigger("offline_delivery_end")}readyForProcessOffline(){this.trigger("offline_process_ready")}readyForMainStreamMode(){this.isMainStreamReadyMd=!0,this.trigger("main_stream_mode_ready")}onInitialChatHistorySynced(){this.trigger("on_initial_chat_synced")}onRecentChatHistorySynced(){this.trigger("on_recent_chat_history_synced")}onFullChatHistorySynced(){this.trigger("on_full_chat_history_synced")}onHistorySyncChunkProcessed(e){this.trigger("new_history_sync_chunk_processed",e)}handleOfflineProgressUpdate(){this.trigger("offline_progress_update")}criticalSyncDone(){this.trigger("on_critical_sync_done")}onTemporaryBan(e){this.trigger("account_temporarily_banned",e)}onStartingLogout(){this.trigger("starting_logout")}handleFatalError(){this.trigger("handle_fatal_error")}merchantDetailsDrawer(e){this.trigger("merchant_details_drawer",e)}showMerchantDetailsEntityTypePopup(e,t){this.trigger("show_merchant_details_entity_type_popup",e,t)}showCountrySelector(e,t,n,r){this.trigger("show_country_selector_popup",e,t,n,r)}toggleStickerMaker(){this.trigger("toggle_sticker_maker")}onAccountSyncForPrivacy(e){this.trigger("account_sync_for_privacy",e)}openStickerPack(e){this.trigger("open_sticker_pack",e)}onStatusViewerOpen(){this.trigger("status_viewer_open")}triggerStorageAlert(){}onAbPropsUpdate(e){this.trigger("on_ab_props_update",e)}abPropsLoaded(){this.trigger("ab_props_loaded")}onNotificationPermissionChange(){this.trigger("on_notification_permission_change")}}t.CmdImpl=h;const g=new h;t.Cmd=g},474296:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.compatPrefix=function(e,t){let n;const s=(0,r.getModernizr)();if(0===e.indexOf(i)){n=e.substring(i.length);return o(s?s.prefixed(i):i,i,n)}if(0===e.indexOf(a)){n=e.substring(a.length);return o(s?s.prefixed(a):a,a,n)}return s.prefixed(e,t,!1)||e};var r=n(223713);const i="animation",a="transition";function o(e,t,n){const r=e.toLowerCase().indexOf(t),i=e.slice(0,r).toLowerCase();return 0===e.indexOf(t)?i+e.slice(r)+n.toLowerCase():i+e.slice(r)+n}},719838:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=document.createElement("textarea");t.value=e,document.body&&document.body.appendChild(t);t.focus(),t.select(),document.execCommand("copy"),document.body&&document.body.removeChild(t)}},39928:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createBugnubTaskUrl=function(e){var t;const n=null===(t=(0,o.getMaybeMeUser)())||void 0===t?void 0:t.user;let s=null;switch(r.Conn.platform){case i.PLATFORMS.ANDROID:s="Android";break;case i.PLATFORMS.IPHONE:s="iPhone";break;case i.PLATFORMS.SMBA:s="SMB - Android";break;case i.PLATFORMS.SMBI:s="SMB - iPhone";break;default:s="Choose an option"}let l="";switch(a.UA.browser){case a.BROWSER_TYPE.CHROME:l="Chrome";break;case a.BROWSER_TYPE.SAFARI:l="Safari";break;case a.BROWSER_TYPE.FIREFOX:l="Firefox";break;case a.BROWSER_TYPE.EDGE:l="Microsoft Edge";break;case a.BROWSER_TYPE.OPERA:l="Opera"}let u="Web (Browser)";const c=["Description:\n","Link to crash logs",`https://www.internalfb.com/intern/bunny/?q=waflb+${n}`,`time of log: ${(new Date).toString()}\n`,`Primary Platform: ${s}`];""!==l&&c.push(`Browser: ${l}`);null!=e&&c.push("Error string:",`${e}`);const d={what:"Messaging",platform:u,web_platform:u,version:"2.2246.10",bug:c.join("\n"),logs:"I understand and give consent",number:null!=n?n:""};return`https://www.internalfb.com/butterfly/form/777724432837431?default_responses=${encodeURIComponent(JSON.stringify(d))}`};var r=n(266888),i=n(828770),a=n(368170),o=n(459857)},113704:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.cx=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return(0,i.default)(e,...n)};var i=r(n(294184))},356097:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DISPLAY_TYPE=void 0;t.DISPLAY_TYPE={CONVERSATION:"CONVERSATION",MSG_INFO:"MSG_INFO",STARRED_MSGS:"STARRED_MSGS",KEPT_MSGS:"KEPT_MSGS",GALLERY:"GALLERY",GALLERY_LINKS:"GALLERY_LINKS",REPLY_STAGE:"REPLY_STAGE",QUOTED_MSG:"QUOTED_MSG",CONTACT_CARD:"CONTACT_CARD",ORDER:"ORDER",STATUS:"STATUS",EDITING:"EDITING"}},493288:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.documentFlushed=function(e){var t;const n=null!==(t=null==e?void 0:e.signal)&&void 0!==t?t:l();return new Promise(((e,t)=>{if(n.aborted)return void t(new o.AbortError);let r;function i(){n.removeEventListener("abort",l);const e=s.indexOf(a);-1!==e&&s.splice(e,1),0===s.length&&null!=r&&(r(),r=null)}function a(){i(),e()}function l(){i(),t(new o.AbortError)}s.push(a),n.addEventListener("abort",l),1===s.length&&(r=function(){let e;const t=requestAnimationFrame((()=>{e=setTimeout((()=>{u()}),0)}));return()=>{cancelAnimationFrame(t),clearTimeout(e)}}())}))},t.resolveAllForTestingOnly=void 0;var a=i(n(751463)),o=n(88237);const s=[],l=(0,a.default)((()=>(new r).signal));function u(){for(;s.length>0;){s.shift()()}}t.resolveAllForTestingOnly=()=>(u(),Promise.resolve())},988410:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(9686));var a=new class{constructor(){this.shouldIndicateFocusTimestamp=0}shouldIndicateFocus(){this.shouldIndicateFocusTimestamp=Date.now()}maybeIndicateFocus(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.default.focusAnimation;Date.now()-this.shouldIndicateFocusTimestamp>200||this.indicateFocus(e,t)}indicateFocus(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.default.focusAnimation;e&&(e.classList.remove(t),e.offsetWidth,e.classList.add(t))}};t.default=a},335540:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(201063);let i=[],a=!1;const o=new r.ShiftTimer((function(){i=[],a=!1}));document.addEventListener("keydown",(()=>{o.forceRunNow()}),{capture:!0,passive:!0});var s={focus:function(e,t){if(e&&(!i.length||e!==i[i.length-1])){if(a=a||null!=window.event,function(e){5===i.length&&i.shift(),i.push(e)}(e),function(){if(i.length<5)return!1;const e=new Set;for(let t=0;t<i.length;t++){if(e.has(i[t]))return!0;e.add(i[t])}return!1}()&&!a)return __LOG__(4,void 0,new Error,!0)`Focus loop encountered.`,void SEND_LOGS("focus-loop");o.onOrBefore(75),e.focus(t)}}};t.default=s},914368:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SCROLL_FUDGE=t.QR_EDGE=t.LAYOUT_2COLUMNS_MAX_WIDTH=void 0;t.SCROLL_FUDGE=100;t.LAYOUT_2COLUMNS_MAX_WIDTH=1024;t.QR_EDGE=264},806279:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UIBusyTasks=t.IdleEnum=t.IdleCallbackTasks=void 0;var r=n(201063),i=n(881839);const a=n(76672).Mirrored(["IDLE_CALLBACK","UI_BUSY"]);t.IdleEnum=a;class o{constructor(e){this.busyMap=new Map,this.busyId=0,this._clearBusyMap=()=>{this.busyMap.clear()},this._taskMap=new Map,this.taskId=0,this.runIdleLoop=()=>{this.idleType===a.IDLE_CALLBACK?this.idleCallbackId=(0,i.requestIdleCallback)(this._ricOnIdle):this.isIdle()&&this._uiBusyOnIdle()},this._ricOnIdle=e=>{let t;const n=this._taskMap.entries();for(;(t=n.next())&&!t.done;){const[n,r]=t.value;if(r(),this._taskMap.delete(n),e.timeRemaining()<=0)break}this._taskMap.size>0&&this.runIdleLoop()},this.idleType=e}setBusy(e){let t=e;return null!=t&&this.busyMap.has(t)?this.busyMap.set(t,this.busyMap.get(t)+1):(t=++this.busyId,this.busyMap.set(t,1)),this.busyTimer||(this.busyTimer=new r.ShiftTimer(this._clearBusyMap)),this.busyTimer.debounce(1e3),t}decBusy(e){if(null==e)return;const t=this.busyMap.get(e);null!=t&&0!==t&&(1===t?this.clearBusy(e):this.busyMap.set(e,t-1))}clearBusy(e){null!=this.busyMap.get(e)&&this.busyMap.delete(e),this.isIdle()&&(this.busyTimer.cancel(),this._taskMap.size>0&&window.setTimeout(this.runIdleLoop,0))}isIdle(){return 0===this.busyMap.size}isBusy(){return this.busyMap.size>0}cancelIdleLoop(){this.idleType===a.IDLE_CALLBACK&&null!=this.idleCallbackId&&(0,i.cancelIdleCallback)(this.idleCallbackId)}_uiBusyOnIdle(){let e;const t=this._taskMap.entries();for(;(e=t.next())&&!e.done;){const[t,n]=e.value;if(n(),this._taskMap.delete(t),this.isBusy())break}}enqueue(e){return this._taskMap.set(++this.taskId,e),1===this._taskMap.size&&this.runIdleLoop(),this.taskId}dequeue(e){const t=this._taskMap.delete(e);return t&&0===this._taskMap.size&&this.cancelIdleLoop(),t}isInQueue(e){return this._taskMap.has(e)}}const s=new o(a.UI_BUSY);t.UIBusyTasks=s;const l=new o(a.IDLE_CALLBACK);t.IdleCallbackTasks=l},615459:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.openBugReportForm=function(e){r.upload({reason:"Manual MD task creation",immediate:!0,isHighPri:!0}),window.open((0,i.createBugnubTaskUrl)(e))};var r=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}r.default=e,n&&n.set(e,r);return r}(n(996588)),i=n(39928);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}},72732:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getIsTabActive=function(){return s},t.isAnotherTabActive=function(){return l.apply(this,arguments)},t.setTabActive=function(){s=!0};var i=r(n(348926)),a=r(n(537152)),o=r(n(647349));let s=!1;function l(){return(l=(0,i.default)((function*(){const e=navigator.serviceWorker;if(null==e?void 0:e.controller)try{return(yield a.default.request(e.controller,o.default.ACTIVE_TAB)).some((e=>!0===e.isActive))}catch(e){return __LOG__(4,void 0,new Error,!0)`error: ${e}`,SEND_LOGS("ACTIVE_TAB service worker call failed"),!1}return!1}))).apply(this,arguments)}},572946:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.isWeb=t.isOSWin=t.isOSRTL=t.isOSMac=t.isOSLTR=t.isNative=t.hasSafariFix=t.hasFontFix=t.hasFirefoxFix=t.hasEdgeFix=void 0;var i=r(n(932325)),a=n(368170);null!=window.Native&&i.default.isRTL(window.Native.appGetLocale());t.isNative=!1;t.isWeb=!0;const o=a.UA.isSafari;t.hasSafariFix=o;const s=a.UA.isTrident;t.hasEdgeFix=s;const l=a.UA.isGecko;t.hasFirefoxFix=l;const u=a.UA.browser===a.BROWSER_TYPE.CHROME||a.UA.browser===a.BROWSER_TYPE.OPERA;t.hasFontFix=u;t.isOSLTR=!1;t.isOSRTL=!1;const c=a.UA.os===a.OS_TYPE.MAC;t.isOSMac=c;const d=a.UA.os===a.OS_TYPE.WINDOWS;t.isOSWin=d},667738:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ThemeContext=t.THEME_ASSETS=void 0,t.applyThemeToUI=u,t.getTheme=function(){var e;if((0,a.getSystemThemeMode)())return i.default.getCurrentTheme();return null!==(e=(0,a.getTheme)())&&void 0!==e?e:"light"},t.setTheme=l,t.useTheme=t.useIsDarkTheme=void 0;var i=r(n(614495)),a=n(757453),o=n(667294);const s={light:[{id:"bg-chat-light",selectors:["[data-asset-chat-background-light]"],low:{default:n(217498)},high:{default:n(217498)}},{id:"bg-chat-dark",selectors:["[data-asset-chat-background-dark]"],low:{default:n(754057)},high:{default:n(754057)}}],dark:[{id:"bg-chat-dark",selectors:["[data-asset-chat-background-dark]"],low:{default:n(754057)},high:{default:n(754057)}}]};function l(e){(0,a.setTheme)(e),u(e)}function u(e){const t=document.body;null==t||t.classList.toggle("dark","dark"===e)}t.THEME_ASSETS=s;const c={theme:i.default.getCurrentTheme(),systemThemeMode:!0,setTheme:l,setSystemThemeMode:a.setSystemThemeMode},d=(0,o.createContext)(c);t.ThemeContext=d;const p=()=>(0,o.useContext)(d);t.useTheme=p;t.useIsDarkTheme=()=>"dark"===p().theme},959206:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Transitions=void 0,t.registerEffects=function(){i.default.RegisterEffect("attach.Up",{defaultDuration:300,calls:[[{opacity:[1,0],translateY:["0%","150%"],scaleX:[1,.3],scaleY:[1,.3]},1,{easing:[300,22]}]]}),i.default.RegisterEffect("attach.Down",{defaultDuration:200,easing:o,calls:[[{opacity:[0,1],translateY:["100%","0%"],scaleX:[.3,1],scaleY:[.3,1]},1,{easing:[.33,0,.39,.91]}]]}),i.default.RegisterEffect("dropdown.Down",{defaultDuration:200,easing:a,calls:[[{opacity:[1,0],translateY:["0%","-15px"]},1,{easing:a}]]})};var i=r(n(512641));const a=[.1,.82,.25,1],o=[.69,0,.79,.14],s=[.84,.07,.93,.46];const l=Object.freeze({pop:{duration:200,easing:s,enter:{props:{scaleX:[1,.5],scaleY:[1,.5],opacity:[1,0]}},leave:{props:{scaleX:[.5,1],scaleY:[.5,1],opacity:[0,1]}}},slide:{duration:200,easing:a,enter:{props:"slideDown"},leave:{props:"slideUp"}},scaleY:{duration:200,easing:a,enter:{props:{scaleY:[1,0],transformOrigin:"center"}},leave:{props:{scaleY:[0,1],transformOrigin:"center"}}},scale:{duration:500,easing:a,enter:{props:{scaleX:[1,0],scaleY:[1,0]}},leave:{props:{scaleX:[0,1],scaleY:[0,1]}}},fade:{duration:200,easing:a,enter:{props:{opacity:[1,0]}},leave:{props:{opacity:[0,1]}}},messageComposer:{duration:300,easing:"easeInOut",enter:{props:{opacity:[1,0],translateX:[0,-100]}},leave:{props:{opacity:[0,1],translateX:[-100,0]}}},pttComposer:{duration:300,easing:"easeInOut",enter:{props:{opacity:[1,0]}},leave:{props:{opacity:[0,1]}}},"fade-fast":{easing:"ease",enter:{props:{opacity:[1,0]},duration:150},leave:{props:{opacity:[0,1]},duration:100}},"ptt-out-of-chat":{enter:{props:{translateY:["-100%","0%"],opacity:[1,0]},duration:250,delay:150,easing:"ease"},leave:{props:{translateY:["0%","-100%"],opacity:[0,1]},duration:250,delay:150,easing:"ease"}},fade_sifo:{enter:{props:{opacity:[1,0]},duration:250},leave:{props:{opacity:[0,1]},duration:100}},capture:{enter:{props:{opacity:[1,0]},duration:350},leave:[{selector:"[data-animate-capture-snapshot]",props:"transition.bounceDownOut",duration:700},{selector:"[data-animate-capture-webcam]",props:{opacity:[0,1]},duration:100,easing:"ease"}]},butterbar:{enter:{props:"slideDown",easing:a,duration:700},leave:{props:"slideUp",easing:o,duration:350}},modal:{enter:[{selector:"[data-animate-modal-backdrop]",props:{opacity:[1,0]},duration:300,easing:[.19,.73,.28,1]},{selector:"[data-animate-modal-popup]",props:{scaleX:[1,0],scaleY:[1,0],opacity:[1,0]},easing:[.19,.73,.28,1],delay:180,duration:200},{selector:"[data-animate-modal-popup]",props:{opacity:[0,0]},duration:180}],leave:[{selector:"[data-animate-modal-backdrop]",props:{opacity:[0,1]},duration:300,easing:o,delay:100},{selector:"[data-animate-modal-popup]",props:{scaleX:[0,1],scaleY:[0,1]},easing:o,duration:200}]},"modal-flow":{enter:[{selector:"[data-animate-modal-backdrop]",props:{opacity:[1,0]},duration:300,easing:[.19,.73,.28,1]},{selector:"[data-animate-modal-popup]",props:{scaleX:[1,0],scaleY:[1,0],opacity:[1,1]},easing:[.19,.73,.28,1],delay:180,duration:200},{selector:"[data-animate-modal-popup]",props:{opacity:[0,0]},duration:180}],leave:[{selector:"[data-animate-modal-backdrop]",props:{opacity:[0,1]},duration:300,easing:o,delay:100},{selector:"[data-animate-modal-popup]",props:{scaleX:[0,1],scaleY:[0,1]},easing:o,duration:200}]},"flow-transition-modal-push":{duration:300,easing:a,enter:{props:{opacity:[1,0]}},leave:{props:{opacity:[0,1]}}},"flow-transition-modal-pop":{duration:300,easing:a,enter:{props:{opacity:[1,0]}},leave:{props:{opacity:[0,1]}}},"flow-transition-box-size-drawer-push":{duration:300,easing:a,enter:[{selector:"[data-animate-modal-body]",props:{translateX:["0%","100%"]}}],leave:[{props:{background:["transparent","transparent"]}},{selector:"[data-animate-modal-popup]",props:{background:["transparent","transparent"],boxShadow:["none","none"]}},{selector:"[data-animate-modal-body]",props:{translateX:["-100%","0%"]}}]},"flow-transition-box-size-drawer-pop":{duration:300,easing:a,enter:[{selector:"[data-animate-modal-body]",props:{translateX:["0%","-100%"]}}],leave:[{props:{background:["transparent","transparent"]}},{selector:"[data-animate-modal-popup]",props:{background:["transparent","transparent"],boxShadow:["none","none"]}},{selector:"[data-animate-modal-body]",props:{translateX:["100%","0%"]}}]},"flow-transition-drawer-push":{duration:300,easing:a,enter:{props:{translateX:["0%","100%"]}},leave:{props:{translateX:["-100%","0%"]}}},"flow-transition-drawer-pop":{duration:300,easing:a,enter:{props:{translateX:["0%","-100%"]}},leave:{props:{translateX:["100%","0%"]}}},"drawer-left":{enter:[{props:{translateX:["0%","-100%"]},duration:300,easing:a},{selector:"[data-animate-drawer-title]",props:{translateX:[0,-50],opacity:[1,0]},duration:500,easing:"easeOut"}],leave:[{props:{translateX:["-100%","0%"]},duration:300,easing:o}]},"drawer-left-rtl":{enter:[{props:{translateX:["0%","100%"]},duration:300,easing:a},{selector:"[data-animate-drawer-title]",props:{translateX:[0,50],opacity:[1,0]},duration:500,easing:"easeOut"}],leave:[{props:{translateX:["100%","0%"]},duration:300,easing:o}]},dropdown:{duration:300,easing:a,enter:[{selector:"[data-animate-dropdown-item]",props:"dropdown.Down",delay:50,duration:375,stagger:25,drag:!0},{props:{scale:[1,0]}},{props:{opacity:[1,0]},duration:100}],leave:{props:{scaleX:[0,1],scaleY:[0,1],opacity:[0,1]}}},"dropdown-picker":{duration:300,easing:a,enter:[{selector:"[data-animate-dropdown-item]",props:{opacity:[1,0]},delay:50,duration:200},{selector:"[data-animate-dropdown-nib]",props:{opacity:[1,0],rotateZ:["45deg"],translateY:["0%","-100%"]}},{props:{scale:[1,0]}},{props:{opacity:[1,0]},duration:100}],leave:[{selector:"[data-animate-dropdown-item]",props:{opacity:[1,0]},duration:100},{selector:"[data-animate-dropdown-nib]",props:{opacity:[1,0]},duration:150},{props:{scaleX:[0,1],scaleY:[0,1],opacity:[0,1]}}]},"profile-viewer":{duration:500,easing:[.1,1.03,.28,.99],leave:[{delay:400,props:{opacity:[0,1]}},{selector:"[data-animate-profile-viewer]",props:{borderRadius:["50%","0%"]}}]},"media-viewer":{duration:300,easing:[.1,1.03,.28,.99],leave:{selector:"[data-animate-media-viewer]",props:{opacity:[0,1]}}},"status-v3-quoted-msg":{enter:{props:{translateY:["0%","100%"],opacity:[1,0]},duration:200,easing:a},leave:{props:{translateY:["100%","0%"],opacity:[0,1]},duration:200,easing:o}},"status-v3-quick-reply":{enter:{props:{opacity:[1,0]},duration:300,easing:a},leave:{props:{opacity:[0,1]},duration:200,easing:o}},"status-v3-panel":{enter:{props:{translateY:["0%","100%"],opacity:[1,0]},duration:300,easing:a},leave:{props:{translateY:["100%","0%"],opacity:[0,1]},duration:200,easing:o}},"status-v3-modal":{easing:[.55,.085,.68,.53],enter:{duration:100,selector:"[data-animate-status-v3-modal-background]",props:{opacity:[1,0]}},leave:{duration:100,selector:"[data-animate-status-v3-modal-background]",props:{opacity:[0,1]}}},"quoted-status-v3-modal":{easing:[.55,.085,.68,.53],enter:{duration:100,selector:"[data-animate-status-v3-viewer]",props:{opacity:[1,0]}},leave:{duration:100,selector:"[data-animate-status-v3-viewer]",props:{opacity:[0,1]}}},"status-v3-player":{easing:[.55,.085,.68,.53],enter:{duration:200,props:{opacity:[1,0]}},leave:{duration:200,props:{opacity:[0,1]}}},"status-v3-media-loading":{duration:300,easing:o,leave:{props:{opacity:[0,1]}}},menu:{enter:{selector:"[data-animate-menu-icons-item]",props:"attach.Up",duration:700,stagger:30,drag:!1},leave:{selector:"[data-animate-menu-icons-item]",props:"attach.Down",duration:200,stagger:30}},emoji:{duration:300,easing:a,enter:{props:{height:[291,0]}},leave:{props:{height:[0,291]}}},ptt:{enter:[{selector:"[data-animate-btn-border]",easing:"easeInOut",props:{scaleX:[1,.5],scaleY:[1,.5],opacity:[1,0]},duration:250,delay:100},{selector:"[data-animate-ptt-counter]",easing:"easeInOut",props:{scaleX:[1,.8],scaleY:[1,.8],opacity:[1,0]},duration:250,delay:100},{props:{opacity:[1,0]},duration:150,easing:a}],leave:[{selector:"[data-animate-btn-border]",easing:a,props:{scaleX:[.5,1],scaleY:[.5,1],opacity:[0,1]},duration:250},{selector:"[data-animate-ptt-counter]",easing:a,props:{scaleX:[.5,1],scaleY:[.5,1],opacity:[0,1]},duration:250},{props:{opacity:[0,1]},duration:300,easing:a}]},"slide-left":{duration:300,easing:a,enter:{props:{translateX:["0%","100%"]}},leave:{props:{translateX:["100%","0%"]}}},"slide-left-rtl":{duration:300,easing:a,enter:{props:{translateX:["0%","-100%"]}},leave:{props:{translateX:["-100%","0%"]}}},"slide-forward":{duration:200,easing:[.19,.93,.18,.99],enter:{props:{translateX:["0%","100%"]}},leave:{props:{translateX:["-100%","0%"]}}},"slide-back":{duration:200,easing:[.19,.93,.18,.99],enter:{props:{translateX:["0%","-100%"]}},leave:{props:{translateX:["100%","0%"]}}},"media-slide-forward":{duration:200,easing:[.19,.93,.18,.99],enter:[{selector:"[data-animate-attach-media]",props:{opacity:[1,0],translateX:["0%","30%"]}},{selector:"[data-animate-media-caption]",props:{opacity:[1,0]}}],leave:[{selector:"[data-animate-attach-media]",props:{opacity:[0,1],translateX:["-30%","0%"]}},{selector:"[data-animate-media-caption]",props:{opacity:[0,1]}}]},"media-slide-back":{duration:200,easing:[.19,.93,.18,.99],enter:[{selector:"[data-animate-attach-media]",props:{opacity:[1,0],translateX:["0%","-30%"]}},{selector:"[data-animate-media-caption]",props:{opacity:[1,0]}}],leave:[{selector:"[data-animate-attach-media]",props:{opacity:[0,1],translateX:["30%","0%"]}},{selector:"[data-animate-media-caption]",props:{opacity:[0,1]}}]},"slide-down-date":{duration:300,enter:{props:{translateY:["0%","-130%"],opacity:[1,0]},easing:a},leave:{props:{translateY:["-130%","0%"],opacity:[0,1]},easing:o}},"slide-down-test":{duration:300,easing:a,enter:{props:{height:["auto","0"],opacity:[1,0]}},leave:{props:{translateY:["-130%","0%"],opacity:[0,1]}}},"pop-fast-reverse":{duration:75,easing:[.14,.62,.33,.9],enter:[{selector:"[data-js-context-icon]",props:{translateX:["0%","-100%"]}},{props:{opacity:[1,.5]}}],leave:[{selector:"[data-js-context-icon]",props:{translateX:["-100%","0%"]}},{props:{opacity:[0,1]}}]},"pop-fast":{duration:75,easing:[.14,.62,.33,.9],enter:[{selector:"[data-js-context-icon]",props:{translateX:["0%","100%"]}},{props:{opacity:[1,.5]}}],leave:[{selector:"[data-js-context-icon]",props:{translateX:["100%","0%"]}},{props:{opacity:[0,1]}}]},"pop-fast-chat":{duration:75,easing:[.14,.62,.33,.9],enter:[{props:{width:["20px","5px"],opacity:[1,.5]}}],leave:[{props:{width:["5px","20px"],opacity:[0,1]}}]},"toast-transition":{duration:300,easing:a,cleanOnComplete:!0,enter:{props:{translateY:["0%","100%"],opacity:[1,0]}},leave:{props:{opacity:[0,1]}}},"slide-up-down":{duration:300,easing:a,enter:{props:{translateY:["0%","100%"]}},leave:{props:{translateY:["100%","0%"]}}},"slide-up-down-footer":{duration:200,easing:a,enter:[{props:{translateY:["0%","100%"]}},{selector:"[data-animate-btn]",props:{opacity:[1,0],scale:[1,0]},delay:200,duration:300}],leave:[{props:{translateY:["100%","0%"]},delay:200},{selector:"[data-animate-btn]",props:{opacity:[0,1],scale:[.6,1]},duration:200}]},"slide-up":{duration:300,easing:a,enter:{props:{translateY:["0%","100%"]}},leave:{props:{translateY:["100%","0%"]}}},"slide-up-fade-in-eta":{duration:100,easing:a,enter:{props:{translateY:["0%","100%"],opacity:[1,0],height:[20,0]}},leave:{props:{translateY:["100%","0%"],opacity:[0,1],height:[0,20]}}},"slide-down":{duration:300,easing:a,enter:{props:{translateY:["0%","-100%"]}},leave:{props:{translateY:["-100%","0%"]}}},"emoji-search-slide-away":{duration:300,enter:{easing:"easeOutCubic",props:{translateY:["0%","-100%"]}},leave:{easing:"easeInCubic",props:{translateY:["-100%","0%"]}}},"emoji-search-slide-away-fast":{duration:80,enter:{easing:"easeOutCubic",props:{translateY:["0%","-100%"]}},leave:{easing:"easeInCubic",props:{translateY:["-100%","0%"]}}},"emoji-search-panel-slide-up":{duration:300,easing:a,enter:{props:{translateY:["0%","100%"],opacity:[1,0]}},leave:{props:{translateY:["100%","0%"],opacity:[0,1]}}},none:{},btn:{duration:300,easing:a,enter:{props:{scale:[1,0],opacity:[1,0]}},leave:{props:{scale:[0,1],opacity:[0,1]}}},pop_delay:{duration:300,enter:[{props:{scale:[1,0],opacity:[1,0]},delay:500,easing:a}],leave:{props:"transition.expandOut",easing:o}},"delay-leave":{duration:1,enter:{props:{opacity:[1,1]}},leave:{props:{opacity:[1,1]},delay:300}},"media-caption":{enter:[{props:{opacity:[0,0],translateY:["100%","100%"]},duration:200},{props:{opacity:[1,0],translateY:["0%","100%"]},easing:a,delay:200,duration:300}],leave:{props:{opacity:[0,1]},easing:"ease",duration:300}},"media-scale":{enter:[{selector:"[data-animate-media-caption]",props:{opacity:[0,0],translateY:["100%","100%"]},duration:200},{selector:"[data-animate-media-caption]",props:{opacity:[1,0],translateY:["0%","100%"]},easing:a,delay:200,duration:300},{selector:"[data-animate-attach-media]",props:{opacity:[0,0]},duration:200},{selector:"[data-animate-attach-media]",props:{opacity:[1,0],scale:[1,.625],display:"flex"},delay:200,duration:300,easing:a}],leave:[{selector:"[data-animate-media-caption]",props:{opacity:[0,1]},easing:"ease",duration:300},{selector:"[data-animate-attach-media]",props:{opacity:[0,1],scale:[.5,1],display:"flex"},delay:0,duration:200,easing:o}]},"thumb-scale":{duration:400,easing:a,enter:{props:"transition.expandIn"},leave:{props:"transition.expandOut"}},"thumb-scale-flex":{duration:400,easing:a,enter:{props:{scale:[1,0],display:"flex"}},leave:{duration:200,props:{scale:[0,1],display:"flex"}}},default:{duration:300,enter:{props:{opacity:[1,0]}},leave:{props:{opacity:[0,1]}}},noop:{duration:0},"noop-full-opacity":{duration:0,enter:{props:{opacity:[1,1]}},leave:{props:{opacity:[1,1]}}},pip:{enter:{props:{opacity:[1,0]},duration:400},leave:{props:{scaleX:[.5,1],scaleY:[.5,1],opacity:[0,1]},duration:200,easing:s}},voip:{enter:{props:{opacity:[1,0]},duration:400},leave:{props:{scaleX:[.5,1],scaleY:[.5,1],opacity:[0,1]},duration:200,easing:s}},"replace-fade":{enter:[{props:{opacity:[0,0]},duration:400},{props:{opacity:[1,0]},duration:400,delay:400}],leave:{props:{opacity:[0,1]},duration:400}}});t.Transitions=l},337159:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Listener=void 0,t.isEventsType=o;var i=n(474296),a=r(n(395654));function o(e){return e instanceof a.default||"function"==typeof e.on&&"function"==typeof e.off}t.Listener=class{constructor(e,t,n,r,a){this._hasEngaged=!1,this._hasDisengaged=!1,this.source=e,this.cb=n,this.opts=r,this._cbIdentifier=a,o(e)?this.event=t:this.event=(0,i.compatPrefix)(t,e)}engage(){if(this._hasEngaged||this._hasDisengaged)return;this._hasEngaged=!0;const e=this.source,t=this.event;o(e)?(e.on(t,this.cb),"function"==typeof e.incObservers&&e.incObservers()):this.opts?e.addEventListener(t,this.cb,this.opts):e.addEventListener(t,this.cb)}disengage(){if(this._hasDisengaged)return;if(this._hasDisengaged=!0,!this._hasEngaged)return;const e=this.source,t=this.event;o(e)?(e.off(this.event,this.cb),"function"==typeof e.decObservers&&e.decObservers()):this.opts?e.removeEventListener(t,this.cb,this.opts):e.removeEventListener(t,this.cb)}represents(e,t,n,r){var i;if(this.source!==e)return!1;if(this.event!==t)return!1;if(this._cbIdentifier!==n)return!1;const{capture:a=!1,once:o=!1,passive:s=!1}=null!=r?r:{},{capture:l=!1,once:u=!1,passive:c=!1}=null!==(i=this.opts)&&void 0!==i?i:{};return a===l&&o===u&&s===c}}},50010:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.uiPadding=t.uiMargin=void 0;r(n(156720));const i={horizMinus6:{marginEnd:"n3fdhnkw",marginStart:"heai6z19"},startMinus6:{marginStart:"heai6z19"},endMinus6:{marginEnd:"n3fdhnkw"},horizMinus4:{marginEnd:"isg5rw3j",marginStart:"nxn8agaf"},startMinus4:{marginStart:"nxn8agaf"},endMinus4:{marginEnd:"isg5rw3j"},topMinus3:{marginTop:"if44n927"},topMinus1:{marginTop:"o9i7y497"},all0:{marginTop:"tt8xd2xn",marginEnd:"jnwc1y2a",marginBottom:"mpdn4nr2",marginStart:"svoq16ka"},horiz0:{marginEnd:"jnwc1y2a",marginStart:"svoq16ka"},vert0:{marginTop:"tt8xd2xn",marginBottom:"mpdn4nr2"},top0:{marginTop:"tt8xd2xn"},bottom0:{marginBottom:"mpdn4nr2"},end0:{marginEnd:"jnwc1y2a"},start0:{marginStart:"svoq16ka"},top1:{marginTop:"b9l0eqez"},all2:{marginTop:"kiiy14zj",marginEnd:"om6y7gxh",marginBottom:"j4enbv94",marginStart:"gj5xqxfh"},horiz2:{marginEnd:"om6y7gxh",marginStart:"gj5xqxfh"},vert2:{marginTop:"kiiy14zj",marginBottom:"j4enbv94"},top2:{marginTop:"kiiy14zj"},bottom2:{marginBottom:"j4enbv94"},end2:{marginEnd:"om6y7gxh"},start2:{marginStart:"gj5xqxfh"},all3:{marginTop:"g1eqewly",marginEnd:"kjemk6od",marginBottom:"kzyzudjh",marginStart:"k6y3xtnu"},horiz3:{marginEnd:"kjemk6od",marginStart:"k6y3xtnu"},vert3:{marginTop:"g1eqewly",marginBottom:"kzyzudjh"},top3:{marginTop:"g1eqewly"},bottom3:{marginBottom:"kzyzudjh"},end3:{marginEnd:"kjemk6od"},start3:{marginStart:"k6y3xtnu"},all4:{marginTop:"qt60bha0",marginEnd:"mw4yctpw",marginBottom:"inww9tbj",marginStart:"qnz2jpws"},horiz4:{marginEnd:"mw4yctpw",marginStart:"qnz2jpws"},vert4:{marginTop:"qt60bha0",marginBottom:"inww9tbj"},top4:{marginTop:"qt60bha0"},bottom4:{marginBottom:"inww9tbj"},end4:{marginEnd:"mw4yctpw"},start4:{marginStart:"qnz2jpws"},all5:{marginTop:"hymafltn",marginEnd:"q471nw87",marginBottom:"g105fvfm",marginStart:"p3lsiedt"},horiz5:{marginEnd:"q471nw87",marginStart:"p3lsiedt"},vert5:{marginTop:"hymafltn",marginBottom:"g105fvfm"},top5:{marginTop:"hymafltn"},bottom5:{marginBottom:"g105fvfm"},end5:{marginEnd:"q471nw87"},start5:{marginStart:"p3lsiedt"},all6:{marginTop:"iin4x6c7",marginEnd:"claouzo6",marginBottom:"ngycyvoj",marginStart:"oz0g9ue8"},horiz6:{marginEnd:"claouzo6",marginStart:"oz0g9ue8"},vert6:{marginTop:"iin4x6c7",marginBottom:"ngycyvoj"},top6:{marginTop:"iin4x6c7"},bottom6:{marginBottom:"ngycyvoj"},end6:{marginEnd:"claouzo6"},start6:{marginStart:"oz0g9ue8"},all8:{marginTop:"dj1c3cmq",marginEnd:"bugiwsl0",marginBottom:"or9x5nie",marginStart:"fooq7fky"},horiz8:{marginEnd:"bugiwsl0",marginStart:"fooq7fky"},vert8:{marginTop:"dj1c3cmq",marginBottom:"or9x5nie"},top8:{marginTop:"dj1c3cmq"},bottom8:{marginBottom:"or9x5nie"},end8:{marginEnd:"bugiwsl0"},start8:{marginStart:"fooq7fky"},all10:{marginTop:"opp68qpq",marginEnd:"spjzgwxb",marginBottom:"brac1wpa",marginStart:"a3oefunm"},horiz10:{marginEnd:"spjzgwxb",marginStart:"a3oefunm"},vert10:{marginTop:"opp68qpq",marginBottom:"brac1wpa"},top10:{marginTop:"opp68qpq"},bottom10:{marginBottom:"brac1wpa"},end10:{marginEnd:"spjzgwxb"},start10:{marginStart:"a3oefunm"},all12:{marginTop:"iy2cu22y",marginEnd:"oz083wsx",marginBottom:"t4zgqcuo",marginStart:"g9zvcdbd"},horiz12:{marginEnd:"oz083wsx",marginStart:"g9zvcdbd"},vert12:{marginTop:"iy2cu22y",marginBottom:"t4zgqcuo"},top12:{marginTop:"iy2cu22y"},bottom12:{marginBottom:"t4zgqcuo"},end12:{marginEnd:"oz083wsx"},start12:{marginStart:"g9zvcdbd"},bottom14:{marginBottom:"k0lnf8n4"},all15:{marginTop:"eg3lofc5",marginEnd:"ds60debm",marginBottom:"pz0xruzv",marginStart:"htq1q0kf"},horiz15:{marginEnd:"ds60debm",marginStart:"htq1q0kf"},vert15:{marginTop:"eg3lofc5",marginBottom:"pz0xruzv"},top15:{marginTop:"eg3lofc5"},bottom15:{marginBottom:"pz0xruzv"},end15:{marginEnd:"ds60debm"},start15:{marginStart:"htq1q0kf"},top16:{marginTop:"fgtikrv0"},bottom16:{marginBottom:"dblt22a0"},all20:{marginTop:"c46o30wg",marginEnd:"rvlagp7p",marginBottom:"du8bjn1j",marginStart:"bv1sdm6y"},horiz20:{marginEnd:"rvlagp7p",marginStart:"bv1sdm6y"},vert20:{marginTop:"c46o30wg",marginBottom:"du8bjn1j"},top20:{marginTop:"c46o30wg"},bottom20:{marginBottom:"du8bjn1j"},end20:{marginEnd:"rvlagp7p"},start20:{marginStart:"bv1sdm6y"},bottom24:{marginBottom:"iyjcf3gk"},vert28:{marginTop:"ignnouf6",marginBottom:"bibl1e27"},top28:{marginTop:"ignnouf6"},bottom28:{marginBottom:"bibl1e27"},all30:{marginTop:"nylzjxre",marginEnd:"lfum0007",marginBottom:"bvhm1occ",marginStart:"r6x3u63k"},horiz30:{marginEnd:"lfum0007",marginStart:"r6x3u63k"},vert30:{marginTop:"nylzjxre",marginBottom:"bvhm1occ"},top30:{marginTop:"nylzjxre"},bottom30:{marginBottom:"bvhm1occ"},end30:{marginEnd:"lfum0007"},start30:{marginStart:"r6x3u63k"},end32:{marginEnd:"bcfko8ch"}},a={horizMinus6:i.horizMinus6,startMinus6:i.startMinus6,endMinus6:i.endMinus6,horizMinus4:i.horizMinus4,startMinus4:i.startMinus4,endMinus4:i.endMinus4,topMinus3:i.topMinus3,topMinus1:i.topMinus1,all0:i.all0,horiz0:i.horiz0,vert0:i.vert0,top0:i.top0,bottom0:i.bottom0,end0:i.end0,start0:i.start0,top1:i.top1,all2:i.all2,horiz2:i.horiz2,vert2:i.vert2,top2:i.top2,bottom2:i.bottom2,end2:i.end2,start2:i.start2,all3:i.all3,horiz3:i.horiz3,vert3:i.vert3,top3:i.top3,bottom3:i.bottom3,end3:i.end3,start3:i.start3,all4:i.all4,horiz4:i.horiz4,vert4:i.vert4,top4:i.top4,bottom4:i.bottom4,end4:i.end4,start4:i.start4,all5:i.all5,horiz5:i.horiz5,vert5:i.vert5,top5:i.top5,bottom5:i.bottom5,end5:i.end5,start5:i.start5,all6:i.all6,horiz6:i.horiz6,vert6:i.vert6,top6:i.top6,bottom6:i.bottom6,end6:i.end6,start6:i.start6,all8:i.all8,horiz8:i.horiz8,vert8:i.vert8,top8:i.top8,bottom8:i.bottom8,end8:i.end8,start8:i.start8,all10:i.all10,horiz10:i.horiz10,vert10:i.vert10,top10:i.top10,bottom10:i.bottom10,end10:i.end10,start10:i.start10,all12:i.all12,horiz12:i.horiz12,vert12:i.vert12,top12:i.top12,bottom12:i.bottom12,end12:i.end12,start12:i.start12,bottom14:i.bottom14,all15:i.all15,horiz15:i.horiz15,vert15:i.vert15,top15:i.top15,bottom15:i.bottom15,end15:i.end15,start15:i.start15,bottom16:i.bottom16,top16:i.top16,all20:i.all20,horiz20:i.horiz20,vert20:i.vert20,top20:i.top20,bottom20:i.bottom20,end20:i.end20,start20:i.start20,bottom24:i.bottom24,vert28:i.vert28,top28:i.top28,bottom28:i.bottom28,all30:i.all30,horiz30:i.horiz30,vert30:i.vert30,top30:i.top30,bottom30:i.bottom30,end30:i.end30,start30:i.start30,end32:i.end32};t.uiMargin=a;const o={all0:{paddingTop:"i5tg98hk",paddingEnd:"f9ovudaz",paddingBottom:"przvwfww",paddingStart:"gx1rr48f"},horiz0:{paddingEnd:"f9ovudaz",paddingStart:"gx1rr48f"},vert0:{paddingTop:"i5tg98hk",paddingBottom:"przvwfww"},top0:{paddingTop:"i5tg98hk"},bottom0:{paddingBottom:"przvwfww"},end0:{paddingEnd:"f9ovudaz"},start0:{paddingStart:"gx1rr48f"},top1:{paddingTop:"qbqilfqo"},all2:{paddingTop:"ppypbuwx",paddingEnd:"fhfm09ip",paddingBottom:"s8gyl5p1",paddingStart:"mjn2akup"},horiz2:{paddingEnd:"fhfm09ip",paddingStart:"mjn2akup"},vert2:{paddingTop:"ppypbuwx",paddingBottom:"s8gyl5p1"},top2:{paddingTop:"ppypbuwx"},bottom2:{paddingBottom:"s8gyl5p1"},end2:{paddingEnd:"fhfm09ip"},start2:{paddingStart:"mjn2akup"},all3:{paddingTop:"ocd2b0bc",paddingEnd:"folpon7g",paddingBottom:"aa0kojfi",paddingStart:"snweb893"},horiz3:{paddingEnd:"folpon7g",paddingStart:"snweb893"},vert3:{paddingTop:"ocd2b0bc",paddingBottom:"aa0kojfi"},top3:{paddingTop:"ocd2b0bc"},bottom3:{paddingBottom:"aa0kojfi"},end3:{paddingEnd:"folpon7g"},start3:{paddingStart:"snweb893"},all4:{paddingTop:"eujn52yf",paddingEnd:"jfqm35v0",paddingBottom:"ckm995li",paddingStart:"bdbt56hn"},horiz4:{paddingEnd:"jfqm35v0",paddingStart:"bdbt56hn"},vert4:{paddingTop:"eujn52yf",paddingBottom:"ckm995li"},top4:{paddingTop:"eujn52yf"},bottom4:{paddingBottom:"ckm995li"},end4:{paddingEnd:"jfqm35v0"},start4:{paddingStart:"bdbt56hn"},all5:{paddingTop:"qomlamqu",paddingEnd:"lnjlmjd6",paddingBottom:"bxcbqipq",paddingStart:"mc6o24uu"},horiz5:{paddingEnd:"lnjlmjd6",paddingStart:"mc6o24uu"},vert5:{paddingTop:"qomlamqu",paddingBottom:"bxcbqipq"},top5:{paddingTop:"qomlamqu"},bottom5:{paddingBottom:"bxcbqipq"},end5:{paddingEnd:"lnjlmjd6"},start5:{paddingStart:"mc6o24uu"},all6:{paddingTop:"n1yiu2zv",paddingEnd:"abxuf49s",paddingBottom:"eb4rp10x",paddingStart:"mhcwslh8"},horiz6:{paddingEnd:"abxuf49s",paddingStart:"mhcwslh8"},vert6:{paddingTop:"n1yiu2zv",paddingBottom:"eb4rp10x"},top6:{paddingTop:"n1yiu2zv"},bottom6:{paddingBottom:"eb4rp10x"},end6:{paddingEnd:"abxuf49s"},start6:{paddingStart:"mhcwslh8"},top7:{paddingTop:"esbfogcw"},all8:{paddingTop:"fbgy3m38",paddingEnd:"ft2m32mm",paddingBottom:"oq31bsqd",paddingStart:"nu34rnf1"},horiz8:{paddingEnd:"ft2m32mm",paddingStart:"nu34rnf1"},vert8:{paddingTop:"fbgy3m38",paddingBottom:"oq31bsqd"},top8:{paddingTop:"fbgy3m38"},bottom8:{paddingBottom:"oq31bsqd"},end8:{paddingEnd:"ft2m32mm"},start8:{paddingStart:"nu34rnf1"},all9:{paddingTop:"qlb265nb",paddingEnd:"i8go5xc4",paddingBottom:"n0ziumnz",paddingStart:"e1yunedv"},horiz9:{paddingEnd:"i8go5xc4",paddingStart:"e1yunedv"},vert9:{paddingTop:"qlb265nb",paddingBottom:"n0ziumnz"},top9:{paddingTop:"qlb265nb"},bottom9:{paddingBottom:"n0ziumnz"},end9:{paddingEnd:"i8go5xc4"},start9:{paddingStart:"e1yunedv"},all10:{paddingTop:"emrlamx0",paddingEnd:"itegkywt",paddingBottom:"aiput80m",paddingStart:"rppts313"},horiz10:{paddingEnd:"itegkywt",paddingStart:"rppts313"},vert10:{paddingTop:"emrlamx0",paddingBottom:"aiput80m"},top10:{paddingTop:"emrlamx0"},bottom10:{paddingBottom:"aiput80m"},end10:{paddingEnd:"itegkywt"},start10:{paddingStart:"rppts313"},all12:{paddingTop:"b7n2qyd4",paddingEnd:"btzf6ewn",paddingBottom:"ekpn4oxx",paddingStart:"nqtxkp62"},horiz12:{paddingEnd:"btzf6ewn",paddingStart:"nqtxkp62"},vert12:{paddingTop:"b7n2qyd4",paddingBottom:"ekpn4oxx"},top12:{paddingTop:"b7n2qyd4"},bottom12:{paddingBottom:"ekpn4oxx"},end12:{paddingEnd:"btzf6ewn"},start12:{paddingStart:"nqtxkp62"},horiz13:{paddingEnd:"pbp0z3j0",paddingStart:"rn41jex5"},start13:{paddingStart:"rn41jex5"},end13:{paddingEnd:"pbp0z3j0"},bottom14:{paddingBottom:"p9a4hubg"},all15:{paddingTop:"pxvlsfnc",paddingEnd:"kyc7k6mt",paddingBottom:"n3bptxsn",paddingStart:"f78eapp6"},horiz15:{paddingEnd:"kyc7k6mt",paddingStart:"f78eapp6"},vert15:{paddingTop:"pxvlsfnc",paddingBottom:"n3bptxsn"},top15:{paddingTop:"pxvlsfnc"},bottom15:{paddingBottom:"n3bptxsn"},end15:{paddingEnd:"kyc7k6mt"},start15:{paddingStart:"f78eapp6"},all16:{paddingTop:"tvsr5v2h",paddingEnd:"l9g3jx6n",paddingBottom:"jd93c9cp",paddingStart:"lyvj5e2u"},horiz16:{paddingEnd:"l9g3jx6n",paddingStart:"lyvj5e2u"},vert16:{paddingTop:"tvsr5v2h",paddingBottom:"jd93c9cp"},start16:{paddingStart:"lyvj5e2u"},end16:{paddingEnd:"l9g3jx6n"},all18:{paddingTop:"a71rq12o",paddingEnd:"tcyu26xv",paddingBottom:"pcbmd69e",paddingStart:"i8b31kl9"},horiz18:{paddingEnd:"tcyu26xv",paddingStart:"i8b31kl9"},top18:{paddingTop:"a71rq12o"},all20:{paddingTop:"nlnf8xo7",paddingEnd:"iffbo4e8",paddingBottom:"r219jyu0",paddingStart:"khscay3k"},horiz20:{paddingEnd:"iffbo4e8",paddingStart:"khscay3k"},vert20:{paddingTop:"nlnf8xo7",paddingBottom:"r219jyu0"},top20:{paddingTop:"nlnf8xo7"},bottom20:{paddingBottom:"r219jyu0"},end20:{paddingEnd:"iffbo4e8"},start20:{paddingStart:"khscay3k"},all24:{paddingTop:"a4bywxmn",paddingEnd:"h1a80dm5",paddingBottom:"lzi2pvmc",paddingStart:"sta02ykp"},horiz24:{paddingEnd:"h1a80dm5",paddingStart:"sta02ykp"},vert24:{paddingTop:"a4bywxmn",paddingBottom:"lzi2pvmc"},top24:{paddingTop:"a4bywxmn"},bottom24:{paddingBottom:"lzi2pvmc"},end24:{paddingEnd:"h1a80dm5"},start24:{paddingStart:"sta02ykp"},horiz25:{paddingEnd:"rmtqb32e",paddingStart:"hmkl5ysc"},all30:{paddingTop:"msavwer2",paddingEnd:"bcymb0na",paddingBottom:"slgfab0f",paddingStart:"e8k79tju"},horiz30:{paddingEnd:"bcymb0na",paddingStart:"e8k79tju"},vert30:{paddingTop:"msavwer2",paddingBottom:"slgfab0f"},top30:{paddingTop:"msavwer2"},bottom30:{paddingBottom:"slgfab0f"},end30:{paddingEnd:"bcymb0na"},start30:{paddingStart:"e8k79tju"},horiz36:{paddingEnd:"lk91ofgv",paddingStart:"s9xya5d7"},start36:{paddingStart:"s9xya5d7"},end36:{paddingEnd:"lk91ofgv"}},s={all0:o.all0,horiz0:o.horiz0,vert0:o.vert0,top0:o.top0,bottom0:o.bottom0,end0:o.end0,start0:o.start0,top1:o.top1,all2:o.all2,horiz2:o.horiz2,vert2:o.vert2,top2:o.top2,bottom2:o.bottom2,end2:o.end2,start2:o.start2,all3:o.all3,horiz3:o.horiz3,vert3:o.vert3,top3:o.top3,bottom3:o.bottom3,end3:o.end3,start3:o.start3,all4:o.all4,horiz4:o.horiz4,vert4:o.vert4,top4:o.top4,bottom4:o.bottom4,end4:o.end4,start4:o.start4,all5:o.all5,horiz5:o.horiz5,vert5:o.vert5,top5:o.top5,bottom5:o.bottom5,end5:o.end5,start5:o.start5,all6:o.all6,horiz6:o.horiz6,vert6:o.vert6,top6:o.top6,bottom6:o.bottom6,end6:o.end6,start6:o.start6,top7:o.top7,all8:o.all8,horiz8:o.horiz8,vert8:o.vert8,top8:o.top8,bottom8:o.bottom8,end8:o.end8,start8:o.start8,all9:o.all9,horiz9:o.horiz9,vert9:o.vert9,top9:o.top9,bottom9:o.bottom9,end9:o.end9,start9:o.start9,all10:o.all10,horiz10:o.horiz10,vert10:o.vert10,top10:o.top10,bottom10:o.bottom10,end10:o.end10,start10:o.start10,all12:o.all12,horiz12:o.horiz12,vert12:o.vert12,top12:o.top12,bottom12:o.bottom12,end12:o.end12,start12:o.start12,horiz13:o.horiz13,start13:o.start13,end13:o.end13,bottom14:o.bottom14,all15:o.all15,horiz15:o.horiz15,vert15:o.vert15,top15:o.top15,bottom15:o.bottom15,end15:o.end15,start15:o.start15,all16:o.all16,horiz16:o.horiz16,vert16:o.vert16,start16:o.start16,end16:o.end16,all18:o.all18,horiz18:o.horiz18,top18:o.top18,all20:o.all20,horiz20:o.horiz20,vert20:o.vert20,top20:o.top20,bottom20:o.bottom20,end20:o.end20,start20:o.start20,all24:o.all24,horiz24:o.horiz24,vert24:o.vert24,top24:o.top24,bottom24:o.bottom24,end24:o.end24,start24:o.start24,horiz25:o.horiz25,all30:o.all30,horiz30:o.horiz30,vert30:o.vert30,top30:o.top30,bottom30:o.bottom30,end30:o.end30,start30:o.start30,horiz36:o.horiz36,start36:o.start36,end36:o.end36};t.uiPadding=s},385385:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MainAudioChannel=void 0;var i=r(n(395654));class a extends i.default{registerMedia(e){let t=null;const n=()=>{t=this.claim(e,(()=>{e.pause()}))},r=()=>{var e;null===(e=t)||void 0===e||e()};return e.addEventListener("play",n),e.addEventListener("pause",r),()=>{var i;null===(i=t)||void 0===i||i(),e.removeEventListener("play",n),e.removeEventListener("pause",r)}}claim(e,t){const n=this._active;return null!=n&&e!==n.key&&(n.pause(),this.trigger("paused_DEPRECATED_DO_NOT_USE",n.key)),this._active={key:e,pause:t},()=>{var t;e===(null===(t=this._active)||void 0===t?void 0:t.key)&&(this._active=null)}}}const o=new a;t.MainAudioChannel=o},63014:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.SKEW_CHANGE_EVENT=t.MUTE_ALWAYS_EXPIRATION_SENTINEL=t.HOUR24_FORMAT_CHANGE_EVENT=t.Clock=void 0;var i=r(n(81109)),a=n(990445),o=r(n(395654)),s=r(n(932325)),l=n(256354),u=n(627162),c=n(548360),d=r(n(730381));const p=["fi","id","ms","ms-my"],_="skew_change";t.SKEW_CHANGE_EVENT=_;const f="hour24_format_change";t.HOUR24_FORMAT_CHANGE_EVENT=f;t.MUTE_ALWAYS_EXPIRATION_SENTINEL=-1;class h extends o.default{constructor(){if(super(),this.is24h=!1,this.skewMS=0,this.skew=0,Intl.DateTimeFormat&&Intl.DateTimeFormat().resolvedOptions){const e=Intl.DateTimeFormat().resolvedOptions().timeZone;switch(e?__LOG__(2)`Intl.DateTimeFormat().resolvedOptions().timeZone is ${e}`:__LOG__(2)`Intl.DateTimeFormat().resolvedOptions().timeZone does not exist`,e){case"America/Sao_Paulo":this.timeZoneHardCode="America/Belem";break;case"America/Campo_Grande":case"America/Cuiaba":this.timeZoneHardCode="America/Porto_Velho"}}}getIs24Hour(){return this.is24h}setIs24Hour(e){e!==this.is24h&&(this.is24h=e,(0,u.setHour24)(e),this.trigger(f))}setIs24HourBasedOnLocale(){const e=(0,u.getHour24)();null!=e?this.setIs24Hour(e):this.setIs24Hour(l.LOCALES_THAT_PREFER_24HOUR_TIME.has(s.default.getLocale()))}setSkew(e){Math.abs(e)>6e4&&__LOG__(2)`Setting large clockskew: ${e}ms`;const t=this.skewMS;this.skewMS=e,this.skew=Math.round(e/1e3),Math.abs(t-this.skewMS)>1e3&&this.trigger(_)}getSkew(){return this.skew}convertGlobalToLocalUnixTime(e){return e+this.skew}relativeStr(e){const t=e+this.skew;return t>=(0,d.default)().startOf("day").unix()?this._timestampStr(t):this._dateRelativeStr(t,!1)}relativeDateStr(e){return this._dateRelativeStr(e+this.skew,!1)}relativeDateAndTimeStr(e){return this._dateRelativeStr(e+this.skew,!0)}monthStr(e){const t=e+this.skew,n=1e3*t;return t>=(0,d.default)().startOf("month").unix()&&t<=(0,d.default)().endOf("month").unix()?c.fbt._("This Month",null,{hk:"3BBgGL"}):t>=(0,d.default)().startOf("year").unix()&&t<=(0,d.default)().endOf("year").unix()?Intl.DateTimeFormat(d.default.locale(),{month:"long"}).format(n):Intl.DateTimeFormat(d.default.locale(),{month:"long",year:"numeric"}).format(n)}timeStr(e){if(this.shouldUseIntlDateTimeFormat()){const t=1e3*(e+this.skew);let n={hour12:!this.is24h,hour:"numeric",minute:"numeric"},r={year:"numeric",month:"numeric",day:"numeric"};null!=this.timeZoneHardCode&&(n=(0,i.default)((0,i.default)({},n),{},{timeZone:this.timeZoneHardCode}),r=(0,i.default)((0,i.default)({},r),{},{timeZone:this.timeZoneHardCode}));return`${Intl.DateTimeFormat(d.default.locale(),n).format(t)}, ${Intl.DateTimeFormat(d.default.locale(),r).format(t)}`}return d.default.unix(e+this.skew).format(this.is24h?`HH${this._hmsSeparator()}mm, l`:"LT, l")}timestampStr(e){return this._timestampStr(e+this.skew)}timestampStrFormat(){return this.is24h?`HH${this._hmsSeparator()}mm`:"LT"}timestampHour(e){const t=e+this.skew,n=d.default.unix(t).hour();return this.is24h?n:n%12}createdStr(e,t){const n=this.daysDelta(e),r=e+this.skew,i=this._timestampStr(r);if(0===n)return t?s.default.t(729,{time:i}):s.default.t(728,{time:i});if(1===n)return t?s.default.t(735,{time:i}):s.default.t(734,{time:i});if(n<7){const e=this._dateRelativeStr(r,!1);return t?s.default.t(733,{day:e,time:i}):s.default.t(732,{day:e,time:i})}const a=this._dateRelativeStr(r,!1);return t?s.default.t(725,{date:a,time:i}):s.default.t(724,{date:a,time:i})}createdByStr(e,t,n){const r=this.daysDelta(e),i=e+this.skew,a=this._timestampStr(i);if(0===r)return n?s.default.t(731,{time:a}):s.default.t(730,{name:t,time:a});if(1===r)return n?s.default.t(737,{time:a}):s.default.t(736,{name:t,time:a});if(r<7){const r=this._dayNameStr(e);return n?c.fbt._("Group created by you, {on_day} at {time}",[c.fbt._param("on_day",r),c.fbt._param("time",a)],{hk:"2dwUQV"}):c.fbt._("Group created by {name}, {on_day} at {time}",[c.fbt._param("name",t),c.fbt._param("on_day",r),c.fbt._param("time",a)],{hk:"34crrC"})}const o=this._dateRelativeStr(i,!1);return n?s.default.t(727,{date:o,time:a}):s.default.t(726,{name:t,date:o,time:a})}createdByOnDateStr(e,t){const n=this._dateStr(e);if(t){if(t.isMe)return c.fbt._("Created by you on {date}",[c.fbt._param("date",n)],{hk:"4vAzF8"});if(t.isMyContact)return c.fbt._("Created by {name} on {date}",[c.fbt._param("name",t.formattedName),c.fbt._param("date",n)],{hk:"w6Jgu"})}return c.fbt._("Created on {date}",[c.fbt._param("date",n)],{hk:"16kFZm"})}_dayNameStr(e){const t=e+this.skew;switch(d.default.unix(t).day()){case 0:return c.fbt._("on Sunday",null,{hk:"3hQdLv"});case 1:return c.fbt._("on Monday",null,{hk:"4uZn7B"});case 2:return c.fbt._("on Tuesday",null,{hk:"4llPGV"});case 3:return c.fbt._("on Wednesday",null,{hk:"4afKlR"});case 4:return c.fbt._("on Thursday",null,{hk:"49dOXK"});case 5:return c.fbt._("on Friday",null,{hk:"3P0f1f"});case 6:return c.fbt._("on Saturday",null,{hk:"1I5myq"});default:throw new Error("Unexpected day number")}}untilStr(e){if(-1===e)return c.fbt._("Always",null,{hk:"26Zr18"});const t=this.daysDelta(e),n=e+this.skew,r=this._timestampStr(n);if(0===t)return s.default.t(630,{time:r});if(1===t)return s.default.t(631,{time:r});if(t<7){const e=this._dateRelativeStr(n,!1);return s.default.t(632,{day:e,time:r})}const i=this._dateRelativeStr(n,!1);return s.default.t(629,{date:i,time:r})}lastSeenStr(e){const t=this.daysDelta(e),n=e+this.skew,r=this._timestampStr(n);if(0===t)return s.default.t(699,{time:r});if(1===t)return s.default.t(701,{time:r});if(t<7){const e=this._dateRelativeStr(n,!1);return s.default.t(700,{date:e,time:r})}const i=this._dateRelativeStr(n,!1);return s.default.t(698,{date:i,time:r})}daysDelta(e,t){const n=d.default.unix(e).startOf("day"),r=(void 0===t?(0,d.default)().startOf("day"):d.default.unix(t).startOf("day")).diff(n,"days");return Math.abs(r)}durationStr(e){const t="string"==typeof e?parseInt(e,10):e,n=d.default.utc(1e3*t);if(n.isValid()){const e=t<a.HOUR_SECONDS?"m:ss":"H:mm:ss";return n.format(e)}return""}_getShortTimeLeftStr(e){const t=Math.floor(e/86400);if(t>0)return{time:s.default.t(601,{days:t,_plural:t}),_plural:t};const n=Math.floor(e/3600);if(n>0)return{time:s.default.t(602,{hours:n,_plural:n}),_plural:n};const r=Math.floor(e/60);return r>0?{time:s.default.t(603,{minutes:r,_plural:r}),_plural:r}:{time:s.default.t(604,{seconds:e,_plural:e}),_plural:e}}timeLeftStr(e){return s.default.t(617,this._getShortTimeLeftStr(e))}paymentTimestampStr(e){const t=e+this.skew,n=d.default.unix(t),r=n.startOf("day"),i=(0,d.default)().startOf("day").diff(r,"days");if(0===i)return c.fbt._("today",null,{hk:"445Hu3"});if(1===i)return c.fbt._("yesterday",null,{hk:"qICUM"});if(!(i<7)){const e=n.format("MMMM d");return s.default.t(814,{date:e})}switch(n.day()){case 0:default:return c.fbt._("on Sunday",null,{hk:"2gwfdl"});case 1:return c.fbt._("on Monday",null,{hk:"4ww1V1"});case 2:return c.fbt._("on Tuesday",null,{hk:"3Bz1cZ"});case 3:return c.fbt._("on Wednesday",null,{hk:"493Z1"});case 4:return c.fbt._("on Thursday",null,{hk:"2pNhJx"});case 5:return c.fbt._("on Friday",null,{hk:"Tf9gq"});case 6:return c.fbt._("on Saturday",null,{hk:"1SPYjP"})}}liveLocationLastUpdatedStr(e){const t=e+this.skew,n=this._timestampStr(t),r=d.default.unix(t).startOf("day"),i=(0,d.default)().startOf("day").diff(r,"days");if(0===i)return s.default.t(400,{time:n});if(1===i)return s.default.t(402,{time:n});if(i<6){const e=this._dateRelativeStr(t,!1);return s.default.t(401,{date:e,time:n})}const a=this._dateRelativeStr(t,!1);return s.default.t(399,{date:a,time:n})}pastParticipantOnDateAtTime(e,t){const n=this.daysDelta(e),r=e+this.skew,i=this._timestampStr(r);if(0===n)return c.fbt._("{action} today at {time}",[c.fbt._param("action",t),c.fbt._param("time",i)],{hk:"lDUJQ"});if(1===n)return c.fbt._("{action} yesterday at {time}",[c.fbt._param("action",t),c.fbt._param("time",i)],{hk:"3aI8Lj"});const a=this._dateRelativeStr(r,!1);return c.fbt._("{action} {date} at {time}",[c.fbt._param("action",t),c.fbt._param("date",a),c.fbt._param("time",i)],{hk:"2No8oD"})}_timestampStr(e){if(this.shouldUseIntlDateTimeFormat()){let t={hour12:!this.is24h,hour:"numeric",minute:"numeric"};null!=this.timeZoneHardCode&&(t=(0,i.default)((0,i.default)({},t),{},{timeZone:this.timeZoneHardCode}));const n=Intl.DateTimeFormat(d.default.locale(),t).format(1e3*e);return this.is24h?n.replace(/^24/,"00"):n.replace(/^0/,"12")}return d.default.unix(e).format(this.timestampStrFormat())}_dateStr(e){if(this.shouldUseIntlDateTimeFormat()){let t={year:"numeric",month:"numeric",day:"numeric"};null!=this.timeZoneHardCode&&(t=(0,i.default)((0,i.default)({},t),{},{timeZone:this.timeZoneHardCode}));return Intl.DateTimeFormat(d.default.locale(),t).format(1e3*e)}return d.default.unix(e).format("l")}_dateRelativeStr(e,t){const n=(0,d.default)().startOf("day"),r=d.default.unix(e).startOf("day"),i=n.diff(r,"days"),a=this._timestampStr(e);if(0===i)return t?s.default.t(845,{time:a}):c.fbt._("today",null,{hk:"445Hu3"});if(1===i)return t?s.default.t(852,{time:a}):c.fbt._("yesterday",null,{hk:"qICUM"});if(!t&&Math.abs(i)<7)return d.default.unix(e).format("dddd");const o=this._dateStr(e);return t?s.default.t(844,{date:o,time:a}):o}_hmsSeparator(){const e=d.default.locale();return p.includes(e)?".":":"}shouldUseIntlDateTimeFormat(){return Intl.DateTimeFormat&&!l.LOCALE_DATE_TIME_CUSTOMIZATIONS[d.default.locale()]&&!l.SHOULD_USE_MOMENT_LOCALE_FORMAT.has(d.default.locale())}}const g=new h;t.Clock=g},330619:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return d.apply(this,arguments)};var i=r(n(348926)),a=r(n(402525)),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(512641));function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}const l="finish",u="stop",c=new Map;function d(){return(d=(0,i.default)((function*(e,t,n){if(!e)return;for(var r=arguments.length,i=new Array(r>3?r-3:0),a=3;a<r;a++)i[a-3]=arguments[a];if("string"==typeof t&&(t===l||t===u))return(0,o.default)(e,t,n,...i);p(e,(e=>{const t=c.get(e)||0;c.set(e,t+1)}));const s=t;if("object"==typeof n&&"object"==typeof s){let e;"function"==typeof n.begin&&(e=n.begin),n.begin=t=>{for(const e in s){const n=s[e];Array.isArray(n)&&(0,o.hook)(t,e,n[1])}e&&e(t)}}const d=yield(0,o.default)(e,t,n,...i);return p(d,(e=>{const t=(c.get(e)||1)-1;0===t?(c.delete(e),_(e)):c.set(e,t)})),d}))).apply(this,arguments)}function p(e,t){Array.isArray(e)?e.forEach((e=>{t(e)})):t(e)}function _(e){var t;const n=o.default.Utilities.data(e),{delayedElements:r}=o.default.State;(0,a.default)(r,((t,n)=>{"count"!==n&&(t!==e&&t||delete r[n])})),(null==n||null===(t=n.velocity)||void 0===t?void 0:t.tweensContainer)&&(n.velocity.tweensContainer.element=null),o.default.Utilities.removeData(e,["fxqueue","velocity"])}},844453:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return(0,m.jsx)(g.TransitionGroup,{childFactory:t=>(0,m.jsx)(A,(0,a.default)((0,a.default)({},e),{},{children:t})),className:e.className,transitionName:e.transitionName,component:e.component,children:e.children})};var a=i(n(81109)),o=i(n(506479)),s=i(n(957557)),l=i(n(441609)),u=n(425315),c=n(780549),d=n(806279),p=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=E(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r)}(n(288057)),n(959206)),_=i(n(330619)),f=n(667294),h=n(973935),g=n(53175),m=n(785893);const y=["selector"];function E(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(E=function(e){return e?n:t})(e)}const S="enter",T="leave",v="appear";class A extends f.Component{constructor(){super(...arguments),this._isUnmounted=!1,this._controller=null,this.setBusy=()=>{this.busyId=d.UIBusyTasks.setBusy(this.busyId),this.isBusy||(this.isBusy=!0,c.Cmd.setUiBusy(!0,"vtg"))},this.unsetBusy=()=>{null!=this.busyId&&(d.UIBusyTasks.clearBusy(this.busyId),delete this.busyId),this.isBusy&&(this.uiBusy=!1,c.Cmd.setUiBusy(!1,"vtg"))},this.componentWillAppear=e=>{this.animateIfEnabled(v,e)},this.componentWillEnter=e=>{this.animateIfEnabled(S,e)},this.componentWillLeave=e=>{this.animateIfEnabled(T,e)},this.getUnmountSignal=()=>(this._controller||(this._controller=new r,this._isUnmounted&&this._controller.abort()),this._controller.signal)}componentWillUnmount(){var e;this._isUnmounted=!0,null===(e=this._controller)||void 0===e||e.abort();const t=C(this,window.Node);(0,_.default)(t,"finish")}_getTransition(){const{transitionName:e}=this.props;if(e&&!p.Transitions[e])throw __LOG__(4,void 0,new Error,!0)` ${e} wasn't found in VelocityTransitionGroupChild transitions.`,SEND_LOGS("transition-name"),new Error("Invalid transitionName");return e?p.Transitions[e]:p.Transitions.default}getTransitionNodes(e,t){let n=t;Array.isArray(n)||(n=[n]);const r={};return n.map((t=>{const{selector:n}=t,i=(0,o.default)(t,y);let s;return s=n?n in r?r[n]:r[n]=e?Array.from(e.querySelectorAll(n)):void 0:e,(0,l.default)(s)?void 0:(0,a.default)({nodes:s},i)})).filter(Boolean)}blockAction(e){e.preventDefault(),e.stopPropagation()}animateTransitions(e){let t=e;const{delay:n=0,children:r,onAnimationComplete:i}=this.props,{staggerDelay:a}=f.Children.only(r);t===v&&(t=S);const o=this._getTransition(),l=o[t];if(!o||!l)return Promise.resolve();const u=(0,s.default)(o,T,S),c=C(this,window.Node),d=this.getTransitionNodes(c,l);return t===T&&(null==c?void 0:c.setAttribute)&&c.addEventListener&&(c.setAttribute("pointerEvents","none",c),c.addEventListener("keypress",this.blockAction,!0),c.addEventListener("keydown",this.blockAction,!0)),Promise.all(d.map((e=>{const{nodes:t,props:r,easing:i,duration:o,delay:s,stagger:l,drag:c}=e;return(0,_.default)(t,r,{easing:i||u.easing||"easeInSine",duration:o||u.duration||0,delay:a||n||s||u.delay||0,queue:u.queue||!1,stagger:l||!1,drag:c||!1})}))).finally((()=>{u.cleanOnComplete&&t===S&&d.forEach((e=>{const t=e.nodes;(Array.isArray(t)?t:[t]).forEach((e=>e.removeAttribute("style")))})),t===T&&(null==c?void 0:c.removeEventListener)&&(c.removeEventListener("keypress",this.blockAction,!0),c.removeEventListener("keydown",this.blockAction,!0)),i&&i()}))}animateIfEnabled(e,t){const{transitionAppear:n=!1,transitionEnter:r=!0,transitionLeave:i=!0}=this.props;let a=!1;switch(e){case S:a=r;break;case T:a=i;break;case v:a=n}a?(this.setBusy(),this.animateTransitions(e).finally((()=>{this.unsetBusy()})).then((()=>{this.getUnmountSignal().aborted||(0,u.isFunction)(t)&&t()}))):t()}rejectOnUnmount(){return this._rejectPromise||(this._rejectPromise=new Promise(((e,t)=>{this._rejector=t})),this._rejectPromise.catch((()=>{}))),this._rejectPromise}render(){return f.Children.only(this.props.children)}}function C(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.HTMLElement;const n=(0,h.findDOMNode)(e);if(n){if(n instanceof t)return n;throw new Error(`[forbiddenFindDOMNode] returned node not instance of ${String(t)}`)}return n}A.displayName="VelocityTransitionGroupChild"},120992:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let t=e||"";const n=arguments.length<=1?0:arguments.length-1;for(let e=0;e<n;e++){const n=e+1<1||arguments.length<=e+1?void 0:arguments[e+1];null!=n&&""!==n&&(t=(t?t+" ":"")+n)}return t}},522545:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(395654));class a extends i.default{constructor(){super(...arguments),this.openVoipWindow=()=>{this.manager&&this.manager.openVoipWindow()},this.closeVoipWindow=()=>{this.manager&&this.manager.closeVoipWindow()}}register(e){this.manager=e}unregister(){this.manager&&this.manager.closeVoipWindow(),this.manager=null}}var o=new a;t.default=o},552112:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddOnBaseModel=void 0;var r=n(54918),i=n(347605);class a extends r.BaseModel{constructor(){super(...arguments),this.ack=(0,i.prop)(),this.isSendFailure=(0,i.session)()}}t.AddOnBaseModel=a},266888:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ConnImpl=t.Conn=void 0;var i=r(n(944908)),a=n(54918),o=n(780549),s=r(n(473190)),l=r(n(932325)),u=n(256354),c=n(65889),d=n(828770),p=n(757453),_=n(459857),f=n(571256),h=r(n(571834));class g extends a.BaseModel{constructor(){super(...arguments),this.id=(0,a.prop)(),this.ref=(0,a.prop)(),this.refTTL=(0,a.prop)(),this.refId=(0,a.prop)(),this.wid=(0,a.prop)(),this.connected=(0,a.prop)(),this.protoVersion=(0,a.prop)(),this.clientToken=(0,a.prop)(),this.serverToken=(0,a.prop)(),this.secret=(0,a.prop)(),this.isResponse=(0,a.prop)(),this.lc=(0,a.prop)(),this.lg=(0,a.prop)(),this.locales=(0,a.prop)(),this.is24h=(0,a.prop)(),this.platform=(0,a.prop)(),this.phone=(0,a.prop)(),this.tos=(0,a.prop)(),this.smbTos=(0,a.prop)(0),this.pushname=(0,a.prop)(),this.blockStoreAdds=(0,a.session)(!1),this.isVoipInitialized=(0,a.session)(!1),this.refExpiry=(0,a.derived)((function(){return Date.now()+this.refTTL}),["ref","refTTL"]),this.locale=(0,a.derived)((function(){return this.formatLocale(this.lg,this.lc)}),["lg","lc"]),this.localesList=(0,a.derived)((function(){return this.locales&&this.locales.length?this.locales.split(",").map((e=>{const[t,n]=e.split("-");return t?[t,n]:null})).filter(Boolean):this.lg?[[this.lg,this.lc]]:[]}),["locales","lg","lc"]),this.allLocales=(0,a.derived)((function(){return(0,i.default)(this.localesList.map((e=>{let[t,n]=e;return this.formatLocale(t,n)}))).filter(Boolean)}),["localesList"]),this.allLanguages=(0,a.derived)((function(){return(0,i.default)(this.localesList.map((e=>{let[t,n]=e;return t})))}),["localesList"]),this.platformField=(0,a.derived)((function(){return"wp7"===this.platform?h.default.PLATFORM_TYPE.WP:this.platform&&h.default.PLATFORM_TYPE[this.platform.toUpperCase()]||h.default.PLATFORM_TYPE.UNKNOWN}),["platform"]),this.tosShowCallNotification=(0,a.derived)((function(){return!0}),["tos"]),this.isSMB=(0,a.derived)((function(){return this.platform===d.PLATFORMS.SMBA||this.platform===d.PLATFORMS.SMBI}),["platform"])}initialize(){a.BaseModel.prototype.initialize.call(this),this.listenTo(this,"change:locale",(function(e,t){l.default.setLocale(t,u.L10N_PRIORITY.PHONE)})),this.listenTo(this,"change:phone",(()=>{!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{mcc:t,mnc:n}=e;t&&"string"==typeof t&&(t=parseInt(t,10));n&&"string"==typeof n&&(n=parseInt(n,10));h.default.Global.set({mcc:null!=t?t:null,mnc:null!=n?n:null,webcPhoneDeviceManufacturer:e.device_manufacturer||null,webcPhoneDeviceModel:e.device_model||null,webcPhoneOsBuildNumber:e.os_build_number||null,webcPhoneOsVersion:e.os_version||null,webcPhoneAppVersion:e.wa_version||null})}(this.phone)})),this.listenTo(this,"change:platform",this._handlePlatformChange),this.listenTo(o.Cmd,"main_stream_mode_ready_legacy",this.updateVoipAvailability)}delete(){(0,p.setPushname)(),(0,p.setVersion)(),this.clear()}canSetMyPushname(){return!this.isSMB}updateVoipAvailability(){__LOG__(2)`Conn: updateVoipAvailability`,(0,c.requireVoip)().then((e=>{if(!(0,f.isVoiceCallEnabled)()&&!(0,f.isVideoCallEnabled)())return __LOG__(2)`Conn: updateVoipAvailability, Voip GK false`,e.cleanup(),void(this.isVoipInitialized=!1);this.id&&(0,_.getMaybeMeUser)()?(0,s.default)().then((t=>{t?(__LOG__(2)`Conn: updateVoipAvailability, isSystemCapableOfVoip true`,e.init().then((t=>{__LOG__(2)`Conn: updateVoipAvailability, Voip initialized: ${t}`,this.isVoipInitialized=t,t&&e.updateAudioVideoSwitch()}))):(__LOG__(2)`Conn: updateVoipAvailability, isSystemCapableOfVoip false`,e.cleanup(),this.isVoipInitialized=!1)})):(__LOG__(2)`Conn: updateVoipAvailability, getMaybeMeUser undefined`,e.cleanup(),this.isVoipInitialized=!1)}))}_handlePlatformChange(){__LOG__(2)`Conn: platform change: ${this.platform}`,this.platform&&h.default.Global.set({webcPhonePlatform:this.platformField})}formatLocale(e,t){return e?t?e.toLowerCase()+"-"+t.toUpperCase():e.toLowerCase():null}shouldSaveToCache(){return!!(0,_.getMe)()&&!!this.id}}t.ConnImpl=g,g.Proxy="conn";const m=new((0,a.defineModel)(g))({id:"1"});t.Conn=m},736751:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PrimaryFeaturesClass=t.PrimaryFeatures=void 0;var r=n(54918),i=n(757453);class a extends r.BaseModel{constructor(){super(...arguments),this.features=(0,r.prop)(),this.contactExcept=(0,r.prop)(!1),this.reactionsSend=(0,r.prop)(!1),this.ddmSettings=(0,r.prop)(!1),this.clearAndDeleteChatSync=(0,r.prop)(!1),this.viewOnceSpReceiver=(0,r.prop)(!1),this.recentSticker=(0,r.prop)(!1),this.favoriteSticker=(0,r.prop)(!1),this.linkPreview=(0,r.prop)(!1)}initializeFromLocalStorage(){this._setPrimaryFeatures((0,i.getPrimaryFeatures)())}setPrimaryFeatures(e){(0,i.setPrimaryFeatures)(e),this._setPrimaryFeatures(e)}_setPrimaryFeatures(e){this.features=e;const t=new Set(e);this.contactExcept=t.has("contact_except"),this.reactionsSend=t.has("reactions_send"),this.ddmSettings=t.has("ddm_settings"),this.clearAndDeleteChatSync=t.has("clear_and_delete_chat_sync"),this.viewOnceSpReceiver=t.has("vo_sp_receiver"),this.recentSticker=t.has("recent_sticker"),this.favoriteSticker=t.has("favorite_sticker"),this.linkPreview=t.has("link_preview")}}t.PrimaryFeaturesClass=a,a.Proxy="primaryFeatures";const o=new((0,r.defineModel)(a))({id:"1"});t.PrimaryFeatures=o},871850:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.PrimaryForceUpgradeClass=t.PrimaryForceUpgrade=void 0;var i=n(287461),a=n(54918),o=n(780549),s=n(736751),l=n(885765),u=r(n(571834));class c extends a.BaseModel{constructor(){super(...arguments),this.forceUpgradeReason=(0,a.prop)(),this.shouldForceUpgrade=(0,a.derived)((function(){return null!=this.forceUpgradeReason}),["forceUpgradeReason"])}setup(){this._update(),this.listenTo(o.Cmd,"on_ab_props_update",(()=>{this._update()})),this.listenTo(s.PrimaryFeatures,"change:features",(()=>{this._update()}))}_update(){try{var e;const n=function(){const e=(0,i.getABPropConfigValue)("companion_min_versions");return JSON.parse(e.substr(5)).map((e=>{let{feature:t,min_version:n}=e;return{feature:t,minVersion:n}}))}(),r=new Set(null!==(e=s.PrimaryFeatures.features)&&void 0!==e?e:[]),a=new l.Version(l.SANITIZED_VERSION_STR),o=n.find((e=>{let{feature:t,minVersion:n}=e;return r.has(t)&&a.lt(n)})),c=this.shouldForceUpgrade;var t;if(this.forceUpgradeReason=null==o?void 0:o.feature,!c&&this.shouldForceUpgrade)new u.default.CompanionForceUpgradeUserActionV2({forceUpgradeUserActionV2:u.default.FORCE_UPGRADE_USER_ACTION_TYPE_V2.SHOW,forceUpgradeReasonV2:null!==(t=this.forceUpgradeReason)&&void 0!==t?t:""}).commit();__LOG__(2)`PrimaryForceUpgradeClass: shouldForceUpgrade ${this.shouldForceUpgrade}`}catch(e){__LOG__(4,void 0,new Error,!0)`PrimaryForceUpgradeClass: ${e}`,SEND_LOGS("primary-force-upgrade-error")}}}t.PrimaryForceUpgradeClass=c,c.Proxy="primaryForceUpgrade";const d=new((0,a.defineModel)(c))({id:"1"});t.PrimaryForceUpgrade=d},241588:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.UNINITIALIZED_VALUE_WEB_BIZ_PROFILE_OPTIONS=t.ServerPropsImpl=t.ServerProps=t.DEFAULT_MAX_FILE_SIZE_BYTES=void 0,t.getMaxFilesSizeServerProp=function(){return E.maxFileSize};var i=n(54918),a=n(650201),o=n(390912),s=r(n(665810)),l=n(386263),u=r(n(571834));const c={imageMaxKBytes:function(e){if("number"==typeof e&&e>0)return 1024*e},pttConversationWaveform:function(e){return Boolean(e)},pttOotPlayback:function(e){return Boolean(e)},pttRememberPlayPosition:function(e){return Boolean(e)},pttWaveformSend:function(e){return Boolean(e)},pttPausableEnabled:function(e){return Boolean(e)},pttForwardedFeaturesEnabled:function(e){return Boolean(e)},maxParticipants:function(e){if("number"==typeof e&&e>0)return e-1},media:h,maxElectronFileSize:f,maxFileSize:f,streamingUploadChunkSize:h,groupDescLength:g,statusVideoMaxDuration:g,muteAlways:m,ctwaContextRender:m,serverPropsVersion:g,wallpapersV2:m,hfmStringChanges:m,webServerStickerPanel:m,shopsProductGrid:m,stickerMaker:function(e){return Boolean(e)},downloadHostSwitchingEnabled:function(e){return Boolean(e)},uploadHostSwitchingEnabled:function(e){return Boolean(e)},webUploadDocumentThumbMmsEnabled:y,webDownloadDocumentThumbMmsEnabled:y,webDownloadStatusThumbMmsEnabled:function(e){return!!(0,a.isFeatureEnabled)("download_status_thumb_mms")&&Boolean(e)}},d=104857600;t.DEFAULT_MAX_FILE_SIZE_BYTES=d;t.UNINITIALIZED_VALUE_WEB_BIZ_PROFILE_OPTIONS=3;const p=604800;class _ extends i.BaseModel{constructor(){super(...arguments),this.serverPropsVersion=(0,i.prop)(),this.gifSearch=(0,i.prop)(!1),this.imageMaxEdge=(0,i.prop)(1600),this.imageMaxKBytes=(0,i.prop)(1048576),this.maxParticipants=(0,i.prop)(101),this.maxSubject=(0,i.prop)(25),this.media=(0,i.prop)(16777216),this.maxElectronFileSize=(0,i.prop)(d),this.maxFileSize=(0,i.prop)(d),this.streamingUploadChunkSize=(0,i.prop)(0),this.groupDescLength=(0,i.prop)(0),this.multicastLimitGlobal=(0,i.prop)(5),this.frequentlyForwardedThreshold=(0,i.prop)(5),this.frequentlyForwardedMax=(0,i.prop)(1),this.ephemeralMessagesAllowedValues=(0,i.prop)("604800"),this.productMediaAttachments=(0,i.prop)(!1),this.muteAlways=(0,i.prop)(!1),this.wallpapersV2=(0,i.prop)(!1),this.hfmStringChanges=(0,i.prop)(!1),this.mmsVCacheAggregationEnabled=(0,i.prop)(!1),this.mmsHotContentTimespan=(0,i.prop)(0),this.mmsCatV1ForwardHotOverrideEnabled=(0,i.prop)(!1),this.pttConversationWaveform=(0,i.prop)(!1),this.pttOotPlayback=(0,i.prop)(!1),this.pttPausableEnabled=(0,i.prop)(!1),this.pttPlaybackSpeedEnabled=(0,i.prop)(!1),this.pttPlaybackSpeedHideDelay=(0,i.prop)(1500),this.pttWaveformSend=(0,i.prop)(!1),this.pttRememberPlayPosition=(0,i.prop)(!1),this.pttForwardedFeaturesEnabled=(0,i.prop)(!1),this.templateDocMimeTypes=(0,i.prop)(1),this.mmsMediaKeyTTL=(0,i.prop)(1/0),this.vcardAsDocumentSizeKb=(0,i.prop)(0),this.vcardMaxSizeKb=(0,i.prop)(1e3),this.mmsVcardAutodownloadSizeKb=(0,i.prop)(1024),this.webUploadDocumentThumbMmsEnabled=(0,i.prop)(!1),this.webDownloadDocumentThumbMmsEnabled=(0,i.prop)(!1),this.webSendDocumentThumbInMessageDisabled=(0,i.prop)(!1),this.webDownloadStatusThumbMmsEnabled=(0,i.prop)(!1),this.statusVideoMaxDuration=(0,i.prop)(30),this.groupCallMaxParticipants=(0,i.prop)(0),this.webVoipMacOsMinVersion=(0,i.prop)(""),this.webVoipWindowsOsMinVersion=(0,i.prop)(""),this.ctwaContextRender=(0,i.prop)(!1),this.ctwaContextCompose=(0,i.prop)(!1),this.syncdInlineMutationsMaxCount=(0,i.prop)(1e3),this.syncdPatchProtobufMaxSize=(0,i.prop)(100),this.syncdKeyMaxUseDays=(0,i.prop)(30),this.syncdWaitForKeyTimeoutDays=(0,i.prop)(2),this.syncdAdditionalMutations=(0,i.prop)(1),this.syncdSentinelTimeoutSeconds=(0,i.prop)(3),this.syncdPatchDeviceIndexIncluded=(0,i.prop)(!1),this.syncdClearChatDeleteChatEnabled=(0,i.prop)(!1),this.syncdPinChatEnabled=(0,i.prop)(!1),this.syncdQPLLoggingEnabled=(0,i.prop)(!1),this.webPaymentBackgroundEnabled=(0,i.prop)(!1),this.webBizProfileOptions=(0,i.prop)(3),this.webBizProfileEdit=(0,i.prop)(!1),this.webBizProfileV3Enabled=(0,i.prop)(!1),this.webBizProfileV3M2=(0,i.prop)(!1),this.webShopsChatHeaderButtonEnabled=(0,i.prop)(!1),this.shopsHideCatalogAttachmentEntrypoint=(0,i.prop)(!1),this.shopsHeaderDropdownMenuItem=(0,i.prop)(!1),this.shopsProductGrid=(0,i.prop)(!1),this.webListMessage=(0,i.prop)(!1),this.webButtonsMessage=(0,i.prop)(!1),this.greenAlertBannerDuration=(0,i.prop)(0),this.webSMBUpsellInBizProfile=(0,i.prop)(!1),this.webProductListMessage=(0,i.prop)(!1),this.webProductListMessageRenderKillSwitch=(0,i.prop)(!1),this.webProductListMessagePageSize=(0,i.prop)(l.PRODUCT_PAGE_SIZE),this.webMediaAutoDownloadEnabled=(0,i.prop)(!1),this.webYouTubePlayerEnhancements=(0,i.prop)(!1),this.webServerStickerPanel=(0,i.prop)(!1),this.webCollectionsDisplay=(0,i.prop)(!1),this.webCollectionsManagement=(0,i.prop)(!1),this.webCollectionsAppealEnabled=(0,i.prop)(!1),this.webCartOnOffToggle=(0,i.prop)(!1),this.downloadHostSwitchingEnabled=(0,i.prop)(!1),this.uploadHostSwitchingEnabled=(0,i.prop)(!1),this.isDirectConnectionForPLMTransparent=(0,i.prop)(!0),this.webPipRedesign=(0,i.prop)(!1),this.blockCatalogCreationEcommerceComplianceIndia=(0,i.prop)(!1),this.ecommerceComplianceIndia=(0,i.prop)(!1),this.editEcommerceComplianceIndia=(0,i.prop)(!1),this.smbEcommerceComplianceIndiaM4=(0,i.prop)(!1),this.smbEcommerceComplianceIndiaM4_5=(0,i.prop)(!1),this.webMdMigrationExperience=(0,i.prop)(!1),this.stickerMaker=(0,i.prop)(!1),this.webLogUploadDownloadCrashes=(0,i.prop)(!1),this.webMdMmsSyncDeletionRequest=(0,i.prop)(!0),this.webLegacyUsersShouldUpdatePrimaryExperience=(0,i.prop)(!1),this.winUwpDeprecationKillswitchEnabled=(0,i.prop)(!1),this.maxKeys=(0,i.prop)(200)}delete(){super.delete(),this.updateProps({})}initialize(){super.initialize()}updateProps(e){let t=e;u.default.Global.set({webcBucket:t.bucket||null}),this.__props.forEach((e=>{let n=t[e];void 0===n?n="serverPropsVersion"===e?this.serverPropsVersion:this.getDefault(e):c[e]&&(n=c[e](n),void 0===n&&(n=this.getDefault(e))),this.set(e,n)}));for(const e in o.LegacyPhoneFeatures.F)void 0!==t[e]&&o.LegacyPhoneFeatures.setFeature(e,t[e])}updateSelectiveProps(e){let t=e;u.default.Global.set({webcBucket:t.bucket||null}),this.__props.forEach((e=>{let n=t[e];void 0!==n&&(c[e]&&(n=c[e](n),void 0===n&&(n=this.getDefault(e))),this.set(e,n))}));for(const n in o.LegacyPhoneFeatures.F)void 0!==t[n]&&o.LegacyPhoneFeatures.setFeature(n,e[n])}extendAndOverrideFromURLParams(e){const t=new s.default(window.location.search),n=e;return this.__props.forEach((e=>{if(!0===t.has(e)){const r=t.get(e);if(null==r)return;"true"===r||"false"===r?n[e]="true"===r:isNaN(r)||isNaN(parseFloat(r))?n[e]=r:n[e]=parseFloat(r)}})),n}getGroupCallMaxParticipants(){return this.groupCallMaxParticipants}getEphemeralMessagesAllowedValues(){try{return this.ephemeralMessagesAllowedValues.split(",").map((e=>parseInt(e,10)))}catch(e){return __LOG__(4,void 0,new Error,!0)`[ephemeral] incorrect type for ephemeralMessagesAllowedValues`,SEND_LOGS("ephemeral"),[p]}}}function f(e){return h(e)}function h(e){if("number"==typeof e&&e>0)return 1024*e*1024}function g(e){if("number"==typeof e&&e>0)return e}function m(e){if("number"==typeof e)return!!e}function y(e){return Boolean(e)}t.ServerPropsImpl=_,_.Proxy="serverProps";const E=new((0,i.defineModel)(_))({id:"1"});t.ServerProps=E},6961:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Socket=void 0;var i=r(n(348926)),a=r(n(706410)),o=r(n(435161)),s=r(n(763105)),l=r(n(402525)),u=n(911794),c=n(643930),d=n(36530),p=n(975175),_=n(238196),f=n(522414),h=n(984330),g=n(54918),m=n(780549),y=n(266888),E=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=Z(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(996588)),S=n(188472),T=r(n(62883)),v=r(n(799132)),A=r(n(385158)),C=n(110567),P=n(638521),O=n(542137),I=n(777834),M=n(65889),b=r(n(174285)),R=n(383047),N=n(332108),w=n(636152),L=r(n(524173)),D=n(288057),k=n(76469),U=n(323791),G=r(n(665810)),x=n(241296),B=n(241588),F=n(704548),j=n(226562),Y=r(n(296121)),K=n(390921),H=n(77767),W=n(366320),V=n(725137),$=n(757453),z=n(94872),q=n(459857),J=n(673168),Q=n(53575),X=r(n(507964));function Z(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(Z=function(e){return e?n:t})(e)}class ee extends((0,c.customError)("ExternalPoke")){}class te extends((0,c.customError)("MustExitLoop")){}class ne extends((0,c.customError)("TakeoverRequested")){}const re={SYNC_INFO:["Conn",T.default.OBJECT],CHALLENGE:["Cmd",{type:"challenge",challenge:T.default.STRING}],DISCONNECT:["Cmd",{type:"disconnect",kind:void 0}],HARD_REFRESH:["Cmd",{type:"update"}],UPGRADE_MD_FOR_INTERNAL_USER:["Cmd",{type:"upgrade_md"}],UPGRADE_MD_FOR_PROD:["Cmd",{type:"upgrade_md_prod",version:void 0}],PONG:["Pong",T.default.BOOLEAN]},ie={TAG:e=>new T.default({tag:e,data:T.default.ANY,binarySize:T.default.ANY}),SYNC_INFO:new T.default({tag:T.default.ANY,data:re.SYNC_INFO,binarySize:T.default.ANY}),CHALLENGE:new T.default({tag:T.default.ANY,data:re.CHALLENGE,binarySize:T.default.ANY}),DISCONNECT:new T.default({tag:T.default.ANY,data:re.DISCONNECT,binarySize:T.default.ANY}),HARD_REFRESH:new T.default({tag:T.default.ANY,data:re.HARD_REFRESH,binarySize:T.default.ANY}),UPGRADE_MD_FOR_INTERNAL_USER:new T.default({tag:T.default.ANY,data:re.UPGRADE_MD_FOR_INTERNAL_USER,binarySize:T.default.ANY}),UPGRADE_MD_FOR_PROD:new T.default({tag:T.default.ANY,data:re.UPGRADE_MD_FOR_PROD,binarySize:T.default.ANY}),PONG:new T.default({tag:T.default.ANY,data:re.PONG,binarySize:T.default.ANY})};class ae extends g.BaseModel{constructor(){super(...arguments),this.socketPreload=(0,g.session)(),this.socket=(0,g.session)(),this.launchGeneration=(0,g.session)(0),this.backoffGeneration=(0,g.session)(0),this.hasSynced=(0,g.session)(),this.state=(0,g.session)(j.SOCKET_STATE.UNLAUNCHED),this.stream=(0,g.session)(j.SOCKET_STREAM.DISCONNECTED),this.canSend=(0,g.session)(),this.sendQueue=(0,g.session)(),this.sendHash=(0,g.session)(),this.cancelHash=(0,g.session)(),this.doubleAckHash=(0,g.session)(),this.sequence=(0,g.session)(0),this.shortTagBase=(0,g.session)(),this.socketWatcher=(0,g.session)(),this.refWatcher=(0,g.session)(),this.pendingPhoneReqs=(0,g.session)(0),this.isIncognito=(0,g.session)(),this.runPromise=(0,g.session)(),this.streamPromise=(0,g.session)(),this.conflictPromise=(0,g.session)(),this.resumePromise=(0,g.session)(),this.logoutMutex=(0,g.session)(0),this.retryTimestamp=(0,g.session)(),this.pokeable=(0,g.session)(),this.launched=(0,g.session)(),this.mustExitLoop=(0,g.session)(),this.syncTag=(0,g.session)(),this.lastPhoneMessage=(0,g.session)(),this.shouldForceReconnect=(0,g.session)(!1)}initialize(){var e=this;this.sendQueue=[],this.sendHash={},this.cancelHash={},this.doubleAckHash={},this.listenTo(this,"change:state",this._handleStateChange.bind(this)),this.listenTo(this,"change:stream",this._handleStreamChange.bind(this)),(0,d.delayMs)(0).then(A.default).then((e=>{this.isIncognito=e})),this.listenTo(m.Cmd,"log_socket_summary",this.summary),this.listenTo(m.Cmd,"set_socket_state",(e=>{this.state=e})),this.listenTo(m.Cmd,"open_socket_stream",(()=>{this.openStream(),this.hasSynced&&this.set({stream:j.SOCKET_STREAM.CONNECTED})})),this.listenTo(m.Cmd,"socket_stream_disconnected",(()=>{this.set({stream:j.SOCKET_STREAM.DISCONNECTED})})),this.listenTo(m.Cmd,"on_critical_sync_done",(()=>{__LOG__(2)`[ws2] observed on_critical_sync_done`,this._handleCriticalSyncDone()})),this.listenTo(m.Cmd,"main_stream_mode_ready",(0,i.default)((function*(){__LOG__(2)`[ws2] observed main_stream_mode_ready`,(yield(0,J.getAllCriticalDataSynced)())?(__LOG__(2)`[ws2] moving to main screen from main_stream_mode_ready`,e.set({hasSynced:!0,stream:j.SOCKET_STREAM.CONNECTED})):__LOG__(2)`[ws2] did not meet conditions to move to main screen`}))),this.listenTo(m.Cmd,"socket_stream_disconnected",(()=>{this.stream=j.SOCKET_STREAM.DISCONNECTED}))}poke(){this.pokeable&&this.pokeable.poke()}takeover(){if(!this.conflictPromise)throw"Takeover called without conflict!";this.conflictPromise.cancel(new ne)}exitLoop(e){this.mustExitLoop=!0,this.runPromise&&this.runPromise.cancel(e||new te)}_setLogoutDirtyBit(){b.default&&b.default.setItem(z.KEYS.LOGOUT_DIRTY_BIT,"1")}_removeLogoutDirtyBit(){b.default&&b.default.removeItem(z.KEYS.LOGOUT_DIRTY_BIT)}_hasDirtyBitSet(){b.default&&b.default.getItem(z.KEYS.LOGOUT_DIRTY_BIT)}clearCredentialsAndStoredData(e){var t=this;return(0,i.default)((function*(){let n=!1;e===N.LogoutReason.ClientFatalError&&(n=!0),t._setLogoutDirtyBit(),n=yield t.clearCredentials(),t._hasDirtyBitSet()&&(n=!0),t._setLogoutDirtyBit();try{yield t.destroyStorage()}catch(e){n=!0,__LOG__(4,void 0,new Error,void 0,["logout"])`destroyStorage: failed with error ${e}`}(0,K.handleOfflineNotifications)(!1),(0,_.clearABPropConfigs)(),n||t._removeLogoutDirtyBit();const r=new G.default;if(n&&"Firefox"!==L.default.info().name&&r.set("post_logout","1"),e){const t=(0,R.getErrorCodeFromLogoutReason)(e);t&&r.set("logout_reason",t)}const i=r.toString();null==i||""===i?window.location.reload():window.location.href=`${window.location.pathname}?${r.toString()}`}))()}destroyStorage(){return(0,i.default)((function*(){const e=[(0,k.destroy)(),(0,w.destroyStorage)()];e.push((0,P.destroy)()),e.push((0,U.destroy)()),e.push((0,I.destroy)()),e.push((0,x.destroy)()),e.push(C.ftsClient.clearInitializationPromises()),yield Promise.all(e)}))()}logout(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:N.LogoutReason.UserInitiated;b.default&&(b.default.removeItem("WebEncKeySalt"),b.default.removeItem("WANoiseInfo")),(0,O.get)().setLogoutState(!0),m.Cmd.onStartingLogout(),__LOG__(2)`ws2:user logged out`;let a=Promise.resolve();const o=Math.min(20,Math.max(0,B.ServerProps.syncdSentinelTimeoutSeconds));a=(0,p.promiseTimeout)(n(795917).Z(),1e3*o).catch((()=>__LOG__(3)`ws2: multi-device logout did not manage to send sentinel patch`));(0,p.promiseTimeout)(a.then((()=>{this.stream===j.SOCKET_STREAM.DISCONNECTED||t?this.sendCurrentLogout(null,r):this.sendCurrentLogout(this.socket,r)})).catch(function(){var t=(0,i.default)((function*(t){__LOG__(4,void 0,new Error)`ws2: [logout error] sendCurrentLogoutPromise errored with ${t}`,yield e.clearCredentialsAndStoredData(r),m.Cmd.logout()}));return function(){return t.apply(this,arguments)}}()),3e3,"network request took more than 3 seconds").then((0,i.default)((function*(){yield e.clearCredentialsAndStoredData(r),e.state===j.SOCKET_STATE.OPENING&&e.trigger("change:state"),m.Cmd.logout()}))).catch(function(){var t=(0,i.default)((function*(t){__LOG__(4,void 0,new Error)`ws2: [logout error] sentinelPromise or sendCurrentLogoutPromise timed out with ${t}`,yield e.clearCredentialsAndStoredData(r),m.Cmd.logout()}));return function(){return t.apply(this,arguments)}}()).finally((()=>{(0,O.get)().setLogoutState(!1)}))}summary(){var e=this;return(0,i.default)((function*(){__LOG__(2)`ws:summary --------------------------------`,__LOG__(2)`ws state ${e.state}`,__LOG__(2)`wd online: ${String(navigator.onLine)}`,__LOG__(2)`ws socket id: ${e.socket?e.socket.id:"n/a"}`}))()}_handleStateChange(){__LOG__(2)`ws2:state change: ${this.state}`}_handleStreamChange(){__LOG__(2)`ws2:stream change: ${this.stream}`,this.stream===j.SOCKET_STREAM.DISCONNECTED&&this.unset("resumePromise")}phoneTimedOut(){return!0}clearSendHash(e){if(e)(0,l.default)(this.sendHash,(function(e){e.resendTimer&&clearTimeout(e.resendTimer),e.onDrop(new h.LogoutDrop(e.toString()))}));else{const e=(0,s.default)(this.sendHash,"ephemeral");__LOG__(3)`Ephemeral Drop: ${(0,o.default)(e,"tag").join(",")}`,e.forEach((function(e){e.resendTimer&&clearTimeout(e.resendTimer),e.onDrop(new h.EphemeralDrop(e.toString()))}))}this.sendHash={},this.doubleAckHash={},this.pendingPhoneReqs=0}openSocket(){const e=this.socketPreload;if(this.socketPreload=null,(null==e?void 0:e.socket)&&e.socket.state===j.WATCHED_SOCKET_STATE.OPEN)return Promise.resolve(e.socket);const t=e&&e.active?e:new Y.default,n=()=>{this.retryTimestamp=t.retryTimestamp};t.on("change:retryTimestamp",n),this.pokeable=t;const r=(0,v.default)(t,"change:socket").cancellable().then((()=>t.socket)).finally((()=>{t.off("change:retryTimestamp",n),t.onerror=null,t.deactivate(),this.pokeable=null}));return t.onerror=e=>{r.cancel(e)},r}waitForSyncInfo(){var e=this;return(0,i.default)((function*(){return(yield e.socket.nextMessage(ie.SYNC_INFO)).data[1]}))()}throwOnClose(){return this.socket.nextMessage(ie.DISCONNECT).then((function(){}))}_handleCriticalSyncDone(){__LOG__(2)`[ws2] moving to main screen from onCriticalSyncDone`,this.set({hasSynced:!0,stream:j.SOCKET_STREAM.CONNECTED})}openStream(){return(0,q.getMeUser)()&&(y.Conn.blockStoreAdds=!1,y.Conn.id="1",y.Conn.trigger("me_ready")),(0,f.addMeToContacts)()}setPokeable(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.retryTimestamp;return this.set({pokeable:{poke(){e.cancel(new ee)}},retryTimestamp:t}),e}clearCredentials(){var e=this;return(0,i.default)((function*(){Q.userPreferencesStore.updatePreservedUserKeys();let t=!1;try{t=yield e.clearState()}catch(e){t=!0}try{(0,$.setBrowserId)()}catch(e){t=!0,__LOG__(4,void 0,new Error,void 0,["logout"])`ws2:clearState error ${e}`}try{(0,$.setUnknownId)()}catch(e){__LOG__(4,void 0,new Error,void 0,["logout"])`ws2:setUnknownId error ${e}`}try{(0,q.setMe)()}catch(e){t=!0,__LOG__(4,void 0,new Error,void 0,["logout"])`ws2:setMe error ${e}`}try{yield(0,J.clearRegistrationInfo)()}catch(e){t=!0,__LOG__(4,void 0,new Error,void 0,["logout"])`ws2:clearRegistrationInfo error ${e}`}try{yield(0,F.destroy)()}catch(e){t=!0,__LOG__(4,void 0,new Error,void 0,["logout"])`ws2:destroySignal error ${e}`}try{yield(0,S.deleteEncKeysAndCache)();const e=n(47405).cn;yield e()}catch(e){t=!0}try{yield(0,V.clearAllLocalState)()}catch(e){t=!0,__LOG__(4,void 0,new Error,void 0,["logout"])`ws2:clearAllLocalState error ${e}`}return t}))()}clearState(){var e=this;return(0,i.default)((function*(){__LOG__(2)`ws2:clearState`;let t=!1;e.sendQueue=[],e.clearSendHash(!0),e.unset("hasSynced");try{(yield(0,M.requireClearAppStates)())()}catch(e){t=!0,e instanceof D.DbOnLogoutAbort?__LOG__(3)`ws2:clearState failed due to DB operations aborted: ${e.stack}`:(__LOG__(4,void 0,new Error,!0)`ws2:clearState error ${e.stack}`,SEND_LOGS("clear_session_app_state"))}try{yield(0,X.default)()}catch(e){t=!0,e instanceof D.DbOnLogoutAbort?__LOG__(3)`ws2:clearState failed due to DB operations aborted: ${e.stack}`:(__LOG__(4,void 0,new Error,!0)`ws2:clearState error ${e.stack}`,SEND_LOGS("clear_persistent_app_state"))}return t}))()}sendCurrentLogout(e,t){let n=(0,H.unpairDevice)(t).then((e=>{200!==e.status&&__LOG__(3)`ws2:multi-device logout failed with error code ${e.status}`,(0,u.stopComms)()})).catch((e=>{__LOG__(4,!0,new Error)`[CRITICAL] unpairDevice failed with error, preoceed with local logout \n${e.stack}`}));return n||(n=Promise.reject(new Error("sendCurrentLogout: should not reach"))),n}sendRemainingLogouts(){let e=this.logoutMutex;if(0!==e)return;const t=n(794938).default,r=(0,$.getOldLogoutCreds)();0!==r.length?(this.logoutMutex=e=1,Promise.all((0,o.default)(r,function(){var e=(0,i.default)((function*(e){__LOG__(2)`ws2:POST logout`;try{yield t.post("https://web.whatsapp.com/logout",e),function(e){const t=(0,$.getOldLogoutCreds)(),n=(0,a.default)(e);(0,$.setOldLogoutCreds)((0,s.default)(t,(e=>!n(e))))}(e)}catch(e){__LOG__(3)`ws2:POST logout failure`}}));return function(){return e.apply(this,arguments)}}())).finally((()=>{e===this.logoutMutex&&(this.logoutMutex=0)}))):this.logoutMutex=-1}updateImmediately(e){E.upload({reason:e,immediate:!0}).finally((()=>{W.Updater.restart(!0)}))}}const oe=new((0,g.defineModel)(ae));t.Socket=oe},841273:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.StreamMode=t.StreamInfo=t.Stream=t.Obscurity=void 0;var i=r(n(23279)),a=n(201063),o=n(54918),s=n(780549),l=r(n(99398)),u=n(828927),c=n(226562),d=n(6961),p=n(366320),_=n(673168),f=r(n(571834)),h=n(115383),g=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(824194)),m=n(397203);function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}const E=n(76672).Mirrored(["OFFLINE","OPENING","PAIRING","SYNCING","RESUMING","CONNECTING","NORMAL","TIMEOUT","SCREEN_LOCKED"]);t.StreamInfo=E;const S=n(76672).Mirrored(["QR","MAIN","SYNCING","OFFLINE","CONFLICT","PROXYBLOCK","TOS_BLOCK","SMB_TOS_BLOCK","DEPRECATED_VERSION"]);t.StreamMode=S;const T=n(76672).Mirrored(["SHOW","OBSCURE","HIDE"]);t.Obscurity=T;class v extends o.BaseModel{constructor(){super(...arguments),this.info=(0,o.session)(E.NORMAL),this.mode=(0,o.session)(S.SYNCING),this.obscurity=(0,o.session)(T.HIDE),this.needsUpdate=(0,o.session)(),this.clientExpired=(0,o.session)(!1),this.hardExpired=(0,o.session)(!1),this.lastSyncStart=(0,o.session)(P()),this.needsManualDownload=(0,o.session)(),this.couldForce=(0,o.session)(),this.uiActive=(0,o.session)(),this.available=(0,o.session)(!0),this.unavailableShiftTimer=(0,o.session)(),this.unavailableAutoLockTimer=(0,o.session)(),this.unavailableLogoutTimer=(0,o.session)(),this.unobscureShiftTimer=(0,o.session)(),this.timeoutEvent=(0,o.session)(),this.resumeCount=(0,o.session)(0),this.phoneAuthed=(0,o.session)(!1),this._activeModeMeasure=(0,o.session)(),this.displayInfo=(0,o.derived)((function(){return function(e,t){switch(t){case T.SHOW:return e;case T.HIDE:return d.Socket.hasSynced?E.NORMAL:E.CONNECTING;case T.OBSCURE:switch(e){case E.OPENING:case E.PAIRING:case E.SYNCING:case E.RESUMING:return E.CONNECTING;default:return e}}return __LOG__(3)`Stream:unknown obscure level:`,e}(this.info,this.obscurity)}),["info","obscurity"])}initialize(){super.initialize(),(0,_.isRegistered)()||(this.mode=S.QR),this._activeModeMeasure=g.startMeasure(`Stream.mode: ${this.mode}`),this.unavailableShiftTimer=new a.ShiftTimer((()=>this.markUnavailable())),this.unobscureShiftTimer=new a.ShiftTimer((()=>this.unobscure())),this.unavailableAutoLockTimer=new a.ShiftTimer((function(){0!==(0,_.getScreenLockDurationInSeconds)()&&(__LOG__(2)`Stream:autoLockShiftTimer auto lock due to inactivity`,location.reload())})),this.listenTo(d.Socket,"change:state change:stream change:hasSynced",this._handleSocketUpdate),this.listenTo(l.default,"change:online",this._handleSocketUpdate),this.listenTo(this,"change:available",this._handleAvailableUpdate),this.listenTo(this,"change:phoneAuthed",this._handlePhoneAuthedUpdate),this.listenTo(this,"change:info change:displayInfo change:mode",(0,i.default)(this._handleSelfUpdate)),this.listenTo(this,"change:info",this.logPageResume),this.listenTo(this,"change:info",this.updateWamLog),this.listenTo(this,"change:mode",this.logModeChange),this.listenTo(this,"change:available change:uiActive",this.updateCouldForce),this.listenTo(s.Cmd,"midnight",this.updateHardExpire.bind(this)),this.listenTo(s.Cmd,"socket_stream_disconnected",(()=>{n(935234).PresenceCollection.clearAllPresence()})),window.document&&document.addEventListener("visibilitychange",this.updateCouldForce),this.updateCouldForce(),this.updateHardExpire()}delete(){}markAvailable(){this.unavailableShiftTimer.cancel(),this.available=!0}markUnavailable(e){null!=e&&0!==e?this.unavailableShiftTimer.onOrBefore(e):(this.unavailableShiftTimer.cancel(),this.available=!1)}_handleSelfUpdate(){__LOG__(2)`Stream:onSelfUpdate mode:${this.mode} info:${this.info} view:${this.displayInfo}`;let e=this.timeoutEvent;if(this.info===E.TIMEOUT)e||(this.timeoutEvent=e=new f.default.WebcPhoneDisconnected),this.displayInfo===E.TIMEOUT&&null==this._bbarTime&&(this._bbarTime=Date.now());else if(e){e.markWebcPhoneDisconnectedT();const t=this._bbarTime;null!=t&&(e.webcPhoneBbarShownT=Date.now()-t),e.commit(),this.timeoutEvent=null,this._bbarTime=null}this.mode===S.MAIN&&s.Cmd.readyForMainStreamModeLegacy()}_handleSocketUpdate(){const e={},t=function(){switch(d.Socket.state){case c.SOCKET_STATE.SCREEN_LOCKED:return E.SCREEN_LOCKED;case c.SOCKET_STATE.TIMEOUT:return E.TIMEOUT;case c.SOCKET_STATE.OPENING:return l.default.online?E.OPENING:E.OFFLINE;case c.SOCKET_STATE.PAIRING:return d.Socket.hasSynced?E.RESUMING:E.PAIRING;case c.SOCKET_STATE.CONNECTED:return d.Socket.stream!==c.SOCKET_STREAM.CONNECTED?d.Socket.hasSynced?E.NORMAL:E.SYNCING:E.NORMAL;case c.SOCKET_STATE.UNLAUNCHED:case c.SOCKET_STATE.PROXYBLOCK:default:return E.NORMAL}}();if(e.info=t,e.mode=function(){let e=!1;if(e=(0,_.isRegistered)(),!e&&d.Socket.state!==c.SOCKET_STATE.PROXYBLOCK)return S.QR;const t=d.Socket.hasSynced;switch(d.Socket.state){case c.SOCKET_STATE.PROXYBLOCK:return S.PROXYBLOCK;case c.SOCKET_STATE.CONFLICT:return S.CONFLICT;case c.SOCKET_STATE.TOS_BLOCK:return S.TOS_BLOCK;case c.SOCKET_STATE.SMB_TOS_BLOCK:return S.SMB_TOS_BLOCK;case c.SOCKET_STATE.DEPRECATED_VERSION:return S.DEPRECATED_VERSION;case c.SOCKET_STATE.UNLAUNCHED:return S.SYNCING;case c.SOCKET_STATE.UNPAIRED_IDLE:case c.SOCKET_STATE.UNPAIRED:return S.QR;case c.SOCKET_STATE.OPENING:if(!l.default.online&&!d.Socket.hasSynced)return S.OFFLINE;default:return t||d.Socket.stream===c.SOCKET_STREAM.CONNECTED?S.MAIN:S.SYNCING}}(),e.phoneAuthed=d.Socket.stream!==c.SOCKET_STREAM.DISCONNECTED,t===E.NORMAL)this.unobscureShiftTimer.cancel(),e.obscurity=T.HIDE;else if(t===E.OFFLINE)this.unobscureShiftTimer.cancel(),e.obscurity=T.OBSCURE;else switch(this.obscurity){case T.HIDE:this.unobscureShiftTimer.onOrBefore(18e3);break;case T.OBSCURE:this.unobscureShiftTimer.onOrBefore(3e3);break;case T.SHOW:}this.set(e)}unobscure(){this.obscurity=T.SHOW}_handlePhoneAuthedUpdate(){if(this.phoneAuthed){this.sendAvailability(!0);n(896472).RecentEmojiCollection.sync()}}_handleAvailableUpdate(){const e=this.available;__LOG__(2)`Stream:onAvailableUpdate user ${e?"available":"unavailable"}`;const t=(0,_.getScreenLockDurationInSeconds)();if(e||0===t?this.unavailableAutoLockTimer.cancel():this.unavailableAutoLockTimer.onOrBefore(1e3*t),this.sendAvailability(!1),e){const{sendDeliveryReceiptsAfterPresence:e}=n(881560);e()}else{n(935234).PresenceCollection.clearAllPresence()}}sendAvailability(e){(e||this.uiActive)&&(this.available?(0,u.sendPresenceAvailable)():(0,u.sendPresenceUnavailable)())}updateCouldForce(){this.couldForce=!this.uiActive||!this.available&&document.hidden}updateHardExpire(){p.Updater.isExpired()&&(this.hardExpired=!0,p.Updater.restart(!0))}logPageResume(){this.info===E.RESUMING&&(this.resumeCount++,new f.default.WebcPageResume({webcResumeCount:this.resumeCount}).commit())}updateWamLog(){const e=this.info===E.NORMAL;(0,h.streamInfoChange)(this.info,m.WatchedSocketModel.numSocketsAttempted,e),e&&this.stopListening(this,"change:info",this.updateWamLog)}logModeChange(){this._activeModeMeasure&&this._activeModeMeasure.end(),this.mode===S.SYNCING&&(this.lastSyncStart=P()),this._activeModeMeasure=g.startMeasure(`Stream.mode: ${this.mode}`),new f.default.WebcStreamModeChange({webcStreamMode:A(this.mode)}).commit()}}function A(e){switch(e){case S.QR:return f.default.WEBC_STREAM_MODE_CODE.QR;case S.MAIN:return f.default.WEBC_STREAM_MODE_CODE.MAIN;case S.SYNCING:return f.default.WEBC_STREAM_MODE_CODE.SYNCING;case S.OFFLINE:return f.default.WEBC_STREAM_MODE_CODE.OFFLINE;case S.CONFLICT:return f.default.WEBC_STREAM_MODE_CODE.CONFLICT;case S.PROXYBLOCK:return f.default.WEBC_STREAM_MODE_CODE.PROXYBLOCK;case S.DEPRECATED_VERSION:return f.default.WEBC_STREAM_MODE_CODE.DEPRECATED_VERSION;case S.TOS_BLOCK:case S.SMB_TOS_BLOCK:return f.default.WEBC_STREAM_MODE_CODE.TOS_BLOCK}}v.Proxy="stream";const C=new((0,o.defineModel)(v));function P(){return Math.floor(window.performance.now())}t.Stream=C},954178:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.createProductInquiry=function(e,t,n,r){const d={ack:a.ACK.CLOCK,id:new s.default({id:"product_inquiry",remote:t,fromMe:!0}),from:t,t:(0,i.unixTime)(),type:u.MSG_TYPE.PRODUCT,title:e.name,description:e.description,businessOwnerJid:t.toString({legacy:!0}),productId:e.id.toString(),url:e.url,productImageCount:e.getProductImageCollectionCount(),body:n.preview instanceof o.default?n.preview.getBase64():null,currencyCode:e.currency,priceAmount1000:e.priceAmount1000,salePriceAmount1000:(0,c.isSalePriceActive)(e)?e.salePriceAmount1000:null,sessionId:r,retailerId:e.retailerId},p=new l.Msg(d);return p.mediaData.set(n),p};var i=n(990445),a=n(402994),o=r(n(756680)),s=r(n(565754)),l=n(387191),u=n(373070),c=n(977892)},893425:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.BusinessCategoriesResultCollectionImpl=t.BusinessCategoriesResultCollection=void 0;var i=r(n(348926)),a=n(594534),o=n(630591),s=n(497334);class l extends a.BaseCollection{_find(e){return(0,i.default)((function*(){const{categories:t,notABizId:n}=yield(0,o.queryBusinessCategories)(e);return new s.BusinessCategoriesResult({id:e,categories:t,notABizId:n})}))()}}t.BusinessCategoriesResultCollectionImpl=l,l.model=s.BusinessCategoriesResult,l.staleCollection=!0;const u=new l;t.BusinessCategoriesResultCollection=u},497334:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.BusinessCategoriesResult=t.BUSINESS_CATEGORY_EMPTY_STR_ID=void 0;var i=n(54918),a=r(n(124928));t.BUSINESS_CATEGORY_EMPTY_STR_ID="__empty_query__";class o extends i.BaseModel{constructor(){super(...arguments),this.id=(0,i.prop)(),this.categories=(0,i.prop)(),this.notABizId=(0,i.prop)()}getCollection(){return n(893425).BusinessCategoriesResultCollection}}o.Proxy="BusinessCategoriesResult",o.idClass=a.default;const s=(0,i.defineModel)(o);t.BusinessCategoriesResult=s},152943:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=r(n(348926)),o=r(n(132375)),s=n(815443),l=n(594534),u=n(630591),c=r(n(162949)),d=n(895758),p=n(944878),_=n(78088),f=n(323829),h=n(628905);class g extends l.BaseCollection{_getValidCertAndSignedUserInfo(e,t,n){return(0,a.default)((function*(){if(!n&&(null==t?void 0:t.certificateChain)){const[n,r]=yield Promise.all([(0,d.getValidCertificate)((0,_.stringToCertificateString)(t.certificateChain)),(0,u.querySignedUserInfo)(e)]);if(n)return{signedUserInfo:r,validCertificate:n}}const[r,{certificateString:i,leaftCertificateCommonName:a}]=yield Promise.all([(0,u.querySignedUserInfo)(e),(0,d.fetchCertificateFullChain)(e)]);if(r.businessDomain!==a)throw new d.DCCertificateDomainMismatchError("[direct-connection] certificate common name does not match business domain");return{signedUserInfo:r,validCertificate:yield(0,d.getValidCertificate)(i)}}))()}_getCypherTypeForConversation(e,t){return(0,d.userHasSentMessageToBusiness)(e)||t?p.CypherType.PhoneNumberAndPostcode:p.CypherType.Postcode}_fetchPostcode(e,t){return(0,a.default)((function*(){var n;if("string"==typeof(null==t?void 0:t.postcode)&&!0===t.postcodeSetByUser)return{postcode:t.postcode,postcodeSetByUser:t.postcodeSetByUser,postcodeLocationName:null!==(n=t.postcodeLocationName)&&void 0!==n?n:""};const r=yield(0,d.fetchDefaultPostcode)(e);return r?(0,i.default)((0,i.default)({},r),{},{postcodeSetByUser:!1}):void 0}))()}_getCypherFromDborApi(e){var t=this;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,a.default)((function*(){const r=yield(0,s.fetchDirectConnectionKeys)(e.toJid());if(!n&&r&&t._isRowDataInGoodCondition(e,r))return{id:e,cypher:(0,p.stringToCypherString)(r.cypher),cypherExpirationTimestamp:r.cypherExpirationTimestamp,cypherType:r.cypherType,certificateChain:r.certificateChain,postcode:r.postcode,postcodeSetByUser:r.postcodeSetByUser,postcodeLocationName:r.postcodeLocationName};const a=t._getCypherTypeForConversation(e,"string"==typeof(null==r?void 0:r.postcode)&&!0===r.postcodeSetByUser),o=yield t.genNewCypher(e,a,{rowData:r,forceRenew:n});return null==o?(__LOG__(4,void 0,new Error)`[direct-connection] Cannot generate cypher`,null):(yield(0,s.createOrUpdateDirectConnectionKeys)((0,i.default)((0,i.default)({},o),{},{id:e.toJid(),cypher:(0,p.cypherStringToString)(o.cypher)})),o)}))()}_verifyPostcode(e,t){return(0,h.getJobManager)().waitUntilCompleted(f.jobSerializers.verifyPostcode(e,t))}_updateModel(e){return this.set([e])}genNewCypher(e,t,n){var r=this;let{rowData:i,forceRenew:s}=n;return(0,a.default)((function*(){const[{validCertificate:n,signedUserInfo:a},l]=yield Promise.all([r._getValidCertAndSignedUserInfo(e,i,Boolean(s)),r._fetchPostcode(e,i)]);if(null==n)return __LOG__(3)`[direct-connection] no certificate returned from the get_public_key IQ`,null;if(null==l)return __LOG__(3)`[direct-connection] Post code data could not be found`,null;const{cypher:u}=(0,o.default)(yield(0,d.getCypher)(n.chain,l.postcode,a,t),"yield getCypher(validCertificate.chain, postcodeData.postcode, signedUserInfo, cypherType)"),c=t===p.CypherType.PhoneNumberAndPostcode?a.phoneNumberSignatureExpiration:null,f=(0,_.certificateStringToString)(n.string);return{id:e,cypher:u,cypherExpirationTimestamp:c,cypherType:t,certificateChain:f,postcode:l.postcode,postcodeSetByUser:l.postcodeSetByUser,postcodeLocationName:l.postcodeLocationName}}))()}verifyAndSavePostcode(e,t){var n=this;let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,a.default)((function*(){const a=yield(0,s.fetchDirectConnectionKeys)(e.toJid()),l=p.CypherType.PhoneNumberAndPostcode,{validCertificate:u,signedUserInfo:c}=yield n._getValidCertAndSignedUserInfo(e,a,r);if(null==u)return __LOG__(3)`[direct-connection] certificate is null during verify postcode`,null;const{cypher:f,exportedAesKey:h,iv:g}=(0,o.default)(yield(0,d.getCypher)(u.chain,t,c,l),"yield getCypher(validCertificate.chain, newPostcode, signedUserInfo, newCypherType)"),m=l===p.CypherType.PhoneNumberAndPostcode?c.phoneNumberSignatureExpiration:null;let y,E;try{const t=yield n._verifyPostcode(e,f);y=t.resultCode,E=t.encryptedLocationName}catch(r){if((0,d.errorIsDirectConnectionCypherError421)(r))return n.verifyAndSavePostcode(e,t,!0);throw r}if("success"===y&&"string"==typeof E){const r=yield(0,p.decryptDataWithSymmetricKeyToString)(h,E,g),a={cypherExpirationTimestamp:m,certificateChain:(0,_.certificateStringToString)(u.string),cypherType:l,postcode:t,postcodeSetByUser:!0,postcodeLocationName:r};return yield(0,s.createOrUpdateDirectConnectionKeys)((0,i.default)({id:e.toJid(),cypher:(0,p.cypherStringToString)(f)},a)),n._updateModel((0,i.default)({id:e,cypher:f},a)),{resultCode:y,decryptedLocationName:r}}return{resultCode:y}}))()}removeCypher(e){const t=this.get(e);return t?(this.remove(t),(0,s.removeDirectConnectionKeys)(e.toJid())):Promise.resolve()}_isCypherInGoodCondition(e,t,n,r){return!(0,d.isCypherFromLaunch1)(t)&&!(0,d.isCypherExpired)(t,n)&&t===this._getCypherTypeForConversation(e,r)}_isRowDataInGoodCondition(e,t){return this._isCypherInGoodCondition(e,t.cypherType,t.cypherExpirationTimestamp,!0===t.postcodeSetByUser)}_isModelDataInGoodCondition(e,t){return this._isCypherInGoodCondition(e,t.cypherType,t.cypherExpirationTimestamp,!0===t.postcodeSetByUser)}getCypher(e){var t=this;let{forceRenew:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,a.default)((function*(){const r=n?null:t.get(e);return r&&t._isModelDataInGoodCondition(e,r)?r:[].concat(yield t.update(e,{forceRenewDirectConnection:n}))[0]}))()}_find(e){return this._getCypherFromDborApi(e)}_update(e,t){let{forceRenewDirectConnection:n}=t;return this._getCypherFromDborApi(e,n)}}g.model=c.default;var m=new g;t.default=m},162949:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(54918),a=r(n(124928));class o extends i.BaseModel{constructor(){super(...arguments),this.id=(0,i.prop)(),this.cypher=(0,i.prop)(),this.cypherExpirationTimestamp=(0,i.prop)(),this.cypherType=(0,i.prop)(),this.postcode=(0,i.prop)(),this.postcodeSetByUser=(0,i.prop)(),this.postcodeLocationName=(0,i.prop)()}}o.Proxy="business_direct_connection",o.idClass=a.default;var s=(0,i.defineModel)(o);t.default=s},895758:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DCCertificateDomainMismatchError=void 0,t.businessSupportsPostcode=function(e){var t,n;return!0===(null===(t=e.directConnection)||void 0===t?void 0:t.enabled)&&"string"==typeof(null===(n=e.directConnection.defaultPostcode)||void 0===n?void 0:n.code)},t.errorIsDirectConnectionCypherError421=function(e){return e instanceof l.ServerStatusCodeError&&421===e.statusCode},t.fetchCertificateFullChain=function(){return S.apply(this,arguments)},t.fetchDefaultPostcode=function(){return v.apply(this,arguments)},t.getCypher=function(e,t,n,r){const i=function(e,t,n){switch(e){case d.CypherType.PhoneNumberAndPostcode:return{postcode:t,phone_number:n.phoneNumber,ttl_timestamp:n.phoneNumberSignatureExpiration,phone_number_signature:n.phoneNumberSignature};case d.CypherType.Postcode:return{postcode:t}}}(r,t,n);return(0,d.genCypher)(e[0],i)},t.getValidCertificate=function(){return E.apply(this,arguments)},t.isCypherExpired=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(0,g.default)();if(e!==d.CypherType.PhoneNumberAndPostcode)return!1;if(null==t)return!0;const r=(0,g.default)(t,m),i=!(r.isValid()&&r.isAfter(n));return i},t.isCypherFromLaunch1=function(e){return!e},t.isCypherNeeded=function(){return T.apply(this,arguments)},t.timestampFormat=t.isDirectConnectionNumbersAbPropChanged=t.isDirectConnectionFlagChanged=void 0,t.userHasSentMessageToBusiness=function(e){const t=c.ChatCollection.get(e);return!!t&&t.hasMaybeSentMsgToChat()};var i=r(n(348926)),a=r(n(98017)),o=n(643930),s=r(n(132375)),l=n(984330),u=n(630591),c=n(965012),d=n(944878),p=n(263079),_=n(78088),f=n(241588),h=n(771146),g=r(n(730381));const m="YYYYMMDDTHHmmssZ";t.timestampFormat=m;class y extends((0,o.customError)("DCCertificateDomainMismatchError")){}function E(){return(E=(0,i.default)((function*(e){const t=yield(0,_.extractCertificates)(e),{result:n}=yield(0,_.validateCertificates)(t.slice(1,-1),t.slice(-1));return n?{string:e,chain:t}:null}))).apply(this,arguments)}function S(){return(S=(0,i.default)((function*(e){var t;const[{certificate:n},r]=yield Promise.all([(0,u.queryBusinessPublicKey)(e),(0,_.fetchFromCABundle)()]);if(null==n)throw new Error("[direct-connection] no certificate returned from the get_public_key IQ");const i=yield(0,_.extractCertificates)(n),a=i.length>0?null===(t=i[0].subject.typesAndValues.find((e=>"2.5.4.3"===e.type)))||void 0===t?void 0:t.value.valueBlock.value:null,o=(0,s.default)(yield(0,_.genRootIssuers)(i,r),"yield genRootIssuers(extractedCertificate, caBundle)");return{certificateString:(0,_.encodeToString)([...i,...o]),leaftCertificateCommonName:a}}))).apply(this,arguments)}function T(){return(T=(0,i.default)((function*(e){var t;const r=n(69108).BusinessProfileCollection;return Boolean((0,p.supportsDirectConnection)()&&null!=c.ChatCollection.get(e)&&(null===(t=yield r.find(e))||void 0===t?void 0:t.isBusinessDirectConnection()))}))).apply(this,arguments)}function v(){return(v=(0,i.default)((function*(e){var t;const r=n(69108).BusinessProfileCollection,i=yield r.find(e);if((null===(t=i.directConnection)||void 0===t?void 0:t.enabled)&&i.directConnection.defaultPostcode)return{postcode:i.directConnection.defaultPostcode.code,postcodeLocationName:i.directConnection.defaultPostcode.locationName}}))).apply(this,arguments)}t.DCCertificateDomainMismatchError=y;t.isDirectConnectionFlagChanged=(e,t)=>{if(e===f.UNINITIALIZED_VALUE_WEB_BIZ_PROFILE_OPTIONS)return!1;return((0,h.getBusinessProfileQueryVersionWithCustomBizProfileOptions)(e)&h.DIRECT_CONNECTION_FLAG)>0!==((0,h.getBusinessProfileQueryVersionWithCustomBizProfileOptions)(t)&h.DIRECT_CONNECTION_FLAG)>0};t.isDirectConnectionNumbersAbPropChanged=(e,t)=>null!=e&&!(0,a.default)(e,t)},69108:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.CATALOG_EXISTS=t.BusinessProfileCollectionImpl=t.BusinessProfileCollection=void 0;var i=r(n(81109)),a=r(n(348926)),o=n(183660),s=n(594534),l=n(630591),u=n(72696),c=n(895758),d=n(941881),p=n(85663),_=n(780549),f=n(121977),h=n(263079),g=n(241588),m=n(669050);t.CATALOG_EXISTS="catalog_exists";class y extends s.BaseCollection{constructor(){super(),this.listenTo(g.ServerProps,"change:webBizProfileOptions",((e,t,n)=>{(0,c.isDirectConnectionFlagChanged)(n,t)&&(__LOG__(2)`[direct-connection] change in direct connection bit detected. marking relevant biz profiles from abprop numbers as stale`,this._markBizProfilesAsStale((0,h.directConnectionBusinessNumbersFromAbprop)()))}));let e=(0,o.isABPropsAfterFirstSync)()?(0,h.directConnectionBusinessNumbersFromAbprop)():null;this.listenTo(_.Cmd,"on_ab_props_update",(()=>{try{const n=(0,h.directConnectionBusinessNumbersFromAbprop)();var t;if((0,c.isDirectConnectionNumbersAbPropChanged)(e,n))this._markBizProfilesAsStale(Array.from(new Set((null!==(t=e)&&void 0!==t?t:[]).concat(n))));e=n}catch(e){__LOG__(4,!0,new Error,!0)`[direct-connection] Failed to force update biz profiles on abprop biz numbers change`,SEND_LOGS("direct-connection-biz-number-abprop-sync-fail"+e)}}))}_find(e){return this._findAndParse(e,{queryCatalog:!0})}_update(e,t){return this._findAndParse(e,{queryCatalog:!1,getMerchantCompliance:null==t?void 0:t.getMerchantCompliance})}_findAndParse(e,t){var n=this;let{queryCatalog:r,getMerchantCompliance:o}=t;return(0,a.default)((function*(){const t=n.gadd(e);if(!t.id.isUser())return __LOG__(2)`Store:BusinessProfile:find businessProfile is only available to users (${String(e)})`,Promise.resolve({id:e});let a,s=null;const c=(0,l.queryBusinessProfile)([{wid:t.id,tag:t.tag}],o);if((0,u.isCustomURLViaBizProfileEnabled)())a=yield c;else{const[e,n]=yield Promise.all([c,(0,l.queryCustomUrlPaths)(t.id).catch((e=>{404!==e.statusCode&&(__LOG__(4,void 0,new Error,!0)`Error retrieving custom url ${e.message}`,SEND_LOGS("custom-url-get-error"))}))]);a=e,null!=(null==n?void 0:n.paths)&&(s=n.paths)}if(!Array.isArray(a))return __LOG__(3)`Received invalid business profile response`,null;if(0===a.length)return __LOG__(2)`Store:BusinessProfile:find No businessProfile found for ${String(e)}`,{id:e};const d=a[0],{wid:_,tag:h}=d,g={id:_,tag:h},{profile:m}=d;if(m){const t=f.ContactCollection.get(e);return t&&!t.isContactSyncCompleted&&(t.set("isBusiness",!0),t.set("forcedBusinessUpdateFromServer",!0)),(0,i.default)((0,i.default)({},(0,p.parseBusinessProfile)({id:d.wid,profile:m,queryCatalog:r,customUrlPaths:s})),g)}return g}))()}fetchBizProfile(e){const t=this.get(e);return t&&t.markStale(),this.find(e)}onResume(){this.filter((e=>e.stale&&e.hasObservers())).map((e=>this.find(e.id)))}getValid(e){const t=this.get(e);if(null==t?void 0:t.isValid())return t}markProfileAsStale(e){var t;null===(t=this.get(e))||void 0===t||t.markStale()}hasBusinessProfileInCache(e){return!!this.get(e)}_markBizProfilesAsStale(e){var t=this;return(0,a.default)((function*(){yield Promise.all(e.map((e=>(0,m.createUserWid)(e))).filter((e=>t.hasBusinessProfileInCache(e))).map((e=>{__LOG__(2)`[direct-connection] forcefully marking biz profile as stale`,t.markProfileAsStale(e)})))}))()}}t.BusinessProfileCollectionImpl=y,y.model=d.BusinessProfile,y.staleCollection=!0;const E=new y;t.BusinessProfileCollection=E},941881:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_BUSINESS_CATEGORIES=t.DEFAULTS=t.BusinessProfile=t.BUSINESS_URL_DOMAIN=void 0;var i=n(54918),a=n(72696),o=r(n(124928));const s="wa.me/";t.BUSINESS_URL_DOMAIN=s;t.MAX_BUSINESS_CATEGORIES=3;class l extends i.BaseModel{constructor(){super(...arguments),this.id=(0,i.prop)(),this.tag=(0,i.prop)(),this.description=(0,i.prop)(),this.categories=(0,i.prop)(),this.profileOptions=(0,i.prop)(),this.email=(0,i.prop)(),this.website=(0,i.prop)(),this.latitude=(0,i.prop)(),this.longitude=(0,i.prop)(),this.businessHours=(0,i.prop)(),this.catalogStatus=(0,i.prop)(),this.address=(0,i.prop)(),this.structuredAddress=(0,i.prop)(),this.legalEntityDetails=(0,i.prop)(),this.fbPage=(0,i.prop)(),this.igProfessional=(0,i.prop)(),this.isProfileLinked=(0,i.prop)(),this.directConnection=(0,i.prop)(),this.customUrlPaths=(0,i.prop)(),this.customUrlPath=(0,i.prop)(),this.customUrl=(0,i.derived)((function(){var e;let t;if((0,a.isCustomURLViaBizProfileEnabled)()&&null!=this.customUrlPath)t=this.customUrlPath;else{if(!(this.customUrlPaths&&(null===(e=this.customUrlPaths)||void 0===e?void 0:e.length)>0))return null;t=this.customUrlPaths[0]}return`wa.me/${t}`}),["customUrlPaths","customUrlPath"]),this.coverPhoto=(0,i.prop)(),this.stale=(0,i.session)(!0)}markStale(){this.stale=!0,this.hasObservers()&&this.getCollection().find(this.id)}getCollection(){return n(69108).BusinessProfileCollection}isValid(){return Array.isArray(this.categories)}isBusinessDirectConnection(){var e,t,n,r;return null!==(e=null!==(t=null===(n=this.directConnection)||void 0===n?void 0:n.enabled)&&void 0!==t?t:null===(r=this.profileOptions)||void 0===r?void 0:r.directConnection)&&void 0!==e&&e}}l.Proxy="businessProfile",l.idClass=o.default;const u=(0,i.defineModel)(l);t.BusinessProfile=u;t.DEFAULTS={description:null,email:null,website:null}},85663:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.CATALOG_EXISTS=t.BUSINESS_OPEN_STATUS=void 0,t.getBusinessOpenState=A,t.parseBusinessProfile=t.isShopBanned=t.isCompleteBizProfile=t.hasShop=t.hasCatalog=t.goToShop=t.goToCommerceManager=void 0,t.quickReplyHoursStr=function(e){const t=function(e){switch(A(e).status){case v.OPEN_24H:case v.OPEN_APPOINTMENT:case v.OPEN:return!0;case v.CLOSED:case v.CLOSED_TODAY:default:return!1}}(e)?f.fbt._("We're currently *open*",null,{hk:"1Skaff"}):f.fbt._("We're currently *closed*",null,{hk:"18eiaZ"}),n=f.fbt._("Our business hours are:",null,{hk:"Qljt"}),r=(0,_.getBusinessHours)(e,!0).map((e=>`${(0,o.default)(e.day)}: ${e.hours}`)).join("\n");return[t,n,r].join("\n")};var i=r(n(81109)),a=r(n(506479)),o=r(n(854251)),s=n(941881),l=n(817649),u=n(644130),c=n(121977),d=r(n(524173)),p=n(241588),_=n(199666),f=n(548360);const h=["business_hours","catalog_status","structured_address","profile_options","address","legal_entity_details","fb_page","ig_professional","profile_is_linked","cover_photo","custom_url"],g="catalog_exists";t.CATALOG_EXISTS=g;const m=e=>{var t;return(null==e||null===(t=e.profile_options)||void 0===t?void 0:t.commerce_experience)===l.COMMERCE_EXPERIENCE_TYPES.CATALOG||(null==e?void 0:e.catalog_status)===g};t.hasCatalog=e=>{var t;return e&&e instanceof s.BusinessProfile?(null===(t=e.profileOptions)||void 0===t?void 0:t.commerceExperience)===l.COMMERCE_EXPERIENCE_TYPES.CATALOG||e.catalogStatus===g:m(e)};const y=e=>{var t,n;return(null==e||null===(t=e.profileOptions)||void 0===t?void 0:t.commerceExperience)===l.COMMERCE_EXPERIENCE_TYPES.SHOP&&Boolean(null==e||null===(n=e.profileOptions)||void 0===n?void 0:n.shopURL)};t.hasShop=y;t.isShopBanned=e=>{var t,n;return(null==e||null===(t=e.profileOptions)||void 0===t?void 0:t.commerceExperience)===l.COMMERCE_EXPERIENCE_TYPES.NONE||y(e)&&!!(null==e||null===(n=e.profileOptions)||void 0===n?void 0:n.isBanned)};t.goToShop=e=>{var t;const n=null==e||null===(t=e.profileOptions)||void 0===t?void 0:t.shopURL;n&&d.default.open(n)};t.goToCommerceManager=e=>{var t;const n=null==e||null===(t=e.profileOptions)||void 0===t?void 0:t.commerceManagerURL;d.default.open(n||"https://business.facebook.com/commerce_manager/")};const E=e=>m(e)||p.ServerProps.shopsProductGrid&&(e=>{var t,n;return(null==e||null===(t=e.profile_options)||void 0===t?void 0:t.commerce_experience)===l.COMMERCE_EXPERIENCE_TYPES.SHOP&&Boolean(null==e||null===(n=e.profile_options)||void 0===n?void 0:n.shop_url)})(e),S=e=>{let{email:t,landline_number:n,mobile_number:r}=e;const i={email:t};return n&&(i.landlineNumber=n),r&&(i.mobileNumber=r),i},T=e=>{let{entity_name:t,entity_type:n,is_registered:r,entity_type_custom:i,customer_care_details:a,grievance_officer_details:o}=e;const s={entityName:t,entityType:n,isRegistered:r};return i&&(s.entityTypeCustom=i),a&&(s.customerCareDetails=(e=>{let{email:t,landline_number:n,mobile_number:r}=e;return S({email:t,landline_number:n,mobile_number:r})})(a)),o&&(s.grievanceOfficerDetails=(e=>{let{name:t,email:n,landline_number:r,mobile_number:i}=e;const a=S({email:n,landline_number:r,mobile_number:i});return a.name=t,a})(o)),s};t.parseBusinessProfile=e=>{let{profile:t,id:n,queryCatalog:r,customUrlPaths:o}=e;if(!t)return{id:n};const{business_hours:d,catalog_status:p,structured_address:_,profile_options:f,address:g,legal_entity_details:m,fb_page:y,ig_professional:S,profile_is_linked:v,cover_photo:A,custom_url:C}=t,P=(0,a.default)(t,h),O={};return O.businessHours=d?(e=>{let{config:t,timezone:n}=e;const r={};return t.forEach((e=>{const{day_of_week:t,mode:n}=e;if(n===l.BUSINESS_HOUR_MODES.SPECIFIC_HOURS){const{open_time:i,close_time:a}=e;r[t]||(r[t]={mode:n,hours:[]}),null!=i&&null!=a&&r[t].hours&&r[t].hours.push([i,a])}else r[t]={mode:n}})),{config:r,timezone:n}})(d):null,f&&(O.profileOptions={},O.profileOptions.commerceExperience=f.commerce_experience,O.profileOptions.cartEnabled=f.cart_enabled,O.profileOptions.directConnection=f.direct_connection,null!=f.shop_url&&(O.profileOptions.shopURL=f.shop_url),null!=f.commerce_manager_url&&(O.profileOptions.commerceManagerURL=f.commerce_manager_url),null!=f.is_banned&&(O.profileOptions.isBanned=f.is_banned)),E(t)&&(O.catalogStatus=p,r&&u.CatalogCollection.findCarouselCatalog(n).then((e=>{const t=Array.isArray(e)?e[0]:e,r=c.ContactCollection.get(n);r&&(r.businessCatalog=t)})).catch((()=>__LOG__(3)`Store:BusinessProfile:missing catalog`))),_?O.structuredAddress={streetAddress:_.street_address,cityId:_.city_id,localizedCityName:_.localized_city_name,zipCode:_.zip_code}:O.address=g||null,m&&(O.legalEntityDetails=T(m)),y&&(O.fbPage={displayName:y.display_name,likes:y.likes,id:y.id}),S&&(O.igProfessional={handle:S.ig_handle,followers:S.followers}),null!=v&&(O.isProfileLinked=!!v),null!=o&&(O.customUrlPaths=o),null!=C&&(O.customUrlPath=C),O.coverPhoto=null!=A?{id:A.id,url:A.url}:null,(0,i.default)((0,i.default)((0,i.default)((0,i.default)({},s.DEFAULTS),P),O),{},{id:n})};t.isCompleteBizProfile=e=>{var t,n;return null!=e.address&&null!=e.description&&null!=(null===(t=e.businessHours)||void 0===t?void 0:t.config)&&0!==Object.keys(e.businessHours.config).length&&null!=e.email&&0!==(null===(n=e.website)||void 0===n?void 0:n.length)};const v={OPEN:"open",CLOSED:"closed",OPEN_TODAY:"open_today",CLOSED_TODAY:"closed_today",OPEN_APPOINTMENT:"open_appointment",OPEN_24H:"open_24h",UNKNOWN:"unknown"};function A(e,t){var n,r;if(null==e.timezone)return{status:"unknown"};const i=t||new Date,a=new Date(i.toLocaleString("en-US",{timeZone:e.timezone})),o=(i.getTime()-a.getTime())/1e3/60,s=e.config[l.DAYS_OF_WEEK[i.getDay()]];if(!s)return{status:v.CLOSED_TODAY};switch(s.mode){case l.BUSINESS_HOUR_MODES.OPEN_24H:if(s)return{status:v.OPEN_24H};break;case l.BUSINESS_HOUR_MODES.APPOINTMENT_ONLY:if(s)return{status:v.OPEN_APPOINTMENT};break;case l.BUSINESS_HOUR_MODES.SPECIFIC_HOURS:const e=60*i.getHours()+i.getMinutes();if(1===(null===(n=s.hours)||void 0===n?void 0:n.length)){const t=s.hours[0][0],n=s.hours[0][1];return e>=t&&e<=n?{status:v.OPEN,openUntil:C(o+n)}:e<=t?{status:v.CLOSED,opensAt:C(o+t)}:{status:v.CLOSED}}if(2===(null===(r=s.hours)||void 0===r?void 0:r.length)){const t=s.hours[0][0],n=s.hours[0][1],r=s.hours[1][0],i=s.hours[1][1];return e>=t&&e<=n?{status:v.OPEN,openUntil:C(o+n),additionalOpen:C(o+r),additionalClose:C(o+i)}:e<t?{status:v.CLOSED,opensAt:C(o+t),additionalOpen:C(o+r),additionalClose:C(o+i)}:e>=r&&e<=i?{status:v.OPEN,openUntil:C(o+i)}:e<r?{status:v.CLOSED,opensAt:C(o+r)}:{status:v.CLOSED}}}return{status:"unknown"}}function C(e){const t=new Date,n=Math.floor(e/60);return t.setHours(n),t.setMinutes(e%60),t.setSeconds(0),t}t.BUSINESS_OPEN_STATUS=v},64609:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ButtonCollection=void 0;var i=n(594534),a=r(n(906787));class o extends i.BaseCollection{}t.ButtonCollection=o,o.model=a.default},906787:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(54918);class i extends r.BaseModel{constructor(){super(...arguments),this.id=(0,r.prop)(),this.displayText=(0,r.prop)(),this.selected=(0,r.session)(!1)}}i.Proxy="replyButton";var a=(0,r.defineModel)(i);t.default=a},750871:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(594534),i=n(387191);class a extends r.BaseCollection{constructor(){super(...arguments),this.hasProductBefore=!0}delete(){super.delete(),this.stopListening(),this.reset()}queryProducts(e){const t=e.msgs;this.hasProductBefore=!1;const n=t.filter((e=>null!=e.asProduct));return 0===n.length?this.trigger("products_loaded"):this.add(n,{at:0}),Promise.resolve()}}t.default=a,a.model=i.Msg,a.comparator=(e,t)=>e.t-t.t},283667:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(594534),a=r(n(399383));class o extends i.BaseCollection{}t.default=o,o.model=a.default},399383:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(54918),a=r(n(565754));class o extends i.BaseModel{constructor(){super(...arguments),this.id=(0,i.prop)(),this.unsyncedButtonReplies=(0,i.prop)()}}o.Proxy="msgButtonReplyMsg",o.idClass=a.default;var s=(0,i.defineModel)(o);t.default=s},154685:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.TemplateButtonCollection=void 0;var i=n(594534),a=r(n(439888));class o extends i.BaseCollection{}t.TemplateButtonCollection=o,o.model=a.default,o.comparator=(e,t)=>e.id<t.id?-1:e.id>t.id?1:0},439888:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(54918);class i extends r.BaseModel{constructor(){super(...arguments),this.id=(0,r.prop)(),this.displayText=(0,r.prop)(),this.subtype=(0,r.prop)(),this.url=(0,r.prop)(),this.phoneNumber=(0,r.prop)(),this.selectionId=(0,r.prop)(),this.selected=(0,r.session)(!1)}}i.Proxy="templateButton";var a=(0,r.defineModel)(i);t.default=a},371719:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(594534),i=n(387191);class a extends r.BaseCollection{}t.default=a,a.model=i.Msg,a.comparator=function(e,t){return t.t-e.t}},268392:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AgentCollection=void 0;var r=n(61314),i=n(98671),a=n(314350),o=n(594534),s=n(266888);class l extends o.BaseCollection{constructor(){super(),this._agentsByDeviceId=new Map,this.triggerDeviceIdMapUpdate=()=>{this._agentsByDeviceId=new Map,this.getModelsArray().forEach((e=>{this._agentsByDeviceId.set(e.deviceId,e)}))},this.on("remove reset",this.triggerDeviceIdMapUpdate),s.Conn.on("change:pushname",(()=>{const e=this.getModelsArray().filter((e=>e.deviceId===a.PRIMARY_DEVICE_ID))[0];null!=e&&e.set("name",(0,a.getFormattedAgentNameForAgent)(e))}))}add(e,t){const n=super.add(e,t);return this.triggerDeviceIdMapUpdate(),(0,r.checkOrphanAgents)(n.map((e=>{var t;return null!==(t=null==e?void 0:e.id)&&void 0!==t?t:""}))),n}getByDeviceId(e){return this._agentsByDeviceId.get(e)}initializeFromCache(e){this.add(e,{merge:!0})}}l.model=i.Agent;const u=new l;t.AgentCollection=u},98671:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Agent=void 0;var r=n(54918);class i extends r.BaseModel{constructor(){super(...arguments),this.id=(0,r.prop)(),this.deviceId=(0,r.prop)(),this.name=(0,r.prop)(),this.isDeleted=(0,r.prop)(!1)}getCollection(){return n(268392).AgentCollection}}i.Proxy="agent";const a=(0,r.defineModel)(i);t.Agent=a},314350:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PRIMARY_DEVICE_ID=void 0,t.canUserSeeMessageAttribution=function(){return(0,r.isMultiDeviceMessageAttributionEnabled)()&&(0,a.isFeatureFlagEnabled)("MD_EXTENSION")},t.getFormattedAgentName=s,t.getFormattedAgentNameForAgent=function(e){return s(e.name,e.deviceId)};n(98671);var r=n(72696),i=n(266888),a=n(978751),o=n(548360);function s(e,t){return 0===t?o.fbt._("{business-name} (Admin)",[o.fbt._param("business-name",i.Conn.pushname)],{hk:"3KT4id"}).toString():e}t.PRIMARY_DEVICE_ID=0},375672:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnattributedMessageCollection=void 0;var r=n(154549),i=n(594534),a=n(634418),o=n(94872);class s extends i.BaseCollection{}s.model=a.UnattributedMessage,s.cachePolicy={id:o.COLLECTIONS_KEYS.UNATTRIBUTED_MESSAGE_COLLECTION,policy:r.CACHE_POLICY.LOAD,delay:1e3};const l=new s;t.UnattributedMessageCollection=l},634418:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnattributedMessage=void 0;var r=n(54918);class i extends r.BaseModel{constructor(){super(...arguments),this.id=(0,r.prop)(),this.deviceId=(0,r.prop)()}getCollection(){return n(375672).UnattributedMessageCollection}}i.Proxy="unattributed_message";const a=(0,r.defineModel)(i);t.UnattributedMessage=a},978751:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t._reset=function(){c=!1,u.clear(),l.clear()},t._sortSubscriptions=y,t.getFeatureFlagState=_,t.initialize=function(){return p.apply(this,arguments)},t.isFeatureFlagEnabled=f,t.isInitializedAndFeatureFlagEnabled=function(e){return!!c&&f(e)},t.listen=function(e,t){if(!(0,a.isSmbOrangeEnabled)())return Promise.resolve().then((()=>t(null,!1))),()=>{};let n=l.get(e);n||(n=new Set,l.set(e,n));n.add(t),c&&Promise.resolve().then((()=>{const n=u.get(e);try{t((null==n?void 0:n.subscription)||null,(null==n?void 0:n.hasChanged)||!1)}catch(t){__LOG__(4,void 0,new Error,!0)`PremiumAccessEngine: error calling handler during listen for feature ${e}, error ${t}`,SEND_LOGS("PremiumAccessEngine")}}));return()=>{const n=l.get(e);n&&n.delete(t)}},t.update=function(){if((0,a.isSmbOrangeEnabled)()){if(!c)throw Error("Premium access engine update() called before initialize()");const e=g(),t=new Set;u.forEach(((n,r)=>{if(e.has(r)){var i,a;const t=null===(i=e.get(r))||void 0===i?void 0:i[0];(null===(a=n.subscription)||void 0===a?void 0:a.equal(t))?n.hasChanged&&(n.hasChanged=!1,h(r)):(n.hasChanged=!0,n.subscription=null==t?void 0:t.clone(),h(r))}else n.hasChanged=!0,n.subscription=null,h(r),t.add(r)})),e.forEach(((e,t)=>{u.has(t)||(u.set(t,{hasChanged:!0,subscription:e[0].clone()}),h(t))})),t.forEach((e=>u.delete(e)))}};var i=r(n(348926)),a=n(72696),o=n(808469);let s="{}";const l=new Map,u=new Map;let c=!1,d=null;function p(){return(p=(0,i.default)((function*(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;if(!c&&(0,a.isSmbOrangeEnabled)()){const{restoreSubscriptions:t}=n(565804);yield t(),d=m(e);g().forEach(((e,t)=>{u.set(t,{subscription:e[0].clone(),hasChanged:!1})})),c=!0,yield Promise.resolve(),l.forEach(((e,t)=>{const n=u.get(t);e.forEach((e=>{try{e((null==n?void 0:n.subscription)||null,(null==n?void 0:n.hasChanged)||!1)}catch(e){__LOG__(4,void 0,new Error,!0)`PremiumAccessEngine: error calling handler during initialize for feature ${t}, error ${e}`,SEND_LOGS("PremiumAccessEngine")}}))}))}}))).apply(this,arguments)}function _(e){var t,n;if(!(0,a.isSmbOrangeEnabled)())return null;if(!c)throw Error(`Premium access engine getFeatureFlagState() for feature ${e} called before initialize()`);return null!==(t=null===(n=u.get(e))||void 0===n?void 0:n.subscription)&&void 0!==t?t:null}function f(e){let t;try{t=_(e)}catch(t){__LOG__(4,void 0,new Error,!0)`isFeatureFlagEnabled: trying to read feature "${e}" before PremiumAccessEngine has been initialized, error ${t}`,SEND_LOGS("isFeatureFlagEnabled")}return null!=t&&(!t.isDeactivated||!1)}function h(e){const t=l.get(e),n=u.get(e);t&&n&&t.forEach((t=>{Promise.resolve().then((()=>{t(n.subscription,n.hasChanged)})).catch((t=>{__LOG__(4,void 0,new Error,!0)`PremiumAccessEngine: error calling handler for feature ${e}, error ${t}`,SEND_LOGS("PremiumAccessEngine")}))}))}function g(){const e=new Map;return d&&Object.entries(d).forEach((t=>{let[n,r]=t;const i=n;r.forEach((t=>{const n=o.SubscriptionCollection.get(t);if(n){let t=e.get(i);t||(t=[],e.set(i,t)),t.push(n)}}))})),e.forEach(((t,n)=>{const r=y(t);e.set(n,r)})),e}function m(e){let t=!1;const n=JSON.parse(e),r=Object.keys(n);return r.length>0?r.forEach((e=>{const r=n[e];Array.isArray(r)||(t=!0,__LOG__(4,void 0,new Error,!0)`PremiumAccessEngine: invalid config for key ${e}, value is not an array`,SEND_LOGS("PremiumAccessEngine")),0===r.length&&(t=!0,__LOG__(4,void 0,new Error,!0)`PremiumAccessEngine: invalid config for key ${e}, value is empty array`,SEND_LOGS("PremiumAccessEngine"))})):t=!0,t?null:n}function y(e){return e.sort(((e,t)=>e.isDeactivated&&!t.isDeactivated?1:!e.isDeactivated&&t.isDeactivated?-1:e.isDeactivated&&t.isDeactivated?0:e.isAutoRenewing&&!t.isAutoRenewing?-1:t.isAutoRenewing&&!e.isAutoRenewing?1:e.isAutoRenewing||t.isAutoRenewing?0:(t.expirationDate||0)-(e.expirationDate||0))),e}},808469:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionCollection=void 0;var r=n(594534),i=n(245716);class a extends r.BaseCollection{initializeFromCache(e){this.add(e,{merge:!0})}}a.model=i.Subscription;const o=new a;t.SubscriptionCollection=o},245716:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Subscription=void 0;var i=r(n(766678)),a=n(54918);class o extends a.BaseModel{constructor(){super(...arguments),this.id=(0,a.prop)(),this.isDeactivated=(0,a.prop)(!1),this.isAutoRenewing=(0,a.prop)(!1),this.expirationDate=(0,a.prop)()}equal(e){return!!e&&(e.id===this.id&&e.isAutoRenewing===this.isAutoRenewing&&e.isDeactivated===this.isDeactivated&&e.expirationDate===this.expirationDate)}clone(){return(0,i.default)(this)}}o.Proxy="subscription";const s=(0,a.defineModel)(o);t.Subscription=s},308084:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.CartCollectionImpl=t.CartCollection=void 0;var i=n(154549),a=n(594534),o=r(n(587521)),s=n(94872);class l extends a.BaseCollection{constructor(e,t){super(),this.imageWidth=100,this.imageHeight=100,null!=e&&(this.imageWidth=e),null!=t&&(this.imageHeight=t)}initializeFromCache(e){try{(e||[]).forEach((e=>{const t=new o.default({id:e.id,itemCount:e.itemCount,total:e.total,currency:e.currency,message:e.message});t.cartItemCollection.add(e.products),this.add(t,{merge:!0})}))}catch(e){__LOG__(3)`Error while restoring carts from cache, ${String(e)}`}}findCart(e){return this.gadd(e)}}t.CartCollectionImpl=l,l.model=o.default,l.cachePolicy={id:s.COLLECTIONS_KEYS.CART_COLLECTION,policy:i.CACHE_POLICY.LOAD,delay:2e3};const u=new l;t.CartCollection=u},668768:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CartItemCollection=void 0;var r=n(594534),i=n(514587);class a extends r.BaseCollection{}t.CartItemCollection=a,a.model=i.CartItem},514587:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CartItem=void 0;var r=n(54918);class i extends r.BaseModel{constructor(){super(...arguments),this.id=(0,r.prop)(),this.priceAmount1000=(0,r.prop)(),this.currency=(0,r.prop)(),this.name=(0,r.prop)(),this.quantity=(0,r.prop)(),this.imageHash=(0,r.prop)(),this.imageCdnUrl=(0,r.prop)(),this.maxAvailable=(0,r.prop)()}getCollection(){return n(308084).CartCollection}}i.Proxy="cart-item";const a=(0,r.defineModel)(i);t.CartItem=a},587521:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(54918),i=n(668768);class a extends r.BaseModel{constructor(){super(...arguments),this.id=(0,r.prop)(),this.products=(0,r.prop)(),this.itemCount=(0,r.prop)(),this.total=(0,r.prop)(),this.currency=(0,r.prop)(),this.message=(0,r.prop)()}countTotals(){const e=this.cartItemCollection.reduce(((e,t)=>{var n;return e.currency.add(t.currency),{itemCount:e.itemCount+t.quantity,total:e.total+t.quantity*(null!==(n=t.priceAmount1000)&&void 0!==n?n:0),currency:e.currency}}),{itemCount:0,total:0,currency:new Set}),t=1===e.currency.size,n={itemCount:e.itemCount,total:t?e.total:null,currency:t?e.currency.values().next().value:null};this.set(n,{silent:!0})}initialize(){super.initialize(),this.cartItemCollection=new i.CartItemCollection,this.listenTo(this,"change:cartItemCollection",this.countTotals)}getCollection(){return n(308084).CartCollection}}a.Proxy="cart";var o=(0,r.defineModel)(a);t.default=o},69374:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AssignedAgentsCollection=void 0;var r=n(98671),i=n(594534);class a extends i.BaseCollection{}t.AssignedAgentsCollection=a,a.model=r.Agent},387202:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatAssignmentCollection=void 0;var r=n(268392),i=(n(98671),n(69374)),a=n(594534),o=n(561397),s=n(669050);class l extends a.BaseCollection{constructor(){super(),this._chatUnopenedStatus=new Map,this._agentChatAssignmentCollections=new Map,this._pendingInitializations=[],this.listenTo(this,"add",this._handleAdd),this.listenTo(this,"remove",this._handleRemove),this.listenTo(this,"change",this._handleChange),this.listenTo(r.AgentCollection,"add",this._handleAgentAdd)}_handleAdd(e){this._chatUnopenedStatus.set(e.chatId,!e.chatOpenedByAgent);const t=this.getAgentCollectionForChatId((0,s.createWid)(e.chatId));if(null==e.agent){const t=r.AgentCollection.get(e.agentId);null!=t?e.agent=t:(__LOG__(3,void 0,void 0,!0)`chat_assignment_collection:_handleAdd failed`,SEND_LOGS("chat_assignment_collection:_handleAdd: attempted to add assignment without agent"))}null!=e.agent&&t.add(e.agent)}_handleRemove(e){const t=this._agentChatAssignmentCollections.get(e.chatId);t&&t.remove(e.agent),this._chatUnopenedStatus.delete(e.chatId)}_handleChange(e){this._chatUnopenedStatus.set(e.chatId,!e.chatOpenedByAgent),this.getAgentCollectionForChatId((0,s.createWid)(e.chatId)).trigger("change",[])}_handleAgentAdd(e){const t=this._pendingInitializations.filter((t=>t.agentId===e.id));this.processChatAssignments(t)}_handleAgentRemove(e){this.getModelsArray().forEach((t=>{t.agent===e&&this.remove(t.id)}))}processChatAssignments(e){const t=[];e.forEach((e=>{var n;const i=r.AgentCollection.get(e.agentId);var a;(null===(n=this.get(e.id))||void 0===n?void 0:n.agent.id)===e.agentId?null===(a=this.get(e.id))||void 0===a||a.set({chatOpenedByAgent:e.chatOpenedByAgent}):i&&!i.isDeleted?t.push(new o.ChatAssignment({id:e.id,chatId:e.chatId,chatOpenedByAgent:e.chatOpenedByAgent,agent:i})):this._pendingInitializations.push(e)})),this.add(t,{merge:!0})}setChatUnopenedStatus(e,t){this._chatUnopenedStatus.set(e,t)}clearChatUnopenedState(e,t){this.getModelsArray().filter((n=>n.chatId===e&&n.agent.deviceId===t)).forEach((e=>e.set("chatOpenedByAgent",!0)))}getChatUnopenedStatus(e){return!!this._chatUnopenedStatus.get(e.toString({legacy:!0}))}reset(){this._agentChatAssignmentCollections.forEach((e=>{e.reset()})),super.reset()}getAgentCollectionForChatId(e){let t=this._agentChatAssignmentCollections.get(e.toString({legacy:!0}));return t||(t=new i.AssignedAgentsCollection,this._agentChatAssignmentCollections.set(e.toString({legacy:!0}),t)),t}initializeFromCache(e){this.processChatAssignments(e)}}l.model=o.ChatAssignment;const u=new l;t.ChatAssignmentCollection=u},561397:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChatAssignment=void 0;n(98671);var r=n(54918);class i extends r.BaseModel{constructor(){super(...arguments),this.id=(0,r.prop)(),this.chatId=(0,r.prop)(),this.agent=(0,r.prop)(),this.agentId=(0,r.prop)(),this.chatOpenedByAgent=(0,r.prop)()}getCollection(){return n(387202).ChatAssignmentCollection}}i.Proxy="chat_assignment";const a=(0,r.defineModel)(i);t.ChatAssignment=a},319266:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canAssignChats=function(){return(0,r.chatAssignmentEnabled)()&&(0,i.isInitializedAndFeatureFlagEnabled)("MD_EXTENSION")};var r=n(72696),i=n(978751)},478353:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.LabelCollectionImpl=t.LabelCollection=void 0;var i=r(n(82729)),a=n(328620),o=n(594534),s=n(454794),l=n(388536),u=n(266888),c=r(n(932325)),d=n(501632),p=n(275261),_=n(294715),f=n(390737),h=n(757453),g=n(149159),m=n(548360),y=n(785893);class E extends o.BaseCollection{constructor(){super(),this.listenTo(this,"remove",this.handleRemove)}initializeAssociationsFromCache(e){e.forEach((e=>{let{labelId:t,associationId:n,type:r}=e;(0,l.addToLabelCollection)(n,[t],r===_.LabelAssociationType.Jid?s.LabelItemParentType.Chat:s.LabelItemParentType.Msg)}))}addNewLabel(){throw new Error("This call is only supported in non-MD mode")}removeAllLabelsMD(e){return this.addOrRemoveLabelsMD((e.labels||[]).map((e=>({type:"remove",id:e}))),[e])}addOrRemoveLabelsMD(e,t){e.forEach((e=>{let{id:n,type:r}=e;t.forEach((e=>{const t=(0,l.getParentTypeFromModel)(e),i=e.id.toString();"add"===r?(0,l.addToLabelCollection)(i,[n],t):(0,l.removeLabelFromCollection)(i,n,t)}))}))}addOrRemoveLabels(e,t){const n=(0,a.genId)(),r=new a.ActionType(c.default.t(5,{count:e.length,_plural:e.length})),i=(0,g.editLabelAssociation)(e,t).then((()=>{this.addOrRemoveLabelsMD(e,t)})).then((()=>new a.ActionType(c.default.t(7,{count:e.length,_plural:e.length})))).catch((()=>(__LOG__(3)`addingNewLabel dropped`,new a.ActionType(c.default.t(6)))));f.ToastManager.open((0,y.jsx)(a.ActionToast,{id:n,initialAction:r,pendingAction:i}))}deleteLabel(){return Promise.reject(new Error("This call is only supported in non-MD mode"))}_getActionLabelUpdateString(e,t){switch(e){case d.LABEL_PROPERTIES.NAME:return t===d.UPDATE_STATUS.UPDATING?m.fbt._("Updating label name",null,{hk:"2FancO"}):t===d.UPDATE_STATUS.SUCCEEDED?m.fbt._("Label name updated",null,{hk:"Nacb5"}):m.fbt._("Label name update failed",null,{hk:"33PW5z"});case d.LABEL_PROPERTIES.COLOR:return t===d.UPDATE_STATUS.UPDATING?m.fbt._("Updating label color",null,{hk:"49XPdJ"}):t===d.UPDATE_STATUS.SUCCEEDED?m.fbt._("Label color updated",null,{hk:"2cuEYz"}):m.fbt._("Label color update failed",null,{hk:"Dzw1J"})}return""}updateLabel(){return Promise.reject(new Error("This call is only supported in non-MD mode"))}getNewLabelColor(){return Promise.reject(new Error("This call is only supported in non-MD mode"))}getLabelColorPalette(){return this.labelColorPalette=this.labelColorPalette||(0,h.getSmbLabelPalette)(),this.labelColorPalette&&this.labelColorPalette.waVersion===u.Conn.phone.wa_version?Promise.resolve(this.labelColorPalette.colors):this._getColorPaletteLoop().then((e=>{const t=e.labelColors.map((e=>{let{color:t}=e;return t}));return(0,h.setSmbLabelPalette)({colors:t,waVersion:u.Conn.phone.wa_version}),t})).catch((()=>{}))}_getColorPaletteLoop(){return Promise.reject(new Error("This call is only supported in non-MD mode"))}handleRemove(e){const{labelItemCollection:t}=e;t.toArray().forEach((e=>{const{parentId:t,parentType:n,labelId:r}=e,a=(0,l.getParentCollection)(n).get(t);a&&(a.labels=(0,i.default)(a.labels,(e=>e!==r)))}))}onResume(){this.filter((e=>e.hasObservers())).forEach((e=>{this.find(e.id)}))}_findQuery(){return Promise.reject(new Error("This call is only supported in non-MD mode"))}_find(){return this._findQuery()}getLabelsForModel(e,t){return this.filter((n=>n.labelItemCollection.get((0,l.createLabelItemId)(e,n.id,t)))).map((e=>e.id))}}t.LabelCollectionImpl=E,E.model=p.Label,E.staleCollection=!0,E.resumeOnAvailable=!0;const S=new E;t.LabelCollection=S},501632:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UPDATE_STATUS=t.LABEL_PROPERTIES=t.IPHONE_LABEL_COLOR_PALETTE=t.ANDROID_LABEL_COLOR_PALETTE=void 0;t.ANDROID_LABEL_COLOR_PALETTE=["#FF9485","#64C4FF","#FFD429","#DFAEF0","#99B6C1","#55CCB3","#FF9DFF","#D3A91D","#6D7CCE","#D7E752","#00D0E2","#FFC5C7","#93CEAC","#F74848","#00A0F2","#83E422","#FFAF04","#B5EBFF","#9BA6FF","#9368CF"];t.IPHONE_LABEL_COLOR_PALETTE=["#A62C71","#90A841","#C1A03F","#792138","#AE8774","#F0B330","#B6B327","#C69FCC","#8B6990","#FF8A8C","#54C265","#FF7B6B","#26C4DC","#57C9FF","#74676A","#7E90A3","#5696FF","#6E257E","#7ACBA5","#243640"];const n=Object.freeze({NAME:"name",COLOR:"color"});t.LABEL_PROPERTIES=n;const r=Object.freeze({UPDATING:"updating",SUCCEEDED:"succeeded",FAILED:"failed"});t.UPDATE_STATUS=r},638290:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.LabelItemCollection=void 0;var i=r(n(82569)),a=n(594534),o=n(388536),s=r(n(756901));class l extends a.BaseCollection{constructor(){super(),this.listenTo(this,"add",this._handleAdd),this.listenTo(this,"remove",this._handleRemove)}_handleAdd(e){this._handleChange(e,!0)}_handleRemove(e){this._handleChange(e,!1)}_handleChange(e,t){const n=(0,o.getParentCollection)(e.parentType).get(e.parentId);if(!n)return;const r=n.labels||[];t?r.includes(e.labelId)||(n.labels=[e.labelId].concat(r)):n.labels=(0,i.default)(r,e.labelId)}}t.LabelItemCollection=l,l.model=s.default},756901:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(54918);n(454794);class i extends r.BaseModel{constructor(){super(...arguments),this.id=(0,r.prop)(),this.parentType=(0,r.prop)(),this.parentId=(0,r.prop)(),this.labelId=(0,r.prop)()}}i.Proxy="labelItem";var a=(0,r.defineModel)(i);t.default=a},275261:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Label=void 0,t.intColorToHex=function(e){return`#${(parseInt(e,10)>>>0).toString(16).slice(-6)}`};var r=n(54918),i=n(454794),a=n(266888),o=n(501632),s=n(638290),l=n(828770);class u extends r.BaseModel{constructor(){super(...arguments),this.id=(0,r.prop)(),this.name=(0,r.prop)(),this.colorIndex=(0,r.prop)(),this.color=(0,r.prop)(),this.count=(0,r.prop)(),this.stale=(0,r.session)(!0),this.hexColor=(0,r.derived)((function(){const e=this.colorIndex;if(null!=e)return a.Conn.platform===l.PLATFORMS.SMBI?o.IPHONE_LABEL_COLOR_PALETTE[e]:o.ANDROID_LABEL_COLOR_PALETTE[e]}),["color","colorIndex"])}initialize(){super.initialize(),this.labelItemCollection=new s.LabelItemCollection,this._triggerLabelUpdate(),this.listenTo(this,"change:name",this._triggerLabelUpdate),this.listenTo(this,"change:color",this._triggerLabelUpdate),this.listenTo(this,"change:colorIndex",this._triggerLabelUpdate),this.listenTo(this,"change:count",this._triggerLabelUpdate),this.listenTo(this.labelItemCollection,"add",this._handleLabelItemCollectionUpdate),this.listenTo(this.labelItemCollection,"remove",this._handleLabelItemCollectionUpdate)}_find(e){return Promise.resolve({id:e})}_triggerLabelUpdate(){this.name&&n(478353).LabelCollection.trigger(`label_updated_${this.id}`)}_handleLabelItemCollectionUpdate(){const e=this.labelItemCollection.filter((e=>e.parentType!==i.LabelItemParentType.Contact)).length;this.count=String(e)}}u.Proxy="label";const c=(0,r.defineModel)(u);t.Label=c},13622:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.OrderCollectionImpl=t.OrderCollection=void 0;var i=r(n(81109)),a=r(n(348926)),o=n(594534),s=n(520898),l=r(n(970319)),u=n(523930),c=n(486392),d=r(n(630781)),p=n(459857),_=n(669050),f=n(153593);class h extends o.BaseCollection{constructor(e,t){super(),this.width=80,this.height=80,null!=e&&(this.width=e),null!=t&&(this.height=t)}addOrder(){const e=(0,l.default)(),t=(0,p.getMeUser)();return super.add({id:e,fetchedFromServer:!1,sellerJid:(0,u.encodeJid)(t),createdAt:Math.round((new Date).getTime()/1e3),currency:(0,f.currencyForCountryShortcode)((0,c.getCountryShortcodeByPhone)(t.user)),products:[],tax:null,subtotal:null,total:null}),this.assertGet(e)}findOrder(e,t,n){const r=this.get(e);return null!=r?Promise.resolve(r):this._queryOrder(e,t,n)}_queryOrder(e,t,n){var r=()=>super.add,o=this;return(0,a.default)((function*(){const a=yield(0,s.queryOrder)((0,_.createWid)(t),e,o.width,o.height,n);r().call(o,(0,i.default)({id:e,fetchedFromServer:!0,sellerJid:t},a));const l=o.get(e);if(null!=l)return Promise.resolve(l)}))()}}t.OrderCollectionImpl=h,h.model=d.default,h.staleCollection=!0;const g=new h;t.OrderCollection=g},694607:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.OrderItemCollection=void 0;var i=n(594534),a=r(n(335758));class o extends i.BaseCollection{}t.OrderItemCollection=o,o.model=a.default},335758:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(54918),a=r(n(116253)),o=n(172259);class s extends i.BaseModel{constructor(){super(...arguments),this.id=(0,i.prop)(),this.price=(0,i.prop)(),this.currency=(0,i.prop)(),this.name=(0,i.prop)(),this.quantity=(0,i.prop)(),this.thumbnailId=(0,i.prop)(),this.thumbnailUrl=(0,i.prop)(),this.isCustomItem=(0,i.prop)(),this.isQuantitySet=(0,i.prop)(),this.mediaData=(0,i.derived)((function(){return new a.default({mediaStage:null!=this.thumbnailUrl?o.MEDIA_DATA_STAGE.RESOLVED:o.MEDIA_DATA_STAGE.PREPARING,renderableUrl:null!=this.thumbnailUrl?`${this.thumbnailUrl}`:null})}),["thumbnailUrl"])}getCollection(){return n(13622).OrderCollection}}s.Proxy="order-item";var l=(0,i.defineModel)(s);t.default=l},630781:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=n(54918),o=n(694607),s=r(n(335758));class l extends a.BaseModel{constructor(){super(...arguments),this.id=(0,a.prop)(),this.products=(0,a.prop)(),this.itemCount=(0,a.prop)(),this.subtotal=(0,a.prop)(),this.tax=(0,a.prop)(),this.total=(0,a.prop)(),this.currency=(0,a.prop)(),this.createdAt=(0,a.prop)(),this.sellerJid=(0,a.prop)(),this.totalItemCount=(0,a.derived)((function(){return this.products.reduce(((e,t)=>e+t.quantity),0)}),["products"])}initialize(){super.initialize(),this.orderItemCollection=new o.OrderItemCollection,this.listenTo(this,"change:cartItemCollection",this.triggerItemCollectionUpdate),this.triggerItemCollectionUpdate()}triggerItemCollectionUpdate(){this.orderItemCollection.set(this.products.map((e=>new s.default((0,i.default)({},e)))),{merge:!0})}getCollection(){return n(13622).OrderCollection}}l.Proxy="order";var u=(0,a.defineModel)(l);t.default=u},644130:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.CatalogCollectionImpl=t.CatalogCollection=void 0;var i=r(n(348926)),a=n(425315),o=n(984330),s=n(594534),l=n(418012),u=r(n(470170)),c=n(617769),d=(n(316348),n(555622)),p=n(241588),_=n(669050),f=n(841208);class h extends s.BaseCollection{addMsgAsProduct(e){const t=e.businessOwnerJid&&(0,_.createWid)(e.businessOwnerJid);if(!t)return;const n=this.get(t),r=n&&e.productId&&n.msgProductCollection.get(e.productId),i=n&&e.productId?n.productCollection.get(e.productId):null;if((null==i?void 0:i.t)&&i.t>=e.t)return;if(null==r?void 0:r.fetchedFromServer)return;const a=(0,f.mapMsgToProductModel)(e);return super.add({id:t,afterCursor:void 0,_msgs:[a],stale:!0,fetchedFromServer:!!i},{merge:!0})}_queryProduct(e){var t=()=>super.add,n=this;let{catalogWid:r,productId:a,productMsgMediaData:s,width:u,height:c,shouldFetchComplianceFields:d,canLogQpl:p}=e;return(0,i.default)((function*(){const e=yield(0,l.queryProduct)(r,a,u,c,d,p);if("NOT_FOUND"===e.error){const e=n.get(r);return null==e||e.productCollection.remove(a),Promise.reject(new o.E404("CatalogCollection:findProduct:_queryProduct NOT_FOUND"))}if(!e.data)return t().call(n,{id:r,afterCursor:void 0});const{data:i}=e;if(!i.image_cdn_urls)return Promise.reject(new Error("CatalogCollection:findProduct:_queryProduct: could not find image_cdn_urls for product"));const _=(0,f.mapProductResponseToModel)(i,r);_.productMsgMediaData=s;const h=[_];return t().call(n,{id:r,afterCursor:void 0,_products:h,_msgs:h},{merge:!0})}))()}findProduct(e){let{catalogWid:t,productId:n,productMsgMediaData:r,shouldFetchComplianceFields:i,canLogQpl:a}=e;return n?this._queryProduct({catalogWid:t,productId:n,productMsgMediaData:r,shouldFetchComplianceFields:i,canLogQpl:a}):Promise.reject(new Error("CatalogCollection:findProduct Received productId type "+(void 0===n?"undefined":"null")))}_queryCatalog(e,t,n,r,a,o){return(0,i.default)((function*(){const i=e?e.index:0;o&&d.QPL.markerPoint(o,"datasource_catalog_start");const s=yield(0,l.queryCatalog)(t,n,10,void 0,void 0,r,a);if(o&&d.QPL.markerPoint(o,"datasource_catalog_end"),!s.data.length)return{id:t,afterCursor:null};const u=[];return s.data.forEach((e=>{e.image_cdn_urls&&u.push((0,f.mapProductResponseToModel)(e,t))})),{id:t,afterCursor:s.paging.cursors.after,_products:u,fetchedFromServer:!0,index:i+u.length}}))()}_findQuery(e,t){const n=this.get(e),r=n&&!n.stale?n.afterCursor:void 0;return this._queryCatalog(n,e,r,void 0,void 0,null==t?void 0:t.markerId)}_find(e,t){return this._findQuery(e,t)}findCarouselCatalog(e){var t=()=>super.add,n=this;return(0,i.default)((function*(){const r=n.get(e),i=(0,a.isString)(e)?(0,_.createWid)(e):e;r&&r.set({index:0});const o=yield n._queryCatalog(r,i,void 0,void 0,Boolean(p.ServerProps.shopsProductGrid));return r&&r.markProductCollectionOld(),t().call(n,o,{merge:!0})}))()}findNextProductPage(e,t){var n=this;return(0,i.default)((function*(){!0===t&&(0,c.qplPointCatalogView)("datasource_start");const r=yield n.update(e);!0===t&&(0,c.qplPointCatalogView)("datasource_end");return(Array.isArray(r)?r[0]:r).productCollection.getProductModels()}))()}findCollectionMembership(e,t){var n=()=>super.add,r=this;return(0,i.default)((function*(){let i=r.get(e);const o=(0,a.isString)(e)?(0,_.createWid)(e):e,s=i&&!i.stale?i.afterCursor:void 0,l=yield r._queryCatalog(i,o,s,t);n().call(r,l,{merge:!0}),i=r.get(e),i&&(i.stale=!1)}))()}removeCatalog(e){const t=this.get(e);t?this.remove(t):__LOG__(4,void 0,new Error)`Catalog data cleanup called on a non-existent catalogId`}}t.CatalogCollectionImpl=h,h.model=u.default,h.staleCollection=!0;const g=new h;t.CatalogCollection=g},470170:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=r(n(132375)),o=n(54918),s=n(418012),l=n(240733),u=n(494517),c=n(75058),d=r(n(124928)),p=n(841208);class _ extends o.BaseModel{constructor(){super(...arguments),this.id=(0,o.prop)(),this.afterCursor=(0,o.prop)(),this.index=(0,o.prop)(),this.hasCatalogCategories=(0,o.prop)(),this.fetchedFromServer=(0,o.session)(),this._products=(0,o.session)(),this._msgs=(0,o.session)()}initialize(){super.initialize(),this.productCollection=new u.ProductCollection,this.msgProductCollection=new u.ProductCollection,this.collections=new l.ProductCollCollection,this.listenTo(this,"change:_products",this.triggerProductUpdate),this.listenTo(this,"change:_msgs",this.triggerMsgUpdate),this.triggerProductUpdate(),this.triggerMsgUpdate()}triggerProductUpdate(){this._products&&this.productCollection.add(this._products,{merge:!0}),this._products=void 0}triggerMsgUpdate(){this._msgs&&this.msgProductCollection.add(this._msgs,{merge:!0}),this._msgs=void 0}markProductCollectionOld(){this.productCollection.forEach((e=>e.markOld()))}addProduct(e){var t=this;return(0,i.default)((function*(){const{id:n}=t,r=yield(0,s.addProduct)(e),i=t.productCollection.at(0);r.catalogWid=n,r.index=i?i.index-1:0;const o=t.productCollection.add(r,{merge:!0,at:0})[0];return(0,a.default)(o,"addedProduct")}))()}editProduct(e){var t=this;return(0,i.default)((function*(){const n=yield(0,s.editProduct)(e),r=t.productCollection.add(n,{merge:!0})[0];return t.collections&&t.collections.forEach((t=>{t.productCollection.get(e.id)&&t.productCollection.add(n,{merge:!0})})),(0,a.default)(r,"editedProduct")}))()}refreshProduct(e){var t=this;return(0,i.default)((function*(){const n=t.productCollection.get(e);n&&(n.stale=!0);const r=yield(0,s.queryProduct)(t.id,e);if(null!=r.data){const i=(0,p.mapProductResponseToModel)(r.data,t.id);n&&t.productCollection.add(i,{merge:!0}),t.collections&&t.collections.forEach((t=>{t.productCollection.get(e)&&t.productCollection.add(i,{merge:!0})}))}}))()}pullProduct(e,t){var n=this;return(0,i.default)((function*(){const r=yield(0,s.queryProduct)(n.id,e,void 0,void 0,void 0,t);if("NOT_FOUND"===r.error&&n.productCollection.remove(e),null!=r.data){const e=new c.Product((0,p.mapProductResponseToModel)(r.data,n.id));n.updateProduct(e)}}))()}updateProduct(e){this.productCollection.add(e,{merge:!1})}getCollection(){return n(644130).CatalogCollection}}_.Proxy="catalog",_.idClass=d.default;var f=(0,o.defineModel)(_);t.default=f},617769:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.qplPointCatalogView=function(e){i.QPL.markerPoint(r.QuickLogMarkerId.WHATSAPP_CATALOG_VIEW,e)},t.qplPointProductMessageSend=function(e){i.QPL.markerPoint(r.QuickLogMarkerId.WHATSAPP_PRODUCT_MESSAGE_SEND,e)};var r=n(316348),i=n(555622)},312784:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.createProductMsgSnapshot=E,t.sendProductMessage=function(){return S.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=r(n(132375)),s=r(n(1840)),l=n(497565),u=n(373070),c=n(617769),d=n(977892),p=n(625786),_=n(390737),f=r(n(571834)),h=n(548360),g=n(785893);function m(){return y.apply(this,arguments)}function y(){return(y=(0,a.default)((function*(e,t){const n=(0,o.default)(new s.default({chatParticipantCount:t}),"new AttachMediaCollection({\n chatParticipantCount\n})");if((0,c.qplPointProductMessageSend)("image_upload_start"),yield n.processAttachments([{file:e}],f.default.MEDIA_PICKER_ORIGIN_TYPE.CHAT_PHOTO_LIBRARY),(0,c.qplPointProductMessageSend)("image_upload_end"),!n.canSend())return;const r=n.getPreviewableMedias();if(1!==r.length)return;const[i]=r;return i.caption||(i.caption=void 0),i}))).apply(this,arguments)}function E(e){return(0,i.default)((0,i.default)({businessOwnerJid:e.catalogWid.toString({legacy:!0}),productId:e.id.toString(),url:e.url,productImageCount:e.getProductImageCollectionCount(),title:e.name,description:e.description},0===e.priceAmount1000?{priceAmount1000:null,currencyCode:null}:{currencyCode:e.currency,priceAmount1000:e.priceAmount1000}),{},{salePriceAmount1000:(0,d.isSalePriceActive)(e)?e.salePriceAmount1000:null})}function S(){return(S=(0,a.default)((function*(e,t,n){const r=t.getHeadImageFile();if(!r)throw _.ToastManager.open((0,g.jsx)(p.Toast,{msg:h.fbt._("Can not send product before media is ready",null,{hk:"1dON6O"}),id:(0,p.genId)()})),new Error("Tried to send product message. Media file is not available.");const a=e.getParticipantCount(),o=yield m(r,a);if(!o)throw _.ToastManager.open((0,g.jsx)(p.Toast,{msg:h.fbt._("Can not send product before media is ready",null,{hk:"1dON6O"}),id:(0,p.genId)()})),new Error("Tried to send product message. Media data is not available.");const s={quotedMsg:n,caption:o.caption,addEvenWhilePreparing:o.previewable&&o.state===l.ATTACH_MEDIA_STATE.PROCESSING,useBasePropsType:!0};o.sendToChat(e,(0,i.default)((0,i.default)({},s),{},{type:u.MSG_TYPE.PRODUCT,productMsgOptions:E(t)}))}))).apply(this,arguments)}},240733:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ProductCollCollection=void 0;var i=r(n(348926)),a=n(594534),o=r(n(678595)),s=(n(316348),n(555622)),l=r(n(36707)),u=r(n(804166)),c=n(719722),d=n(841208);const p=100,_=e=>({id:e.id,name:e.name,reviewStatus:e.reviewStatus,totalItemsCount:e.totalItemsCount,canAppeal:e.canAppeal,commerceUrl:e.commerceUrl,rejectReason:e.rejectReason});class f extends a.BaseCollection{constructor(){super(...arguments),this.afterCursor=""}findCollectionsList(e,t,n,r){var a=this;return(0,i.default)((function*(){r&&s.QPL.markerPoint(r,"datasource_collections_start");try{const n=yield(0,c.attemptWithDirectConnectionRetry)(e,(n=>(0,l.default)({catalogWid:e,afterCursor:a.afterCursor,limit:10,productsCount:t,width:p,height:p,directConnectionEncryptedInfo:n})));r&&s.QPL.markerPoint(r,"datasource_collections_end"),a.afterCursor=n.afterCursor,a.add(n.collections.map(_),{merge:!0}),n.collections.forEach((t=>{const n=a.get(t.id);n&&n.addProducts(t.products.map((t=>(0,d.mapProductResponseToModel)(t,e))))})),a.trigger("change")}catch(e){throw __LOG__(4,!0,new Error,!0)`Failed findCollectionsList, error: ${e}`,SEND_LOGS("Find collections list failed"),e}}))()}getCollectionModels(e){const t=this.toArray();return e?t:t.filter((e=>!e.isHidden&&"APPROVED"===e.reviewStatus))}findCollectionProducts(e,t,n,r){var a=this;return(0,i.default)((function*(){let n=a.get(t);const i=n?n.afterCursor:void 0;r&&s.QPL.markerPoint(r,"datasource_start");try{const o=yield(0,c.attemptWithDirectConnectionRetry)(e,(n=>(0,u.default)({catalogWid:e,collectionId:t,afterCursor:i,limit:10,width:p,height:p,directConnectionEncryptedInfo:n})));r&&s.QPL.markerPoint(r,"datasource_end"),1===o.collections.length&&(a.add(o.collections.map(_),{merge:!0}),n=a.get(t),n&&(n.addProducts(o.collections[0].products.map((t=>(0,d.mapProductResponseToModel)(t,e)))),n.afterCursor=o.afterCursor))}catch(e){throw __LOG__(4,!0,new Error,!0)`Failed findCollectionProducts, error: ${e}`,SEND_LOGS("Find collection products failed"),e}}))()}}t.ProductCollCollection=f,f.model=o.default,f.staleCollection=!0},678595:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(54918),i=n(494517);class a extends r.BaseModel{constructor(){super(...arguments),this.id=(0,r.prop)(),this.name=(0,r.prop)(),this.isHidden=(0,r.prop)(),this.reviewStatus=(0,r.prop)(),this.commerceUrl=(0,r.prop)(),this.rejectReason=(0,r.prop)(),this.totalItemsCount=(0,r.prop)(),this.afterCursor=(0,r.prop)(),this.canAppeal=(0,r.prop)()}initialize(){super.initialize(),this.productCollection=new i.ProductCollection,this.afterCursor=void 0}addProducts(e){this.productCollection.add(e,{merge:!0})}}a.Proxy="productColl";var o=(0,r.defineModel)(a);t.default=o},494517:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProductCollection=t.PRODUCT_REVIEW_STATUS=void 0;var r=n(594534),i=n(75058);const a={NO_REVIEW:"NO_REVIEW",PENDING:"PENDING",REJECTED:"REJECTED",APPROVED:"APPROVED",OUTDATED:"OUTDATED"};t.PRODUCT_REVIEW_STATUS=a;class o extends r.BaseCollection{getProductModels(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=super.toArray();if(super.length<1)return t;const n=super.head();if(!(null==n?void 0:n.catalogWid))return t;const r=e?new Set([a.OUTDATED,a.NO_REVIEW,a.APPROVED,a.REJECTED,a.PENDING]):new Set([a.APPROVED]),i=super.filter((e=>r.has(e.reviewStatus)&&!e.old));return e?i:i.filter((e=>!e.isHidden))}add(e,t){const n=t?super.add(e,t):super.add(e);return this.sort(),n}evictImagesFromCache(e){const t=this.get(e);t&&t.evictImagesFromCache()}_find(e){const t=this.get(e);return t?Promise.resolve(t):Promise.resolve({id:e})}}t.ProductCollection=o,o.model=i.Product,o.comparator=function(e,t){return e.index-t.index}},368892:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProductImageCollection=void 0;var r=n(594534),i=n(465459);class a extends r.BaseCollection{toArray(){return super.filter((e=>e.old?(this.remove(e),!1):e))}}t.ProductImageCollection=a,a.model=i.ProductImage},465459:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.STATIC_WHATSAPP_IMAGE_URI=t.ProductImage=void 0;var a=i(n(348926)),o=i(n(81109)),s=n(360336),l=n(663166),u=n(54918),c=n(677332),d=n(644234),p=i(n(116253)),_=n(232294),f=i(n(756680)),h=n(719621),g=n(172259),m=n(288057);const y="https://static.whatsapp.net";t.STATIC_WHATSAPP_IMAGE_URI=y;const E=(0,l.createTimer)({algo:{type:"fibonacci",first:0,second:1},jitter:.25,max:9e5});function S(e){return"_productimage_"+(e.includes(y)?e:new URL(e).pathname)}class T extends u.BaseModel{constructor(){super(...arguments),this.id=(0,u.prop)(),this.type=(0,u.prop)(),this.mediaUrl=(0,u.prop)(),this.blobUrl=(0,u.session)(),this.mediaData=(0,u.session)(),this.fetchedFromServer=(0,u.prop)(),this.old=(0,u.session)(!1)}initialize(){super.initialize(),this.listenTo(this,"change:mediaUrl change:fetchedFromServer",this.triggerImageUpdate),this.triggerImageUpdate()}_processAndUpdateMediaData(e){let t={};const n=f.default.createFromData(e,"image/jpeg");(0,d.prepRawMedia)(n,{}).waitForPrep().then((e=>(t=(0,o.default)((0,o.default)({},t),{},{mediaBlob:e.mediaBlob,type:e.type,mimetype:e.mimetype,fullWidth:e.fullWidth,fullHeight:e.fullHeight}),Promise.all(["string"==typeof e.preview?f.default.createFromBase64Jpeg(e.preview):Promise.resolve(null),f.default.createFromData(e.mediaBlob),(0,c.calculateFilehashFromBlob)(e.mediaBlob)])))).then((e=>{const[n,r,i]=e;t=(0,o.default)((0,o.default)({},t),{},{preview:n,mediaBlob:r,renderableUrl:r.url(),mediaStage:g.MEDIA_DATA_STAGE.RESOLVED,filehash:i}),i!==this.mediaData.filehash&&this.mediaData.set(t)}))}triggerImageUpdate(){var e=this;return(0,a.default)((function*(){if(!e.fetchedFromServer||!e.mediaUrl)return;e.mediaData||e.addChild("mediaData",new p.default({mediaStage:g.MEDIA_DATA_STAGE.PREPARING}));const t=S(e.mediaUrl),n=yield h.LruMediaStore.get(t);if(n)return e._processAndUpdateMediaData(n);const i={delay:e=>{let{taskDuration:t}=e;const n=1e3*E();return Math.max(n-t,0)},signal:(new r).signal,retries:10};try{const{result:n}=yield(0,s.backoff)(i,function(){var t=(0,a.default)((function*(t){const n=yield(0,_.fetchMedia)(e.mediaUrl);return n&&n.status>=200&&n.status<300?n:t(new m.CatalogImageDownloadError)}));return function(){return t.apply(this,arguments)}}());h.LruMediaStore.put(t,n),e._processAndUpdateMediaData(n)}catch(t){__LOG__(3)`Failed to fetch ${e.mediaUrl}`,e.mediaData.set({mediaStage:g.MEDIA_DATA_STAGE.ERROR_MISSING})}}))()}markOld(){this.old=!0}evictFromCache(){if(this.mediaUrl){const e=S(this.mediaUrl);h.LruMediaStore.del(e)}}}T.Proxy="productImage";const v=(0,u.defineModel)(T);t.ProductImage=v},386263:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PRODUCT_PAGE_SIZE=void 0;t.PRODUCT_PAGE_SIZE=6},125392:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ProductMessageListCollectionImpl=t.ProductMessageListCollection=void 0;var i=r(n(348926)),a=n(594534),o=n(418012),s=n(601570),l=(n(316348),n(669050));class u extends a.BaseCollection{_queryProductList(e,t){return(0,i.default)((function*(){const n=e.catalogId,r=yield(0,o.queryProductList)(n,e.getNextProductBatchToLoad(),void 0,void 0,t);return{id:e.id,_products:r,fetchedFromServer:!0}}))()}_findQuery(e,t){const n=this.get(e);return null==n?Promise.resolve({id:e}):this._queryProductList(n,null==t?void 0:t.markerId)}_find(e,t){return this._findQuery(e,t)}getOrAdd(e,t,n,r,i){let a=this.get(e);if(null!=a)return a;if(null==r)return null;const o=(0,l.createWid)(r);return a=this.add({id:e,catalogId:o,_productList:t,title:i,requiresDirectConnection:n})[0],null!=a?a:null}}t.ProductMessageListCollectionImpl=u,u.model=s.ProductMessageList,u.staleCollection=!0;const c=new u;t.ProductMessageListCollection=c},601570:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ProductMessageList=void 0;var i=r(n(348926)),a=n(54918),o=n(701602),s=n(895758),l=n(644130),u=n(965012),c=r(n(565754)),d=n(494517),p=n(500411),_=n(386263),f=n(241588),h=n(841208);const g=["ERROR","SUCCESS"];class m extends a.BaseModel{constructor(){super(...arguments),this.id=(0,a.prop)(),this.catalogId=(0,a.prop)(),this.title=(0,a.prop)(),this.requiresDirectConnection=(0,a.prop)(),this._productsLoadingStatus=(0,a.session)(),this._productList=(0,a.session)(),this._products=(0,a.session)()}initialize(){super.initialize(),this.productCollection=l.CatalogCollection.gadd({id:this.catalogId}).productCollection,this._productsLoadingStatus=new Map,this.listenTo(this,"change:_products",this.triggerProductUpdate),this.triggerProductUpdate(),this.listenTo(this.productCollection,"remove",this.triggerProductRemoved),this.listenTo(u.ChatCollection,"add",this.triggerChatAdded)}triggerProductRemoved(e){(0,o.updateProductListHeaderImageRejected)(e,this.id)}triggerProductUpdate(){null!=this._products&&(this._products.forEach((e=>{const t=this._getFetchStatus(e);if(this.setProductLoadingStatus(e.id,t),"DELETED"===e.status&&this.triggerProductRemoved(e),"DELETED"!==e.status&&"ERROR"!==t){const t=(0,h.mapProductResponseToModel)(e,this.catalogId);t.reviewStatus===d.PRODUCT_REVIEW_STATUS.REJECTED&&this.triggerProductRemoved(t),this.productCollection.add(t,{merge:!0})}})),this._products=void 0)}triggerChatAdded(e){var t=this;return(0,i.default)((function*(){e.id.equals(t.catalogId)&&(yield(0,s.isCypherNeeded)(t.catalogId))&&(t.productCollection.reset(),t._productsLoadingStatus=new Map)}))()}getNextProductBatchToLoad(){const e=this.getPageSize(),t=this._productList.productSections.reduce(((e,t)=>{let{products:n}=t;return[...e,...n.map((e=>{let{productId:t}=e;return t})).filter(Boolean).filter((e=>"NONE"===this.getProductLoadingStatus(e)))]}),[]).slice(0,e);return t.forEach((e=>this.setProductLoadingStatus(e,"PENDING"))),t}getPageSize(){const e=f.ServerProps.webProductListMessagePageSize||_.PRODUCT_PAGE_SIZE,t=this.getProductSize();return t<3*e?t:2*e}getProductSize(){return this._productList.productSections.reduce(((e,t)=>{let{products:n}=t;return e+n.length}),0)}setProductLoadingStatus(e,t){this._productsLoadingStatus.set(e,t)}getProductLoadingStatus(e){return this._productsLoadingStatus.get(e)||"NONE"}getTotalProductsFetchedOrFailed(){return Array.from(this._productsLoadingStatus).filter((e=>{let[t,n]=e;return g.includes(n)})).length}getProductList(){return this._productList}getSections(){return this._productList.productSections}getSectionsCount(){return this._productList.productSections.reduce(((e,t)=>{let{title:n}=t;return null!=n&&""!==n?e+1:e}),0)}isFetching(){let e=!1;return this._productsLoadingStatus.forEach((t=>{"PENDING"===t&&(e=!0)})),e}_getFetchStatus(e){return e.status!==p.INVALID_PRODUCT_TOKEN&&e.image_cdn_urls?"SUCCESS":"ERROR"}}m.Proxy="product_list",m.idClass=c.default;const y=(0,a.defineModel)(m);t.ProductMessageList=y},75058:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Product=t.MIN_PRICE=t.MAX_PRODUCT_IMAGES=t.MAX_PRICE=void 0;var i=n(54918),a=n(698210),o=r(n(116253)),s=n(172259),l=n(368892);t.MIN_PRICE=0;t.MAX_PRICE=4503599627370496;t.MAX_PRODUCT_IMAGES=10;class u extends i.BaseModel{constructor(){super(...arguments),this.old=(0,i.session)(!1),this.checkmark=(0,i.session)(!1),this.id=(0,i.prop)(),this.isHidden=(0,i.prop)(),this.catalogWid=(0,i.prop)(),this.url=(0,i.prop)(),this.name=(0,i.prop)(),this.description=(0,i.prop)(),this.availability=(0,i.prop)(),this.maxAvailable=(0,i.prop)(),this.reviewStatus=(0,i.prop)(),this.canAppeal=(0,i.prop)(),this.currency=(0,i.prop)(),this.priceAmount1000=(0,i.prop)(),this.salePriceAmount1000=(0,i.prop)(),this.salePriceStartDate=(0,i.prop)(),this.salePriceEndDate=(0,i.prop)(),this.retailerId=(0,i.prop)(),this.productImageCollection=(0,i.session)(),this.imageCount=(0,i.prop)(),this.index=(0,i.prop)(),this.additionalImageCdnUrl=(0,i.prop)(),this.additionalImageHashes=(0,i.prop)(),this.imageCdnUrl=(0,i.prop)(),this.imageHash=(0,i.prop)(),this.complianceInfo=(0,i.prop)(),this.productMsgMediaData=(0,i.session)(),this.fetchedFromServer=(0,i.session)(),this.t=(0,i.prop)()}initialize(){super.initialize(),this.productImageCollection=new l.ProductImageCollection,this.listenTo(this,"change:imageCdnUrl",this.triggerMainImageUpdate),this.initImageUpdate()}triggerAdditionalImageUpdate(){var e;let t=0;null===(e=this.additionalImageCdnUrl)||void 0===e||e.forEach(((e,n)=>{this.productImageCollection.gadd({id:`_${n+1}`,mediaUrl:e,fetchedFromServer:this.fetchedFromServer,old:!1},{merge:!0}),t=n+1})),this.productImageCollection.filter(((e,n)=>n>t)).forEach((e=>e.markOld()))}triggerMainImageUpdate(){var e;this.imageCdnUrl?this.productImageCollection.gadd({id:"_0",mediaUrl:this.imageCdnUrl,fetchedFromServer:this.fetchedFromServer,old:!1},{merge:!0}):null===(e=this.productImageCollection.get("_0"))||void 0===e||e.markOld()}initImageUpdate(){if(this.fetchedFromServer||!this.productMsgMediaData)this.triggerMainImageUpdate();else for(let e=0;e<this.imageCount;e++)this.productImageCollection.gadd({id:`_${e}`,type:"product",mediaData:new o.default({mediaStage:s.MEDIA_DATA_STAGE.PREPARING}),fetchedFromServer:this.fetchedFromServer,old:!1},{merge:!0})}markOld(){this.old=!0}lazyloadProductImageCollection(){return this.triggerAdditionalImageUpdate(),this.productImageCollection}getProductImageCollectionCount(){return this.productImageCollection.length}getProductImageCollectionHead(){return this.productImageCollection.head()}getHeadImageFile(){var e;const{productImageCollection:t,name:n}=this,r=t.head();if(!r)return;let i;const o=null===(e=r.mediaData)||void 0===e?void 0:e.mediaBlob;if(o._blob&&(i=o._blob),!i)return;return(0,a.createFile)([i],`${n}.jpg`,{type:"image/jpeg"})}evictImagesFromCache(){this.productImageCollection.forEach((e=>e.evictFromCache()))}getPreviewImage(){return this.productImageCollection.head()}getCollection(){return this.collection}}u.Proxy="product";const c=(0,i.defineModel)(u);t.Product=c},977892:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSalePriceActive=t.isEmptyPrice=t.getSavings=t.getActivePrice=void 0;const n=e=>null!=e.salePriceAmount1000&&(null==e.salePriceStartDate||e.salePriceStartDate<=Date.now())&&(null==e.salePriceEndDate||e.salePriceEndDate>Date.now());t.isSalePriceActive=n;const r=e=>n(e)?e.salePriceAmount1000:e.priceAmount1000;t.getActivePrice=r;t.getSavings=e=>{var t,r;return n(e)?Math.max(0,(null!==(t=e.priceAmount1000)&&void 0!==t?t:0)-(null!==(r=e.salePriceAmount1000)&&void 0!==r?r:0)):0};t.isEmptyPrice=e=>{const{currency:t,priceAmount1000:n}=e,i=r(e);return!t||null==n||null==i}},319022:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.QuickReplyCollectionImpl=t.QuickReplyCollection=void 0;var i=n(201063),a=n(154549),o=n(594534),s=r(n(301513)),l=n(702247),u=n(94872);class c extends o.BaseCollection{constructor(){super(...arguments),this.smartDefaultsAdded=!1,this.flushCountsTimer=new i.ShiftTimer((()=>{this.hasPendingCounts()&&this.flushCounts()})),this.sortQuickReply=(e,t)=>e.totalCount===t.totalCount?e.id<t.id?-1:1:e.totalCount>t.totalCount?-1:1,this._handleCountsFlushed=e=>{let{id:t,count:n}=e;const r=this.get(t);r&&(r.count=n,r.pendingCount=0)}}addSmartDefaultsIfNeeded(){!1===this.smartDefaultsAdded&&((0,l.addSmartDefaults)(),this.smartDefaultsAdded=!0)}filterShortcuts(e){return this.filter((t=>{let{shortcut:n}=t;return n.toLowerCase().startsWith(e.toLowerCase())})).sort(this.sortQuickReply)}periodicFlush(){}hasPendingCounts(){return this.some((e=>{let{pendingCount:t}=e;return t>0}))}getAllPendingCounts(){const e={};return this.forEach((t=>{let{id:n,pendingCount:r}=t;r>0&&(e[n]=r)})),e}flushCounts(){throw new Error("This call is only supported in non-MD mode")}_findQuery(){return Promise.reject(new Error("This call is only supported in non-MD mode"))}}t.QuickReplyCollectionImpl=c,c.model=s.default,c.cachePolicy={id:u.COLLECTIONS_KEYS.QUICK_REPLY_COLLECTION,policy:a.CACHE_POLICY.LOAD,delay:2e3};const d=new c;t.QuickReplyCollection=d},388390:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QuickReplyTypes=void 0;const r=n(76672)({TEXT:"text",ADDRESS_SMART_DEFAULT:"address_smart_default",HOURS_SMART_DEFAULT:"hours_smart_default",PROFILE_SMART_DEFAULT:"profile_smart_default"});t.QuickReplyTypes=r},301513:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(54918),i=n(388390),a=n(89455);class o extends r.BaseModel{constructor(){super(...arguments),this.id=(0,r.prop)(),this.shortcut=(0,r.prop)(),this.message=(0,r.prop)(),this.count=(0,r.prop)(),this.keywords=(0,r.prop)(),this.pendingCount=(0,r.session)(0),this.totalCount=(0,r.derived)((function(){return this.count+this.pendingCount}),["count","pendingCount"]),this.type=(0,r.derived)((function(){var e;switch(null!==(e=i.QuickReplyTypes.cast(this.id))&&void 0!==e?e:i.QuickReplyTypes.TEXT){case i.QuickReplyTypes.ADDRESS_SMART_DEFAULT:return i.QuickReplyTypes.ADDRESS_SMART_DEFAULT;case i.QuickReplyTypes.HOURS_SMART_DEFAULT:return i.QuickReplyTypes.HOURS_SMART_DEFAULT;case i.QuickReplyTypes.PROFILE_SMART_DEFAULT:return i.QuickReplyTypes.PROFILE_SMART_DEFAULT;default:return i.QuickReplyTypes.TEXT}}),["id"])}useOnce(){this.isSmartDefault()?(this.count+=1,(0,a.updateQuickReply)(this)):(this.pendingCount+=1,this.getCollection().periodicFlush())}getCollection(){return n(319022).QuickReplyCollection}isSmartDefault(){switch(this.type){case i.QuickReplyTypes.PROFILE_SMART_DEFAULT:case i.QuickReplyTypes.HOURS_SMART_DEFAULT:case i.QuickReplyTypes.ADDRESS_SMART_DEFAULT:return!0;default:return!1}}}o.Proxy="quickReply";var s=(0,r.defineModel)(o);t.default=s},702247:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addSmartDefaults=function(){(function(){const e=a.QuickReplyTypes.PROFILE_SMART_DEFAULT,t=function(){const e=i.ContactCollection.get((0,s.getMaybeMeUser)());if(e){const t=a.QuickReplyTypes.PROFILE_SMART_DEFAULT;return new o.default({id:t,shortcut:l.fbt._("profile",null,{hk:"10UPRT"}).toString(),message:e.displayName,count:-1,keywords:[]})}}(),r=n(319022).QuickReplyCollection;r.get(e)?t&&r.add({id:e,message:t.message},{merge:!0}):t&&r.add(t,{merge:!0})})(),function(){const e=a.QuickReplyTypes.ADDRESS_SMART_DEFAULT,t=function(){const e=n(69108).BusinessProfileCollection.get((0,s.getMaybeMeUser)());if((null==e?void 0:e.latitude)||(null==e?void 0:e.longitude)||(null==e?void 0:e.address)){const t=a.QuickReplyTypes.ADDRESS_SMART_DEFAULT,n=e.address||l.fbt._("Map Location",null,{hk:"3wlwI4"});return new o.default({id:t,shortcut:l.fbt._("address",null,{hk:"38K1PS"}).toString(),message:l.fbt._("{pinEmoji} {address}",[l.fbt._param("pinEmoji","📍"),l.fbt._param("address",n)],{hk:"huwFP"}).toString(),count:-1,keywords:[]})}}(),r=n(319022).QuickReplyCollection;r.get(e)?t&&r.add({id:e,message:t.message},{merge:!0}):t&&r.add(t,{merge:!0})}(),function(){const e=a.QuickReplyTypes.HOURS_SMART_DEFAULT,t=function(){var e;const t=n(69108).BusinessProfileCollection,r=n(85663).quickReplyHoursStr,i=t.get((0,s.getMaybeMeUser)());if(null==i||null===(e=i.businessHours)||void 0===e?void 0:e.config){const e=a.QuickReplyTypes.HOURS_SMART_DEFAULT,t=r(i.businessHours);return new o.default({id:e,shortcut:l.fbt._("hours",null,{hk:"1WmWJY"}).toString(),message:t,count:-1,keywords:[]})}}(),r=n(319022).QuickReplyCollection;r.get(e)?t&&r.add({id:e,message:t.message},{merge:!0}):t&&r.add(t,{merge:!0})}()};var i=n(121977),a=n(388390),o=r(n(301513)),s=n(459857),l=n(548360)},965012:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ChatCollectionImpl=t.ChatCollection=void 0;var i=r(n(348926)),a=r(n(535937)),o=r(n(639693)),s=r(n(763105)),l=r(n(435161)),u=r(n(23279)),c=n(204597),d=n(594534),p=n(217020),_=r(n(285874)),f=n(413497),h=n(266888),g=r(n(377565)),m=r(n(866337)),y=n(806279),E=n(755707),S=n(788063),T=n(226562),v=n(6961),A=n(53575);class C extends d.BaseCollection{constructor(){super(),this.notSpam={},this.promises={sendUnstarAll:null},this._sortEnabled=!1,this._viewOnceCleanupTaskQueue=new Set,this.enableSortListener(),this.listenTo(v.Socket,"change:stream",(()=>{v.Socket.stream===T.SOCKET_STREAM.RESUMING&&this.forEach((e=>{e.pendingMsgs=!1}))})),this.listenToOnce(this,"sort",(0,u.default)(this.setIndexes,100)),this._scheduleViewOnceMediaCleanup()}_scheduleViewOnceMediaCleanup(){clearTimeout(this._viewOnceCleanupTimeout),this._viewOnceCleanupTimeout=setTimeout((()=>{y.IdleCallbackTasks.enqueue((()=>{this._runViewOnceMediaCleanup(),this._scheduleViewOnceMediaCleanup()}))}),18e5)}_runViewOnceMediaCleanup(){this.forEach((e=>{const t=e.id;this._viewOnceCleanupTaskQueue.has(t)||(y.IdleCallbackTasks.enqueue((()=>{this._viewOnceCleanupTaskQueue.delete(t);const e=this.get(t);!1===(null==e?void 0:e.active)&&e.deregisterExpiredViewOnceBulkMessages(e.msgs)})),this._viewOnceCleanupTaskQueue.add(t))}))}getUnreadCount(){return this.filter((e=>e.shouldShowUnreadInTitle)).length}enableSortListener(e){this._sortEnabled||(this.listenTo(this,"change:t change:pin change:shouldAppearInList",this.sort),e&&this.sort(),this._sortEnabled=!0)}disableSortListener(){this._sortEnabled&&(this.stopListening(null,null,this.sort),this._sortEnabled=!1)}setIndexes(){this.forEach(((e,t)=>{e.initialIndex=t}))}getActive(){return this.filter((e=>e.active))[0]}unstarAllMessages(e,t){return(0,S.unstarAllMessages)(e,t)}forwardMessagesToChats(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,i.default)((function*(){const a=Promise.all(e.map((e=>(0,c.promiseProps)({message:e,canForward:(0,E.canMsgForward)(e)&&(null!=n(301460).MsgCollection.get(e.id)||e.isEphemeral)})))),u=yield Promise.all(t.filter((e=>e.canSend)).map(function(){var e=(0,i.default)((function*(e){let t;t=e.isUser&&e.contact.isBlocked()?(0,p.unblockContact)(e.contact):Promise.resolve(!0);const[n]=yield Promise.all([a,t]),i=(0,l.default)((0,s.default)(n,{canForward:!0}),"message"),o=(0,l.default)((0,s.default)(n,{canForward:!1}),"message");return(0,c.promiseProps)({chat:e,undelivered:e.forwardMessages(i,!0,r),canForward:i,cannotForward:o})}));return function(){return e.apply(this,arguments)}}())),d=(0,o.default)(u.map((e=>{let{chat:t,undelivered:n,canForward:r,cannotForward:i}=e,a=null;return(n.length||i.length)&&(a=(0,g.default)({chat:t,undelivered:n,canForward:r,cannotForward:i})),a?{chat:t,reason:a}:null})));if(d.length)throw new m.default(d);return!0}))()}saveToCache(){if(!h.Conn.shouldSaveToCache())return;const{id:e}=C.cachePolicy;__LOG__(2)`ChatCollection:saveToCache save: ${String(e)}`;const t=this.map(((e,t)=>{const n=e.toJSON(),r=t<20?Math.min(e.unreadCount+20,50):Math.min(Math.max(3,e.unreadCount),20);return n.msgs=e.msgs?e.msgs.slice(-r).map((e=>(0,a.default)(e.toJSON(),(e=>void 0!==e)))):[],n}));A.userPreferencesStore.setCollection(e,t,!0)}onResume(){const e=this.getActive();e&&e.presence.subscribe()}delete(){super.delete(),this.listenToOnce(this,"sort",(0,u.default)(this.setIndexes,100))}}t.ChatCollectionImpl=C,C.model=f.Chat,C.comparator=_.default;const P=new C;t.ChatCollection=P},909450:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cagAndCommunitySubjectDiffer=function(e){if(!e||!e.contact.name)return!1;const t=(0,a.chatCollection)().findFirst((t=>{var n,r;return(null===(n=t.groupMetadata)||void 0===n?void 0:n.parentGroup)===e.id&&(null===(r=t.groupMetadata)||void 0===r?void 0:r.defaultSubgroup)}));if(!t||!t.contact.name)return!1;return t.contact.name!==e.contact.name},t.canAddGroupToCommunity=function(e){if(!(null==e?void 0:e.groupMetadata)||l(e))return!1;const t=e.groupMetadata;return t.participants.iAmAdmin()||u(e)},t.canDeactivateCommunity=function(e){if(!(null==e?void 0:e.groupMetadata)||l(e))return!1;return u(e)},t.formatSubgroupUpdateTypes=function(e,t){return e.map((e=>{var n,r;const i=t?null===(n=(0,a.chatCollection)().get(e))||void 0===n?void 0:n.formattedTitle:null===(r=(0,a.unjoinedSubgroupMetaDataCollection)().get(e))||void 0===r?void 0:r.subject;return{id:e,subject:null!=i?i:""}}))},t.getCagIdFromCommunity=function(e){return(0,a.groupMetaDataCollection)().filter((t=>t.parentGroup===e&&!0===t.defaultSubgroup)).map((e=>e.id))},t.isCommunityCreator=u,t.isIntegritySuspendedCommunity=l;var r=n(287461),i=n(387196),a=n(130714),o=n(862159),s=n(459857);function l(e){var t;return(null==e||null===(t=e.groupMetadata)||void 0===t?void 0:t.groupType)===o.GroupType.COMMUNITY&&(0,i.isSuspendedGroup)(e)&&(0,r.getABPropConfigValue)("community_suspend_v0_enabled")}function u(e){if(!(null==e?void 0:e.groupMetadata))return!1;const t=e.groupMetadata;return t.participants.iAmSuperAdmin()||(0,s.isMeAccount)(t.owner)}},285874:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(287461);var i=(e,t)=>{const n=e.pin||0,i=t.pin||0;if(n||i)return n!==i?n>i?-1:1:e.id.toString()<t.id.toString()?-1:1;const a=(0,r.getABPropConfigValue)("offline_thread_meta_enabled")?Math.max(e.previewT||0,e.t||0):e.t||0,o=(0,r.getABPropConfigValue)("offline_thread_meta_enabled")?Math.max(t.previewT||0,t.t||0):t.t||0;return a!==o?a>o?-1:1:e.id.toString()<t.id.toString()?-1:1};t.default=i},451402:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FTS_TTL=t.ConversationEndOfHistoryTransferModelPropType=t.CHAT_KIND=void 0;const r=n(76672)({COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY:0,COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY:1,INCOMPLETE:2,NOT_INCLUDED_IN_HIST_SYNC:3});t.ConversationEndOfHistoryTransferModelPropType=r;t.FTS_TTL=3e5;t.CHAT_KIND={GROUP:"group",BROADCAST:"broadcast",CHAT:"chat",COMMUNITY:"community"}},376721:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(924583),o=n(984330),s=n(594534),l=n(301460),u=n(387191);class c extends s.BaseCollection{constructor(){var e;super(...arguments),e=this,this.hasDocBefore=!0,this._count=null,this.count=function(){var t=(0,i.default)((function*(t){var n;if(null!=e._count)return e._count;const r=t.msgs.filter(d),i=null!==(n=r[0])&&void 0!==n?n:t.msgs.head();if(null==i)return 0;try{var a;const t=null!==(a=(yield l.MsgCollection.queryMedia(i.id.remote,1/0,"before",i.id,"document")).length)&&void 0!==a?a:0,n=t>0&&r.length>0?1:0;return e._count=t+r.length-n,e._count}catch(e){return __LOG__(4,!0,new Error,!0)`Failed to count docs for chat ${t.id}`,SEND_LOGS(`md-failed-docs-count: ${e.message}`),null}}));return function(){return t.apply(this,arguments)}}()}delete(){super.delete(),this.stopListening(),this.reset()}add(e,t){return this._count=null,super.add(e,t)}remove(e,t){return this._count=null,super.remove(e,t)}queryDocs(e,t){if(t)return this.queryDocBefore||(this.queryDocBefore=l.MsgCollection.queryMedia(t.id.remote,l.MEDIA_QUERY_LIMIT,"before",t.id,"document").then((e=>((!e||e.length<l.MEDIA_QUERY_LIMIT)&&(this.hasDocBefore=!1),this.add(e.filter(d),{at:0}),{length:e.length}))).catch((0,a.filteredCatch)(o.E404,(()=>{}))).finally((()=>{this.queryDocBefore=null,this.trigger("query_doc_before")})),this.trigger("query_doc_before")),this.queryDocBefore;const n=e.msgs;if(0===this.length){if(!n||0===n.length)return this.hasDocBefore=!1,new Promise((e=>{e({eof:!0})}));this.add(n.filter(d),{at:0})}if(e.msgs.msgLoadState.noEarlierMsgs)return this.hasDocBefore=!1,new Promise((e=>{e({eof:!0})}));if(this.length<=2*l.MEDIA_QUERY_LIMIT){const t=0===this.length?n.head():this.head();return this.queryDocs(e,t)}return new Promise((e=>{e({eof:!1})}))}}function d(e){return null!=e.asDoc&&!e.isVcardOverMmsDocument}t.default=c,c.model=u.Msg},299261:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDisappearingModeInitiator=function(e){const t=(0,i.unproxy)(e);if(t.isGroup)return null;if(!(0,r.isDisappearingModeEnabled)())return null;if(null!=t.disappearingModeInitiator)return t.disappearingModeInitiator;if(s(t))return a.DisappearingModeInitiator.ChangedInChat;return null},t.getEphemeralSetting=o,t.getEphemeralSettingTimestamp=function(e){const t=(0,i.unproxy)(e);return t.isGroup||0===t.ephemeralSettingTimestamp?null:t.ephemeralSettingTimestamp},t.isEphemeralSettingOn=s,t.shouldShowEphemeralSetting=function(e){const t=(0,i.unproxy)(e);if(t.isPSA)return!1;if(t.isGroup){var n,r;const e=null===(n=t.groupMetadata)||void 0===n?void 0:n.participants.getSuperAdmin();if(null==e?void 0:e.contact.isEnterprise)return!1;if(!(null===(r=t.groupMetadata)||void 0===r?void 0:r.canSetEphemeralSetting())&&!s(t))return!1}return!t.isBroadcast&&!t.contact.isEnterprise};var r=n(493928),i=n(411067),a=n(808639);function o(e){var t;const n=(0,i.unproxy)(e),r=n.isGroup?null===(t=n.groupMetadata)||void 0===t?void 0:t.ephemeralDuration:n.ephemeralDuration;return null==r||0===r?null:r<0?(__LOG__(3)`[ephemeral] invalid duration of ${r} for chat ${n.id.toString()}`,null):r}function s(e){const t=o((0,i.unproxy)(e));return null!=t&&0!==t}},103846:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLastReceivedMsg=function(e){const t=(0,o.unproxy)(e);for(let e=t.msgs.length-1;e>=0;e--){const n=t.msgs.at(e);if(n&&(!n.local||n.ack>r.ACK.CLOCK))return n}return},t.getLastReceivedNonExpiredMsg=function(e,t){const n=(0,o.unproxy)(e);for(let e=n.msgs.length-1;e>=0;e--){const i=n.msgs.at(e);if(i&&(!i.local||i.ack>r.ACK.CLOCK)&&(!i.isEphemeral||null!=i.ephemeralExpirationTimestamp&&i.ephemeralExpirationTimestamp>t))return i}return},t.getLastTimestampMsg=function(e){const t=(0,o.unproxy)(e);for(let e=t.msgs.length-1;e>=0;e--){const n=t.msgs.at(e);if(n&&(0,a.eventTypeFromMsgType)(n)!==i.EventType.IGNORE)return n}return};var r=n(402994),i=n(147980),a=(n(387191),n(96219)),o=n(411067)},387196:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.canSendToGroup=function(e){const t=(0,u.unproxy)(e);return t.canSend&&!f(t)&&!p(t)},t.getParticipantCount=function(e){var t;const n=(0,u.unproxy)(e);return(null===(t=n.groupMetadata)||void 0===t?void 0:t.participants.length)||1},t.isCommunityAnnouncementGroup=_,t.isDeactivatedCommunityAnnouncementGroup=function(e){var t;const n=(0,u.unproxy)(e);return(null===(t=n.groupMetadata)||void 0===t?void 0:t.groupType)===s.GroupType.DEFAULT_ANNOUNCEMENT_GROUP&&p(n)},t.isIntegritySuspendedDefaultSubgroup=function(e){var t;const n=(0,u.unproxy)(e);return(null===(t=n.groupMetadata)||void 0===t?void 0:t.groupType)===s.GroupType.DEFAULT_ANNOUNCEMENT_GROUP&&f(n)&&(0,a.getABPropConfigValue)("community_suspend_v0_enabled")},t.isInviteGrowthLockedGroup=function(e){var t;const n=(0,u.unproxy)(e);return n.isGroup&&"invite"===(null===(t=n.groupMetadata)||void 0===t?void 0:t.growthLockType)&&(n.groupMetadata.growthLockExpiration||0)>(0,i.unixTime)()},t.isSupportGroup=d,t.isSupportGroupOrSupportAdmin=function(e){const t=(0,u.unproxy)(e);return d(t)||(0,o.default)(t.id.user)},t.isSuspendedGroup=f,t.isTerminatedGroup=p,t.isTerminatedGroupOrNotMember=function(e){var t;if(!e)return!1;const n=(0,u.unproxy)(e),r=p(n),i=f(n)&&!(null===(t=n.groupMetadata)||void 0===t?void 0:t.participants.iAmMember());return(r||i)&&!_(n)},t.shouldBlockCall=function(e){return f(e)||p(e)},t.shouldIncludeEntityIdInAppealRequest=function(){return(0,a.getABPropConfigValue)("group_suspend_appeal_include_entity_id_enabled")},t.updateReadOnly=function(e){var t;const n=(0,u.unproxy)(e);if(d(n)&&n.isReadOnly)return;let r=Promise.resolve();if(n.isGroup&&!(null===(t=n.groupMetadata)||void 0===t?void 0:t.stale)){var i;const e=!(null===(i=n.groupMetadata)||void 0===i?void 0:i.participants.iAmMember())||p(n);n.isReadOnly!==e&&(__LOG__(2)`chat:updateReadOnly:old ${n.isReadOnly}, new ${e}`,r=(0,c.updateLocal)(n.id,{isReadOnly:e}).then((()=>n.isReadOnly=e)))}r.then((()=>{n.isBroadcast&&n.updateTitle()}))};var i=n(990445),a=n(287461),o=r(n(143589)),s=n(862159),l=n(97858),u=n(411067),c=n(669880);function d(e){var t;if(!e)return!1;const n=(0,u.unproxy)(e);return n.isGroup&&!0===(null===(t=n.groupMetadata)||void 0===t?void 0:t.support)}function p(e){var t;const n=(0,u.unproxy)(e);return n.isGroup&&!!(null===(t=n.groupMetadata)||void 0===t?void 0:t.terminated)}function _(e){var t;const n=(0,u.unproxy)(e);return(0,l.communitiesEnabled)()&&n.isGroup&&(null===(t=n.groupMetadata)||void 0===t?void 0:t.groupType)===s.GroupType.DEFAULT_ANNOUNCEMENT_GROUP}function f(e){var t;if(!e)return!1;const n=(0,u.unproxy)(e);return n.isGroup&&!!(null===(t=n.groupMetadata)||void 0===t?void 0:t.suspended)}},246829:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(924583),o=n(962833),s=n(984330),l=n(594534),u=n(301460),c=n(344247),d=n(387191);class p extends l.BaseCollection{constructor(){var e;super(...arguments),e=this,this.hasLinkBefore=!0,this._count=null,this.count=function(){var t=(0,i.default)((function*(t){var n;if(null!=e._count)return e._count;const r=t.msgs.filter((e=>(0,c.getLinksFromMsg)(e).length>0)),i=null!==(n=r[0])&&void 0!==n?n:t.msgs.head();if(null==i)return 0;try{var a;const t=null!==(a=(yield u.MsgCollection.queryMedia(i.id.remote,1/0,"before",i.id,"url")).length)&&void 0!==a?a:0,n=t>0&&r.length>0?1:0;return e._count=t+r.length-n,e._count}catch(e){return __LOG__(4,!0,new Error,!0)`Failed to count medias for chat ${t.id}`,SEND_LOGS(`md-failed-medias-count: ${e.message}`),null}}));return function(){return t.apply(this,arguments)}}()}delete(){super.delete(),this.stopListening(),this.reset()}add(e,t){return this._count=null,super.add(e,t)}remove(e,t){return this._count=null,super.remove(e,t)}queryLinks(e,t){if(t)return this.queryLinkBefore||(this.queryLinkBefore=u.MsgCollection.queryMedia(t.id.remote,u.MEDIA_QUERY_LIMIT,"before",t.id,"url").then((e=>((!e||e.length<u.MEDIA_QUERY_LIMIT)&&(this.hasLinkBefore=!1),this.add(e,{at:0}),this.createLinksAndAddMsgs(e),{length:e.length}))).catch((0,a.filteredCatch)(s.E404,(()=>{}))).finally((()=>{this.queryLinkBefore=null,this.trigger("query_link_before")})),this.trigger("query_link_before")),this.queryLinkBefore;const n=e.msgs.getModelsArray();if(0===this.length){if(!n||0===n.length)return this.hasLinkBefore=!1,new Promise((e=>{e({eof:!0})}));this.add(n.filter((e=>(0,c.getLinksFromMsg)(e).length>0)),{at:0}),this.createLinksAndAddMsgs(n)}if(e.msgs.msgLoadState.noEarlierMsgs)return this.hasLinkBefore=!1,new Promise((e=>{e({eof:!0})}));if(this.length<=2*u.MEDIA_QUERY_LIMIT){const t=0===this.length?e.msgs.head():this.head();return this.queryLinks(e,t)}return new Promise((e=>{e({eof:!1})}))}createLinksAndAddMsgs(e){const t=[];(0,o.promiseLoop)(((n,r,i)=>{if(e.length===i)return void n();const a=e[i];if(null!=a){(0,c.getLinksFromMsg)(a).length&&t.push(a)}})).then((()=>{this.add(t),this.trigger("query_link_before")}))}}t.default=p,p.model=d.Msg,p.comparator=(e,t)=>e.t-t.t},987561:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.loadEarlierMsgs=function(){return A.apply(this,arguments)},t.loadMsgsPromiseLoop=O,t.loadRecentMsgs=function(e,t,n){const r=(0,S.unproxy)(e);let i=t;i||(i=r.msgs);return C(r,i)?Promise.resolve():i.msgLoadState.isLoadingRecentMsgs?i.loadRecentPromise:P(r,"after",i,T.default.WEBC_QUERY_TRIGGER_TYPE.USER_SCROLL,n)};var i=r(n(348926)),a=n(88237),o=n(989211),s=n(924583),l=r(n(132375)),u=n(36530),c=n(962833),d=r(n(99842)),p=n(984330),_=n(451402),f=(n(74753),n(292220)),h=r(n(495976)),g=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=v(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),m=n(301460),y=n(567538),E=(n(387191),n(192737)),S=n(411067),T=r(n(571834));function v(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(v=function(e){return e?n:t})(e)}function A(){return(A=(0,i.default)((function*(e,t,n,r){const i=(0,S.unproxy)(e);yield i.waitForChatLoading();let a=t;const o=null!=n?n:T.default.WEBC_QUERY_TRIGGER_TYPE.USER_SCROLL;if(a||(a=i.msgs),a.msgLoadState.noEarlierMsgs)return Promise.resolve();if(a.msgLoadState.isLoadingEarlierMsgs)return a.loadEarlierPromise;const s=a?a.head():null,l=yield P(i,"before",a,o,r),u=s?s.msgChunk:a;return u&&Array.isArray(l)&&l.length<f.PAGE_SIZE&&(u.msgLoadState.noEarlierMsgs=i.endOfHistoryTransferType!==_.ConversationEndOfHistoryTransferModelPropType.INCOMPLETE),u&&C(i,u)&&i.trigger("msgs:loadEarlier"),l}))).apply(this,arguments)}function C(e,t){return e.msgs===t}function P(e,t,n,r,i){let a;a="after"===t?n.last():n.head();let o={};a?o=a.id.clone():o.remote=e.id,o.count=f.PAGE_SIZE,o.direction=t;const s=(0,y.newMessageQueryEvent)(r);return O(e,a,n,m.MsgCollection.findQuery.bind(m.MsgCollection,o,{logOnSend:e=>{s.webcResponseBytes+=e.binarySize}}),t,s,!0,i)}function O(e,t,n,r,l,_){let f=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],m=arguments.length>7?arguments[7]:void 0;const v=(0,S.unproxy)(e),A=performance.now();"after"===l?(n.msgLoadState.isLoadingRecentMsgs=!0,_.webcMessageQueryType=T.default.WEBC_MESSAGE_QUERY_DIRECTION.LOAD_NEXT):"before"===l?(n.msgLoadState.isLoadingEarlierMsgs=!0,_.webcMessageQueryType=T.default.WEBC_MESSAGE_QUERY_DIRECTION.LOAD_PREV):"around"===l&&(n.msgLoadState.isLoadingAroundMsgs=!0,_.webcMessageQueryType=T.default.WEBC_MESSAGE_QUERY_DIRECTION.LOAD_AROUND),_.webcBrowserNetworkType=(0,E.getEffectiveNetworkType)(),_.webcChatType=v.getWebcChatType(),"number"==typeof v.initialIndex&&(_.webcChatPosition=v.initialIndex);const C=(0,d.default)([m,v.deleteSignal].filter(Boolean),(e=>(0,c.promiseLoop)(function(){var s=(0,i.default)((function*(i,s,c){if(e.aborted)throw new a.AbortError;const d=(0,u.delayMs)((0,o.expBackoff)(c,12e4,1e3,.1)),f=Promise.resolve();try{yield f;const o=yield r();if(e.aborted)throw new a.AbortError;let s;_.webcQueryT=Math.ceil(performance.now()-A),Array.isArray(o[0])?(s=o[0][0],o.forEach((e=>(0,y.logMessageCounts)(_,e)))):(s=o[0],(0,y.logMessageCounts)(_,o)),s&&(_.webcEarliestMessageT=s.t,s.msgChunk===v.msgs&&(_.webcEarliestMessageIndex=v.msgs.length-1)),(0,h.default)().then((e=>{e&&(_.webcBrowserStorageQuotaBytes=e.quota,_.webcBrowserStorageQuotaUsedBytes=e.usage)})).finally((()=>_.commit())),I(t,n,l),i(o)}catch(e){if(e.name===a.ABORT_ERROR)throw e;return c>3||404===e?(I(t,n,l),__LOG__(3)`chat:loadMsgs:error ${String(e)}`,404===e?Promise.reject(new p.E404):Promise.reject(new g.GaveUpRetry(`Gave up msg fetch after ${c} tries`))):d}}));return function(){return s.apply(this,arguments)}}(),0))).catch((0,s.filteredCatch)(g.GaveUpRetry,(()=>[]))).catch((0,s.filteredCatch)(p.E404,(e=>{if(f)return[];throw e})));return"after"===l?n.loadRecentPromise=C:"before"===l?n.loadEarlierPromise=C:"around"===l&&(n.loadAroundPromise=C),C}function I(e,t,n){const r=(null==e?void 0:e.msgChunk)&&e.msgChunk!==t;t.msgLoadState.contextLoaded=!0,e&&r&&((0,l.default)(e.msgChunk,"msg.msgChunk").msgLoadState.contextLoaded=!0),"after"===n?t.msgLoadState.isLoadingRecentMsgs=!1:"before"===n?t.msgLoadState.isLoadingEarlierMsgs=!1:"around"===n&&(t.msgLoadState.isLoadingAroundMsgs=!1)}},220479:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addMediaMsgs=function(e,t,n){if(!t)return;const r=(0,l.unproxy)(e),a=Array.isArray(t)?t:[t],o=[],c=[],d=[],p=[];a.forEach((e=>{u(e)&&o.push(e),e.asDoc&&d.push(e),(0,s.getGalleryLinks)(e).some((t=>t.href!==e.matchedText))&&c.push(e),null!=e.asProduct&&p.push(e)}));const{mediaMsgs:_}=r;if(_&&o.length){const e=(0,i.default)((0,i.default)({},n),{},{silent:!1});_.add(o,e)}r.linkMsgs&&c.length&&r.linkMsgs.add(c,n);r.docMsgs&&d.length&&r.docMsgs.add(d,n);r.productMsgs&&p.length&&r.productMsgs.add(p,n)},t.constructMediaMsgs=function(e,t){const n=(0,l.unproxy)(e);if(!t)return n.getMediaMsgs();if(t.isViewOnce)return new a.default;let r;n.getMediaMsgs().includes(t)||t.msgChunk===n.msgs?(r=n.getMediaMsgs(),r.hasMediaAfter=!1):r=new a.default;r.includes(t)||(t.msgChunk?r.add(t.msgChunk.filter(u)):r.add(t));return r},t.countAllMedia=function(e){const t=(0,l.unproxy)(e);if(null!=t.promises.sendDelete)return Promise.resolve(0);return Promise.all([t.getMediaMsgs(),t.getLinkMsgs(),t.getDocMsgs()].map((e=>e.count(t)))).then((e=>e.reduce(((e,t)=>e+(null!=t?t:0)),0)))},t.resetMediaMsgs=function(e){const t=(0,l.unproxy)(e),{mediaMsgs:n,linkMsgs:r,docMsgs:i,productMsgs:a}=t;n&&(n.delete(),n.queryMedia({chat:t}));r&&(r.delete(),r.queryLinks(t));i&&(i.delete(),i.queryDocs(t));a&&(a.delete(),a.queryProducts(t))},t.resetMediasCount=function(e,t){if(!o.LegacyPhoneFeatures.supportsFeature(o.LegacyPhoneFeatures.F.MEDIAS_COUNT))return;const n=(0,l.unproxy)(e);null!=t.mediaCount&&(n.mediaCount=t.mediaCount);null!=t.linkCount&&(n.linkCount=t.linkCount);null!=t.docCount&&(n.docCount=t.docCount)},t.updateMediasCountOnMsg=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!o.LegacyPhoneFeatures.supportsFeature(o.LegacyPhoneFeatures.F.MEDIAS_COUNT))return;const r=(0,l.unproxy)(e),i=n?-1:1;t.isMedia&&(r.mediaCount+=i);const a=(0,s.getLinksFromMsg)(t).length;a&&(r.linkCount+=i*a);t.asDoc&&(r.docCount+=i)};var i=r(n(81109)),a=r(n(2917)),o=n(390912),s=n(344247),l=(n(387191),n(411067));function u(e){return e.isMedia&&!e.isViewOnce}},2917:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(924583),o=n(984330),s=n(594534),l=n(220479),u=n(301460),c=n(387191);const d="before",p="after";function _(e){return e.isMedia&&!e.isViewOnce}class f extends s.BaseCollection{constructor(){var e;super(...arguments),e=this,this.hasMediaBefore=!0,this.hasMediaAfter=!0,this._count=null,this.count=function(){var t=(0,i.default)((function*(t){var n;if(null!=e._count)return e._count;const r=t.msgs.filter(_),i=null!==(n=r[0])&&void 0!==n?n:t.msgs.head();if(null==i)return 0;try{var a;const t=null!==(a=(yield u.MsgCollection.queryMedia(i.id.remote,1/0,"before",i.id)).mediaCount)&&void 0!==a?a:0,n=t>0&&r.length>0?1:0;return e._count=t+r.length-n,e._count}catch(e){return __LOG__(4,!0,new Error,!0)`Failed to count medias for chat ${t.id}`,SEND_LOGS(`md-failed-medias-count: ${e.message}`),null}}));return function(){return t.apply(this,arguments)}}()}delete(){super.delete(),this.stopListening()}add(e,t){return this._count=null,super.add(e,t)}remove(e,t){return this._count=null,super.remove(e,t)}getAfter(e){const t=this.indexOf(e);return t<0||t===this.length-1?null:this.at(t+1)}getBefore(e){const t=this.indexOf(e);return t<=0?null:this.at(t-1)}loadEarlierMedias(){const e=this.head();e&&this.queryMedia({msg:e})}loadRecentMedias(){const e=this.last();e&&this.queryMedia({msg:e,direction:p})}loadMoreAroundIfNeeded(e){if(!e||e.isViewOnce)return;const t=this.indexOf(e);t<20&&this.hasMediaBefore&&this.loadEarlierMedias(),this.length-t<20&&this.hasMediaAfter&&this.loadRecentMedias()}queryMedia(e){var t;const{chat:n,msg:r}=e,i=null!==(t=e.direction)&&void 0!==t?t:d;if(!r&&n){const e=n.msgs;if(!e||0===e.length)return this.hasMediaBefore=!1,new Promise((e=>{e({eof:!0})}));this.add(e.filter(_),{at:0});const t=this.toArray();if(n.msgs.msgLoadState.noEarlierMsgs)return this.hasMediaBefore=!1,new Promise((e=>{e({eof:!0})}));if(t.length<=2*u.MEDIA_QUERY_LIMIT){const r=0===t.length?e.head():t[0];return this.queryMedia({chat:n,msg:r})}return new Promise((e=>{e({eof:!1})}))}if(r&&i===d){if(this.queryMediaBefore)return this.queryMediaBefore;let e=0;return this.queryMediaBefore=u.MsgCollection.queryMedia(r.id.remote,u.MEDIA_QUERY_LIMIT,i,r.isMedia?r.id:void 0).then((t=>{const r=t.messages;(!r||r.length<u.MEDIA_QUERY_LIMIT)&&(this.hasMediaBefore=!1);let i=[];r&&r.length>0&&(i=r.filter(_)),this.add(i,{at:0});const a={mediaCount:t.mediaCount,linkCount:t.linkCount,docCount:t.docCount};return n&&(0,l.resetMediasCount)(n,a),e=i.length,{length:e}})).catch((0,a.filteredCatch)(o.E404,(()=>{}))).finally((()=>{this.queryMediaBefore=null,this.trigger("query_media_before",e)})),this.trigger("query_media_before",0),this.queryMediaBefore}if(r&&i===p)return this.queryMediaAfter?this.queryMediaAfter:this.queryMediaAfter=u.MsgCollection.queryMedia(r.id.remote,u.MEDIA_QUERY_LIMIT,i,r.id).then((e=>{const t=e.messages;(!t||t.length<u.MEDIA_QUERY_LIMIT)&&(this.hasMediaAfter=!1);let r=[];t&&t.length>0&&(r=t.filter(_)),this.add(r);const i={mediaCount:e.mediaCount,linkCount:e.linkCount,docCount:e.docCount};return n&&(0,l.resetMediasCount)(n,i),{length:r.length}})).catch((0,a.filteredCatch)(o.E404,(()=>{}))).finally((()=>{this.queryMediaAfter=null,this.trigger("query_media_after")}))}}t.default=f,f.model=c.Msg,f.comparator=(e,t)=>e.t-t.t},738599:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.clearFtsCache=function(e){(0,g.unproxy)(e).ftsCache={}},t.fts=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0;const i=(0,g.unproxy)(e);if(1===n){const e=i.ftsCache[t];if(e)return e;const a=p.MsgCollection.search(t,n,r,i.id);i.ftsCache[t]=a;const o=()=>{i.ftsCache[t]=null};return setTimeout(o,s.FTS_TTL),a.catch(o),a}return p.MsgCollection.search(t,n,r,i.id)},t.getSearchContext=function(e,t,n){const r=(0,g.unproxy)(e);let i,o=null;t instanceof h.Msg?o=t:t instanceof f.default&&(i=t);let c=o?o.msgChunk:void 0;const y=Math.trunc(d.PAGE_SIZE/3*2);if(!c||!c.msgLoadState.contextLoaded){c||(c=new u.ChatMsgsCollection,r.msgChunks.push(c),o&&c.add(o));const e=o?o.id.clone():i.clone();e.count=y;const t=function(){if(o)return o.msgChunk;if(null!=i){const e=p.MsgCollection.get(i);return(null==e?void 0:e.msgChunk)?e.msgChunk:c}return c},d=(0,_.newMessageQueryEvent)(m.default.WEBC_QUERY_TRIGGER_TYPE.SEARCH_RESULT_CLICK);l.loadMsgsPromiseLoop(r,o,c,p.MsgCollection.getContext.bind(p.MsgCollection,e,t,(e=>{d.webcResponseBytes+=e.binarySize})),"around",d,null==n).then((e=>{const n=t();n&&c&&n!==c&&r.notifyMsgCollectionMerge(n,c,n);const l=e[0],u=i?p.MsgCollection.get(i):o;u&&Array.isArray(l)&&l.length<y&&((0,a.default)(u.msgChunk,"loadedMsg.msgChunk").msgLoadState.noEarlierMsgs=r.endOfHistoryTransferType!==s.ConversationEndOfHistoryTransferModelPropType.INCOMPLETE,c&&u.msgChunk!==c&&(c.msgLoadState.noEarlierMsgs=r.endOfHistoryTransferType!==s.ConversationEndOfHistoryTransferModelPropType.INCOMPLETE))})).catch((()=>{n&&(n.isQuotedMsgAvailable=!1)}))}return{collection:c,msg:o,key:i,highlightMsg:!0}},t.matchFilter=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=(0,g.unproxy)(e);if((0,i.default)(t))return!0;if(t.label)return n.labels&&n.labels.includes(t.label);if(t.kind===c.SEARCH_FILTERS.UNREAD)return!!n.hasUnread&&!n.isBroadcast||(0,o.canAssignChats)()&&n.isAssignedToMe&&n.unopenedByAssignedAgent;if(t.kind===c.SEARCH_FILTERS.CONTACT)return n.contact.isMyContact&&!n.contact.isGroup&&!n.isBroadcast;if(t.kind===c.SEARCH_FILTERS.NON_CONTACT)return!n.contact.isMyContact&&!n.contact.isGroup&&!n.isBroadcast;if(t.kind===c.SEARCH_FILTERS.ASSIGNED_TO_YOU)return(0,o.canAssignChats)()&&n.isAssignedToMe;return t.kind===c.SEARCH_FILTERS.cast(n.kind)};var i=r(n(441609)),a=r(n(132375)),o=n(319266),s=n(451402),l=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(987561)),u=n(74753),c=n(2754),d=n(292220),p=n(301460),_=n(567538),f=r(n(565754)),h=n(387191),g=n(411067),m=r(n(571834));function y(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(y=function(e){return e?n:t})(e)}},413497:(e,t,n)=>{"use strict";var r=n(170315).default,i=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Chat=void 0,t.getForwardedMessageFields=Ue;var a=i(n(348926)),o=i(n(957557)),s=i(n(875472)),l=i(n(766678)),u=i(n(441609)),c=i(n(23279)),d=n(88237),p=n(924583),_=i(n(424646)),f=i(n(132375)),h=n(36530),g=i(n(99842)),m=n(990445),y=n(287461),E=n(493928),S=n(402994),T=i(n(164325)),v=n(599459),A=n(984330),C=n(54918),P=n(72696),O=n(388536),I=n(387202),M=n(451402),b=i(n(376721)),R=n(299261),N=n(103846),w=n(387196),L=i(n(246829)),D=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=De(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(987561)),k=n(220479),U=i(n(2917)),G=n(738599),x=n(984025),B=i(n(750871)),F=i(n(106177)),j=n(780549),Y=n(266888),K=i(n(846870)),H=i(n(155858)),W=n(121977),V=i(n(799132)),$=n(862159),z=n(307988),q=n(111624),J=n(557242),Q=i(n(932325)),X=n(928563),Z=n(390912),ee=n(644234),te=i(n(565754)),ne=n(344247),re=(n(387191),n(96219)),ie=n(373070),ae=n(52136),oe=n(323829),se=n(671598),le=n(828927),ue=n(935234),ce=n(312784),de=n(697180),pe=n(257630),_e=n(214028),fe=n(446556),he=n(662469),ge=i(n(802635)),me=n(87429),ye=n(168661),Ee=n(227834),Se=n(147034),Te=i(n(642034)),ve=n(987523),Ae=n(757453),Ce=n(459857),Pe=i(n(887927)),Oe=n(208182),Ie=i(n(571834)),Me=i(n(124928)),be=n(669050),Re=n(669880),Ne=n(901289),we=(n(808639),n(986632)),Le=n(548360);function De(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(De=function(e){return e?n:t})(e)}class ke extends ge.default{constructor(){super(...arguments),this.id=(0,C.prop)(),this.t=(0,C.prop)(),this.unreadCount=(0,C.prop)(0),this.archive=(0,C.prop)(),this.isReadOnly=(0,C.prop)(),this.isAnnounceGrpRestrict=(0,C.prop)(),this.modifyTag=(0,C.prop)(),this.muteExpiration=(0,C.prop)(0),this.isAutoMuted=(0,C.prop)(!1),this.name=(0,C.prop)(),this.notSpam=(0,C.prop)(),this.pin=(0,C.prop)(),this.labels=(0,C.prop)(),this.changeNumberOldJid=(0,C.prop)(),this.changeNumberNewJid=(0,C.prop)(),this.lastReceivedKey=(0,C.prop)(),this.ephemeralDuration=(0,C.prop)(),this.ephemeralSettingTimestamp=(0,C.prop)(),this.disappearingModeInitiator=(0,C.prop)(),this.createdLocally=(0,C.session)(),this.pendingAction=(0,C.session)(),this.formattedTitle=(0,C.session)(),this.active=(0,C.session)(),this.pausedTimerId=(0,C.session)(),this.presenceResendTimerId=(0,C.session)(),this.recording=(0,C.session)(),this.typing=(0,C.session)(),this.colors=(0,C.session)(),this.composeContents=(0,C.session)((()=>({}))),this.attachMediaContents=(0,C.session)(),this.isComposingPoll=(0,C.session)(!1),this.pttRecordingSession=(0,C.session)(),this.squelch=(0,C.session)(),this.reactionSquelch=(0,C.session)(),this.pendingSeenCount=(0,C.session)(0),this.unreadMsgAnchor=(0,C.session)(),this.markedUnread=(0,C.session)(),this.trusted=(0,C.session)(),this.canSend=(0,C.session)(),this.promises=(0,C.session)((()=>({}))),this.ftsCache=(0,C.session)((()=>({}))),this.composeQuotedMsg=(0,C.session)(),this.composeQuotedMsgRemoteJid=(0,C.session)(),this.quotedMsgAdminGroupJid=(0,C.session)(),this.quotedMsgAdminGroupSubject=(0,C.session)(),this.quotedMsgAdminParentGroupJid=(0,C.session)(),this.groupMetadata=(0,C.session)(),this.presence=(0,C.session)(),this.mute=(0,C.session)(),this.contact=(0,C.session)(),this.liveLocation=(0,C.session)(),this.liveLocationQueried=(0,C.session)(!1),this.mediaCount=(0,C.session)(0),this.linkCount=(0,C.session)(0),this.docCount=(0,C.session)(0),this.productCount=(0,C.session)(0),this.pendingDeleteForMeCount=(0,C.session)(0),this.isParentGroup=(0,C.session)(),this.unreadMentionsOfMe=(0,C.prop)(),this.unreadMentionCount=(0,C.prop)(),this.hasUnreadMention=(0,C.prop)(!1),this.archiveAtMentionViewedInDrawer=(0,C.prop)(!1),this.hasChatBeenOpened=(0,C.prop)(!1),this.tcToken=(0,C.prop)(),this.tcTokenTimestamp=(0,C.prop)(),this.tcTokenSenderTimestamp=(0,C.prop)(),this.msgUnsyncedButtonReplyMsgs=(0,C.prop)(),this.vcardDismissed=(0,C.session)(!1),this.endOfHistoryTransfer=(0,C.session)(!1),this.endOfHistoryTransferType=(0,C.prop)(),this.hasEstablishedE2EESession=(0,C.session)(!1),this.pendingInitialLoading=(0,C.prop)(!1),this.lastReactionPreview=(0,C.prop)(),this.chatlistPreview=(0,C.prop)(),this.previewT=(0,C.prop)(),this.unopenedByAssignedAgent=(0,C.session)(!1),this.isAssignedToMe=(0,C.session)(!1),this.assignedAgent=(0,C.session)(),this.kind=(0,C.derived)((function(){var e;return Me.default.isGroup(this.id)?(null===(e=this.groupMetadata)||void 0===e?void 0:e.groupType)===$.GroupType.COMMUNITY?M.CHAT_KIND.COMMUNITY:M.CHAT_KIND.GROUP:Me.default.isBroadcast(this.id)?M.CHAT_KIND.BROADCAST:Me.default.isUser(this.id)?M.CHAT_KIND.CHAT:void __LOG__(2)`chat:unknown kind id:${this.id.toString()}`})),this.isUser=(0,C.derived)((function(){return Me.default.isUser(this.id)})),this.isPSA=(0,C.derived)((function(){return Me.default.isPSA(this.id)})),this.isIAS=(0,C.derived)((function(){return Me.default.isIAS(this.id)})),this.isGroup=(0,C.derived)((function(){return Me.default.isGroup(this.id)})),this.isCAG=(0,C.derived)((function(){var e;return this.isGroup&&(null===(e=this.groupMetadata)||void 0===e?void 0:e.groupType)===$.GroupType.DEFAULT_ANNOUNCEMENT_GROUP})),this.isBroadcast=(0,C.derived)((function(){return Me.default.isBroadcast(this.id)})),this.isBusinessGroup=(0,C.derived)((function(){var e;const t=null===(e=this.groupMetadata)||void 0===e?void 0:e.participants.getAdmins();if(!t)return!1;for(const e of t){const t=W.ContactCollection.get(e.id);if(null==t?void 0:t.isBusiness)return!0}return!1})),this.canUnread=(0,C.derived)((function(){return!this.isBroadcast})),this.hasUnread=(0,C.derived)((function(){return 0!==this.unreadCount}),["unreadCount"]),this.optimisticUnreadCount=(0,C.derived)((function(){const{unreadCount:e,pendingSeenCount:t}=this;return e===K.default.MARKED_AS_UNREAD?e:Math.max(0,e-t)}),["unreadCount","pendingSeenCount"]),this.shouldShowUnreadDivider=(0,C.derived)((function(){if(0===this.unreadCount)return!1;if(this.unreadMsgAnchor){const{msgChunk:e}=this.unreadMsgAnchor,t=e?e.getModelsArray():[];return this.unreadMsgAnchor!==t.find((e=>e.isUnreadType))}if(this.msgs.msgLoadState.noEarlierMsgs){return this.msgs.filter((e=>e.isUnreadType)).length!==this.unreadCount}return!0}),["unreadCount","unreadMsgAnchor"]),this.shouldAppearInList=(0,C.derived)((function(){if(this.isBroadcast)return"chat"===this.id.user;if(Me.default.isStatusV3(this.id))return!1;if(this.endOfHistoryTransferType===M.ConversationEndOfHistoryTransferModelPropType.NOT_INCLUDED_IN_HIST_SYNC&&0===this.msgs.length)return!1;if(this.isGroup&&!0===this.isParentGroup)return!1;if(this._shouldAppearInListLatched)return!0;const e=this.msgs.some((e=>!(e.type===ie.MSG_TYPE.GROUPS_V4_INVITE&&e.from.equals((0,Ce.getMaybeMeUser)())||e.isInitialE2ENotification||e.type===ie.MSG_TYPE.CALL_LOG||e.isBizNotification||["change_number","masked_thread_created"].includes(e.subtype)||e.isDisappearingModeSystemMessage)));return this._shouldAppearInListLatched=!this.createdLocally||e,this._shouldAppearInListLatched}),["createdLocally","msgs","msgsLength","isParentGroup"]),this.previewMessage=(0,C.derived)((function(){for(let e=this.msgs.length-1;e>=0;e--){const t=this.msgs.at(e);if(t&&t.type!==ie.MSG_TYPE.E2E_NOTIFICATION&&(t.type!==ie.MSG_TYPE.NOTIFICATION_TEMPLATE||"chat_assignment"===t.subtype||"chat_assignment_unassign"===t.subtype)&&t.type!==ie.MSG_TYPE.REACTION&&t.type!==ie.MSG_TYPE.POLL_UPDATE&&t.type!==ie.MSG_TYPE.KEEP_IN_CHAT&&!t.pendingDeleteForMe)return t}if(this.msgs.length>0)return this.msgs.last()}),["msgs","msgsChanged","pendingDeleteForMeCount"]),this.showChangeNumberNotification=(0,C.derived)((function(){const{changeNumberOldJid:e,changeNumberNewJid:t,id:n,isUser:r}=this;if(!r)return!1;if(!e&&!t)return!1;const i=W.ContactCollection.get(t||n);return!(null==i?void 0:i.isMyContact)}),["changeNumberOldJid","changeNumberNewJid","id","isUser"]),this.shouldShowUnreadInTitle=(0,C.derived)((function(){var e;const t=!!this.muteExpiration;if(this.archive)return!1;if(this.optimisticUnreadCount<=0)return!1;if(!this.isGroup)return!t;if((null===(e=this.groupMetadata)||void 0===e?void 0:e.groupType)===$.GroupType.COMMUNITY)return!1;if(!t)return!0;if(!this.msgs||0===this.msgs.length)return!1;let n=!1;const r=this.msgs,i=this.optimisticUnreadCount;let a=Math.max(0,r.length-i);for(;a<r.length;a++){const e=this.msgs.at(a);if(!e)continue;const t=(0,Ce.getMaybeMeUser)();if(e.isMentioned(t)||(0,de.isQuotedMsg)(e,t)){const t=this.getCollection().get(e.sender);if(!t||!t.muteExpiration){n=!0;break}}}return n}),["isGroup","archive","optimisticUnreadCount","muteExpiration"]),this.deleteSignal=(0,C.derived)((function(){return this._abortController.signal})),this.derivedLastAddOnPreview=(0,C.derived)((function(){if(this.chatlistPreview)return this.chatlistPreview;const{lastReactionPreview:e}=this;return e?(0,X.lastAddOnPreviewFromDeprecatedLastReactionPreview)(e):void 0}),["chatlistPreview","lastReactionPreview"])}initialize(){super.initialize(),this.addQueue=new _.default,this.sendQueue=new _.default,this._ephemeralMessagesToDelete=new Set,this._ephemeralMessageTimerIds=new Map,this._abortController=new r,this.msgs.msgLoadState.contextLoaded=!0,this.addChild("presence",ue.PresenceCollection.gadd(this.id));const e=ae.MuteCollection.get(this.id);if(e?this.addChild("mute",e):this.addChild("mute",ae.MuteCollection.gadd({id:this.id,expiration:this.muteExpiration,isAutoMuted:this.isAutoMuted})),this.listenTo(this.mute,"change:expiration",this.updateMuteExpiration),this.listenTo(this.mute,"change:isAutoMuted",this.updateMuteIsAutoMuted),this.addChild("contact",W.ContactCollection.gadd(this.id)),this.name&&!this.contact.name){const e={name:this.name};this.isGroup?this.contact.set(e):(0,Ne.updateLocal)(this.contact.id,e).then((()=>{this.contact.set(e)}))}if(this.listenTo(this.contact,"change:name",this.updateTitle),this.listenTo(this.contact,"change:isContactBlocked",this.updateCanSend),this.isGroup&&(this.trusted=!0),this.listenTo(me.TosManager,"change",this.updateCanSend),this.listenTo(this.contact,"change:privacyMode",this.updateCanSend),this.isGroup||this.isBroadcast){const e=this.getGroupMetadataCollection();let t;this.isBroadcast&&!e.get(this.id)&&(t=!0);const n=e.gadd(this.id);if(this.addChild("groupMetadata",n),this.listenTo(n,"change:stale change:announce",this._updateIsAnnounceGrpRestrict),this.listenTo(n.participants,"change:isAdmin bulk_add bulk_remove",this._updateIsAnnounceGrpRestrict),this.listenTo(n,"change:trusted change:stale",this.isTrusted),this.listenTo(n,"change:participants change:stale change:suspended change:terminated",(()=>{(0,w.updateReadOnly)(this)})),this.listenTo(n.participants,"change:contact.formattedShortName",this.updateTitle),(0,E.isGroupCatchUpEnabled)()){if(this.unreadMentionsOfMe){const e=this.unreadMentionsOfMe.map((e=>new Te.default({id:e.id,timestamp:e.timestamp})));n.unreadMentionMetadata.addUnreadMentions(e,z.UnreadMessageType.PERSISTANCE_LOAD)}null!=this.unreadMentionCount&&(n.unreadMentionMetadata.pendingUnreadMentionCount=this.unreadMentionCount),this._handleUnreadMention(),this.listenTo(n.unreadMentionMetadata.unreadMentionCollection,"add remove reset",this._handleUnreadMention),this.listenTo(n.unreadMentionMetadata,"change:pendingUnreadMentionCount",this._handleUnreadMention)}(0,w.updateReadOnly)(this),this._updateIsAnnounceGrpRestrict();const r=this.id;this.listenTo(this,"change:isReadOnly",(function(){this.isTrusted(),this.updateCanSend(),e.update(r)})),this.listenTo(this,"change:isAnnounceGrpRestrict",this.updateCanSend),this.listenTo(this,"change:archive",(()=>{!0===this.archive&&(0,fe.shouldEnableArchiveV2)()&&(0,he.setArchiveEnabledSetting)(!0)})),this.listenTo(n,"change:isParentGroup",(()=>{this.isParentGroup=n.isParentGroup})),this.isParentGroup=n.isParentGroup,t&&e.update(r)}else this.listenTo(this.presence,"change:isOnline",(()=>(0,le.presenceOnlineChanged)(this)));const t=this.getCollection();t.notSpam[this.id]&&!this.notSpam&&(0,_e.sendNotSpam)(this).catch((()=>{})),t.notSpam[this.id]=!!this.notSpam,this.notSpam||this.listenTo(this,"change:notSpam",this._handleNotSpamChange),this.updateTitle(),this.isTrusted(),this.updateCanSend(),this.listenTo(this.contact,"change:isMyContact",this.isTrusted),this.listenTo(this.msgs,"add",(e=>{(0,q.handleNewMsgForChat)(this,e)})),this.listenTo(this.msgs,"update_sort_time",this.updateSortTime),this.listenTo(this.msgs,"bulk_add",((e,t)=>(0,k.addMediaMsgs)(this,e,t))),this.listenTo(this.msgs,"add",this._deregisterExpiredViewOnceMessage),this.listenTo(this.msgs,"bulk_add",this.deregisterExpiredViewOnceBulkMessages),this.listenTo(this.msgs,"add remove change:ephemeralExpirationTimestamp change:kicState",this._resetEphemeralMessageExpirationTimer),this.listenTo(this.msgs,"bulk_add",(e=>{e.forEach((e=>{this._resetEphemeralMessageExpirationTimer(e)}))})),this.listenTo(this.msgs,"change:kicState",(e=>{const t=this.keptMsgs;t&&(e.isKept?t.add(e):t.remove(e))})),this.listenTo(this,"change:msgs",(()=>(0,k.resetMediaMsgs)(this))),this.saveAssignedColorsDebounced=(0,c.default)((()=>(0,x.saveAssignedColors)(this)),1e3),this.listenTo(this,"change:active",this._handleActiveUpdate),this.pendingAction=0,this.listenTo(this,"change:t change:modifyTag",(()=>(0,G.clearFtsCache)(this))),this.listenTo(Q.default,"locale_change",(()=>{this.updateTitle()})),Y.Conn.isSMB&&((0,O.initializeLabels)(this),this._initializeChatAssignment())}_initializeChatAssignment(){if((0,P.chatAssignmentEnabled)()){this.set("unopenedByAssignedAgent",I.ChatAssignmentCollection.getChatUnopenedStatus(this.id));const e=I.ChatAssignmentCollection.getAgentCollectionForChatId(this.id);this.set("isAssignedToMe",this._getIsAssignedToMe()),this.set("assignedAgent",e.at(0)),this.listenTo(e,"add remove change",(()=>{this.set("unopenedByAssignedAgent",I.ChatAssignmentCollection.getChatUnopenedStatus(this.id)),this.set("isAssignedToMe",this._getIsAssignedToMe()),this.set("assignedAgent",e.at(0))}))}}_getIsAssignedToMe(){const e=(0,Ce.assertGetMe)().getDeviceId();return I.ChatAssignmentCollection.getAgentCollectionForChatId(this.id).getModelsArray().some((t=>t.deviceId===e))}_handleUnreadMention(){this.isGroup&&this.groupMetadata&&(0,E.isElevatedImportantMessageEnabled)()&&(this.hasUnreadMention=this.groupMetadata.unreadMentionMetadata.getUnreadMentionCount()>0)}set(e,t,n){"string"==typeof e?("muteExpiration"===e&&this.mute&&this.mute.setMute(t),"isAutoMuted"===e&&this.mute&&this.mute.setAutoMuted(t)):e.hasOwnProperty("muteExpiration")&&this.mute&&this.mute.setMute(e.muteExpiration,e.isAutoMuted);return super.set(e,t,n)}addPendingAction(e){const t=()=>{this.decPending()};e.then(t,t),this.pendingAction++}decPending(){this.pendingAction>0?this.pendingAction--:(__LOG__(2)`chat:onPendingActionUpdate pendingAction value is invalid`,this.pendingAction=0)}_handleActiveUpdate(){if(this.isGroup&&this.active&&(this.squelch=K.default.SQUELCH_RESET_VALUE,this.reactionSquelch=K.default.SQUELCH_RESET_VALUE,this.hasChatBeenOpened=!0),this.presence.chatActive=this.active,!this.active){this.msgs.filter((e=>(0,Oe.isExpired)(e.safe()))).forEach(ee.deregisterMsg);const e=Array.from(this._ephemeralMessagesToDelete);(0,v.removeExpiredMessagesFromHistory)(e).then((()=>{const t=e.map((e=>e.id.toString()));if(t.length>0){(0,ve.deleteModelsForLastAddOnPreview)(t);(0,n(628905).getJobManager)().waitUntilPersisted(oe.jobSerializers.deleteAddOns(this.id.toString(),t))}})),this._ephemeralMessagesToDelete.forEach((e=>{this._ephemeralMessagesToDelete.delete(e),e.delete({skipUpdatingSortTime:!0,doNotResetLastReceived:!0})}))}}_handlePendingActionUpdate(){this.pendingAction<0&&(__LOG__(2)`chat:onPendingActionUpdate pendingAction value is invalid`,this.pendingAction=0)}_handleNotSpamChange(){this.getCollection().notSpam[this.id]=this.notSpam,this.isTrusted(),this.notSpam&&this.stopListening(this,"change:notSpam")}senderMsgCount(){return this.getAllMsgs().filter((e=>!e.isSentByMe&&!e.isNotification)).length}hasMaybeSentMsgToChat(){return this.getAllMsgs().some((e=>e.isSentByMe))}isTrusted(){let e=!1;var t;this.isGroup?e=this.isReadOnly||this.notSpam||(null===(t=this.groupMetadata)||void 0===t?void 0:t.isTrusted()):this.isBroadcast?e=!0:this.isUser&&(e=this.notSpam||this.contact.isMyContact);return!e&&this.hasMaybeSentMsgToChat()&&(e=!0),this.trusted=Boolean(e)}canBlockFromNotification(){return(0,y.getABPropConfigValue)("block_from_notification")&&this.isUser&&!this.isTrusted()}updateMuteExpiration(){const e=Number(this.mute.expiration);(0,Re.updateLocal)(this.id,{muteExpiration:e}).then((()=>this.muteExpiration=e))}updateMuteIsAutoMuted(){const e=Boolean(this.mute.isAutoMuted);(0,Re.updateLocal)(this.id,{isAutoMuted:e}).then((()=>this.isAutoMuted=e))}updateTitle(){var e,t,n;if(this.isBroadcast)this.formattedTitle=null!==(e=this.contact.name)&&void 0!==e?e:(null!==(t=null===(n=this.groupMetadata)||void 0===n?void 0:n.participants)&&void 0!==t?t:[]).map((function(e){return e.contact.formattedShortName})).join(", ");else if(this.isUser){var r;this.formattedTitle=null!==(r=this.contact.getFormattedUser())&&void 0!==r?r:""}else if(this.isGroup){var i,a;this.formattedTitle=null!==(i=this.contact.name)&&void 0!==i?i:null===(a=this.groupMetadata)||void 0===a?void 0:a.subject}}title(){var e;return this.isGroup?null!==(e=this.formattedTitle)&&void 0!==e?e:Le.fbt._("Unknown subject",null,{hk:"1SrFOZ"}).toString():this.formattedTitle}getTcToken(){return null==this.tcToken||null==this.tcTokenTimestamp||(0,Se.isTokenExpired)(this.tcTokenTimestamp,Se.TcTokenMode.Receiver)?null:this.tcToken}isPresenceUnknown(){return!(!(0,y.getABPropConfigValue)("trusted_contacts_ti")||null!=this.getTcToken())}updateCanSend(){return this.isReadOnly||this.isAnnounceGrpRestrict||(0,Ee.shouldBlockByTos)(this.contact)||(0,ye.shouldBlockByCountry)(this.contact)?this.canSend=!1:this.isUser?this.canSend=!(this.contact.isContactBlocked||this.isPSA||this.isIAS):this.canSend=!0}delete(){super.delete(),this.getCollection().remove(this.id),this._abortController.abort(),this.presence.delete(),this.liveLocation&&this.liveLocation.delete(),j.Cmd.closeChat(this),this.groupMetadata&&this.groupMetadata.delete(),this.mediaMsgs&&this.mediaMsgs.delete(),this.linkMsgs&&this.linkMsgs.delete(),this.docMsgs&&this.docMsgs.delete(),this.productMsgs&&this.productMsgs.delete();const e=this.starredMsgs;e&&(e.delete(),e.stopListening(),e.reset()),this.receivedVcardMsgs&&this.receivedVcardMsgs.delete(),(0,Ae.deleteComposeContents)(this.id)}isDirty(){return 0!==this.unreadCount}canPin(){var e;if(this.archive)return!1;const t=null===(e=this.promises)||void 0===e?void 0:e.setArchive;return!(null==t?void 0:t.archive)}canArchive(){return!this.isBroadcast||Z.LegacyPhoneFeatures.supportsFeature(Z.LegacyPhoneFeatures.F.ARCHIVE_BROADCAST)}setComposeContents(e){this.composeContents=e}getSessionPersistedComposeContents(){return(0,Ae.getComposeContents)(this.id)}getComposeContents(){return(0,u.default)(this.composeContents)?this.getSessionPersistedComposeContents()||{}:this.composeContents}setAttachMediaContents(e){this.attachMediaContents=e}isComposing(){const{text:e}=this.composeContents;return Boolean(e)||this.isComposingPoll}preload(){1===this.msgs.length&&D.loadEarlierMsgs(this).catch((0,p.filteredCatch)(A.E404,(()=>{}))).catch((e=>{__LOG__(2)`chat:preload failed\n${e}`}))}onEmptyMRM(){__LOG__(2)`models:Chat:removeMsg 0 messages left, querying...`,D.loadEarlierMsgs(this).catch((0,p.filteredCatch)(A.E404,(()=>{}))).catch((e=>{__LOG__(2)`chat:onEmptyMRM failed\n${e}`}))}deleteMsgs(e,t){this.deleteMsgsBeforeMsgInclusive(void 0,!e,t)}deleteMsgsOlderThan(e,t,n){const r=this.msgs;let i=r.head();!i||i.t>=e||(i=r.last(),i&&i.t<e?this.deleteMsgs(t,n):this.deleteMsgsPartial((function(r){return r&&(n&&!(0,re.msgMatchesType)(r,n)||r.star&&!t||r.t>=e||r.isInitialE2ENotification)})))}deleteMsgsBeforeMsgInclusive(e){let t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0;if(e){if(!this.msgs.get(e.id))return;t=this.msgs.indexOf(e)}else t=this.msgs.length;this.deleteMsgsPartial((function(e,i){return r&&!(0,re.msgMatchesType)(e,r)||e.msgChunk===this.msgs&&i>t||n&&e.star||e.isInitialE2ENotification&&n}),!0)}deleteMsgsPartial(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.unreadCount;if(this.getAllCMCs().forEach((n=>{const r=n.filter(((t,n,r)=>!e.apply(this,[t,n,r])));n.remove(r,void 0,t),r.forEach((e=>{e.delete()}))})),(0,l.default)(this.msgChunks).forEach((e=>{0===e.length&&this.removeMsgsCollection(e)})),this.msgs.length>0){const e=n>this.msgs.length?this.msgs.length:n;(0,Re.updateLocal)(this.id,{unreadCount:e}).then((()=>{this.unreadCount=e,this.msgs.msgLoadState.noEarlierMsgs=this.endOfHistoryTransferType!==M.ConversationEndOfHistoryTransferModelPropType.INCOMPLETE}))}}deleteMessages(e){this.deleteMsgsPartial((t=>!e.includes(t.id.toString())),!0),0===this.getAllMsgs().length&&D.loadEarlierMsgs(this)}getLastMsgKeyForAction(){const e=this.msgs.last();let t;return e&&(t=!this.lastReceivedKey||e.id.fromMe&&e.local&&e.ack===S.ACK.CLOCK?e.id:this.lastReceivedKey),t||void 0}getWebcChatType(){switch(this.kind){case M.CHAT_KIND.CHAT:return Ie.default.WEBC_CHAT_TYPE.INDIVIDUAL;case M.CHAT_KIND.GROUP:return Ie.default.WEBC_CHAT_TYPE.GROUP;case M.CHAT_KIND.BROADCAST:return Ie.default.WEBC_CHAT_TYPE.BROADCAST_LIST;case M.CHAT_KIND.COMMUNITY:return Ie.default.WEBC_CHAT_TYPE.COMMUNITY;default:throw new TypeError(`Invalid Chat.kind ${String(this.kind)}`)}}getMdChatAssignmentChatType(){switch(this.kind){case M.CHAT_KIND.CHAT:return Ie.default.MD_CHAT_ASSIGNMENT_CHAT_TYPE.INDIVIDUAL;case M.CHAT_KIND.GROUP:return Ie.default.MD_CHAT_ASSIGNMENT_CHAT_TYPE.GROUP;case M.CHAT_KIND.BROADCAST:return Ie.default.MD_CHAT_ASSIGNMENT_CHAT_TYPE.BROADCAST_LIST;case M.CHAT_KIND.COMMUNITY:return Ie.default.MD_CHAT_ASSIGNMENT_CHAT_TYPE.COMMUNITY;default:throw new TypeError(`Invalid Chat.kind ${String(this.kind)}`)}}getChatAssignmentChatType(){switch(this.kind){case M.CHAT_KIND.CHAT:return Ie.default.CHAT_ASSIGNMENT_CHAT_TYPE.INDIVIDUAL;case M.CHAT_KIND.GROUP:return Ie.default.CHAT_ASSIGNMENT_CHAT_TYPE.GROUP;case M.CHAT_KIND.BROADCAST:return Ie.default.CHAT_ASSIGNMENT_CHAT_TYPE.COMMUNITY;default:throw new TypeError(`Invalid Chat.kind ${String(this.kind)}`)}}deregisterExpiredViewOnceBulkMessages(e){e.forEach(this._deregisterExpiredViewOnceMessage)}_deregisterExpiredViewOnceMessage(e){(0,Oe.isExpired)(e.safe())&&(0,ee.deregisterMsg)(e)}_resetEphemeralMessageExpirationTimer(e){var t=this;T.default.clearTimeout(this._ephemeralMessageTimerIds.get(e)),this._ephemeralMessageTimerIds.delete(e),this._ephemeralMessagesToDelete.delete(e);const{ephemeralExpirationTimestamp:r}=e;if(null==r||!this.msgs.includes(e)||e.isKept)return;const i=function(){var r=(0,a.default)((function*(){if(t._ephemeralMessageTimerIds.delete(e),t.active)t._ephemeralMessagesToDelete.add(e);else{yield(0,v.removeExpiredMessagesFromHistory)([e]),(0,ve.deleteModelsForLastAddOnPreview)([e.id.toString()]);const r=n(628905).getJobManager;yield r().waitUntilPersisted(oe.jobSerializers.deleteAddOns(t.id.toString(),[e.id.toString()])),e.delete({skipUpdatingSortTime:!0,doNotResetLastReceived:!0})}}));return function(){return r.apply(this,arguments)}}();if(e.isExpired())i();else{const t=T.default.setGlobalTimeout(i,1e3*r);this._ephemeralMessageTimerIds.set(e,t)}}sendProductMessage(e,t){var n=this;return(0,a.default)((function*(){yield(0,ce.sendProductMessage)(n,e,t)}))()}_isMediaMsg(e){return Boolean(e.asMms&&!e.ctwaContext)}isUnreadMsg(e){const t=this.msgs.filter((e=>e.isUnreadType));return t.includes(e,t.length-this.unreadCount)}_forwardMessageAndSendToChat(e,t){var n=this;let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return(0,a.default)((function*(){if(n._isMediaMsg(e))return void(yield(0,ee.forwardMediaMsg)(e,n,r,i));const a=Ue(e),o=(0,Ce.getMaybeMeUser)();let s;t.isGroup()&&(s=(0,be.toUserWid)(o));const l=new te.default({from:o,to:t,id:te.default.newId(),participant:s,selfDir:"out"});e.ctwaContext&&(a.body=e.ctwaContext.sourceUrl,a.type=ie.MSG_TYPE.CHAT,a.mediaObject=void 0),(0,R.isEphemeralSettingOn)(n)&&(a.ephemeralDuration=(0,R.getEphemeralSetting)(n));const u=(0,R.getEphemeralSettingTimestamp)(n);null!=u&&(a.ephemeralSettingTimestamp=u);const c=(0,R.getDisappearingModeInitiator)(n);return null!=c&&(a.disappearingModeInitiator=c),Object.assign(a,{id:l,from:o,t:(0,m.unixTime)(),to:t,ack:S.ACK.CLOCK,participant:void 0,local:!0,self:"out",isNewMsg:!0,star:!1,isForwarded:e.isForwarded||!e.isSentByMe,forwardedFromWeb:!0,forwardingScore:e.getForwardingScoreWhenForwarded(),multicast:r}),(0,pe.addAndSendMsgToChat)(n,a),Promise.resolve()}))()}forwardMessages(e){var t=this;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,a.default)((function*(){const i=t.id,a=t.contact;if(a.isUser&&a.isBlocked())throw new H.default("Forwarded to contact is blocked",a);const o=[];for(const a of e)try{yield t._forwardMessageAndSendToChat(a,i,n,r)}catch(e){t._isMediaMsg(a)&&o.push(a)}return o}))()}_updateIsAnnounceGrpRestrict(){const e=this.groupMetadata;if(this.isGroup&&null!=e&&!e.stale){const t=!e.participants.iAmAdmin()&&e.announce;this.isAnnounceGrpRestrict!==t&&(__LOG__(2)`chat:_updateIsAnnounceGrpRestrict:old ${this.isAnnounceGrpRestrict}, new: ${t}`,(0,Re.updateLocal)(this.id,{isAnnounceGrpRestrict:t}).then((()=>this.isAnnounceGrpRestrict=t)))}}sortMsgs(e){const t=e.map((e=>{const t=(0,f.default)(e.msgChunk,"msg.msgChunk");return{msg:e,chunkT:(0,f.default)(t.at(0),"chunk.at(0)").t,index:t.indexOf(e)}}));return(0,s.default)(t,["chunkT","index"]).map((e=>e.msg))}waitForChatLoading(){let e=Promise.resolve();return this.pendingInitialLoading&&(e=(0,V.default)(this,"change:pendingInitialLoading",(()=>!this.pendingInitialLoading))),e}unstarAll(){const e=this.getAllMsgs();e.forEach((e=>{e&&(e.star=!1)})),(0,we.removeStarredMsgs)(e)}updateSortTime(){if(this.promises.updateSortTime)return;const e=new r,t=e.signal,n=(0,g.default)([t,this._abortController.signal],(e=>(0,h.delayMs)(0).then((()=>{const e=(0,N.getLastTimestampMsg)(this);if(e)this.t=e.t;else if(!this.msgs.msgLoadState.noEarlierMsgs&&!this.pendingMsgs)return D.loadEarlierMsgs(this)})).then((t=>{if(e.aborted)throw new d.AbortError;if(t){const e=(0,N.getLastTimestampMsg)(this);this.t=e?e.t:void 0}})).catch((()=>{})).finally((()=>{this.promises.updateSortTime=void 0}))));this.promises.updateSortTime={promise:n,abortController:e}}removeFromCollection(e){var t;(e.star&&(0,we.removeStarredMsgs)([e]),e.isMedia&&this.mediaMsgs?this.mediaMsgs.remove(e):(0,ne.getLinksFromMsg)(e).length>0&&this.linkMsgs?this.linkMsgs.remove(e):e.asDoc&&this.docMsgs?this.docMsgs.remove(e):null!=e.asProduct&&this.productMsgs&&this.productMsgs.remove(e),e.isKept&&this.keptMsgs&&this.keptMsgs.remove(e),(0,k.updateMediasCountOnMsg)(this,e,!0),(0,E.isGroupCatchUpEnabled)()&&e.chat.isGroup)&&(null===(t=e.chat.groupMetadata)||void 0===t||t.unreadMentionMetadata.removeUnreadMentions(e.id.toString()))}getMediaMsgs(){return this.mediaMsgs||(this.mediaMsgs=new U.default),this.mediaMsgs}getLinkMsgs(){return this.linkMsgs||(this.linkMsgs=new L.default),this.linkMsgs}getDocMsgs(){return this.docMsgs||(this.docMsgs=new b.default),this.docMsgs}getParticipantCount(){var e;return(null===(e=this.groupMetadata)||void 0===e?void 0:e.participants.length)||1}iAmAdmin(){return!!this.groupMetadata&&this.groupMetadata.participants.iAmAdmin()}getProductMsgs(){return this.productMsgs||(this.productMsgs=new B.default),this.productMsgs}getReceivedVcardMsgs(){return this.contact.isMyContact||!this.contact.isUser?null:(this.receivedVcardMsgs||(this.receivedVcardMsgs=new F.default,this.receivedVcardMsgs.parent=this),this.receivedVcardMsgs)}dismissVcard(){this.vcardDismissed=!0}getStarredMsgs(){let e=this.starredMsgs;return e||(this.starredMsgs=e=new we.StarredMsgCollection,this.starredMsgs.add(we.AllStarredMsgsCollection.filter((e=>e.chat===this)))),e}hasStarredMsgs(){return this.getStarredMsgs().length>0}getKeptMsgs(){let e=this.keptMsgs;return e||(this.keptMsgs=e=new J.KeptMsgCollection,this.keptMsgs.add(this.msgs.filter((e=>e.isKept)))),e}hasKeptMsgs(){return this.msgs.some((e=>e.isKept))}hasKicSystemMessage(){return this.msgs.some((e=>"gp2"===e.type&&"ephemeral_keep_in_chat"===e.subtype))}canSendPolls(){var e;return null==this.groupMetadata?(0,se.isPollsCreationEnabledInOneOnOneChats)():(0,se.isPollsCreationEnabled)()&&(null===(e=this.groupMetadata)||void 0===e?void 0:e.groupType)!==$.GroupType.DEFAULT_ANNOUNCEMENT_GROUP}getCollection(){return n(965012).ChatCollection}getGroupMetadataCollection(){return n(318797).default}}function Ue(e){var t;let n=["buttons","caption","broadcast","ephemeralDuration","ephemeralSettingTimestamp","ephemeralStartTimestamp","ephemeralOutOfSync","dynamicReplyButtons","replyButtons","isMdHistoryMsg","bizPrivacyStatus","kicState","kicKey","kicTimestampMs","kicNotified"];!0===e.isDynamicReplyButtonsMsg&&e.type===ie.MSG_TYPE.CHAT||(n=["footer",...n]),(null===(t=e.quotedMsg)||void 0===t?void 0:t.type)!==ie.MSG_TYPE.PRODUCT&&(n=["quotedMsg","quotedParticipant","quotedRemoteJid","quotedStanzaID",...n]);const r=e.asUrl;return null==r||null==r.mediaKeyTimestamp||(0,Pe.default)(r.mediaKeyTimestamp)||(n=["mediaKey","mediaKeyTimestamp","thumbnailHQ","thumbnailDirectPath","thumbnailSha256","thumbnailEncSha256","thumbnailHeight","thumbnailWidth",...n]),(0,o.default)(e.toJSON(),n)}ke.Proxy="chat",ke.idClass=Me.default;const Ge=(0,C.defineModel)(ke);t.Chat=Ge},74753:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MsgLoadState=t.ChatMsgsCollection=void 0;var i=r(n(81109)),a=n(594534),o=n(54918),s=n(975565),l=n(387191),u=r(n(441143));class c extends o.BaseModel{constructor(){super(...arguments),this.noEarlierMsgs=(0,o.prop)(),this.isLoadingEarlierMsgs=(0,o.prop)(),this.isLoadingRecentMsgs=(0,o.prop)(),this.isLoadingAroundMsgs=(0,o.prop)(),this.contextLoaded=(0,o.prop)()}}c.Proxy="msgLoad";const d=(0,o.defineModel)(c);t.MsgLoadState=d;class p extends a.BaseCollection{constructor(){super(),this.msgLoadState=new d({noEarlierMsgs:!1,isLoadingEarlierMsgs:!1,isLoadingRecentMsgs:!1,isLoadingAroundMsgs:!1,contextLoaded:!1}),this.listenTo(this,"add remove reset sort",this.triggerChangeLast)}delete(){this.stopListening(),super.delete(),this.msgLoadState.delete()}triggerChangeLast(e,t,n){const r=this.last();if(this._last!==r){this._last=r;let i=!1;const a=!!n.add,o=!!n.remove;t.includes(e)&&a&&!o&&(i=!0),this.trigger("change:last",r,i)}}add(e,t){let r;Array.isArray(e)?1===e.length&&(r=e[0]):r=e;let a=[];if(null!=r&&(r.isInitialE2ENotification||r.isDisappearingModeSystemMessage)){const n=this.some((e=>e.isInitialE2ENotification));if(r.isInitialE2ENotification&&(n||(a=super.add(e,(0,i.default)((0,i.default)({},t),{},{at:0})))),r.isDisappearingModeSystemMessage){if(!this.some((e=>e.isDisappearingModeSystemMessage))){const r=n?1:0;a=super.add(e,(0,i.default)((0,i.default)({},t),{},{at:r}))}}a&&this.trigger("insert_msgs",a,t)}else a=super.add(e,t);if(a.length>0){const e=n(301460).MsgCollection.add(a,t);e.forEach((e=>{e&&this.isModel(e)&&(e.msgChunk=this)})),this.trigger("bulk_add",a,t),e.forEach((e=>(0,s.logDeepConversation)(e)))}return a}remove(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=super.remove(e,t),i=!!t&&t.silent,a=r.filter((e=>!!e));return a.length&&!i&&(this.trigger("remove_msgs",a,t),n||this.trigger("update_sort_time")),r}replace(e){this.msgLoadState=e.msgLoadState,this.loadRecentPromise=e.loadRecentPromise,this.loadEarlierPromise=e.loadEarlierPromise,this.loadAroundPromise=e.loadAroundPromise;const t=e.getModelsArray();this.set(t,{silent:!0,merge:!1}),t.forEach((e=>{this.isModel(e)&&(e.msgChunk=this)})),this.trigger("bulk_add",t)}onMsgLoadStateChange(e){let t;const n=()=>{e()},r=()=>{(0,u.default)(null!=t,"prevMsgLoadState cannot be null after bulk_add"),t.off("change",n);const r=this.msgLoadState;r.on("change",n),t=r,e()};t=this.msgLoadState,t.on("change",n),this.on("bulk_add",r);let i=()=>{(0,u.default)(null!=t,"prevMsgLoadState cannot be null when unsubscribing"),this.off("bulk_add",r),t.off("change",n)};return()=>{const e=i;e&&(i=null,e())}}}t.ChatMsgsCollection=p,p.model=l.Msg},984025:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getAssignedColor=function(e,t){const n=(0,s.unproxy)(e),r=n.colors||(n.colors=function(e){const t=(0,s.unproxy)(e);t.groupMetadata&&t.listenTo(t.groupMetadata.participants,"remove reset",u);return(0,l.getGroupParticipantAssignedColor)(t.id)||{}}(n));let a;const c=(0,o.default)(t.toString());if(a=r[c])return a;const d={};(0,i.default)(r,((e,t)=>{d[e]?d[e].push(t):d[e]=[t]}));let p=Number.POSITIVE_INFINITY;for(let e=1;e<=17;e++){if(!d[e]){a=e;break}d[e].length<p&&(p=d[e].length,a=e)}return r[c]=a,n.saveAssignedColorsDebounced(),a},t.saveAssignedColors=function(e){const t=(0,s.unproxy)(e),n=t.colors;n&&(0,l.setGroupParticipantAssignedColor)(t.id,n)};var i=r(n(402525)),a=r(n(291966)),o=r(n(706223)),s=n(411067),l=n(757453);function u(e){var t,n;const r=(0,s.unproxy)(e);if(!r.colors)return;const i=null!==(t=null===(n=r.groupMetadata)||void 0===n?void 0:n.participants)&&void 0!==t?t:[],l=r.colors,u=(0,a.default)(Object.keys(l),i.map((e=>e.id.toString())).map(o.default));u.forEach((function(e){delete l[e]})),u.length&&r.saveAssignedColorsDebounced()}},875130:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(154549),i=n(594534),a=n(934886),o=n(94872),s=n(905225);class l extends i.BaseCollection{initializeFromCache(e){this.add([{id:a.DEFAULT_PREFERENCE,wallpaperColor:s.DEFAULT_CHAT_WALLPAPER,saveToCameraRoll:!0,showDoodle:!0},...e||[]],{merge:!0})}get(e){return super.get(e)||super.get(a.DEFAULT_PREFERENCE)}delete(){super.delete(),this.add({id:a.DEFAULT_PREFERENCE,wallpaperColor:s.DEFAULT_CHAT_WALLPAPER,saveToCameraRoll:!0,showDoodle:!0})}}l.model=a.ChatPreference,l.cachePolicy={id:o.COLLECTIONS_KEYS.CHAT_PREFERENCE_COLLECTION,policy:r.CACHE_POLICY.LOAD,delay:1e3};var u=new l;t.default=u},934886:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_PREFERENCE=t.ChatPreference=void 0;var i=n(54918),a=r(n(124928));const o="defaultPreference";t.DEFAULT_PREFERENCE=o;class s extends i.BaseModel{constructor(){super(...arguments),this.id=(0,i.prop)(),this.wallpaperColor=(0,i.prop)(),this.saveToCameraRoll=(0,i.prop)(),this.showDoodle=(0,i.prop)()}getCollection(){return n(875130).default}}s.Proxy="chatPreference",s.idClass=a.default,s.allowedIds=[o];const l=(0,i.defineModel)(s);t.ChatPreference=l},106177:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(924583),i=n(984330),a=n(594534),o=n(390912),s=n(301460),l=n(387191);class u extends a.BaseCollection{constructor(){super(...arguments),this.syncPromise=null,this.isSynced=!1}onResume(){this.isSynced=!1,this.sync(this.parent)}sync(e){return o.LegacyPhoneFeatures.supportsFeature(o.LegacyPhoneFeatures.F.INDEX_RECEIVED_VCARD)?this.isSynced?Promise.resolve():(this.syncPromise||(this.syncPromise=s.MsgCollection.queryVcard(e.id).then((e=>this.add(e))).catch((0,r.filteredCatch)(i.E499,(()=>{}))).catch((()=>{})).finally((()=>{this.isSynced=!0,this.syncPromise=null}))),this.syncPromise):(this.isSynced=!0,Promise.resolve())}}t.default=u,u.model=l.Msg,u.resumeOnAvailable=!0},152310:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(801156)),a=r(n(642034));class o extends i.default{oldestUnreadMention(){var e;const t=null!==(e=this.last())&&void 0!==e?e:null;return t&&this.remove(t),t}}t.default=o,o.model=a.default,o.comparator=(e,t)=>t.timestamp-e.timestamp},52136:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MuteCollectionImpl=t.MuteCollection=void 0;var r=n(154549),i=n(594534),a=n(266888),o=n(708394),s=n(94872),l=n(117429),u=n(53575);let c=!0,d=!0,p=!1,_=!1,f=!1,h=!1,g=!1;class m extends i.BaseCollection{initializeFromCache(e){Array.isArray(e)?e.forEach((e=>{[o.GLOBAL_MUTE,o.GLOBAL_REACTIONS_MUTE].includes(e.id)&&this.add(e,{remove:!1})})):null!=e&&e.id===o.GLOBAL_MUTE&&this.add(e,{remove:!1}),this.setGlobalNotifications((0,l.getGlobalNotifications)()),this.setGlobalOfflineNotifications((0,l.getGlobalOfflineNotifications)()),this.setGlobalSounds((0,l.getGlobalSounds)()),this.setGlobalCallRingtone((0,l.getGlobalCallRingtone)()),this.setGlobalPreviews((0,l.getGlobalPreviews)()),this.setCollapseMuted((0,l.getCollapseMuted)()),this.setOutgoingMessageSound((0,l.getOutgoingMessageSound)()),this.setIgnoreNondirectGroupMsg((0,l.getIgnoreNondirectGroupMsg)())}saveToCache(){if(!a.Conn.shouldSaveToCache())return;const{id:e}=this.constructor.cachePolicy,t=[];__LOG__(2)`models:mute:cache-save: ${String(e)}`;const n=this.get(o.GLOBAL_MUTE),r=this.get(o.GLOBAL_REACTIONS_MUTE);n&&t.push(n.toJSON()),r&&t.push(r.toJSON()),t.length?u.userPreferencesStore.setCollection(e,t):__LOG__(3)`models:mute:cache-save: globalMuteModel or globalReactionsMuteModel does not exist`}globalMute(){const e=this.get(o.GLOBAL_MUTE);return e||this.add({id:o.GLOBAL_MUTE})[0]}globalReactionsMute(){const e=this.get(o.GLOBAL_REACTIONS_MUTE);return e||this.add({id:o.GLOBAL_REACTIONS_MUTE})[0]}getGlobalSounds(){return c}setGlobalSounds(e){c=e,(0,l.setGlobalSounds)(e)}getGlobalCallRingtone(){return d}setGlobalCallRingtone(e){d=e,(0,l.setGlobalCallRingtone)(e)}getGlobalNotifications(){return p}setGlobalNotifications(e){p=e,(0,l.setGlobalNotifications)(e)}getGlobalOfflineNotifications(){return _}setGlobalOfflineNotifications(e){_=e,(0,l.setGlobalOfflineNotifications)(e)}getGlobalPreviews(){return f}setGlobalPreviews(e){f=e,(0,l.setGlobalPreviews)(e)}getCollapseMuted(){return h}setCollapseMuted(e){h=e,(0,l.setCollapseMuted)(e),this.trigger("change:collapseMuted",h)}getOutgoingMessageSound(){return g}setOutgoingMessageSound(e){g=e,(0,l.setOutgoingMessageSound)(e)}getIgnoreNondirectGroupMsg(){return!1}setIgnoreNondirectGroupMsg(e){}}t.MuteCollectionImpl=m,m.model=o.Mute,m.cachePolicy={id:s.COLLECTIONS_KEYS.MUTE_COLLECTION,policy:r.CACHE_POLICY.LOAD,delay:1e3};const y=new m;t.MuteCollection=y},708394:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Mute=t.GLOBAL_REACTIONS_MUTE=t.GLOBAL_MUTE=void 0;var i=n(425315),a=n(287461),o=n(328620),s=r(n(164325)),l=n(54918),u=r(n(932325)),c=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=m(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),d=n(390737),p=n(459857),_=r(n(124928)),f=n(379040),h=r(n(730381)),g=n(785893);function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(m=function(e){return e?n:t})(e)}const y="global_mute";t.GLOBAL_MUTE=y;const E="global_reactions_mute";t.GLOBAL_REACTIONS_MUTE=E;class S extends l.BaseModel{constructor(){super(...arguments),this.id=(0,l.prop)(),this.expiration=(0,l.prop)(0),this.callExpiration=(0,l.prop)(0),this.isAutoMuted=(0,l.prop)(!1),this._unmuteTimer=(0,l.session)(),this._unmuteCallTimer=(0,l.session)(),this.promises=(0,l.session)((()=>({mute:null,unmute:null}))),this.isMuted=(0,l.derived)((function(){return!!this.expiration}),["expiration"]),this.isCallMuted=(0,l.derived)((function(){return!!this.callExpiration}),["callExpiration"])}initialize(){super.initialize(),null!=this.expiration&&0!==this.expiration&&this.mute({expiration_:this.expiration,isAutoMuted:this.isAutoMuted}),null!=this.callExpiration&&0!==this.callExpiration&&this.muteCall(this.callExpiration)}setMute(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;(e||this.expiration)&&e!==this.expiration&&(e?this.mute({expiration_:e,isAutoMuted:t,sendDevice:n}):this.unmute({sendDevice:n}))}setAutoMuted(e){this.set({isAutoMuted:e})}mute(e){let{expiration_:t,sendDevice:n,toastId_:r,fromMultiselect:a=!1,isAutoMuted:l=!1}=e,p=t;if(!(0,i.isNumber)(p))return __LOG__(2)`models:Mute:mute called with invalid expiration ${p}`,Promise.reject(new c.ActionError);p=Math.round(p),p>2e9&&__LOG__(2)`models:Mute:mute called with wrong units?${this.id.toString()} exp:${p}`;const m=()=>{if(this.isMuted&&(s.default.clearTimeout(this._unmuteTimer),this.unset("_unmuteTimer")),-1===p)__LOG__(2)`models:Mute:mute ${this.id.toString()} muted, no expiration`;else{const e=p-(0,h.default)().unix();__LOG__(2)`models:Mute:mute ${this.id.toString()} duration:${e}`,this._unmuteTimer=s.default.setGlobalTimeout(this.unmute.bind(this),1e3*p)}this.set({expiration:p,isAutoMuted:l})},y=!a&&_.default.isGroup(this.id);if(n){if(this.promises.mute)return this.promises.mute;const e=this.promises.mute=(0,f.sendConversationMute)(this.id,p,this.expiration,l),t=y?new o.ActionType(u.default.t(65)):new o.ActionType(u.default.t(31)),i=r||(0,o.genId)(),s=this.promises.mute.catch((()=>{__LOG__(3)`models:Mute:mute dropped`;const e=y?u.default.t(63):u.default.t(29);throw new o.ActionType(e,{actionText:u.default.t(122),actionHandler:this.mute.bind(this,p,l,n,i)})})).then((e=>{if(200===e.status){const e=y?u.default.t(64):u.default.t(30);return a?new o.ActionType(e):new o.ActionType(e,{actionText:u.default.t(126),actionHandler:this.unmute.bind(this,n,i)})}if(e.status>=400)throw y?new o.ActionType(u.default.t(63)):new o.ActionType(u.default.t(29))}));return d.ToastManager.open((0,g.jsx)(o.ActionToast,{id:i,initialAction:t,pendingAction:s})),e.then((function(e){200===e.status&&!0!==e._duplicate&&m()})).finally((()=>{this.promises.mute=null}))}return m(),Promise.resolve()}muteCall(e){let t=e;if(!(0,i.isNumber)(t))return __LOG__(2)`models:Mute:muteCall called with invalid expiration ${t}`,Promise.reject(new c.ActionError);if(t=Math.round(t),t>2e9&&__LOG__(2)`models:Mute:muteCall called with wrong units?${this.id.toString()} exp:${t}`,this.isCallMuted&&(s.default.clearTimeout(this._unmuteCallTimer),this.unset("_unmuteCallTimer")),-1===t)__LOG__(2)`models:Mute:muteCall ${this.id.toString()} muted, no expiration`;else{const e=t-(0,h.default)().unix();__LOG__(2)`models:Mute:muteCall ${this.id.toString()} duration:${e}`,this._unmuteCallTimer=s.default.setGlobalTimeout(this.unmuteCall.bind(this),1e3*t)}return this.set({callExpiration:t}),Promise.resolve()}canMute(){let e=!1;if((0,p.isMeAccount)(this.id)&&(0,a.getABPropConfigValue)("note_to_self"))return!1;if(_.default.isGroup(this.id)){const t=n(318797).default.get(this.id);t&&(e=t.participants.iAmMember())}return e||_.default.isUser(this.id)}_clearUnmuteTimer(){s.default.clearTimeout(this._unmuteTimer),this.unset("_unmuteTimer"),this.expiration=0}_clearUnmuteCallTimer(){s.default.clearTimeout(this._unmuteCallTimer),this.unset("_unmuteCallTimer"),this.callExpiration=0}unmute(){let{sendDevice:e,toastId_:t,fromMultiselect:n=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=()=>{__LOG__(2)`models:Mute:unmute ${this.id.toString()}`,this._clearUnmuteTimer(),this.set({isAutoMuted:false})},i=!n&&_.default.isGroup(this.id);if(e){if(this.promises.unmute)return this.promises.unmute;const n=this.promises.unmute=(0,f.sendConversationMute)(this.id,0,this.expiration,false),a=i?new o.ActionType(u.default.t(72)):new o.ActionType(u.default.t(42)),s=t||(0,o.genId)(),l=this.promises.unmute.catch((()=>{__LOG__(3)`models:Mute:unmute dropped`;const t=i?u.default.t(70):u.default.t(40);throw new o.ActionType(t,{actionText:u.default.t(122),actionHandler:this.unmute.bind(this,e,s)})})).then((e=>{if(200===e.status)return i?new o.ActionType(u.default.t(71)):new o.ActionType(u.default.t(41));if(e.status>=400)throw i?new o.ActionType(u.default.t(70)):new o.ActionType(u.default.t(40))}));return d.ToastManager.open((0,g.jsx)(o.ActionToast,{id:s,initialAction:a,pendingAction:l})),n.then((function(e){200===e.status&&!0!==e._duplicate&&r()})).finally((()=>{this.promises.unmute=null}))}return r(),Promise.resolve()}unmuteCall(){return __LOG__(2)`models:Mute:unmuteCall ${this.id.toString()}`,this._clearUnmuteCallTimer(),Promise.resolve()}delete(){super.delete(),this.getCollection().remove(this.id),this._clearUnmuteTimer()}getCollection(){return n(52136).MuteCollection}}S.Proxy="mute",S.idClass=_.default,S.allowedIds=[y,E];const T=(0,l.defineModel)(S);t.Mute=T},802635:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(82569)),a=r(n(385564)),o=n(54918),s=n(74753);class l extends o.BaseModel{constructor(){super(...arguments),this.id=(0,o.prop)(),this.pendingMsgs=(0,o.prop)(),this.labels=(0,o.prop)(),this.msgChunks=(0,o.session)((()=>[])),this.lastReceivedKey=(0,o.session)(),this.unreadMsgAnchor=(0,o.session)(),this.disableUnreadAnchor=(0,o.session)(),this.msgsLength=(0,o.session)(),this.msgsChanged=(0,o.session)(0),this.msgs=(0,o.collection)(s.ChatMsgsCollection)}initialize(){super.initialize(),this.listenTo(this.msgs,"change:last",(()=>{this.msgsChanged++})),this.listenTo(this.msgs,"add remove bulk_add",(()=>{this.msgsChanged++,this.msgsLength=this.msgs.length}))}onEmptyMRM(){throw new Error("onEmptyMRM not implemented")}delete(){super.delete(),this.getAllCMCs().forEach((e=>{e.forEach((e=>{e.delete()})),e.delete()}))}removeMsg(e){const t=e.msgChunk;if(!t)return;t.indexOf(e)<0||(__LOG__(2)`models:Chat:removeMsg ${e.get("id")}`,t.remove(e),0===t.length&&(t===this.msgs?this.onEmptyMRM():this.removeMsgsCollection(t)))}getAllCMCs(){return this.msgChunks.concat([this.msgs])}getAllMsgs(){return(0,a.default)(this.getAllCMCs().map((e=>e.getModelsArray())))}replaceMsgsCollection(e){__LOG__(2)`model:Chat:replaceMsgsCollection:${this.id.toString()}`;const t={msg:e.last()};this.msgs.replace(e),this.notifyMsgCollectionMerge(e,this.msgs,this.msgs,t),this.msgChunks=(0,i.default)(this.msgChunks,e),e.delete()}removeMsgsCollection(e){this.msgChunks=(0,i.default)(this.msgChunks,e),e.delete()}notifyMsgCollectionMerge(e,t,n,r){this.trigger("change:cmc:merge",e,t,n,r)}}t.default=l},642034:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(54918);class i extends r.BaseModel{constructor(){super(...arguments),this.id=(0,r.prop)(),this.timestamp=(0,r.prop)()}}i.Proxy="unreadMention";var a=(0,r.defineModel)(i);t.default=a},507964:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return s.apply(this,arguments)};var i=r(n(348926)),a=r(n(144778)),o=n(719621);function s(){return(s=(0,i.default)((function*(){(yield Promise.allSettled([(0,a.default)(),o.LruMediaStore.clear()])).forEach((e=>{if("rejected"===e.status)throw e.reason}))}))).apply(this,arguments)}},495296:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(268392),a=n(157211),o=n(893425),s=n(69108),l=n(651634),u=n(644130),c=n(387202),d=n(965012),p=r(n(875130)),_=r(n(837104)),f=n(121977),h=n(469867),g=n(403757),m=r(n(788788)),y=r(n(318797)),E=n(478353),S=n(557346),T=n(301460),v=n(739245),A=n(52136),C=n(13622),P=n(48907),O=n(935234),I=n(292390),M=n(319022),b=n(925155),R=n(896472),N=n(702378),w=n(647912),L=n(951220),D=n(600445),k=n(669818),U=n(301876),G=n(425192),x=n(441051),B=n(808469),F=n(375672),j=r(n(56992)),Y=r(n(774719)),K=n(986632),H={Blocklist:a.BlocklistCollection,BusinessCategoryResult:o.BusinessCategoriesResultCollection,BusinessProfile:s.BusinessProfileCollection,Call:l.CallCollection,Catalog:u.CatalogCollection,Chat:d.ChatCollection,ChatAssignment:c.ChatAssignmentCollection,ChatPreference:p.default,Contact:f.ContactCollection,ConversionTuple:Y.default,DailyAggregatedStats:h.DailyAggregatedStatsCollection,EmojiVariant:g.EmojiVariantCollection,GroupMetadata:y.default,Label:E.LabelCollection,LiveLocation:S.LiveLocationCollection,Msg:T.MsgCollection,MsgInfo:v.MsgInfoCollection,Mute:A.MuteCollection,Order:C.OrderCollection,PollVote:P.PollVoteCollection,Presence:O.PresenceCollection,ProfilePicThumb:I.ProfilePicThumbCollection,QuickReply:M.QuickReplyCollection,RecentEmoji:R.RecentEmojiCollection,RecentSticker:w.RecentStickerCollection,StarredMsg:K.AllStarredMsgsCollection,Status:D.StatusCollection,StatusV3:k.StatusV3Collection,Sticker:U.StickerCollection,StickerSearch:x.StickerSearchCollection,RecentStickerMD:L.RecentStickerCollectionMd,StickerPackCollectionMD:G.StickerPackCollectionMd,FavoriteSticker:m.default,Reactions:b.ReactionsCollection,RecentReactions:N.RecentReactionsCollection,UnjoinedSubgroupMetadataCollection:j.default,AgentCollection:i.AgentCollection,SubscriptionCollection:B.SubscriptionCollection,UnattributedMessageCollection:F.UnattributedMessageCollection,CommunityActivityCollection:_.default};t.default=H},7869:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ--ℝℤΩℨK--ℹℼ-ℿⅅ-ⅉⅎↃↄⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〆〱-〵〻〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛥꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA--zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]");t.default=n},121977:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ContactCollectionImpl=t.ContactCollection=void 0;var i=r(n(23279)),a=n(594534),o=n(292220),s=n(684733),l=r(n(428760)),u=r(n(702575)),c=r(n(799132)),d=n(349943),p=r(n(932325)),_=n(226562),f=n(6961),h=n(757453),g=n(643131),m=n(750469);class y extends a.BaseCollection{constructor(){super(),this._contactHashes=new u.default,this.checksum=void 0,this._frequentContacts={},this._sort=(0,i.default)((()=>super.sort()),1e3),this._silentSort=(0,i.default)((()=>super.sort({silent:!0})),1e3),this.listenTo(p.default,"locale_change",(()=>this.sort())),this.listenTo(this,"change:name",this.sort),this.listenTo(f.Socket,"change:stream",(()=>{f.Socket.stream===_.SOCKET_STREAM.RESUMING&&this.forEach((e=>{e.unset("verificationString"),e.unset("verificationBinary")}))})),this.listenTo(this,"add",this.contactAdded),this.listenTo(this,"remove",this.contactRemoved)}sort(e){return(null==e?void 0:e.silent)?this._silentSort():this._sort()}ensureSorted(){this._sort.flush()}initializeFromCache(e){e&&(__LOG__(2)`Store:Contact init from cache`,this.add(e,{silent:!0,merge:!0}))}contactAdded(e){this._contactHashes.put(e)}contactRemoved(e){this._contactHashes.remove(e)}contactHashLength(){return this._contactHashes.length}delete(){super.delete(),this.setChecksum(),delete this.checksum,this._frequentContacts={},(0,m.setFrequent)({}).catch((()=>{})),this._contactHashes.clear()}isFilteredContact(e){return!!e.name&&!e.isMe&&!e.isPSA&&e.isWAContact}getFilteredContacts(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.filter((function(t){return!t.id.isLid()&&(t.isMe?e:t.name&&!t.isPSA&&t.isWAContact)}))}getGroupContacts(){return this.filter((e=>e.isGroup))}_find(e){const t=this.get(e);return t?Promise.resolve(t):Promise.resolve({id:e})}_findQuery(e){return(0,d.contactFindQuery)(e)}sync(){return this.findQuery({}),(0,c.default)(this,o.COLLECTION_HAS_SYNCED)}updateFrequentContacts(e){this._frequentContacts=e}frequentContacts(e,t){let n=e&&this._frequentContacts[e];if(n||(n=this._frequentContacts.message),!n)return[];const r=null==t?void 0:t.id;return n.map((e=>this.get(e))).filter((e=>!!e&&!e.id.equals(r)))}getUserCount(){return this.map((e=>e.isUser?1:0)).reduce(((e,t)=>e+t),0)}setChecksum(e){this.checksum=e,(0,h.setContactChecksum)(this.checksum),(0,g.setChecksum)(e).catch((()=>{}))}resolveWidsFromHash(e){return this._contactHashes.get(e)}}t.ContactCollectionImpl=y,y.model=l.default,y.comparator=s.ContactComparator;const E=new y;t.ContactCollection=E},684733:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContactComparator=void 0,t.getCollator=function(){return a};var r=n(780549),i=n(256354);let a;o(),r.Cmd.on("set_collator",o);function o(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.DEFAULT_LOCALE;if(null===(e=self.Intl)||void 0===e?void 0:e.Collator){const e=self.Intl.Collator([t],{sensitivity:"base"});a={compare(t,n){try{return e.compare(t,n)}catch(e){return 0}}}}else a={compare:(e,t)=>e.localeCompare(t)}}t.ContactComparator=(e,t)=>{const n=e.id.toString(),r=t.id.toString(),i=e.name,o=t.name;if(!i&&o)return 1;if(i&&!o)return-1;if(i&&o&&e.header&&t.header){const n=a.compare(e.header,t.header);return 0===n?a.compare(i,o):n}return n&&r?n.localeCompare(r):-1}},428760:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(706223)),a=n(990445),o=n(287461),s=r(n(7869)),l=n(450491),u=n(54918),c=n(551746),d=n(72696),p=n(388536),_=n(157211),f=n(817649),h=n(266888),g=n(684733),m=n(914404),y=r(n(932325)),E=n(292390),S=n(600445),T=n(459857),v=r(n(124928)),A=n(931019),C=n(548360);const P=/^[^0-9]+$/;class O extends u.BaseModel{constructor(){super(...arguments),this.id=(0,u.prop)(),this.name=(0,u.prop)(),this.shortName=(0,u.prop)(),this.pushname=(0,u.prop)(),this.type=(0,u.prop)("in"),this.verifiedName=(0,u.prop)(),this.isBusiness=(0,u.prop)(),this.isEnterprise=(0,u.prop)(),this.isSmb=(0,u.prop)(),this.verifiedLevel=(0,u.prop)(),this.privacyMode=(0,u.prop)(),this.statusMute=(0,u.prop)(),this.sectionHeader=(0,u.prop)(),this.labels=(0,u.prop)(),this.isContactSyncCompleted=(0,u.prop)(),this.forcedBusinessUpdateFromServer=(0,u.prop)(),this.disappearingModeDuration=(0,u.prop)(),this.disappearingModeSettingTimestamp=(0,u.prop)(),this.requestedPnTimestamp=(0,u.prop)(),this.isContactBlocked=(0,u.session)(!1),this.verificationString=(0,u.session)(),this.verificationBinary=(0,u.session)(),this.pendingAction=(0,u.session)(),this.promises=(0,u.session)((()=>({}))),this.status=(0,u.session)(),this.profilePicThumb=(0,u.session)(),this.businessProfile=(0,u.session)(),this.commonGroups=(0,u.session)(),this.liveLocations=(0,u.session)(),this.businessCatalog=(0,u.session)(),this.locale=(0,u.session)(),this.shareOwnPn=(0,u.session)(),this.phoneJid=(0,u.session)(),this.displayNameLID=(0,u.session)(),this.notifyName=(0,u.derived)((function(){return this.isBusiness&&this.verifiedLevel!==f.VERIFIED_LEVEL.HIGH?this.verifiedName:this.pushname}),["pushname","isBusiness","verifiedLevel","verifiedName"]),this.mentionName=(0,u.derived)((function(){return!this.isMyContact&&this.isBusiness&&this.verifiedLevel!==f.VERIFIED_LEVEL.HIGH?null:this.name||this.notifyName}),["isMyContact","isBusiness","verifiedLevel","name","notifyName"]),this.displayName=(0,u.derived)((function(){return this.isMe&&h.Conn.pushname?h.Conn.pushname:v.default.isPSA(this.id)?"WhatsApp":null!=this.mentionName&&""!==this.mentionName?this.mentionName:this.formattedPhone}),["id","mentionName","isMe","formattedPhone"]),this.displayNameOrPnForLid=(0,u.derived)((function(){var e;return null!=this.phoneJid?(0,A.widToFormattedUser)(this.phoneJid):null!==(e=this.displayNameLID)&&void 0!==e?e:"Unknown number"}),["phoneJid","displayNameLID"]),this.formattedPhone=(0,u.derived)((function(){return this.id.isLid()?this.displayNameOrPnForLid:(0,A.widToFormattedUser)(this.id)}),["displayNameOrPnForLid"]),this.userid=(0,u.derived)((function(){return this.isUser?v.default.user(this.id):null})),this.userhash=(0,u.derived)((function(){return this.isUser?(0,i.default)((this.id.user||"")+"WA_ADD_NOTIF"):null})),this.searchName=(0,u.derived)((function(){if(v.default.isPSA(this.id))return y.default.accentFold(y.default.t(862));if(v.default.isSupportAccount(this.id))return y.default.accentFold("WhatsApp Support");if(this.isMe){var e;const t=C.fbt._("{nameOrPhoneNumber} (You)",[C.fbt._param("nameOrPhoneNumber",null!==(e=this.name)&&void 0!==e?e:this.formattedPhone)],{hk:"dRYOr"});return y.default.accentFold(t.toString())}return this.name?y.default.accentFold(this.name):null}),["name","formattedPhone","id","isMe","locale"]),this.searchVerifiedName=(0,u.derived)((function(){return this.verifiedLevel!==f.VERIFIED_LEVEL.HIGH?null:this.verifiedName?y.default.accentFold(this.verifiedName):null}),["verifiedLevel","verifiedName"]),this.header=(0,u.derived)((function(){if(this.name){const e=this.name.toLowerCase(),t=s.default.exec(e);if(t&&0===t.index||t&&P.test(e.slice(t.index))){const e=t[0],n=y.default.removeAccents(e);return(0,g.getCollator)().compare(n,e)?e:n}return"#"}}),["name"]),this.isMe=(0,u.derived)((function(){return(0,T.isMeAccount)(this.id)})),this.isUser=(0,u.derived)((function(){return v.default.isUser(this.id)})),this.isGroup=(0,u.derived)((function(){return v.default.isGroup(this.id)})),this.isBroadcast=(0,u.derived)((function(){return v.default.isBroadcast(this.id)})),this.isPSA=(0,u.derived)((function(){return v.default.isPSA(this.id)})),this.isIAS=(0,u.derived)((function(){return v.default.isIAS(this.id)})),this.isSupportAccount=(0,u.derived)((function(){return v.default.isSupportAccount(this.id)})),this.formattedShortNameWithNonBreakingSpaces=(0,u.derived)((function(){return this.id?this.isMe?y.default.t(853):this.shortName||this.formattedName&&this.formattedName.replace(/\s/g," "):""}),["shortName","formattedName","id","locale"]),this.formattedShortName=(0,u.derived)((function(){return this.id?this.isMe?y.default.t(853):this.shortName||this.formattedName:""}),["shortName","formattedName","id","locale"]),this.formattedName=(0,u.derived)((function(){return this.id?this.isMe?y.default.t(853):v.default.isPSA(this.id)?y.default.t(862):v.default.isSupportAccount(this.id)?"WhatsApp Support":this.name?this.name:this.verifiedLevel===f.VERIFIED_LEVEL.HIGH&&this.verifiedName?this.verifiedName:this.isUser?this.formattedPhone:"":""}),["name","id","locale","verifiedLevel","verifiedName","formattedPhone"]),this.formattedUser=(0,u.derived)((function(){return this.getFormattedUser()}),["name","id","locale","verifiedLevel","verifiedName","formattedPhone"]),this.isWAContact=(0,u.derived)((function(){return this.isUser&&"in"===this.type}),["type"]),this.isMyContact=(0,u.derived)((function(){var e;return!(!this.isUser||!(null===(e=this.name)||void 0===e?void 0:e.length))}),["name"]),this.canRequestPhoneNumber=(0,u.derived)((function(){return null==this.requestedPnTimestamp||this.requestedPnTimestamp+84e3<(0,a.unixTime)()}),["requestedPnTimestamp"]),this.showBusinessCheckmarkAsPrimary=(0,u.derived)((function(){return this.isSupportAccount||this.isBusiness&&this.verifiedLevel===f.VERIFIED_LEVEL.HIGH&&(this.name===this.verifiedName||!this.name)}),["isBusiness","verifiedLevel","name","verifiedName"]),this.showBusinessCheckmarkAsSecondary=(0,u.derived)((function(){return this.isBusiness&&this.verifiedLevel===f.VERIFIED_LEVEL.HIGH&&Boolean(this.name)&&this.name!==this.verifiedName}),["isBusiness","verifiedLevel","name","verifiedName"]),this.isDisplayNameApproved=(0,u.derived)((function(){return this.isBusiness&&(this.verifiedLevel===f.VERIFIED_LEVEL.HIGH||this.verifiedLevel===f.VERIFIED_LEVEL.LOW)}),["isBusiness","verifiedLevel"]),this.shouldForceBusinessUpdate=(0,u.derived)((function(){return!this.forcedBusinessUpdateFromServer&&!this.isContactSyncCompleted}),["forcedBusinessUpdateFromServer","isContactSyncCompleted"])}initialize(){super.initialize(),this.id&&(this.isMe&&this.addChild("status",S.StatusCollection.gadd(this.id)),this.isMe&&this.addChild("profilePicThumb",E.ProfilePicThumbCollection.gadd(this.id)),(this.isBusiness||this.isMe&&h.Conn.isSMB)&&this.addChild("businessProfile",n(69108).BusinessProfileCollection.gadd(this.id)),this.listenTo(this,"change:isBusiness",(()=>(0,c.handleBusinessChange)(this))),this.isMe&&this.listenTo(h.Conn,"change:pushname",(()=>{this.set({pushname:h.Conn.pushname})})),this.listenTo(y.default,"locale_change",(()=>{this.locale=y.default.getLocale()})),this.listenTo(this,"change:name",this.updateShortName),this.isContactBlocked=!!_.BlocklistCollection.get(this.id),this.pendingAction=0,h.Conn.isSMB&&(0,p.initializeLabels)(this),this.id.isLid()&&(0,l.attachContactLidInfo)(this).then((()=>{null==this.phoneJid||this.isContactBlocked||(this.isContactBlocked=!!_.BlocklistCollection.get(this.phoneJid))})))}updateShortName(){if(this.isUser&&this.name&&!this.shortName){const e=(0,m.getShortName)(this.name);e&&this.set("shortName",e)}}getStatus(){return v.default.user(this.id)||__LOG__(2)`contact:getStatus for non-user ${this.id.toString()}`,this.status=S.StatusCollection.gadd(this.id)}getProfilePicThumb(){return this.profilePicThumb=E.ProfilePicThumbCollection.gadd(this.id)}addPendingAction(e){const t=()=>{this.decPending()};return e.then(t,t),this.pendingAction++,e}decPending(){this.pendingAction>0?this.pendingAction--:(__LOG__(2)`contact:onPendingActionUpdate pendingAction value is invalid`,this.pendingAction=0)}isBlocked(){const e=this.phoneJid;return null!=_.BlocklistCollection.get(this.id)||!(!this.id.isLid()||null==e)&&null!=_.BlocklistCollection.get(e)}searchMatch(e,t,n){var r;if((0,d.canDisplayLabel)()&&n)return!(e&&this.searchName&&!this.searchName.includes(e))&&Boolean(null===(r=this.labels)||void 0===r?void 0:r.includes(n));if(!e)return!1;if(this.searchName&&this.searchName.includes(e))return!0;if(this.userid&&this.userid.includes(e))return!0;if(t&&this.userid&&this.userid.includes(t))return!0;if(this.searchVerifiedName&&this.searchVerifiedName.includes(e))return!0;if(this.pushname&&y.default.accentFold(this.pushname).includes(e))return!0;if(this.isMe){const t=C.fbt._("Me You",null,{hk:"2c79Fn"});if(y.default.accentFold(t.toString()).includes(e))return!0}return!1}isDisplayNameEnabledForVerificationLevelLow(){return this.isEnterprise?!(0,o.getABPropConfigValue)("web_display_name_for_enterprise_biz_vlevel_low_killswitch"):!!this.isSmb&&!(0,o.getABPropConfigValue)("web_display_name_for_biz_vlevel_low_killswitch")}getFormattedUser(){return this.id?v.default.isPSA(this.id)?y.default.t(862):v.default.isSupportAccount(this.id)?"WhatsApp Support":this.name?this.name:this.verifiedLevel===f.VERIFIED_LEVEL.HIGH&&this.verifiedName||this.isDisplayNameEnabledForVerificationLevelLow()&&this.isDisplayNameApproved&&this.verifiedName?this.verifiedName:this.formattedPhone:""}set(e,t,n){const r=super.set(e,t,n);if("string"!=typeof e&&(null==t?void 0:t.merge)&&r){if(r.isPSA)return r;!e.name&&r.name&&(r.unset("name"),r.unset("shortName")),!e.verifiedName&&r.verifiedName&&r.unset("verifiedName")}return r}getCollection(){return n(121977).ContactCollection}setNotMyContact(){this.name&&this.set("name",void 0)}}O.Proxy="contact",O.idClass=v.default;var I=(0,u.defineModel)(O);t.default=I},914404:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getShortName=function(e){if(null==e)return null;const[t]=e.split(/\s/);if(i.default.exec(t))return t;return __LOG__(2)`[short-name] unable to get short name for contact: ${e}`,null};var i=r(n(7869))},702575:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(82729)),a=r(n(132375)),o=r(n(124928));class s{constructor(){this._map={},this.length=0}static getSidelistHash(e){return e.isUser?"string"==typeof e.userhash&&e.userhash.slice?e.userhash.slice(0,4):(__LOG__(3)`Store:Contact can't call slice on contact.userhash`,null):null}put(e){const t=s.getSidelistHash(e);if(t&&!this._map[t]){if(this._map[t]){const n=this._map[t];n instanceof o.default?this._map[t]=[n,e.id]:n instanceof Array&&n.push(e.id)}else this._map[t]=e.id;this.length++}}remove(e){const t=s.getSidelistHash(e);if(!t||!this._map[t])return;const n=(0,a.default)(this._map[t],"this._map[hash]");n instanceof o.default?delete this._map[t]:n instanceof Array&&(0,i.default)(n,(t=>t.equals(e.id))),this.length++}get(e){const t=this._map[e];return t instanceof o.default?[t]:t}clear(){this._map={},this.length=0}}t.default=s},292390:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ProfilePicThumbCollectionImpl=t.ProfilePicThumbCollection=void 0;var i=r(n(348926)),a=r(n(441609)),o=n(924583),s=r(n(706223)),l=n(990445),u=n(287461),c=n(984330),d=n(154549),p=n(594534),_=n(266888),f=n(862159),h=n(476314),g=n(890213),m=n(94872),y=n(53575),E=n(105284),S=r(n(124928)),T=n(669050),v=n(670903);const A=l.WEEK_MILLISECONDS;class C extends p.BaseCollection{get(e){const t=super.get(e);if((0,u.getABPropConfigValue)("web_enable_profile_pic_thumb_db_caching")&&this.isProfilePicRefreshNeeded(null==t?void 0:t.timestamp,null==t?void 0:t.eurlStale)&&(null==t||t.markStale({eurl:!0})),!this.modelClass.prototype.isIdType(e))return t;const n=super.get((0,s.default)(e.toString()));if(n){if(this.remove(n,{silent:!0}),t&&t.tag)return t;const r=n.toJSON();return r.id=e,this.add(r,{silent:!0,merge:!0})[0]}return t||void 0}saveToCache(){if(!_.Conn.shouldSaveToCache())return;const e=C.cachePolicy.id;let t=this.filter((e=>S.default.isWid(e.id)&&!!e.eurl));t=t.map((function(e){const t=e.toJSON();return t.id=(0,s.default)(t.id.toString()),t})),__LOG__(2)`models:profilePic:cache-save: ${String(e)}`,y.userPreferencesStore.setCollection(e,t)}initializeFromCache(e){if(!this.length||!e)return;const t=this.reduce(((e,t)=>(e[(0,s.default)(t.id.toString())]=t.id.toString(),e)),new Object);if((0,a.default)(t))return;const n=e.reduce(((e,n)=>(t[n.id]&&(n.id=(0,T.createWid)(t[n.id]),n.stale=!0,n.token&&e.push(n)),e)),[]);this.add(n,{merge:!0})}onResume(){const e=this.filter((e=>{const t=n(965012).ChatCollection.get(e.id);return e.hasObservers()&&e.stale&&(S.default.isUser(e.id)||S.default.isGroup(e.id))&&!(null==t?void 0:t.isReadOnly)})).map((e=>(e.tag||e.unset("tag",{silent:!0}),e)));this.resyncPictures(e)}_update(e){if(!(0,u.getABPropConfigValue)("web_enable_profile_pic_thumb_db_caching"))return this._find((0,T.createWid)(e.toString()));const t=this.gadd({id:e});return t.markStale({eurl:!0}),this.find(t.id)}_find(e){var t,r;const i=n(965012).ChatCollection.get(e),a=(null==i||null===(t=i.groupMetadata)||void 0===t?void 0:t.groupType)===f.GroupType.COMMUNITY,o=n(56992).default.get(e.toString());if((null==i?void 0:i.isReadOnly)&&!a&&null==o||(null==i||null===(r=i.groupMetadata)||void 0===r?void 0:r.terminated))return Promise.resolve({id:e,stale:!0});if((S.default.isUser(e)||S.default.isGroup(e))&&!S.default.isPSA(e)){const t={};return S.default.isGroup(e)&&(a?t.parentGroupId=e:null!=o&&(t.parentGroupId=o.parentGroupId)),(0,v.requestProfilePicFromServer)(e,t)}return Promise.resolve({id:e,tag:null})}imageChanged(e,t){var n=this;return(0,i.default)((function*(){const r=n.gadd(e);t===h.PROFILE_PIC_COMMAND.REMOVE?(r.set({tag:void 0,eurl:void 0,previewEurl:void 0}),yield(0,v.persistProfilePicToDB)(e)):t!==h.PROFILE_PIC_COMMAND.SET&&r.tag===t||(yield n.update(r.id))}))()}resyncPictures(e){return 0===e.length?Promise.resolve():(0,v.profilePicResync)(e.map((function(e){return{id:e.id,tag:e.tag}}))).then((t=>{__LOG__(2)`ProfilePicThumbStore:resyncPictures success`,t.forEach((t=>{const n=this.get(t.id);n&&n.set({tag:t.tag,raw:void 0,stale:!1,eurl:t.eurl,eurlStale:!1,previewEurl:t.previewEurl,timestamp:Date.now()}),e.forEach((e=>{e.eurlStale&&this.update(e.id)})),e.forEach((e=>{e.stale=!1}))}))})).catch((0,o.filteredCatch)(c.ServerStatusCodeError,(e=>{423===e.status||429===e.status?__LOG__(3)`ProfilePicThumbStore:resyncPictures blocked ${e.status}`:e.status>=400&&__LOG__(3)`ProfilePicThumbStore:resyncPictures dropped: ${String(e)}`}))).catch((function(e){__LOG__(3)`ProfilePicThumbStore:resyncPictures dropped: ${String(e)}`}))}findThumbnailWid(e){return e.find((e=>{var t;return null===(t=this.get(e))||void 0===t?void 0:t.img}))}getThumbnailWidFromVcard(e){if(!e)return null;const t=(0,E.vcardWids)(e);if(!t)return;const n=this.findThumbnailWid(t);return n||(t.length?t[0]:null)}isProfilePicRefreshNeeded(e){if(null==e||arguments.length>1&&void 0!==arguments[1]&&arguments[1])return!0;return Date.now()-e>A}}t.ProfilePicThumbCollectionImpl=C,C.model=g.ProfilePicThumb,C.staleCollection=!0,C.resumeOnAvailable=!0,C.cachePolicy={id:m.COLLECTIONS_KEYS.PROFILE_PIC_THUMB_COLLECTION,trigger:"change:tag change:raw",policy:d.CACHE_POLICY.LOAD,delay:5e3};const P=new C;t.ProfilePicThumbCollection=P},890213:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ProfilePicThumb=t.FALLBACK=void 0;var i=r(n(81109)),a=n(54918),o=n(476314),s=r(n(79291)),l=n(459857),u=r(n(124928)),c=r(n(478885));const d={SINGLE:"SINGLE",GROUP:"GROUP"};t.FALLBACK=d;class p extends a.BaseModel{constructor(){super(...arguments),this.id=(0,a.prop)(),this.tag=(0,a.prop)(),this.raw=(0,a.prop)(),this.eurl=(0,a.prop)(),this.previewEurl=(0,a.prop)(),this.stale=(0,a.session)(!0),this.eurlStale=(0,a.session)(!1),this.pendingPic=(0,a.session)(),this.timestamp=(0,a.session)(),this.img=(0,a.derived)((function(){return this.raw?"data:image/jpeg;base64,"+this.raw:!this.tag&&this.stale?null:this.tag?this.previewEurl:void 0}),["tag","raw","stale","eurl","eurlStale","previewEurl"]),this.imgFull=(0,a.derived)((function(){return!this.raw&&this.tag||!this.stale?!this.raw&&this.tag?this.eurl:void 0:null}),["tag","raw","stale","eurl","eurlStale"]),this.fallbackType=(0,a.derived)((function(){return u.default.isUser(this.id)?d.SINGLE:(u.default.isGroup(this.id),d.GROUP)}),["id"])}markStale(e){this.stale=!0,!0===(null==e?void 0:e.eurl)&&(this.eurlStale=!0)}validate(){if(this.stale||this.eurlStale)return this.getCollection().update(this.id)}generateUrl(e){let t={t:e,u:this.id.toString(),i:this.tag||""};return(null===c.default||void 0===c.default?void 0:c.default.alive)&&this.eurl&&!this.eurlStale&&(t=(0,i.default)({e:this.eurl},t)),s.default.build(o.PP_URL,t)}canSet(){if(u.default.isGroup(this.id)){var e;const t=n(965012).ChatCollection.get(this.id);return!(null==t||null===(e=t.groupMetadata)||void 0===e?void 0:e.participants.iAmRestrictedMember())}return!!this.id.equals((0,l.getMaybeMeUser)())}canDelete(){if(u.default.isGroup(this.id)&&this.tag){var e;const t=n(965012).ChatCollection.assertGet(this.id);return!(null==t||null===(e=t.groupMetadata)||void 0===e?void 0:e.participants.iAmRestrictedMember())}return!(!this.id.equals((0,l.getMaybeMeUser)())||!this.tag)}getCollection(){return n(292390).ProfilePicThumbCollection}}p.Proxy="profilePicThumb",p.idClass=u.default;const _=(0,a.defineModel)(p);t.ProfilePicThumb=_},600445:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.StatusCollectionImpl=t.StatusCollection=void 0;var i=n(594534),a=n(397201),o=r(n(831067)),s=r(n(124928)),l=n(669050);class u extends i.BaseCollection{onResume(){this.filter((e=>e.hasObservers())).forEach((e=>{this.find(e.id)}))}_find(e){const t=e instanceof s.default?e:(0,l.createWid)(e);return(0,a.getStatus)(t)}}t.StatusCollectionImpl=u,u.model=o.default,u.idClass=s.default,u.staleCollection=!0,u.resumeOnAvailable=!0;const c=new u;t.StatusCollection=c},831067:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(54918),a=r(n(124928));class o extends i.BaseModel{constructor(){super(...arguments),this.id=(0,i.prop)(),this.status=(0,i.prop)(),this.stale=(0,i.session)(!0)}getCollection(){return n(600445).StatusCollection}}o.Proxy="status",o.idClass=a.default;var s=(0,i.defineModel)(o);t.default=s},769926:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ConversionTupleExpiry=t.ConversionTuple=void 0;var i=n(551168),a=n(990445),o=r(n(164325)),s=n(54918),l=r(n(124928));const u=604800;t.ConversionTupleExpiry=u;class c extends s.BaseModel{constructor(){super(...arguments),this.id=(0,s.prop)(),this.conversionData=(0,s.prop)(),this.conversionSource=(0,s.prop)(),this.timestamp=(0,s.prop)((()=>(0,a.unixTime)())),this.alarmId=(0,s.session)()}initialize(){super.initialize(),this.listenTo(this,"change:timestamp",this._setExpiryTimer),this._setExpiryTimer()}_setExpiryTimer(){const e=this.timestamp+u;if(e<0)return __LOG__(3)`Invalid conversionTuple timer`,void this.delete();this.alarmId=o.default.setLocalTimeout((()=>{this.delete()}),1e3*e,this.alarmId)}_clearAlarm(){this.alarmId&&(o.default.clearTimeout(this.alarmId),this.alarmId=void 0)}elapsedSeconds(){return(0,a.unixTime)()-this.timestamp}formatTuple(){const e={conversionDelaySeconds:this.elapsedSeconds()};return this.conversionData&&(e.conversionData=this.conversionData),this.conversionSource&&(e.conversionSource=this.conversionSource),e}toJSON(){const e=this.serialize(),t=e.conversionData;if(t instanceof ArrayBuffer){const n=new i.Binary(t);e.conversionData=n.readString(t.byteLength)}return e}delete(){super.delete(),this.getCollection().remove(this.id),this._clearAlarm()}getCollection(){return n(774719).default}}c.Proxy="conversionTuple",c.idClass=l.default;const d=(0,s.defineModel)(c);t.ConversionTuple=d},774719:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(990445),i=n(154549),a=n(594534),o=n(94872),s=n(769926),l=n(127714);class u extends a.BaseCollection{initializeFromCache(e){if(!e)return;const t=(0,r.unixTime)()-s.ConversionTupleExpiry,n=e.filter((e=>e.timestamp-t>0)).map((e=>{const t=(0,l.parseConversionData)(e.conversionData);return t?e.conversionData=t:delete e.conversionData,e}));this.add(n),this.saveToCache()}}u.model=s.ConversionTuple,u.cachePolicy={id:o.COLLECTIONS_KEYS.CONVERSION_TUPLE_COLLECTION,policy:i.CACHE_POLICY.LOAD,delay:1e3};var c=new u;t.default=c},225867:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PrinaDailyActionType=t.DailyAggregatedStats=void 0;var r=n(54918);const i=n(76672)({NARRATIVE_APPEAR:1,DIALOG_APPEAR:2,DIALOG_SELECT:3});t.PrinaDailyActionType=i;const a=864e5;class o extends r.BaseModel{constructor(){super(...arguments),this.id=(0,r.prop)(),this.startTime=(0,r.prop)(),this.pttCancelBroadcast=(0,r.prop)(0),this.pttCancelGroup=(0,r.prop)(0),this.pttCancelIndividual=(0,r.prop)(0),this.pttDraftReviewBroadcast=(0,r.prop)(0),this.pttDraftReviewGroup=(0,r.prop)(0),this.pttDraftReviewIndividual=(0,r.prop)(0),this.pttFastplaybackBroadcast=(0,r.prop)(0),this.pttFastplaybackGroup=(0,r.prop)(0),this.pttFastplaybackIndividual=(0,r.prop)(0),this.pttLockBroadcast=(0,r.prop)(0),this.pttLockGroup=(0,r.prop)(0),this.pttLockIndividual=(0,r.prop)(0),this.pttPlaybackBroadcast=(0,r.prop)(0),this.pttPlaybackGroup=(0,r.prop)(0),this.pttPlaybackIndividual=(0,r.prop)(0),this.pttRecordBroadcast=(0,r.prop)(0),this.pttRecordGroup=(0,r.prop)(0),this.pttRecordIndividual=(0,r.prop)(0),this.pttSendBroadcast=(0,r.prop)(0),this.pttSendGroup=(0,r.prop)(0),this.pttSendIndividual=(0,r.prop)(0),this.pttPausedRecordBroadcast=(0,r.prop)(0),this.pttPausedRecordGroup=(0,r.prop)(0),this.pttPausedRecordIndividual=(0,r.prop)(0),this.pttStopTapBroadcast=(0,r.prop)(0),this.pttStopTapGroup=(0,r.prop)(0),this.pttStopTapIndividual=(0,r.prop)(0),this.pttOutOfChatBroadcast=(0,r.prop)(0),this.pttOutOfChatGroup=(0,r.prop)(0),this.pttOutOfChatIndividual=(0,r.prop)(0),this.goldenBoxContactNarrativeAppearCount=(0,r.prop)(0),this.goldenBoxContactDialogAppearCount=(0,r.prop)(0),this.goldenBoxContactDialogSelectCount=(0,r.prop)(0),this.goldenBoxGroupNarrativeAppearCount=(0,r.prop)(0),this.goldenBoxGroupDialogAppearCount=(0,r.prop)(0),this.goldenBoxGroupDialogSelectCount=(0,r.prop)(0),this.infoScreenContactNarrativeAppearCount=(0,r.prop)(0),this.infoScreenContactDialogAppearCount=(0,r.prop)(0),this.infoScreenContactDialogSelectCount=(0,r.prop)(0),this.infoScreenGroupNarrativeAppearCount=(0,r.prop)(0),this.infoScreenGroupDialogAppearCount=(0,r.prop)(0),this.infoScreenGroupDialogSelectCount=(0,r.prop)(0),this.chatsListNarrativeAppearCount=(0,r.prop)(0),this.chatsListDialogAppearCount=(0,r.prop)(0),this.chatsListDialogSelectCount=(0,r.prop)(0),this.statusListNarrativeAppearCount=(0,r.prop)(0),this.statusListDialogAppearCount=(0,r.prop)(0),this.statusListDialogSelectCount=(0,r.prop)(0),this.callingScreenAudioNarrativeAppearCount=(0,r.prop)(0),this.callingScreenAudioDialogAppearCount=(0,r.prop)(0),this.callingScreenAudioDialogSelectCount=(0,r.prop)(0),this.prinaLastEvent=(0,r.prop)(0),this.communityTabGroupNavigations=(0,r.prop)(0),this.communityTabToHomeViews=(0,r.prop)(0),this.communityTabViews=(0,r.prop)(0),this.communityNoActionTabViews=(0,r.prop)(0),this.communityHome=(0,r.prop)((()=>({}))),this.pnhCagActions=(0,r.prop)((()=>({}))),this.kicGroupNotificationTaps=(0,r.prop)(0),this.kicGroupNotifications=(0,r.prop)(0),this.kicNotificationTaps=(0,r.prop)(0),this.kicNotifications=(0,r.prop)(0)}initialize(){super.initialize()}getEndTime(){return this.startTime+a}shouldBeSubmitted(){return!this.isExpired()&&this.getEndTime()<Date.now()}isExpired(){const e=Date.now()-18144e5;return this.startTime<e}}o.Proxy="daily-aggregated-stats";const s=(0,r.defineModel)(o);t.DailyAggregatedStats=s},469867:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DailyAggregatedStatsCollectionImpl=t.DailyAggregatedStatsCollection=void 0;var i=r(n(132375)),a=n(154549),o=n(594534),s=n(225867),l=n(757453),u=n(94872);const c=864e5;class d extends o.BaseCollection{gaddForDate(e){var t;const n=(0,l.getDailyStatsStartTime)(),r=e.getTime()-n,a=Math.floor(r/c),o=n+c*a;return null!==(t=this.get(o))&&void 0!==t?t:(0,i.default)(this.add({id:o.toString(),startTime:o})[0],"this.add({\n id: startTime.toString(),\n startTime\n})[0]")}gaddForToday(){return this.gaddForDate(new Date)}initializeFromCache(e){if(null==e)return;const t=e.map((e=>new s.DailyAggregatedStats(e))).filter((e=>_(e)&&!e.isExpired()));this.add(t)}serialize(){return this.toArray().filter((e=>_(e)&&!e.isExpired())).map((e=>e.toJSON()))}}t.DailyAggregatedStatsCollectionImpl=d,d.model=s.DailyAggregatedStats,d.cachePolicy={id:u.COLLECTIONS_KEYS.DAILY_AGGREGATED_STATS_COLLECTION,policy:a.CACHE_POLICY.LOAD,delay:1e3};const p=new d;function _(e){return(e.startTime-(0,l.getDailyStatsStartTime)())%c==0}t.DailyAggregatedStatsCollection=p},403757:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.EmojiVariantCollectionImpl=t.EmojiVariantCollection=void 0;var i=n(154549),a=n(594534),o=r(n(610877)),s=n(94872),l=n(429334);class u extends a.BaseCollection{setVariant(e,t){const n=l.EmojiUtil.getSkinToneBase(e);if(!n)throw new Error("attempt to store variantless emoji");this.gadd({id:n,variant:t})}getVariant(e){if(l.EmojiUtil.getSkinToneBase(e)){const t=this.get(e);return t?l.EmojiUtil.normalizeEmoji(t.variant):null}throw new Error("attempt to get variantless emoji")}getVariantIfExists(e){if(l.EmojiUtil.getSkinToneBase(e)){const t=this.get(e);return t?l.EmojiUtil.normalizeEmoji(t.variant):null}return null}}t.EmojiVariantCollectionImpl=u,u.model=o.default,u.cachePolicy={id:s.COLLECTIONS_KEYS.EMOJI_VARIANT_COLLECTION,policy:i.CACHE_POLICY.LOAD,delay:1e3};const c=new u;t.EmojiVariantCollection=c},610877:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(54918);class i extends r.BaseModel{constructor(){super(...arguments),this.id=(0,r.prop)(),this.variant=(0,r.prop)()}}i.Proxy="emojiVariant";var a=(0,r.defineModel)(i);t.default=a},896472:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.RecentEmojiCollectionImpl=t.RecentEmojiCollection=void 0;var i=r(n(823493)),a=r(n(23279)),o=n(154549),s=n(594534),l=n(390912),u=r(n(193869)),c=n(94872),d=n(429334);class p extends s.BaseCollection{constructor(){super(),this.dirty=!1,this._throttledSync=(0,i.default)((function(e){e.sync()}),36,{leading:!1}),this.listenTo(this,"change:weight change:length",(0,a.default)(this._sortTrimScale,100))}_sortTrimScale(){const e=this.length;e&&(this.sort(),e>36&&this.remove(this.slice(36)))}delete(){super.delete(),this.dirty=!1,this._throttledSync.cancel()}sync(){return this.findQuery({},{set:!0}).finally((()=>{this.dirty=!1}))}_findQuery(){return Promise.reject(new s.CollectionSilentQueryError("gk recent emoji sync unsupported"))}throttledSync(){l.LegacyPhoneFeatures.supportsFeature(l.LegacyPhoneFeatures.F.RECENT_EMOJI_SYNC)&&(__LOG__(2)`models:RecentEmoji:throttledSync dirty: ${String(this.dirty)}`,this._throttledSync(this))}increment(e){const t=d.EmojiUtil.getSkinToneBase(e)||e;this.get(t)||this.add({id:t,weight:0}),this.forEach((e=>{e.id===t?e.weight+=1:e.weight*=.9})),this.dirty=!0,this.throttledSync()}}t.RecentEmojiCollectionImpl=p,p.cachePolicy={id:c.COLLECTIONS_KEYS.RECENT_EMOJI_COLLECTION,policy:o.CACHE_POLICY.LOAD,delay:2e3},p.comparator=(e,t)=>e.weight>t.weight?-1:1,p.model=u.default;const _=new p;t.RecentEmojiCollection=_},193869:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(54918);class i extends r.BaseModel{constructor(){super(...arguments),this.id=(0,r.prop)(),this.weight=(0,r.prop)()}}i.Proxy="recentEmoji";var a=(0,r.defineModel)(i);t.default=a},837104:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(834986),o=n(594534),s=n(965012),l=n(722564),u=r(n(318797)),c=n(862159),d=r(n(56992)),p=n(459857),_=n(673168),f=n(669050),h=n(548360);class g extends o.BaseCollection{constructor(){super(),this.listenTo(d.default,"add remove change:subject",this._updateSubgroupName)}_updateSubgroupName(e){const t=this.findFirst((t=>{var n;return null===(n=t.subgroupId)||void 0===n?void 0:n.equals(e.id)}));null!=t&&(t.subgroupName=e.subject)}getActivityFor(e){return this.filter((t=>t.communityId.equals(e)))}shouldShowTabBadge(){var e;if(0===this.length)return!1;const t=null!==(e=(0,_.getCommunityTabLastSeenTimestamp)())&&void 0!==e?e:0;return this.some((e=>e.timestamp>t))}syncActivityFor(e){var t=this;return(0,i.default)((function*(){var n,r;const i=null!==(n=u.default.assertGet(e).lastSeenActivityTimestamp)&&void 0!==n?n:0,o=null!==(r=(0,_.getCommunityTabLastSeenTimestamp)())&&void 0!==r?r:0,g=yield(0,a.getMessagesBefore)(e.toString(),(e=>e.t<i));0!==g.length&&g.forEach((n=>{if(null==n.author)return;const r=(0,f.createWidFromWidLike)(n.author);if((0,p.isMeAccount)(r))return;const{t:i}=n;if(n.subtype===c.GROUP_ACTIONS.SUB_GROUP_LINK){var a,u;const r=(0,f.createWidFromWidLike)(null===(a=n.templateParams)||void 0===a?void 0:a[0]);let o=null===(u=s.ChatCollection.get(r))||void 0===u?void 0:u.formattedTitle;if(null==o){var _,g;const e=null===(_=d.default.get(r.toString()))||void 0===_?void 0:_.subject,t=null===(g=n.templateParams)||void 0===g?void 0:g[1];o=null!=e?e:null!=t?t:h.fbt._("unknown subject",null,{hk:"3Lg3Zm"}).toString()}t.add({id:n.id,type:l.ActivityTypeType.SUB_GROUP_LINK,communityId:e,timestamp:i,subgroupName:o,subgroupId:r})}else n.subtype===c.GROUP_ACTIONS.ADD&&i>o&&t.add({id:e.toString(),communityId:e,timestamp:i,type:l.ActivityTypeType.NEW_COMMUNITY})}))}))()}addDeduppedSubgroupLink(e){const t=e.filter((e=>!this.some((t=>{var n;return null===(n=t.subgroupId)||void 0===n?void 0:n.equals(e.subgroupId)}))));return this.add(t)}}g.model=l.CommunityActivity,g.comparator=(e,t)=>e.timestamp-t.timestamp;var m=new g;t.default=m},722564:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommunityActivity=t.ActivityTypeType=void 0;var r=n(54918),i=n(347605);const a=n(76672).Mirrored(["SUB_GROUP_LINK","NEW_COMMUNITY"]);t.ActivityTypeType=a;class o extends r.BaseModel{constructor(){super(...arguments),this.id=(0,i.prop)(),this.communityId=(0,i.prop)(),this.type=(0,i.prop)(),this.timestamp=(0,i.prop)(),this.subgroupName=(0,i.prop)(),this.subgroupId=(0,i.prop)()}}o.Proxy="communityActivity";const s=(0,r.defineModel)(o);t.CommunityActivity=s},258561:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(801156)),a=r(n(89051));class o extends i.default{}t.default=o,o.model=a.default,o.comparator=(e,t)=>t.t-e.t},89051:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(54918),a=n(121977),o=r(n(124928));class s extends i.BaseModel{constructor(){super(...arguments),this.id=(0,i.prop)(),this.t=(0,i.prop)(),this.addedBy=(0,i.prop)(),this.requestMethod=(0,i.prop)(),this.contact=(0,i.session)(),this.addedByContact=(0,i.session)()}initialize(){super.initialize(),this.addChild("contact",a.ContactCollection.gadd(this.id)),this.addChild("addedByContact",a.ContactCollection.gadd(this.addedBy))}}s.Proxy="membership_approval_request",s.idClass=o.default;var l=(0,i.defineModel)(s);t.default=l},318797:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(393386)),a=n(594534),o=n(965012),s=r(n(243560)),l=n(198670),u=r(n(124928)),c=n(380310);class d extends a.BaseCollection{constructor(){super(),this.listenTo(this,"add",this.onGroupAdd),this.listenTo(this,"remove",this.onGroupRemove),this.listenTo(this,"change:parentGroup",this.onParentGroupChange)}onGroupAdd(e){if(!e.participants.iAmMember())return;const t=e.parentGroup?this.get(e.parentGroup.toString()):null;if(null!=t){const n=e.id;(0,l.subgroupUnjoinedToJoined)(t,n)}}onGroupRemove(e){if(!e.participants.iAmMember())return;const t=e.parentGroup?this.get(e.parentGroup.toString()):null;null!=t&&(0,l.updateJoinedSubgroups)(t)}onParentGroupChange(e,t,n){if(!e.participants.iAmMember())return;const r=e.id,i=null!=t?this.get(t.toString()):null,a=null!=n?this.get(n.toString()):null;null!=i?((0,l.subgroupUnjoinedToJoined)(i,r),null!=a&&(0,l.updateJoinedSubgroups)(a)):null!=a&&(0,l.unlinkParentGroup)(a,r)}onResume(){(0,i.default)(o.ChatCollection.where({active:!0}).filter((e=>e.isGroup||e.isBroadcast)),o.ChatCollection.where({isBroadcast:!0})).forEach((e=>{this.find(e.id)}))}_find(e){if(u.default.isGroup(e)){const t=n(965012).ChatCollection.get(e);return(null==t?void 0:t.isReadOnly)?Promise.resolve({id:e}):(0,c.findGroupMetadata)(e)}return u.default.isBroadcast(e)?Promise.resolve({id:e}):(__LOG__(2)`groupMetadata:find trying to fetch non-group/bclist wid ${e.toString()}`,Promise.reject(new Error(`groupMetadata:find trying to fetch non-group/bclist wid ${e.toString()}`)))}}d.model=s.default,d.staleCollection=!0;var p=new d;t.default=p},477466:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=(0,n(667294).createContext)(null);t.default=r},243560:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(201063),o=n(287461),s=n(493928),l=n(54918),u=n(965012),c=n(121977),d=r(n(258561)),p=r(n(164560)),_=r(n(857998)),f=n(862159),h=n(672503),g=n(97858),m=r(n(311041)),y=r(n(446205)),E=n(198670),S=n(459857),T=(r(n(571834)),r(n(124928))),v=n(669050),A=n(574819),C=n(548360);class P extends l.BaseModel{constructor(){super(...arguments),this.participants=(0,l.collection)(p.default),this.pendingParticipants=(0,l.collection)(_.default),this.pastParticipants=(0,l.collection)(m.default),this.membershipApprovalRequests=(0,l.collection)(d.default),this.id=(0,l.prop)(),this.creation=(0,l.prop)(),this.owner=(0,l.prop)(),this.subject=(0,l.prop)(),this.subjectTime=(0,l.prop)(),this.desc=(0,l.prop)(),this.descId=(0,l.prop)(),this.descTime=(0,l.prop)(),this.descOwner=(0,l.prop)(),this.restrict=(0,l.prop)(),this.announce=(0,l.prop)(),this.noFrequentlyForwarded=(0,l.prop)(),this.ephemeralDuration=(0,l.prop)(),this.membershipApprovalMode=(0,l.prop)(),this.growthLockExpiration=(0,l.prop)(),this.growthLockType=(0,l.prop)(),this.size=(0,l.prop)(),this.numSubgroups=(0,l.prop)(),this.support=(0,l.prop)(),this.suspended=(0,l.prop)(!1),this.terminated=(0,l.prop)(!1),this.uniqueShortNameMap=(0,l.prop)(),this.isParentGroup=(0,l.prop)(),this.isParentGroupClosed=(0,l.prop)(),this.parentGroup=(0,l.prop)(),this.defaultSubgroup=(0,l.prop)(),this.unjoinedSubgroups=(0,l.session)((()=>[])),this.joinedSubgroups=(0,l.session)((()=>[])),this.lastActivityTimestamp=(0,l.prop)(),this.lastSeenActivityTimestamp=(0,l.prop)(),this.incognito=(0,l.prop)(),this.stale=(0,l.session)(!0),this.deviceStale=(0,l.session)(!1),this.trusted=(0,l.session)(!0),this.inviteCode=(0,l.session)(),this.groupInviteCodePromise=(0,l.session)(),this.revokeGroupInvitePromise=(0,l.session)(),this.participantQueryPromise=(0,l.session)(),this.deviceQueryPromise=(0,l.session)(),this.unjoinedSubgroupsQueryPromise=(0,l.session)(),this.displayedDesc=(0,l.session)(""),this.revokeGroupsV4AddInvitePromise=(0,l.session)(),this.groupInviteLink=(0,l.derived)((function(){return this.inviteCode?`https://chat.whatsapp.com/${this.inviteCode}`:null}),["inviteCode"]),this.cachedDeviceCount=(0,l.session)(),this.cachedDeviceSizeBucket=(0,l.session)(),this.groupType=(0,l.derived)((function(){return!0===this.defaultSubgroup?f.GroupType.DEFAULT_ANNOUNCEMENT_GROUP:null!=this.parentGroup?f.GroupType.SUBGROUP:!0===this.isParentGroup?f.GroupType.COMMUNITY:f.GroupType.DEFAULT}),["parentGroup","isParentGroup","defaultSubgroup"]),this.isIncognitoCag=(0,l.derived)((function(){return this.groupType===f.GroupType.DEFAULT_ANNOUNCEMENT_GROUP&&Boolean(this.incognito)}),["groupType","incognito"])}hasUniqueShortNameMention(e){var t;if(!this.uniqueShortNameMap||!e.shortName||!e.isMyContact)return!1;const n=this._normalizeShortName(e.shortName);return null!==(t=this.uniqueShortNameMap.get(n))&&void 0!==t&&t}_normalizeShortName(e){return e.toLowerCase().trim()}isSuspendedOrTerminated(){return this.suspended||this.terminated}delete(){super.delete(),this.getCollection().remove(this.id),this.participants.delete()}canSetSubject(){if(this.isSuspendedOrTerminated())return!1;if((0,g.communitiesEnabled)()){if(this.groupType===f.GroupType.DEFAULT_ANNOUNCEMENT_GROUP)return!1;if(this.groupType===f.GroupType.COMMUNITY)return this.participants.iAmAdmin()}return!!this.participants.iAmMember()&&((this.participants.iAmAdmin()||!0!==this.restrict)&&!this.support)}canSetDescription(){return!(!this.participants.iAmMember()||!this.participants.iAmAdmin()&&this.restrict)&&(!this.isSuspendedOrTerminated()&&(!((0,g.communitiesEnabled)()&&(this.groupType===f.GroupType.COMMUNITY||this.groupType===f.GroupType.DEFAULT_ANNOUNCEMENT_GROUP)&&!this.participants.iAmAdmin())&&!this.support))}searchMatch(e){var t;if(null==e)return!1;const{id:n}=this,r=null===(t=u.ChatCollection.get(n))||void 0===t?void 0:t.formattedTitle;return!(null==r||!r.toLowerCase().includes(e))}canSetGroupProperty(){return!this.isSuspendedOrTerminated()&&((!(0,g.communitiesEnabled)()||this.groupType!==f.GroupType.COMMUNITY&&this.groupType!==f.GroupType.DEFAULT_ANNOUNCEMENT_GROUP)&&(!!this.participants.iAmAdmin()&&!this.support))}canSetEphemeralSetting(){const e=!this.support;return!this.isSuspendedOrTerminated()&&(!!this.participants.iAmMember()&&(this.participants.iAmAdmin()?e:!this.restrict&&(!!(0,o.getABPropConfigValue)("ephemeral_allow_group_members")&&(this.groupType!==f.GroupType.DEFAULT_ANNOUNCEMENT_GROUP&&e))))}initialize(){l.BaseModel.prototype.initialize.call(this),this.listenTo(this.participants,"change:isAdmin change:isSuperAdmin change:contact.isMyContact sort remove reset",(()=>{this.isTrusted(),this._updateDisplayedDesc()})),this.listenTo(this.participants,"bulk_add bulk_remove reset",this.triggerParticipantsChange),this.listenTo(this,"change:owner",this.isTrusted),this.listenTo(this,"change:isParentGroup",this._updateSubgroups),this.listenTo(this,"change:desc",this._updateDisplayedDesc),this.listenTo(this,"change:groupType",this._updateDisplayedDesc),this._updateDisplayedDesc(),this.isTrusted(),this._updateUniqueShortNameMapTimer=this._createUniqueNameMapShiftTimer(),this.listenTo(this.participants,"change:contact.shortName",this._handleParticipantShortNameUpdated),this.uniqueShortNameMap=new Map,this.unreadMentionMetadata=new y.default,this.groupType===f.GroupType.COMMUNITY&&this._updateSubgroups()}_handleParticipantShortNameUpdated(){var e;null===(e=this._updateUniqueShortNameMapTimer)||void 0===e||e.debounce(P.UPDATE_NAME_MAP_DEBOUNCE_TIME)}triggerParticipantsChange(){var e;(0,s.isDropLastNameEnabled)()&&(null===(e=this._updateUniqueShortNameMapTimer)||void 0===e||e.debounce(P.UPDATE_NAME_MAP_DEBOUNCE_TIME));this.trigger("change:participants")}_createUniqueNameMapShiftTimer(){return new a.ShiftTimer((()=>{if((0,s.isDropLastNameEnabled)()){const e=new Map;this.participants&&this.participants.forEach((t=>{if(t.contact.shortName&&t.contact.isMyContact){const n=this._normalizeShortName(t.contact.shortName);e.has(n)?e.set(n,!1):e.set(n,!0)}})),this.uniqueShortNameMap=e}}))}_isGroupAdminInAddressBook(){return this.participants.some((e=>e.isAdmin&&e.contact.isMyContact))}isTrusted(){if(this.stale)return this.trusted;if(this.support)return this.trusted=!0;if(this.owner){if((0,S.isMeAccount)(this.owner))return this.trusted=!0;const e=c.ContactCollection.get(this.owner);if(null==e?void 0:e.isMyContact)return this.trusted=!0}return this._isGroupAdminInAddressBook()?this.trusted=!0:this.trusted=!1}hasJoined(){const{id:e,groupType:t,joinedSubgroups:n}=this;if(t===f.GroupType.COMMUNITY)return n.length>0;const r=u.ChatCollection.get(e);return!!r&&!1===r.isReadOnly}_updateDisplayedDesc(){!(0,g.communitiesEnabled)()||this.groupType!==f.GroupType.DEFAULT_ANNOUNCEMENT_GROUP||this.canSetDescription()||null!=this.desc&&""!==this.desc?this.displayedDesc=this.desc:this.displayedDesc=C.fbt._("",null,{hk:"4kc4Kr"}).toString()}_updateSubgroups(){(0,E.updateJoinedSubgroups)(this),(0,E.updateUnjoinedSubgroups)(this)}revokeGroupsV4AddInvite(e){if(this.revokeGroupsV4AddInvitePromise)return this.revokeGroupsV4AddInvitePromise;const t=(0,A.widToGroupJid)(this.id),{pendingParticipants:n}=this;let r=Promise.resolve();return r=(0,h.revokeGroupInviteV4)(e,t),this.revokeGroupsV4AddInvitePromise=r.then((t=>(t.status>=200&&t.status<300&&n.remove(e),t.status))).catch((()=>(__LOG__(3)`models:groupMetadata:participantCollection:revokeGroupsV4AddInvite failed`,500))).finally((()=>{this.revokeGroupsV4AddInvitePromise=null}))}queryGroupsV4PendingInvite(){var e=this;return(0,i.default)((function*(){(yield(0,h.getPendingParticipants)(e.id)).forEach((t=>{e.pendingParticipants.add({id:(0,v.createUserWid)(t)})}))}))()}getJoinedSubgroupsMetadata(){const e=this.getCollection();return this.joinedSubgroups.map((t=>e.get(t.toString()))).filter(Boolean)}getUnjoinedSubgroupsMetadata(){const e=this.getUnjoinedCollection();return this.unjoinedSubgroups.map((t=>e.get(t.toString()))).filter(Boolean)}getSubgroupsMetadata(){return[...this.getJoinedSubgroupsMetadata(),...this.getUnjoinedSubgroupsMetadata()]}getParentGroupChat(){const e=this.parentGroup;if(e)return u.ChatCollection.get(e)}isParentGroupParticipant(){const e=this.parentGroup;if(!e)return!1;const t=this.getCollection().get(e);return!!(null==t?void 0:t.joinedSubgroups.length)}isLastSubgroup(){const e=this.parentGroup;if(!e)return!1;const t=this.getCollection().get(e);return 1===(null==t?void 0:t.joinedSubgroups.length)}getUnjoinedCollection(){return n(56992).default}getCollection(){return n(318797).default}}P.Proxy="groupMetadata",P.idClass=T.default,P.UPDATE_NAME_MAP_DEBOUNCE_TIME=200;var O=(0,l.defineModel)(P);t.default=O},164560:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(23279)),a=n(965012),o=r(n(801156)),s=n(121977),l=n(931130),u=r(n(702267)),c=r(n(27210)),d=n(862159),p=r(n(932325)),_=n(97858),f=n(198670),h=n(459857);class g extends o.default{constructor(e){super(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this._updateSubgroup=e=>{var t,n,r;if(!e||!(0,h.isMeAccount)(e.id))return;const i=this.parent.id,o=i?null===(t=a.ChatCollection.get(i.toString()))||void 0===t||null===(n=t.groupMetadata)||void 0===n?void 0:n.parentGroup:null,s=o?null===(r=a.ChatCollection.get(o.toString()))||void 0===r?void 0:r.groupMetadata:null;null!=s&&(this.iAmMember()?(0,f.subgroupUnjoinedToJoined)(s,i):(0,f.subgroupJoinedToUnjoined)(s,i))},this._debouncedSort=(0,i.default)((()=>this.sort()),1e3),this.sendForNeededAddRequest=e=>{var t,n;const r=this.getChat(),i=null!==(t=null===(n=r.groupMetadata)||void 0===n?void 0:n.desc)&&void 0!==t?t:"";(0,l.sendForNeededAddRequest)(e,r.formattedTitle||r.name,i,this.parent.id)},this.listenTo(this,"change:contact.name",this._debouncedSort),this.listenTo(p.default,"locale_change",this._debouncedSort),this.listenTo(this,"add remove",this._updateSubgroup)}delete(){this.forEach((function(e){e.delete()})),this.stopListening(),this.reset()}ensureSorted(){this._debouncedSort.flush()}set(e,t){const n=t||{};n.isParticipantCollectionAdd||(n.remove=!0);const r=super.set(e,n);return this.trigger("bulk_add",r),!0===n.remove&&this.trigger("bulk_remove",r),r}add(e,t){const n=t||{};n.isParticipantCollectionAdd=!0;const r=super.add(e,n);return this.trigger("bulk_add",r),r}remove(e,t){const n=super.remove(e,t||{});return this.trigger("bulk_remove",n),n}canAdd(){return!!this.iAmAdmin()}canPromote(e){var t;if(!e)return!1;if((0,h.isMeAccount)(e.id))return!1;if(!this.iAmAdmin())return!1;if(e.isAdmin)return!1;return!((null===(t=this.getChat().groupMetadata)||void 0===t?void 0:t.groupType)===d.GroupType.DEFAULT_ANNOUNCEMENT_GROUP&&!(0,_.communitiesEnabled)())}canDemote(e){var t,n,r;if(!e)return!1;if(!this.iAmAdmin())return!1;const i=this.getChat();if((!(0,_.communitiesEnabled)()||(null===(t=i.groupMetadata)||void 0===t?void 0:t.groupType)!==d.GroupType.COMMUNITY&&(null===(n=i.groupMetadata)||void 0===n?void 0:n.groupType)!==d.GroupType.DEFAULT_ANNOUNCEMENT_GROUP)&&(0,h.isMeAccount)(e.id))return!1;var a,o;return e.isSuperAdmin?!(!(0,_.communitiesEnabled)()||(null===(a=i.groupMetadata)||void 0===a?void 0:a.groupType)!==d.GroupType.COMMUNITY&&(null===(o=i.groupMetadata)||void 0===o?void 0:o.groupType)!==d.GroupType.DEFAULT_ANNOUNCEMENT_GROUP)&&(0,h.isMeAccount)(e.id):!!e.isAdmin&&!(!(0,_.communitiesEnabled)()&&(null===(r=i.groupMetadata)||void 0===r?void 0:r.groupType)===d.GroupType.DEFAULT_ANNOUNCEMENT_GROUP)}canRemove(e){var t;return!!e&&(!(0,h.isMeAccount)(e.id)&&(!!this.iAmAdmin()&&((null===(t=this.getChat().groupMetadata)||void 0===t?void 0:t.groupType)!==d.GroupType.DEFAULT_ANNOUNCEMENT_GROUP||!e.isAdmin&&!e.isSuperAdmin)))}canVerifyIdentity(e){return!!e&&!(0,h.isMeAccount)(e.id)}iAmMember(){return!!this.getMeParticipant()}iAmRestrictedMember(){var e;return!0===(null===(e=this.getChat().groupMetadata)||void 0===e?void 0:e.restrict)&&!this.iAmAdmin()}iAmAdmin(){const e=this.getMeParticipant();return!0===(null==e?void 0:e.isAdmin)}iAmSuperAdmin(){const e=this.getMeParticipant();return!0===(null==e?void 0:e.isSuperAdmin)}getAdmins(){return this.where({isAdmin:!0})}getSuperAdmin(){return this.findFirst((e=>e.isSuperAdmin))}getMyContacts(){return this.filter((e=>{var t;return!!(null===(t=s.ContactCollection.get(e.id))||void 0===t?void 0:t.isMyContact)}))}getMeParticipant(){const e=(0,h.getMaybeMeUser)();let t;e&&(t=this.get(e));const n=(0,h.getMaybeMeLidUser)();return!t&&n&&(t=this.get(n)),t}getChat(){const e=this.parent.id;return a.ChatCollection.assertGet(e)}}t.default=g,g.model=c.default,g.comparator=u.default},702267:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(684733);var i=(e,t)=>(0,r.ContactComparator)(e.contact,t.contact);t.default=i},27210:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(54918),a=n(121977),o=r(n(124928));class s extends i.BaseModel{constructor(){super(...arguments),this.id=(0,i.prop)(),this.isAdmin=(0,i.prop)(),this.isSuperAdmin=(0,i.prop)(),this.leaveTs=(0,i.prop)(),this.leaveReason=(0,i.prop)(),this.contact=(0,i.session)()}initialize(){super.initialize(),this.addChild("contact",a.ContactCollection.gadd(this.id))}}s.Proxy="participant",s.idClass=o.default;var l=(0,i.defineModel)(s);t.default=l},857998:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(23279)),a=r(n(801156)),o=r(n(702267)),s=r(n(27210)),l=r(n(932325));class u extends a.default{constructor(e){super(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this._debouncedSort=(0,i.default)((()=>this.sort()),1e3),this.listenTo(this,"change:contact.name",this._debouncedSort),this.listenTo(l.default,"locale_change",this._debouncedSort)}delete(){this.forEach((function(e){e.delete()})),this.stopListening(),this.reset()}ensureSorted(){this._debouncedSort.flush()}set(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.isParticipantCollectionAdd||(t.remove=!0),super.set(e,t)}add(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.isParticipantCollectionAdd=!0,super.add(e,t)}}t.default=u,u.model=s.default,u.comparator=o.default},307988:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnreadMessageType=void 0;const r=n(76672).Mirrored(["NEW_MESSAGE","PERSISTANCE_LOAD","HISTORYC_SYNC_CHUNK"]);t.UnreadMessageType=r},311041:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(990445),a=r(n(801156)),o=n(682144),s=r(n(27210));class l extends a.default{getValidRecords(){return this.filter((e=>{const t=(0,i.castToUnixTime)(e.leaveTs);return(0,i.happenedWithin)(t,i.DAY_SECONDS*o.PAST_PARTICIPANT_EXPIRATION_DAYS)}))}}t.default=l,l.model=s.default,l.comparator=(e,t)=>t.leaveTs-e.leaveTs},56992:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(594534),a=r(n(318797)),o=r(n(975295)),s=n(198670);class l extends i.BaseCollection{constructor(){super(),this.listenTo(this,"add",this._handleAddRemove),this.listenTo(this,"remove",this._handleAddRemove),this.listenTo(this,"change:parentGroupId",this._handleChange)}_updateParent(e){e&&(0,s.updateUnjoinedSubgroups)(e)}_handleAddRemove(e){const t=a.default.get(e.parentGroupId.toString());this._updateParent(t)}_handleChange(e,t,n){const r=null!=t?a.default.get(t.toString()):null,i=null!=n?a.default.get(n.toString()):null;this._updateParent(r),this._updateParent(i)}}l.model=o.default;var u=new l;t.default=u},975295:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(54918),a=r(n(164560)),o=n(862159),s=r(n(124928)),l=n(548360);class u extends i.BaseModel{constructor(){super(...arguments),this.id=(0,i.prop)(),this.subject=(0,i.prop)(),this.subjectTime=(0,i.prop)(),this.parentGroupId=(0,i.prop)(),this.defaultSubgroup=(0,i.prop)(),this.desc=(0,i.prop)(),this.creation=(0,i.prop)(),this.owner=(0,i.prop)(),this.size=(0,i.prop)(),this.adminRequestRequired=(0,i.prop)(),this.membershipApprovalMode=(0,i.prop)(),this.membershipApprovalRequest=(0,i.prop)(),this.participants=(0,i.collection)(a.default),this.groupType=(0,i.derived)((function(){return!0===this.defaultSubgroup?o.GroupType.DEFAULT_ANNOUNCEMENT_GROUP:o.GroupType.SUBGROUP}),["defaultSubgroup"]),this.displayedDesc=(0,i.derived)((function(){return this.groupType!==o.GroupType.DEFAULT_ANNOUNCEMENT_GROUP||null!=this.desc&&""!==this.desc?this.desc:l.fbt._("",null,{hk:"3BnLJ3"}).toString()}),["desc","groupType"])}}u.Proxy="unjoinedSubgroupMetadata",u.idClass=s.default;var c=(0,i.defineModel)(u);t.default=c},446205:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(54918),a=r(n(152310));n(307988);class o extends i.BaseModel{constructor(){super(...arguments),this.unreadMentionCollection=(0,i.prop)(),this.pendingUnreadMentionCount=(0,i.prop)()}initialize(){this.unreadMentionCollection=new a.default,this.pendingUnreadMentionCount=0}hasMentionId(e){return null!=this.unreadMentionCollection.get(e)}addUnreadMentions(e){this.unreadMentionCollection.add(e)}removeUnreadMentions(e){this.unreadMentionCollection.remove(e)}oldestUnreadMention(){return this.unreadMentionCollection.oldestUnreadMention()}reset(){this.pendingUnreadMentionCount=0,this.unreadMentionCollection.reset()}getUnreadMentionCount(){return this.pendingUnreadMentionCount+this.unreadMentionCollection.length}}var s=(0,i.defineModel)(o);t.default=s},594534:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.CollectionSilentQueryError=t.BaseCollection=void 0;var i=r(n(348926)),a=r(n(81109)),o=r(n(873955)),s=r(n(639693)),l=r(n(643063)),u=n(924583),c=n(425315),d=n(984330),p=n(154549),_=n(427401),f=r(n(801156)),h=n(266888),g=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=T(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),m=(n(316348),n(226562)),y=n(6961),E=n(841273),S=n(53575);function T(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(T=function(e){return e?n:t})(e)}const v="QUERY",A="FIND",C="UPDATE",P=(new Object).toString(),O={id:"none",policy:p.CACHE_POLICY.NONE};class I extends Error{constructor(e){super(e),this.name="CollectionSilentQueryError",this.message=e}}t.CollectionSilentQueryError=I;class M extends f.default{constructor(){super(),this._inflight={},this._cachePolicy=(0,_.createCachePolicy)(this,this.constructor.cachePolicy||O),this._staleCollection=this.constructor.staleCollection||!1,this._resumeOnAvailable=this.constructor.resumeOnAvailable||!1,(!0===this._staleCollection||(0,c.isFunction)(this.onResume))&&(this.listenTo(y.Socket,"change:stream",this._handleStreamChange),this._resumeOnAvailable&&this.listenTo(E.Stream,"change:available",(()=>{E.Stream.available&&this._needsUpdate&&this._onResume()}))),this._cachePolicy.enableCaching(),this._cachePolicy.constructor.policy===p.CACHE_POLICY.LOAD&&this.listenTo(h.Conn,"me_ready",this._updateFromCache)}initializeFromCache(e){this.add(e)}saveToCache(){if(!h.Conn.shouldSaveToCache())return;const{id:e}=this._cachePolicy;__LOG__(2)`baseCollection:saveToCache save: ${String(e)}`,S.userPreferencesStore.setCollection(e,this.toJSON())}add(e,t){if(e){if(h.Conn.blockStoreAdds)throw new d.LogoutDrop("adding to store when blocking store adds");const n=Array.isArray(e)?e:[e];if(n.every((e=>null==e?void 0:e.isState))){const e=(0,l.default)(n,(e=>this.get(e.id)));return e.length&&super.add(e,t),n}}return super.add(e,t)}findQuery(e,t){return this._query(v,e,t)}find(e,t){return e?this._query(A,e,t):(__LOG__(4,void 0,new Error,!0)`Called find without an id`,SEND_LOGS("find-without-id"),Promise.reject(new Error("called find without an id")))}update(e,t){return e?this._query(C,e,t):(__LOG__(4,void 0,new Error,!0)`Called update without an id`,SEND_LOGS("update-without-id"),Promise.reject(new Error("called update without an id")))}handle(e){const t=this._handle(e.shift());if(this._staleCollection){const e=Array.isArray(t)?t:[t];(0,s.default)(e).forEach((e=>{e.stale=!1}))}this.add(t,{merge:!0})}gadd(e,t){if(this.modelClass.prototype.isIdType(e)){const n=this.get(e);return n||this.add({id:e},t)[0]}if(e.id){const n=t||{};return n.merge=!0,this.add(e,n)[0]}throw new Error("gadd called without an id attr (id)")}gaddUp(e){let t,n=this._staleCollection;if(this.modelClass.prototype.isIdType(e)){const r={stale:n,id:e};t=this.get(e)||this.add(r,{merge:!0})[0]}else e.id&&(this.get(e.id)&&(n=!1),e=(0,a.default)({stale:n},e),t=this.add(e,{merge:!0})[0]);if(t){const e=t;return t.stale&&this.find(t.id),e}throw new Error(".gaddUp called without an id attr (id)")}delete(){this._inflight={},this.reset()}isStateStale(e){const t=this.get(e);return!!t&&t.stale}_handleResume(){switch(y.Socket.stream){case m.SOCKET_STREAM.DISCONNECTED:if(!this._staleCollection)return;this.forEach((e=>{e&&(e.stale=!0)}));break;case m.SOCKET_STREAM.RESUMING:case m.SOCKET_STREAM.SYNCING:case m.SOCKET_STREAM.CONNECTED:}}_onResume(){(0,c.isFunction)(this.onResume)&&(this._resumeOnAvailable&&!E.Stream.available?this._needsUpdate=!0:(this.onResume(),this._needsUpdate=!1))}_query(e,t,n){let r=(0,c.isString)(t)?t:t.toString();r===P&&(r=(0,o.default)("collection_query_"));const i=e===v?void 0:this.get(t),a="force-"+r;return(this._inflight[a]&&e===A||e===C)&&(r=a),this._inflight[r]?e===A&&i&&!i.stale?Promise.resolve(i):this._inflight[r]:!i||i.stale||e===C?this._inflight[r]=this._serverQuery(e,t,n).finally((()=>{delete this._inflight[r]})).catch((0,u.filteredCatch)(d.LogoutDrop,(e=>{__LOG__(3)`LogoutDrop error: ${e.toString()}`}))).catch((e=>{if(!(e instanceof I))throw e;__LOG__(2)`baseCollection:query query promise rejected: ${String(e)}`})):Promise.resolve(i)}_serverQuery(e,t,n){var r=this;return(0,i.default)((function*(){let i;if(e===C)i=r._update(t,n);else if(e===A)i=r._find(t,n);else{const e=null==n?void 0:n.logOnSend;i=r._findQuery(t,e)}const a=yield i;if(r._staleCollection){const e=Array.isArray(a)?a:[a];(0,s.default)(e).forEach((function(e){void 0===e.stale&&(e.stale=!1)}))}let o;if(o=(null==n?void 0:n.set)?r.set(a):r.add(a,{merge:!0}),Array.isArray(a))return o;if(o[0])return o[0];throw new g.ModelCreateError("Unknown",a)}))()}_update(e,t){return this._find(e,t)}_handleStreamChange(){this._handleResume(),this._cachePolicy.constructor.policy===p.CACHE_POLICY.LOAD&&this._updateFromCache()}_updateFromCache(){const{id:e}=this._cachePolicy;this._cachePolicy.disableCaching(),h.Conn.shouldSaveToCache()&&(__LOG__(2)`baseCollection:initFromCache load: ${String(e)}`,this.initializeFromCache(S.userPreferencesStore.getCollection(e)),this._cachePolicy.enableCaching())}}t.BaseCollection=M},609390:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.BaseMirror=void 0,t.genBitMask=function(e,t){const n=[];for(let r=0;r<t.length;r++){const i=e[`change:${t[r]}`],a=Math.floor(i/32);o(n,a+1),n[a]|=1<<i%32}return n},t.genMirrorMask=function(e){const t={};let n=0;const r=e=>{t[`change:${e}`]=n++};e.props&&Object.keys(e.props).forEach(r);e.session&&Object.keys(e.session).forEach(r);e.derived&&Object.keys(e.derived).forEach(r);return t};var i=r(n(604788));function a(e,t){e[t]=e[e.length-1],e.pop()}function o(e,t){if(t<=e.length)return;const n=t-e.length;for(let t=0;t<n;t++)e.push(0)}t.BaseMirror=class{constructor(e){this.state=e}destructor(){this.state.off("all",this.onGatherEvent,this)}initListener(){this.state.on("all",this.onGatherEvent,this),this.masks=[],this.listeners=[],this.changeEvents=[]}onGatherEvent(e){if("change"===e){if(!this.changeEvents.filter(Boolean).length)return;this.onChange(),this.changeEvents=[]}else{const t=this.state.mirrorMask[e];if(void 0===t)return;const n=t/32|0;o(this.changeEvents,n+1),this.changeEvents[n]|=1<<(t%32|0)}}onChange(){const e=this.state,t=this.changeEvents;(0,i.default)(this.masks,this.listeners).forEach((n=>{let[r,i]=n;const a=Math.min(t.length,r.length);for(let n=0;n<a;n++)if(t[n]&r[n]){const[t,n]=i;null!=t&&null!=n&&t(n,e);break}}))}addListener(e,t,n){this.listeners||this.initListener(),this.masks.push(t),this.listeners.push([e,n])}removeListener(e){const t=this.listeners;for(let n=0;n<t.length;n++)t[n][0]===e&&(t[n][0]=null,t[n][1]=null,a(this.masks,n),a(t,n))}}},54918:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.BaseModel=void 0,Object.defineProperty(t,"collection",{enumerable:!0,get:function(){return p.collection}}),t.defineModel=function(e){const t=(0,p.convert)(e),n=(0,p.stateExtend)(h,t);if(e.Proxy){const r=(0,u.genMirrorMask)(t);n.prototype.mirrorMask=r,n.prototype.proxyName=e.Proxy,(0,_.ProxyStateFactory)(e.Proxy,t,r)}return n},Object.defineProperty(t,"derived",{enumerable:!0,get:function(){return p.derived}}),Object.defineProperty(t,"prop",{enumerable:!0,get:function(){return p.prop}}),Object.defineProperty(t,"session",{enumerable:!0,get:function(){return p.session}});var i=r(n(81109)),a=r(n(907287)),o=r(n(402525)),s=r(n(114176)),l=n(425315),u=n(609390),c=n(780549),d=r(n(395654)),p=n(347605),_=n(976484);const f=/^change:/;class h extends d.default{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(),this.stale=(0,p.session)(!1),this.__fired=null,this.__changes=null,this.__initialized=!1,t._internalInitializationDoNotUse)return;this.stale=(null==e?void 0:e.stale)||this.getDefault("stale"),this.parent=t.parent,this.collection=t.collection,this._initDeriveds(),this._initCollections();const n=this.__defaults,r=n?(0,i.default)((0,i.default)({},n),e):e;r&&!function(e){for(const t in e)if(e.hasOwnProperty(t))return!1;return!0}(r)&&this.set(r,(0,i.default)({silent:!0},t)),this.initialize(),this.__initialized=!0}initialize(){if(this.collection&&this.id&&!this.collection.modelClass.prototype.isIdType(this.id))throw new Error(`Model id:${String(this.id)} is wrong type`);this._uiObservers=0,this.mirrorMask&&(this.mirror=new u.BaseMirror(this))}_refreshStaleModel(){if(this._uiObservers||!this.stale){if(!this.getCollection)throw new Error("base_model:_refreshStaleModel getCollection does not exist");this.getCollection().find(this.id)}}incObservers(e){if(this._uiObservers++,e)return;n(99398).default.online&&this.stale&&(c.Cmd.uiBusy?this.listenToOnce(c.Cmd,"ui_idle",this._refreshStaleModel):this._refreshStaleModel())}decObservers(){this._uiObservers>0&&this._uiObservers--,0===this._uiObservers&&this.stopListening(c.Cmd,"ui_idle",this._refreshStaleModel)}hasObservers(){return this._uiObservers>0}getObservers_TEST_ONLY(){return null}addChild(e,t){const n={};n[e]=t,this.set(n,{silent:!0}),this.listenTo(t,"all",this._getCachedEventBubblingHandler(e))}get(e){return this[e]}set(e,t,n){var r;let i=n;return"string"==typeof e?this._set(e,t,i):(i=t,(null===(r=i)||void 0===r?void 0:r.merge)?this._set((0,s.default)(e,(e=>void 0===e)),i):this._set(e,i))}_markChange(e,t){this.__initialized&&(this._getChanges().push({key:e,oldValue:t}),this.__fired&&(this.__fired[e]=!1))}_set(e,t,n){const r=!!this.__changes,[i,a]=(0,l.isString)(e)?[{[e]:t},n]:[e,t];let o=Object.keys(i).reduce(((e,t)=>{const n=this._setKV(t,i[t],a);return n&&e.push(...n),e}),[]),s=0;for(;o&&o.length>0;){if(s++>5)throw new Error("Circular derived properties / event listeners");const e=this._topo;if(!e)throw new Error("_topo unexpectedly undefined");const t=g(e,o);o=t.reduce(((e,n,r)=>{const i=this._setD(n,t.slice(r+1));return i&&e.push(...i),e}),[])}if(!(null==a?void 0:a.silent)&&this.hasUnfiredChanges()){const e=this.__fired={},t=this._getChanges(),n=t.length>0;for(;t.length;){const{key:n,oldValue:r}=t.shift();if(!e[n]){e[n]=!0;const t=this._definition[n].evt;if(this.isListening(t)||this.isListening("all")){const e=this[n];this.trigger(t,this,e,r)}}}(n&&this.isListening("change")||this.isListening("all"))&&this.trigger("change",this)}return r||(this.__changes&&(this.__changes=null),this.__fired&&(this.__fired=null)),this}_setKV(e,t,n){if(this._collections[e])return void this[e].set(t,n);const r=this._definition[e];if(!r)return void(this[e]=t);if(r.attr===p.Attr.DERIVED)throw new Error(`Attempting to directly set derived property: ${e}`);const i=r.sk,a=this[e];if(t===a)return;this[i]=t,this._markChange(e,a);const o=this._deps;return(null==o?void 0:o[e])?o[e]:void 0}_setD(e,t){var n;const r=this._definition[e],i=r.sk,a=r.fn.call(this),o=this[i];if(a!==o&&(this[i]=a,this._markChange(e,o),null===(n=this._deps)||void 0===n?void 0:n[e])){const n=function(e,t){const n=new Set(t);return e.filter((e=>!n.has(e)))}(this._deps[e],t);if(n.length)return n}}hasUnfiredChanges(){const e=this.__fired,t=this.__changes;if(!t)return!1;if(!e)return!0;for(let n=0;n<t.length;n++)if(!e[t[n].key])return!0;return!1}_getChanges(){return this.__changes||(this.__changes=[])}_initDeriveds(){this.__derived.forEach((e=>{this[this._definition[e].sk]=p.INIT}))}_initCollections(){(0,o.default)(this._collections,((e,t)=>{this[t]=new e(null,{parent:this})}))}unset(e,t){const n=Array.isArray(e)?e:[e];this.set((0,a.default)(n),t)}clear(){this.unset([...this.__props,...this.__session])}delete(){this.stopListening()}reset(){this.set(this.__defaults)}toJSON(){return this.serialize()}serialize(){const e={};for(let t=0;t<this.__props.length;t++)e[this.__props[t]]=this[this.__props[t]];return(0,o.default)(this._collections,((t,n)=>{e[n]=this[n].serialize()})),e}getDefault(e){const t=this._definition[e];if(!t)return;const n=t.defaultValue;return(0,l.isFunction)(n)?n():n}_getCachedEventBubblingHandler(e){return function(t,n,r){f.test(t)?this.trigger("change:"+e+"."+t.split(":")[1],n,r):"change"===t&&this.trigger("change",this)}.bind(this)}static isIdType(e){return!(!this.allowedIds||!this.allowedIds.includes(e))||(this.idClass?e instanceof this.idClass:"string"==typeof e)}pp(){}}function g(e,t){const n=new Set(t);return e.filter((e=>n.has(e)))}t.BaseModel=h},801156:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=n(487769),o=r(n(395654));class s extends o.default{constructor(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),e.parent&&(this.parent=e.parent);const{model:t,comparator:n}=this.constructor;if(!t)throw new Error("Collection initialized without model. It is likely that you have a circular dependency. Run `yarn lint:circular` to find it and use inline `require` instead of `import` to avoid it.");this.modelClass=t,n&&(this._comparator=n),this._reset();const r=this;Object.defineProperty(this,"length",{get:()=>r._models.length})}add(e,t){let n;return n=Array.isArray(e)?e.slice():e?[e]:[],this.set(n,(0,i.default)({merge:!1,add:!0,remove:!1},t))}set(e,t){if(!e)return __LOG__(3)`collection:set called with no models`,[];const n=(0,i.default)({add:!0,remove:!0,merge:!0},t);let r,a,o,s;const l=this._comparator&&!1!==n.sort,u=[],c=[],d={},{add:p,merge:_,remove:f}=n,h=null!=n.at?n.at:void 0,g=!(l||!p||!f)&&[];for(let t=0,i=e.length;t<i;t++){if(s=e[t],this.isModel(s)&&(a=s),r=s.id,!r){__LOG__(3)`collection:set model has no id`;continue}if(o=this.get(r),o){const r=o;f&&(d[o.id.toString()]=!0),_&&(s=a&&s===a?a.attributes:s,r.set(s,n)),e[t]=r}else if(p){if(a=e[t]=this._prepareModel(s,n),!a)continue;{const e=a;u.push(e),this._addReference(e)}}if(a=o||a,!a)continue;const i=a;!g||a.id&&d[a.id.toString()]||g.push(i),d[i.id.toString()]=!0}if(f){for(let e=0,t=this.length;e<t;e++){a=this._models[e];const t=a;d[a.id.toString()]||c.push(t)}c.length&&this.remove(c,(0,i.default)({},n))}let m;if(u.length||g.length)if(l&&(m=!0),"number"==typeof h)this._models.splice(h,0,...u);else{const e=g||u;for(let t=0,n=e.length;t<n;t++)this._models.push(e[t])}if(m&&this.sort({silent:!0}),!n.silent){for(let e=0,t=u.length;e<t;e++)a=u[e],a.trigger?a.trigger("add",a,this,n):this.trigger("add",a,this,n);(m||g.length)&&this.trigger("sort",this,n)}return e}remove(e){let t,n,r,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=Array.isArray(e)?e.slice():[e],s=[];for(let e=0,l=o.length;e<l;e++)if(i=o[e],i&&(r=i instanceof this.modelClass?i.id:i,t=s[e]=this.get(r),t)){const e=t;this._deIndex(t),n=this._models.indexOf(t),this._models.splice(n,1),a.silent||(a.index=n,e.trigger?e.trigger("remove",t,this,a):this.trigger("remove",t,this,a)),this._removeReference(e)}return s}reset(){for(let e=0,t=this._models.length;e<t;e++)this._removeReference(this._models[e]);this._reset(),this.trigger("reset",this)}sort(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this._comparator)throw new Error("Cannot sort without comparator");return this._models.sort(this._comparator.bind(this)),e.silent||this.trigger("sort",this,e),this}replaceId(e,t){const n=this.get(e);n&&(this._removeFromIndex(e),n.set({id:t}),this._addIndex(n))}reorderMutate(e,t){(0,a.arrayMoveMutate)(this._models,e,t)}get(e){return this._index[e]}assertGet(e){const t=this._index[e];return t||(__LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("Collection:assertGet no result")),t}at(e){return this._models[e]}serialize(){return this.map((e=>e.toJSON()))}toJSON(){return this.serialize()}isModel(e){return e instanceof this.modelClass}includes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return 0===t?e instanceof this.modelClass&&null!=this.get(e.id):this._models.includes(e,t)}indexOf(e,t){return this._models.indexOf(e,t)}lastIndexOf(e,t){return this._models.lastIndexOf(e,t)}every(e){return this._models.every(e)}some(e){return this._models.some(e)}forEach(e){this._models.forEach(e)}map(e){return this._models.map(e)}filter(e){return this._models.filter(e)}findFirst(e){return this._models.find(e)}reduce(e,t){return this._models.reduce(e,t)}slice(e,t){return this._models.slice(e,t)}where(e){return this.filter((t=>{for(const n in e)if(e[n]!==t.get(n))return!1;return!0}))}head(){return this._models[0]}last(){return this._models[this._models.length-1]}toArray(){return this._models.slice()}getModelsArray(){return this._models}reorder(e,t){return(0,a.arrayMove)(this._models,e,t)}_reset(){this._models=[],this._index={}}_prepareModel(e,t){if(this.isModel(e))return e.collection||(e.collection=this),e;const n=(0,i.default)((0,i.default)({},t),{},{collection:this});try{return new this.modelClass(e,n)}catch(e){return void __LOG__(3)`collection:_prepareModel exception: ${e.stack}`}}_addReference(e){this._addIndex(e),e.collection||(e.collection=this),e.on&&e.on("all",this._handleModelEvent,this)}_removeReference(e){this===e.collection&&delete e.collection,this._deIndex(e),e.off&&e.off("all",this._handleModelEvent,this)}_addIndex(e){this._index[e.id]=e}_deIndex(e){delete this._index[e.id]}_removeFromIndex(e){this.get(e)&&delete this._index[e]}_handleModelEvent(e,t,n,r){const i=e.indexOf(":"),a=-1===i?e:e.slice(0,i);("add"!==a&&"remove"!==a||n===this)&&("destroy"===a&&this.remove(t,r),this.trigger.apply(this,arguments))}}t.default=s},347605:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.NO_DEFAULT_VALUE=t.INIT=t.Attr=void 0,t.collection=function(e){return{val:e,type:m}},t.convert=function(e){const t=new e({},{_internalInitializationDoNotUse:!0}),n={name:e.name||"Unknown",props:{},session:{},derived:{},collections:{},isIdType:e.isIdType};e.Collection&&(n.Collection=e.Collection);e.idClass&&(n.idClass=e.idClass);e.allowedIds&&(n.allowedIds=e.allowedIds);const r=new Set(["constructor"]),i=new Set(["collection","parent","__changes","__fired","__initialized"]);(function(e){const t=[];for(const n in e)"function"!=typeof e[n]&&t.push([n,e[n]]);return t})(t).forEach((t=>{let[a,s]=t;if(!i.has(a)&&null!=s)switch(s.type){case f:n.props[a]=y(s);break;case h:n.session[a]=y(s);break;case g:n.derived[a]=(0,o.default)(s,"type"),r.add(s.fn.name);break;case m:n.collections[a]=s.val;break;default:throw new Error(`Invalid defineModel Class type for ${e.name}:${a}.`)}}));const a=function(e){const t={},n=Object.getPrototypeOf({});let r=e;Object.getOwnPropertyNames(r).forEach((e=>{"function"==typeof r[e]&&(t[e]=r[e])}));for(;(r=Object.getPrototypeOf(r))&&r!==n;)Object.getOwnPropertyNames(r).forEach((e=>{e in t||(t[e]=r[e])}));return t}(t);return r.forEach((e=>{delete a[e]})),Object.assign(n,a),n},t.derived=function(e,t){return{fn:e,deps:t,type:g}},t.prop=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_;const t={defaultValue:e,type:f};return t},t.session=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_;const t={defaultValue:e,type:h};return t},t.stateExtend=function(e,t){const n=(0,l.default)(t.name,"protoDef.name");delete t.name;const r=function(e,t){return{[t]:class extends e{}}[t]}(e,n),s=r.prototype,u=s.__props=[],_=s.__session=[],f=s.__derived=[],h=s._collections={},g=s._definition={},m=s._derived={};(0,a.default)(t.props,(function(e,t){u.push(t),S(s,t,e,p.PROP)})),(0,a.default)(t.session,(function(e,t){_.push(t),S(s,t,e,p.SESSION)})),(0,a.default)(t.derived,(function(e,t){f.push(t),function(e,t,n){const r=E(t),i=n.fn;e._definition[t]=e._derived[t]={sk:r,evt:"change:"+t,attr:p.DERIVED,fn:i,deps:n.deps},Object.defineProperty(e,t,{get(){const e=this[r];if(e!==d)return e;const t=i.call(this);return this[r]=t,t},set(){throw new TypeError(`'${t}' is a derived property, it can't be set directly.`)}})}(s,t,e)})),(0,a.default)(t.collections,(function(e,t){h[t]=e})),Object.assign(s,(0,o.default)(t,["props","session","derived","collections"]));const y=u.concat(_),T=y.length;Object.defineProperties(s,{attributes:{get(){const e={};for(let t=0;t<T;++t)e[y[t]]=this[y[t]];return e}},isState:{get:()=>!0,set(){throw new Error("attempt to set isState")}}});const v={};for(let e=0;e<T;e++){const t=y[e];"defaultValue"in g[t]&&(v[t]=d)}(0,i.default)(v)||(s.__defaults=v);if(f.length){const e=[],t={},n={};(0,a.default)(m,((r,i)=>{n[i]=!0,(0,a.default)(r.deps,(r=>{n[r]=!0,(t[r]||(t[r]=[])).push(i),e.push([i,r])}))})),e.length&&(s._deps=t,s._topo=c.default.array(Object.keys(n),e).reverse())}return r};var i=r(n(441609)),a=r(n(402525)),o=r(n(957557)),s=r(n(513218)),l=r(n(132375)),u=n(425315),c=r(n(394633));const d={sentinel:"DEFAULT VALUE PLACEHOLDER"};t.INIT=d;const p={PROP:"PROP",SESSION:"SESSION",DERIVED:"DERIVED"};t.Attr=p;const _=Symbol("NO_DEFAULT_VALUE");t.NO_DEFAULT_VALUE=_;const f="Props",h="Session",g="Derived",m="Collection";function y(e){const t=e.defaultValue;return t===_?{}:{defaultValue:t}}function E(e){return"__x_"+e}function S(e,t,n,r){if(!(0,s.default)(n))throw new Error("Invalid Prop/Session definition.");const i={sk:E(t),evt:`change:${t}`,attr:r};void 0!==n.defaultValue&&(i.defaultValue=n.defaultValue),e._definition[t]=i;const a=(0,u.isFunction)(i.defaultValue);if(null!=i.defaultValue&&!a){if(Array.isArray(i.defaultValue))throw new Error("Do not return mutable types as default values as they are shared. Type: Array provided.");if((0,s.default)(i.defaultValue))throw new Error("Do not return mutable types as default values as they are shared. Type: WAUnsafeObjectType provided.")}const o=i.sk;Object.defineProperty(e,t,{set(e){this.set(t,e)},get(){const e=this[o];return e!==d?e:a?this[o]=i.defaultValue():i.defaultValue}})}},976484:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyStates=t.ProxyStateFactory=t.DuplicatedProxyProperty=void 0;var i=r(n(506479)),a=n(643930);const o=["props","session","collections","derived"];class s extends((0,a.customError)("DuplicatedProxyProperty")){}t.DuplicatedProxyProperty=s;const l={};t.ProxyStates=l;t.ProxyStateFactory=(e,t,n)=>{const{props:r,session:a,collections:u,derived:c}=t,d=(0,i.default)(t,o),p=function(e){this.$ProxyState$state=e},_={};if([r,a,u,c].forEach((t=>{t&&Object.keys(t).forEach((t=>{_[t]={get(){return __LOG__(4,void 0,new Error,!0)`Cannot read proxy property "${e}.${t}" created in <${this.$ProxyState$ComponentName}/>. Make sure it is in your list of concerns.`,SEND_LOGS("Invalid ProxyState Access"),this.$ProxyState$state[t]},set(n){__LOG__(4,void 0,new Error,!0)`Cannot write proxy property "${e}.${t}" created in <${this.$ProxyState$ComponentName}/>. Make sure it is in your list of concerns.`,SEND_LOGS("Invalid ProxyState Write"),this.$ProxyState$state[t]=n}}}))})),_.proxyName={value:e},_.mirrorMask={value:n},_.isProxyOf={value(e){return this.$ProxyState$state===e}},["set","get",...Object.keys(d)].forEach((e=>{_[e]={value(){const t=this.$ProxyState$state;return t[e].apply(t,arguments)}}})),(p.prototype=Object.create(null,_)).constructor=p,e in l)throw new s(`Duplicated proxy property "${e}".`);l[e]=p}},411067:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unproxy=function(e){if(null==e?void 0:e.$ProxyState$state)return e.$ProxyState$state;return e}},154549:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.CACHE_POLICY=t.BaseCachePolicy=void 0;var i=r(n(395654));const a={LOAD:"LOAD",NONE:"NONE"};t.CACHE_POLICY=a;class o extends i.default{constructor(e,t){super(),this.collection=e,this.id=t}enableCaching(){}disableCaching(){}}t.BaseCachePolicy=o,o.policy=a.NONE},427401:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.createCachePolicy=function(e,t){switch(t.policy){case"LOAD":return new i.default(e,t);case"NONE":return new a.default(e,t)}return new a.default(e,{id:"none",policy:"NONE"})};var i=r(n(682631)),a=r(n(392131))},682631:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(23279)),a=n(154549);class o extends a.BaseCachePolicy{constructor(e,t){super(e,t.id),this._trigger=t.trigger||"all",this._delay=t.delay,this._saveToCache=(0,i.default)(this.saveToCache,this._delay)}saveToCache(){this.collection.saveToCache()}enableCaching(){this.listenTo(this.collection,this._trigger,this._saveToCache)}disableCaching(){this.stopListening(this.collection,this._trigger,this._saveToCache)}}t.default=o,o.policy=a.CACHE_POLICY.LOAD},392131:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(154549);class i extends r.BaseCachePolicy{constructor(e,t){super(e,t.id)}}t.default=i,i.policy=r.CACHE_POLICY.NONE},557346:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.LiveLocationCollectionImpl=t.LiveLocationCollection=void 0;var i=n(990445),a=n(594534),o=r(n(947490)),s=n(373070),l=r(n(124928));class u extends a.BaseCollection{_find(e){return l.default.isUser(e)||l.default.isGroup(e)?Promise.reject(new Error("This call is only supported in non-MD mode")):Promise.reject(new Error("invalid wid for live location: "+e))}getActive(){return Promise.reject(new Error("This call is only supported in non-MD mode"))}onResume(){this.filter((e=>e.active&&e.hasParticipants())).forEach((e=>{this.update(e.id)}))}processMsg(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.type===s.MSG_TYPE.LOCATION&&e.isLive||(__LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("collection:liveLocation trying to process non live-location msg"));const n=e.id.remote,{lat:r,lng:a,accuracy:o,speed:l,degrees:u,sequence:c,comment:d,shareDuration:p,t:_}=e;if(!_||!p)return;const f=_+p;if(f<=(0,i.unixTime)())return;const h={id:e.sender,lat:r,lng:a,accuracy:o,speed:l,degrees:u,sequence:c,comment:d,expiration:f,lastUpdated:_,msg:e};-1===c&&delete h.sequence;const g=this.get(n);if(g){const e=g.participants.get(h.id);if(t)return void(e&&e.lastUpdated<=h.lastUpdated&&e.set(h));if(e&&g.participants.removeParticipant(e),g.hasParticipants())return void g.participants.add(h)}this.add({id:n,participants:[h]})}removeMsg(e){e.type===s.MSG_TYPE.LOCATION&&e.isLive||(__LOG__(4,void 0,new Error,!0)`Assertion failed!`,SEND_LOGS("collection:liveLocation trying to remove non live-location msg"));const t=e.id.remote,n=e.sender,r=this.get(t);r&&r.participants.remove(n)}_extractLocationFields(e){return void 0===e.lat||void 0===e.lng?{}:{lastUpdated:(0,i.unixTime)()-e.elapsed,lat:e.lat,lng:e.lng,accuracy:e.accuracy,speed:e.speed,degrees:e.degrees,comment:e.comment}}}t.LiveLocationCollectionImpl=u,u.model=o.default,u.staleCollection=!0,u.resumeOnAvailable=!0;const c=new u;t.LiveLocationCollection=c},947490:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(54918),a=n(965012),o=r(n(435390)),s=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),l=n(459857),u=r(n(124928));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}class d extends i.BaseModel{constructor(){super(...arguments),this.id=(0,i.prop)(),this.duration=(0,i.prop)(),this.participants=(0,i.collection)(o.default),this.active=(0,i.session)(!1),this.keepAliveTimer=(0,i.session)(),this.stopPromise=(0,i.session)()}initialize(){super.initialize(),this.listenTo(this.participants,"remove reset",(()=>{this.hasParticipants()||this.delete()}));const e=a.ChatCollection.get(this.id);e&&!e.liveLocation&&(e.liveLocation=this)}delete(){super.delete(),this.stopViewingMap(),this.participants.delete(),this.getCollection().remove(this.id);const e=a.ChatCollection.get(this.id);e&&(e.liveLocation=void 0)}hasParticipants(){return this.participants.length>0}startViewingMap(){this.active||(this.active=!0,this._updateLiveLocations(),this._startKeepAlive())}stopViewingMap(){this.active&&(this.active=!1,this._pauseLiveLocations(),this._stopKeepAlive())}userHasLiveLocation(e){return!!this.participants.get(e)}iHaveLiveLocation(){return this.userHasLiveLocation((0,l.getMaybeMeUser)())}stopMyLiveLocation(){return this.iHaveLiveLocation()?this.stopPromise?this.stopPromise:Promise.reject(new Error("This call is only supported in non-MD mode")):Promise.reject(new s.ActionError)}_updateLiveLocations(){this.getCollection().update(this.id).catch((()=>{}))}_pauseLiveLocations(){throw new Error("This call is only supported in non-MD mode")}_sendKeepAlive(){throw new Error("This call is only supported in non-MD mode")}_startKeepAlive(){if(null!=this.keepAliveTimer)return;const e=this.duration;null!=e&&0!==e&&(this.keepAliveTimer=window.setInterval(this._sendKeepAlive.bind(this),1e3*e))}_stopKeepAlive(){null!=this.keepAliveTimer&&(window.clearInterval(this.keepAliveTimer),this.keepAliveTimer=null)}getCollection(){return n(557346).LiveLocationCollection}}d.Proxy="liveLocation",d.idClass=u.default;var p=(0,i.defineModel)(d);t.default=p},435390:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(594534),a=n(684733),o=r(n(565761)),s=n(459857);class l extends i.BaseCollection{constructor(){super(),this.listenTo(this,"change:disabled",(e=>{e.disabled&&this.removeParticipant(e)}))}delete(){this.forEach((e=>this.removeParticipant(e)))}validLocations(){return this.filter((e=>e.valid))}removeParticipant(e){this.remove(e),e.delete()}}t.default=l,l.model=o.default,l.comparator=(e,t)=>{const n=(0,s.getMaybeMeUser)();return e.contact.id.equals(n)?-1:t.contact.id.equals(n)?1:(0,a.ContactComparator)(e.contact,t.contact)}},565761:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(990445),a=n(425315),o=r(n(164325)),s=n(54918),l=n(121977),u=n(592036),c=n(459857),d=r(n(124928));class p extends s.BaseModel{constructor(){super(...arguments),this.id=(0,s.prop)(),this.msg=(0,s.prop)(),this.lat=(0,s.prop)(),this.lng=(0,s.prop)(),this.accuracy=(0,s.prop)(),this.speed=(0,s.prop)(),this.degrees=(0,s.prop)(),this.sequence=(0,s.prop)(),this.comment=(0,s.prop)(),this.expiration=(0,s.prop)(),this.lastUpdated=(0,s.prop)(),this.contact=(0,s.session)(),this.expireTimerId=(0,s.session)(),this.disabled=(0,s.session)(!1),this.isMe=(0,s.derived)((function(){return this.id.equals((0,c.getMaybeMeUser)())}),["id"]),this.valid=(0,s.derived)((function(){return t=this.lat,(0,a.isNumber)(t)&&t>=-90&&t<=90&&(e=this.lng,(0,a.isNumber)(e)&&e>=-180&&e<=180);var e,t}),["lat","lng"])}initialize(){super.initialize(),this.addChild("contact",l.ContactCollection.gadd(this.id)),(0,u.addLiveLocation)(this.contact,this),this.listenTo(this,"change:expiration",this._setExpireTimer),this._setExpireTimer()}delete(){super.delete(),this._disableMsg(),(0,u.removeLiveLocation)(this.contact,this),this._clearExpireTimer()}remainingTime(){return this.expiration-(0,i.unixTime)()}elapsedTime(){return(0,i.unixTime)()-this.lastUpdated}disable(){this.disabled=!0}_disableMsg(){const e=this.msg;e&&(e.shareDuration=(0,i.unixTime)()-e.t-1)}_setExpireTimer(){this.expiration&&(this.remainingTime()<=0?this._expire():this.expireTimerId=o.default.setGlobalTimeout(this._expire.bind(this),1e3*this.expiration,this.expireTimerId))}_clearExpireTimer(){o.default.clearTimeout(this.expireTimerId),this.expireTimerId=null}_expire(){this.disable()}}p.Proxy="liveLocationParticipant",p.idClass=d.default;var _=(0,s.defineModel)(p);t.default=_},1840:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(497565),o=n(594534),s=n(698210),l=r(n(932325)),u=r(n(409701)),c=n(75421),d=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=g(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),p=n(241588),_=r(n(237889)),f=n(456277),h=n(548360);function g(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(g=function(e){return e?n:t})(e)}const{IMAGE:m,VIDEO:y,DOCUMENT:E,AUDIO:S}=s.FILETYPE,{READY:T,ERROR:v,PROCESSING:A}=a.ATTACH_MEDIA_STATE;let C=1;class P extends o.BaseCollection{constructor(e){let{chatParticipantCount:t}=e;super(),this.errorMsgs=null,this.ignored=0,this.mediaPickerStatsLogger=new f.MediaPickerStatsLogger,this.selection=new _.default([],(e=>e.id),"prev"),this.isStickerMaker=!1,this.mediaPickerStatsLogger.chatRecipients=t,this.listenTo(this.selection,"all",this._handleSelectionEvents.bind(this))}_handleSelectionEvents(e,t){"focus"!==t&&!1!==t||this.trigger("active-change")}removeSingleton(e,t){var n;e&&(t||this.mediaPickerStatsLogger.logDelete(e.id),e.url&&window.URL.revokeObjectURL(e.url),(null===(n=e.original)||void 0===n?void 0:n.url)&&window.URL.revokeObjectURL(e.original.url))}remove(e,t){const n=super.remove(e,t);return n.forEach((e=>this.removeSingleton(e,t))),this.selection.init(this.getPreviewableMedias(),!0),n}delete(){super.delete(),this.forEach((e=>this.removeSingleton(e))),this.selection.init(this.getPreviewableMedias(),!0)}reorder(e,t){return this.reorderMutate(e,t),this.selection.init(this.getPreviewableMedias(),!0),this.getPreviewableMedias()}replace(e,t){const n=this.get(e);if(!n)return;const r=this.indexOf(n),i=n.caption;this.remove(n,{silent:!0}),n.delete();const o=new a.AttachMedia({id:e,caption:i,file:this._normalizeAttachment(t)});return this.add(o,r?{at:r}:{}),o.processPromise}getValidMedias(){return this.filter((e=>e.state===T||e.state===A))}getPreviewableMedias(){return this.filter((e=>e.previewable))}getActive(){return this.selection.getVal()}setActive(e){this.selection.setVal(e)}unsetActive(){this.selection.unset()}setNextAsActive(){const e=this.selection.list.length-1;return-1===this.selection.index||this.selection.index===e||this.selection.setNext(),this.selection.getVal()}setPrevAsActive(){return-1===this.selection.index||0===this.selection.index||this.selection.setPrev(),this.selection.getVal()}processAttachments(e,t){var n=this;return(0,i.default)((function*(){const r=n.getPreviewableMedias().length,i=(0,c.getMaxNumberSelectableMedia)(e.length+r),o=e.length+r>i?Math.max(i-r,0):e.length,s=e.length-o;0===o?s&&n.trigger("max_upload_limit",s):n.ignore(s);const l=e.slice(0,o).map((e=>new a.AttachMedia({id:C++,file:n._normalizeAttachment(e),fileOrigin:t})));n.add(l);const u=n.getActive();return n.unsetActive(),Promise.all(e).then((()=>{n._attemptToSetNextActiveFromAdded(l,u)})),yield Promise.all(l.map((e=>e.processPromise))),l.forEach((e=>n._logMediaAdd(e,t))),n._attemptToSetNextActiveFromAdded(l,u)}))()}_attemptToSetNextActiveFromAdded(e,t){if(this.getActive())return;if(this.getModelsArray().some((e=>e.state===A&&!e.previewable)))return;let n=e.find((e=>e.previewable));n||(n=t),this.selection.init(this.getPreviewableMedias()),n&&this.setActive(n)}_logMediaAdd(e,t){if(null==t)return;const n=e.isGif?"gif":e.type;this.mediaPickerStatsLogger.logAdd(e.id,n,t)}_normalizeAttachment(e){return(0,i.default)((function*(){const t=yield Promise.resolve(e);return t.filename||(t.filename=t.file.name),t.mimetype||(t.mimetype=t.file.type),t.type||(t.type=(0,s.typeFromMimetype)(t.file.type)),!t.type&&t.mimetype&&(t.type=(0,s.typeFromMimetype)(t.mimetype)),t}))()}ignore(e){e>0&&(this.ignored+=e)}uiProcessMsgs(){let e,t=[],n=0,r=0,i=0,a=0,o=0,s=0,_=0,f=0,g=0,T=0,C=0,P=!1;const O=l.default.filesize(p.ServerProps.media),I=l.default.filesize((0,p.getMaxFilesSizeServerProp)()),M=l.default.filesize(1024*p.ServerProps.vcardMaxSizeKb);if(this.forEach((t=>{if(!t.uiProcessed&&(!e&&t.previewable&&(e=t),t.state!==A&&(t.uiProcessed=!0,t.state===v)))if(t.exception instanceof u.default)switch(t.getFileType()){case m:n+=1;break;case y:r+=1;break;case S:i+=1;break;case E:t.isVcardOverMmsDocument?o+=t.documentPageCount:a+=1}else if(t.exception instanceof d.MediaFileEmpty)switch(t.getFileType()){case m:s+=1;break;case y:_+=1;break;case S:f+=1;break;case E:t.isVcardOverMmsDocument?T+=t.documentPageCount:g+=1}else t.exception instanceof d.MediaFileFailedLoad?P=!0:C+=1})),n>0&&t.push(l.default.t(372,{number:n,_plural:n,maxSize:O})),r>0&&t.push(l.default.t(649,{number:r,_plural:r,maxSize:O})),i>0&&t.push(l.default.t(142,{number:i,_plural:i,maxSize:O})),a>0&&t.push(l.default.t(248,{number:a,_plural:a,maxSize:I})),o>0&&t.push(l.default.t(215,{_plural:o,maxSize:M})),s>0&&t.push(l.default.t(371,{number:s,_plural:s})),_>0&&t.push(l.default.t(647,{number:_,_plural:_})),f>0&&t.push(l.default.t(140,{number:f,_plural:f})),g>0&&t.push(l.default.t(247,{number:g,_plural:g})),T>0&&t.push(l.default.t(214,{number:T,_plural:T})),C>0&&t.push(l.default.t(306,{number:C,_plural:C})),P&&(t=[],t.push(h.fbt._("The item you tried adding failed to load.",null,{hk:"1MmBvO"}))),t.length>1){t=[];const e=n+r+i+a,o=s+_+f+g,u=e+o+C;0===C?(0!==e&&t.push(l.default.t(307,{number:e,_plural:e,maxSize:I})),0!==o&&t.push(l.default.t(303,{number:o,_plural:o}))):t.push(l.default.t(305,{number:u,_plural:u}))}const b=t.join(" ");this.errorMsgs=b;const R=this.getPreviewableMedias().length;this.ignore(R-(0,c.getMaxNumberSelectableMedia)(R));const N=this.ignored;return this.ignored=0,N&&this.trigger("max_upload_limit",N),C>0&&this.trigger("files_not_supported"),{errorMsgs:b}}canSend(){return!this.getModelsArray().some((e=>e.state===A&&!e.previewable))}}t.default=P,P.model=a.AttachMedia},497565:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MediaEditorAction=t.AttachMedia=t.ATTACH_MEDIA_STATE=void 0;var i=r(n(81109)),a=r(n(348926)),o=n(924583),s=n(54918),l=n(698210),u=n(644234),c=r(n(287866)),d=r(n(409701)),p=r(n(756680)),_=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=m(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),f=n(373070),h=(n(411562),n(432938)),g=n(323400);function m(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(m=function(e){return e?n:t})(e)}const y=n(76672).Mirrored(["Outline","OutlineDone","CropRotateCanvas"]);t.MediaEditorAction=y;const E={READY:"ready",PROCESSING:"processing",ERROR:"error"};t.ATTACH_MEDIA_STATE=E;class S extends s.BaseModel{constructor(){super(...arguments),this.id=(0,s.prop)(),this.file=(0,s.prop)(),this.uiProcessed=(0,s.prop)(!1),this.fileOrigin=(0,s.prop)(),this.isVcardOverMmsDocument=(0,s.prop)(!1),this.stickerMaker=(0,s.prop)(!1),this.state=(0,s.session)(),this.mediaPrep=(0,s.session)(),this.mimetype=(0,s.session)(),this.originalMimetype=(0,s.session)(),this.processPromise=(0,s.session)(),this.exception=(0,s.session)(),this.caption=(0,s.session)(),this.type=(0,s.session)(f.MSG_TYPE.UNKNOWN),this.mediaEditorData=(0,s.session)(),this.lastMediaEditorAction=(0,s.session)(),this.editedFile=(0,s.session)(),this._mediaEditorUndoStack=(0,s.session)((()=>[])),this._mediaEditorRedoStack=(0,s.session)((()=>[])),this.preview=(0,s.session)(),this.fullPreview=(0,s.session)(),this.fullPreviewSize=(0,s.session)(),this.filename=(0,s.session)(),this.documentPageCount=(0,s.session)(),this.isGif=(0,s.session)(),this.gifAttribution=(0,s.session)(),this.previewable=(0,s.derived)((function(){if(!this.type||!this.mimetype||!this.fullPreview)return!1;switch(this.type){case f.MSG_TYPE.DOCUMENT:return!!this.filename;case f.MSG_TYPE.IMAGE:case f.MSG_TYPE.VIDEO:return!(!this.fullPreviewSize||!this.preview);case f.MSG_TYPE.AUDIO:case f.MSG_TYPE.STICKER:case f.MSG_TYPE.PTT:case f.MSG_TYPE.UNKNOWN:return!0;default:throw new Error(`Unsupported attach media type ${this.type}`)}}),["preview","fullPreview","type","filename","fullPreviewSize","mimetype"]),this.filesize=(0,s.derived)((function(){return this.file instanceof p.default?this.file.size():this.file instanceof Blob?this.file.size:null}),["file"]),this.fileExt=(0,s.derived)((function(){return this.filename?(0,l.getFileExtension)(this.filename):null}),["filename"])}initialize(){if(super.initialize(),!(this.file instanceof Promise))throw new Error("cannot process non-promise file");this.processAttachment(this.file)}processAttachment(e){this.state=E.PROCESSING,this.mediaEditorData=c.default.create(),this.processPromise=this._processAttachmentPromiseHelper(e).then((()=>{const e=new Image;e.src=this.fullPreview,e.onload=()=>{const t={};this.stickerMaker&&(t.fitToSquare=!0,t.scale=1-2*h.STICKER_MAKER_IMAGE_PADDING/h.STICKER_DIMENSION),this.mediaEditorData=this.mediaEditorData.setBackground(e,t)}}))}_processAttachmentPromiseHelper(e){var t=this;return e.then(function(){var e=(0,a.default)((function*(e){t.set(e);const n=(0,i.default)({},null),{file:r,filename:a,isGif:o,asSticker:s,stickerMaker:c,gifAttribution:d,isVcardOverMmsDocument:_,documentPageCount:m}=e;!0===o?(n.asGif=!0,n.gifAttribution=d):e.type===l.FILETYPE.DOCUMENT&&(n.asDocument=!0,n.filename=a,n.isVcardOverMmsDocument=_,n.documentPageCount=m),n.asSticker=s,!0===c&&(n.minDimension=h.STICKER_DIMENSION,n.transparency=!0),n.precomputedFields={fullHeight:e.fullPreviewSize?e.fullPreviewSize.height:void 0,fullWidth:e.fullPreviewSize?e.fullPreviewSize.width:void 0,preview:e.preview,duration:e.duration};const y=p.default.createFromData(r,r.type),S=(0,u.prepRawMedia)(y,n);t.set({mediaPrep:S});const T=yield S.waitForPrep(),v=T.documentPreview,A=T.mediaBlob instanceof p.default?window.URL.createObjectURL(T.mediaBlob.forceToBlob()):window.URL.createObjectURL(T.mediaBlob),C={file:T.mediaBlob,fullPreview:A,type:T.type,filename:T.filename,mimetype:T.mimetype,originalMimetype:e.mimetype,preview:T.preview,state:E.READY,isGif:T.isGif,fullPreviewSize:void 0,documentPageCount:m,isVcardOverMmsDocument:T.isVcardOverMmsDocument,editedFile:T.mediaBlob};(0,g.isNonZeroNumber)(T.fullWidth)&&(0,g.isNonZeroNumber)(T.fullHeight)&&(C.fullPreviewSize={height:T.fullHeight,width:T.fullWidth}),T.type===f.MSG_TYPE.IMAGE&&(C.preview=A),T.type===f.MSG_TYPE.DOCUMENT&&v&&(C.fullPreview=v.url,C.preview=v.thumbUrl,C.fullPreviewSize={height:v.height,width:v.width},C.documentPageCount=v.pdfPages),t.set(C),t.previewable||(__LOG__(4,void 0,new Error,!0)`Invariant violated, processed file is not previewable`,SEND_LOGS("AttachMedia processFile"))}));return function(){return e.apply(this,arguments)}}()).catch((0,o.filteredCatch)([_.InvalidMediaFileType,_.InvalidImageFileType],(t=>{if(this.isGif||this.type===l.FILETYPE.DOCUMENT)throw t;return this._processAttachmentPromiseHelper(e.then((e=>(e.type=l.FILETYPE.DOCUMENT,e))))}))).catch((0,o.filteredCatch)([d.default,_.MediaFileFailedLoad,_.MediaFileEmpty],(e=>(this.set({exception:e,state:E.ERROR}),this)))).catch((()=>(__LOG__(3)`AttachMedia:processFile convert unexpected error to InvalidMediaFileType:`,this.set({exception:new _.InvalidMediaFileType,state:E.ERROR}),this)))}sendToChat(e,t){if(!this.mediaPrep)return Promise.reject(new Error("MediaPrep not available"));if(this.state===E.ERROR)return Promise.reject(new Error(this.exception));if(!(this.state!==E.PROCESSING||this.previewable&&t.addEvenWhilePreparing))return Promise.reject(new Error("Media still processing"));if(this.state===E.READY)return this.mediaPrep.sendToChat(e,t);const n={mimetype:this.mimetype};switch(this.type){case f.MSG_TYPE.VIDEO:n.isGif=this.isGif,n.gifAttribution=this.gifAttribution;case f.MSG_TYPE.IMAGE:n.width=this.fullPreviewSize.width,n.height=this.fullPreviewSize.height,n.body=this.preview,t.placeholderProps=n;break;case f.MSG_TYPE.DOCUMENT:n.pageCount=this.documentPageCount,n.filename=this.filename,n.body=this.preview,t.placeholderProps=n;break;case f.MSG_TYPE.AUDIO:case f.MSG_TYPE.PTT:}return this.mediaPrep.sendToChat(e,t)}getFileType(){if(!(this.file instanceof Blob||this.file instanceof File))throw new Error("expected file to be a Blob or File");return(0,l.typeFromMimetype)(this.file.type)}isViewableOnce(){return new Set([f.MSG_TYPE.IMAGE,f.MSG_TYPE.VIDEO]).has(this.type)&&!this.isGif}isSendableAsSticker(){return this.type===f.MSG_TYPE.IMAGE}delete(){this.fullPreview&&window.URL.revokeObjectURL(this.fullPreview),super.delete()}updateMediaEditorData(e,t){return this.mediaEditorData===e||(t.undoable&&(this._mediaEditorUndoStack.push([this.mediaEditorData,this.lastMediaEditorAction]),this.lastMediaEditorAction=t.lastAction,this._mediaEditorRedoStack=[]),this.mediaEditorData=e),this.mediaEditorData}undoMediaEditorData(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.canUndoMediaEditorData()){e&&this._mediaEditorRedoStack.push([this.mediaEditorData,this.lastMediaEditorAction]);const[t,n]=this._mediaEditorUndoStack.pop();this.mediaEditorData=t,this.lastMediaEditorAction=n}}redoMediaEditorData(){if(this.canRedoMediaEditorData()){this._mediaEditorUndoStack.push([this.mediaEditorData,this.lastMediaEditorAction]);const[e,t]=this._mediaEditorRedoStack.pop();this.mediaEditorData=e,this.lastMediaEditorAction=t}}canUndoMediaEditorData(){return this._mediaEditorUndoStack.length>0}canRedoMediaEditorData(){return this._mediaEditorRedoStack.length>0}updateEditedFile(e){this.editedFile=e}updatePreview(e){window.URL.revokeObjectURL(this.preview),this.preview=e}updateFullPreview(e){window.URL.revokeObjectURL(this.fullPreview),this.fullPreview=e}updateCaption(e){this.caption=e}}S.Proxy="attachMedia";const T=(0,s.defineModel)(S);t.AttachMedia=T},755707:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canAdminRevokeMsg=function(e){var t;const n=(0,h.unproxy)(e),r=Math.trunc(+new Date/1e3)-n.t<=f.REVOKE_WINDOW_V2;return(0,u.adminRevokeSenderEnabled)()&&m(n)&&!n.id.fromMe&&Boolean(null===(t=n.chat.groupMetadata)||void 0===t?void 0:t.participants.iAmAdmin())&&r},t.canEditMsg=function(e){const t=(0,h.unproxy)(e);return!(!(0,u.sendMessageEditEnabled)()||!(0,l.msgTypeSupportsEditing)(t.type))&&(t.isSentByMe&&!t.isForwarded&&(0,l.isWithinEditWindow)(t.t)&&"out"===t.self&&!t.chat.isCAG&&!t.mayFail())},t.canMsgForward=g,t.canMsgQuickForward=function(e){const t=(0,h.unproxy)(e);if(!g(e)||t.isFrequentlyForwarded||0!==(0,c.getSuspiciousLinks)(t).length||null!=t.asPttLike||t.type===p.MSG_TYPE.STICKER||!t.interactiveButtonsReleased())return!1;return null!=t.asMms||t.linkPreview||t.type===p.MSG_TYPE.VCARD||t.type===p.MSG_TYPE.LOCATION||null!=t.ctwaContext},t.canReportMsg=function(e){const t=(0,h.unproxy)(e);if(t.isSentByMe||t.isPSA)return!1;return(0,o.isSpamSupportedForMessageType)(t.type)},t.canSenderRevokeMsg=function(e){const t=(0,h.unproxy)(e),n=(0,r.isSenderRevokeWindowSenderEnabled)()?f.REVOKE_WINDOW_V2:f.REVOKE_WINDOW,i=Math.trunc(+new Date/1e3)-t.t<=n;return m(t)&&t.id.fromMe&&i},t.canStarMsg=function(e){const t=(0,h.unproxy)(e);if(t.type===p.MSG_TYPE.LIST&&!(0,d.listMsgCanRender)(t))return!1;return(!t.isEphemeral||t.supportsStarWithKeepInChat())&&!t.isNotification&&!t.isFutureproof&&!t.isViewOnce&&t.type!==p.MSG_TYPE.REVOKED&&!(t.ack<i.ACK.SENT&&t.isSentByMe)&&t.interactiveButtonsReleased()};var r=n(493928),i=n(402994),a=n(387196),o=n(126506),s=n(172259),l=n(591988),u=n(97858),c=n(344247),d=n(96219),p=n(373070),_=n(533494),f=n(140661),h=n(411067);function g(e){var t,n;const r=(0,h.unproxy)(e);if(r.type===p.MSG_TYPE.CIPHERTEXT)return!1;if(r.type===p.MSG_TYPE.OVERSIZED)return!1;if(r.type===p.MSG_TYPE.REVOKED)return!1;if(r.type===p.MSG_TYPE.UNKNOWN)return!1;if(r.type===p.MSG_TYPE.PAYMENT)return!1;if(r.type===p.MSG_TYPE.POLL_CREATION)return!1;if(r.type===p.MSG_TYPE.REQUEST_PHONE_NUMBER)return!1;if(r.type===p.MSG_TYPE.LIST)return(null===(t=r.list)||void 0===t?void 0:t.listType)===_.Message$ListMessage$ListType.PRODUCT_LIST&&(0,d.listMsgCanRender)(r);if(r.type===p.MSG_TYPE.GROUPS_V4_INVITE)return!1;if(r.type===p.MSG_TYPE.LOCATION&&r.isLive)return!1;if(r.type===p.MSG_TYPE.ORDER)return!1;if(r.type===p.MSG_TYPE.INTERACTIVE&&null!=r.nativeFlowName)return!1;if(!r.interactiveButtonsReleased())return!1;if(r.ack<i.ACK.SENT&&r.isSentByMe)return!1;if(r.asMms){const e=r.mediaData;if(e.mediaStage===s.MEDIA_DATA_STAGE.EXISTS)return!0;if(e.mediaStage===s.MEDIA_DATA_STAGE.ERROR_MISSING)return!1;if(e.mediaStage===s.MEDIA_DATA_STAGE.ERROR_UNSUPPORTED)return!1;if(e.mediaStage!==s.MEDIA_DATA_STAGE.RESOLVED&&(r.type===p.MSG_TYPE.IMAGE||r.type===p.MSG_TYPE.VIDEO||r.type===p.MSG_TYPE.PTT))return!1;if(r.isViewOnce)return!1;if(r.isUnsentMedia)return!1}return!(null===(n=r.nativeFlowButtons)||void 0===n?void 0:n.length)}function m(e){var t;return!(e.chat.isGroup&&!(null===(t=e.chat.groupMetadata)||void 0===t?void 0:t.participants.iAmMember()))&&(e.isUserCreatedType&&!e.broadcast&&!e.isUnsentPhoneMsg()&&!e.isUnsentMedia&&!(0,a.isSuspendedGroup)(e.chat)&&!(0,a.isTerminatedGroup)(e.chat))}},301460:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MsgCollectionImpl=t.MsgCollection=t.MEDIA_QUERY_LIMIT=void 0;var i=r(n(348926)),a=r(n(132375)),o=n(204597),s=n(425315),l=n(402994),u=n(984330),c=n(594534),d=n(292220),p=r(n(799132)),_=n(969104),f=r(n(283667)),h=(r(n(565754)),n(387191)),g=n(373070),m=n(440585),y=n(533494),E=n(697180),S=n(241588),T=n(226562),v=n(6961),A=r(n(371719)),C=n(459857),P=r(n(124928)),O=n(69769);t.MEDIA_QUERY_LIMIT=50;class I extends c.BaseCollection{constructor(){super(),this.preAck={},this.pendingAdd={},this.ftsCache={},this.productListMessagesPrefetchChain=Promise.resolve([]),this._handleSearchTag=e=>{this.pendingSearchTag=e},this.listenTo(S.ServerProps,"change:pttForwardedFeaturesEnabled",(()=>{this.forEach((e=>{"ptt"!==e.type&&"audio"!==e.type||(e.pttForwardedFeaturesEnabled=S.ServerProps.pttForwardedFeaturesEnabled)}))})),this.listenTo(v.Socket,"change:stream",(function(){v.Socket.stream===T.SOCKET_STREAM.DISCONNECTED&&(this.preAck={})})),this.listenTo(this,"remove",this.removeFromCollection)}removeFromCollection(e){e.chat&&e.chat.removeFromCollection(e)}_findQuery(e,t){var r=this;return(0,i.default)((function*(){const i=r;let a;switch(e.direction){case"before":case"after":a=e.direction;break;default:a="before"}const o={add:a,isHistory:!0},s=yield(0,O.msgFindQuery)(a,e,t,void 0);return s.status>=400?(__LOG__(3)`model:Msg:findQuery error ${s.status}`,Promise.reject(s.status)):(s.forEach((function(e){e.invis=!0})),__LOG__(2)`model:Msg:findQuery:got:${s.length}:${e.direction}`,i.processMultipleMessages(e.remote,s,o,(function(){const t=i.get(e),r=n(965012).ChatCollection.get(e.remote);return t?t.msgChunk:r?r.msgs:void 0})))}))()}add(e,t){const n=(Array.isArray(e)?e:[e]).filter((e=>{if(null==e.ephemeralDuration||0===e.ephemeralDuration)return!0;return!new h.Msg(e).isExpiredAndNotKept()})),r=super.add(n,t);return this._syncTemplateButtonClickState(r),this._syncQuickReplyButtonClickState(r),this._prefetchProductListMessages(r),r}_prefetchProductListMessages(e){const t=n(125392).ProductMessageListCollection;this.productListMessagesPrefetchChain=e.filter((e=>{var t,n;return null!=e&&e.isNewMsg&&e.type===g.MSG_TYPE.LIST&&(null===(t=e.list)||void 0===t?void 0:t.listType)===y.Message$ListMessage$ListType.PRODUCT_LIST&&null!=(null===(n=e.list)||void 0===n?void 0:n.productListInfo)})).reduce(((e,n)=>{var r,i;if(null==n)return e;const a=n.requiresDirectConnection,o=n.isForwarded?n.businessOwnerJid:n.from.toString({legacy:!0}),s=null===(r=n.list)||void 0===r?void 0:r.productListInfo;if(null==o||null==s)return e;const l=t.getOrAdd(n.id,s,a,o,null===(i=n.list)||void 0===i?void 0:i.title);return null==l||0!==l.productCollection.getModelsArray().length||l.isFetching()?e:e.then((()=>t.update(l.id)))}),this.productListMessagesPrefetchChain)}_syncTemplateButtonClickState(e){for(let t=0;t<e.length;t++){const n=e[t];if(!n)continue;const r=n.chat;if(n.type===g.MSG_TYPE.TEMPLATE_BUTTON_REPLY&&null!=n.selectedIndex&&n.sender.equals((0,C.getMaybeMeUser)())){null==r.msgUnsyncedButtonReplyMsgs&&(r.msgUnsyncedButtonReplyMsgs=new f.default);const{msgUnsyncedButtonReplyMsgs:e}=r,t=(0,E.getQuotedMsgObj)(n);if(!t)continue;let i=e.get(t.id);i||(e.add({id:t.id,unsyncedButtonReplies:new A.default}),i=e.get(t.id));const{unsyncedButtonReplies:o}=(0,a.default)(i,"buttonReplyMsg");o.add(n);const s=this.get(t.id);if(null==s?void 0:s.buttons){const e=s.buttons.get(`${(0,a.default)(n.selectedIndex,"msg.selectedIndex")}`);e&&(e.selected=!0),o.remove(n)}}else if(n.isFromTemplate&&n.buttons){const{msgUnsyncedButtonReplyMsgs:e}=r;if(null==e)continue;const t=e.get(n.id);t&&(t.unsyncedButtonReplies.forEach((e=>{const t=(0,a.default)(n.buttons,"msg.buttons").get(`${(0,a.default)(e.selectedIndex,"replyMsg.selectedIndex")}`);t&&(t.selected=!0)})),t.unsyncedButtonReplies.delete())}}}_syncQuickReplyButtonClickState(e){for(let t=0;t<e.length;t++){const n=e[t];if(n)if(n.type===g.MSG_TYPE.BUTTONS_RESPONSE&&null!=n.selectedButtonId&&n.sender.equals((0,C.getMaybeMeUser)())){const e=(0,E.getQuotedMsgObj)(n);if(!e)continue;const t=this.get(e.id);if(null==t?void 0:t.replyButtons){const e=t.replyButtons.get(n.selectedButtonId);e&&(e.selected=!0)}}else if(n.isDynamicReplyButtonsMsg&&n.replyButtons&&n.replyButtons.every((e=>!e.selected))&&n.chat){const e=Math.max(0,n.chat.msgs.length-1e3);n.chat.msgs.getModelsArray().slice(e).filter((e=>{var t;return e.type===g.MSG_TYPE.BUTTONS_RESPONSE&&null!=e.selectedButtonId&&e.sender.equals((0,C.getMaybeMeUser)())&&(null===(t=(0,E.getQuotedMsgObj)(e))||void 0===t?void 0:t.id.toString())===n.id.toString()})).map((e=>{let{selectedButtonId:t}=e;return t})).forEach((e=>{var t;const r=null===(t=n.replyButtons)||void 0===t?void 0:t.get(e);null!=r&&(r.selected=!0)}))}}}getStarred(e,t,n){var r=this;return(0,i.default)((function*(){const i={count:"number"!=typeof t||isNaN(t)?d.PAGE_SIZE:t,chat:e||void 0,remote:null==n?void 0:n.remote,id:null==n?void 0:n.id,fromMe:null==n?void 0:n.fromMe,participant:null==n?void 0:n.participant},a=yield(0,O.msgFindQuery)("star",i),o=a.status;return a.status>=400?(499===o?__LOG__(2)`model:Msg:getStarred error 499 (unimplemented)`:__LOG__(3)`model:Msg:getStarred error ${o}`,Promise.reject(o)):r.processMultipleMessages(void 0,a,{add:"search"})}))()}getMessagesById(e){var t=this;return(0,i.default)((function*(){const n=yield(0,O.msgFindByIds)(e);return(0,o.promiseProps)({messages:t.processMultipleMessages(void 0,n,{add:"search"}),eof:!0,canceled:!1})}))()}queryVcard(e){var t=this;return(0,i.default)((function*(){const n=yield(0,O.queryVcard)(e);return 499===n.status?(__LOG__(2)`model:Msg:queryVcard error 499 (unimplemented)`,Promise.reject(new u.E499)):t.processMultipleMessages(void 0,n,{add:"search"})}))()}incrementalStarredUpdate(e){return this.processMultipleMessages(void 0,e,{add:"search"})}search(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const a=`${e}__${i.label||i.kind&&i.kind||""}`;if(1===t&&!r){const o=this.ftsCache[a];if(o)return o;const s=this._search(e,t,n,r,i.label,i.kind);this.ftsCache[a]=s;const l=()=>{this.ftsCache[a]=null};return setTimeout(l,_.FTS_TTL),s.catch(l),s}return this._search(e,t,n,r,i.label,i.kind)}_search(e,t,n,r,a,l){var c=this;return(0,i.default)((function*(){const i={searchTerm:e,page:(0,s.isNumber)(t)&&0!==t?t:1,count:(0,s.isNumber)(n)&&0!==n?n:d.PAGE_SIZE,remote:r,tagToCancel:r?c.pendingSearchTag:void 0,label:a,kind:l},p=yield(0,O.msgFindQuery)("search",i,void 0,c._handleSearchTag);if(i.tagToCancel===c.pendingSearchTag&&(c.pendingSearchTag=void 0),499===p.status)return(0,o.promiseProps)({messages:Promise.resolve([]),eof:!1,canceled:!0});if(404===p.status)return Promise.reject(new u.E404);if(p.status>=400)return __LOG__(3)`model:Msg:search error ${p.status}`,Promise.reject(new u.ServerStatusCodeError(p.status,"failed to find a msg during fts"));const _=Array.isArray(p)?p:p.messages,f=!!Array.isArray(p)||p.eof;return(0,o.promiseProps)({messages:c.processMultipleMessages(void 0,_,{add:"search"}),eof:f,canceled:!1})}))()}queryMedia(e,t,n,r,a){var l=this;return(0,i.default)((function*(){const i={remote:e,count:(0,s.isNumber)(t)&&0!==t?t:d.PAGE_SIZE,id:null==r?void 0:r.id,fromMe:null==r?void 0:r.fromMe,participant:null==r?void 0:r.participant,direction:n||"before",media:a},c=yield(0,O.msgFindQuery)("media",i);return c.status>=400?(__LOG__(3)`model:Msg:media error ${c.status}`,404===c.status?Promise.reject(new u.E404):Promise.reject(new u.ServerStatusCodeError(c.status,"failed to find a msg during media query"))):a?l.processMultipleMessages(void 0,c,{add:"search"}):(0,o.promiseProps)({docCount:c.docCount,linkCount:c.linkCount,mediaCount:c.mediaCount,messages:l.processMultipleMessages(void 0,c.messages,{add:"search"})})}))()}getContext(e,t,n){const r=this.get(e);if(r)return Promise.all([(0,O.msgFindQuery)("before",e,n),(0,O.msgFindQuery)("after",e,n)]).then((n=>{let[i,a]=n;if(!Array.isArray(i)||!Array.isArray(a))throw __LOG__(3)`model:msg:getContext fetch error`,i.status||a.status;return r.search=!1,Promise.all([this.processMultipleMessages(e.remote,i,{add:"before",isHistory:!0},t),this.processMultipleMessages(e.remote,a,{add:"after",isHistory:!0},t)])}));const i={add:"after",isHistory:!0};return(0,O.msgFindQuery)("after",e,n).then((n=>{if(!Array.isArray(n))throw __LOG__(3)`model:msg:getContext:after fetch error`,n.status;if(P.default.isStatusV3(n[0].id.remote))throw new Error("statusV3, stop querying before the msg");return this.processMultipleMessages(e.remote,n,i,t)})).then((t=>{const r=(0,a.default)(t[0],"after[0]"),i=r.id.clone();i.count=e.count+1;const o={add:"before",isHistory:!0};return Promise.all([(0,O.msgFindQuery)("before",i,n).then((t=>{if(!Array.isArray(t))throw __LOG__(3)`model:msg:getContext:before fetch error`,t.status;if(!t[t.length-1].id.equals(e))throw __LOG__(3)`model:msg:getContext:before ctx message mismatch`,405;return this.processMultipleMessages(e.remote,t,o,(function(){return r.msgChunk}))})),Promise.resolve(t)])}))}hasSynced(){return(0,p.default)(this,d.COLLECTION_HAS_SYNCED)}delete(){super.delete(),this.preAck={}}processMultipleMessages(e,t,n,r){let i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];const a=()=>(0,m._processMultipleMessages)(e,t,n,r);if(e){let t;const n=this.pendingAdd[e];return t=n&&i?n.then(a):a(),t.finally((()=>{e&&this.pendingAdd[e]===t&&(this.pendingAdd[e]=null)})).catch((()=>{})),this.pendingAdd[e]=t}return a()}markAllAsStale(){this.forEach((e=>e.unset("recvFresh")))}hasUnsentMessages(){return this.some((e=>e.ack===l.ACK.CLOCK&&e.local&&e.isSentByMe))}}t.MsgCollectionImpl=I,I.model=h.Msg;const M=new I;t.MsgCollection=M},739245:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.MsgInfoCollectionImpl=t.MsgInfoCollection=void 0;var i=n(594534),a=n(349965),o=n(738482),s=r(n(565754)),l=n(226562),u=n(6961),c=n(42954);class d extends i.BaseCollection{_initializeStaleCollection(){this.listenTo(u.Socket,"change:stream",(()=>{u.Socket.stream===l.SOCKET_STREAM.DISCONNECTED&&this.forEach((e=>{e.settled||e.set("stale",!0)}))}))}_find(e){const t=n(301460).MsgCollection.get(e);return t?t.isSentByMe?(0,c.sendQueryMsgInfo)(t):Promise.reject(new i.CollectionSilentQueryError("message not sent by me")):Promise.reject(new i.CollectionSilentQueryError(`No message found for id: ${e}`))}updateInfo(e,t,n,r,i,o){const l=new s.default({from:t,to:n,id:e,participant:i}),u=new s.default({from:t,to:n,id:e}),c=this.get(l)||this.get(u);if(c)return(0,a.updateMsgInfo)(c,r,i,o)}}t.MsgInfoCollectionImpl=d,d.model=o.MsgInfo,d.staleCollection=!0;const p=new d;t.MsgInfoCollection=p},738482:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ParticipantCollection=t.MsgInfoParticipant=t.MsgInfo=void 0;var i=n(54918),a=r(n(801156)),o=n(121977),s=n(684733),l=r(n(565754)),u=r(n(124928));class c extends i.BaseModel{constructor(){super(...arguments),this.id=(0,i.prop)(),this.t=(0,i.prop)(),this.contact=(0,i.session)()}initialize(){super.initialize(),this.addChild("contact",o.ContactCollection.gadd(this.id))}}c.Proxy="msgInfoParticipant",c.idClass=u.default;const d=(0,i.defineModel)(c);t.MsgInfoParticipant=d;class p extends a.default{}t.ParticipantCollection=p,p.model=d,p.comparator=(e,t)=>(0,s.ContactComparator)(e.contact,t.contact);class _ extends i.BaseModel{constructor(){super(...arguments),this.id=(0,i.prop)(),this.usePlayReceipt=(0,i.prop)(),this.playedRemaining=(0,i.prop)(0),this.readRemaining=(0,i.prop)(0),this.deliveryRemaining=(0,i.prop)(0),this.deliveryPrivacyMode=(0,i.prop)(),this.played=(0,i.collection)(p),this.read=(0,i.collection)(p),this.delivery=(0,i.collection)(p),this.settled=(0,i.derived)((function(){return this.usePlayReceipt?!this.playedRemaining:!this.readRemaining}),["usePlayReceipt","playedRemaining","readRemaining"])}getCollection(){return n(739245).MsgInfoCollection}}_.Proxy="msgInfo",_.idClass=l.default;const f=(0,i.defineModel)(_);t.MsgInfo=f},344247:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getFooterLinks=function(e){const t=(0,u.unproxy)(e),n=t.footer;if(!t.supportsMessageFooterLinks||null==n)return[];if(t.getRawFooterLinks().length>0)return t.getRawFooterLinks();const[r]=d({content:n,sender:t.sender,cachedValue:t.getRawFooterLinks()});return t.setRawFooterLinks(r),r},t.getGalleryLinks=function(e){const t=(0,u.unproxy)(e);return(0,i.default)(p(t),"href").filter((e=>e.isHttp))},t.getHeaderLinks=function(e){var t;const n=(0,u.unproxy)(e);var r;if(_(n,!0))return f(n,(null===(r=n.list)||void 0===r?void 0:r.title)||"");if(_(n,!1))return f(n,n.title);if(n.type===s.MSG_TYPE.INTERACTIVE&&null!=(null===(t=n.interactiveHeader)||void 0===t?void 0:t.title))return f(n,n.interactiveHeader.title);return[]},t.getLinksFromMsg=p,t.getPollOptionLinks=function(e,t){var n;const r=(0,u.unproxy)(e);if(null==r.pollOptions)return null;if(null==r.getRawPollOptionsToLinks()){var i;const e=new Map(null===(i=r.pollOptions)||void 0===i?void 0:i.map((e=>{const[t]=d({content:e.name,sender:r.sender});return[e,t]})));r.setRawPollOptionsToLinks(e)}return null===(n=r.getRawPollOptionsToLinks())||void 0===n?void 0:n.get(t)},t.getSuspiciousLinks=function(e){return p((0,u.unproxy)(e)).filter((e=>{var t;return null===(t=e.suspiciousCharacters)||void 0===t?void 0:t.size}))},t.shouldDisplayHeaderLinks=_;var i=r(n(545578)),a=n(203910),o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(446303)),s=n(373070),l=n(533494),u=n(411067);function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}function d(e){const{content:t,sender:n,cachedValue:r=[],currentIndex:i=0,endIndex:s=1/0}=e;if(i>=s)return[r,s];const l=(0,a.firstNCodepoints)(t,s);let u=o.findLinks(l,false,n);if((0,a.numCodepoints)(t)>s&&u.length>0){const e=u[u.length-1];(0,a.numCodepoints)(l.slice(0,e.index))+(0,a.numCodepoints)(e.url)===s&&(u=o.findLinks(t,false,n))}return[u,s]}function p(e,t){const n=(0,u.unproxy)(e),r=null!=t?t:n.initialPageSize+1,{text:i}=n;if(null==i)return n.getRawLinks();const[a,o]=d({content:i,sender:n.sender,cachedValue:n.getRawLinks(),currentIndex:n.linksIndexParsed,endIndex:r});return n.linksIndexParsed=o,n.setRawLinks(a),a}function _(e,t){var n,r;return t?"list"===e.type&&(null===(n=e.list)||void 0===n?void 0:n.listType)===l.Message$ListMessage$ListType.SINGLE_SELECT&&null!=(null===(r=e.list)||void 0===r?void 0:r.title):!0===e.isDynamicReplyButtonsMsg&&null!=e.title}function f(e,t){if(e.getRawHeaderLinks().length>0)return e.getRawHeaderLinks();const[n]=d({content:t,sender:e.sender,cachedValue:e.getRawHeaderLinks()});return e.setRawHeaderLinks(n),n}},387191:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Msg=void 0;var i=r(n(348926)),a=r(n(23279)),o=r(n(957557)),s=r(n(441609)),l=r(n(339138)),u=ce(n(553272)),c=n(8525),d=n(316860),p=n(990445),_=n(425315),f=n(402994),h=n(450491),g=n(54918),m=n(388536),y=n(832547),E=n(103846),S=n(387196),T=n(780549),v=n(147980),A=n(266888),C=r(n(846870)),P=n(121977),O=n(263079),I=r(n(495976)),M=r(n(799132)),b=n(720934),R=r(n(710024)),N=n(862159),w=r(n(753110)),L=r(n(182394)),D=r(n(932325)),k=ce(n(644234)),U=r(n(116253)),G=n(172259),x=n(937484),B=r(n(565754)),F=ce(n(96219)),j=n(373070),Y=n(52136),K=n(899841),H=n(533494),W=n(709018),V=(n(411562),n(241588)),$=n(517286),z=r(n(726171)),q=n(459857),J=n(105284),Q=n(208182),X=r(n(571834)),Z=r(n(124928)),ee=n(669050),te=n(931019),ne=n(814929),re=n(403688),ie=n(127714),ae=n(522357),oe=n(808639),se=n(84461),le=n(429334);function ue(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(ue=function(e){return e?n:t})(e)}function ce(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=ue(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r}class de extends g.BaseModel{constructor(){super(...arguments),this.id=(0,g.prop)(),this.rowId=(0,g.prop)(),this.body=(0,g.prop)(),this.type=(0,g.prop)(),this.subtype=(0,g.prop)(),this.t=(0,g.prop)(),this.revokeTimestamp=(0,g.prop)(),this.notifyName=(0,g.prop)(),this.from=(0,g.prop)(),this.to=(0,g.prop)(),this.author=(0,g.prop)(),this.self=(0,g.prop)("in"),this.ack=(0,g.prop)(),this.invis=(0,g.prop)(),this.isNewMsg=(0,g.prop)(),this.star=(0,g.prop)(!1),this.kicKey=(0,g.prop)(),this.kicState=(0,g.prop)(),this.kicTimestampMs=(0,g.prop)(),this.kicNotified=(0,g.prop)(!1),this.keepType=(0,g.prop)(),this.keptMessageKey=(0,g.prop)(),this.keptCount=(0,g.prop)(),this.recvFresh=(0,g.prop)(),this.caption=(0,g.prop)(),this.interactiveAnnotations=(0,g.prop)(),this.contextInfo=(0,g.prop)(),this.clientUrl=(0,g.prop)(),this.loc=(0,g.prop)(),this.lat=(0,g.prop)(),this.lng=(0,g.prop)(),this.isLive=(0,g.prop)(),this.accuracy=(0,g.prop)(),this.speed=(0,g.prop)(),this.degrees=(0,g.prop)(),this.comment=(0,g.prop)(),this.sequence=(0,g.prop)(),this.shareDuration=(0,g.prop)(),this.finalLat=(0,g.prop)(),this.finalLng=(0,g.prop)(),this.finalAccuracy=(0,g.prop)(),this.finalThumbnail=(0,g.prop)(),this.finalSpeed=(0,g.prop)(),this.finalDegrees=(0,g.prop)(),this.finalTimeOffset=(0,g.prop)(),this.deprecatedMms3Url=(0,g.prop)(),this.directPath=(0,g.prop)(),this.mimetype=(0,g.prop)(),this.duration=(0,g.prop)(),this.filehash=(0,g.prop)(),this.encFilehash=(0,g.prop)(),this.size=(0,g.prop)(),this.filename=(0,g.prop)(),this.streamingSidecar=(0,g.prop)(),this.mediaKey=(0,g.prop)(),this.mediaKeyTimestamp=(0,g.prop)(),this.pageCount=(0,g.prop)(),this.isGif=(0,g.prop)(),this.gifAttribution=(0,g.prop)(),this.isViewOnce=(0,g.prop)(),this.streamable=(0,g.prop)(),this.width=(0,g.prop)(),this.height=(0,g.prop)(),this.thumbnailDirectPath=(0,g.prop)(),this.thumbnailSha256=(0,g.prop)(),this.thumbnailEncSha256=(0,g.prop)(),this.thumbnailHeight=(0,g.prop)(),this.thumbnailWidth=(0,g.prop)(),this.waveform=(0,g.prop)(),this.staticUrl=(0,g.prop)(),this.stickerPackId=(0,g.prop)(),this.stickerPackName=(0,g.prop)(),this.stickerPackPublisher=(0,g.prop)(),this.scanLengths=(0,g.prop)(),this.scansSidecar=(0,g.prop)(),this.isFromTemplate=(0,g.prop)(!1),this.devicesAdded=(0,g.prop)(),this.devicesRemoved=(0,g.prop)(),this.isThisDeviceAdded=(0,g.prop)(),this.firstFrameLength=(0,g.prop)(),this.firstFrameSidecar=(0,g.prop)(),this.isAnimated=(0,g.prop)(),this.canonicalUrl=(0,g.prop)(),this.matchedText=(0,g.prop)(),this.thumbnail=(0,g.prop)(),this.thumbnailHQ=(0,g.prop)(),this.richPreviewType=(0,g.prop)(),this.doNotPlayInline=(0,g.prop)(),this.title=(0,g.prop)(),this.description=(0,g.prop)(),this.businessOwnerJid=(0,g.prop)(),this.productId=(0,g.prop)(),this.currencyCode=(0,g.prop)(),this.priceAmount1000=(0,g.prop)(),this.salePriceAmount1000=(0,g.prop)(),this.retailerId=(0,g.prop)(),this.url=(0,g.prop)(),this.productImageCount=(0,g.prop)(),this.sessionId=(0,g.prop)(),this.pollName=(0,g.prop)(),this.pollOptions=(0,g.prop)(),this.pollSelectableOptionsCount=(0,g.prop)(),this.pollInvalidated=(0,g.prop)(!1),this.pollUpdateParentKey=(0,g.prop)(),this.encPollVote=(0,g.prop)(),this.senderTimestampMs=(0,g.prop)(),this.latestEditMsgKey=(0,g.prop)(null),this.latestEditSenderTimestampMs=(0,g.prop)(null),this.recipients=(0,g.prop)(),this.broadcast=(0,g.prop)(),this.quotedMsg=(0,g.prop)(),this.quotedStanzaID=(0,g.prop)(),this.quotedRemoteJid=(0,g.prop)(),this.quotedParticipant=(0,g.prop)(),this.quotedGroupSubject=(0,g.prop)(),this.quotedParentGroupJid=(0,g.prop)(),this.mentionedJidList=(0,g.prop)(),this.footer=(0,g.prop)(),this.hydratedButtons=(0,g.prop)(),this.buttons=(0,g.session)(),this.selectedId=(0,g.prop)(),this.selectedIndex=(0,g.prop)(),this.multicast=(0,g.prop)(),this.urlText=(0,g.prop)(),this.urlNumber=(0,g.prop)(),this.clearMedia=(0,g.prop)(),this.isVcardOverMmsDocument=(0,g.prop)(!1),this.isCaptionByUser=(0,g.prop)(),this.vcardList=(0,g.prop)(),this.vcardFormattedName=(0,g.prop)(),this.revokeSender=(0,g.prop)(),this.protocolMessageKey=(0,g.prop)(),this.futureproofBuffer=(0,g.prop)(),this.futureproofParams=(0,g.prop)(),this.futureproofType=(0,g.prop)(),this.futureproofSubtype=(0,g.prop)(),this.templateParams=(0,g.prop)(),this.textColor=(0,g.prop)(),this.backgroundColor=(0,g.prop)(),this.font=(0,g.prop)(),this.campaignId=(0,g.prop)(),this.campaignDuration=(0,g.prop)(),this.actionLink=(0,g.prop)(),this.statusPSAReadTimestamp=(0,g.prop)(),this.isForwarded=(0,g.prop)(!1),this.forwardingScore=(0,g.prop)(),this.labels=(0,g.prop)(),this.hasReaction=(0,g.prop)(!1),this.paymentCurrency=(0,g.prop)(),this.paymentAmount1000=(0,g.prop)(),this.paymentMessageReceiverJid=(0,g.prop)(),this.paymentTransactionTimestamp=(0,g.prop)(),this.paymentStatus=(0,g.prop)(),this.paymentTxnStatus=(0,g.prop)(),this.paymentNoteMsg=(0,g.prop)(),this.paymentRequestMessageKey=(0,g.prop)(),this.paymentExpiryTimestamp=(0,g.prop)(),this.paymentInviteServiceType=(0,g.prop)(),this.paymentBackground=(0,g.prop)(),this.ephemeralStartTimestamp=(0,g.prop)(),this.ephemeralDuration=(0,g.prop)(),this.ephemeralSettingTimestamp=(0,g.prop)(),this.ephemeralOutOfSync=(0,g.prop)(),this.ephemeralSharedSecret=(0,g.prop)(),this.disappearingModeInitiator=(0,g.prop)(),this.messageSecret=(0,g.prop)(),this.originalSelfAuthor=(0,g.prop)(),this.bizPrivacyStatus=(0,g.prop)(),this.privacyModeWhenSent=(0,g.prop)(),this.verifiedBizName=(0,g.prop)(),this.inviteCode=(0,g.prop)(),this.inviteCodeExp=(0,g.prop)(),this.inviteGrp=(0,g.prop)(),this.inviteGrpName=(0,g.prop)(),this.inviteGrpJpegThum=(0,g.prop)(),this.inviteGrpType=(0,g.prop)(),this.sellerJid=(0,g.prop)(),this.message=(0,g.prop)(),this.orderTitle=(0,g.prop)(),this.itemCount=(0,g.prop)(),this.orderId=(0,g.prop)(),this.surface=(0,g.prop)(),this.status=(0,g.prop)(),this.token=(0,g.prop)(),this.totalAmount1000=(0,g.prop)(),this.totalCurrencyCode=(0,g.prop)(),this.historySyncMetaData=(0,g.prop)(),this.isSendFailure=(0,g.prop)(),this.appStateSyncKeyShare=(0,g.prop)(),this.appStateSyncKeyRequest=(0,g.prop)(),this.appStateFatalExceptionNotification=(0,g.prop)(),this.peerDataOperationRequestMessage=(0,g.prop)(),this.peerDataOperationRequestResponseMessage=(0,g.prop)(),this.broadcastParticipants=(0,g.prop)(),this.broadcastEphSettings=(0,g.prop)(),this.broadcastId=(0,g.prop)(),this.ctwaContext=(0,g.prop)(),this.list=(0,g.prop)(),this.listResponse=(0,g.prop)(),this.productListItemCount=(0,g.prop)(),this.productHeaderImageRejected=(0,g.prop)(!1),this.agentId=(0,g.prop)(),this.lastPlaybackProgress=(0,g.prop)(0),this.local=(0,g.session)(!1),this.search=(0,g.session)(),this.msgChunk=(0,g.session)(),this.startOfDay=(0,g.session)(),this.startOfDaySkew=(0,g.session)(),this._quotedMsgObj=(0,g.session)(),this.isQuotedMsgAvailable=(0,g.session)(!0),this.senderObj=(0,g.session)(),this.mediaData=(0,g.session)(),this.forwardedFromWeb=(0,g.session)(!1),this.squelch=(0,g.session)(),this.wamMessageSendReporter=(0,g.session)(),this.wamMessageSendPerfReporter=(0,g.session)(),this.pendingDeleteForMe=(0,g.session)(!1),this.isDynamicReplyButtonsMsg=(0,g.prop)(!1),this.dynamicReplyButtons=(0,g.prop)(),this.replyButtons=(0,g.session)(),this.buttonsResponse=(0,g.prop)(),this.selectedButtonId=(0,g.prop)(),this.headerType=(0,g.prop)(),this.nativeFlowName=(0,g.prop)(),this.nativeFlowButtons=(0,g.prop)(),this.interactiveHeader=(0,g.prop)(),this.interactiveType=(0,g.prop)(),this.interactivePayload=(0,g.prop)(),this.reactionParentKey=(0,g.prop)(),this.reactionText=(0,g.prop)(),this.reactionTimestamp=(0,g.prop)(),this.encReactionTargetMessageKey=(0,g.prop)(),this.encReactionEncIv=(0,g.prop)(),this.encReactionEncPayload=(0,g.prop)(),this.revokeDuration=(0,g.session)(),this.isMdHistoryMsg=(0,g.prop)(!1),this.stickerSentTs=(0,g.prop)(0),this.isAvatar=(0,g.prop)(!1),this._links=(0,g.session)((()=>[])),this._headerLinks=(0,g.session)((()=>[])),this._footerLinks=(0,g.session)((()=>[])),this.linksIndexParsed=(0,g.session)(0),this._pollOptionsToLinks=(0,g.session)(),this._phoneNumbers=(0,g.session)((()=>[])),this._headerPhoneNumbers=(0,g.session)((()=>[])),this._footerPhoneNumbers=(0,g.session)((()=>[])),this.phoneNumbersIndexParsed=(0,g.session)(0),this._waitForPhoneUploadPromise=(0,g.session)(),this.requiresDirectConnection=(0,g.prop)(null),this.pttForwardedFeaturesEnabled=(0,g.prop)(!1),this.chat=(0,g.derived)((function(){return this._getChatCollection().get(this.id.remote)})),this.hasTemplateButtons=(0,g.derived)((function(){return this.isFromTemplate&&null!=this.buttons&&this.buttons.length>0}),["buttons"]),this.ephemeralExpirationTimestamp=(0,g.derived)((function(){return(0,v.getEphemeralExpirationTimestamp)(this)}),["t","subtype","ephemeralStartTimestamp","ephemeralDuration"]),this.isEphemeral=(0,g.derived)((function(){return(this.type!==j.MSG_TYPE.PROTOCOL||"ephemeral_setting"!==this.subtype)&&(null!=this.ephemeralDuration&&0!==this.ephemeralDuration)}),["ephemeralDuration","type","subtype"]),this.isRevoke=(0,g.derived)((function(){return this.type===j.MSG_TYPE.PROTOCOL&&["sender_revoke","admin_revoke"].includes(this.subtype)}),["type","subtype"]),this.isQuickReply=(0,g.derived)((function(){if(!this.hasTemplateButtons)return!1;if(null==this.buttons)return!1;const e=this.buttons.at(0);return null!=e&&e.subtype===$.TEMPLATE_BUTTON_SUBTYPE.QUICK_REPLY}),["buttons"]),this.isKept=(0,g.derived)((function(){return this.kicState===ae.KeepInChatState.KEPT}),["kicState"]),this.isUnkept=(0,g.derived)((function(){return this.kicState===ae.KeepInChatState.UNKEPT}),["kicState"]),this.isFutureproof=(0,g.derived)((function(){return this.type===j.MSG_TYPE.UNKNOWN||this.type===j.MSG_TYPE.PAYMENT&&"futureproof"===this.subtype}),["type","subtype"]),this.isGroupMsg=(0,g.derived)((function(){return(0,v.isGroupMsg)(this)})),this.isStickerMsg=(0,g.derived)((function(){return this.type===j.MSG_TYPE.STICKER})),this.isStatusV3=(0,g.derived)((function(){return(0,v.isStatusV3)(this)})),this.isPSA=(0,g.derived)((function(){return Z.default.isPSA(this.id.remote)})),this.isIAS=(0,g.derived)((function(){return Z.default.isIAS(this.id.remote)})),this.isProductListMessage=(0,g.derived)((function(){var e;return this.type===j.MSG_TYPE.LIST&&(null===(e=this.list)||void 0===e?void 0:e.listType)===H.Message$ListMessage$ListType.PRODUCT_LIST})),this.isRTL=(0,g.derived)((function(){return"rtl"===this.dir||void 0===this.dir&&D.default.isRTL()}),["dir"]),this.isEdited=(0,g.derived)((function(){return null!=this.latestEditMsgKey}),["latestEditMsgKey"]),this.asProductInquiry=(0,g.derived)((function(){const e=this.safe();return e.type===j.MSG_TYPE.PRODUCT&&e.id&&e.id.id.startsWith(y.PRODUCT_INQUIRY_TYPE)?e:null})),this.statusV3CanvasColor=(0,g.derived)((function(){if(!this.isStatusV3)return null;const e=this.backgroundColor;return e?`rgba(${e>>16&255}, ${e>>8&255}, ${255&e}, ${e>>24&255})`:"rgba(86, 150, 255, 255)"})),this.isSentByMe=(0,g.derived)((function(){return(0,v.isSentByMe)(this)})),this.isSentByMeFromWeb=(0,g.derived)((function(){return this.id.fromMe&&this.local&&this.isUserCreatedType}),["isUserCreatedType"]),this.isRevokedByMe=(0,g.derived)((function(){return null!=this.revokeSender&&(0,q.isMeAccount)(this.revokeSender)})),this.isInternational=(0,g.derived)((function(){var e;const t=this.id.fromMe?this.to.toString({legacy:!0}):this.from.toString({legacy:!0}),n=null===(e=(0,q.getMaybeMeUser)())||void 0===e?void 0:e.toString({legacy:!0});return t&&n?(0,c.phoneCC)(t)!==(0,c.phoneCC)(n):(__LOG__(3)`Msg: could not derive isInternational as some data is missing`,!1)})),this.isNotification=(0,g.derived)((function(){return(0,v.isNotificationType)(this.type,this.subtype)}),["type","subtype"]),this.asGroupNotification=(0,g.derived)((function(){const e=this.safe();switch(e.type){case j.MSG_TYPE.GROUP_NOTIFICATION:case j.MSG_TYPE.GP2:return e;default:return null}}),["type"]),this.asBroadcastNotification=(0,g.derived)((function(){const e=this.safe();return e.type===j.MSG_TYPE.BROADCAST_NOTIFICATION?e:null}),["type"]),this.isBizNotification=(0,g.derived)((function(){if(this.type===j.MSG_TYPE.NOTIFICATION_TEMPLATE){if(y.BIZ_SYSTEM_MSG_SUBTYPES.includes(this.subtype))return!0;if(y.BIZ_SYSTEM_MSG_SUBTYPES_V2.includes(this.subtype))return!0;switch(this.subtype){case"verified_initial_unknown":case"verified_initial_low":case"verified_initial_high":case"verified_transition_any_to_none":case"verified_transition_any_to_high":case"verified_transition_high_to_low":case"verified_transition_high_to_unknown":case"verified_transition_unknown_to_low":case"verified_transition_low_to_unknown":case"verified_transition_none_to_low":case"verified_transition_none_to_unknown":case"biz_verified_transition_top_to_bottom":case"biz_verified_transition_bottom_to_top":case"biz_intro_top":case"biz_intro_bottom":case"biz_name_change":case"biz_move_to_consumer_app":case"biz_two_tier_migration_top":case"biz_two_tier_migration_bottom":return!0;default:return!1}}return!1}),["type","subtype"]),this.asProduct=(0,g.derived)((function(){const e=this.safe();return"product"===e.type?e:null}),["type"]),this.asAlbumAsset=(0,g.derived)((function(){const e=this.safe();return e.type!==j.MSG_TYPE.IMAGE&&(e.type!==j.MSG_TYPE.VIDEO||!0===e.isGif)||e.isNotification||e.caption||e.asRevoked||e.quotedMsg||e.ctwaContext||e.isViewOnce?null:e}),["type","isNotification","caption","isForwarded","asRevoked","isGif","quotedMsg","ctwaContext","isViewOnce"]),this.asAutoDownloadableMedia=(0,g.derived)((function(){if(this.isViewOnce)return null;const e=this.safe();switch(e.type){case j.MSG_TYPE.IMAGE:case j.MSG_TYPE.STICKER:case j.MSG_TYPE.AUDIO:case j.MSG_TYPE.PTT:case j.MSG_TYPE.VIDEO:case j.MSG_TYPE.DOCUMENT:return e}return(0,F.typeIsUrl)(e)?e:null}),["type","isViewOnce"]),this.asGroupedSticker=(0,g.derived)((function(){const e=this.safe();return e.type!==j.MSG_TYPE.STICKER||e.isNotification||e.asRevoked||e.quotedMsg||e.ctwaContext?null:e}),["type","isNotification","asRevoked","quotedMsg","ctwaContext"]),this.isMedia=(0,g.derived)((function(){return["image","video","audio"].includes(this.type)}),["type"]),this.asDoc=(0,g.derived)((function(){const e=this.safe();return e.type===j.MSG_TYPE.DOCUMENT?e:null}),["type"]),this.asImage=(0,g.derived)((function(){const e=this.safe();return e.type===j.MSG_TYPE.IMAGE?e:null}),["type"]),this.asVideo=(0,g.derived)((function(){const e=this.safe();return e.type===j.MSG_TYPE.VIDEO?e:null}),["type"]),this.asAudio=(0,g.derived)((function(){const e=this.safe();return e.type===j.MSG_TYPE.AUDIO?e:null}),["type"]),this.asPtt=(0,g.derived)((function(){const e=this.safe();return e.type===j.MSG_TYPE.PTT?e:null}),["type"]),this.asPollCreation=(0,g.derived)((function(){const e=this.safe();return e.type===j.MSG_TYPE.POLL_CREATION?e:null}),["type"]),this.asPollUpdate=(0,g.derived)((function(){const e=this.safe();return e.type===j.MSG_TYPE.POLL_UPDATE?e:null}),["type"]),this.asRequestPhoneNumber=(0,g.derived)((function(){const e=this.safe();return e.type===j.MSG_TYPE.REQUEST_PHONE_NUMBER?e:null}),["type"]),this.asMms=(0,g.derived)((function(){const e=this.safe();return(0,F.typeIsMms)(e)?e:null}),["type"]),this.asUrl=(0,g.derived)((function(){const e=this.safe();return(0,F.typeIsUrl)(e)?e:null}),["type","subtype"]),this.asRevoked=(0,g.derived)((function(){const e=this.safe();return e.type===j.MSG_TYPE.REVOKED?e:null}),["type"]),this.asViewOnce=(0,g.derived)((function(){const e=this.asVisualMedia;return(null==e?void 0:e.isViewOnce)?e:null}),["type","isViewOnce"]),this.asVisualMedia=(0,g.derived)((function(){const e=this.safe();return e.type===j.MSG_TYPE.IMAGE||e.type===j.MSG_TYPE.VIDEO?e:null}),["type"]),this.asChat=(0,g.derived)((function(){const e=this.safe();return e.type===j.MSG_TYPE.CHAT?e:null}),["type"]),this.numTimesForwarded=(0,g.derived)((function(){return this.forwardingScore?this.forwardingScore||0:this.isForwarded?1:0}),["isForwarded","forwardingScore"]),this.isFrequentlyForwarded=(0,g.derived)((function(){return this.numTimesForwarded>=C.default.FREQUENTLY_FORWARDED_SENTINEL}),["numTimesForwarded"]),this.eventType=(0,g.derived)((function(){if(!this.isNewMsg)return v.EventType.IGNORE;const e=(0,F.eventTypeFromMsgType)(this);return this.invis?e===v.EventType.IGNORE?v.EventType.IGNORE:v.EventType.NOTEWORTHY:e}),["type","invis","isNewMsg"]),this.sender=(0,g.derived)((function(){return(0,v.getSender)(this)})),this.originalSender=(0,g.derived)((function(){return(0,v.getOriginalSender)(this)})),this.text=(0,g.derived)((function(){var e,t;if(this.isFromTemplate||this.isDynamicReplyButtonsMsg)return this.type===j.MSG_TYPE.CHAT?this.body:this.caption;switch(this.type){case"chat":case"interactive_response":return this.body;case"image":case"video":case"document":return this.caption;case"location":return this.isLive?this.comment:void 0;case"payment":return null===(e=this.paymentNoteMsg)||void 0===e?void 0:e.body;case"groups_v4_invite":return this.comment;case"list":return null===(t=this.list)||void 0===t?void 0:t.description;case"product":return(0,l.default)(this.title,{length:K.MAX_REPLY_PRODUCT_TITLE_LENGTH});case"hsm":case"template_button_reply":return this.body;case"interactive":return null!=this.nativeFlowName?(0,b.formatNFMText)(this):this.caption;case"native_flow":return(0,b.formatNFMText)(this);case"poll_creation":return this.pollName;case"audio":case"biz-cover-photo":case"broadcast_notification":case"buttons_response":case"call_log":case"ciphertext":case"debug":case"e2e_notification":case"gp2":case"group_notification":case"keep_in_chat":case"list_response":case"multi_vcard":case"notification":case"notification_template":case"order":case"oversized":case"poll_update":case"protocol":case"ptt":case"reaction":case"reaction_enc":case"request_phone_number":case"revoked":case"sticker":case"unknown":case"vcard":return;default:return void this.type}}),["type","body","caption","comment","isLive","paymentNoteMsg","subtype","pollName"]),this.containsEmoji=(0,g.derived)((function(){const{text:e}=this;return!!e&&le.EmojiUtil.containsEmoji(e)}),["text"]),this.isFailed=(0,g.derived)((function(){return this.isSentByMe&&this.ack<f.ACK.CLOCK||!!this.isSendFailure}),["isSentByMe","ack","isSendFailure"]),this.vcard=(0,g.derived)((function(){if(this.type===j.MSG_TYPE.VCARD)try{return(0,J.parseVcard)(this.body)}catch(e){return}}),["type","body"]),this.isUnsentMedia=(0,g.derived)((function(){return this.ack<f.ACK.SENT&&null!=this.asMms&&this.isSentByMe}),["ack","asMms","isSentByMe"]),this.dir=(0,g.derived)((function(){return this.type===j.MSG_TYPE.VCARD?this.subtype?u.dir(this.subtype):void 0:this.text?u.dir(this.text):void 0}),["type","text","subtype"]),this.rtl=(0,g.derived)((function(){return this.type===j.MSG_TYPE.VCARD?!!this.subtype&&"rtl"===u.dir(this.subtype):!!this.text&&"rtl"===u.dir(this.text)}),["type","text","subtype"]),this.linkPreview=(0,g.derived)((function(){return(0,_.isString)(this.matchedText)&&(!(0,s.default)(this.title)||!(0,s.default)(this.description))&&this.body.includes(this.matchedText)}),["matchedText","body","title","description"]),this.isGroupsV4InviteExpired=(0,g.derived)((function(){if(this.type!==j.MSG_TYPE.GROUPS_V4_INVITE)return!1;if(!this.inviteCode)return!0;const e=(new Date).getTime()/1e3;return parseInt(e,10)>=parseInt(this.inviteCodeExp,10)}),["type","inviteCode","inviteCodeExp"]),this.isUnreadType=(0,g.derived)((function(){return(0,v.isUnreadTypeMsg)(this)}),["type"]),this.isUserCreatedType=(0,g.derived)((function(){switch(this.type){case"protocol":case"chat":case"location":case"vcard":case"multi_vcard":case"image":case"video":case"audio":case"ptt":case"document":case"sticker":case"product":case"groups_v4_invite":case"order":case"poll_creation":return!0;case"biz-cover-photo":case"broadcast_notification":case"buttons_response":case"call_log":case"ciphertext":case"debug":case"e2e_notification":case"gp2":case"group_notification":case"hsm":case"interactive":case"interactive_response":case"keep_in_chat":case"list":case"list_response":case"native_flow":case"notification":case"notification_template":case"oversized":case"payment":case"poll_update":case"reaction":case"reaction_enc":case"request_phone_number":case"revoked":case"template_button_reply":case"unknown":return!1;default:return this.type,!1}}),["type"]),this.supportsMessageFooter=(0,g.derived)((function(){return this.isFromTemplate||this.isDynamicReplyButtonsMsg}),["isDynamicReplyButtonsMsg","isFromTemplate"]),this.supportsMessageFooterLinks=(0,g.derived)((function(){return this.isDynamicReplyButtonsMsg||this.type===j.MSG_TYPE.LIST||this.type===j.MSG_TYPE.INTERACTIVE}),["type","isDynamicReplyButtonsMsg"]),this.hasBodyOrFooter=(0,g.derived)((function(){return null!=this.text||null!=this.footer}),["text","footer"]),this.initialPageSize=(0,g.derived)((function(){return this.isFrequentlyForwarded?308:768}),["isFrequentlyForwarded"]),this.productListHeaderImage=(0,g.derived)((function(){var e,t,n,r;return!0===this.productHeaderImageRejected?null:null!==(e=null===(t=this.list)||void 0===t||null===(n=t.productListInfo)||void 0===n||null===(r=n.headerImage)||void 0===r?void 0:r.jpegThumbnail)&&void 0!==e?e:null}),["productHeaderImageRejected","list"]),this.isInitialE2ENotification=(0,g.derived)((function(){return this.type===j.MSG_TYPE.E2E_NOTIFICATION&&"encrypt"===this.subtype||y.BIZ_SYSTEM_MSG_SUBTYPES_V2_INIT.includes(this.subtype)}),["type","subtype"]),this.isDisappearingModeSystemMessage=(0,g.derived)((function(){return this.type===j.MSG_TYPE.NOTIFICATION_TEMPLATE&&"disappearing_mode"===this.subtype}),["type","subtype"]),this.asPttLike=(0,g.derived)((function(){const e=this.safe();return e.type===j.MSG_TYPE.PTT||e.pttForwardedFeaturesEnabled&&e.type===j.MSG_TYPE.AUDIO&&(0,x.isOpus)(e.mimetype)&&null!=e.waveform?e:null}),["type","mimetype","pttForwardedFeaturesEnabled","waveform"]),this.kicSender=(0,g.derived)((function(){if(null!=this.kicKey){if(this.kicKey.fromMe)return(0,q.getMaybeMeUser)();if(this.isGroupMsg&&null!=this.kicKey.participant)return(0,ee.toUserWid)(this.kicKey.participant);if(!this.isGroupMsg)return(0,ee.toUserWid)(this.kicKey.remote)}}),["kicKey","isGroupMsg"]),this._saveLastPlaybackProgress=(0,a.default)(((e,t)=>{(0,re.updateLocal)(e,{lastPlaybackProgress:t})}),500)}initialize(){if(super.initialize(),this.pttForwardedFeaturesEnabled=V.ServerProps.pttForwardedFeaturesEnabled,this._pendingAckUpdate=new d.PromiseQueue,this.sender)this.addChild("senderObj",P.ContactCollection.gadd(this.sender));else switch(this.type){case j.MSG_TYPE.NOTIFICATION:case j.MSG_TYPE.NOTIFICATION_TEMPLATE:case j.MSG_TYPE.GROUP_NOTIFICATION:case j.MSG_TYPE.GP2:case j.MSG_TYPE.BROADCAST_NOTIFICATION:case j.MSG_TYPE.E2E_NOTIFICATION:case j.MSG_TYPE.CALL_LOG:case j.MSG_TYPE.PROTOCOL:break;default:__LOG__(2)`msg:msg with no sender id:${this.id.toString()}, from:${this.from.toString()}, author:${this.author&&this.author.toString()}, type:${this.type}`}let e;this.mentionedJidList=this.mentionedJidList||[],this.mentionedJidList.forEach((e=>P.ContactCollection.gadd(e)));const t=this.getCollection();(e=t.preAck[this.id])&&(__LOG__(2)`Msg:initialize updating msg with out of order ack`,this.updateAck(e.ack,e.t),delete t.preAck[this.id]),this.type===j.MSG_TYPE.CIPHERTEXT&&this.listenToOnce(this,"change:type",this._handleCiphertextDecrypted),this.mediaObject=void 0,F.typeIsMms(this)&&(this._createMediaDataChild(),this.isViewOnce&&!(0,Q.isUnviewed)(this.safe())||k.registerMsg(this)),this.isLive&&n(557346).LiveLocationCollection.processMsg(this,!1),A.Conn.isSMB&&(0,m.initializeLabels)(this),this.isViewOnce&&(this.listenTo(this,"change:ack",this._handleViewOnceMediaStatusChanged),this.listenTo(this.mediaData,"change:mediaStage",this._handleViewOnceMediaStatusChanged))}getRawLinks(){return this._links}setRawLinks(e){this._links=e}getRawPollOptionsToLinks(){return this._pollOptionsToLinks}setRawPollOptionsToLinks(e){this._pollOptionsToLinks=e}getRawHeaderLinks(){return this._headerLinks}setRawHeaderLinks(e){this._headerLinks=e}getRawFooterLinks(){return this._footerLinks}setRawFooterLinks(e){this._footerLinks=e}getRawPhoneNumbers(){return this._phoneNumbers}setRawPhoneNumbers(e){this._phoneNumbers=e}getRawHeaderPhoneNumbers(){return this._headerPhoneNumbers}setRawHeaderPhoneNumbers(e){this._headerPhoneNumbers=e}getRawFooterPhoneNumbers(){return this._footerPhoneNumbers}setRawFooterPhoneNumbers(e){this._footerPhoneNumbers=e}getRawQuotedMsgObj(){return this._quotedMsgObj}setRawQuotedMsgObj(e){this._quotedMsgObj=e}_createMediaDataChild(){this.addChild("mediaData",new U.default)}hasSymbol(){return this.type===j.MSG_TYPE.INTERACTIVE?this.interactiveType===L.default.SHOPS_STOREFRONT||this.interactiveType===L.default.NATIVE_FLOW&&this.nativeFlowName===w.default.ORDER_DETAILS:this.type===j.MSG_TYPE.NATIVE_FLOW?this.nativeFlowName===w.default.ORDER_DETAILS:["image","video","audio","ptt","location","vcard","multi_vcard","document","ciphertext","oversized","unknown","call_log","revoked","sticker","payment","poll_creation","groups_v4_invite","product","order"].includes(this.type)}mayFail(){return this.isSentByMe&&this.ack<f.ACK.SENT}isUnsentPhoneMsg(){return!this.local&&this.isSentByMe&&this.ack<f.ACK.SENT}supportsStarWithKeepInChat(){return!!(0,se.isKeepInChatFullyDisabled)()||this.isEphemeral&&((0,se.isKeepInChatReadOnlyEnabled)()||(0,se.isKICFullyEnabled)()&&this.star)}interactiveButtonsReleased(){return this.isFromTemplate||!this.hasTemplateButtons&&this.type!==j.MSG_TYPE.TEMPLATE_BUTTON_REPLY}isGroupLeave(){return"gp2"===this.type&&("leave"===this.subtype||"remove"===this.subtype)&&(0,q.isMeAccount)(this.recipients[0])}isTrusted(){var e;return!!(0,q.isMeAccount)(this.sender)||(!!(null===(e=this.senderObj)||void 0===e?void 0:e.isMyContact)||(this.isGroupMsg?this.chat.isTrusted():!!this.isPSA||this.chat.notSpam))}getVcardWids(){return this.type!==j.MSG_TYPE.VCARD?null:(0,J.vcardWids)(this.vcard)}getLocObject(){const e=this.loc;if(e){const[t,n=null]=e.split("\n");return{name:t,addr:n}}return null}resumeRemoteUpload(){return this.isUnsentPhoneMsg()&&(0,W.sendMsgRecord)(this),this.forceDownloadMediaEvenIfExpensive()}forceRMR(){return Promise.reject(new Error("unimplemented forceRMR"))}isForcingRMR(){return!1}cancelDownload(){k.cancelDownloadMsg(this)}resumeUpload(){return this.mediaData.mediaStage!==G.MEDIA_DATA_STAGE.NEED_UPLOAD&&(__LOG__(4,void 0,new Error,!0)`resumeUpload called while state was ${this.mediaData.mediaStage}`,SEND_LOGS("resume-non-need-upload")),k.resumeUploadMsg(this)}cancelUpload(){k.cancelUploadMsg(this)}waitForPhoneUpload(){var e=this;return(0,i.default)((function*(){Boolean(e.mediaData.filehash)&&!e.isUnsentPhoneMsg()||(e._waitForPhoneUploadPromise||(e._waitForPhoneUploadPromise=(0,M.default)(e.mediaData,"change:mediaStage change:filehash",(()=>Boolean(e.mediaData.filehash)&&!e.isUnsentPhoneMsg()))),yield e._waitForPhoneUploadPromise,e._waitForPhoneUploadPromise=null)}))()}forceDownloadMediaEvenIfExpensive(){return this.downloadMedia({downloadEvenIfExpensive:!0,rmrReason:X.default.WEBC_RMR_REASON_CODE.MSG_CLICK,isUserInitiated:!0})}downloadMedia(e){if(this.asRevoked)return Promise.resolve();const{downloadEvenIfExpensive:t,rmrReason:n,isUserInitiated:r,isAutoDownload:i}=e;if(!r&&!this.isTrusted())return Promise.resolve();if(this.asMms||(__LOG__(4,void 0,new Error,!0)`id: ${this.id.toString()} type: ${this.type}`,SEND_LOGS("media-fault: downloadMedia msg is not mms type")),this.isUnsentPhoneMsg()){let t=this._waitForPhoneUploadPromise;return t||(t=this._waitForPhoneUploadPromise=(0,M.default)(this.mediaData,"change:mediaStage change:filehash",(()=>!!this.mediaData.filehash&&!this.isUnsentPhoneMsg())).then((()=>{this._waitForPhoneUploadPromise=null}))),t.then((()=>this.downloadMedia(e)))}return k.downloadMsg({msg:this,isUserClick:n===X.default.WEBC_RMR_REASON_CODE.MSG_CLICK,downloadEvenIfExpensive:t,rmrReason:n,rmrData:this._getRmrData(n),mode:r?"manual":"auto",isAutoDownload:i})}_getRmrData(e){const t={webcRmrReason:e,webcMessageT:this.t},n=this.chat;if(n){t.webcChatType=n.getWebcChatType(),null!=n.initialIndex&&(t.webcChatPosition=n.initialIndex);const{msgChunk:e}=this;e&&e===n.msgs&&(t.webcMessageIndex=e.length-e.indexOf(this)-1)}return t}applyUpdate(e){return e.type&&this.type!==e.type&&F.typeIsMms(e)?(this.type===j.MSG_TYPE.CIPHERTEXT||this.isFutureproof||(__LOG__(4,void 0,new Error,!0)`updated ${this.id.toString()} from ${this.type} to ${String(e.type)}`,SEND_LOGS("invalid-type-update")),this._createMediaDataChild(),k.registerMsgEarly(this,e),k.prepareMsg(this).then((()=>{this.set(e)})).catch((e=>{__LOG__(4,void 0,new Error,!0)`error = ${String(e)}`,SEND_LOGS("preregister-error")}))):(this.set(e),this.isLive&&n(557346).LiveLocationCollection.processMsg(this,!0),Promise.resolve())}waitForPrep(){var e=this;return(0,i.default)((function*(){var t;const n=null==e.requiresDirectConnection?(0,O.genDirectConnectionMessageModifiers)(e.type,null===(t=e.list)||void 0===t?void 0:t.listType,e.businessOwnerJid).then((t=>e.set(t))):Promise.resolve(),r=F.typeIsMms(e)?k.prepareMsg(e):Promise.resolve();return yield n,r}))()}delete(e){super.delete();n(986632).AllStarredMsgsCollection.remove(this),this.isLive&&n(557346).LiveLocationCollection.removeMsg(this);this.getCollection().remove(this.id),this.msgChunk&&this.msgChunk.remove(this.id,{},Boolean(null==e?void 0:e.skipUpdatingSortTime)),F.typeIsMms(this)&&k.deregisterMsg(this),n(478353).LabelCollection.removeAllLabelsMD(this);const t=this._getChatCollection().get(this.id.remote);if(t){t.unreadMsgAnchor===this&&(t.unreadMsgAnchor=void 0);if((!e||!e.doNotResetLastReceived)&&t.lastReceivedKey===this.id){let e;const n=(0,E.getLastReceivedMsg)(t);n&&(e=n.id),(0,ne.setLastReceivedKey)(t.id,e).then((()=>{t.lastReceivedKey=e}))}t.composeQuotedMsg===this&&(t.composeQuotedMsg=null)}}isLastMessage(){const e=this.chat.msgs.last();return this.id.equals(null==e?void 0:e.id)}msgContextInfo(e){const t=(0,o.default)(this.toJSON(),["id","t","notifyName","from","to","author","self","ack","invis","isNewMsg","star","recvFresh","recipients","broadcast","quotedMsg","quotedStanzaID","quotedRemoteJid","quotedParticipant","senderObj","multicast","replyButtons","buttons","latestEditMsgKey","latestEditSenderTimestampMs"]),n=this.id;let r=null;return e&&!n.remote.equals(e)&&(r=n.remote),{quotedMsg:t,quotedParticipant:this.sender,quotedStanzaID:n.id,quotedRemoteJid:r}}displayName(e,t){if(!this.sender)return"";if((0,q.isMeAccount)(this.sender))return D.default.t(853);if(this.isPSA)return"WhatsApp";const n=this.senderObj,r=e?n.shortName:void 0;if(r)return r;if(n.name)return n.name;const i=t&&this.notifyName?" ~"+this.notifyName:"";return(this.sender.isLid()?n.displayNameOrPnForLid:(0,te.widToFormattedUser)(this.sender))+i}isMentioned(e){return!!this.mentionedJidList&&this.mentionedJidList.findIndex((t=>t.equals(e)))>-1}mentionMap(){if(!this.mentionedJidList)return null;if(!this.mentionedJidList.length)return null;const e={};return this.mentionedJidList.forEach((t=>{e[`@${Z.default.user(t)||""}`]=P.ContactCollection.gadd(t)})),e}updateAck(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=this.ack;!this.isStatusV3&&this.chat.isGroup&&this.isMdHistoryMsg&&e>=f.ACK.RECEIVED&&this.id.fromMe||((0,_.isNumber)(e)&&(void 0===r||e>r||e===f.ACK.FAILED)?(this.ack=e,e>=1&&null!=t&&null==this.ephemeralStartTimestamp&&this.updateEphemeralStartTimestamp(t),"ephemeral_setting"===this.subtype&&1===e&&null!=t&&(0,z.default)(this.chat,t),n||this._pendingAckUpdate.enqueue((()=>(0,re.updateLocal)(this.id,{ack:e})))):e===f.ACK.FAILED&&this.ack===f.ACK.CLOCK&&(this.ack=f.ACK.FAILED,this._pendingAckUpdate.enqueue((()=>(0,re.updateLocal)(this.id,{ack:e})))))}updateLastPlaybackProgress(e){this.lastPlaybackProgress=e,this._saveLastPlaybackProgress(this.id,e)}avParams(){return k.mediaMetadata(this)}resend(){var e=this;if(this.isFailed){const t={ack:f.ACK.CLOCK,isSendFailure:!1};return this._pendingAckUpdate.enqueue((0,i.default)((function*(){yield(0,re.updateLocal)(e.id,t),e.set(t)}))),this.asMms?this.isSentByMeFromWeb?this.resumeUpload():this.resumeRemoteUpload():(0,W.sendMsgRecord)(this)}return Promise.resolve()}_handleCiphertextDecrypted(){if(this.isStatusV3)return;const e=this.chat,t=e.msgs.length,n=e.msgs.indexOf(this);-1!==n&&t-n<=10&&T.Cmd.alertNewMsg(this)}_handleViewOnceMediaStatusChanged(){if(!this.isViewOnce)return;if(null==this.mediaData)return;const e=this.isSentByMe&&this.ack>=f.ACK.SENT&&this.mediaData.mediaStage===G.MEDIA_DATA_STAGE.RESOLVED,t=!this.isSentByMe&&this.ack>=f.ACK.PLAYED;(e||t)&&(this.stopListening(this,"change:ack",this._handleViewOnceMediaStatusChanged),this.stopListening(this.mediaData,"change:mediaStage",this._handleViewOnceMediaStatusChanged),k.deregisterMsg(this))}isReaction(){return this.type===j.MSG_TYPE.REACTION||this.type===j.MSG_TYPE.REACTION_ENC}isCagAddon(){var e;return Boolean(null===(e=this.chat.groupMetadata)||void 0===e?void 0:e.isIncognitoCag)&&this.isReaction()}getWamDisappearingModeInitiator(){const e=this.disappearingModeInitiator;if(null==e)return null;switch(e){case oe.DisappearingModeInitiator.InitiatedByMe:return X.default.DISAPPEARING_CHAT_INITIATOR_TYPE.INITIATED_BY_ME;case oe.DisappearingModeInitiator.InitiatedByOther:return X.default.DISAPPEARING_CHAT_INITIATOR_TYPE.INITIATED_BY_OTHER;case oe.DisappearingModeInitiator.ChangedInChat:return X.default.DISAPPEARING_CHAT_INITIATOR_TYPE.CHAT}}getWamMessageType(){return this.isStatusV3?X.default.MESSAGE_TYPE.STATUS:this.isGroupMsg?X.default.MESSAGE_TYPE.GROUP:Z.default.isBroadcast(this.id.remote)?X.default.MESSAGE_TYPE.BROADCAST:X.default.MESSAGE_TYPE.INDIVIDUAL}getWamMediaType(){var e,t;if(!0===this.isDynamicReplyButtonsMsg)return X.default.MEDIA_TYPE.BUTTON_MESSAGE;switch(this.type){case j.MSG_TYPE.IMAGE:return X.default.MEDIA_TYPE.PHOTO;case j.MSG_TYPE.VIDEO:return this.mediaData.isGif?X.default.MEDIA_TYPE.GIF:X.default.MEDIA_TYPE.VIDEO;case j.MSG_TYPE.AUDIO:return X.default.MEDIA_TYPE.AUDIO;case j.MSG_TYPE.PTT:return X.default.MEDIA_TYPE.PTT;case j.MSG_TYPE.DOCUMENT:return X.default.MEDIA_TYPE.DOCUMENT;case j.MSG_TYPE.UNKNOWN:return X.default.MEDIA_TYPE.FUTURE;case j.MSG_TYPE.LOCATION:return this.isLive?X.default.MEDIA_TYPE.LIVE_LOCATION:X.default.MEDIA_TYPE.LOCATION;case j.MSG_TYPE.VCARD:return X.default.MEDIA_TYPE.CONTACT;case j.MSG_TYPE.MULTI_VCARD:return X.default.MEDIA_TYPE.CONTACT_ARRAY;case j.MSG_TYPE.CHAT:return this.linkPreview?(0,ie.matchCatalogUrl)(this.matchedText)?X.default.MEDIA_TYPE.CATALOG_LINK:(0,ie.matchProductUrl)(this.matchedText)?X.default.MEDIA_TYPE.PRODUCT_LINK:X.default.MEDIA_TYPE.URL:X.default.MEDIA_TYPE.NONE;case j.MSG_TYPE.STICKER:return X.default.MEDIA_TYPE.STICKER;case j.MSG_TYPE.PRODUCT:return X.default.MEDIA_TYPE.PRODUCT_IMAGE;case j.MSG_TYPE.LIST:switch(null!==(e=null===(t=this.list)||void 0===t?void 0:t.listType)&&void 0!==e?e:H.Message$ListMessage$ListType.UNKNOWN){case H.Message$ListMessage$ListType.SINGLE_SELECT:return X.default.MEDIA_TYPE.LIST;case H.Message$ListMessage$ListType.PRODUCT_LIST:return X.default.MEDIA_TYPE.PRODUCT_LIST;default:return X.default.MEDIA_TYPE.NONE}case j.MSG_TYPE.LIST_RESPONSE:return X.default.MEDIA_TYPE.LIST_REPLY;case j.MSG_TYPE.BUTTONS_RESPONSE:return X.default.MEDIA_TYPE.BUTTON_RESPONSE_MESSAGE;case j.MSG_TYPE.ORDER:return X.default.MEDIA_TYPE.ORDER;case j.MSG_TYPE.INTERACTIVE:return(0,R.default)(this.interactiveType);case j.MSG_TYPE.REACTION:case j.MSG_TYPE.REACTION_ENC:return X.default.MEDIA_TYPE.REACTION;case j.MSG_TYPE.POLL_CREATION:return X.default.MEDIA_TYPE.POLL_CREATE;case j.MSG_TYPE.POLL_UPDATE:return"poll_vote"===this.subtype?X.default.MEDIA_TYPE.POLL_VOTE:X.default.MEDIA_TYPE.NONE;case j.MSG_TYPE.KEEP_IN_CHAT:return this.keepType===H.KeepType.KEEP_FOR_ALL?X.default.MEDIA_TYPE.KEEP:X.default.MEDIA_TYPE.UNKEEP;default:return X.default.MEDIA_TYPE.NONE}}getForwardingScoreWhenForwarded(){const e=this.numTimesForwarded+(this.id.fromMe?0:1);return e>=V.ServerProps.frequentlyForwardedThreshold?C.default.FREQUENTLY_FORWARDED_SENTINEL:e}updateEphemeralStartTimestamp(e){var t=this;return(0,i.default)((function*(){yield(0,re.updateLocal)(t.id,{ephemeralStartTimestamp:e}),t.ephemeralStartTimestamp=e}))()}isExpired(){return null!=this.ephemeralExpirationTimestamp&&this.ephemeralExpirationTimestamp<=(0,p.unixTime)()}isExpiredAndNotKept(){return this.isExpired()&&!this.isKept}timeUntilExpiration(){const e=this.ephemeralExpirationTimestamp;return null==e?null:this.isExpired()?0:e-(0,p.unixTime)()}_logStorageEstimate(e){return(0,i.default)((function*(){const t=yield(0,I.default)();t&&(e.webcBrowserStorageQuotaBytes=t.quota,e.webcBrowserStorageQuotaUsedBytes=t.usage)}))()}getCollection(){return n(301460).MsgCollection}_getChatCollection(){return n(965012).ChatCollection}isDownloadable(){var e;return!this.asRevoked&&(!this.isViewOnce&&(this.type===j.MSG_TYPE.VCARD||this.type===j.MSG_TYPE.MULTI_VCARD||!!(null===(e=this.mediaData)||void 0===e?void 0:e.isDownloadable())&&this.type!==j.MSG_TYPE.STICKER))}safe(){return this}unsafe(){return this}meUserIsLastKICActor(){return Z.default.equals(this.kicSender,(0,q.getMaybeMeUser)())}keepIsLockedForMe(){return this.keepIsLockedByDmSettings()}keepIsLockedForMeSenderSuperpower(){return this.isUnkept&&Z.default.equals(this.kicSender,this.sender)&&!this.meUserIsLastKICActor()}keepIsLockedByDmSettings(){var e;return!!this.chat.isGroup&&!(null===(e=this.chat.groupMetadata)||void 0===e?void 0:e.canSetEphemeralSetting())}_isKICEnabled(){return!(this.chat.isCAG&&!(0,se.isKeepInChatInCAGEnabled)())&&(this.isEphemeral&&this.type!==j.MSG_TYPE.REVOKED&&!this.isViewOnce)}canShowKeepOrUnkeepOption(){return this.canShowKeepOption()||this.canShowUnkeepOption()}canShowKeepOption(){var e;return!!(0,se.isKICFullyEnabled)()&&(this._isKICEnabled()&&((0,S.canSendToGroup)(this.chat)||null!=(null===(e=this.chat.groupMetadata)||void 0===e?void 0:e.pastParticipants.get((0,q.assertGetMeUser)())))&&!this.keepIsLockedForMe()&&!this.star)}canShowUnkeepOption(){return this.isKept&&this._isKICEnabled()&&(this.canRevokeUnkeep()||this.canShowKeepOption())}canRevokeUnkeep(){if((0,se.isKeepInChatReadEnabled)()&&this.isSentByMe){var e;if(this.chat.isGroup&&!0===(null===(e=this.chat.groupMetadata)||void 0===e?void 0:e.participants.iAmMember()))return!0;if(this.chat.isUser&&!this.chat.contact.isBlocked())return!0}return!1}isPastUnkeepExpirationLimit(){const e=this.ephemeralExpirationTimestamp;if(null!=e){const t=Math.trunc(+new Date/1e3)-e;return this.isKept&&t>(0,se.getUndoKeepInChatExpiration)()}return!1}shouldShowNotificationPreview(){var e;return!(null===(e=this.asViewOnce)||void 0===e?void 0:e.isViewOnce)&&Y.MuteCollection.getGlobalPreviews()}senderIsGroupParticipant(){var e=this;return(0,i.default)((function*(){const t=e.chat.groupMetadata;if(null==t)return!1;if(null!=t.participants.get(e.sender))return!0;if(!(t.groupType===N.GroupType.DEFAULT_ANNOUNCEMENT_GROUP&&!0===t.incognito))return!1;const n=yield(0,h.getCurrentLid)(e.sender.user);return null!=n&&null!=t.participants.get(n)}))()}iAmGroupParticipant(){var e;return!0===(null===(e=this.chat.groupMetadata)||void 0===e?void 0:e.participants.iAmMember())}}de.Proxy="msg",de.idClass=B.default;const pe=(0,g.defineModel)(de);t.Msg=pe},96219:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addRecordsToChat=C,t.broadcastFanout=function(e){let t;if(!e.invis){const r=A(e);r&&(t=r.map((e=>e.remote)),r.forEach((t=>{const r=n(301460).MsgCollection;if(!r.some((0,o.default)({id:t}))){const i=M(e);i.to=t.remote,i.id=t,i.broadcast=!0;const a=r.add(i,{merge:!0});(0,n(855309).findChat)(t.remote).then((function(e){a.forEach((t=>{if(t.type!==g.MSG_TYPE.PROTOCOL){(0,d.isEphemeralSettingOn)(e)&&(t.ephemeralDuration=(0,d.getEphemeralSetting)(e));const n=(0,d.getEphemeralSettingTimestamp)(e);null!=n&&(t.ephemeralSettingTimestamp=n);const r=(0,d.getDisappearingModeInitiator)(e);null!=r&&(t.disappearingModeInitiator=r)}})),C(a,e,!0)}))}})))}return t},t.createQuotedMsg=function(e){if(!e)return null;const t=new h.default({from:e.from,to:e.to,id:e.id,participant:e.participant,selfDir:e.self});e.id=t;return new(0,n(387191).Msg)(e).safe()},t.eventTypeFromMsgType=function(e){const t=e.type,r=e.subtype;let i;i=t===g.MSG_TYPE.GP2||t===g.MSG_TYPE.GROUP_NOTIFICATION?"subject"===r?p.EventType.NOTEWORTHY:"add"===r||"invite"===r?e.recipients&&(0,E.isMePrimary)(e.recipients[0])?p.EventType.SIGNIFICANT:p.EventType.IGNORE:"linked_group_promote"===r||"linked_group_demote"===r?function(e){const{communitiesEnabled:t}=n(97858);if(t()){const t=n(318797).default,{GroupType:r}=n(862159),i=t.get(e.id.remote);if((null==i?void 0:i.groupType)===r.DEFAULT_ANNOUNCEMENT_GROUP&&e.recipients&&(0,E.isMePrimary)(e.recipients[0])&&!(0,E.isMeAccount)(e.author))return p.EventType.SIGNIFICANT}return p.EventType.IGNORE}(e):"remove"===r?e.recipients&&(0,E.isMePrimary)(e.recipients[0])?p.EventType.NOTEWORTHY:p.EventType.IGNORE:"create"===r?p.EventType.NOTEWORTHY:"parent_group_link"===r||"parent_group_unlink"===r?p.EventType.SIGNIFICANT:"sibling_group_link"===r||"sibling_group_unlink"===r||"membership_approval_request"===r?p.EventType.NOTEWORTHY:p.EventType.IGNORE:t===g.MSG_TYPE.BROADCAST_NOTIFICATION||t===g.MSG_TYPE.NOTIFICATION||t===g.MSG_TYPE.E2E_NOTIFICATION?"create"===r?p.EventType.NOTEWORTHY:p.EventType.IGNORE:t===g.MSG_TYPE.GROUPS_V4_INVITE&&(0,E.isMePrimary)(e.from)?p.EventType.IGNORE:t===g.MSG_TYPE.CALL_LOG?p.EventType.NOTEWORTHY:e.broadcast?S.default.isBroadcast(e.id.remote)?p.EventType.NOTEWORTHY:p.EventType.IGNORE:t===g.MSG_TYPE.REVOKED?p.EventType.IGNORE:S.default.isPSA(e.id.remote)?e.ack===l.ACK.RECEIVED?p.EventType.DEFAULT:p.EventType.AMBIENT:t===g.MSG_TYPE.CIPHERTEXT||t===g.MSG_TYPE.OVERSIZED?p.EventType.AMBIENT:t===g.MSG_TYPE.NOTIFICATION_TEMPLATE?"chat_assignment"!==r&&"chat_assignment_unassign"!==r||!(0,c.shouldReorderChatOnAssignment)("chat_assignment_unassign"===r)?p.EventType.IGNORE:p.EventType.NOTEWORTHY:t===g.MSG_TYPE.PROTOCOL&&"ephemeral_setting"===r||t===g.MSG_TYPE.UNKNOWN&&"reaction"===r||t===g.MSG_TYPE.REACTION?p.EventType.IGNORE:p.EventType.DEFAULT;return i},t.getBroadcastFanoutKeys=A,t.getMediaMsgWithCaptionForForwarding=function(e){if(!(0,f.forwardMediaWithCaptionsEnabled)()||e.length>1)return null;const t=e.filter((e=>e.isMedia&&Boolean(e.caption)));return 1===t.length?t[0]:null},t.getOriginalQuotedMsgIfPossible=function(e,t){var n;if(!e)return e;const r=null===(n=t.get(e.id))||void 0===n?void 0:n.safe();return!r||r.asRevoked||r.isEdited?e:r},t.getReadMsgKeys=function(e){return e.filter((e=>e.ack===l.ACK.READ)).map((e=>e.id.toString()))},t.getReferentialKey=function(e){const t=n(669050);if(e.broadcastId&&t.isWidlike(e.broadcastId)){const n=e.id;return new h.default({fromMe:n.fromMe,remote:t.createWidFromWidLike(e.broadcastId),id:n.id,participant:n.remote})}return e.id},t.listMsgCanRender=function(e){var t;return(null===(t=e.list)||void 0===t?void 0:t.listType)!==m.Message$ListMessage$ListType.PRODUCT_LIST||(0,c.productListMessagesEnabled)()&&!y.ServerProps.webProductListMessageRenderKillSwitch},t.msgMatchesType=function(e,t){switch(t){case"text":return e.type===g.MSG_TYPE.CHAT&&"url"!==e.subtype;case"image":return e.type===g.MSG_TYPE.IMAGE;case"video":return e.type===g.MSG_TYPE.VIDEO&&!e.isGif;case"gif":return e.type===g.MSG_TYPE.VIDEO&&e.isGif;case"audio":return e.type===g.MSG_TYPE.AUDIO;case"ptt":return e.type===g.MSG_TYPE.PTT;case"document":return e.type===g.MSG_TYPE.DOCUMENT;case"location":return e.type===g.MSG_TYPE.LOCATION;case"vcard":return e.type===g.MSG_TYPE.VCARD||e.type===g.MSG_TYPE.MULTI_VCARD;case"url":return e.type===g.MSG_TYPE.CHAT&&"url"===e.subtype;case"sticker":return e.type===g.MSG_TYPE.STICKER;case void 0:default:return!1}},t.typeIsMms=function(e){var t;switch(e.type){case"image":case"video":case"audio":case"ptt":case"sticker":case"document":case"product":return!0;case"protocol":return"history_sync_notification"===e.subtype;case g.MSG_TYPE.NATIVE_FLOW:return e.headerType===m.Message$ButtonsMessage$HeaderType.IMAGE;case g.MSG_TYPE.INTERACTIVE:return Boolean((null===(t=e.interactiveHeader)||void 0===t?void 0:t.mediaType)&&_.IM_MEDIA_HEADER_TYPES.has(e.interactiveHeader.mediaType));default:return!1}},t.typeIsUrl=function(e){return e.type===g.MSG_TYPE.CHAT&&"url"===e.subtype};var i=r(n(348926)),a=r(n(530988)),o=r(n(706410)),s=r(n(435161)),l=n(402994),u=n(984330),c=n(72696),d=n(299261),p=n(147980),_=n(943914),f=n(97858),h=r(n(565754)),g=n(373070),m=n(533494),y=n(241588),E=n(459857),S=r(n(124928)),T=r(n(933173)),v=n(814929);function A(e){var t;let r,i,a;if(e instanceof n(387191).Msg)i=e,a=e.id;else{if(!(e instanceof h.default))return void __LOG__(3)`model:msgs:broadcastFanout: unknown msgOrKey: ${String(e)}`;a=e}if(!S.default.isStatusV3(a.remote)){if((null===(t=i)||void 0===t?void 0:t.recipients)&&0!==i.recipients.length)r=i.recipients;else{const e=n(318797).default.get(a.remote);e?r=(0,s.default)(M(e.participants),"id"):__LOG__(2)`model:msgs:broadcastFanout no group_metadata rec for bclist, cant fanout: ${a.remote.toString()}`}return r?r.map((e=>new h.default({fromMe:a.fromMe,remote:e,id:a.id}))):void 0}}function C(e,t,r,i,a,o){const s=i||t.msgs;if(0===e.length)return;let l=s===t.msgs;if(o)if(l)__LOG__(2)`models:msg:store:resetMostRecentMsgs .msgs === cmc !`,P(t,s,e);else{l=!0;P(t,s,e).then((()=>{const e=new(0,n(74753).ChatMsgsCollection);e.replace(t.msgs),t.msgChunks.push(e),t.replaceMsgsCollection(s),t.msgs.trigger("change:last",t.msgs.last())}))}else r?l?P(t,s,e):I(s,e):I(s,e,{at:0,silent:e.every(b)});const u=a;u&&!t.unreadMsgAnchor&&(t.disableUnreadAnchor?t.disableUnreadAnchor=!1:t.unreadMsgAnchor=e.find((function(e){return e.id.toString()===u.toString()})))}function P(){return O.apply(this,arguments)}function O(){return(O=(0,i.default)((function*(e,t,n){const r=(0,a.default)(n,(e=>!!e));if(!r)return Promise.resolve();I(t,n),yield(0,v.setLastReceivedKey)(e.id,r.id),e.lastReceivedKey=r.id}))).apply(this,arguments)}function I(e,t,n){try{e.add(t,n)}catch(e){if(!(e instanceof u.LogoutDrop))throw e;__LOG__(3)`setRecords LogoutDrop: ${e.toString()}`}}function M(e){return null!=e&&"object"==typeof e?JSON.parse(JSON.stringify(e),T.default):e}function b(e){return e.eventType===p.EventType.IGNORE}},973480:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canPrivateReply=function(e){const t=(0,s.unproxy)(e);return!t.mayFail()&&!t.isNotification&&t.type!==a.MSG_TYPE.UNKNOWN&&t.type!==a.MSG_TYPE.CIPHERTEXT&&t.type!==a.MSG_TYPE.OVERSIZED&&t.type!==a.MSG_TYPE.REVOKED&&!t.isSentByMe&&t.isGroupMsg&&t.interactiveButtonsReleased()&&!t.isExpiredAndNotKept()},t.canPrivateReplyInRestrictedGrp=function(e){const t=(0,s.unproxy)(e);return!!t.chat.isAnnounceGrpRestrict&&!t.chat.isReadOnly&&!t.mayFail()&&!t.isSentByMe&&!t.isNotification&&t.type!==a.MSG_TYPE.UNKNOWN&&t.type!==a.MSG_TYPE.CIPHERTEXT&&t.type!==a.MSG_TYPE.OVERSIZED&&t.type!==a.MSG_TYPE.REVOKED&&t.interactiveButtonsReleased()&&!t.isExpiredAndNotKept()},t.canReplyMsg=function(e){const t=(0,s.unproxy)(e);if(t.type===a.MSG_TYPE.LIST&&!(0,i.listMsgCanRender)(t))return!1;return t.chat.canSend&&l(e)},t.isReplyMsg=function(e){const t=(0,s.unproxy)(e);return Boolean(t.quotedMsg)},t.isStatusReplyMsg=function(e){var t;const n=(0,s.unproxy)(e);return!!(null===(t=(0,o.getQuotedMsgObj)(n))||void 0===t?void 0:t.isStatusV3)},t.replyChecks=l;var r=n(387196),i=n(96219),a=n(373070),o=n(697180),s=n(411067);function l(e){const t=(0,s.unproxy)(e);return!t.mayFail()&&!t.isNotification&&!(0,r.isSuspendedGroup)(t.chat)&&!(0,r.isTerminatedGroup)(t.chat)&&t.type!==a.MSG_TYPE.UNKNOWN&&t.type!==a.MSG_TYPE.CIPHERTEXT&&t.type!==a.MSG_TYPE.OVERSIZED&&t.type!==a.MSG_TYPE.REVOKED&&t.interactiveButtonsReleased()&&!t.isExpiredAndNotKept()}},697180:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getQuotedMsgAdminGroupJid=function(e){const t=(0,o.unproxy)(e);return null==t.quotedMsg?t.quotedRemoteJid:null},t.getQuotedMsgAdminGroupSubject=function(e){const t=(0,o.unproxy)(e);return null==t.quotedMsg?t.quotedGroupSubject:null},t.getQuotedMsgAdminParentGroupJid=function(e){const t=(0,o.unproxy)(e);return null==t.quotedMsg?t.quotedParentGroupJid:null},t.getQuotedMsgObj=c,t.getQuotedMsgObjImpl=d,t.getQuotedPaymentRequestMsg=p,t.isQuotedMsg=function(e,t){const n=c(e);return!!n&&n.sender.equals(t)};var i=r(n(132375)),a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(96219)),o=n(411067),s=n(459857),l=r(n(124928));function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function c(e){const t=(0,o.unproxy)(e);if(!t.quotedMsg&&!t.paymentRequestMessageKey)return null;if(t.getRawQuotedMsgObj()){const e=t.getCollection();return a.getOriginalQuotedMsgIfPossible(t.getRawQuotedMsgObj(),e)}if(t.quotedMsg)t.setRawQuotedMsgObj(d(t));else{if(!t.paymentRequestMessageKey)return null;t.setRawQuotedMsgObj(p(t))}const n=t.getCollection();return a.getOriginalQuotedMsgIfPossible(t.getRawQuotedMsgObj(),n)}function d(e){const t=(0,s.getMaybeMeUser)(),n=(0,i.default)(e.quotedParticipant,"msg.quotedParticipant"),r=(0,s.isMeAccount)(n),o=r?"out":"in",u=e.quotedRemoteJid?e.quotedRemoteJid:e.id.remote,c={id:e.quotedStanzaID,from:r?t:u,to:r?u:t,self:o,author:n,remote:u};return(l.default.isGroup(c.from)||l.default.isGroup(c.to)||l.default.isStatusV3(u))&&((0,s.isMeAccount)(n),1)&&(c.participant=(0,i.default)(e.quotedParticipant,"msg.quotedParticipant")),Object.assign(c,e.quotedMsg),a.createQuotedMsg(c)}function p(e){if(!e.paymentRequestMessageKey)return null;const t=e.paymentRequestMessageKey.remote?e.paymentRequestMessageKey.remote:e.id.remote,n=e.paymentRequestMessageKey.fromMe,r=null!=e.paymentRequestMessageKey.self?e.paymentRequestMessageKey.self:n?"out":"in",i=e.paymentRequestMessageKey.participant||e.paymentMessageReceiverJid,o={id:e.paymentRequestMessageKey.id,from:n?(0,s.getMaybeMeUser)():t,to:n?t:(0,s.getMaybeMeUser)(),self:r,participant:i,author:i,remote:t,amount1000:e.paymentAmount1000,currency:e.paymentCurrency,receiverJid:e.sender,type:e.type,subtype:"request"};return a.createQuotedMsg(o)}},157211:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.BlocklistCollectionImpl=t.BlocklistCollection=void 0;var i=n(594534),a=r(n(404454));class o extends i.BaseCollection{constructor(){super(),this.listenTo(this,"add",this.blockContact),this.listenTo(this,"remove",this.unblockContact)}blockContact(e){e.contact().isContactBlocked=!0}unblockContact(e){e.contact().isContactBlocked=!1}dedupedList(){return this.filter((e=>{const t=e.contact(),n=t.phoneJid;return!t.id.isLid()||null==n||null==this.get(n)}))}}t.BlocklistCollectionImpl=o,o.model=a.default;const s=new o;t.BlocklistCollection=s},404454:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(54918),a=r(n(124928));class o extends i.BaseModel{constructor(){super(...arguments),this.id=(0,i.prop)()}contact(){return n(121977).ContactCollection.gadd(this.id)}getCollection(){return n(157211).BlocklistCollection}}o.Proxy="blocklist",o.idClass=a.default;var s=(0,i.defineModel)(o);t.default=s},54562:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getBlockEntryPointFromSpamFlow=function(e){switch(e){case a.SpamFlow.OverflowMenuReport:return i.BlockEntryPoint.OverflowMenuReport;case a.SpamFlow.MediaViewer:return i.BlockEntryPoint.MediaViewer;case a.SpamFlow.MessageMenu:return i.BlockEntryPoint.MessageMenu;case a.SpamFlow.AccountInfoReport:return i.BlockEntryPoint.AccountInfoReport;case a.SpamFlow.OneToOneChatSpamBannerReport:return i.BlockEntryPoint.OneToOneChatSpamBannerReport;default:return null}},t.getBlockEventMetricFromBlockEntryPoint=function(e){if(null==e)return o.default.BLOCK_ENTRY_POINT.OTHER;switch(e){case i.BlockEntryPoint.OneToOneOldSpamBannerBlock:return o.default.BLOCK_ENTRY_POINT.ONE_TO_ONE_OLD_SPAM_BANNER_BLOCK;case i.BlockEntryPoint.OneToOneSpamBannerBlock:return o.default.BLOCK_ENTRY_POINT.ONE_TO_ONE_SPAM_BANNER_BLOCK;case i.BlockEntryPoint.AccountInfo:return o.default.BLOCK_ENTRY_POINT.ACCOUNT_INFO;case i.BlockEntryPoint.AccountInfoReport:return o.default.BLOCK_ENTRY_POINT.ACCOUNT_INFO_REPORT;case i.BlockEntryPoint.BizOldSpamBannerBlock:return o.default.BLOCK_ENTRY_POINT.BIZ_OLD_SPAM_BANNER_BLOCK;case i.BlockEntryPoint.BizSpamBannerBlock:return o.default.BLOCK_ENTRY_POINT.BIZ_SPAM_BANNER_BLOCK;case i.BlockEntryPoint.BlockHeaderChat:return o.default.BLOCK_ENTRY_POINT.BLOCK_HEADER_CHAT;case i.BlockEntryPoint.CallLog:return o.default.BLOCK_ENTRY_POINT.CALL_LOG;case i.BlockEntryPoint.Chat:return o.default.BLOCK_ENTRY_POINT.CHAT;case i.BlockEntryPoint.ChatListBlock:return o.default.BLOCK_ENTRY_POINT.CHAT_LIST_BLOCK;case i.BlockEntryPoint.ChatListContextMenuBlock:return o.default.BLOCK_ENTRY_POINT.CHAT_LIST_CONTEXT_MENU_BLOCK;case i.BlockEntryPoint.ChatListNoInsubBlock:return o.default.BLOCK_ENTRY_POINT.CHAT_LIST_NOINSUB_BLOCK;case i.BlockEntryPoint.NotificationBlock:return o.default.BLOCK_ENTRY_POINT.NOTIFICATION_BLOCK;case i.BlockEntryPoint.OverflowMenuBlock:return o.default.BLOCK_ENTRY_POINT.OVERFLOW_MENU_BLOCK;case i.BlockEntryPoint.OverflowMenuReport:return o.default.BLOCK_ENTRY_POINT.OVERFLOW_MENU_REPORT;case i.BlockEntryPoint.Profile:return o.default.BLOCK_ENTRY_POINT.PROFILE;case i.BlockEntryPoint.TriggeredBlock:return o.default.BLOCK_ENTRY_POINT.TRIGGERED_BLOCK;case i.BlockEntryPoint.BlockList:return o.default.BLOCK_ENTRY_POINT.BLOCK_LIST;case i.BlockEntryPoint.MediaViewer:return o.default.BLOCK_ENTRY_POINT.MEDIA_VIEWER;case i.BlockEntryPoint.MessageMenu:return o.default.BLOCK_ENTRY_POINT.MESSAGE_MENU;case i.BlockEntryPoint.OneToOneChatSpamBannerReport:return o.default.BLOCK_ENTRY_POINT.ONE_TO_ONE_SPAM_BANNER_REPORT}},t.getBlockPsaRemoveEntryPointFromBlockEntryPoint=function(e){switch(e){case i.BlockEntryPoint.Profile:return 1;case i.BlockEntryPoint.ChatListBlock:return 2;case i.BlockEntryPoint.BlockList:return 1;default:return null}},t.getSpamFlowFromBlockEntryPoint=function(e){switch(e){case i.BlockEntryPoint.OneToOneOldSpamBannerBlock:case i.BlockEntryPoint.BizOldSpamBannerBlock:return a.SpamFlow.OneToOneOldSpamBannerBlock;case i.BlockEntryPoint.BizSpamBannerBlock:return a.SpamFlow.BizSpamBannerBlock;case i.BlockEntryPoint.ChatListBlock:return a.SpamFlow.ChatListBlock;case i.BlockEntryPoint.NotificationBlock:return a.SpamFlow.NotificationBlock;case i.BlockEntryPoint.OverflowMenuBlock:return a.SpamFlow.OverflowMenuBlock;default:return a.SpamFlow.Block}},t.getUnblockPsaRemoveEntryPointFromBlockEntryPoint=function(e){switch(e){case i.BlockEntryPoint.Profile:return 3;case i.BlockEntryPoint.ChatListBlock:return 4;case i.BlockEntryPoint.BlockList:return 5;default:return null}};var i=n(400436),a=n(453603),o=r(n(571834))},557242:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.KeptMsgCollection=void 0;var i=r(n(348926)),a=n(594534),o=n(387191);class s extends a.BaseCollection{constructor(){super(...arguments),this.isSynced=!0,this.syncPromise=null}process(){}sync(){return(0,i.default)((function*(){}))()}updateMsgs(){}}t.KeptMsgCollection=s,s.model=o.Msg,s.comparator=(e,t)=>t.t-e.t},935234:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.PresenceCollectionImpl=t.PresenceCollection=void 0;var i=r(n(348926)),a=n(287461),o=n(594534),s=n(883850),l=n(147034),u=r(n(124928)),c=n(375026);class d extends o.BaseCollection{_subscribe(e){return(0,i.default)((function*(){const t=n(965012).ChatCollection.get(e);if((0,a.getABPropConfigValue)("trusted_contacts_reciprocity")&&null!=t){const e=null!=t.tcTokenSenderTimestamp&&(0,l.isTokenExpired)(t.tcTokenSenderTimestamp,l.TcTokenMode.Receiver);if(!t.contact.isBusiness&&!e&&!t.contact.isWAContact)return}yield(0,c.subscribePresence)(e,null==t?void 0:t.getTcToken())}))()}_find(e){var t=this;return(0,i.default)((function*(){return!t.gadd(e).isUser||u.default.isServer(e)||u.default.isPSA(e)||(yield t._subscribe(e)),{id:e}}))()}reSubscribeWhenActive(e){var t=this;return(0,i.default)((function*(){const n=t.get(e);null!=n&&!1!==n.isSubscribed&&(yield t._subscribe(e))}))()}clearAllPresence(){this.forEach((e=>{e.reset(),e.set({stale:!0,isSubscribed:!1})}))}}t.PresenceCollectionImpl=d,d.model=s.Presence,d.staleCollection=!0;const p=new d;t.PresenceCollection=p},25868:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WithholdDisplayStage=void 0;const r=n(76672).Mirrored(["Info","Business","ChatAssignment","None"]);t.WithholdDisplayStage=r},883850:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Presence=t.ChatstateCollection=t.Chatstate=void 0,t.processStagesRecursively=E;var i=r(n(23279)),a=n(594534),o=n(54918),s=n(387202),l=n(319266),u=n(63014),c=n(121977),d=r(n(932325)),p=n(25868),_=r(n(124928)),f=n(548360);class h extends o.BaseModel{constructor(){super(...arguments),this.id=(0,o.prop)(),this.type=(0,o.prop)(),this.t=(0,o.prop)(),this.deny=(0,o.prop)(),this.updateTime=(0,o.session)(),this.expireTimerId=(0,o.session)()}}h.Proxy="chatstate",h.idClass=_.default;const g=(0,o.defineModel)(h);t.Chatstate=g;class m extends a.BaseCollection{}t.ChatstateCollection=m,m.model=g;class y extends o.BaseModel{constructor(){super(...arguments),this.id=(0,o.prop)(),this.isOnline=(0,o.session)(!1),this.stale=(0,o.session)(!0),this.hasData=(0,o.session)(!1),this.isSubscribed=(0,o.session)(!1),this.withholdDisplayStage=(0,o.session)(p.WithholdDisplayStage.None),this.forceDisplay=(0,o.session)(!1),this.chatActive=(0,o.session)(!1),this.withholdDisplayTimer=(0,o.session)(),this.forceDisplayTimer=(0,o.session)(),this.chatstate=(0,o.session)(),this.chatstates=(0,o.collection)(m),this.isGroup=(0,o.derived)((function(){return _.default.isGroup(this.id)})),this.isUser=(0,o.derived)((function(){return _.default.isUser(this.id)}))}initialize(){super.initialize();const e=this.isGroup?{id:"",type:"unavailable"}:{id:this.id};this.addChild("chatstate",new g(e)),this.isGroup?this.listenTo(this.chatstates,"add change",(0,i.default)((()=>{let e,t=!1;this.chatstates.forEach((n=>{"composing"!==n.type&&"recording"!==n.type||e&&!(e.updateTime<n.updateTime)||(e=n),t=t||"available"===n.type})),this.set({isOnline:t}),this.chatstate.set({id:e?e.id:"",type:e?e.type:"unavailable"})}))):this.listenTo(this.chatstate,"change:type",(()=>{"available"===this.chatstate.type?this.isOnline=!0:"unavailable"===this.chatstate.type&&(this.isOnline=!1)})),this.listenTo(this,"change:chatActive",this._handleChatActiveChange)}delete(){super.delete(),this.getCollection().remove(this.id),this.chatstate.delete(),this.chatstates.forEach((e=>e.delete()))}reset(){this.hasData=!1,this.isGroup?this.chatstates.forEach((e=>{e.type="unavailable"})):this.isUser&&(this.chatstate.unset("t"),this.chatstate.unset("deny")),this.chatstate.set({id:this.isGroup?"":this.id,type:"unavailable",t:void 0,deny:void 0})}isActive(){const e=this.chatstate.type;return this.hasData&&("composing"===e||"recording"===e)}getGroupSubtitleText(){if(!this.hasData)return null;if(!this.isGroup)return __LOG__(4,void 0,new Error,!0)`getGroupSubtitleText is used when presence is not for a group`,SEND_LOGS("getGroupSubtitleText-not-group"),null;const e=this._getActiveContact();if(null==e)return null;const t=e.formattedShortName;return"composing"===this.chatstate.type?d.default.t(702,{participant:t}):d.default.t(703,{participant:t})}_getActiveContact(){const e=this.chatstate.id;return e?c.ContactCollection.get(e):null}getUserSubtitleText(){if(!this.hasData)return null;if(!this.isUser)return __LOG__(4,void 0,new Error,!0)`getUserSubtitleText is used when presence is not for a user`,SEND_LOGS("getUserSubtitleText-not-user"),null;const e=this.chatstate;switch(e.type){case"available":return d.default.t(697);case"composing":return f.fbt._("typing…",null,{hk:"49dYir"});case"recording":return f.fbt._("recording audio…",null,{hk:"21blv0"});case"unavailable":return e.deny||null==e.t?null:u.Clock.lastSeenStr(e.t)}}getFormattedString(){return this.hasData?this.isGroup?this.getGroupSubtitleText():this.isUser?this.getUserSubtitleText():null:null}_handleChatActiveChange(){if(this.chatActive){const e=s.ChatAssignmentCollection.getAgentCollectionForChatId(this.id).length>0,t=this._getActiveContact(),n=[];this.hasData?((0,l.canAssignChats)()&&e&&n.push(p.WithholdDisplayStage.ChatAssignment),!0===(null==t?void 0:t.isBusiness)&&n.push(p.WithholdDisplayStage.Business),n.length>0?E(this,[...n,p.WithholdDisplayStage.None]):this.withholdDisplayStage=p.WithholdDisplayStage.None):((0,l.canAssignChats)()&&e&&n.push(p.WithholdDisplayStage.ChatAssignment),!0===(null==t?void 0:t.isBusiness)&&n.push(p.WithholdDisplayStage.Business),E(this,[...n,p.WithholdDisplayStage.Info,p.WithholdDisplayStage.None])),this.forceDisplayTimer=setTimeout((()=>{this.set({forceDisplay:!0,forceDisplayTimer:void 0})}),2e3)}else this.withholdDisplayTimer&&(clearTimeout(this.withholdDisplayTimer),this.withholdDisplayTimer=void 0),this.forceDisplayTimer&&(clearTimeout(this.forceDisplayTimer),this.forceDisplayTimer=void 0)}subscribe(){return this.getCollection().find(this.id)}getCollection(){return n(935234).PresenceCollection}}function E(e,t){if(0===t.length)return;const[n,...r]=t;e.set({withholdDisplayStage:n,withholdDisplayTimer:n===p.WithholdDisplayStage.None?null:setTimeout((()=>{E(e,r)}),n===p.WithholdDisplayStage.Business?5e3:3e3)})}y.Proxy="presence",y.idClass=_.default;const S=(0,o.defineModel)(y);t.Presence=S},925155:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ReactionsCollectionImpl=t.ReactionsCollection=void 0;var i=r(n(81109)),a=r(n(348926)),o=n(425315),s=n(402994),l=n(594534),u=r(n(565754)),c=n(403385),d=n(713334),p=n(459857),_=n(914436),f=n(429334);class h extends l.BaseCollection{_find(e){return(0,a.default)((function*(){const t=n(301460).MsgCollection,r=t.get(e);if(!r){const{messages:n}=yield t.getMessagesById([e]),r=n[0];return r?(0,_.sendQueryReactions)(r):Promise.reject(new l.CollectionSilentQueryError(`No message found for id: ${e}`))}return(0,_.sendQueryReactions)(r)}))()}addOrUpdateReaction(e){if(e.reactionText===c.REVOKED_REACTION_TEXT)return this.removeReaction(e);const t=this.get(e.parentMsgKey);if(t){const{reactionSenderModel:n,reactionAggregateWithSender:r}=this.getAggregateEmojiAndSender(t,e.senderUserJid);if(r&&n)return e.timestamp>n.timestamp?((0,p.isSerializedWidMe)(e.senderUserJid)&&(n.trigger("revoked"),r.set({hasReactionByMe:!1})),this._addNewReactionToAggregate(e,t),void(r.aggregateEmoji===f.EmojiUtil.getEmojiAggregate(e.reactionText)?(r.senders.remove(n.id),t.reactions.trigger("change:senders")):this._removeAggregateEmojiAndSender(t,n,r))):void 0;this._addNewReactionToAggregate(e,t)}}removeReaction(e){if((0,p.isSerializedWidMe)(e.senderUserJid))return this._removeSelfReaction(e);const t=this.get(e.parentMsgKey);if(t){const{reactionAggregateWithSender:n,reactionSenderModel:r}=this.getAggregateEmojiAndSender(t,e.senderUserJid);n&&r&&(this._removeAggregateEmojiAndSender(t,r,n),r.trigger("revoked"))}else __LOG__(3)`reactions_collection:removeReaction no reactions model found`}_addNewReactionToAggregate(e,t){const n=f.EmojiUtil.getEmojiAggregate(e.reactionText),r=t.reactions.get(n),a=u.default.fromString(e.msgKey),o=(0,i.default)((0,i.default)({},e),{},{id:a}),s=(0,p.isSerializedWidMe)(e.senderUserJid);r?(s&&(r.set({hasReactionByMe:!0}),t.set({reactionByMe:e})),r.senders.add(o),t.reactions.sort(),r.trigger("change:senders")):(s&&t.set({reactionByMe:e}),t.reactions.add({aggregateEmoji:n,hasReactionByMe:s,id:n,senders:[o]}))}_removeAggregateEmojiAndSender(e,t,n){n.senders.remove(t.id),0===n.senders.length?e.reactions.remove(n.id):e.reactions.sort(),n.trigger("change:senders")}getAggregateEmojiAndSender(e,t){let n=null,r=null;for(let i=0;i<e.reactions.length;i++){const a=e.reactions.at(i),o=null==a?void 0:a.senders.findFirst((e=>e.senderUserJid===t));if(o){n=o,r=a;break}}return{reactionSenderModel:n,reactionAggregateWithSender:r}}_removeSelfReaction(e){const t=this.get(e.parentMsgKey);if(null==t||t.set({reactionByMe:null}),t){const{reactionAggregateWithSender:n,reactionSenderModel:r}=this.getAggregateEmojiAndSender(t,e.senderUserJid);null==n||n.set({hasReactionByMe:!1}),n&&r&&(this._removeAggregateEmojiAndSender(t,r,n),r.trigger("revoked"))}}markReactionsAsRead(e){e.forEach((e=>{const{parentMsgKey:t,msgKey:n,reactionText:r}=e,a=f.EmojiUtil.getEmojiAggregate(r),o=this.get(t);if(o){const e=o.reactions.get(a),t=null==e?void 0:e.senders.get(n);t?t.set((0,i.default)((0,i.default)({},t),{},{read:!0})):__LOG__(3)`reactions_collection:markReactionsAsRead Reaction sender model not found`}}))}getSenderByMsgKey(e){for(const t of this.toArray())for(const n of t.reactions.toArray()){const t=n.senders.get(e);if(null!=t)return t}}getExistingSenderModelFromReactionDetails(e){const{parentMsgKey:t,msgKey:n,reactionText:r}=e,i=f.EmojiUtil.getEmojiAggregate(r),a=this.get(t);if(a){const e=a.reactions.get(i);return null==e?void 0:e.senders.get(n)}__LOG__(3)`reactions_collection:getExistingSenderModelFromReactionDetails Reactions sender model not found for this message id`}shouldUpdateAck(e,t){const n=this.getExistingSenderModelFromReactionDetails(e);if(n){const e=n.ack;return!(!(0,o.isNumber)(t)||!(void 0===e||null==e||t>e||t===s.ACK.FAILED))}return __LOG__(3)`reactions_collection:shouldUpdateAck Reaction sender model not found`,!1}deleteReactionsByParentMessageKey(e){this.remove(e)}}t.ReactionsCollectionImpl=h,h.model=d.Reactions;const g=new h;t.ReactionsCollection=g},713334:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ReactionsSendersCollection=t.ReactionsSenders=t.Reactions=t.AggReactionsCollection=t.AggReactions=void 0;var i=r(n(594654)),a=n(402994),o=n(552112),s=n(54918),l=r(n(801156)),u=n(121977),c=r(n(565754)),d=n(459857),p=n(669050);class _ extends o.AddOnBaseModel{constructor(){super(...arguments),this.id=(0,s.prop)(),this.msgKey=(0,s.prop)(),this.parentMsgKey=(0,s.prop)(),this.reactionText=(0,s.prop)(),this.timestamp=(0,s.prop)(),this.senderUserJid=(0,s.prop)(),this.read=(0,s.prop)(),this.orphan=(0,s.prop)(),this.isFailed=(0,s.derived)((function(){return(0,d.isSerializedWidMe)(this.senderUserJid)&&null!=this.ack&&this.ack<a.ACK.CLOCK||Boolean(this.isSendFailure)}),["ack","isSendFailure"]),this.senderObj=(0,s.session)(),this.parentMsg=(0,s.derived)((function(){return this._getMsgCollection().get(this.parentMsgKey)}))}initialize(){super.initialize(),this.addChild("senderObj",u.ContactCollection.gadd((0,p.createUserWid)(this.senderUserJid)))}_getMsgCollection(){return n(301460).MsgCollection}isEqual(e){return this.id.equals(e.id)}}_.Proxy="reactionsSenders",_.idClass=c.default;const f=(0,s.defineModel)(_);t.ReactionsSenders=f;class h extends l.default{}t.ReactionsSendersCollection=h,h.model=f,h.comparator=(e,t)=>(0,d.isSerializedWidMe)(e.senderUserJid)?-1:(0,d.isSerializedWidMe)(t.senderUserJid)?1:t.timestamp-e.timestamp;class g extends s.BaseModel{constructor(){super(...arguments),this.id=(0,s.prop)(),this.aggregateEmoji=(0,s.prop)(),this.hasReactionByMe=(0,s.prop)(),this.senders=(0,s.collection)(h)}}g.Proxy="aggReactions";const m=(0,s.defineModel)(g);t.AggReactions=m;class y extends l.default{}t.AggReactionsCollection=y,y.model=m,y.comparator=(e,t)=>{const n=t.senders.length-e.senders.length;if(e.hasReactionByMe)return-1;if(t.hasReactionByMe)return 1;if(0===n){const n=t.senders.at(0),r=e.senders.at(0);if(n&&r)return n.timestamp-r.timestamp}return n};class E extends s.BaseModel{constructor(){super(...arguments),this.id=(0,s.prop)(),this.reactionByMe=(0,s.prop)(),this.reactions=(0,s.collection)(y)}unreadSenders(){return(0,i.default)(this.reactions.toArray(),(e=>e.senders.filter((e=>!e.read&&!(0,d.isSerializedWidMe)(e.senderUserJid))))).map((e=>{let{id:t,parentMsgKey:n,reactionText:r,senderUserJid:i}=e;return{msgKey:t,parentMsgKey:c.default.fromString(n),reactionText:r,senderUserJid:i}}))}getReactionSenderModel(e,t){const n=this.reactions.get(e);return null==n?void 0:n.senders.findFirst((e=>e.senderUserJid===t))}getCollection(){return n(925155).ReactionsCollection}}E.Proxy="reactions",E.idClass=c.default;const S=(0,s.defineModel)(E);t.Reactions=S},274013:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(54918);class i extends r.BaseModel{constructor(){super(...arguments),this.id=(0,r.prop)(),this.reactionText=(0,r.prop)(),this.timestamp=(0,r.prop)()}}i.Proxy="recentReaction";var a=(0,r.defineModel)(i);t.default=a},702378:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.RecentReactionsCollectionImpl=t.RecentReactionsCollection=t.RECENT_REACTIONS_LIMIT=t.LISTENER_DEBOUNCE_WAIT=void 0;var i=r(n(23279)),a=n(154549),o=n(594534),s=r(n(274013)),l=n(94872);t.RECENT_REACTIONS_LIMIT=16;t.LISTENER_DEBOUNCE_WAIT=100;class u extends o.BaseCollection{constructor(){super(),this.listenTo(this,"add",(0,i.default)(this._sortTrim,100))}_find(e){return Promise.resolve(e)}_sortTrim(){const e=this.length;e&&(this.sort(),e>16&&this.remove(this.slice(16)))}}t.RecentReactionsCollectionImpl=u,u.model=s.default,u.cachePolicy={id:l.COLLECTIONS_KEYS.RECENT_REACTIONS_COLLECTION,policy:a.CACHE_POLICY.LOAD,delay:2e3},u.comparator=(e,t)=>t.timestamp-e.timestamp;const c=new u;t.RecentReactionsCollection=c},208182:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VIEW_ONCE_EXPIRE_AFTER=void 0,t.isExpired=u,t.isUnviewed=function(e){return!l(e)&&!u(e)},t.isViewed=l,t.setViewOnceTestExpire_INTERNAL=function(){};var r=n(990445),i=n(402994),a=n(411067);let o=1209600;function s(e){const t=(0,a.unproxy)(e);return null!=t?t.asViewOnce:null}function l(e){var t;return(null===(t=s(e))||void 0===t?void 0:t.ack)===i.ACK.PLAYED}function u(e){const t=s(e);if(null==t)return!1;const n=(0,r.unixTime)()-(0,a.unproxy)(t).t;return!l(t)&&n>=o}t.VIEW_ONCE_EXPIRE_AFTER=o},710024:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(null==e)return a.default.MEDIA_TYPE.NONE;switch(e){case i.default.SHOPS_STOREFRONT:return a.default.MEDIA_TYPE.SHOP_STOREFRONT;case i.default.NATIVE_FLOW:return a.default.MEDIA_TYPE.INTERACTIVE_NFM}};var i=r(n(182394)),a=r(n(571834))},897215:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(54918);const i={classic:!1,enabled:!1};class a extends r.BaseModel{constructor(){super(...arguments),this.id=(0,r.prop)(),this.archive=(0,r.prop)(),this.disappearingMode=(0,r.prop)(),this.showArchiveV2=(0,r.derived)((function(){return!!this.archive.enabled&&!this.archive.classic}),["archive","enabled"])}delete(){this.set({archive:i,disappearingMode:i}),super.delete()}}a.Proxy="settings";var o=new((0,r.defineModel)(a))({id:"default_settings_id",archive:i,disappearingMode:{duration:0,settingTimestamp:0}});t.default=o},986632:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.StarredMsgCollection=t.AllStarredMsgsCollection=void 0,t.addStarredMsgs=function(e){p.add(e),e.forEach((e=>{e.chat.starredMsgs&&e.chat.starredMsgs.add(e)}))},t.removeStarredMsgs=_;var i=r(n(132375)),a=n(594534),o=n(292220),s=n(301460),l=n(387191),u=n(226562),c=n(6961);class d extends a.BaseCollection{constructor(){super(),this.syncPromise=null,this.isSynced=!1,this.listenTo(c.Socket,"change:stream",(()=>{c.Socket.stream===u.SOCKET_STREAM.DISCONNECTED?this.isSynced=!1:c.Socket.stream===u.SOCKET_STREAM.CONNECTED&&this.delete()}))}process(e,t,n,r){r?this.delete():this.updateMsgs(e,t,n)}sync(e){if(this.isSynced)return Promise.resolve();if(null!=this.syncPromise)return this.syncPromise;const t=this;let n;const r=this.last();return r&&(n=r.id),this.syncPromise=s.MsgCollection.getStarred(e,o.PAGE_SIZE,n).then((function(e){e.length&&t.add(e,{silent:!0}),e.length<o.PAGE_SIZE&&(t.isSynced=!0)})).catch((function(){__LOG__(3)`starred msg sync error: `})).finally((()=>{t.syncPromise=null,t.trigger("sync")})),this.trigger("sync"),(0,i.default)(this.syncPromise,"syncPromise can not be null")}updateMsgs(e,t,n){const r=this.syncPromise||Promise.resolve();this.syncPromise=r.then((()=>{if(e){return(t.length>0?s.MsgCollection.incrementalStarredUpdate(t):Promise.resolve([])).then((e=>{const t=e.concat(n);this.isSynced&&this.add(t,{silent:!0}),t.forEach((e=>{e.chat.starredMsgs&&e.chat.starredMsgs.add(e)})),this.trigger("sync")})).catch((()=>{__LOG__(3)`models:starred:update:error: `}))}_(t.concat(n).filter((e=>!e.star)))})).finally((()=>{this.syncPromise=null}))}delete(){this.isSynced=!1,super.delete()}}t.StarredMsgCollection=d,d.model=l.Msg,d.comparator=(e,t)=>t.t-e.t;const p=new d;function _(e){p.remove(e),e.forEach((e=>{e.chat.starredMsgs&&e.chat.starredMsgs.remove(e)}))}t.AllStarredMsgsCollection=p},96656:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPSACampaigns=i,t.getPsaCampaignIndex=function(e,t){if(0===t.length)return-1;let n=0,r=t[0].campaignId;for(let i=1;i<t.length;i++){const{id:a,campaignId:o}=t[i];if(r!==o?(r=o,n=0):n++,a.toString()===e.toString())return n}return-1},t.getPsaCampaignsString=function(e){const t=i(e),n=[];return Object.keys(t).forEach((e=>{const r=t[e],{numberOfStatus:i,numberOfReadStatus:a}=r;n.push(`${e}:${i-a}`)})),n.join(",")},t.isCampaignExpired=a,t.isExpiredStatusPSA=function(e,t){const n=i(e);return Object.keys(n).every((e=>a(n[e],t)))};var r=n(990445);function i(e){const t={};return e.forEach((e=>{let{t:n,campaignId:r,campaignDuration:i,statusPSAReadTimestamp:a}=e;if(!r)return;t[r]||(t[r]={id:r,t:n,duration:i,firstReadTimestamp:null,numberOfStatus:0,numberOfReadStatus:0});const o=t[r];o.numberOfStatus++,null!=a&&(o.numberOfReadStatus++,(null==o.firstReadTimestamp||a<o.firstReadTimestamp)&&(o.firstReadTimestamp=a))})),t}function a(e,t){const n=e.firstReadTimestamp;if(null!=n)return(0,r.unixTime)()-n>t;const i=e.duration;return null!=i&&(0,r.unixTime)()-e.t>i}},669818:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.StatusV3CollectionImpl=t.StatusV3Collection=void 0;var i=r(n(348926)),a=r(n(441609)),o=r(n(763105)),s=r(n(112297)),l=n(616310),u=n(990445),c=n(287461),d=n(594534),p=(r(n(756680)),n(301460)),_=n(96219),f=r(n(836595)),h=n(459857),g=r(n(571834)),m=n(669050),y=n(603774);class E extends d.BaseCollection{_find(e){return Promise.resolve({id:e})}findQuery(e,t){var n=()=>super.findQuery,r=this;return(0,i.default)((function*(){const i=(yield n().call(r,e,t))||[];return yield Promise.all(i.map((e=>{if(!e)return;let t=0;return e.msgs.forEach((n=>{t<e._msgs.length&&e._msgs[t].id.toString()===n.id.toString()?++t:n.delete()})),e._msgs.length>0?r.addStatusMessages(e.id,e._msgs):Promise.resolve()}))),i}))()}_findQuery(){return(0,y.queryStatusAll)()}sync(){const e=window.performance.now();return this.findQuery({},{set:this.hasSynced()}).finally((()=>{this.trigger("sync")})).then((t=>{const n=window.performance.now(),r=Math.round(n-e);return this.logMetrics({type:"sync",syncTime:r}),this.forEach((e=>{e.msgs.length>e.totalCount&&__LOG__(2)`Total count: ${e.totalCount}, msgs length: ${e.msgs.length}`})),t}))}logMetrics(e){let t;t="sync"===e.type?new g.default.WebcStatusSync({webcStatusSyncT:e.syncTime}):new g.default.WebcStatusSession({webcStatusSessionId:e.sessionId});const n=this.filter((e=>!e.contact.isMe)),r=n.filter((e=>!e.contact.statusMute)),i=r.filter((e=>e.hasUnread)),a=r.filter((e=>!e.hasUnread)),o=n.filter((e=>e.contact.statusMute)),l=(0,s.default)(r.map((e=>e.unreadCount))),u=(0,s.default)(r.map((e=>e.readCount))),c=(0,s.default)(o.map((e=>e.totalCount)));t.webcStatusRecentItemCount=l,t.webcStatusRecentRowCount=i.length,t.webcStatusViewedItemCount=u,t.webcStatusViewedRowCount=a.length,t.webcStatusMutedItemCount=c,t.webcStatusMutedRowCount=o.length,t.commit()}hasSynced(){return!0}handleUpdate(e,t,n){const r=e.id.fromMe?(0,h.getMaybeMeUser)():e.author;if(this.hasSynced()){if(n)return!0;const t="sender_revoke"===e.subtype,i=this.get(r);if(i){const n=!0;if(t){const t=e.protocolMessageKey;if(!0!==(null!=t&&i.containsMessage(t)))return!0;const n=null==t?void 0:t.toString(),r=(0,_.getReadMsgKeys)(i.msgs.toArray()),a={totalCount:i.totalCount-1};null==r.find((e=>e===n))&&!0!==i.readKeys[n]&&(a.unreadCount=i.unreadCount-1),i.set(a)}else{const t={totalCount:i.totalCount+1};e.invis||(t.unreadCount=i.unreadCount+1),t.t=e.t,i.set(t)}return n}return t||this.add({id:r,t:e.t,unreadCount:e.invis?0:1,totalCount:1}),!0}return!1}addStatusMessages(e,t){return p.MsgCollection.processMultipleMessages((0,m.createWid)(l.STATUS_JID),t,{add:"after",isHistory:!0})}getUnexpired(e){let t=!1;t=(0,c.getABPropConfigValue)("web_status_psa");const n=this.filter((e=>!(e.totalCount<=0)&&(!e.isExpired()&&(!e.contact.isMe&&(!!e.contact.isMyContact||!!e.contact.isPSA&&t)))));if(t&&n.sort(((e,t)=>e.contact.isPSA===t.contact.isPSA?0:e.contact.isPSA?-1:1)),e){return(0,o.default)(n,(e=>e.unreadCount>0))}return(0,o.default)(n,(e=>0===e.unreadCount))}getMyStatus(){const e=this.filter((e=>e.contact.isMe));if(!((0,a.default)(e)||(0,u.unixTime)()-e[0].t>86400))return e[0]}getPSAStatus(){const e=this.filter((e=>e.contact.isPSA));if(0!==e.length)return e[0]}}t.StatusV3CollectionImpl=E,E.model=f.default,E.comparator=(e,t)=>t.t-e.t;const S=new E;t.StatusV3Collection=S},836595:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=n(990445),o=r(n(164325)),s=n(54918),l=n(292220),u=n(121977),c=n(96656),d=r(n(802635)),p=r(n(124928)),_=n(603774);const f=86400;class h extends d.default{constructor(){super(...arguments),this.id=(0,s.prop)(),this.t=(0,s.prop)(),this.unreadCount=(0,s.prop)(0),this.totalCount=(0,s.prop)(0),this.pic=(0,s.prop)(),this._msgs=(0,s.prop)((()=>[])),this.readKeys=(0,s.session)((()=>({}))),this.contact=(0,s.session)(),this.expireTimer=(0,s.session)(),this.expireTs=(0,s.session)(),this.hasUnread=(0,s.derived)((function(){return this.unreadCount>0}),["unreadCount"]),this.readCount=(0,s.derived)((function(){const e=this.totalCount-this.unreadCount;return Number.isFinite(e)?e:(__LOG__(3)`Bad status v3 read count, ${this.totalCount}, ${this.unreadCount}`,0)}),["unreadCount","totalCount"]),this.lastStatus=(0,s.derived)((function(){return this.msgs.last()}),["msgsChanged","totalCount"])}initialize(){super.initialize(),this.addChild("contact",u.ContactCollection.gadd(this.id)),this.listenTo(this.msgs,"add bulk_add",(()=>{window.setTimeout((()=>{this.setupStatusExpiration()}))})),this.listenTo(this,"change:lastStatus",(()=>{this.lastStatus&&(this.t=this.lastStatus.t)}))}isExpired(){return this.id.isPSA()?(0,c.isExpiredStatusPSA)(this.msgs.toArray(),f):(0,a.unixTime)()-this.t>f}setupStatusExpiration(){const e=this.msgs.at(0);if(!e)return;if("number"==typeof this.expireTs&&this.expireTs<=e.t)return;const t=e.t+f+1;t<(0,a.unixTime)()?window.setTimeout((()=>{this.expireMsg()})):(this.expireTimer=o.default.setGlobalTimeout(this.expireMsg.bind(this),1e3*t,this.expireTimer),this.expireTs=e.t)}_removeSingleMsg(e){const t=this.msgs;this.unreadCount>this.totalCount-1&&this.unreadCount--,this.totalCount--,t.remove(e),e.delete()}expireMsg(){if(this.id.isPSA())return void this.expirePSAMsg();const e=this.msgs;for(;e.length>0;){const t=e.at(0);if(!t)break;if(t.t+f>(0,a.unixTime)())break;this._removeSingleMsg(t)}this.expireTs=void 0,this.expireTimer=void 0,0!==this.totalCount&&this.setupStatusExpiration()}expirePSAMsg(){const e=(0,c.getPSACampaigns)(this.msgs.toArray());this.msgs.forEach((t=>{const{campaignId:n}=t;if(null==n)return;(0,c.isCampaignExpired)(e[n],f)&&this._removeSingleMsg(t)})),this.expireTs=void 0,this.expireTimer=void 0,0!==this.totalCount&&this.setupStatusExpiration()}revokeMsgs(e){const t=new Set(e);this.msgs.filter((e=>t.has(e.id.toString()))).forEach((e=>this._removeSingleMsg(e))),0===this.totalCount&&(this.expireTs=void 0,this.expireTimer=void 0)}delete(){__LOG__(2)`Status v3 deleted with total count: ${this.totalCount}`,super.delete(),this.expireTimer&&o.default.clearTimeout(this.expireTimer),null!=this.expireTs&&(this.expireTs=void 0),this.getCollection().remove(this.id)}onEmptyMRM(){__LOG__(2)`Status V3 onEmptyMRM with total count: ${this.totalCount}, noEarlierMsgs: ${this.msgs.msgLoadState.noEarlierMsgs?"true":"false"}`,this.msgs.msgLoadState.noEarlierMsgs&&0===this.totalCount?this.delete():this.totalCount>0&&this.loadMore().catch((()=>{})).finally((()=>{this.msgs.length||this.delete()}))}loadMore(){return arguments.length>0&&void 0!==arguments[0]||l.PAGE_SIZE,this.msgs.msgLoadState.noEarlierMsgs?Promise.resolve():this.msgs.msgLoadState.isLoadingEarlierMsgs?this.msgs.loadEarlierPromise:Promise.resolve()}handleReadStatus(e){this.readKeys[e]||(this.readKeys[e]=!0,this.unreadCount>0&&this.unreadCount--)}sendReadStatus(e,t){var n=this;return(0,i.default)((function*(){(yield(0,_.sendReadStatus)(e,t))&&n.handleReadStatus(e.id)}))()}getCollection(){return n(669818).StatusV3Collection}containsMessage(e){return this.msgs.toArray().some((t=>t.id.toString()===e.toString()))}}h.Proxy="statusV3",h.idClass=p.default;var g=(0,s.defineModel)(h);t.default=g},824668:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.updateDisappearingMode=function(){return u.apply(this,arguments)};var i=r(n(348926)),a=n(493928),o=n(121977),s=n(669050),l=n(901289);function u(){return(u=(0,i.default)((function*(e,t,n){if(!(0,a.isDisappearingModeEnabled)())return Promise.resolve();const r=(0,s.createUserWid)(e.user,e.server),i=o.ContactCollection.get(r);if(i){const{disappearingModeSettingTimestamp:e}=i;if(null==e&&0!==n||null!=e&&e<n){const e={disappearingModeDuration:t,disappearingModeSettingTimestamp:n};yield(0,l.updateLocal)(r,e),i.set(e),__LOG__(2,void 0,void 0,void 0,["DM","DDM"])`updateDisappearingMode: Contact=${r.toString()} updated, new duration=${t} t=${n}.`}}}))).apply(this,arguments)}},651634:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.CallCollectionImpl=t.CallCollection=void 0;var i=r(n(682492)),a=r(n(114176)),o=n(385385),s=n(594534),l=r(n(709019));class u extends s.BaseCollection{constructor(){super(...arguments),this.pendingOffers={},this.pendingVoipCapChecks={}}processIncomingCall(e,t,n){if(null!=this.get(e))return void __LOG__(2)`voip:processIncomingCall: Attempting to add existing call with call ID`;let r=n;const o={id:e};null!=t&&(o.peerJid=t),r&&(r=(0,a.default)(r,(e=>null==e)),(0,i.default)(o,r)),this.add(o,{merge:!0})}cleanupPendingOffer(e){delete this.pendingOffers[e]}setActiveCall(e){var t,n;this.activeCall,null===(t=this.activeCall)||void 0===t||t.webClientShouldHandle;this.activeCall=e,this.trigger("change:activeCall",e),null===(n=this._releaseAudioChannelClaim)||void 0===n||n.call(this),null!=e&&(this._releaseAudioChannelClaim=o.MainAudioChannel.claim(this,(()=>{})))}}t.CallCollectionImpl=u,u.model=l.default;const c=new u;t.CallCollection=c},709019:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(385385),a=n(54918),o=r(n(89630)),s=n(780549),l=n(266888),u=n(571256),c=n(416371);class d extends a.BaseModel{constructor(){super(...arguments),this.id=(0,a.prop)(),this.peerJid=(0,a.prop)(),this.offerTime=(0,a.prop)(),this.isVideo=(0,a.prop)(!1),this.isGroup=(0,a.prop)(!1),this.groupCallParticipants=(0,a.prop)(),this.canHandleLocally=(0,a.prop)(!1),this.outgoing=(0,a.prop)(!1),this.webClientShouldHandle=(0,a.prop)(!1),this.participants=(0,a.collection)(o.default),this.callInfo=(0,a.prop)(),this._state=(0,a.prop)(),this._ringTimeout=(0,a.prop)()}getState(){return this._state}setState(e){var t;(t=this._state,e in _[t||"EMPTY"])&&(this._state=e,this._handleNotification())}_handleNotification(){const e=this.getState();if(!(!l.Conn.tosShowCallNotification||!this.peerJid||(0,u.isVoiceCallEnabled)()&&!this.isVideo||(0,u.isVideoCallEnabled)()&&this.isVideo))if(e===c.CALL_STATES.INCOMING_RING){s.Cmd.alertCall(this.peerJid,this.id,this.isVideo,this.isGroup,this.canHandleLocally);i.MainAudioChannel.claim(this,(()=>{}))()}else s.Cmd.cancelCall(this.peerJid)}getCollection(){return n(651634).CallCollection}}d.Proxy="call";var p=(0,a.defineModel)(d);t.default=p;const _={EMPTY:{[c.CALL_STATES.INCOMING_RING]:!0,[c.CALL_STATES.OUTGOING_CALLING]:!0,[c.CALL_STATES.CONNECTING]:!0,[c.CALL_STATES.REJECTED]:!0,[c.CALL_STATES.HANDLED_REMOTELY]:!0,[c.CALL_STATES.ENDED]:!0,[c.CALL_STATES.FAILED]:!0},INCOMING_RING:{[c.CALL_STATES.HANDLED_REMOTELY]:!0,[c.CALL_STATES.CONNECTING]:!0,[c.CALL_STATES.ACTIVE]:!0,[c.CALL_STATES.REJECTED]:!0,[c.CALL_STATES.ENDED]:!0,[c.CALL_STATES.REMOTE_CALL_IN_PROGRESS]:!0,[c.CALL_STATES.FAILED]:!0},OUTGOING_CALLING:{[c.CALL_STATES.OUTGOING_RING]:!0,[c.CALL_STATES.CONNECTING]:!0,[c.CALL_STATES.ENDED]:!0,[c.CALL_STATES.FAILED]:!0,[c.CALL_STATES.ACTIVE]:!0,[c.CALL_STATES.NOT_ANSWERED]:!0,[c.CALL_STATES.REMOTE_CALL_IN_PROGRESS]:!0},OUTGOING_RING:{[c.CALL_STATES.CONNECTING]:!0,[c.CALL_STATES.ACTIVE]:!0,[c.CALL_STATES.REJECTED]:!0,[c.CALL_STATES.ENDED]:!0,[c.CALL_STATES.FAILED]:!0,[c.CALL_STATES.NOT_ANSWERED]:!0},CONNECTING:{[c.CALL_STATES.ACTIVE]:!0,[c.CALL_STATES.ENDED]:!0,[c.CALL_STATES.REMOTE_CALL_IN_PROGRESS]:!0,[c.CALL_STATES.FAILED]:!0},CONNECTION_LOST:{[c.CALL_STATES.ACTIVE]:!0,[c.CALL_STATES.ENDED]:!0,[c.CALL_STATES.FAILED]:!0},ACTIVE:{[c.CALL_STATES.ENDED]:!0,[c.CALL_STATES.FAILED]:!0,[c.CALL_STATES.CONNECTION_LOST]:!0},HANDLED_REMOTELY:{},ENDED:{},REJECTED:{},REMOTE_CALL_IN_PROGRESS:{},FAILED:{},NOT_ANSWERED:{}}},89630:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(132304)),a=n(594534),o=r(n(632909));class s extends a.BaseCollection{}t.default=s,s.model=o.default,s.comparator=(e,t)=>e.id===t.id?0:(0,i.default)(e.id,t.id)?-1:1},632909:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(54918);class i extends r.BaseModel{constructor(){super(...arguments),this.id=(0,r.prop)(),this.callId=(0,r.prop)(),this.isIncoming=(0,r.prop)(!1),this.isRinging=(0,r.prop)(!1),this.isInterrupted=(0,r.prop)(!1),this.isMuted=(0,r.prop)(!1),this.isTrafficStopped=(0,r.prop)(!1),this.isInvitingToGroupCall=(0,r.prop)(!1),this.isVideoStopped=(0,r.prop)(!1),this.isVideoPaused=(0,r.prop)(!1),this.isVideoDecodePaused=(0,r.prop)(!1),this.isVideoDecodeStarted=(0,r.prop)(!1),this.isOfferingVideoUpgrade=(0,r.prop)(!1)}}i.Proxy="callParticipant";var a=(0,r.defineModel)(i);t.default=a},611592:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(54918);class i extends r.BaseModel{constructor(){super(...arguments),this.isFocused=(0,r.session)(!0)}initialize(){super.initialize(),this._handleFocus=this._handleFocus.bind(this),this._handleBlur=this._handleBlur.bind(this)}delete(){super.delete()}_handleFocus(){this.isFocused=!0}_handleBlur(){this.isFocused=!1}}i.Proxy="mainWindowState";var a=new((0,r.defineModel)(i));t.default=a},367231:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(54918),i=n(416371);class a extends r.BaseModel{constructor(){super(...arguments),this.callId=(0,r.prop)(),this.peerJid=(0,r.prop)(),this.pc=(0,r.prop)(),this.answer=(0,r.prop)(),this.localStream=(0,r.prop)(),this.remoteAudioStream=(0,r.prop)(),this.remoteVideoStream=(0,r.prop)(),this._state=(0,r.prop)(i.WEB_CALL_STATES.NONE)}getState(){return this._state}setState(e){const t=e;(function(e,t){const n=e||i.WEB_CALL_STATES.NONE;return t in s[n]})(this._state,t)&&(this._state=t)}}a.Proxy="webCall";var o=(0,r.defineModel)(a);t.default=o;const s={NONE:{[i.WEB_CALL_STATES.OUTGOING_CALLING]:!0,[i.WEB_CALL_STATES.INCOMING_CALLING]:!0},OUTGOING_CALLING:{[i.WEB_CALL_STATES.ACTIVE]:!0,[i.WEB_CALL_STATES.NONE]:!0},INCOMING_CALLING:{[i.WEB_CALL_STATES.ACTIVE]:!0,[i.WEB_CALL_STATES.NONE]:!0},ACTIVE:{[i.WEB_CALL_STATES.NONE]:!0}}},638521:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.clearInitializePromise=function(){_=null},t.destroy=function(){return(0,a.destroyStorage)().catch((()=>(0,i.dexieCastToPromise)(new p.default(a.DATABASE_NAME).delete()))).finally((()=>(_=null,(0,i.dexieCastToPromise)(new p.default("fts-storage-dogfooding").delete()))))},Object.defineProperty(t,"getIndexV1Table",{enumerable:!0,get:function(){return s.getTable}}),Object.defineProperty(t,"getIndexV2Table",{enumerable:!0,get:function(){return l.getTable}}),Object.defineProperty(t,"getIndexV3Table",{enumerable:!0,get:function(){return c.getTable}}),Object.defineProperty(t,"getManifestTable",{enumerable:!0,get:function(){return d.getTable}}),Object.defineProperty(t,"getPurgeRangeQueueTable",{enumerable:!0,get:function(){return o.getTable}}),Object.defineProperty(t,"getV2TokenToPrefixMappingTable",{enumerable:!0,get:function(){return u.getTable}}),t.initialize=function(){null==_&&((0,a.createStorage)(),(0,d.addTable)(),(0,s.addTable)(),(0,l.addTable)(),(0,u.addTable)(),(0,o.addTable)(),(0,c.addTable)(),_=(0,a.getStorage)().initialize().catch((e=>{throw __LOG__(4,!0,new Error,!0)`Assertion failed!`,SEND_LOGS("Failed to initialize fts storage"),e})));return _};var i=n(273624),a=n(803905),o=n(527276),s=n(911853),l=n(417902),u=n(95237),c=n(418419),d=n(25842),p=r(n(986128));let _},803905:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DATABASE_NAME=void 0,t.createStorage=function(){const e=new i.default(u);c=new a.Storage(e),c.addErrorHandler(s.default.AbortError,(e=>{e.message.includes("QuotaExceededError")&&o.StorageCmd.trigger("storage_not_enough_space")}))},t.destroyStorage=function(){if(null==c)return Promise.reject(new Error("[fts-storage] Storage should be created first before being destroyed"));return c.purge().then((()=>{c=null})).catch((e=>{throw c=null,e}))},t.getStorage=function(){return(0,l.default)(null!=c,"[fts-storage] Storage should be created first before being accessed"),c};var i=r(n(844800)),a=n(408286),o=n(355701),s=r(n(986128)),l=r(n(441143));const u="fts-storage";t.DATABASE_NAME=u;let c=null},705514:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ftsV1IndexCreateTable=function(){return(0,r.getStorage)().versions.version(0)},t.ftsV2IndexCreateTable=function(){return(0,r.getStorage)().versions.version(3)},t.ftsV2TokenToPrefixesCreateTable=function(){return(0,r.getStorage)().versions.version(4)},t.ftsV3IndexCreateTable=function(){return(0,r.getStorage)().versions.version(5)},t.manifestCreateTable=function(){return(0,r.getStorage)().versions.version(1)},t.purgeRangeQueueCreateTable=function(){return(0,r.getStorage)().versions.version(2)};var r=n(803905)},527276:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.TABLE_NAME=void 0,t.addTable=function(){(0,i.getStorage)().add(l).version((0,a.purgeRangeQueueCreateTable)(),[new s.default(["chatId","tsOfLastMessage","startRowId","endRowId"]),new o.default("offset")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table(l)};var i=n(803905),a=n(705514),o=r(n(372407)),s=r(n(277631));const l="fts-purge-range-queue";t.TABLE_NAME=l},911853:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.TABLE_NAME=void 0,t.addTable=function(){(0,a.getStorage)().add(c).version((0,o.ftsV1IndexCreateTable)(),[new u.default("token"),new l.default("ids"),new s.default("ids"),new l.default("prefixes"),new s.default("prefixes")]).view((e=>e?(0,i.buildEntry)(e.prefixes,e.ids):null))},t.getTable=function(){return(0,a.getStorage)().table(c)};var i=n(156854),a=n(803905),o=n(705514),s=r(n(227209)),l=r(n(372407)),u=r(n(874712));const c="fts-v1-index";t.TABLE_NAME=c},417902:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.TABLE_NAME=void 0,t.addTable=function(){(0,a.getStorage)().add(d).version((0,o.ftsV2IndexCreateTable)(),[new c.default(["id","chatId","token"]),new u.default("id"),new u.default("chatId"),new u.default("token"),new l.default(["chatId","token"]),new s.default("timestamp"),new l.default(["id","token"])]).view((e=>e?(0,i.buildEntry)(e.id,e.chatId,e.token,e.timestamp):null))},t.getTable=function(){return(0,a.getStorage)().table(d)};var i=n(369269),a=n(803905),o=n(705514),s=r(n(372407)),l=r(n(974622)),u=r(n(599395)),c=r(n(277631));const d="fts-v2-index";t.TABLE_NAME=d},95237:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.TABLE_NAME=void 0,t.addTable=function(){(0,i.getStorage)().add(u).version((0,a.ftsV2TokenToPrefixesCreateTable)(),[new l.default("token"),new s.default("prefixes"),new o.default("prefixes")]).view((e=>e||null))},t.getTable=function(){return(0,i.getStorage)().table(u)};var i=n(803905),a=n(705514),o=r(n(227209)),s=r(n(372407)),l=r(n(874712));const u="fts-v2-token-prefixes";t.TABLE_NAME=u},418419:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.TABLE_NAME=void 0,t.addTable=function(){(0,a.getStorage)().add(d).version((0,o.ftsV3IndexCreateTable)(),[new c.default("ftsRowId"),new l.default("id"),new u.default("id"),new l.default("chatId"),new u.default("chatId"),new l.default("timestamp"),new l.default("prefixes"),new s.default("prefixes")]).view((e=>e?(0,i.buildDBEntry)(e.ftsRowId,e.id,e.chatId,e.timestamp,e.prefixes):null))},t.getTable=function(){return(0,a.getStorage)().table(d)};var i=n(344171),a=n(803905),o=n(705514),s=r(n(227209)),l=r(n(372407)),u=r(n(599395)),c=r(n(172581));const d="fts-v3-index";t.TABLE_NAME=d},25842:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.TABLE_NAME=t.ManifestKeys=void 0,t.addTable=function(){(0,i.getStorage)().add(l).version((0,a.manifestCreateTable)(),[new s.default("key"),new o.default("tokenizerVersion"),new o.default("schemaVersion"),new o.default("isCurrent"),new o.default("lastMsgKeyViaFullIndexer"),new o.default("isFullIndexingComplete")]).view((e=>e||null))},t.getTable=function(){return(0,i.getStorage)().table(l)};var i=n(803905),a=n(705514),o=r(n(372407)),s=r(n(874712));const l="manifest";t.TABLE_NAME=l;const u=Object.freeze({PREV_VERSION:"prev.version",CURR_VERSION:"curr.version",NEXT_VERSION:"next.version"});t.ManifestKeys=u},777834:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.destroy=function(){return(0,a.destroyStorage)().catch((()=>(0,i.dexieCastToPromise)(new s.default(a.DATABASE_NAME).delete()))).finally((()=>{l=null}))},t.initialize=function(){null==l&&((0,a.createStorage)(),(0,o.addTable)(),l=(0,a.getStorage)().initialize().catch((e=>{throw __LOG__(4,!0,new Error,!0)`Assertion failed!`,SEND_LOGS("Failed to initialize jobs storage"),e})));return l};var i=n(273624),a=n(229020),o=n(314642),s=r(n(986128));let l},229020:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DATABASE_NAME=void 0,t.createStorage=function(){const e=new i.default(u);c=new a.Storage(e),c.addErrorHandler(s.default.AbortError,(e=>{e.message.includes("QuotaExceededError")&&o.StorageCmd.trigger("storage_not_enough_space")}))},t.destroyStorage=function(){if(null==c)return Promise.reject(new Error("[jobs-storage] Storage should be created first before being destroyed"));return c.purge().then((()=>{c=null})).catch((e=>{throw c=null,e}))},t.getStorage=function(){return(0,l.default)(null!=c,"[jobs-storage] Storage should be created first before being accessed"),c};var i=r(n(844800)),a=n(408286),o=n(355701),s=r(n(986128)),l=r(n(441143));const u="jobs-storage";t.DATABASE_NAME=u;let c=null},45090:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.jobsCreateV1Table=function(){return(0,r.getStorage)().versions.version(0)},t.jobsCreateV2Table=function(){return(0,r.getStorage)().versions.version(1)};var r=n(229020)},314642:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("jobs-store").version((0,a.jobsCreateV1Table)(),[new l.default("jobId"),new o.default("type"),new o.default("uniqKey"),new s.default("uniqKey"),new o.default("original"),new o.default("current"),new o.default("step"),new o.default("startTime"),new o.default("endTime"),new o.default("stepHardStartCountAfterTimeout"),new o.default("stepFirstStartTime"),new o.default("waitUntil"),new o.default("backedOffCount"),new o.default("version")]).version((0,a.jobsCreateV2Table)(),[new o.default("stepUnexpectedErrorCount"),new u.default("endTime")]).view((e=>({jobId:e.jobId,type:e.type,uniqKey:e.uniqKey,original:e.original,current:e.current,step:e.step,startTime:e.startTime,stepHardStartCountAfterTimeout:e.stepHardStartCountAfterTimeout,stepFirstStartTime:e.stepFirstStartTime,waitUntil:e.waitUntil,backedOffCount:e.backedOffCount,version:e.version,stepUnexpectedErrorCount:e.stepUnexpectedErrorCount})))},t.getTable=function(){return(0,i.getStorage)().table("jobs-store")};var i=n(229020),a=n(45090),o=r(n(372407)),s=r(n(599395)),l=r(n(172581)),u=r(n(482078))},408286:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.Storage=t.NotInitializedError=t.NoSuchTableError=t.NoSuchDatabaseError=t.NoFallbackError=t.DuplicateTableError=t.DuplicateDatabaseError=t.AlreadyInitializedError=void 0;var i=r(n(348926)),a=r(n(581216)),o=r(n(559351)),s=n(214578);class l extends Error{constructor(){super(...arguments),this.name="AlreadyInitializedError"}}t.AlreadyInitializedError=l;class u extends Error{constructor(){super(...arguments),this.name="DuplicateDatabaseError"}}t.DuplicateDatabaseError=u;class c extends Error{constructor(){super(...arguments),this.name="DuplicateTableError"}}t.DuplicateTableError=c;class d extends Error{constructor(){super(...arguments),this.name="NoFallbackError"}}t.NoFallbackError=d;class p extends Error{constructor(){super(...arguments),this.name="NoSuchDatabaseError"}}t.NoSuchDatabaseError=p;class _ extends Error{constructor(){super(...arguments),this.name="NoSuchTableError"}}t.NoSuchTableError=_;class f extends Error{constructor(){super(...arguments),this.name="NotInitializedError"}}t.NotInitializedError=f;t.Storage=class{constructor(e){this.tables=new Map,this.views=new Map,this.state=1,this.versions=new s.StorageVersionManager,this.errorHandlers=new Map,this._database=e}addErrorHandler(e,t){const n=(new e).name;this.errorHandlers.set(n,t)}add(e){if(this.tables.has(e))throw new c(`Table "${e}" already added. Reuse the definition.`);const t=new o.default(e,this.versions);return this.tables.set(e,t),t}_getBackingDB(){return this._database}_unsafeGetOrCreateView(e){if(this.views.has(e))return this.views.get(e);const t=this._database.view(e.name,e.rowview,e.shouldEnablePropFilter,e.shouldUseDbMsgEncKeyForEncryptedCol);return this.views.set(e,t),t}_guardInitializedThunk(e){return()=>{if(3&this.state)throw new f("Storage must be initialized before accessing a table!");return e()}}table(e){const t=this.tables.get(e);if(!t)throw new _(`Unknown table ${e} requested, ensure table is defined!`);if(!this._getBackingDB())throw new p(`Unable to find associated database with table "${e}"`);return new a.default(this._guardInitializedThunk((()=>this._unsafeGetOrCreateView(t))),this.errorHandlers)}lock(e,t){if(3&this.state)return Promise.reject(new f("Initialize storage before attempting to lock tables!"));for(let t=0;t<e.length;++t)if(!this.tables.has(e[t]))return Promise.reject(new _(`Requested lock of unknown table "${e[t]}"`));const n=e.map((e=>{const t=this.tables.get(e);if(t)return t;throw new _(`Requested lock of unknown table "${e}"`)})).map((e=>this._unsafeGetOrCreateView(e)));return this._getBackingDB().transact(e,(0,i.default)((function*(){return t(n)}))).finally((()=>{}))}_getUpgraderForCurrentVersion(e,t){for(let n=0;n<e.length;n++)if(e[n].maxVersion===t){const r=e[n].upgraders.get(t);if(r)return{name:e[n].name,callback:r}}}_applyDatabaseVersion(e,t,n){const r=t,i=n.map((e=>e.schema(r))).filter(Boolean);return e.initialize(t,i,this._getUpgraderForCurrentVersion(n,r),this.errorHandlers)}initialize(){var e=this;return(0,i.default)((function*(){if(4&e.state)throw new l("Storage instance has already been initialized");if(e.versions.validate(),!e._database)throw new p(`"${e._database.constructor.name}" failed availability check!`);yield e._database.available();const t=Array.from(e.tables.values()),n=e._getBackingDB();if(t&&n){for(let r=0;r<=e.versions.getMax();r++)yield e._applyDatabaseVersion(n,r,t);yield n.open(),e.state=4}}))()}purge(){return this.state=2,this.views=new Map,this._getBackingDB().reset().then((()=>{}))}}},643163:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.PRIMARY_KEY_TYPE=t.INDEX_TYPE=void 0,t.cloneSchema=function(e){return{name:e.name,columns:e.columns.map((e=>(0,i.default)({},e))),indexes:e.indexes.map(u),encryptedColumns:(0,i.default)({},e.encryptedColumns||{}),deleted:e.deleted}},t.emptySchema=function(e){return{name:e,columns:[],indexes:[],encryptedColumns:{}}},t.findIndex=function(e,t){return e.indexes.findIndex((e=>function(e,t){if(e.type!==t.type)return!1;switch(e.type){case s.SIMPLE:case s.ARRAY:case s.UNIQUE:return(0,a.default)(t.type===e.type,"Index types are not equal"),e.column===t.column;case s.COMPOSITE:return(0,a.default)(t.type===e.type,"Index types are not equal"),e.columns.length===t.columns.length&&!e.columns.some((e=>!t.columns.includes(e)))}throw new Error(`cannot compare unknown indexes of types: ${e.type}, ${t.type}`)}(t,e)))},t.freezeSchema=function(e){return Object.freeze({name:e.name,columns:Object.freeze(e.columns.map(Object.freeze)),indexes:Object.freeze(e.indexes.map(l)),encryptedColumns:Object.freeze((0,i.default)({},e.encryptedColumns||{})),deleted:e.deleted})},t.indexContainsColumn=function(e,t){switch(e.type){case s.SIMPLE:case s.ARRAY:case s.UNIQUE:return e.column===t;case s.COMPOSITE:return!!e.columns.find((e=>e===t))}throw new Error(`cannot check indexes of unknown index type: ${e.type}`)};var i=r(n(81109)),a=r(n(441143));const o=Object.freeze({AUTO_INCREMENT:"auto-increment",USER_DEFINED:"user-defined",COMPOSITE:"composite"});t.PRIMARY_KEY_TYPE=o;const s=Object.freeze({SIMPLE:"simple",COMPOSITE:"composite",ARRAY:"array",UNIQUE:"unique"});function l(e){switch(e.type){case s.SIMPLE:return Object.freeze({type:s.SIMPLE,column:e.column});case s.ARRAY:return Object.freeze({type:s.ARRAY,column:e.column});case s.COMPOSITE:return Object.freeze({type:s.COMPOSITE,columns:Object.freeze(e.columns.map(Object.freeze))});case s.UNIQUE:return Object.freeze({type:s.UNIQUE,column:e.column})}throw new Error(`cannot freeze index of unknown type: ${e.type}`)}function u(e){switch(e.type){case s.SIMPLE:return{type:s.SIMPLE,column:e.column};case s.UNIQUE:return{type:s.UNIQUE,column:e.column};case s.COMPOSITE:return{type:s.COMPOSITE,columns:e.columns.map((e=>e))};case s.ARRAY:return{type:s.ARRAY,column:e.column}}throw new Error(`cannot clone unknown index type: ${e.type}`)}t.INDEX_TYPE=s},559351:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(81109)),a=n(882180),o=n(643163),s=r(n(441143));function l(e){return e}t.default=class{constructor(e,t){this.maxVersion=-1,this.versions=new Map,this.upgraders=new Map,this.shouldEnablePropFilter=!0,this.shouldUseDbMsgEncKeyForEncryptedCol=!1,this.name=e,this.versionManager=t}version(e,t,n){this.versionManager.claim(e),(0,s.default)(!this.versions.has(e),`Table "${this.name}" already has version #${+e} defined!`),(0,s.default)(e>this.maxVersion,`Versions for table ${this.name} must be defined in order`),this.maxVersion=e;const r=this.schema(e)||(0,o.emptySchema)(this.name),i=(0,a.sortMutations)(t).reduce(((e,t)=>(t.validate(e),t.apply(e))),(0,o.cloneSchema)(r));return this.versions.set(e,(0,o.freezeSchema)(i)),this.upgraders.set(e,n),this}delete(e){this.versionManager.claim(e),(0,s.default)(!this.versions.has(e),`Table "${this.name}" already has version #${+e} defined!`),(0,s.default)(e>this.maxVersion,`Versions for table ${this.name} must be defined in order`),this.maxVersion=e;const t=this.schema(e)||(0,o.emptySchema)(this.name),n=(0,i.default)((0,i.default)({},t),{},{deleted:!0});return this.versions.set(e,(0,o.freezeSchema)(n)),this}view(e){return this.rowview=e,this}enablePropFilter(e){return this.shouldEnablePropFilter=e,this}useDbMsgEncKeyForEncryptedCol(e){return this.shouldUseDbMsgEncKeyForEncryptedCol=e,this}schema(e){const t=this.versions.get(e);if(t)return t;const n=Array.from(this.versions.keys()).map(l).sort(((e,t)=>e-t)).filter((t=>t<e)).pop();return n||0===n?this.versions.get(n)||(0,o.emptySchema)(this.name):null}}},214578:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StorageVersionManager=t.MissingVersionError=t.InvalidVersionError=t.DuplicateVersionError=void 0;class n extends Error{constructor(){super(...arguments),this.name="DuplicateVersionError"}}t.DuplicateVersionError=n;class r extends Error{constructor(){super(...arguments),this.name="InvalidVersionError"}}t.InvalidVersionError=r;class i extends Error{constructor(){super(...arguments),this.name="MissingVersionError"}}t.MissingVersionError=i;t.StorageVersionManager=class{constructor(){this.versions=new Set,this._max=-1}claim(e){if(e<0)throw new r("Versions must by greater than or equal to zero!");if(this.versions.has(e))throw new n(`Version #${e} has already been claimed!`);this.versions.add(e),this._max=Math.max(this.getMax(),e)}version(e){if(e<0)throw new r("Versions must by greater than or equal to zero!");return e}validate(){for(let e=0;e<=this.getMax();++e)if(!this.versions.has(e))throw new i(`Schema version #${e} is missing!`)}getMax(){return this._max}}},844800:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(348926)),a=r(n(132375)),o=n(652568),s=n(436005),l=n(273624),u=n(345632),c=n(643163),d=r(n(986128)),p=r(n(441143));function _(){return(_=(0,i.default)((function*(e,t,n,r){if(!s.DbEncKeyStore)throw new Error("feature is not yet implemented");const i=r?s.DbEncKeyStore.getDbMsgEncKeys():s.DbEncKeyStore.getEncKeys(),a=i[i.length-1],o=new Uint8Array(16);self.crypto.getRandomValues(o);const c=n===u.ENCRYPTED_VALUE_TYPE.STRING?(new TextEncoder).encode(e):e;try{const e=self.crypto.subtle.encrypt({iv:o,name:s.DB_ENCRYPTION_CIPHER},a.key,c),t=null==d.default.currentTransaction?e:d.default.waitFor(e);return{_data:yield(0,l.dexieCastToPromise)(t),iv:o,_keyId:a.id}}catch(e){throw T(e,"encryptDbMaterial",null),e}}))).apply(this,arguments)}function f(){return(f=(0,i.default)((function*(e,t,n,r){if(!s.DbEncKeyStore)throw new Error("feature is not yet implemented");const{_data:i,iv:a,_keyId:o}=e,c=r?s.DbEncKeyStore.getDbMsgEncKeys().filter((e=>e.id===o))[0]:s.DbEncKeyStore.getEncKeys().filter((e=>e.id===o))[0];if((0,p.default)(null!=c,"Encryption key id not found"),null==i)return i;try{const e=self.crypto.subtle.decrypt({iv:a,name:s.DB_ENCRYPTION_CIPHER},c.key,i),t=null==d.default.currentTransaction?e:d.default.waitFor(e),r=yield(0,l.dexieCastToPromise)(t);return n===u.ENCRYPTED_VALUE_TYPE.STRING?new TextDecoder("utf-8").decode(r):r}catch(e){throw T(e,"decryptDbMaterial",null),e}}))).apply(this,arguments)}d.default.Promise.PSD.onunhandled=()=>{},d.default.Promise.PSD.txRelaxedDurabilityEnabled=!0;class h{constructor(e,t,n,r,i,a){this.table=e,this.view=n,this.db=t,this.propFilter=r,this.tableEncryptedColumns=new Map(Object.keys(i).map((e=>[e,i[e]]))),this.shouldUseDbMsgEncKeyForEncryptedCol=a}asyncView(e){var t=this;let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(0,i.default)((function*(){if(!t._hasEncryptedColumn()||!n)return t.view(e);const r=yield t._decryptColumns(e);return t.view(r)}))()}_decryptColumns(e){var t=this;return(0,i.default)((function*(){(0,p.default)("object"==typeof e,"Called `_decryptColumns` with primitive value");const n=Array.from(t.tableEncryptedColumns.entries()).map((n=>{let[r,i]=n;const a=e[r];return(null==a?void 0:a._data)&&(null==a?void 0:a.iv)?function(){return f.apply(this,arguments)}(a,r,i,t.shouldUseDbMsgEncKeyForEncryptedCol).then((t=>{e[r]=t})):a}));return yield Promise.all(n),e}))()}_encryptColumns(e){const t=Array.from(this.tableEncryptedColumns.entries()).map((t=>{let[n,r]=t;const i=e[n];return null==i?i:function(){return _.apply(this,arguments)}(i,n,r,this.shouldUseDbMsgEncKeyForEncryptedCol).then((t=>{e[n]=t}))}));return Promise.all(t).then((()=>e))}_addAndEncrypt(e){var t=this;return(0,i.default)((function*(){if(!t._hasEncryptedColumn())return t.table.add(e);const n=yield t._encryptSingleUpdate(e);return t.table.add(n)}))()}_putAndEncrypt(e){var t=this;return(0,i.default)((function*(){if(!t._hasEncryptedColumn())return t.table.put(e);const n=yield t._encryptColumns(e);return t.table.put(n)}))()}_bulkAddAndEncrypt(e){return this._hasEncryptedColumn()?this._encryptBulkUpdates(e).then((e=>this.table.bulkAdd(e))):this.table.bulkAdd(e)}_bulkPutAndEncrypt(e){return this._hasEncryptedColumn()?d.default.waitFor(this._encryptBulkUpdates(e)).then((e=>this.table.bulkPut(e))):this.table.bulkPut(e)}_encryptBulkUpdates(e){if(!this._hasEncryptedColumn())return Promise.resolve(e);const t=[],n=e.map(((e,n)=>this._encryptColumns(e).then((e=>{t[n]=e}))));return Promise.all(n).then((()=>t))}_encryptSingleUpdate(e){var t=this;return(0,i.default)((function*(){if(!t._hasEncryptedColumn())return e;return yield t._encryptColumns(e)}))()}asyncViewMap(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this._hasEncryptedColumn()||!t)return Promise.resolve(e.map((e=>e?this.view(e):null)));const n=e.map((e=>null!=e?this.asyncView(e):Promise.resolve(null)));return(0,l.dexieCastToPromise)(null==d.default.currentTransaction?Promise.all(n):d.default.waitFor(Promise.all(n)))}preflightEncryptSingleRecord(e){return this.tableEncryptedColumns,Object.keys(e).forEach((t=>{this.tableEncryptedColumns.has(t)||delete e[t]})),this._encryptColumns(e)}postflightDecryptSingleRecord(e){var t=this;return(0,i.default)((function*(){const n=yield t._decryptColumns(e);return t.view(n)}))()}bulkCreateWith_ALREADY_ENCRYPTED_RECORDS_ONLY(e){return 0===e.length?(0,l.dexieCastToPromise)():(v(e,this.tableEncryptedColumns),(0,l.dexieCastToPromise)(this.table.bulkAdd(e)).catch((e=>{throw T(e,"bulkCreateWith_ALREADY_ENCRYPTED_RECORDS_ONLY",this.table.name),e})))}bulkCreateOrReplace_ALREADY_ENCRYPTED_RECORDS_ONLY(e){return 0===e.length?(0,l.dexieCastToPromise)():(v(e,this.tableEncryptedColumns),(0,l.dexieCastToPromise)(this.table.bulkPut(e)).catch((e=>{throw T(e,"bulkCreateOrReplace",this.table.name),e})))}create(e){const t=this.propFilter(e);return(0,l.dexieCastToPromise)(this._addAndEncrypt(t)).catch((e=>{throw T(e,"create",this.table.name),e}))}createOrReplace(e){const t=this.propFilter(e);return(0,l.dexieCastToPromise)(this._putAndEncrypt(t)).catch((e=>{throw T(e,"createOrReplace",this.table.name),e}))}createOrMerge(e,t){var n=this;return(0,i.default)((function*(){const r=n.propFilter(t),i=yield n._encryptColumns(r);return(0,l.dexieCastToPromise)(n.db.transaction("rw",n.table,(()=>n.table.where(":id").equals(e).modify((e=>{Object.assign(e,i)})).then((e=>{if(1!==e)return n.table.add(i)})))).then((()=>{}))).catch((e=>{throw T(e,"createOrMerge",n.table.name),e}))}))()}get(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return(0,l.dexieCastToPromise)(this.table.get(e)).then((e=>e?this.asyncView(e,t):null)).catch((e=>{throw T(e,"get",this.table.name),e}))}merge(e,t){var n=this;return(0,i.default)((function*(){const r=n.propFilter(t),i=yield n._encryptSingleUpdate(r);try{yield(0,l.dexieCastToPromise)(n.table.update(e,i))}catch(e){throw T(e,"merge",n.table.name),e}}))()}remove(e){var t=this;return(0,i.default)((function*(){try{yield(0,l.dexieCastToPromise)(t.table.delete(e))}catch(e){throw T(e,"remove",t.table.name),e}}))()}bulkCreate(e){if(0===e.length)return(0,l.dexieCastToPromise)();const t=e.map((e=>this.propFilter(e)));return this._hasEncryptedColumn()?(0,l.dexieCastToPromise)(this.db.transaction("rw",this.table,(()=>this._bulkAddAndEncrypt(t)))).catch((e=>{throw T(e,"bulkCreate",this.table.name),e})):(0,l.dexieCastToPromise)(this.table.bulkAdd(t))}bulkCreateOrReplace(e){if(0===e.length)return(0,l.dexieCastToPromise)();const t=e.map((e=>this.propFilter(e)));return this._hasEncryptedColumn()?(0,l.dexieCastToPromise)(this.db.transaction("rw",this.table,(()=>this._bulkPutAndEncrypt(t)))).catch((e=>{throw T(e,"bulkCreateOrReplace",this.table.name),e})):(0,l.dexieCastToPromise)(this.table.bulkPut(t))}bulkCreateOrMerge(e){var t=this;return(0,i.default)((function*(){if(0===e.length)return(0,l.dexieCastToPromise)();const n=new Map,r=t._primaryKey();function a(){return(a=(0,i.default)((function*(e){const n=t.table.where(":id").anyOf(Array.from(e.keys()));yield n.modify((t=>{Object.assign(t,e.get(t[r])),e.delete(t[r])}));return Array.from(e.values())}))).apply(this,arguments)}return(yield t._encryptBulkUpdates(e)).forEach((e=>{const i=t.propFilter(e);(0,p.default)(r in i,"Called `bulkCreateOrMerge` with item(s) not including the primary key"),n.set(i[r],i)})),(0,l.dexieCastToPromise)(t.db.transaction("rw",t.table,(()=>function(){return a.apply(this,arguments)}(n).then((e=>0===e.length?(0,l.dexieCastToPromise)():t.table.bulkPut(e)))))).catch((e=>{throw T(e,"bulkCreateOrMerge",t.table.name),e}))}))()}bulkGet(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return 0===e.length?Promise.resolve([]):(0,l.dexieCastToPromise)(this.db.transaction("r",this.table,(()=>{const t=e.map((e=>this.table.get(e)));return d.default.Promise.all(t)}))).then((e=>this.asyncViewMap(e,t))).catch((e=>{throw T(e,"bulkGet",this.table.name),e}))}bulkRemove(e){return 0===e.length?Promise.resolve():(0,l.dexieCastToPromise)(this.db.transaction("rw",this.table,(()=>this.table.bulkDelete(e)))).catch((e=>{throw T(e,"bulkRemove",this.table.name),e}))}bulkRemoveByIndex(e,t){return 0===t.length?Promise.resolve():(0,l.dexieCastToPromise)(E(this.table.where(y(e)).anyOf(t)).delete()).catch((e=>{throw T(e,"bulkRemoveByIndex",this.table.name),e}))}all(e,t){let n=E(this.table.orderBy((null==e?void 0:e.index)?y(e.index):":id"),e);t&&(n=n.until(t));let r=null;switch(null==e?void 0:e.returnKeyType){case"keys":r=(0,l.dexieCastToPromise)(n.keys());break;case"primary_key":r=(0,l.dexieCastToPromise)(n.primaryKeys());break;default:r=(0,l.dexieCastToPromise)(n.toArray()).then((t=>this.asyncViewMap(t,null==e?void 0:e.shouldDecrypt)))}return r.catch((e=>{throw T(e,"all",this.table.name),e}))}count(){return(0,l.dexieCastToPromise)(this.table.count()).catch((e=>{throw T(e,"count",this.table.name),e}))}bulkDeleteRange(e,t,n,r){return E(this.table.where(y(e)).between(t,n,!!(null==r?void 0:r.lowerInclusive),!!(null==r?void 0:r.upperInclusive)),r).delete().catch((e=>{throw T(e,"bulkDeleteRange",this.table.name),e}))}equals(e,t,n){return(0,l.dexieCastToPromise)(E(this.table.where(y(e)).equals(t),n).toArray()).then((e=>this.asyncViewMap(e,null==n?void 0:n.shouldDecrypt))).catch((e=>{throw T(e,"equals",this.table.name),e}))}anyOf(e,t,n){return 0===t.length?Promise.resolve([]):(0,l.dexieCastToPromise)(E(this.table.where(y(e)).anyOf(t),n).distinct().toArray()).then((e=>this.asyncViewMap(e,null==n?void 0:n.shouldDecrypt))).catch((e=>{throw T(e,"anyOf",this.table.name),e}))}startsWithAnyOf(e,t,n){return 0===t.length?Promise.resolve([]):(0,l.dexieCastToPromise)(E(this.table.where(y(e)).startsWithAnyOf(t),n).distinct().toArray()).then((e=>this.asyncViewMap(e,null==n?void 0:n.shouldDecrypt))).catch((e=>{throw T(e,"startsWithAnyOf",this.table.name),e}))}greaterThan(e,t,n){const r=(null==n?void 0:n.inclusive)?this.table.where(y(e)).aboveOrEqual(t):this.table.where(y(e)).above(t);return(0,l.dexieCastToPromise)(E(r,n).toArray()).then((e=>this.asyncViewMap(e,null==n?void 0:n.shouldDecrypt))).catch((e=>{throw T(e,"greaterThan",this.table.name),e}))}lessThan(e,t,n){const r=(null==n?void 0:n.inclusive)?this.table.where(y(e)).belowOrEqual(t):this.table.where(y(e)).below(t);return(0,l.dexieCastToPromise)(E(r,n).toArray()).then((e=>this.asyncViewMap(e,null==n?void 0:n.shouldDecrypt))).catch((e=>{throw T(e,"lessThan",this.table.name),e}))}between(e,t,n,r,i){const a=E(this.table.where(y(e)).between(t,n,!!(null==r?void 0:r.lowerInclusive),!!(null==r?void 0:r.upperInclusive)),r);let o=null;switch(null==r?void 0:r.returnKeyType){case"keys":o=(0,l.dexieCastToPromise)(a.keys());break;case"primary_key":o=(0,l.dexieCastToPromise)(a.primaryKeys());break;default:o=i?(0,l.dexieCastToPromise)(a.until(i).toArray()).then((e=>this.asyncViewMap(e,null==r?void 0:r.shouldDecrypt))):(0,l.dexieCastToPromise)(a.toArray()).then((e=>this.asyncViewMap(e,null==r?void 0:r.shouldDecrypt)))}return o.catch((e=>{throw T(e,"between",this.table.name),e}))}forEachSortedBy(e,t){var n=this;return this.table.orderBy(e).each(function(){var e=(0,i.default)((function*(e){const r=yield n._decryptColumns(e);return t(r)}));return function(){return e.apply(this,arguments)}}()).catch((e=>{throw T(e,"forEachSortedBy",this.table.name),e}))}forEach(e){var t=this;return this.table.each(function(){var n=(0,i.default)((function*(n){const r=yield t._decryptColumns(n);return e(r)}));return function(){return n.apply(this,arguments)}}()).catch((e=>{throw T(e,"forEach",this.table.name),e}))}clear(){return(0,l.dexieCastToPromise)(this.table.clear()).catch((e=>{throw T(e,"clear",this.table.name),e}))}_primaryKey(){return this.table.schema.primKey.name}_hasEncryptedColumn(){return this.tableEncryptedColumns.size>0}}function g(e){if(e.length>1)return e.forEach((e=>{(0,p.default)(e.primaryKey&&e.primaryKey===c.PRIMARY_KEY_TYPE.COMPOSITE,"Invalid column passed to `formatPrimaryKey`")})),`[${e.map((e=>e.name)).join("+")}]`;const t=e[0];return(0,p.default)(t.primaryKey&&t.primaryKey!==c.PRIMARY_KEY_TYPE.COMPOSITE,"Invalid column passed to `formatPrimaryKey`"),t.primaryKey===c.PRIMARY_KEY_TYPE.AUTO_INCREMENT?`${t.name}++`:t.name}function m(e){switch(e.type){case c.INDEX_TYPE.SIMPLE:return e.column;case c.INDEX_TYPE.COMPOSITE:return`[${e.columns.join("+")}]`;case c.INDEX_TYPE.ARRAY:return`*${e.column}`;case c.INDEX_TYPE.UNIQUE:return`&${e.column}`}throw new Error(`Cannot format index of type "${e.type}"`)}function y(e){return 1===e.length?e[0]:`[${e.join("+")}]`}function E(e,t){let n=e;return(null==t?void 0:t.reverse)&&(n=n.reverse()),t&&null!=t.offset&&(n=n.offset(t.offset)),t&&null!=t.limit&&0!==t.limit&&(n=n.limit(t.limit)),n}function S(e){return Promise.resolve(e)}function T(e,t,n){__LOG__(3,!0)`idb failed to do Operation: ${t} on Table: ${n}. Failed with error ${e}`}function v(e,t){const n=Array.from(t.entries());e.forEach((e=>{n.forEach((t=>{let[n,r]=t;e[n]&&(e[n]._keyId&&e[n]._data&&e[n].iv||__LOG__(2)`[CRITICAL] Records contain unencrypted field`)}))}))}t.default=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:S;this.tableNames=new Map,this.tableColumns=new Map,this.tableEncryptedColumns=new Map,this.errorHandlers=new Map,this.name=e,this.db=new d.default(this.name),this.transformSchema=t}initialize(e,t,n,r){return r&&(this.errorHandlers=r),function(e,t,n,r,i){return(0,o.promiseReduce)(e,((e,a)=>i((0,c.cloneSchema)(a)).then((i=>{if((0,p.default)(!(i.name in e),"Multiple tables resulted in the same transformed name"),i.deleted)return e[i.name]=null,e;t.set(a.name,i.name),n.set(a.name,i.columns.map((e=>e.name))),r.set(a.name,i.encryptedColumns||{});const o=i.columns.filter((e=>e.primaryKey));(0,p.default)(o.length>=1,`No primary key was defined for "${a.name}"`);const s=[g(o)].concat(i.indexes.map(m)).join(", ");return e[i.name]=s,e}))),{})}(t,this.tableNames,this.tableColumns,this.tableEncryptedColumns,this.transformSchema).then((t=>{this.db.version(e+1).stores(t).upgrade((e=>{var t;if(n)return null===(t=e[n.name])||void 0===t?void 0:t.toCollection().modify(n.callback)}))}))}open(){var e=this;return(0,i.default)((function*(){yield(0,l.dexieCastToPromise)(e.db.open())}))()}transact(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rw";return(0,l.dexieCastToPromise)(this.db.transaction(n,e,(()=>t()))).catch((e=>{const t=this.errorHandlers.get(e.name);if(!t)throw e;t(e)}))}close(){return this.db.close(),(0,l.dexieCastToPromise)()}view(e,t,n,r){(0,p.default)(this.tableNames.has(e),`Attemped to get view for uninitialized table "${e}"`),(0,p.default)(this.tableColumns.has(e),`Attemped to get columns for uninitialized table "${e}"`);const i=n?function(e){if(!e)return e=>e;return t=>{const n={};return e.forEach((e=>{t.hasOwnProperty(e)&&(n[e]=t[e])})),n}}(this.tableColumns.get(e)):e=>e;return new h(this.db.table(this.tableNames.get(e)),this.db,t,i,(0,a.default)(this.tableEncryptedColumns.get(e),"this.tableEncryptedColumns.get(table)"),r)}available(){return Promise.resolve(!0)}reset(){return this.tableNames=new Map,(0,l.dexieCastToPromise)(this.db.delete())}}},581216:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(542817)),a=n(288057);t.default=class{constructor(e,t){this.errorHandlers=new Map,this._view=e,t&&(this.errorHandlers=t)}_maybeHandleError(e){const t=this.errorHandlers.get(e.name);t&&t(e)}_read(e){if(i.default.isLogoutInProgress)return Promise.reject(new a.DbOnLogoutAbort("dropping db read operation due to logout"));return e(this._view()).catch((e=>{throw this._maybeHandleError(e),e}))}_write(e){if(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1])&&i.default.isLogoutInProgress)return Promise.reject(new a.DbOnLogoutAbort("dropping db write operation due to logout"));return e(this._view()).catch((e=>{throw this._maybeHandleError(e),e}))}create(e){return this._write((t=>t.create(e)))}preflightEncryptSingleRecord(e){return this._write((t=>t.preflightEncryptSingleRecord(e)),!1,!0)}postflightDecryptSingleRecord(e){return this._write((t=>t.postflightDecryptSingleRecord(e)),!1,!0)}bulkCreateWith_ALREADY_ENCRYPTED_RECORDS_ONLY(e){return this._write((t=>t.bulkCreateWith_ALREADY_ENCRYPTED_RECORDS_ONLY(e)))}bulkCreateOrReplace_ALREADY_ENCRYPTED_RECORDS_ONLY(e){return this._write((t=>t.bulkCreateOrReplace_ALREADY_ENCRYPTED_RECORDS_ONLY(e)))}createOrReplace(e){return this._write((t=>t.createOrReplace(e)))}createOrMerge(e,t){return this._write((n=>n.createOrMerge(e,t)))}get(e){return this._read((t=>t.get(e)))}merge(e,t){return this._write((n=>n.merge(e,t)))}remove(e){return this._write((t=>t.remove(e)))}bulkCreate(e){return this._write((t=>t.bulkCreate(e)))}bulkCreateOrReplace(e){return this._write((t=>t.bulkCreateOrReplace(e)))}bulkCreateOrMerge(e){return this._write((t=>t.bulkCreateOrMerge(e)))}bulkGet(e,t){return this._read((n=>n.bulkGet(e,t)))}bulkRemoveByIndex(e,t){return this._write((n=>n.bulkRemoveByIndex(e,t)))}bulkRemove(e){return this._write((t=>t.bulkRemove(e)))}bulkDeleteRange(e,t,n){return this._write((r=>r.bulkDeleteRange(e,t,n)))}all(e,t){return this._read((n=>n.all(e,t)))}count(){return this._read((e=>e.count()))}equals(e,t,n){return this._read((r=>r.equals(e,t,n)))}anyOf(e,t,n){return this._read((r=>r.anyOf(e,t,n)))}startsWithAnyOf(e,t,n){return this._read((r=>r.startsWithAnyOf(e,t,n)))}greaterThan(e,t,n){return this._read((r=>r.greaterThan(e,t,n)))}lessThan(e,t,n){return this._read((r=>r.lessThan(e,t,n)))}between(e,t,n,r,i){return this._read((a=>a.between(e,t,n,r,i)))}forEachSortedBy(e,t){return this._read((n=>n.forEachSortedBy(e,t)))}forEach(e){return this._read((t=>t.forEach(e)))}clear(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._write((e=>e.clear()),e)}}},790248:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(158275)),a=r(n(441143));class o extends i.default{constructor(e){super(),(0,a.default)("AbstractPrimaryKey"!==this.constructor.name,"Cannot instantiate abstract class AbstractPrimaryKey"),Array.isArray(e)?this.columns=[...e]:this.columns=[e]}validate(e){(0,a.default)(0===e.columns.length,"Attempted to add primary key after other columns")}apply(){throw new Error("Subclass of `AbstractPrimaryKey` must implement `apply` method")}}t.default=o},227209:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(158275)),a=n(643163),o=r(n(441143));class s extends i.default{constructor(e){super(),this.column=e}validate(e){const t=e.columns.find((e=>e.name===this.column));(0,o.default)(t,`Attempted to add index on non-existent column "${this.column}" in "${e.name}"`),(0,o.default)(t&&(!t.primaryKey||t.primaryKey===a.PRIMARY_KEY_TYPE.COMPOSITE),`Cannot add index on primary key on table "${e.name}"`),(0,o.default)(!e.indexes.some((e=>(e.type===a.INDEX_TYPE.ARRAY||e.type===a.INDEX_TYPE.SIMPLE||e.type===a.INDEX_TYPE.UNIQUE)&&(0,a.indexContainsColumn)(e,this.column))),`Attempted to add index "${this.column}" which already exists in "${e.name}"`)}apply(e){const t=(0,a.cloneSchema)(e);return t.indexes.push(this._getIndex()),t}_getIndex(){return{type:a.INDEX_TYPE.ARRAY,column:this.column}}}t.default=s},372407:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(158275)),a=n(643163),o=r(n(441143));class s extends i.default{constructor(e){super(),this.name=e}validate(e){(0,o.default)(!e.columns.find((e=>e.name===this.name)),`Attempted to add column "${this.name}" to "${e.name}" but it already exists`)}apply(e){const t=(0,a.cloneSchema)(e);return t.columns.push({name:this.name}),t}}t.default=s},974622:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(158275)),a=n(643163),o=r(n(441143));class s extends i.default{constructor(e){super(),this.columns=[...e]}validate(e){this.columns.forEach((t=>{(0,o.default)(e.columns.find((e=>e.name===t)),`Attempted to add index on non-existent column "${t}" in "${e.name}"`)})),(0,o.default)(this.columns.length>1,"Attempted to add composite index for only 1 column"),(0,o.default)(-1===(0,a.findIndex)(e,this._getIndex()),`Attempted to add index [${String(this.columns)}], which already exists in "${e.name}"`);const t=e.columns.filter((e=>e.primaryKey&&e.primaryKey===a.PRIMARY_KEY_TYPE.COMPOSITE)).map((e=>e.name));(0,o.default)(t.length!==this.columns.length||t.some((e=>!this.columns.includes(e))),`Attempted to add index [${String(this.columns)}], which already is the primary key in "${e.name}"`)}apply(e){const t=(0,a.cloneSchema)(e);return t.indexes.push(this._getIndex()),t}_getIndex(){return{type:a.INDEX_TYPE.COMPOSITE,columns:this.columns}}}t.default=s},345632:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ENCRYPTED_VALUE_TYPE=t.AddEncryptedColumn=void 0;var i=r(n(158275)),a=n(643163),o=r(n(441143));const s=Object.freeze({STRING:"String",ARRAY_BUFFER:"ArrayBuffer"});t.ENCRYPTED_VALUE_TYPE=s;class l extends i.default{constructor(e,t){super(),this.name=e,this.dataType=t}validate(e){(0,o.default)(!e.columns.find((e=>e.name===this.name)),`Attempted to add encrypted column "${this.name}" to "${e.name}" but it already exists`)}apply(e){const t=(0,a.cloneSchema)(e);return t.columns.push({name:this.name}),t.encryptedColumns[this.name]=this.dataType,t}}t.AddEncryptedColumn=l},599395:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(158275)),a=n(643163),o=r(n(441143));class s extends i.default{constructor(e){super(),this.keyPath=e,this.column=e.split(".")[0]}validate(e){const t=e.columns.find((e=>e.name===this.column));(0,o.default)(t,`Attempted to add index on non-existent column "${this.column}" in "${e.name}"`),(0,o.default)(t&&(!t.primaryKey||t.primaryKey===a.PRIMARY_KEY_TYPE.COMPOSITE),`Cannot add index on primary key on table "${e.name}"`),(0,o.default)(!e.indexes.some((e=>(e.type===a.INDEX_TYPE.ARRAY||e.type===a.INDEX_TYPE.SIMPLE||e.type===a.INDEX_TYPE.UNIQUE)&&(0,a.indexContainsColumn)(e,this.column))),`Attempted to add index "${this.column}" which already exists in "${e.name}"`)}apply(e){const t=(0,a.cloneSchema)(e);return t.indexes.push(this._getIndex()),t}_getIndex(){return{type:a.INDEX_TYPE.SIMPLE,column:this.keyPath}}}t.default=s},277309:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(158275)),a=n(643163),o=r(n(441143));class s extends i.default{constructor(e){super(),this.column=e}validate(e){const t=e.columns.find((e=>e.name===this.column));(0,o.default)(t,`Attempted to add index on non-existent column "${this.column}" in "${e.name}"`),(0,o.default)(t&&(!t.primaryKey||t.primaryKey===a.PRIMARY_KEY_TYPE.COMPOSITE),`Cannot add index on primary key on table "${e.name}"`),(0,o.default)(!e.indexes.some((e=>(e.type===a.INDEX_TYPE.ARRAY||e.type===a.INDEX_TYPE.SIMPLE||e.type===a.INDEX_TYPE.UNIQUE)&&(0,a.indexContainsColumn)(e,this.column))),`Attempted to add index "${this.column}" which already exists in "${e.name}"`)}apply(e){const t=(0,a.cloneSchema)(e);return t.indexes.push(this._getIndex()),t}_getIndex(){return{type:a.INDEX_TYPE.UNIQUE,column:this.column}}}t.default=s},172581:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(790248)),a=n(643163),o=r(n(441143));class s extends i.default{validate(e){super.validate(e),(0,o.default)(this.columns&&1===this.columns.length,"Attempted to add UserDefinedPrimaryKey over wrong number of columns")}apply(e){const t=(0,a.cloneSchema)(e);return t.columns.unshift({name:this.columns[0],primaryKey:a.PRIMARY_KEY_TYPE.AUTO_INCREMENT}),t}}t.default=s},277631:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(790248)),a=n(643163),o=r(n(441143));class s extends i.default{validate(e){super.validate(e),(0,o.default)(this.columns&&this.columns.length>1,"Attempted to add composite primary key for only 1 column")}apply(e){const t=(0,a.cloneSchema)(e);return this.columns.forEach((e=>{t.columns.push({name:e,primaryKey:a.PRIMARY_KEY_TYPE.COMPOSITE})})),t}}t.default=s},158275:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(441143));t.default=class{constructor(){(0,i.default)("Mutation"!==this.constructor.name,"Cannot instantiate abstract class Mutation")}validate(){throw new Error("Subclasses of Mutaton must implement `validate`")}apply(){throw new Error("Subclasses of Mutaton must implement `apply`")}}},882180:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.sortMutations=function(e){return[...e].sort(E)};var i=r(n(227209)),a=r(n(372407)),o=r(n(974622)),s=n(345632),l=r(n(599395)),u=r(n(277309)),c=r(n(172581)),d=r(n(277631)),p=r(n(24880)),_=r(n(482078)),f=r(n(726441)),h=r(n(614604)),g=r(n(874712)),m=r(n(441143));const y=[f.default,p.default,h.default,_.default,c.default,g.default,d.default,a.default,l.default,i.default,o.default,u.default,s.AddEncryptedColumn];function E(e,t){const n=y.indexOf(e.constructor),r=y.indexOf(t.constructor);return(0,m.default)(-1!==n,`Mutation ${e.constructor.name} is not a known mutation type`),(0,m.default)(-1!==r,`Mutation ${e.constructor.name} is not a known mutation type`),n-r}},24880:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(158275)),a=n(643163),o=r(n(441143));class s extends i.default{constructor(e){super(),this.column=e}validate(e){(0,o.default)(-1!==(0,a.findIndex)(e,this._getIndex()),`Attempted to remove non-existent index "${this.column}" on "${e.name}"`)}apply(e){const t=(0,a.cloneSchema)(e),n=(0,a.findIndex)(e,this._getIndex());return t.indexes.splice(n,1),t}_getIndex(){return{type:a.INDEX_TYPE.ARRAY,column:this.column}}}t.default=s},482078:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(158275)),a=n(643163),o=r(n(441143));class s extends i.default{constructor(e){super(),this.name=e}validate(e){const t=e.columns.find((e=>e.name===this.name));(0,o.default)(t,`Attempted to remove column "${this.name}" from "${e.name}" but it doesn't exist`),(0,o.default)(!t.primaryKey,`Attempted to remove primary key column "${this.name}". Removing primary keys is not supported.`),(0,o.default)(!e.indexes.some((e=>(0,a.indexContainsColumn)(e,this.name))),`Attempted to remove column "${this.name}" from "${e.name}" but an index exists with the column`)}apply(e){const t=(0,a.cloneSchema)(e);return t.columns.splice(t.columns.findIndex((e=>e.name===this.name)),1),t}}t.default=s},726441:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(158275)),a=n(643163),o=r(n(441143));class s extends i.default{constructor(e){super(),this.columns=[...e].sort()}validate(e){(0,o.default)(-1!==(0,a.findIndex)(e,this._getIndex()),`Attempted to remove non-existent index [${String(this.columns)}] on "${e.name}"`)}apply(e){const t=(0,a.cloneSchema)(e),n=(0,a.findIndex)(e,this._getIndex());return t.indexes.splice(n,1),t}_getIndex(){return{type:a.INDEX_TYPE.COMPOSITE,columns:this.columns}}}t.default=s},614604:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(158275)),a=n(643163),o=r(n(441143));class s extends i.default{constructor(e){super(),this.column=e}validate(e){(0,o.default)(-1!==(0,a.findIndex)(e,this._getIndex()),`Attempted to remove non-existent index "${this.column}" on "${e.name}"`)}apply(e){const t=(0,a.cloneSchema)(e),n=(0,a.findIndex)(e,this._getIndex());return t.indexes.splice(n,1),t}_getIndex(){return{type:a.INDEX_TYPE.SIMPLE,column:this.column}}}t.default=s},874712:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(790248)),a=n(643163),o=r(n(441143));class s extends i.default{validate(e){super.validate(e),(0,o.default)(this.columns&&1===this.columns.length,"Attempted to add UserDefinedPrimaryKey over wrong number of columns")}apply(e){const t=(0,a.cloneSchema)(e);return t.columns.unshift({name:this.columns[0],primaryKey:a.PRIMARY_KEY_TYPE.USER_DEFINED}),t}}t.default=s},190335:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.initialize=void 0;var i=r(n(751463)),a=n(636152);const o=(0,i.default)((()=>(0,a.getStorage)().initialize()));t.initialize=o},636152:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DATABASE_NAME=void 0,t.createStorage=p,t.destroyStorage=function(){return _.apply(this,arguments)},t.getStorage=function(){return(0,u.default)(null!=d,"[lru-media-storage-idb] Storage should be created first before being accessed"),d};var i=r(n(348926)),a=r(n(844800)),o=n(408286),s=n(355701),l=r(n(986128)),u=r(n(441143));const c="lru-media-storage-idb";t.DATABASE_NAME=c;let d=null;function p(){const e=new a.default(c);d=new o.Storage(e),d.addErrorHandler(l.default.AbortError,(e=>{e.message.includes("QuotaExceededError")&&s.StorageCmd.trigger("storage_not_enough_space")}))}function _(){return(_=(0,i.default)((function*(){if(null==d)throw new Error("[lru-media-storage-idb] Storage should be created first before being destroyed");try{yield d.purge()}finally{d=null}}))).apply(this,arguments)}p()},732075:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.storePrimaryIndex=t.storeDataIndex=t.IdbArrayBufferTable=void 0;var i=n(636152),a=r(n(372407)),o=r(n(874712));const s="id";t.storePrimaryIndex=s;const l="data";t.storeDataIndex=l;const u="lru-media-array-buffer";(0,i.getStorage)().add(u).version((0,i.getStorage)().versions.version(0),[new o.default(s),new a.default(l)]).view((e=>({id:e.id,data:e.data})));const c=(0,i.getStorage)().table(u);t.IdbArrayBufferTable=c},581692:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.metaInfoSizeIndex=t.metaInfoPrimaryIndex=t.metaInfoDateIndex=t.IdbMetaInfoTable=void 0;var i=n(636152),a=r(n(372407)),o=r(n(599395)),s=r(n(874712));t.metaInfoPrimaryIndex="id";const l="timestamp";t.metaInfoDateIndex=l;const u="size";t.metaInfoSizeIndex=u;const c="lru-media-meta-info";(0,i.getStorage)().add(c).version((0,i.getStorage)().versions.version(1),[new s.default("id"),new a.default(l),new o.default(l)]).version((0,i.getStorage)().versions.version(2),[new a.default(u)]).view((e=>({id:e.id,timestamp:e.timestamp,size:e.size||0})));const d=(0,i.getStorage)().table(c);t.IdbMetaInfoTable=d},76469:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={initialize:!0};t.initialize=function(){return(0,i.initializeWithoutGKs)()};var i=n(749118);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(r,e)||e in t&&t[e]===i[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}}))}))},749118:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.clearInitializePromise=function(){ae=null},t.destroy=function(){return(0,a.destroyStorage)().catch((()=>(0,i.dexieCastToPromise)(new ie.default(a.DATABASE_NAME).delete()))).finally((()=>{ae=null}))},Object.defineProperty(t,"getABPropConfigsTable",{enumerable:!0,get:function(){return s.getTable}}),Object.defineProperty(t,"getActiveMessageRangesTable",{enumerable:!0,get:function(){return l.getTable}}),Object.defineProperty(t,"getAgentTable",{enumerable:!0,get:function(){return u.getTable}}),Object.defineProperty(t,"getBlocklistTable",{enumerable:!0,get:function(){return c.getTable}}),Object.defineProperty(t,"getCartTable",{enumerable:!0,get:function(){return d.getTable}}),Object.defineProperty(t,"getChatTable",{enumerable:!0,get:function(){return p.getTable}}),Object.defineProperty(t,"getCollectionVersionTable",{enumerable:!0,get:function(){return h.getTable}}),Object.defineProperty(t,"getContactTable",{enumerable:!0,get:function(){return g.getTable}}),Object.defineProperty(t,"getDeviceListTable",{enumerable:!0,get:function(){return m.getTable}}),Object.defineProperty(t,"getDirectConnectionKeysTable",{enumerable:!0,get:function(){return y.getTable}}),Object.defineProperty(t,"getEncryptedMutationsTable",{enumerable:!0,get:function(){return E.getTable}}),Object.defineProperty(t,"getFavoriteStickersTable",{enumerable:!0,get:function(){return S.getTable}}),Object.defineProperty(t,"getFtsIndexingQueueTable",{enumerable:!0,get:function(){return T.getTable}}),Object.defineProperty(t,"getGroupInviteV4Table",{enumerable:!0,get:function(){return v.getTable}}),Object.defineProperty(t,"getGroupMetadataTable",{enumerable:!0,get:function(){return A.getTable}}),Object.defineProperty(t,"getHistorySyncNotificationTable",{enumerable:!0,get:function(){return C.getTable}}),Object.defineProperty(t,"getInactiveReceiptTable",{enumerable:!0,get:function(){return P.getTable}}),Object.defineProperty(t,"getLabelAssociationTable",{enumerable:!0,get:function(){return I.getTable}}),Object.defineProperty(t,"getLabelTable",{enumerable:!0,get:function(){return O.getTable}}),Object.defineProperty(t,"getMembershipApprovalRequestTable",{enumerable:!0,get:function(){return N.getTable}}),Object.defineProperty(t,"getMessageHistoryTable",{enumerable:!0,get:function(){return L.getTable}}),Object.defineProperty(t,"getMessageOrphansTable",{enumerable:!0,get:function(){return k.getTable}}),Object.defineProperty(t,"getMessageTable",{enumerable:!0,get:function(){return w.getTable}}),Object.defineProperty(t,"getMissingKeysTable",{enumerable:!0,get:function(){return U.getTable}}),Object.defineProperty(t,"getMsgInfoTable",{enumerable:!0,get:function(){return D.getTable}}),Object.defineProperty(t,"getNonMessageDataRequestTable",{enumerable:!0,get:function(){return G.getTable}}),Object.defineProperty(t,"getOrphanPaymentNotificationTable",{enumerable:!0,get:function(){return x.getTable}}),Object.defineProperty(t,"getOrphanReceiptTable",{enumerable:!0,get:function(){return B.getTable}}),Object.defineProperty(t,"getOrphanRevokeTable",{enumerable:!0,get:function(){return F.getTable}}),Object.defineProperty(t,"getOrphanTcTokenTable",{enumerable:!0,get:function(){return j.getTable}}),Object.defineProperty(t,"getParticipantTable",{enumerable:!0,get:function(){return Y.getTable}}),Object.defineProperty(t,"getPeerMessageTable",{enumerable:!0,get:function(){return H.getTable}}),Object.defineProperty(t,"getPendingMutationsTable",{enumerable:!0,get:function(){return W.getTable}}),Object.defineProperty(t,"getPollVotesTable",{enumerable:!0,get:function(){return o.getTable}}),Object.defineProperty(t,"getPrivacyDisallowedListTable",{enumerable:!0,get:function(){return V.getTable}}),Object.defineProperty(t,"getProfilePicThumbTable",{enumerable:!0,get:function(){return $.getTable}}),Object.defineProperty(t,"getQuickReplyTable",{enumerable:!0,get:function(){return z.getTable}}),Object.defineProperty(t,"getReactionsTable",{enumerable:!0,get:function(){return q.getTable}}),Object.defineProperty(t,"getRecentStickersTable",{enumerable:!0,get:function(){return J.getTable}}),Object.defineProperty(t,"getSyncActionsTable",{enumerable:!0,get:function(){return X.getTable}}),Object.defineProperty(t,"getSyncKeysTable",{enumerable:!0,get:function(){return Z.getTable}}),Object.defineProperty(t,"getTasksScheduledTimeTable",{enumerable:!0,get:function(){return ee.getTable}}),Object.defineProperty(t,"getVerifiedBusinessNameTable",{enumerable:!0,get:function(){return re.getTable}}),t.initializeWithoutGKs=function(){null==ae&&((0,a.createStorage)(),(0,s.addTable)(),(0,l.addTable)(),(0,u.addTable)(),(0,c.addTable)(),(0,d.addTable)(),(0,p.addTable)(),(0,_.addTable)(),(0,f.addTable)(),(0,h.addTable)(),(0,g.addTable)(),(0,m.addTable)(),(0,y.addTable)(),(0,E.addTable)(),(0,S.addTable)(),(0,T.addTable)(),(0,v.addTable)(),(0,A.addTable)(),(0,C.addTable)(),(0,P.addTable)(),(0,I.addTable)(),(0,O.addTable)(),(0,b.addTable)(),(0,R.addTable)(),(0,M.addTable)(),(0,w.addTable)(),(0,L.addTable)(),(0,U.addTable)(),(0,D.addTable)(),(0,x.addTable)(),(0,B.addTable)(),(0,F.addTable)(),(0,j.addTable)(),(0,Y.addTable)(),(0,K.addTable)(),(0,H.addTable)(),(0,W.addTable)(),(0,o.addTable)(),(0,V.addTable)(),(0,$.addTable)(),(0,z.addTable)(),(0,q.addTable)(),(0,J.addTable)(),(0,Q.addTable)(),(0,X.addTable)(),(0,Z.addTable)(),(0,ee.addTable)(),(0,te.addTable)(),(0,ne.addTable)(),(0,re.addTable)(),(0,k.addTable)(),(0,N.addTable)(),(0,G.addTable)(),ae=(0,a.getStorage)().initialize().catch((e=>{throw __LOG__(4,!0,new Error,!0)`Assertion failed!`,SEND_LOGS("Failed to initialize model storage"),e})));return ae};var i=n(273624),a=n(605316),o=n(816990),s=n(427138),l=n(574017),u=n(402593),c=n(287844),d=n(950242),p=n(76085),_=n(936771),f=n(873762),h=n(396033),g=n(490474),m=n(88134),y=n(55519),E=n(396399),S=n(699070),T=n(558249),v=n(968574),A=n(126092),C=n(607585),P=n(517066),O=n(187411),I=n(294715),M=n(640322),b=n(594014),R=n(257678),N=n(49970),w=n(121260),L=n(572837),D=n(719438),k=n(467862),U=n(536884),G=n(320493),x=n(609910),B=n(302213),F=n(428557),j=n(414015),Y=n(443421),K=n(417917),H=n(131020),W=n(257383),V=n(572768),$=n(391967),z=n(949135),q=n(237),J=n(235513),Q=n(651308),X=n(516934),Z=n(732367),ee=n(448855),te=n(484187),ne=n(766488),re=n(646240),ie=r(n(986128));let ae},605316:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DATABASE_NAME=void 0,t.createStorage=function(){const e=new i.default(u);c=new a.Storage(e),c.addErrorHandler(s.default.AbortError,(e=>{e.message.includes("QuotaExceededError")&&o.StorageCmd.trigger("storage_not_enough_space")}))},t.destroyStorage=function(){if(null==c)return Promise.reject(new Error("[model-storage] Storage should be created first before being destroyed"));return c.purge().then((()=>{c=null})).catch((e=>{throw c=null,e}))},t.getStorage=function(){return(0,l.default)(null!=c,"[model-storage] Storage should be created first before being accessed"),c};var i=r(n(844800)),a=n(408286),o=n(355701),s=r(n(986128)),l=r(n(441143));const u="model-storage";t.DATABASE_NAME=u;let c=null},526456:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.abpropsConfigCreateTable=function(){return(0,r.getStorage)().versions.version(19)},t.activeMessageRangesCreateTable=function(){return(0,r.getStorage)().versions.version(23)},t.addActionToPendingMutations=function(){return(0,r.getStorage)().versions.version(48)},t.addArchiveAtMentionViewedInDrawer=function(){return(0,r.getStorage)().versions.version(61)},t.addChatThreadLoggingTable=function(){return(0,r.getStorage)().versions.version(78)},t.addCommunityAdminPromotionColumns=function(){return(0,r.getStorage)().versions.version(88)},t.addGroupFromKeyToGroupInviteV4=function(){return(0,r.getStorage)().versions.version(55)},t.addHasAccessedToAbpropsConfigTable=function(){return(0,r.getStorage)().versions.version(77)},t.addIncognitoGroupMetadataColumn=function(){return(0,r.getStorage)().versions.version(100)},t.addReactionTableMsgKeyIndex=function(){return(0,r.getStorage)().versions.version(75)},t.addReactionTableOrphanIndex=function(){return(0,r.getStorage)().versions.version(71)},t.addRequiresDirectConnection=function(){return(0,r.getStorage)().versions.version(63)},t.addStaticURLToImageVideoMessages=function(){return(0,r.getStorage)().versions.version(60)},t.addStatusPSACampaignFields=function(){return(0,r.getStorage)().versions.version(65)},t.addSupportForHSMButtons=function(){return(0,r.getStorage)().versions.version(46)},t.addTcTokenSenderTimestampToChatTable=function(){return(0,r.getStorage)().versions.version(62)},t.addTcTokenTimestampToChatTable=function(){return(0,r.getStorage)().versions.version(57)},t.addTcTokenToChatTable=function(){return(0,r.getStorage)().versions.version(56)},t.addUnreadMentionCountToChatTable=function(){return(0,r.getStorage)().versions.version(51)},t.addUnreadMentionToChatTable=function(){return(0,r.getStorage)().versions.version(44)},t.addWaveformToAudioMessages=function(){return(0,r.getStorage)().versions.version(50)},t.agentCreateTable=function(){return(0,r.getStorage)().versions.version(82)},t.blocklistCreateTable=function(){return(0,r.getStorage)().versions.version(4)},t.cartCreateTable=function(){return(0,r.getStorage)().versions.version(25)},t.chatAddDisappearingModeInitiator=function(){return(0,r.getStorage)().versions.version(36)},t.chatAssignmentCreateTable=function(){return(0,r.getStorage)().versions.version(103)},t.chatCreateTable=function(){return(0,r.getStorage)().versions.version(6)},t.collectionVersionCreateTable=function(){return(0,r.getStorage)().versions.version(1)},t.contactAddDisappearingModeProperties=function(){return(0,r.getStorage)().versions.version(35)},t.contactAddHash=function(){return(0,r.getStorage)().versions.version(105)},t.contactAddIsContactSyncCompleted=function(){return(0,r.getStorage)().versions.version(28)},t.contactCreateTable=function(){return(0,r.getStorage)().versions.version(3)},t.deviceListAddDelete=function(){return(0,r.getStorage)().versions.version(41)},t.deviceListAddV2Fields=function(){return(0,r.getStorage)().versions.version(59)},t.deviceListCreateTable=function(){return(0,r.getStorage)().versions.version(11)},t.directConnectionKeysAddPostcodeColumns=function(){return(0,r.getStorage)().versions.version(84)},t.directConnectionKeysCreateTable=function(){return(0,r.getStorage)().versions.version(70)},t.encryptHistorySyncDirectPath=function(){return(0,r.getStorage)().versions.version(42)},t.encryptHistorySyncFilehash=function(){return(0,r.getStorage)().versions.version(45)},t.encryptedMutationsCreateTable=function(){return(0,r.getStorage)().versions.version(15)},t.favoriteStickersCreateTable=function(){return(0,r.getStorage)().versions.version(73)},t.ftsIndexingQueueCreateTable=function(){return(0,r.getStorage)().versions.version(24)},t.groupInviteV4CreateTable=function(){return(0,r.getStorage)().versions.version(39)},t.groupMetadataCreateTable=function(){return(0,r.getStorage)().versions.version(20)},t.historySyncNotificationsCreateTable=function(){return(0,r.getStorage)().versions.version(14)},t.inactiveReceiptCreateTable=function(){return(0,r.getStorage)().versions.version(12)},t.labelAssociationCreateTable=function(){return(0,r.getStorage)().versions.version(17)},t.labelCreateTable=function(){return(0,r.getStorage)().versions.version(16)},t.lidChatStateCreateTable=function(){return(0,r.getStorage)().versions.version(102)},t.lidDisplayNameMappingCreateTable=function(){return(0,r.getStorage)().versions.version(94)},t.lidPnMappingCreateTable=function(){return(0,r.getStorage)().versions.version(90)},t.lidPnMappingRemoveDisplayName=function(){return(0,r.getStorage)().versions.version(95)},t.membershipApprovalRequestCreateTable=function(){return(0,r.getStorage)().versions.version(101)},t.messageAddActionLink=function(){return(0,r.getStorage)().versions.version(72)},t.messageAddDisappearingModeInitiator=function(){return(0,r.getStorage)().versions.version(37)},t.messageAddGroupInviteV4=function(){return(0,r.getStorage)().versions.version(38)},t.messageAddHeaderType=function(){return(0,r.getStorage)().versions.version(74)},t.messageAddInteractiveMessageFields=function(){return(0,r.getStorage)().versions.version(69)},t.messageAddIsSendFailureProperties=function(){return(0,r.getStorage)().versions.version(27)},t.messageAddNativeFlowNameField=function(){return(0,r.getStorage)().versions.version(54)},t.messageAddPaymentBackground=function(){return(0,r.getStorage)().versions.version(68)},t.messageAddPaymentInviteServiceType=function(){return(0,r.getStorage)().versions.version(64)},t.messageAddPaymentRequestNFMFields=function(){return(0,r.getStorage)().versions.version(49)},t.messageAddPaymentTxnStatus=function(){return(0,r.getStorage)().versions.version(29)},t.messageAddPollInvalidated=function(){return(0,r.getStorage)().versions.version(98)},t.messageAddPrivacyModeFields=function(){return(0,r.getStorage)().versions.version(32)},t.messageAddProductListPreviewHeaderImage=function(){return(0,r.getStorage)().versions.version(34)},t.messageAddProductListPreviewInfo=function(){return(0,r.getStorage)().versions.version(30)},t.messageCreateTable=function(){return(0,r.getStorage)().versions.version(7)},t.messageHistoryCreateTable=function(){return(0,r.getStorage)().versions.version(106)},t.messageInfoAddDeliveryPrivacyMode=function(){return(0,r.getStorage)().versions.version(33)},t.messageInfoCreateTable=function(){return(0,r.getStorage)().versions.version(8)},t.messageOrphansAddColumns=function(){return(0,r.getStorage)().versions.version(97)},t.messageOrphansCreateTable=function(){return(0,r.getStorage)().versions.version(92)},t.messageRemovePaymentRequestHeaderField=function(){return(0,r.getStorage)().versions.version(52)},t.messageStatusPSAReadTimestamp=function(){return(0,r.getStorage)().versions.version(76)},t.migrateSubgroupsArray=function(){return(0,r.getStorage)().versions.version(80)},t.missingKeysCreateTable=function(){return(0,r.getStorage)().versions.version(26)},t.nonMessageDataRequestCreateTable=function(){return(0,r.getStorage)().versions.version(107)},t.orphanPaymentNotificationCreateTable=function(){return(0,r.getStorage)().versions.version(40)},t.orphanReceiptCreateTable=function(){return(0,r.getStorage)().versions.version(10)},t.orphanRevokeCreateTable=function(){return(0,r.getStorage)().versions.version(47)},t.orphanTcTokenCreateTable=function(){return(0,r.getStorage)().versions.version(89)},t.participantCreateTable=function(){return(0,r.getStorage)().versions.version(9)},t.paymentBackgroundsCreateTable=function(){return(0,r.getStorage)().versions.version(79)},t.peerMessageCreateTable=function(){return(0,r.getStorage)().versions.version(43)},t.pendingMutationsCreateTable=function(){return(0,r.getStorage)().versions.version(0)},t.pollVotesAddMsgKeyIndex=function(){return(0,r.getStorage)().versions.version(104)},t.pollVotesCreateTable=function(){return(0,r.getStorage)().versions.version(91)},t.privacyDisallowedListAddDhashField=function(){return(0,r.getStorage)().versions.version(67)},t.privacyDisallowedListCreateTable=function(){return(0,r.getStorage)().versions.version(58)},t.profilePicThumbCreateTable=function(){return(0,r.getStorage)().versions.version(5)},t.quickReplyCreateTable=function(){return(0,r.getStorage)().versions.version(18)},t.reactionsCreateTable=function(){return(0,r.getStorage)().versions.version(66)},t.recentStickersCreateTable=function(){return(0,r.getStorage)().versions.version(53)},t.removeCommunityAdminPromotionColumns=function(){return(0,r.getStorage)().versions.version(99)},t.removeSpamColumnsInGroupMetadata=function(){return(0,r.getStorage)().versions.version(87)},t.removeUnjoinedSubgroups=function(){return(0,r.getStorage)().versions.version(83)},t.renameCommunityAdminPromotionColumns=function(){return(0,r.getStorage)().versions.version(96)},t.subscriptionCreateTable=function(){return(0,r.getStorage)().versions.version(85)},t.syncActionsCreateTable=function(){return(0,r.getStorage)().versions.version(2)},t.syncKeysCreateTable=function(){return(0,r.getStorage)().versions.version(21)},t.tasksScheduledTimeCreateTable=function(){return(0,r.getStorage)().versions.version(22)},t.unjoinedSubgroupMetadataCreateTable=function(){return(0,r.getStorage)().versions.version(81)},t.unjoinedSubgroupParentGroupIndex=function(){return(0,r.getStorage)().versions.version(86)},t.userPrefsCreateTable=function(){return(0,r.getStorage)().versions.version(93)},t.verifiedBusinessNameAddPrivacyMode=function(){return(0,r.getStorage)().versions.version(31)},t.verifiedBusinessNameAddSmbColumn=function(){return(0,r.getStorage)().versions.version(108)},t.verifiedBusinessNameCreateTable=function(){return(0,r.getStorage)().versions.version(13)};var r=n(605316)},827012:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getABPropConfigs=function(){return(0,s.initializeWithoutGKs)().then((()=>(0,u.getTable)().all().then((e=>e))))},t.getConfigValue=function(e){const t=a.ABPropConfigs[e];if(null==t)return __LOG__(4,!0,new Error,!0)`invalid ABProps config name`,SEND_LOGS("invalid ABProps config name: "+e),Promise.reject(new Error("invalid ABProps config name"));const[n,r,i,o]=t,l=i;return(0,s.initializeWithoutGKs)().then((()=>(0,u.getTable)().get(String(n)).then((e=>e?c(e.configValue,r,l):l))))},t.parseConfigValue=c,t.setConfigAccessed=function(e){return(0,l.getStorage)().lock(["abpropConfigs"],function(){var t=(0,i.default)((function*(t){let[n]=t;const r=yield n.get(String(e));null!=r&&!0!==(null==r?void 0:r.hasAccessed)&&(yield n.merge(String(e),{hasAccessed:!0}))}));return function(){return t.apply(this,arguments)}}())},t.updateABPropConfigs=function(e){return(0,l.getStorage)().lock(["abpropConfigs"],function(){var t=(0,i.default)((function*(t){let[n]=t;const r=yield n.all(),i=new Map;r.forEach((e=>{null!=e.configExpoKey&&i.set(e.configCode,{configCode:e.configCode,configValue:e.configValue,configExpoKey:e.configExpoKey,hasAccessed:e.hasAccessed})}));let a=!1;const s=[];e.forEach(((e,t)=>{let n=!1;const r=i.get(String(t));if(r){const i=r.configExpoKey;null!=i&&e.configExpoKey!==i?(o.exposureKeys.delete(i),a=!0,o.accessedConfigs.delete(t)):null!=i&&(n=r.hasAccessed)}s.push({configCode:String(t),configValue:e.configValue,configExpoKey:e.configExpoKey,hasAccessed:n})})),a&&(0,o.updateGlobalExpoKey)(),yield n.clear(),yield n.bulkCreate(s)}));return function(){return t.apply(this,arguments)}}())};var i=r(n(348926)),a=n(94728),o=n(744655),s=n(749118),l=n(605316),u=n(427138);function c(e,t,n){return null==e||null==t?n:"bool"===t?"1"===e||"True"===e||"true"===e:"int"===t?parseInt(e,10):"float"===t?parseFloat(e):e}},133331:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t._cache=void 0,t.addActiveMessageRange=function(){return h.apply(this,arguments)},t.bulkUpdateActiveMessageRanges=function(e){return _.bulkCreateOrReplaceRanges(e)},t.getActiveMessageRanges=function(e){return _.getRangesForChat(e)},t.getActiveRangeAction=function(e,t){switch(e){case"archive":return c.ActiveRangeAction.Archive;case"markChatAsRead":return c.ActiveRangeAction.MarkChatAsRead;case"clearChat":return(null==t?void 0:t.deleteStarred)&&t.deleteMedia?c.ActiveRangeAction.ClearChatDeleteStarredDeleteMedia:(null==t?void 0:t.deleteStarred)&&!t.deleteMedia?c.ActiveRangeAction.ClearChatDeleteStarredKeepMedia:(null==t?void 0:t.deleteMedia)&&!t.deleteStarred?c.ActiveRangeAction.ClearChatKeepStarredDeleteMedia:c.ActiveRangeAction.ClearChatKeepStarredKeepMedia;case"deleteChat":return(null==t?void 0:t.deleteMedia)?c.ActiveRangeAction.DeleteChatDeleteMedia:c.ActiveRangeAction.DeleteChatKeepMedia;default:throw new Error("unsupported active message range action")}},t.removeActiveMessageRange=function(e,t){return _.removeRange(e,t)};var i=r(n(81109)),a=r(n(348926)),o=r(n(132375)),s=n(370625),l=n(484777),u=n(749118),c=n(574017),d=n(309512);let p=new Map;const _={reset:()=>{p=new Map},removeRange(e,t){var n;return null===(n=p.get(e))||void 0===n||n.delete(t),(0,u.getActiveMessageRangesTable)().remove([e,t])},createOrReplaceRange(e){let t=p.get(e.chatId);return null==t&&(t=new Map,p.set(e.chatId,t)),t.set(e.action,e),(0,u.getActiveMessageRangesTable)().createOrReplace(e)},bulkCreateOrReplaceRanges:e=>(e.forEach((e=>{let t=p.get(e.chatId);null==t&&(t=new Map,p.set(e.chatId,t)),t.set(e.action,e)})),(0,u.getActiveMessageRangesTable)().bulkCreateOrReplace(e)),getRangesForChat:e=>(0,a.default)((function*(){let t=p.get(e);if(null==t){const n=yield(0,u.getActiveMessageRangesTable)().anyOf(["chatId"],[e]);t=new Map(n.map((e=>[e.action,e]))),p.set(e,t)}return Array.from(t.values())}))()};function f(e,t){switch(e){case c.ActiveRangeAction.Archive:return{action:c.ActiveRangeAction.Archive,actionValue:(0,o.default)(t.archiveChatAction,"syncActionValue.archiveChatAction")};case c.ActiveRangeAction.MarkChatAsRead:return{action:c.ActiveRangeAction.MarkChatAsRead,actionValue:(0,o.default)(t.markChatAsReadAction,"syncActionValue.markChatAsReadAction")};case c.ActiveRangeAction.ClearChatKeepStarredKeepMedia:return{action:c.ActiveRangeAction.ClearChatKeepStarredKeepMedia,actionValue:(0,o.default)(t.clearChatAction,"syncActionValue.clearChatAction")};case c.ActiveRangeAction.ClearChatKeepStarredDeleteMedia:return{action:c.ActiveRangeAction.ClearChatKeepStarredDeleteMedia,actionValue:(0,o.default)(t.clearChatAction,"syncActionValue.clearChatAction")};case c.ActiveRangeAction.ClearChatDeleteStarredKeepMedia:return{action:c.ActiveRangeAction.ClearChatDeleteStarredKeepMedia,actionValue:(0,o.default)(t.clearChatAction,"syncActionValue.clearChatAction")};case c.ActiveRangeAction.ClearChatDeleteStarredDeleteMedia:return{action:c.ActiveRangeAction.ClearChatDeleteStarredDeleteMedia,actionValue:(0,o.default)(t.clearChatAction,"syncActionValue.clearChatAction")};case c.ActiveRangeAction.DeleteChatDeleteMedia:return{action:c.ActiveRangeAction.DeleteChatDeleteMedia,actionValue:(0,o.default)(t.deleteChatAction,"syncActionValue.deleteChatAction")};case c.ActiveRangeAction.DeleteChatKeepMedia:return{action:c.ActiveRangeAction.DeleteChatKeepMedia,actionValue:(0,o.default)(t.deleteChatAction,"syncActionValue.deleteChatAction")};default:throw new Error(`unsupported action for message ranges: ${String(e)}`)}}function h(){return(h=(0,a.default)((function*(e,t,n){var r;const a=(0,d.decodeProtobuf)(s.SyncActionValueSpec,n),{actionValue:o}=f(t,a),u=(null===(r=o.messageRange)||void 0===r?void 0:r.messages)||[],c=yield(0,l.filterReceivedMessagesInRange)(e,u),p=Math.max(0,u.length-c.length);return _.createOrReplaceRange((0,i.default)((0,i.default)({chatId:e},f(t,a)),{},{remainingMessages:p}))}))).apply(this,arguments)}t._cache=_},718785:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBlocklist=function(){return(0,i.getTable)().all().then((e=>e.map((e=>(0,a.createUserWid)(e.id)))))},t.updateBlocklist=function(e){if(!e)return Promise.resolve(!1);const t=e.map((e=>({id:e.toString()})));return(0,r.getStorage)().lock(["blocklist"],(e=>{let[n]=e;return n.clear().then((()=>n.bulkCreate(t).then((()=>!0))))}))};var r=n(605316),i=n(287844),a=n(669050)},697588:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addUnreadMentionChat=function(e,t){return(0,c.getStorage)().lock(["chat"],function(){var n=(0,i.default)((function*(n){let[r]=n;const i=Array.from(e.keys());if(0===i.length)return;const a=yield(0,d.getTable)().bulkGet(i);if(!a||0===a.length)return void __LOG__(4,void 0,new Error)`addUnreadMentionChat: could not find chats`;const o=[];return a.forEach((n=>{if(n){var r;const a=n.id.toString();let s=null!==(r=n.unreadMentionsOfMe)&&void 0!==r?r:[];const l=e.get(a);l&&(s=s.concat(l));let u={id:a,unreadMentionsOfMe:s};if(t){var i;u={id:a,unreadMentionsOfMe:s,unreadMentionCount:null!==(i=t.get(a))&&void 0!==i?i:0}}o.push(u)}})),(0,d.getTable)().bulkCreateOrMerge(o)}));return function(){return n.apply(this,arguments)}}())},t.bulkGetChats=function(e){return(0,d.getTable)().bulkGet(e.map((()=>e.toString())))},t.bulkUpdateChatLastAddOnPreview=function(e){const t=Array.from(e).map((e=>{let[t,n]=e;return{id:t,chatlistPreview:n,lastReactionPreview:void 0}}));return(0,d.getTable)().bulkCreateOrMerge(t)},t.createChat=function(e,t){return(0,d.getTable)().create((0,a.default)({id:e.toString()},t)).catch((e=>{if(e instanceof u.DbOnLogoutAbort)throw e;throw __LOG__(4,!0,new Error)`update chat table failed`,new Error("update chat table failed")}))},t.getChatMeta=function(){return f.apply(this,arguments)},t.markMessageAndChatAsRead=function(e,t,n){return(0,c.getStorage)().lock(["message","chat"],function(){var r=(0,i.default)((function*(r){let[i,a]=r;const u=yield(0,p.getTable)().equals(["from","pendingReadReceipt"],[t,1],{shouldDecrypt:!1}),c=[];let d=0;const _=[];u.forEach((t=>{if(null==e||null!=t.rowId&&t.rowId>e){if(d++,(0,o.isGroupCatchUpEnabled)()&&(0,l.isImportantMessage)(t)){const e={id:t.id,timestamp:t.t};_.push(e)}}else c.push({id:t.id,ack:Math.max(t.ack,s.ACK.READ),pendingReadReceipt:null})}));const f=0===d&&n?-1:d,h=[a.createOrMerge(t,{id:t,unreadCount:f,unreadMentionsOfMe:_,unreadMentionCount:0})];c.length>0&&h.push((0,p.getTable)().bulkCreateOrMerge(c)),yield Promise.all(h)}));return function(){return r.apply(this,arguments)}}())},t.pruneExpiredOrphanTcTokens=function(){const e=(0,_.tokenExpirationCutoff)(_.TcTokenMode.Receiver),t=[];return(0,c.getStorage)().lock(["orphan-tc-token"],function(){var n=(0,i.default)((function*(n){let[r]=n;return(yield r.all()).forEach((n=>{const r=n.tcTokenTimestamp;null!=r&&r<e&&t.push(n.chatId)})),r.bulkRemove(t)}));return function(){return n.apply(this,arguments)}}())},t.pruneExpiredTcTokens=function(){const e=(0,_.tokenExpirationCutoff)(_.TcTokenMode.Receiver);return(0,c.getStorage)().lock(["chat"],function(){var t=(0,i.default)((function*(t){let[n]=t;const r=yield n.lessThan(["tcTokenTimestamp"],e);if(!r||0===r.length)return;const i=r.map((e=>({id:e.id,tcToken:null,tcTokenTimestamp:null})));return n.bulkCreateOrMerge(i)}));return function(){return t.apply(this,arguments)}}())},t.reduceChatUnreadCount=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return(0,c.getStorage)().lock(["chat"],function(){var n=(0,i.default)((function*(n){let[r]=n;const i=yield r.get(e);if(null==i)return void __LOG__(4,void 0,new Error)`reduceChatUnreadCount: could not find chat with id ${e}`;const a=Math.max(i.unreadCount-t,0);return r.merge(e,{unreadCount:a})}));return function(){return n.apply(this,arguments)}}())},t.removeUnreadMentionChat=function(e){return(0,c.getStorage)().lock(["chat"],function(){var t=(0,i.default)((function*(t){let[n]=t;const r=Array.from(e.keys());if(0===r.length)return;const i=yield(0,d.getTable)().bulkGet(r);if(!i||0===i.length)return void __LOG__(4,void 0,new Error)`removeUnreadMentionChat: could not find chats`;const a=[];return i.forEach((t=>{if(t){var n;let r=null!==(n=t.unreadMentionsOfMe)&&void 0!==n?n:[];const i=e.get(t.id.toString());i&&(r=r.filter((e=>!i.includes(e.id)))),a.push({id:t.id.toString(),unreadMentionsOfMe:r})}})),(0,d.getTable)().bulkCreateOrMerge(a)}));return function(){return t.apply(this,arguments)}}())},t.updateChatArchiveDrawer=function(e){return(0,c.getStorage)().lock(["chat"],(t=>{let[n]=t;const r=Array.from(e.keys());if(0===r.length)return Promise.resolve();const i=r.map((t=>{var n;return{id:t,archiveAtMentionViewedInDrawer:null!==(n=e.get(t))&&void 0!==n&&n}}));return n.bulkCreateOrMerge(i)}))},t.updateChatForMarkAsReadSync=function(e){return(0,c.getStorage)().lock(["chat"],function(){var t=(0,i.default)((function*(t){let[n]=t;const r=yield n.get(e);if(null!=r)return-1===r.unreadCount?n.createOrMerge(e,{id:e,unreadCount:0,unreadMentionsOfMe:[],unreadMentionCount:0}):void 0;__LOG__(4,void 0,new Error)`updateMarkChatAsReadSync: could not find chat with id ${e}`}));return function(){return t.apply(this,arguments)}}())};var i=r(n(348926)),a=r(n(81109)),o=n(493928),s=n(402994),l=n(147980),u=n(288057),c=n(605316),d=n(76085),p=n(121260),_=n(147034);function f(){return(f=(0,i.default)((function*(e){const t=yield(0,d.getTable)().get(e.toString());return t?{unreadCount:t.unreadCount,timestamp:t.t}:Promise.reject(new Error("Failed to find row in chat table with id:"+e.toString()))}))).apply(this,arguments)}},995772:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.createOrUpdateChatEvents=function(e){return d.enqueue((0,i.default)((function*(){const t=(yield(0,u.getTable)().bulkGet(e.map((e=>{let{chatId:t,startTs:n}=e;return[t,n]})))).map(((t,n)=>{const r=e[n],i=function(e,t,n){if(null==n)return(0,a.default)({chatId:e,startTs:t},c);return Object.keys(c).reduce(((e,t)=>(null==e[t]&&(e[t]=c[t]),e)),n)}(r.chatId,r.startTs,t);return l.COUNT_FIELD_NAMES.forEach((e=>{i[e]+=r[e]})),s.FLAG_FIELD_NAMES.forEach((e=>{i[e]=r[e]})),i.msgsSent+=r.addMsgsSent,i.msgsReceived+=r.addMsgsReceived,i.viewOnceMsgsSent+=r.addViewOnceMsgsSent,i.viewOnceMsgsReceived+=r.addViewOnceMsgsReceived,i.viewOnceMessagesOpened+=r.addViewOnceMsgsOpened,i.callOffersSent+=r.addCallOffersSent,i.callOffersReceived+=r.addCallOffersReceived,i.totalCallDuration+=r.addTotalCallDuration,i.commerceMsgsSent+=r.addCommerceMsgsSent,i.commerceMsgsReceived+=r.addCommerceMsgsReceived,i.pdpInquiriesSent+=r.addPdpInquiriesSent,i.reactionsSent+=r.addReactionsSent,i.reactionsReceived+=r.addReactionsReceived,i.forwardMessagesSent+=r.addForwardMessagesSent,i.forwardMessagesReceived+=r.addForwardMessagesReceived,i}));return(0,u.getTable)().bulkCreateOrReplace(t)})))},t.deleteBeforeInclusive=function(){return p.apply(this,arguments)},t.getBeforeInclusive=function(e){return(0,u.getTable)().lessThan(["startTs"],e,{inclusive:!0})},t.getChatEvent=function(e,t){return(0,u.getTable)().get([e,t])};var i=r(n(348926)),a=r(n(81109)),o=n(316860),s=n(742988),l=n(244612),u=n(873762);const c=Object.freeze((0,a.default)((0,a.default)((0,a.default)({},l.COUNT_FIELDS),s.FLAG_FIELDS),{},{msgsSent:0,msgsReceived:0,viewOnceMsgsSent:0,viewOnceMsgsReceived:0,viewOnceMessagesOpened:0,callOffersSent:0,callOffersReceived:0,totalCallDuration:0,commerceMsgsSent:0,commerceMsgsReceived:0,pdpInquiriesSent:0,reactionsSent:0,reactionsReceived:0,forwardMessagesSent:0,forwardMessagesReceived:0})),d=new o.PromiseQueue;function p(){return(p=(0,i.default)((function*(e){return yield(0,u.getTable)().bulkDeleteRange(["startTs"],0,e+1)}))).apply(this,arguments)}},469475:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getContactHash=d,t.isAddressBookContact=function(){return c.apply(this,arguments)},t.setNotAddressBookContacts=function(e){return(0,l.getStorage)().lock(["contact"],(()=>{const t=e.map((e=>({id:e,isAddressBookContact:0,name:void 0,shortName:void 0,contactHash:d(e)})));return(0,s.getContactTable)().bulkCreateOrMerge(t)}))};var i=r(n(348926)),a=n(417405),o=r(n(706223)),s=n(76469),l=n(605316),u=n(669050);function c(){return(c=(0,i.default)((function*(e){const t=yield(0,s.getContactTable)().get(e);return null!=t&&0!==t.isAddressBookContact}))).apply(this,arguments)}function d(e){const t=(0,u.createWid)(e).user,n=(0,a.decodeB64)((0,o.default)(t+"WA_ADD_NOTIF"));return(0,a.encodeB64)(n.slice(0,3))}},866729:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.bulkCreateOrReplaceDeviceRecord=function(){return y.apply(this,arguments)},t.bulkGetDeviceRecord=h,t.createOrReplaceDeviceRecord=function(){return m.apply(this,arguments)},t.doesDeviceHashMatch=function(){return A.apply(this,arguments)},t.getAllDeviceLists=function(){return(0,c.getTable)().all()},t.getDeviceIds=E,t.getDeviceInfoForSync=function(){return v.apply(this,arguments)},t.getDeviceRecord=f,t.getMyDeviceList=function(){return C.apply(this,arguments)},t.hasDevice=function(){return T.apply(this,arguments)};var i=r(n(348926)),a=r(n(594654)),o=n(616310),s=n(138596),l=n(476462),u=n(848624),c=n(88134),d=n(459857),p=n(669050);const _=new s.LruCache({sizeLimit:5e3,getSize:()=>1});function f(e){var t;const n=(0,l.createDeviceListPK)(e);if(!_.has(n)){const e=(0,c.getTable)().get(n);_.put(n,e)}return null!==(t=_.get(n))&&void 0!==t?t:Promise.resolve(null)}function h(){return g.apply(this,arguments)}function g(){return(g=(0,i.default)((function*(e){const t=[];if(e.forEach((e=>{_.has((0,l.createDeviceListPK)(e))||t.push((0,l.createDeviceListPK)(e))})),t.length>0){(yield(0,c.getTable)().bulkGet(t)).forEach(((e,n)=>{_.put(t[n],Promise.resolve(e))}))}return Promise.all(e.map((e=>_.get((0,l.createDeviceListPK)(e)))))}))).apply(this,arguments)}function m(){return(m=(0,i.default)((function*(e){yield(0,c.getTable)().createOrReplace(e),_.put(e.id,Promise.resolve(e))}))).apply(this,arguments)}function y(){return(y=(0,i.default)((function*(e){yield(0,c.getTable)().bulkCreateOrReplace(e),e.forEach((e=>{_.put(e.id,Promise.resolve(e))}))}))).apply(this,arguments)}function E(){return S.apply(this,arguments)}function S(){return(S=(0,i.default)((function*(e){return(yield h(e)).map((e=>{if(e&&!e.deleted){const t=e.devices.map((e=>e.id));return{id:e.id,devices:t}}return null}))}))).apply(this,arguments)}function T(){return(T=(0,i.default)((function*(e,t){if(t===o.DEFAULT_DEVICE_ID)return!0;const[n]=yield E([e]);return!!n&&!!n.devices.includes(t)}))).apply(this,arguments)}function v(){return(v=(0,i.default)((function*(e){return(yield h(e)).map((e=>{if(e&&!e.deleted){const t=e.devices.map((e=>e.id));return{id:e.id,devices:t,timestamp:e.timestamp,expectedTs:e.expectedTs}}return null}))}))).apply(this,arguments)}function A(){return(A=(0,i.default)((function*(e,t){if(null==t)return!0;const n=(yield E([e])).map((e=>null==e?[]:e.devices.map((t=>(0,p.createDeviceWidFromDeviceListPk)(e.id,t))))),r=(0,a.default)(n,(e=>e));return(yield(0,u.phashV2)(r))!==t}))).apply(this,arguments)}function C(){return(C=(0,i.default)((function*(){const e=(0,d.assertGetMe)(),t=yield f(e);if(!t||t.deleted)throw new Error("syncd: cannot find my device list");return t}))).apply(this,arguments)}},815443:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createOrUpdateDirectConnectionKeys=function(e){return(0,r.getTable)().createOrMerge(e.id,e)},t.fetchDirectConnectionKeys=function(e){return(0,r.getTable)().get(e)},t.removeDirectConnectionKeys=function(e){return(0,r.getTable)().remove(e)};var r=n(55519)},653076:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDeviceUpdateLock=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=["participant","device-list"];t&&(i=[...i,"message"]);n&&(i=[...i,"missing-keys"]);return(0,r.getStorage)().lock(i,(t=>e(t)))};var r=n(605316)},298466:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getPendingParticipants=function(e){var t;const n=null===(t=(0,l.getMaybeMeUser)())||void 0===t?void 0:t.toString();return(0,s.getTable)().equals(["from","groupId"],[n,e.toString()]).then((e=>e.filter((e=>!e.expired&&(0,o.unixTime)()<=e.expiration)))).then((e=>e.map((e=>e.to))))},t.persistGroupInviteV4Msg=function(e,t){return(0,s.getTable)().createOrMerge(e,t)},t.persistGroupInviteV4Msgs=function(e){return(0,s.getTable)().bulkCreateOrMerge(e)},t.revokeGroupInvites=function(){return u.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(990445),s=n(968574),l=n(459857);function u(){return(u=(0,a.default)((function*(e,t,n,r){const a=yield(0,s.getTable)().equals(["from","to","groupId"],[e,t,n]).then((e=>e.filter((e=>!e.expired&&e.expiration<=r))));return(0,s.getTable)().bulkCreateOrReplace(a.map((e=>(0,i.default)((0,i.default)({},e),{},{expired:!0})))),a}))).apply(this,arguments)}},443780:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addNotification=_,t.enqueueNotification=function(){return f.apply(this,arguments)},t.fetchNextHitorySyncChunkForProcessing=function(){return h.apply(this,arguments)},t.markChunkForReuploadPending=function(e){return u.delete(e),(0,s.getTable)().merge(e,{reuploadPending:!0})},t.removeLocalFailureFromInFlightChunk=function(e){u.delete(e)},t.updateCurrentlyProcessed=p;var i=r(n(81109)),a=r(n(348926)),o=n(926552),s=n(607585),l=n(673168);const u=new Set;function c(){return(c=(0,a.default)((function*(e,t,n){const r=yield(0,l.getLastHistorySyncedChunk)();if(4===e)return!0;if([2,3].includes(e)&&1===t){if(3===e){return!0===(yield(0,l.getInitialHistorySyncComplete)())}const t=yield(0,l.getHistorySyncStatus)();return!!(null==t?void 0:t.recentCompleted)}if(null==r)return!1;const[i,a]=r.split("_");return i===`${e}`&&a===""+(t-1)||(i===`${e}`&&a===`${t}`?(__LOG__(2,void 0,void 0,void 0,["History sync"])`isPreviousChunkProcessed: next chunk already processed ${e}_${t}, last processed: ${r} `,yield p(n),!1):(__LOG__(2,void 0,void 0,void 0,["History sync"])`isPreviousChunkProcessed returned false for ${e}_${t}, last processed: ${r} `,!1))}))).apply(this,arguments)}function d(){const e=(0,s.getTable)().equals(["processed"],0,{shouldDecrypt:!1}).then(function(){var e=(0,a.default)((function*(e){var t;const n=e.filter((e=>!u.has(e.msgKey)&&!e.reuploadPending)).sort(((e,t)=>e.syncType<t.syncType?1:e.syncType>t.syncType?-1:e.syncType===t.syncType&&null!=e.chunkOrder&&null!=t.chunkOrder?e.chunkOrder-t.chunkOrder:0));let r=n.length>0?n[0]:void 0;if(null!=(null===(t=r)||void 0===t?void 0:t.chunkOrder)){if(r){const e=yield function(){return c.apply(this,arguments)}(r.syncType,r.chunkOrder,r.msgKey);if((0,o.handleChunkProgress)(e),!e)return;r=yield(0,s.getTable)().postflightDecryptSingleRecord(r)}return r}var i;__LOG__(2,void 0,void 0,void 0,["History sync"])`getNextUnProcessedNotification chunkOrder is null, ${null===(i=r)||void 0===i?void 0:i.msgKey}`}));return function(){return e.apply(this,arguments)}}());return e||Promise.reject(new Error("getNextUnProcessed history sync notification: not supported for non MD"))}function p(e){return u.delete(e),(0,s.getTable)().remove(e).catch((e=>{__LOG__(2,void 0,void 0,void 0,["History sync"])`updateCurrentlyProcessed failed with error ${e}`}))}function _(e){const t=e.downloadOptions.mediaKey,n=e.downloadOptions.directPath,r=e.downloadOptions.filehash,a=e.downloadOptions.encFilehash;e.downloadOptions.mediaKey="",e.downloadOptions.directPath="",e.downloadOptions.filehash="",e.downloadOptions.encFilehash="";const o=(0,i.default)((0,i.default)({},e),{},{chunkEncryptionKey:t,directPath:n,filehash:r,encFilehash:a});return e.processed=0,(0,s.getTable)().createOrMerge(e.msgKey,o)}function f(){return(f=(0,a.default)((function*(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];yield _(e),t&&u.add(e.msgKey)}))).apply(this,arguments)}function h(){return(h=(0,a.default)((function*(){if(u.size>0)return null;const e=yield d();return e&&(e.downloadOptions.mediaKey=e.chunkEncryptionKey,delete e.chunkEncryptionKey,e.downloadOptions.directPath=e.directPath||e.downloadOptions.directPath,delete e.directPath,e.downloadOptions.filehash=""===e.downloadOptions.filehash?e.filehash:e.downloadOptions.filehash,delete e.filehash,e.downloadOptions.encFilehash=e.encFilehash,delete e.encFilehash,u.add(e.msgKey)),e}))).apply(this,arguments)}},642232:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.hydrateWids=function e(t){if(Array.isArray(t))return t.map(((t,n)=>e((0,a.default)(n,t,i.isWidlike,i.createWidFromWidLike))));if(t&&"object"==typeof t){const n=Object.keys(t);for(let r=0;r<n.length;r++){const o=n[r];t[o]=e((0,a.default)(o,t[o],i.isWidlike,i.createWidFromWidLike))}return t}return t};var i=n(669050),a=r(n(933173))},426717:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeMembershipApprovalRequests=t.removeAllMembershipApprovalRequests=t.getMembershipApprovalRequests=t.addMembershipApprovalRequests=void 0;var r=n(749118),i=n(669050);t.getMembershipApprovalRequests=e=>(0,r.getMembershipApprovalRequestTable)().equals(["groupId"],e.toString()).then((e=>e.map((e=>{let{id:t,t:n,addedBy:r,requestMethod:a}=e;return{id:(0,i.createWid)(t),t:n,addedBy:(0,i.createWid)(r),requestMethod:a}}))));t.addMembershipApprovalRequests=(e,t)=>{const n=t.map((t=>{let{id:n,t:r,addedBy:i,requestMethod:a}=t;return{groupId:e.toString(),id:n.toString(),t:r,addedBy:i.toString(),requestMethod:a}}));return(0,r.getMembershipApprovalRequestTable)().bulkCreateOrReplace(n)};t.removeMembershipApprovalRequests=(e,t)=>{const n=e.toString();return(0,r.getMembershipApprovalRequestTable)().bulkRemove(t.map((e=>[n,e.toString()])))};t.removeAllMembershipApprovalRequests=e=>(0,r.getMembershipApprovalRequestTable)().bulkRemoveByIndex(["groupId"],[e.toString()])},486492:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.RetryEligibilityResult=void 0,t.createOrMergeReceiptRecords=function(e){const t=new Map;return e.forEach((e=>{var n;const{msgKey:r,receiverId:i}=e,a=(0,p.toUserWid)(i).toString(),s=r.toString(),l=`${s},${a}`,u=null!==(n=i.device)&&void 0!==n?n:o.DEFAULT_DEVICE_ID,c=t.get(l);c?c.deviceNotDelivered.push(u):t.set(l,{msgKey:s,receiverUserJid:a,deviceDelivered:[],deviceNotDelivered:[u]})})),(0,l.getStorage)().lock(["message-info"],function(){var e=(0,a.default)((function*(e){let[n]=e;const r=Array.from(t.values()).map((e=>[e.msgKey,e.receiverUserJid]));return(yield n.anyOf(["msgKey","receiverUserJid"],r)).forEach((e=>{const n=`${e.msgKey},${e.receiverUserJid}`,r=t.get(n);r&&t.set(n,(0,i.default)((0,i.default)({},e),{},{deviceNotDelivered:[...e.deviceNotDelivered,...r.deviceNotDelivered]}))})),(0,c.getTable)().bulkCreateOrReplace(Array.from(t.values()))}));return function(){return e.apply(this,arguments)}}())},t.isRetryEligible=function(e,t,n,r){const i=(0,p.toUserWid)(t).toString(),a=t.device||0;return(0,c.getTable)().get([e.toString(),i]).then((s=>s?s.deviceNotDelivered.includes(a)?null!=n&&r>=n?h.ELIGIBLE:null!=t.device&&t.device!==o.DEFAULT_DEVICE_ID||null!=s.delivery?h.INELIGIBLE_CHANGED_IDENTITY:h.ELIGIBLE:(__LOG__(2)`MessageInfoStore: ${e.toString()},${i}:${a} has been delivered`,h.INELIGIBLE_ALREADY_DELIVERED):(__LOG__(2)`MessageInfoStore: missing record for ${e.toString()},${i}`,h.INELIGIBLE_RECORD_MISSING)))},t.queryMsgInfo=function(e){const t=String(e);return(0,u.getTable)().get(t).then((t=>{const n=t?t.count:null;return(0,c.getTable)().equals(["msgKey"],e.toString()).then((t=>{const r={delivery:[],deliveryRemaining:0,played:[],playedRemaining:0,read:[],readRemaining:0};let i=0;t.forEach((e=>{const t=(0,p.createWid)(e.receiverUserJid);if(!(0,d.getMeUser)().equals(t)){!function(e){const t=e.read;null!=t&&(null==e.delivery||e.delivery>t)&&(e.delivery=t)}(e);for(let n=0;n<f.length;n++){const i=f[n],a=e[i];null!=a&&r[i].push({id:t,t:a})}null!=e.delivery&&null!=e.deliveryPrivacyMode&&(r.deliveryPrivacyMode=e.deliveryPrivacyMode),i+=1}}));const a=null!=n&&0!==n?n:i;return __LOG__(2)`queryMsgInfo: ${e}, ack count: ${n}, receiver: ${a},
played: ${r.played.length}, read: ${r.read.length}, delivery: ${r.delivery.length}`,r.playedRemaining=a-r.played.length,r.readRemaining=r.playedRemaining-r.read.length,r.deliveryRemaining=r.readRemaining-r.delivery.length,r}))}))},t.updateReceiptRecords=function(e,t,n,r,i){const a=_[e],o=(0,p.toUserWid)(n).toString(),u=n.device||0;if(!a)return Promise.reject(new Error(`updateReceiptRecords: not supported ack type ${e}`));return function(e,t,n,r,i,a){if(0===i.length)return Promise.resolve();return(0,l.getStorage)().lock(["message-info"],(o=>{let[l]=o;const u=i.map((e=>[e,n]));return l.bulkGet(u).then((o=>{const u=[];return i.forEach(((i,l)=>{const c=o[l];if(!c){__LOG__(2)`updateReceiptRecords: got receipt for peer msg ${i},${n}`;const r={msgKey:i,receiverUserJid:n,[e]:t,deviceDelivered:[],deviceNotDelivered:[]};return e===s.ACK_STRING.DELIVERY&&null!=a&&(r.deliveryPrivacyMode=a),void u.push(r)}if(e!==_[s.ACK.INACTIVE]){const n=c[e];(null==c[e]||n>t)&&(c[e]=t),e===s.ACK_STRING.DELIVERY&&null!=a&&(c.deliveryPrivacyMode=a)}c.deviceNotDelivered.length>0&&(c.deviceDelivered.push(r),c.deviceDelivered=c.deviceDelivered.filter(((e,t,n)=>n.indexOf(e)===t)),c.deviceNotDelivered=c.deviceNotDelivered.filter((e=>e!==r))),u.push(c)})),l.bulkCreateOrReplace(u)}))}))}(a,t,o,u,r,i)};var i=r(n(81109)),a=r(n(348926)),o=n(616310),s=n(402994),l=n(605316),u=n(121260),c=n(719438),d=n(459857),p=(r(n(124928)),n(669050));const _={[s.ACK.RECEIVED]:s.ACK_STRING.DELIVERY,[s.ACK.READ]:s.ACK_STRING.READ,[s.ACK.PLAYED]:s.ACK_STRING.PLAYED,[s.ACK.INACTIVE]:s.ACK_STRING.INACTIVE},f=[s.ACK_STRING.PLAYED,s.ACK_STRING.READ,s.ACK_STRING.DELIVERY],h=Object.freeze({ELIGIBLE:"ELGIBLE",INELIGIBLE_RECORD_MISSING:"INELIGIBLE_RECORD_MISSING",INELIGIBLE_ALREADY_DELIVERED:"INELIGIBLE_ALREADY_DELIVERED",INELIGIBLE_NOT_MD:"INELIGIBLE_NOT_MD",INELIGIBLE_CHANGED_IDENTITY:"INELIGIBLE_CHANGED_IDENTITY"});t.RetryEligibilityResult=h},944161:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createOrUpdateOrphanReceipt=function(e,t,n){return(0,r.getStorage)().lock(["orphan-receipt"],(r=>{let[i]=r;return i.bulkGet(n).then((r=>{const a=n.reduce(((n,i,a)=>{let o=r[a];o||(o={msgKey:i});const s=o[e];return(null==s||s>t)&&(o[e]=t,n.push(o)),n}),[]);return i.bulkCreateOrReplace(a)}))}))},t.getOrphanReceipt=function(e){return(0,i.getTable)().get(e)},t.removeOrphanReceipt=function(e){return(0,i.getTable)().remove(e)};var r=n(605316),i=n(302213)},260071:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addOrphanRevokes=function(e){return p.bulkCreateOrReplaceOrphanRevokes(e)},t.applyOrphanRevokes=function(){return _.apply(this,arguments)};var i=r(n(348926)),a=r(n(132375)),o=n(76469),s=n(373070),l=r(n(124928)),u=n(669050);let c=new Map,d=!1;const p={reset:()=>{c=new Map,d=!1},bulkRemoveOrphans:e=>(e.forEach((e=>{c.delete(e.msgKey)})),(0,o.getOrphanRevokeTable)().bulkRemove(e.map((e=>e.msgKey)))),bulkCreateOrReplaceOrphanRevokes:e=>(e.forEach((e=>{c.has(e.msgKey)&&c.delete(e.msgKey),c.set(e.msgKey,e)})),(0,o.getOrphanRevokeTable)().bulkCreateOrReplace(e)),getAllOrphanRevokes:()=>(0,i.default)((function*(){if(!d){const e=yield(0,o.getOrphanRevokeTable)().all();c=new Map(e.map((e=>[e.msgKey,e]))),d=!0}return c}))()};function _(){return(_=(0,i.default)((function*(e){const t=yield p.getAllOrphanRevokes(),n=[],r=[];return e.forEach((e=>{const i=e.id.toString();if(t.has(i)){const c=(0,a.default)(t.get(i),"orphanRevokesCache.get(messageId)");var o;if(__LOG__(2)`applyOrphanRevokes: found orphan revoke for message ${e.id.toString()}`,!l.default.isStatusV3(e.id.remote))r.push({id:e.id,to:e.to,author:e.author,revokeSender:(0,u.createWidFromWidLike)(null!==(o=c.sender)&&void 0!==o?o:e.sender),type:s.MSG_TYPE.REVOKED,subtype:"admin_revoke"===c.subtype?"admin":"sender",protocolMessageKey:e.id,from:e.from,t:e.t,broadcast:e.broadcast});n.push(c)}else r.push(e)})),p.bulkRemoveOrphans(n),r}))).apply(this,arguments)}},559432:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.createOrUpdateOrphanTcToken=function(e,t){return(0,a.getTable)().createOrMerge(e,(0,i.default)({chatId:e},t))},t.getOrphanTcToken=function(e){return(0,a.getTable)().get(e)},t.removeOrphanTcToken=function(e){return(0,a.getTable)().remove(e)};var i=r(n(81109)),a=n(414015)},565583:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.GroupUnSyncedError=void 0,t.clearAdminshipCache=function(e){null!=e?T.delete(e):T.clear()},t.getGroupSenderKeyList=function(){return h.apply(this,arguments)},t.getGroupSenderKeyListFromParticipantRecord=g,t.injectPastParticipantsFromDB=function(){return S.apply(this,arguments)},t.isCurrentUserGroupAdmin=function(e){const t=(0,d.getMaybeMeUser)();if(!T.has(e)){const n=(0,c.getTable)().get(e).then((e=>!!e&&e.admins.includes(null==t?void 0:t.toString())));T.set(e,n)}const n=T.get(e);return Promise.resolve(n)},t.markForgetSenderKey=function(e,t){const n=e.toString();return(0,u.getStorage)().lock(["participant"],(e=>{let[r]=e;return r.get(n).then((e=>{if(e)return r.createOrReplace(y(e,t,!1));__LOG__(2)`markForgetSenderKey: group participant info missing for group ${n}`}))}))},t.markHasSenderKey=function(e,t){const n=e.toString();return(0,u.getStorage)().lock(["participant"],(e=>{let[r]=e;return r.get(n).then((e=>{if(e)return r.createOrReplace(y(e,t,!0));__LOG__(2)`markHasSenderKey: group participant info missing for group ${n}`}))}))},t.pruneExpiredPastParticipants=function(){return(0,u.getStorage)().lock(["participant"],function(){var e=(0,a.default)((function*(e){let[t]=e;const n=yield(0,c.getTable)().all(),r=[];return n.forEach((e=>{const t=e.pastParticipants.filter((e=>{const t=(0,o.castToUnixTime)(e.leaveTs);return(0,o.happenedWithin)(t,o.DAY_SECONDS*l.PAST_PARTICIPANT_EXPIRATION_DAYS)}));if(t.length!==e.pastParticipants.length){const n=(0,i.default)((0,i.default)({},e),{},{pastParticipants:t});r.push(n)}})),r.length,t.bulkCreateOrReplace(r)}));return function(){return e.apply(this,arguments)}}())},t.setAdminshipCache=function(e,t){T.set(e,t)};var i=r(n(81109)),a=r(n(348926)),o=n(990445),s=n(359987),l=n(682144),u=n(605316),c=n(443421),d=n(459857),p=n(440401),_=n(669050);class f extends Error{constructor(){super(...arguments),this.name="GroupUnSyncedError"}}function h(){return(h=(0,a.default)((function*(e){const t=e.toString();return g(e,yield(0,c.getTable)().get(t))}))).apply(this,arguments)}function g(){return m.apply(this,arguments)}function m(){return(m=(0,a.default)((function*(e,t){const n=[],r=[];if(!t)return{skDistribList:n,skList:r,rotateKey:!1};const{senderKey:i,rotateKey:a}=t;return i.forEach(((e,t)=>{var a;const o=(0,_.createWid)(t),s=(0,_.toUserWid)(o),l=null!==(a=i.get(s.toString()))&&void 0!==a&&a;e&&l?r.push(o):(n.push(o),o.isCompanion()&&e&&!l&&__LOG__(3)`getGroupSenderKeyList: include ${t} because its primary doesn't have sender key`)})),yield E(e,i.size),(0,p.cacheGroupMetrics)(t),a?{skDistribList:[...n,...r],skList:[],rotateKey:a}:{skDistribList:n,skList:r,rotateKey:a}}))).apply(this,arguments)}function y(e,t,n){const r=new Map(e.senderKey);let i=!1;return t.forEach((e=>{if((0,d.isMeDevice)(e))return;const t=String(e);r.has(t)?r.set(t,n):e.isLid()||(i=!0)})),{groupId:e.groupId,senderKey:r,participants:e.participants,pastParticipants:e.pastParticipants,admins:e.admins,rotateKey:i,deviceSyncComplete:e.deviceSyncComplete}}function E(e,t){return(0,s.frontendSendAndReceive)("updateCachedDeviceCount",{groupWid:e,deviceCount:t})}function S(){return(S=(0,a.default)((function*(e){const t=e.map((e=>e.id.toString())),n=yield(0,c.getTable)().bulkGet(t);return e.map(((e,t)=>{var r,a;return(0,i.default)((0,i.default)({},e),{},{pastParticipants:null===(r=n[t])||void 0===r||null===(a=r.pastParticipants)||void 0===a?void 0:a.map((e=>{let{jid:t,leaveTs:n,leaveReason:r}=e;return{id:(0,_.createWid)(t),leaveTs:n,leaveReason:r}}))})}))}))).apply(this,arguments)}t.GroupUnSyncedError=f;const T=new Map},118487:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.deletePeerMessage=function(e){const t=(0,o.getTable)(),n=new a.default({fromMe:!0,remote:(0,s.getMeUser)(),id:e});return t.remove(n.toString())},t.storePeerMessages=function(e){const t=e.map((e=>(0,i.default)((0,i.default)({},e),{},{id:String(e.id),to:String(e.to),subtype:String(e.subtype)})));(0,o.getTable)().bulkCreate(t)};var i=r(n(81109)),a=r(n(565754)),o=n(131020),s=n(459857)},618396:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.disallowedRowsToLists=s,t.queryDisallowedLists=function(){return o.apply(this,arguments)};var i=r(n(348926)),a=n(572768);function o(){return(o=(0,i.default)((function*(){try{return s(yield(0,a.getTable)().all())}catch(e){return __LOG__(4,!0,new Error,!0)`privacy_settings_drawer: get all privacy disallowed lists failed`,SEND_LOGS("privacy_settings_drawer: get all privacy disallowed lists failed"),{status:null,groupadd:null,last:null,profile:null}}}))).apply(this,arguments)}function s(e){const t={status:null,groupadd:null,last:null,profile:null};return e.forEach((e=>{switch(e.id){case a.PrivacyDisallowedListType.About:return void(t.status=e);case a.PrivacyDisallowedListType.GroupAdd:return void(t.groupadd=e);case a.PrivacyDisallowedListType.LastSeen:return void(t.last=e);case a.PrivacyDisallowedListType.ProfilePicture:t.profile=e}})),t}},316982:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getAllStatuses=function(){const e=(0,f.createWid)(a.STATUS_JID);return u.DbEncKeyStore.waitForFinalDbMsgEncKey().then((()=>(0,l.queryChatMessageHelper)((0,d.beginningOfChat)(e),(0,d.endOfChat)(e),{lowerInclusive:!1,upperInclusive:!1}).then((e=>{const t=[],n=[];e.forEach((e=>{e.author?(0,o.happenedWithin)((0,o.castToUnixTime)(e.t),o.DAY_SECONDS)&&e.type!==p.MSG_TYPE.REVOKED?n.push((0,c.messageFromDbRow)(e)):t.push(e.id):__LOG__(3)`Author is null for status v3 message`})),(0,_.getTable)().bulkRemove(t);const r=(0,i.default)(n,(e=>e.author.toString())),a=[];for(const e in r){const t=r[e],n=t.filter((e=>e.ack<s.ACK.READ)).length,i=t[t.length-1].t;a.push({id:(0,f.createWid)(e),unreadCount:n,totalCount:t.length,t:i,_msgs:t})}return a}))))};var i=r(n(607739)),a=n(616310),o=n(990445),s=n(402994),l=n(834986),u=n(436005),c=n(907539),d=n(878685),p=n(373070),_=n(121260),f=n(669050)},948425:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTaskScheduledTime=function(e){return(0,i.getTable)().get(e).then((e=>null==e?void 0:e.time))},t.updateTaskScheduledTime=function(e,t){return(0,r.getStorage)().lock(["tasks-scheduled-time"],(n=>{let[r]=n;return r.createOrReplace({taskName:e,time:t})}))};var r=n(605316),i=n(448855)},699612:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.cleanUnjoinedSubgroups=function(){return d.apply(this,arguments)},t.removeUnjoinedSubgroupMetadataFromStorage=function(e){(0,s.getTable)().remove(e.toString())},t.updateUnjoinedSubgroups=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=r(n(81109)),o=r(n(506479)),s=n(484187);const l=["defaultSubgroup","parentGroupId"];function u(e){const t={},{defaultSubgroup:n,parentGroupId:r}=e,i=(0,o.default)(e,l);return null!=n&&(t.defaultSubgroup=n),null!=r&&(t.parentGroup=r.toString()),(0,a.default)((0,a.default)((0,a.default)({},i),t),{},{id:e.id.toString()})}function c(){return(c=(0,i.default)((function*(e){let{unjoinedSubgroups:t,parentGroupId:n,link:r}=e;if(!r)return void(yield(0,s.getTable)().bulkRemove(t.map((e=>e.id.toString()))));let i=[];const o=yield(0,s.getTable)().bulkGet(t.map((e=>e.id.toString())));i=t.map(((e,t)=>{const r=o[t];let i={subject:e.subject,subjectTime:e.subjectTime||0};if(r){const e=r.subjectTime||0;e>i.subjectTime&&(i={subject:r.subject,subjectTime:e})}return u((0,a.default)((0,a.default)((0,a.default)({},e),i),{},{parentGroupId:n}))})),yield(0,s.getTable)().bulkCreateOrMerge(i)}))).apply(this,arguments)}function d(){return(d=(0,i.default)((function*(e){let{unjoinedSubgroupIds:t,parentGroupId:n}=e;const r=(yield(0,s.getTable)().equals(["parentGroup"],n.toString())).map((e=>e.id)),i=t.map((e=>e.toString())),a=r.filter((e=>!i.includes(e)));yield(0,s.getTable)().bulkRemoveByIndex(["id"],a)}))).apply(this,arguments)}},357621:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bulkCreateOrReplaceUserPrefs=function(e){return(0,r.getTable)().bulkCreateOrReplace(e)},t.clearUserPrefs=function(){return(0,r.getTable)().clear()},t.createOrReplaceUserPref=function(e){return(0,r.getTable)().createOrReplace(e)},t.getUserPref=function(e){return(0,r.getTable)().get(e)},t.removeUserPref=function(e){return(0,r.getTable)().remove(e)};var r=n(766488)},85734:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.VerifiedBusinessNameUpdateType=void 0,t.createOrUpdateVerifiedBusinessName=function(){return s.apply(this,arguments)},t.getAllVerifiedNames=function(){let e=Promise.resolve([]);return e=(0,a.getTable)().all(),e};var i=r(n(348926)),a=n(646240);const o=n(76672).Mirrored(["Replace","Merge"]);function s(){return(s=(0,i.default)((function*(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.Replace;const n=(0,a.getTable)();t===o.Replace?yield n.createOrReplace(e):yield n.createOrMerge(e.id,e)}))).apply(this,arguments)}t.VerifiedBusinessNameUpdateType=o},577721:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addOnProviders=void 0,t.getAddOnProviderForFutureproofMsg=function(e){return s.find((t=>t.matchesFutureproof(e)))},t.getAddOnProviderForMsg=function(e){return s.find((t=>t.matches(e)))},t.getProviderForAddOnType=function(e){var t;return null!==(t=s.find((t=>t.type===e)))&&void 0!==t?t:null};var r=n(275709),i=n(399219),a=n(596070),o=n(744540);n(564121);const s=[a.pollVotesAddOnProvider,r.keepInChatAddOnProvider,o.reactionsAddOnProvider,i.messageEditAddOnProvider];t.addOnProviders=s},275709:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.keepInChatAddOnProvider=void 0;var i=r(n(348926)),a=n(359987),o=n(678794),s=n(373070),l=n(564121),u=n(84461),c=n(421394);const d={type:l.MessageAddOnType.KeepInChat,matches:e=>e.type===s.MSG_TYPE.KEEP_IN_CHAT,matchesFutureproof:e=>e.type===s.MSG_TYPE.UNKNOWN&&e.subtype===s.MSG_TYPE.KEEP_IN_CHAT,canRenderInUi:()=>(0,u.isKeepInChatReadAndUIEnabled)(),processOrphansForNewMsg:(e,t)=>(0,i.default)((function*(){const e=t.map((e=>e.parsedMsgPayload)),n=(0,c.runKeepInChatTieBreaker)(e);if(__LOG__(2)`keepInChatAddOnProvider: found orphan`,null!=n){const e=(0,o.msgDataFromMsgModel)(n);yield(0,a.frontendSendAndReceive)("processKeepInChatMessage",{keepInChatMessage:e,allowNotification:!1})}}))()};t.keepInChatAddOnProvider=d},171461:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapOrphansToProviders=function(e){const t=new Map;for(const i of e){var n;const e=(0,r.getProviderForAddOnType)(i.type);if(!e)continue;const a=null!==(n=t.get(e))&&void 0!==n?n:[];a.push(i),t.set(e,a)}return t};var r=n(577721)},399219:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.messageEditAddOnProvider=void 0;var i=r(n(348926)),a=n(52045),o=n(97858),s=n(373070);const l={type:n(564121).MessageAddOnType.MessageEdit,matches:e=>e.type===s.MSG_TYPE.PROTOCOL&&"message_edit"===e.subtype,matchesFutureproof:e=>e.type===s.MSG_TYPE.UNKNOWN&&"message_edit"===e.subtype,canRenderInUi:()=>(0,o.receiveMessageEditEnabled)(),processOrphansForNewMsg:(e,t)=>(0,i.default)((function*(){var n;const r=null===(n=(yield(0,a.processEditProtocolMsgs)(t.map((e=>e.parsedMsgPayload)))).find((t=>t.parentMsg.id.equals(e.id))))||void 0===n?void 0:n.editedMsgData;r&&Object.assign(e,r)}))()};t.messageEditAddOnProvider=l},596070:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pollVotesAddOnProvider=void 0;var r=n(880860),i=n(963495),a=n(373070),o=n(671598);const s={type:n(564121).MessageAddOnType.PollVote,matches:e=>e.type===a.MSG_TYPE.POLL_UPDATE&&"poll_vote"===e.subtype,matchesFutureproof:e=>e.type===a.MSG_TYPE.UNKNOWN&&e.subtype===a.MSG_TYPE.POLL_UPDATE,canRenderInUi:()=>(0,o.isPollVoteProcessingEnabled)(),processOrphansForNewMsg:(e,t)=>(0,i.processPollUpdateMsgs)(t.map((e=>e.parsedMsgPayload))),updateAcks:(e,t)=>(0,r.updateAddOnAcksForTable)("poll-votes",e,t)};t.pollVotesAddOnProvider=s},280085:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.processOrphansForNewMsg=function(){return u.apply(this,arguments)};var i=r(n(348926)),a=r(n(385564)),o=n(318354),s=n(171461),l=n(467862);function u(){return(u=(0,i.default)((function*(e){const t=yield(0,o.getMessageOrphansByParentMsgKey)(e.id);t.length&&__LOG__(2)`processOrphansForNewMsg: found orphans`;const n=yield(0,s.mapOrphansToProviders)(t),r=[];for(const[t,i]of n.entries())r.push(t.processOrphansForNewMsg(e,i));yield Promise.all(r);const i=(0,a.default)(Array.from(n.values())).map((e=>e.msgKey));yield(0,l.getTable)().bulkRemove(i)}))).apply(this,arguments)}},744540:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.reactionsAddOnProvider=void 0;var i=r(n(348926)),a=n(880860),o=n(373070);const s={type:n(564121).MessageAddOnType.Reaction,matches:e=>e.type===o.MSG_TYPE.REACTION,matchesFutureproof:e=>e.type===o.MSG_TYPE.UNKNOWN&&e.subtype===o.MSG_TYPE.REACTION,canRenderInUi:()=>!0,processOrphansForNewMsg:()=>(0,i.default)((function*(){throw new Error("Reactions not yet integrated into orphan framework")}))(),updateAcks:(e,t)=>(0,a.updateAddOnAcksForTable)("reactions",e,t)};t.reactionsAddOnProvider=s},880860:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.updateAddOnAcksForTable=function(e,t,n){return(0,s.getStorage)().lock([e],function(){var e=(0,a.default)((function*(e){let[r]=e;const a=[],s=new Map;for(const e of t){const t=e.msgKey.toString();a.push(t),s.set(e.msgKey.toString(),e)}const l=yield r.anyOf(["msgKey"],a,{shouldDecrypt:!1}),u=[],c=[];for(const e of l){const t=(0,o.default)(s.get(e.msgKey),"updatesByMsgKey.get(row.msgKey)");if(!n(e,t))continue;const r=(0,i.default)((0,i.default)({},e),{},{ack:t.ack});u.push(r),c.push(t)}return yield r.bulkCreateOrReplace_ALREADY_ENCRYPTED_RECORDS_ONLY(u),c}));return function(){return e.apply(this,arguments)}}())};var i=r(n(81109)),a=r(n(348926)),o=r(n(132375)),s=n(605316)},979504:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.queryAndRemoveLocalLabelAssociation=function(){return s.apply(this,arguments)},t.queryLocalLabelAssociation=o;var i=r(n(348926)),a=n(294715);function o(e){return(0,a.getTable)().anyOf(["associationId","type"],e.map((e=>{let{associationId:t,type:n}=e;return[t,n]})))}function s(){return(s=(0,i.default)((function*(e){const t=yield o(e);yield(0,a.getTable)().bulkRemove(t.map((e=>{let{labelId:t,associationId:n,type:r}=e;return[t,n,r]})))}))).apply(this,arguments)}},318354:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageOrphansByParentMsgKey=function(e){return(0,o.getTable)().equals(["parentMsgKey"],String(e)).then((e=>e.filter(Boolean).map(a.orphanFromDbRow)))},t.getMessageOrphansByParentMsgKeys=function(){return s.apply(this,arguments)};var i=r(n(348926)),a=n(784835),o=n(467862);function s(){return(s=(0,i.default)((function*(e){const t=new Set(e.map((e=>String(e)))),n=yield(0,o.getTable)().anyOf(["parentMsgKey"],Array.from(t)),r=new Map;return n.forEach((e=>{const t=r.get(e.parentMsgKey)||[];t.push(e),r.set(e.parentMsgKey,t)})),r}))).apply(this,arguments)}},784835:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.orphanFromDbRow=function(e){return(0,i.default)((0,i.default)({},e),{},{sender:null==e.sender?null:(0,o.createUserWid)(e.sender),parsedMsgPayload:(0,a.messageFromDbRow)(e.parsedMsgPayload)})};var i=r(n(81109)),a=n(907539),o=n(669050)},777658:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.purgeExpiredOrphanRecords=function(){return d.apply(this,arguments)};var i=r(n(348926)),a=n(171461),o=n(784835),s=n(373070),l=n(121260),u=n(467862),c=r(n(730381));function d(){return(d=(0,i.default)((function*(e,t){const n=(0,c.default)().subtract(e,"days").unix(),r=(0,c.default)().subtract(t,"days").unix(),i=yield(0,u.getTable)().between(["t"],0,n),d=new Set(i.map((e=>e.parentMsgKey))),p=yield(0,l.getTable)().bulkGet(Array.from(d)),_=new Set(p.filter((e=>e&&e.type===s.MSG_TYPE.UNKNOWN)).map((e=>null==e?void 0:e.id))),f=i.filter((e=>!_.has(e.parentMsgKey)||e.t<r)).map(o.orphanFromDbRow),h=yield(0,a.mapOrphansToProviders)(f),g=[];for(const[e,t]of h.entries())null!=e.onRecordsPurged&&g.push(e.onRecordsPurged(t));yield Promise.all(g);const m=f.map((e=>e.msgKey));return(0,u.getTable)().bulkRemove(m)}))).apply(this,arguments)}},43794:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.storeMessageOrphans=function(){return d.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(577721),s=n(147980),l=n(907539),u=n(467862),c=n(564121);function d(){return(d=(0,a.default)((function*(e,t){__LOG__(2)`storeMessageOrphans:`;const n=e.map((e=>{var n,r;return{msgKey:e.id.toString(),parentMsgKey:t(e).toString(),sender:(0,s.getSender)(e).toString(),parsedMsgPayload:(0,l.dbRowFromMessage)((0,i.default)({},e)),type:null!==(n=null===(r=o.addOnProviders.find((t=>t.matches(e))))||void 0===r?void 0:r.type)&&void 0!==n?n:c.MessageAddOnType.Unknown,senderTimestampMs:e.senderTimestampMs,t:e.t}}));yield(0,u.getTable)().bulkCreateOrReplace(n)}))).apply(this,arguments)}},599459:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.pruneExpiredMessages=function(){return u.apply(this,arguments)},t.removeExpiredMessagesFromHistory=function(e){return(0,o.removeMessagesFromHistory)(e.map((e=>e.id.toString())))};var i=r(n(348926)),a=n(990445),o=n(728088),s=n(121260),l=n(421394);function u(){return(u=(0,i.default)((function*(){__LOG__(2,void 0,void 0,void 0,["ephemeral-messages"])`pruneExpiredMessages started`;const e=(yield(0,s.getTable)().lessThan(["expiredTimestamp"],(0,a.unixTime)(),{shouldDecrypt:!1})).filter((e=>!(0,l.isKept)(e.kicState)));return yield(0,o.removeMessagesFromHistory)(e.map((e=>e.id.toString()))),__LOG__(2,void 0,void 0,void 0,["ephemeral-messages"])`pruneExpiredMessages completed`,e}))).apply(this,arguments)}},719060:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.markFutureproofMessagesReparsed=function(){return s.apply(this,arguments)};var i=r(n(348926)),a=n(373070),o=n(121260);function s(){return(s=(0,i.default)((function*(e){try{if(0===e.length)return;const t=(yield(0,o.getTable)().bulkGet(e)).filter(Boolean).filter((e=>e.type===a.MSG_TYPE.UNKNOWN));if(0===t.length)return;const n=t.map((e=>({id:e.id.toString(),futureproofReparsed:!0})));yield(0,o.getTable)().bulkCreateOrMerge(n)}catch(e){throw __LOG__(4,void 0,new Error)`markFutureproofMessagesReparsed: error ${e}`,e}}))).apply(this,arguments)}},728088:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeMessagesFromHistory=function(e){const t=[];return(0,i.initializeWithoutGKs)().then((()=>{if(e.length>0)return(0,s.getTable)().bulkGet(e).then((e=>{e.forEach((e=>{null!=(null==e?void 0:e.rowId)&&t.push(String(e.rowId))}))}))})).then((()=>(0,a.getStorage)().lock(["message","label-association"],(()=>{const t=(0,r.queryAndRemoveLocalLabelAssociation)(e.map((e=>({associationId:e,type:o.LabelAssociationType.Message}))));return Promise.all([(0,s.getTable)().bulkRemove(e),t])})))).then((()=>{t.length>0&&(null==l||l.ftsClient.purge(t).catch((()=>{})))})).then((()=>{})).catch((e=>{throw __LOG__(4,void 0,new Error)`removeMessagesFromHistory: error ${e}`,e}))};var r=n(979504),i=n(749118),a=n(605316),o=n(294715),s=n(121260),l=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(110567));function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}},981360:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.msgFindQuery=function(e,t){if(null!=t.label)return Promise.resolve([]);if("before"===e)return function(){return g.apply(this,arguments)}(t,t.count);if("after"===e)return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_;if(e instanceof d.default){const n=e.remote.toString();return(0,p.getTable)().equals(["id"],e.toString()).then((r=>{if(0===r.length)throw __LOG__(3)`Anchor message ${e.toString()} does not exist in message table`,new f;const i=r[0],a=(0,c.getInChatMsgId)(i.internalId||""),o=(0,c.craftInternalId)(n,a);let l=(0,c.craftInternalId)(n,a+t);return l=(0,c.endOfChat)(e.remote),(0,s.queryChatVisibleMessageHelper)(o,l,{lowerInclusive:!1,upperInclusive:!0},t).then((e=>e.map(u.messageFromDbRow)))}))}return Promise.resolve([])}(t,t.count).catch((0,o.filteredCatch)(f,(()=>({status:404}))));if("star"===e){const e=null==t.id?void 0:new d.default(t);return null!=t.chat?(0,l.getStarredMessagesForChat)(t.chat,t.count,e):(r=t.count,i=e,Promise.resolve().then((()=>{if(null!=i)return(0,p.getTable)().get(i.toString())})).then((e=>{const t=null==e?1/0:e.isStarred;return(0,p.getTable)().between(["isStarred"],0,t,{lowerInclusive:!1,upperInclusive:!1,reverse:!0,limit:r}).then((e=>e.map(u.messageFromDbRow)))})))}if("search"===e){const e={};t.remote&&(e.remote=t.remote.toString()),t.count&&t.page>=0&&(e.limit=t.count,e.page=t.page);return n(110567).ftsClient.search(t.searchTerm,e)}if("media"===e){const e=t.remote,n=null==t.id?void 0:new d.default(t);return"document"===t.media?h(e,t.count,t.direction,"isDocMsg",n).then((e=>e.map(u.messageFromDbRow))):"url"===t.media?h(e,t.count,t.direction,"hasLink",n).then((e=>e.map(u.messageFromDbRow))):Promise.all(["isMediaMsg","isDocMsg","hasLink"].map((r=>h(e,t.count,t.direction,r,n).then((e=>e.map(u.messageFromDbRow)))))).then((e=>{let[t,n,r]=e;const i=[t,r,n].flat();return{docCount:n.length,linkCount:r.length,mediaCount:t.length,messages:i}}))}var r,i;return __LOG__(3)`Message query type ${e} not implemented.`,Promise.reject(new Error(`Message query type ${e} not implemented.`))},t.queryMessageType=h,t.queryVcard=function(e){return(0,p.getTable)().equals(["vcardWAids"],e.toString()).then((e=>e.map(u.messageFromDbRow)))};var i=r(n(81109)),a=r(n(348926)),o=n(924583),s=n(834986),l=n(644034),u=n(907539),c=n(878685),d=r(n(565754)),p=n(121260);const _=20;class f extends Error{constructor(){super(...arguments),this.name="NoAnchorMessageError"}}function h(e,t,n,r,i){return(null==i?Promise.resolve(void 0):(0,p.getTable)().equals(["id"],i.toString())).then((a=>{if(i&&null!=a&&0===a.length)throw __LOG__(3)`Anchor message ${i&&i.toString()} does not exist in message table`,new f;const o=null==a?void 0:a[0];let s,l,u=!1;return"before"===n?(s=(0,c.beginningOfChat)(e),l=null==o?(0,c.endOfChat)(e):(0,c.craftInternalId)(e.toString(),(0,c.getInChatMsgId)(o.internalId||"")),u=!0):(s=null==o?(0,c.beginningOfChat)(e):(0,c.craftInternalId)(e.toString(),(0,c.getInChatMsgId)(o.internalId||"")),l=(0,c.endOfChat)(e)),(0,p.getTable)().between(["internalId",r],[s,0],[l,1/0],{lowerInclusive:!1,upperInclusive:!1,limit:t,reverse:u})}))}function g(){return(g=(0,a.default)((function*(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_;if(!e.remote)return Promise.resolve([]);const n=e.remote.toString();let r;if(e instanceof d.default){const t=yield(0,p.getTable)().equals(["id"],e.toString());if(0===t.length)throw __LOG__(3)`Anchor message ${e.toString()} does not exist in message table`,new f;r=t[0]}let a=(0,c.beginningOfChat)(e.remote),o=(0,c.endOfChat)(e.remote);if(r){const e=(0,c.getInChatMsgId)(r.internalId||""),i=Math.max(0,e-t);o=(0,c.craftInternalId)(n,e),a=(0,c.craftInternalId)(n,i)}a=(0,c.beginningOfChat)(e.remote);const l=yield(0,s.queryChatVisibleMessageHelper)(a,o,(0,i.default)((0,i.default)({},{lowerInclusive:!0,upperInclusive:!1}),{},{reverse:!0}),t);return l.reverse().map(u.messageFromDbRow)}))).apply(this,arguments)}},274745:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t._test=void 0,t.deleteMessagesInMessageRange=function(e,t,n){const{lastMessageTimestamp:r,lastSystemMessageTimestamp:a,messages:o}=t;return(0,d.getStorage)().lock(["message"],function(){var t=(0,i.default)((function*(t){let[i]=t,s=[];const l=[];null!=r&&(l.push(y(e,r,u.MessagePropertyType.IncomingChatMessage,n)),l.push(y(e,r,u.MessagePropertyType.Outgoing,n)));const c=null!=a?a:r;null!=c&&l.push(y(e,c,u.MessagePropertyType.SystemMessage,n)),l.push(function(){return S.apply(this,arguments)}(o,n));const d=yield Promise.all(l);s=s.concat(...d);const p=null==n?void 0:n.skipMessages;return p&&(s=s.filter((e=>!p.has(e)))),yield i.bulkRemove(s),s}));return function(){return t.apply(this,arguments)}}())},t.fixMessageRange=function(e){var t,n;const r=e.messages,i={messages:r,lastMessageTimestamp:e.lastMessageTimestamp};if(__LOG__(2)`syncd: additionalMessages length: ${r.length}`,r.length>f){const{messages:e,newLastMessageTimestamp:t}=g(r,f);null!=t&&(i.lastMessageTimestamp=t,T(i.lastMessageTimestamp,"resultantRange")),i.messages=e}(0,a.numberOrThrowIfTooLarge)(null!==(t=e.lastSystemMessageTimestamp)&&void 0!==t?t:0)>(0,a.numberOrThrowIfTooLarge)(null!==(n=i.lastMessageTimestamp)&&void 0!==n?n:0)&&(i.lastSystemMessageTimestamp=e.lastSystemMessageTimestamp);return i},t.getAdditionalMessages=function(){return h.apply(this,arguments)},t.getFirstSystemMessageTimestamp=function(e){return(0,_.getTable)().between(["messageRangeIndex"],(0,l.beginningOfMessageRange)(e,u.MessagePropertyType.SystemMessage),(0,l.endOfMessageRange)(e,u.MessagePropertyType.SystemMessage),{lowerInclusive:!0,reverse:!1,limit:1,shouldDecrypt:!1}).then((e=>{var t;return(0,l.extractC2STimestampFromMessageRangeIndex)(null===(t=e[0])||void 0===t?void 0:t.messageRangeIndex)}))},t.getLastMessageTimestamp=function(e){return(0,_.getTable)().between(["messageRangeIndex"],(0,l.beginningOfMessageRange)(e,u.MessagePropertyType.IncomingChatMessage),(0,l.endOfMessageRange)(e,u.MessagePropertyType.IncomingChatMessage),{lowerInclusive:!0,reverse:!0,limit:1,shouldDecrypt:!1}).then((e=>{var t;return(0,l.extractC2STimestampFromMessageRangeIndex)(null===(t=e[0])||void 0===t?void 0:t.messageRangeIndex)}))},t.getLastSystemMessageTimestamp=function(e){return(0,_.getTable)().between(["messageRangeIndex"],(0,l.beginningOfMessageRange)(e,u.MessagePropertyType.SystemMessage),(0,l.endOfMessageRange)(e,u.MessagePropertyType.SystemMessage),{lowerInclusive:!0,reverse:!0,limit:1,shouldDecrypt:!1}).then((e=>{var t;return(0,l.extractC2STimestampFromMessageRangeIndex)(null===(t=e[0])||void 0===t?void 0:t.messageRangeIndex)}))},t.logMaybeMillisecondTimestamp=T,t.timestampComparison=m;var i=r(n(348926)),a=n(478337),o=r(n(132375)),s=n(990445),l=n(834986),u=n(878685),c=n(523930),d=n(605316),p=r(n(565754)),_=n(121260);const f=1e3;function h(){return(h=(0,i.default)((function*(e,t,n){const r=(0,_.getTable)().between(["messageRangeIndex"],(0,l.beginningOfMessageRange)(e,u.MessagePropertyType.Outgoing,t),(0,l.endOfMessageRange)(e,u.MessagePropertyType.Outgoing),{reverse:!0,shouldDecrypt:!1}),i=(0,_.getTable)().anyOf(["messageRangeIndex"],[(0,l.beginningOfMessageRange)(e,u.MessagePropertyType.IncomingChatMessage,t),(0,l.beginningOfMessageRange)(e,u.MessagePropertyType.Outgoing,t),(0,l.beginningOfMessageRange)(e,u.MessagePropertyType.Outgoing)],{reverse:!0,shouldDecrypt:!1}),a=yield Promise.all([r,i]).then((e=>{let[t,r]=e;return t.concat(r).filter((e=>-1!==e.ack&&!e.isSendFailure)).filter((e=>!((null==n?void 0:n.excludeStarred)&&e.isStarred))).map((e=>{var t;const n=p.default.fromString(e.id),r=null!==(t=(0,l.extractC2STimestampFromMessageRangeIndex)(e.messageRangeIndex))&&void 0!==t?t:void 0;return{key:(0,c.msgKeyToProtobuf)(n),timestamp:r}}))})),{messages:o,newLastMessageTimestamp:s}=g(a,(null==n?void 0:n.limit)||f);return{messages:o,newLastMessageTimestamp:s}}))).apply(this,arguments)}function g(e,t){const n=[],r=[];if(e.forEach((e=>{null!=e.timestamp?n.push(e):r.push(e)})),n.length<t)return{messages:e};const i=n.sort(m).slice(0,t),s=i[i.length-1];return T(s.timestamp,"smallestTimestampMessage"),{messages:i.concat(r),newLastMessageTimestamp:(0,a.numberOrThrowIfTooLarge)((0,o.default)(s.timestamp,"smallestTimestampMessage.timestamp"))}}function m(e,t){const[n,r]=[e,t].map((e=>(0,a.numberOrThrowIfTooLarge)((0,o.default)(e.timestamp,"syncActionMessage.timestamp"))));return r-n}function y(){return E.apply(this,arguments)}function E(){return(E=(0,i.default)((function*(e,t,n,r){let i=yield(0,_.getTable)().between(["messageRangeIndex"],(0,l.beginningOfMessageRange)(e,n),(0,l.beginningOfMessageRange)(e,n,(0,a.numberOrThrowIfTooLarge)(t)),{lowerInclusive:!0,upperInclusive:!0,shouldDecrypt:!1});return!0===(null==r?void 0:r.forceDeleteAllMessages)||(n===u.MessagePropertyType.SystemMessage&&!1!==(null==r?void 0:r.skipRecentSystemMessages)&&(i=i.filter((e=>!((0,l.isSecuritySensitiveMessage)(e)&&e.t>(0,s.unixTime)()-s.DAY_SECONDS)))),!1!==(null==r?void 0:r.skipStarred)&&(i=i.filter((e=>void 0===e.isStarred))),n===u.MessagePropertyType.SystemMessage&&(i=i.filter((e=>!(0,l.isInitialEncryptionMessage)(e))))),i.map((e=>e.id))}))).apply(this,arguments)}function S(){return(S=(0,i.default)((function*(e,t){const n=e.map((e=>(0,c.protobufToMsgKey)((0,o.default)(e.key,"syncActionMessage.key")).toString())),r=yield(0,_.getTable)().bulkGet(n),i=[];return r.forEach((e=>{null!=e&&(!1!==(null==t?void 0:t.skipStarred)&&null!=e.isStarred||i.push(e.id))})),i}))).apply(this,arguments)}function T(e,t){try{(0,a.numberOrThrowIfTooLarge)(null!=e?e:0)/(0,s.unixTime)()>10&&(__LOG__(4,void 0,new Error,!0)`syncd: large timestamp: ${t} returned a large timestamp: ${e}`,SEND_LOGS(`syncd: ${t} returned a large timestamp`))}catch(t){__LOG__(4,void 0,new Error)`syncd: error reporting logMaybeMillisecondTimestamp for ${e}: ${t}`}}const v={limitAdditionalMessages:g};t._test=v},834986:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.beginningOfMessageRange=function(e,t,n){const r=null!=n?function(e){const t=e.toString(16);return(t.length-1).toString(16)+t}(n):"";return`${e.toString()}_${t}_${r}`},t.endOfMessageRange=function(e,t){return`${e.toString()}_${t}_g`},t.extractC2STimestampFromMessageRangeIndex=function(e){if(e){const t=e.split("_")[2];return t?(0,c.undoOrderPreservingHex)(t):null}return null},t.getKeyMsgsFromChatHistory=function(e,t){const{getAddOnProviderForFutureproofMsg:r}=n(577721);performance.now();const i=(0,o.getABPropConfigValue)("web_init_chat_max_unread_message_count");let a,s,c,p,h=e.unreadCount,g=0;const m=[];let y=0;const E=n(816749).r$;return(0,f.getTable)().between(["internalId"],`${e.id}_/`,`${e.id}_g`,{reverse:!0},(n=>{if(g++,n.type===_.MSG_TYPE.PROTOCOL)return!1;const o=(0,u.messageFromDbRow)(n),f=O(n);if(f)return!1;if(T(n)){const e=r(o);if(!0===n.futureproofReparsed)return!1;if(!(0,d.futureproofReparsingNonAddOnsEnabled)()||f||t){if(null==e?void 0:e.canRenderInUi())return 0!==i&&y>=i?(p||(p=n.id),c||(__LOG__(3)`[init-from-storage] getKeyMsgsFromChatHistory: Exceeded limit ${i} to find a non futureproof reaction message`,c=n),!0):(t||m.push(n),y++,!1)}else m.push(n)}return p||(p=n.id),c||(c=n),s||f||[_.MSG_TYPE.E2E_NOTIFICATION,_.MSG_TYPE.PROTOCOL].includes(n.type)||(s=n),!t&&(null!=s||g>10)||!(!(0===h||0!==i&&e.unreadCount>=i)||!s)||!!(h>0&&(0,l.isUnreadTypeMsg)(n)&&(h-=1,0===h))&&(a=n.id.toString(),!0)})).then((()=>(m.length&&E(m),{anchor:a,previewMsg:s||c,lastReceivedKey:p})))},t.getMessagesBefore=function(e,t){return(0,f.getTable)().between(["internalId"],`${e}_/`,`${e}_g`,{reverse:!0},t)},t.isFutureproof=T,t.isInitialEncryptionMessage=function(e){return e.type===_.MSG_TYPE.E2E_NOTIFICATION&&"encrypt"===e.subtype||e.type===_.MSG_TYPE.NOTIFICATION_TEMPLATE&&"biz_privacy_mode_init_fb"===e.subtype},t.isSecuritySensitiveMessage=function(e){var t;const n=new Map([[_.MSG_TYPE.GP2,["remove","add","ephemeral","invite","leave"]],[_.MSG_TYPE.E2E_NOTIFICATION,["encrypt","encrypt_now","e2e_identity_unavailable","identity","device","chat_psa"]],[_.MSG_TYPE.NOTIFICATION_TEMPLATE,["change_number","masked_thread_created","cag_masked_thread_created","verified_initial_unknown","verified_initial_low","verified_initial_high","verified_transition_any_to_none","verified_transition_any_to_high","verified_transition_high_to_low","verified_transition_high_to_unknown","verified_transition_unknown_to_low","verified_transition_low_to_unknown","verified_transition_none_to_low","verified_transition_none_to_unknown","payment_transaction_status_update_failed","payment_transaction_status_update_refunded","payment_transaction_status_update_refund_failed","payment_transaction_status_receiver_pending_setup","payment_transaction_status_receiver_success_after_hiccup","payment_transaction_request_cancelled","payment_action_account_setup_reminder","payment_action_send_payment_reminder","payment_action_send_payment_invitation","payment_action_request_declined","payment_action_request_expired"]]]);return(null===(t=n.get(e.type))||void 0===t?void 0:t.includes(e.subtype))||!1},t.queryChatMessageHelper=function(){return E.apply(this,arguments)},t.queryChatVisibleMessageHelper=function(){return S.apply(this,arguments)},t.shouldCreateChatWithMsgs=function(e){return e.some((e=>e.type!==_.MSG_TYPE.NOTIFICATION_TEMPLATE))},t.shouldRenderInUI=v;var i=r(n(506479)),a=r(n(348926)),o=n(287461),s=n(402994),l=n(147980),u=n(907539),c=n(878685),d=n(97858),p=r(n(565754)),_=n(373070),f=n(121260),h=n(719438),g=n(459857),m=n(669050);const y=["limit"];function E(){return(E=(0,a.default)((function*(e,t,n){const r=(yield(0,f.getTable)().between(["internalId"],e,t,n)).filter((e=>v(e)));return yield A(r),r}))).apply(this,arguments)}function S(){return(S=(0,a.default)((function*(e,t,r,a){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const{limit:l}=r,c=(0,i.default)(r,y),p=(0,o.getABPropConfigValue)("web_init_chat_max_unread_message_count"),{getAddOnProviderForFutureproofMsg:_}=n(577721),h=[];let g=0;const m=e=>(null!=a&&g===a||!!v(e,s)&&(g++,g>p&&__LOG__(3)`queryChatVisibleMessageHelper: visibleMsgsCount exceeds the threshold`,!1));performance.now();const E=yield(0,f.getTable)().between(["internalId"],e,t,c,m),S=E.filter((e=>{if(T(e)){const t=(0,u.messageFromDbRow)(e),n=_(t);!0!==e.futureproofReparsed&&((0,d.futureproofReparsingNonAddOnsEnabled)()&&!n||(null==n?void 0:n.canRenderInUi())&&!s.includes(e.id.toString()))&&h.push(e)}return!!v(e,s)}));if(h.length){(0,n(816749).r$)(h)}return yield A(S),S}))).apply(this,arguments)}function T(e){return e.type===_.MSG_TYPE.UNKNOWN}function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const{getAddOnProviderForFutureproofMsg:r}=n(577721),i=(0,u.messageFromDbRow)(e),a=O(e),o=r(i);return!a&&((!T(e)||!0!==e.futureproofReparsed)&&(!(o&&o.canRenderInUi()&&!t.includes(e.id.toString()))&&e.type!==_.MSG_TYPE.DEBUG))}function A(){return C.apply(this,arguments)}function C(){return(C=(0,a.default)((function*(e){const t=P(e);if(0===t.length)return;const n=yield(0,h.getTable)().anyOf(["msgKey"],t.map((e=>e.id))),r=new Map,i=[];n.forEach((e=>{const t=(0,m.createWid)(e.receiverUserJid);if((0,g.getMeUser)().equals(t))return;const n=r.get(e.msgKey)||{played:0,read:0,delivery:0};null!=e.played?n.played++:null!=e.read?n.read++:null!=e.delivery&&n.delivery++,r.set(e.msgKey,n)})),t.forEach((e=>{const{ack:t,id:n}=e,a=r.get(n);if(!a)return;let o=null,l=e.count||1;0==(l-=a.played)?o=s.ACK.PLAYED:0==(l-=a.read)?o=s.ACK.READ:0==(l-=a.delivery)&&(o=s.ACK.RECEIVED),null!=o&&o>t&&(e.ack=o,i.push({id:n,ack:o})),i.length>0&&(__LOG__(2,void 0,void 0,void 0,["message-store"])`maybeUpdateMsgAck: storing ack updates ${JSON.stringify(i)}`,(0,f.getTable)().bulkCreateOrMerge(i))}))}))).apply(this,arguments)}function P(e){return e.filter((e=>{if(!(0,l.isUnreadTypeMsg)(e))return!1;if(e.type===_.MSG_TYPE.CIPHERTEXT||e.type===_.MSG_TYPE.UNKNOWN||e.ack<=s.ACK.CLOCK)return!1;const t=p.default.fromString(e.id);if(!t.fromMe)return!1;if(t.remote.isGroup()&&(null!=e.rowId&&e.rowId<1e9||null==e.count))return __LOG__(2,void 0,void 0,void 0,["message-store"])`getMsgMayNeedAckUpdate: skip update for history group message ${e.id}`,!1;if(e.type===_.MSG_TYPE.PTT){if(e.ack===s.ACK.PLAYED)return!1}else if(e.ack===s.ACK.READ)return!1;return!0}))}function O(e){return[_.MSG_TYPE.REACTION,_.MSG_TYPE.REACTION_ENC,_.MSG_TYPE.KEEP_IN_CHAT,_.MSG_TYPE.POLL_UPDATE].includes(e.type)}},484777:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.filterReceivedMessagesInRange=function(){return c.apply(this,arguments)},t.getMsgByMsgKey=function(e){let t;t=e instanceof l.default?e.toString():e;return(0,u.getTable)().get(t).then((e=>e?(0,o.messageFromDbRow)(e):null))},t.getMsgsByMsgKey=function(e){return(0,u.getTable)().bulkGet(e).then((e=>e.filter(Boolean).map(o.messageFromDbRow)))};var i=r(n(348926)),a=r(n(132375)),o=n(907539),s=n(523930),l=r(n(565754)),u=n(121260);function c(){return(c=(0,i.default)((function*(e,t){if(0===t.length)return t;const n=t.map((e=>(0,s.protobufToMsgKey)((0,a.default)(e.key,"syncActionMessage.key")).toString())),r=yield(0,u.getTable)().bulkGet(n,!1);return t.filter(((e,t)=>null!=r[t]))}))).apply(this,arguments)}},741748:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.storeInitialSyncMessages=function(){return M.apply(this,arguments)},t.storeRecentAndFullHistSyncMessages=function(){return b.apply(this,arguments)};var i=r(n(348926)),a=r(n(402525)),o=n(652568),s=n(990445),l=n(493928),u=n(697588),c=n(298466),d=n(260071),p=n(482388),_=n(147980),f=n(436005),h=n(890490),g=n(907539),m=n(6007),y=n(110567),E=n(307988),S=n(446303),T=n(605316),v=n(373070),A=n(558249),C=r(n(642034)),P=n(669050),O=r(n(986128));const I=1e9;function M(){return(M=(0,i.default)((function*(e){yield f.DbEncKeyStore.waitForFinalDbMsgEncKey();let t=0;(0,a.default)(e,(e=>{let{msgs:n}=e;return t+=n.length}));const r=new Map,d=new Map,_=yield(0,o.promiseReduce)(Object.keys(e),function(){var t=(0,i.default)((function*(t,n){let i=t.nextRowId,a=I-e[n].msgs.length;const{pendingUnreadIds:o,unreadMentions:s}=yield R(e[n].chatInfo.unreadCount||0,e[n].msgs);(0,l.isGroupCatchUpEnabled)()&&s.length&&r.set(n,s);const u=[];return e[n].msgs.forEach((e=>{try{i++,a++,e.isMdHistoryMsg=!0;const t=(0,g.dbRowFromMessage)(e),r=(0,p.addMsgMetadataToMsgRow)(t,(0,P.createWid)(n).toString(),!!(0,S.findLink)(e.body,!0),i,a,o.has(String(e.id)));u.push(r)}catch(n){var t,r;if(n instanceof h.DroppingMsgRowDueToLogout)throw n;__LOG__(3,void 0,void 0,void 0,["message-store"])`storeInitialSyncMessages failed for msg: ${null===(t=e.id)||void 0===t?void 0:t.id} from ${null===(r=e.id)||void 0===r?void 0:r.remote}`,__LOG__(4,void 0,new Error,void 0,["message-store"])`storeInitialSyncMessages failed with error: ${n.name}, message: ${n.message}, stack: ${n.stack}`}})),{nextRowId:i,messages:t.messages.concat(u)}}));return function(){return t.apply(this,arguments)}}(),{nextRowId:I-t,messages:[]});return _.messages.forEach((e=>{e.type===v.MSG_TYPE.GROUPS_V4_INVITE&&(0,c.persistGroupInviteV4Msg)(e.id.toString(),{id:e.id.toString(),from:e.from.toString(),to:e.to.toString(),groupId:e.inviteGrp,expiration:parseInt(e.inviteCodeExp,10),expired:(0,s.unixTime)()>=parseInt(e.inviteCodeExp,10)})})),(0,l.isGroupCatchUpEnabled)()&&r.size&&(r.forEach(((e,t)=>{var r,i;const a=n(965012).ChatCollection.get((0,P.createWid)(t)),o=e.map((e=>{let{id:t,timestamp:n}=e;return new C.default({id:t,timestamp:n})})),s=null==a||null===(r=a.groupMetadata)||void 0===r?void 0:r.unreadMentionMetadata,l=null!==(i=null==s?void 0:s.pendingUnreadMentionCount)&&void 0!==i?i:0;(null==s?void 0:s.pendingUnreadMentionCount)&&(s.pendingUnreadMentionCount=Math.max(l-o.length,0),d.set(t,s.pendingUnreadMentionCount)),null==s||s.addUnreadMentions(o,E.UnreadMessageType.HISTORYC_SYNC_CHUNK)})),(0,u.addUnreadMentionChat)(r,d)),(0,T.getStorage)().lock(["message"],(e=>{let[t]=e;return t.bulkCreate(_.messages).catch((e=>{if(__LOG__(3)`Error storing MD initial sync messages with error ${e}`,e instanceof O.default.BulkError||e instanceof O.default.ConstraintError)return __LOG__(2,void 0,void 0,void 0,["History sync"])`Retrying initial sync bulk add on error`,t.bulkCreateOrMerge(_.messages);throw e}))})).then((()=>{O.default.ignoreTransaction((()=>{(0,A.getTable)().bulkCreateOrReplace(_.messages.map((e=>({id:String(e.rowId)})))).then((()=>{y.ftsClient.index().catch((()=>{}))}))}))})).catch((e=>{__LOG__(3)`Error storing MD initial sync messages with error ${e} after retry`}))}))).apply(this,arguments)}function b(){return(b=(0,i.default)((function*(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=e;const o=n(965012).ChatCollection,p=new Map,f=new Map;try{a=yield(0,d.applyOrphanRevokes)(e)}catch(e){__LOG__(4,void 0,new Error,void 0,["History sync"])`applyOrphanRevokes failed with error ${e}`}a.forEach((e=>{if(e.type===v.MSG_TYPE.GROUPS_V4_INVITE&&(0,c.persistGroupInviteV4Msg)(e.id.toString(),{id:e.id.toString(),from:e.from.toString(),to:e.to.toString(),groupId:e.inviteGrp,expiration:parseInt(e.inviteCodeExp,10),expired:(0,s.unixTime)()>=parseInt(e.inviteCodeExp,10)}),(0,l.isGroupCatchUpEnabled)()&&(0,_.isImportantMessage)(e)){const a=e.id.remote.toString();let s=0;if(f.has(a)){var t;s=null!==(t=f.get(a))&&void 0!==t?t:0}else{var n,r;const e=o.get(a);s=null!==(n=null==e||null===(r=e.groupMetadata)||void 0===r?void 0:r.unreadMentionMetadata.pendingUnreadMentionCount)&&void 0!==n?n:0,f.set(a,s)}if(s>0){f.set(a,s-1);const t={id:e.id.toString(),timestamp:e.t};var i;if(p.has(a))null===(i=p.get(a))||void 0===i||i.push(t);else p.set(a,[t])}}}));const g=yield(0,h.encryptMultipleDBMsgs)(a,r);return(0,m.storeEncryptedDBMessages)(g,t,i).then((()=>{(0,l.isGroupCatchUpEnabled)()&&p.size>0&&(p.forEach(((e,t)=>{var n,r;const i=o.get(t),a=null!==(n=f.get(t))&&void 0!==n?n:0,s=null==i||null===(r=i.groupMetadata)||void 0===r?void 0:r.unreadMentionMetadata;if(0===(null==s?void 0:s.pendingUnreadMentionCount)||(null==i?void 0:i.hasChatBeenOpened))p.delete(t);else if(s&&s.pendingUnreadMentionCount>0){s.pendingUnreadMentionCount=a;const t=e.map((e=>new C.default({id:e.id.toString(),timestamp:e.timestamp})));s.addUnreadMentions(t,E.UnreadMessageType.HISTORYC_SYNC_CHUNK)}})),p.size>0&&(0,u.addUnreadMentionChat)(p,f))})).catch((()=>{__LOG__(3)`Error storing MD recent or full sync messages`}))}))).apply(this,arguments)}function R(){return N.apply(this,arguments)}function N(){return(N=(0,i.default)((function*(e,t){let n=e;const r=new Set,i=[];for(let e=t.length-1;e>=0&&!(n<=0);e--){const a=t[e];if((yield(0,p.isPendingUnreadReceipt)(a.id,a))&&(n--,r.add(String(a.id)),(0,l.isGroupCatchUpEnabled)()&&(0,_.isImportantMessage)(a))){const e={id:String(a.id),timestamp:a.t};i.push(e)}}return{pendingUnreadIds:r,unreadMentions:i}}))).apply(this,arguments)}},394275:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.PreviousMsgNotUpdatableError=t.DuplicateMessageError=void 0,t.processGroupInviteMessages=function(){return T.apply(this,arguments)},t.starMessages=function(e){return(0,h.getTable)().bulkGet(e).then((e=>{const t=e.filter(Boolean).map((e=>({id:e.id,isStarred:e.rowId})));return(0,h.getTable)().bulkCreateOrMerge(t)}))},t.storeMessages=function(){return E.apply(this,arguments)},t.unstarMessages=function(e){return(0,h.getTable)().bulkCreateOrMerge(e.map((e=>({id:e,isStarred:void 0}))))},t.updateExistingMessages=function(e,t){var n;const r=null==t?null===(n=e[0])||void 0===n?void 0:n.id.remote:t;if(r){const t=e.map((e=>{const t=(0,c.dbRowFromMessage)(e);return(0,s.addMsgMetadataToMsgRow)(t,r.toString(),!!(0,p.findLink)(e.body,!0))}));return Promise.resolve((0,h.getTable)().bulkCreateOrMerge(t)).then((()=>{d.ftsClient.index().catch((()=>{}))})).catch((e=>{throw __LOG__(3)`Error storing messages`,e}))}return Promise.resolve()},t.updateMessage=function(e){if(S(e))return Promise.resolve();return(0,_.getStorage)().lock(["message"],function(){var t=(0,i.default)((function*(t){let[n]=t;const r=yield n.get(e.id.toString());if(!r)throw new Error(`[messaging] updateMessage: msgId::${e.id.toString()}, Failed to find previous message row in message table`);if(!S(r)&&!function(e){return(null==e?void 0:e.type)===f.MSG_TYPE.UNKNOWN}(r))throw __LOG__(2,void 0,void 0,void 0,["messaging"])`updateMessage: msgId::${e.id.toString()}, Previous row in message table is not a placeholder or futureproof`,new y;null!=r.t&&(e.t=r.t),r.ack>e.ack&&(e.ack=r.ack);const i=(0,s.addMsgMetadataToMsgRow)((0,c.dbRowFromMessage)(e),e.from.toString(),!!(0,p.findLink)(e.body,!0),void 0,void 0,r.pendingReadReceipt);if(i.rowId=r.rowId,i.internalId=r.internalId,null==i.rowId||null==i.internalId)throw new Error(`[messaging] updateMessage: msgId::${e.id.toString()}, missing rowId or internalId`);yield n.createOrReplace(i),S(r)&&(0,l.frontendFireAndForget)("populatePlaceholderWamAction",{msgRow:r}),d.ftsClient.index().catch((()=>{}))}));return function(){return t.apply(this,arguments)}}())};var i=r(n(348926)),a=n(990445),o=n(298466),s=n(482388),l=n(359987),u=n(436005),c=n(907539),d=n(110567),p=n(446303),_=n(605316),f=n(373070),h=n(121260),g=r(n(986128));class m extends Error{constructor(){super(...arguments),this.name="DuplicateMessageError"}}t.DuplicateMessageError=m;class y extends Error{constructor(){super(...arguments),this.name="PreviousMsgNotUpdatableError"}}function E(){return(E=(0,i.default)((function*(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return yield u.DbEncKeyStore.waitForFinalDbMsgEncKey(),Promise.resolve((0,s.storeMessageInTransaction)(e,t,n)).then((()=>{d.ftsClient.index().catch((()=>{}))})).catch((e=>{throw e instanceof g.default.BulkError||e instanceof g.default.ConstraintError?new m:(__LOG__(3)`Error storing messages`,e)}))}))).apply(this,arguments)}function S(e){if(null==e?void 0:e.type){if(e.type===f.MSG_TYPE.CIPHERTEXT)return!0;if(e.type===f.MSG_TYPE.UNKNOWN&&"fanout"===e.subtype)return!0}return!1}function T(){return(T=(0,i.default)((function*(e){return yield Promise.all(e.map((e=>(0,o.persistGroupInviteV4Msg)(e.id.toString(),{id:e.id.toString(),from:e.from.toString(),to:e.to.toString(),groupId:e.inviteGrp,expiration:parseInt(e.inviteCodeExp,10),expired:(0,a.unixTime)()>=parseInt(e.inviteCodeExp,10)})))),Promise.resolve()}))).apply(this,arguments)}t.PreviousMsgNotUpdatableError=y},599580:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.getBoundsForChat=function(){return u.apply(this,arguments)},t.queryAndRemoveMessageHistory=function(){return d.apply(this,arguments)},t.queryAndRemoveMessagesInMessageRange=function(){return c.apply(this,arguments)};var i=r(n(348926)),a=n(274745),o=n(878685),s=n(110567),l=n(121260);function u(){return(u=(0,i.default)((function*(e){const t=(0,o.beginningOfChat)(e),n=(0,o.endOfChat)(e),r=yield(0,l.getTable)().between(["internalId"],t,n,{lowerInclusive:!1,upperInclusive:!1,limit:1});if(0===r.length)return null;const i=r[0].rowId,a=yield(0,l.getTable)().between(["internalId"],t,n,{lowerInclusive:!1,upperInclusive:!1,limit:1,reverse:!0});if(0===a.length)return null;const s=a[0].rowId,u=a[0].t;return null==i||null==s?null:{startRowId:i,endRowId:s,tsOfLastMessage:u}}))).apply(this,arguments)}function c(){return(c=(0,i.default)((function*(e,t,n){const r=yield(0,a.deleteMessagesInMessageRange)(e,t,n);return s.ftsClient.purge(r).catch((()=>{})),r}))).apply(this,arguments)}function d(){return(d=(0,i.default)((function*(e){const t=(0,o.beginningOfChat)(e),n=(0,o.endOfChat)(e),r=yield(0,l.getTable)().between(["internalId"],t,n,{lowerInclusive:!1,upperInclusive:!1,returnKeyType:"primary_key"});return yield(0,l.getTable)().bulkRemove(r),r}))).apply(this,arguments)}},482388:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addMsgMetadataToMsgRow=O,t.isPendingUnreadReceipt=v,t.storeMessageInTransaction=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=null==t?e[0].id.remote:t,i=(0,_.beginningOfChat)(r),o=(0,_.endOfChat)(r);return(0,h.getStorage)().lock(["chat","message"],function(){var t=(0,a.default)((function*(t){let[s,u]=t;const c=yield s.get(r.toString());if(!r.isStatusV3()&&(null!=c||T(e))){const t=yield C(c,e,r);yield s.createOrMerge(r.toString(),t)}const d=u.all({reverse:!n,limit:1,index:["rowId"],returnKeyType:"keys"}).then((e=>0===e.length?S:e[0])),h=u.between(["internalId"],i,o,{limit:1,reverse:!n,returnKeyType:"keys"}).then((e=>0===e.length?S:(0,_.getInChatMsgId)(e[0]))),[g,m]=yield Promise.all([d,h]),y=n?g-e.length:g+1,E=n?m-e.length:m+1,A=yield(0,l.promiseMap)(e,function(){var e=(0,a.default)((function*(e,t){const i=(0,p.dbRowFromMessage)(e),a=!n&&(yield v(e.id,e));return O(i,r.toString(),!!(0,f.findLink)(e.body,!0),y+t,E+t,a)}));return function(){return e.apply(this,arguments)}}());return u.bulkCreate(A).then((()=>A))}));return function(){return t.apply(this,arguments)}}()).then((e=>{E.default.ignoreTransaction((()=>{(0,y.getTable)().bulkCreateOrReplace(e.map((e=>({id:String(e.rowId)}))))}))}))};var i=r(n(81109)),a=r(n(348926)),o=n(616310),s=n(476809),l=n(917140),u=n(493928),c=n(359987),d=n(147980),p=n(907539),_=n(878685),f=n(446303),h=n(605316),g=r(n(565754)),m=n(373070),y=n(558249),E=r(n(986128));const S=1e9;function T(e){return e.some((e=>e.type!==m.MSG_TYPE.NOTIFICATION_TEMPLATE))}function v(){return A.apply(this,arguments)}function A(){return(A=(0,a.default)((function*(e,t){if(e.fromMe||e.remote.isStatusV3())return!1;const n=yield(0,c.frontendSendAndReceive)("getEventTypeFromMsgType",{msg:t});return n===d.EventType.AMBIENT||n===d.EventType.DEFAULT}))).apply(this,arguments)}function C(){return P.apply(this,arguments)}function P(){return(P=(0,a.default)((function*(e,t,n){var r;let i,o=Math.max(0,e?e.unreadCount:0);const l=null!==(r=null==e?void 0:e.unreadMentionsOfMe)&&void 0!==r?r:[];return yield(0,s.promiseEach)(t,function(){var e=(0,a.default)((function*(e){const t=yield(0,c.frontendSendAndReceive)("getEventTypeFromMsgType",{msg:e});if(t!==d.EventType.IGNORE&&(e&&null!=e.t&&(null==i||e.t>i)&&(i=e.t),t!==d.EventType.AMBIENT&&t!==d.EventType.DEFAULT||e.id.fromMe||(o+=1),(0,u.isGroupCatchUpEnabled)())){if((yield v(e.id,e))&&(0,d.isImportantMessage)(e)){const t={id:e.id.toString(),timestamp:e.t};l.push(t)}}}));return function(){return e.apply(this,arguments)}}()),e&&null!=e.t&&(null==i||e.t>i)&&(i=e.t),{id:n.toString(),unreadCount:o,t:i,unreadMentionsOfMe:l}}))).apply(this,arguments)}function O(e,t,n,r,a,s){var l;const u=[m.MSG_TYPE.IMAGE,m.MSG_TYPE.VIDEO,m.MSG_TYPE.AUDIO].includes(e.type),c=(0,i.default)((0,i.default)({},e),{},{vcardWAids:e.vcardWAids||(0,_.getVcardWids)(e),id:e.id.toString(),isStarred:e.star?r:void 0,hasLink:"chat"===e.type&&n?r:void 0,isMediaMsg:u?r:void 0,isDocMsg:e.type===m.MSG_TYPE.DOCUMENT?r:void 0,expiredTimestamp:null!==(l=(0,d.getEphemeralExpirationTimestamp)(e))&&void 0!==l?l:void 0});null!=r&&(c.rowId=r),null!=a&&(c.internalId=(0,_.craftInternalId)(t,a)),s&&t!==o.STATUS_JID&&(c.pendingReadReceipt=1);let p=e.c2sTimestamp;var f;e.id.fromMe?p=null!==(f=e.c2sTimestamp)&&void 0!==f?f:e.t:p=e.t;try{e.type!==m.MSG_TYPE.REACTION&&(c.messageRangeIndex=(0,_.craftMessageRangeIndex)(t,!g.default.fromString(e.id).fromMe,m.SYSTEM_MESSAGE_TYPES.includes(e.type),p))}catch(e){__LOG__(4,void 0,new Error)`[process-msg] craftMessageRangeIndex failed with error ${e}`}return c}},74927:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DuplicateMessageError",{enumerable:!0,get:function(){return r.DuplicateMessageError}}),Object.defineProperty(t,"getMsgByMsgKey",{enumerable:!0,get:function(){return a.getMsgByMsgKey}}),Object.defineProperty(t,"getMsgsByMsgKey",{enumerable:!0,get:function(){return a.getMsgsByMsgKey}}),Object.defineProperty(t,"msgFindQuery",{enumerable:!0,get:function(){return i.msgFindQuery}}),Object.defineProperty(t,"queryVcard",{enumerable:!0,get:function(){return i.queryVcard}}),Object.defineProperty(t,"removeMessagesFromHistory",{enumerable:!0,get:function(){return o.removeMessagesFromHistory}}),Object.defineProperty(t,"starMessages",{enumerable:!0,get:function(){return r.starMessages}}),Object.defineProperty(t,"storeMessages",{enumerable:!0,get:function(){return r.storeMessages}}),Object.defineProperty(t,"unstarMessages",{enumerable:!0,get:function(){return r.unstarMessages}}),Object.defineProperty(t,"updateExistingMessages",{enumerable:!0,get:function(){return r.updateExistingMessages}}),Object.defineProperty(t,"updateMessage",{enumerable:!0,get:function(){return r.updateMessage}});var r=n(394275),i=n(981360),a=n(484777),o=n(728088)},889392:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.changeOrphanStateReactions=function(e){return(0,a.getStorage)().lock(["reactions"],function(){var t=(0,i.default)((function*(t){let[n]=t;const r=e.map((e=>[e,1])),i=yield(0,o.getTable)().anyOf(["parentMsgKey","orphan"],r);return i.forEach((e=>{e.orphan=0,e.orphanReason=void 0})),yield n.bulkCreateOrReplace(i),i}));return function(){return t.apply(this,arguments)}}())};var i=r(n(348926)),a=n(605316),o=n(237)},822246:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.createOrUpdateReactions=function(e){const t=new Map;return e.forEach((e=>{const{parentMsgKey:n,senderUserJid:r}=e;(0,o.isSerializedWidMe)(r)&&(e.read=!0);const i=`${n},${r}`,a=t.get(i);a?a.timestamp<=e.timestamp&&t.set(i,e):t.set(i,e)})),(0,a.getStorage)().lock(["reactions"],function(){var e=(0,i.default)((function*(e){let[n]=e;const r=Array.from(t.values()).map((e=>[e.parentMsgKey,e.senderUserJid]));return(yield n.anyOf(["parentMsgKey","senderUserJid"],r)).forEach((e=>{const n=`${e.parentMsgKey},${e.senderUserJid}`,r=t.get(n);r&&r.timestamp<=e.timestamp&&t.delete(n)})),yield n.bulkCreateOrReplace(Array.from(t.values())),Array.from(t.values())}));return function(){return e.apply(this,arguments)}}())};var i=r(n(348926)),a=n(605316),o=n(459857)},297673:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.existsReaction=function(e){return(0,u.getTable)().get([e.parentMsgKey,e.senderUserJid])},t.getAllReactionsFromParentMsgs=function(e){return(0,s.getStorage)().lock(["reactions"],(t=>{let[n]=t;return n.anyOf(["parentMsgKey"],e)}))},t.getFilteredReactionsFromParentMsgs=function(){return p.apply(this,arguments)},t.getReactions=function(){return d.apply(this,arguments)};var i=r(n(348926)),a=n(476809),o=n(359987),s=n(605316),l=n(403385),u=n(237),c=r(n(929770));function d(){return(d=(0,i.default)((function*(e){const t=yield(0,u.getTable)().equals(["parentMsgKey"],e),n={reactions:[],reactionByMe:null},r=new Map;yield(0,a.promiseEach)(t,function(){var e=(0,i.default)((function*(e){const{reactionText:t,orphan:i}=e;if(t!==l.REVOKED_REACTION_TEXT&&1!==i){var a;const i=yield(0,o.frontendSendAndReceive)("getEmojiAggregate",{emoji:t}),s=null!==(a=r.get(i))&&void 0!==a?a:[];r.set(i,[...s,e]);(0,c.default)(e.msgKey).fromMe&&(n.reactionByMe=e)}}));return function(){return e.apply(this,arguments)}}());const s=n.reactionByMe?yield(0,o.frontendSendAndReceive)("getEmojiAggregate",{emoji:n.reactionByMe.reactionText}):"";return r.forEach(((e,t)=>{let r=!1;t===s&&(r=!0),n.reactions.push({aggregateEmoji:t,senders:e,hasReactionByMe:r})})),n}))).apply(this,arguments)}function p(){return(p=(0,i.default)((function*(e){const t=new Map;return yield(0,s.getStorage)().lock(["reactions"],function(){var n=(0,i.default)((function*(n){let[r]=n;(yield r.anyOf(["parentMsgKey"],e)).forEach((e=>{const{reactionText:n,orphan:r}=e;if(n!==l.REVOKED_REACTION_TEXT&&1!==r){var i;const n=null!==(i=t.get(e.parentMsgKey))&&void 0!==i?i:[];n.push(e),t.set(e.parentMsgKey,n)}}))}));return function(){return n.apply(this,arguments)}}()),t}))).apply(this,arguments)}},200199:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.markReactionRowsAsRead=function(e){return s({reactions:e,read:!0})},t.markReactionsAsReadByMessageKeysInStore=function(e){return(0,o.getStorage)().lock(["reactions"],function(){var t=(0,a.default)((function*(t){let[n]=t;const r=(yield n.anyOf(["msgKey"],e.map((e=>e.toString())))).map((e=>(0,i.default)((0,i.default)({},e),{},{read:!0})));return yield n.bulkCreateOrReplace(r),r}));return function(){return t.apply(this,arguments)}}())},t.markReactionsAsReadOrOrphan=s;var i=r(n(81109)),a=r(n(348926)),o=n(605316);n(23030);function s(e){let{reactions:t,read:n,orphan:r,orphanReason:s}=e;return 0===t.length?Promise.resolve():(0,o.getStorage)().lock(["reactions"],function(){var e=(0,a.default)((function*(e){let[a]=e;const o=t.map((e=>[e.parentMsgKey,e.senderUserJid])),l=yield a.anyOf(["parentMsgKey","senderUserJid"],o),u={};n&&(u.read=n),void 0!==r&&(u.orphan=r,void 0!==s&&(u.orphanReason=s));const c=l.map((e=>(0,i.default)((0,i.default)({},e),u)));return a.bulkCreateOrReplace(c)}));return function(){return e.apply(this,arguments)}}())}},963381:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.PARENT_MSG_PLACEHOLDER_ORPHAN_THRESHOLD=void 0,t.pruneExpiredOrphanReactions=function(){return(0,s.getStorage)().lock(["reactions"],function(){var e=(0,i.default)((function*(e){let[t]=e;const n=yield(0,l.getTable)().equals(["orphan"],1),r=[];n.forEach((e=>{const t=(0,a.castToUnixTime)(e.timestamp/1e3);let n;if(e.orphanReason===u.OrphanReactionsReasonType.ParentMsgMissing?n=(0,o.getABPropConfigValue)("reaction_cleanup_days"):e.orphanReason===u.OrphanReactionsReasonType.ParentMsgPlaceholder?n=60:e.orphanReason===u.OrphanReactionsReasonType.ParentMsgFutureproof&&(n=null),null!=n){!(0,a.happenedWithin)(t,a.DAY_SECONDS*n)&&r.push(e)}}));const i=r.map((e=>[e.parentMsgKey,e.senderUserJid]));if(i.length>0)return t.bulkRemove(i)}));return function(){return e.apply(this,arguments)}}())};var i=r(n(348926)),a=n(990445),o=n(287461),s=n(605316),l=n(237),u=n(23030);t.PARENT_MSG_PLACEHOLDER_ORPHAN_THRESHOLD=60},427138:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("abpropConfigs").version((0,a.abpropsConfigCreateTable)(),[new s.default("configCode"),new o.default("configValue"),new o.default("configExpoKey")]).version((0,a.addHasAccessedToAbpropsConfigTable)(),[new o.default("hasAccessed")]).view((e=>({configCode:e.configCode,configValue:e.configValue,configExpoKey:e.configExpoKey,hasAccessed:e.hasAccessed})))},t.getTable=function(){return(0,i.getStorage)().table("abpropConfigs")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712))},574017:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ActiveRangeAction=void 0,t.addTable=function(){(0,i.getStorage)().add("active-message-ranges").version((0,a.activeMessageRangesCreateTable)(),[new l.default(["chatId","action"]),new s.default("chatId"),new o.default("actionValue"),new o.default("remainingMessages")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("active-message-ranges")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(599395)),l=r(n(277631));const u=Object.freeze({Unknown:"unknown",Archive:"archive",MarkChatAsRead:"markChatAsRead",ClearChatKeepStarredKeepMedia:"clearChat_0_0",ClearChatKeepStarredDeleteMedia:"clearChat_0_1",ClearChatDeleteStarredKeepMedia:"clearChat_1_0",ClearChatDeleteStarredDeleteMedia:"clearChat_1_1",DeleteChatDeleteMedia:"deleteChat_1",DeleteChatKeepMedia:"deleteChat_0"});t.ActiveRangeAction=u},402593:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("agent").version((0,a.agentCreateTable)(),[new s.default("id"),new o.default("deviceId"),new o.default("name"),new o.default("isDeleted")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("agent")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712))},287844:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("blocklist").version((0,a.blocklistCreateTable)(),[new o.default("id")]).view((e=>({id:e.id})))},t.getTable=function(){return(0,i.getStorage)().table("blocklist")};var i=n(605316),a=n(526456),o=r(n(874712))},950242:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("cart").version((0,a.cartCreateTable)(),[new s.default("id"),new o.default("products"),new o.default("message"),new o.default("total"),new o.default("currency"),new o.default("itemCount")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("cart")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712))},76085:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("chat").version((0,a.chatCreateTable)(),[new u.default("id"),new o.default("t"),new o.default("unreadCount"),new o.default("archive"),new o.default("isReadOnly"),new o.default("isAnnounceGrpRestrict"),new o.default("modifyTag"),new o.default("muteExpiration"),new o.default("isAutoMuted"),new o.default("name"),new o.default("notSpam"),new o.default("pin"),new o.default("changeNumberOldJid"),new o.default("changeNumberNewJid"),new o.default("ephemeralDuration"),new o.default("ephemeralSettingTimestamp"),new o.default("unreadMsgAnchorId"),new o.default("endOfHistoryTransferType"),new o.default("lastReactionPreview"),new o.default("chatlistPreview")]).version((0,a.chatAddDisappearingModeInitiator)(),[new o.default("disappearingModeInitiator")]).version((0,a.addUnreadMentionToChatTable)(),[new o.default("unreadMentionsOfMe")]).version((0,a.addUnreadMentionCountToChatTable)(),[new o.default("unreadMentionCount")]).version((0,a.addTcTokenToChatTable)(),[new s.AddEncryptedColumn("tcToken",s.ENCRYPTED_VALUE_TYPE.ARRAY_BUFFER)]).version((0,a.addTcTokenTimestampToChatTable)(),[new o.default("tcTokenTimestamp"),new l.default("tcTokenTimestamp")]).version((0,a.addArchiveAtMentionViewedInDrawer)(),[new o.default("archiveAtMentionViewedInDrawer")]).version((0,a.addTcTokenSenderTimestampToChatTable)(),[new o.default("tcTokenSenderTimestamp")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("chat")};var i=n(605316),a=n(526456),o=r(n(372407)),s=n(345632),l=r(n(599395)),u=r(n(874712))},936771:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add(l).version((0,a.chatAssignmentCreateTable)(),[new s.default("id"),new o.default("chatId"),new o.default("agentId"),new o.default("chatOpenedByAgent")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table(l)};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712));const l="chat-assignment"},873762:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,o.getStorage)().add(d).version((0,s.addChatThreadLoggingTable)(),[new c.default(["chatId","startTs"]),new u.default("chatId"),new u.default("startTs"),new l.default("msgsSent"),new l.default("msgsReceived"),new l.default("viewOnceMsgsSent"),new l.default("viewOnceMsgsReceived"),new l.default("viewOnceMessagesOpened"),new l.default("callOffersSent"),new l.default("callOffersReceived"),new l.default("totalCallDuration"),new l.default("commerceMsgsSent"),new l.default("commerceMsgsReceived"),new l.default("pdpInquiriesSent"),new l.default("reactionsSent"),new l.default("reactionsReceived"),new l.default("forwardMessagesSent"),new l.default("forwardMessagesReceived"),...[...a.COUNT_FIELD_NAMES,...i.FLAG_FIELD_NAMES].map((e=>new l.default(e)))]).view((e=>e))},t.getTable=function(){return(0,o.getStorage)().table(d)};var i=n(742988),a=n(244612),o=n(605316),s=n(526456),l=r(n(372407)),u=r(n(599395)),c=r(n(277631));const d="chat-thread-logging-pending-events"},396033:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("collection-version").version((0,a.collectionVersionCreateTable)(),[new s.default("collection"),new o.default("version"),new o.default("state"),new o.default("finiteFailureStartTime"),new o.default("ltHash"),new o.default("isCollectionInMacMismatchFatal")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("collection-version")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712))},490474:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("contact").version((0,a.contactCreateTable)(),[new l.default("id"),new o.default("name"),new o.default("shortName"),new o.default("pushname"),new o.default("type"),new o.default("verifiedName"),new o.default("isBusiness"),new o.default("isEnterprise"),new o.default("verifiedLevel"),new o.default("statusMute"),new o.default("sectionHeader"),new o.default("isAddressBookContact"),new s.default("isAddressBookContact")]).version((0,a.contactAddIsContactSyncCompleted)(),[new o.default("isContactSyncCompleted"),new s.default("isContactSyncCompleted")]).version((0,a.contactAddDisappearingModeProperties)(),[new o.default("disappearingModeDuration"),new o.default("disappearingModeSettingTimestamp")]).version((0,a.contactAddHash)(),[new o.default("contactHash"),new s.default("contactHash")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("contact")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(599395)),l=r(n(874712))},88134:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("device-list").version((0,a.deviceListCreateTable)(),[new s.default("id"),new o.default("devices"),new o.default("nextVersion"),new o.default("rawId"),new o.default("timestamp"),new o.default("validIndexes"),new o.default("currentIndex")]).version((0,a.deviceListAddDelete)(),[new o.default("deleted")]).version((0,a.deviceListAddV2Fields)(),[new o.default("expectedTs"),new o.default("expectedTsLastDeviceJobTs"),new o.default("expectedTsUpdateTs")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("device-list")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712))},55519:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("direct-connection-keys").version((0,a.directConnectionKeysCreateTable)(),[new s.default("id"),new o.default("certificateChain"),new o.default("cypher"),new o.default("cypherExpirationTimestamp")]).version((0,a.directConnectionKeysAddPostcodeColumns)(),[new o.default("cypherType"),new o.default("postcode"),new o.default("postcodeSetByUser"),new o.default("postcodeLocationName")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("direct-connection-keys")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712))},396399:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("encrypted-mutations").version((0,a.encryptedMutationsCreateTable)(),[new s.default("id"),new o.default("collectionName"),new o.default("keyId"),new o.default("indexMac"),new o.default("operation"),new o.default("indexAndValueCipherText")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("encrypted-mutations")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(172581))},699070:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("favorite-stickers").version((0,a.favoriteStickersCreateTable)(),[new s.default("id"),new o.default("timestamp"),new o.default("sticker"),new o.default("stickerHashWithoutMeta"),new o.default("isFavorite"),new o.default("deviceId")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("favorite-stickers")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712))},558249:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("fts-indexing-queue").version((0,a.ftsIndexingQueueCreateTable)(),[new o.default("id")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("fts-indexing-queue")};var i=n(605316),a=n(526456),o=r(n(874712))},968574:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("group-invite-v4").version((0,a.groupInviteV4CreateTable)(),[new l.default("id"),new o.default("from"),new o.default("to"),new o.default("groupId"),new o.default("expiration"),new o.default("expired"),new s.default(["from","to","groupId"])]).version((0,a.addGroupFromKeyToGroupInviteV4)(),[new s.default(["from","groupId"])]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("group-invite-v4")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(974622)),l=r(n(874712))},126092:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("group-metadata").version((0,a.groupMetadataCreateTable)(),[new l.default("id"),new o.default("subject"),new o.default("subjectTime"),new o.default("creation"),new o.default("owner"),new o.default("desc"),new o.default("descId"),new o.default("descTime"),new o.default("descOwner"),new o.default("restrict"),new o.default("announce"),new o.default("a_v_id"),new o.default("noFrequentlyForwarded"),new o.default("ephemeralDuration"),new o.default("membershipApprovalMode"),new o.default("size"),new o.default("support"),new o.default("suspended"),new o.default("terminated"),new o.default("notAddedByContact"),new o.default("addedBy"),new o.default("parentGroup"),new o.default("subgroups"),new o.default("isParentGroup"),new o.default("isParentGroupClosed"),new o.default("defaultSubgroup"),new o.default("growthLockExpiration"),new o.default("growthLockType"),new o.default("lastActivityTimestamp"),new o.default("lastSeenActivityTimestamp")]).version((0,a.migrateSubgroupsArray)(),[new s.default("subgroups"),new o.default("unjoinedSubgroups")]).version((0,a.removeUnjoinedSubgroups)(),[new s.default("unjoinedSubgroups")]).version((0,a.removeSpamColumnsInGroupMetadata)(),[new s.default("notAddedByContact"),new s.default("addedBy")]).version((0,a.addCommunityAdminPromotionColumns)(),[new o.default("displayCadminPromotion")]).version((0,a.renameCommunityAdminPromotionColumns)(),[new s.default("displayCadminPromotion"),new o.default("acknowledgedCadminPromotion")]).version((0,a.removeCommunityAdminPromotionColumns)(),[new s.default("acknowledgedCadminPromotion")]).version((0,a.addIncognitoGroupMetadataColumn)(),[new o.default("incognito")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("group-metadata")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(482078)),l=r(n(874712))},607585:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("history-sync-notification").version((0,a.historySyncNotificationsCreateTable)(),[new u.default("msgKey"),new o.default("downloadOptions"),new o.default("syncType"),new s.AddEncryptedColumn("chunkEncryptionKey",s.ENCRYPTED_VALUE_TYPE.STRING),new o.default("chunkOrder"),new o.default("processed"),new l.default("syncType"),new l.default("chunkOrder"),new l.default("processed"),new o.default("isReupload"),new o.default("historySyncStepStartedTs"),new o.default("historySyncPayloadSize"),new o.default("reuploadPending")]).version((0,a.encryptHistorySyncDirectPath)(),[new s.AddEncryptedColumn("directPath",s.ENCRYPTED_VALUE_TYPE.STRING)]).version((0,a.encryptHistorySyncFilehash)(),[new s.AddEncryptedColumn("filehash",s.ENCRYPTED_VALUE_TYPE.STRING),new s.AddEncryptedColumn("encFilehash",s.ENCRYPTED_VALUE_TYPE.STRING)]).view((e=>e)).useDbMsgEncKeyForEncryptedCol(!0)},t.getTable=function(){return(0,i.getStorage)().table("history-sync-notification")};var i=n(605316),a=n(526456),o=r(n(372407)),s=n(345632),l=r(n(599395)),u=r(n(874712))},517066:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("inactive-receipt").version((0,a.inactiveReceiptCreateTable)(),[new s.default("msgId"),new o.default("chatId"),new o.default("participantId")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("inactive-receipt")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712))},187411:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("label").version((0,a.labelCreateTable)(),[new s.default("id"),new o.default("name"),new o.default("colorIndex"),new o.default("predefinedId")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("label")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712))},294715:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.LabelAssociationType=void 0,t.addTable=function(){(0,i.getStorage)().add("label-association").version((0,a.labelAssociationCreateTable)(),[new l.default(["labelId","associationId","type"]),new s.default("labelId"),new o.default(["associationId","type"])]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("label-association")};var i=n(605316),a=n(526456),o=r(n(974622)),s=r(n(599395)),l=r(n(277631));const u=n(76672)({Jid:"jid",Message:"message"});t.LabelAssociationType=u},640322:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("lid-chat-state").version((0,a.lidChatStateCreateTable)(),[new s.default("id"),new o.default("shareOwnPn"),new o.default("requestedPnTimestamp")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("lid-chat-state")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712))},594014:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("lid-display-name-mapping").version((0,a.lidDisplayNameMappingCreateTable)(),[new s.default("id"),new o.default("displayName")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("lid-display-name-mapping")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712))},257678:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("lid-pn-mapping").version((0,a.lidPnMappingCreateTable)(),[new u.default("id"),new o.default("phoneNumber"),new s.default("phoneNumber"),new o.default("createdAtTimestamp"),new o.default("displayName")]).version((0,a.lidPnMappingRemoveDisplayName)(),[new l.default("displayName")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("lid-pn-mapping")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(599395)),l=r(n(482078)),u=r(n(874712))},49970:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("pending-membership-approval-request").version((0,a.membershipApprovalRequestCreateTable)(),[new l.default(["groupId","id"]),new s.default("groupId"),new o.default("t"),new o.default("addedBy"),new o.default("requestMethod")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("pending-membership-approval-request")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(599395)),l=r(n(277631))},121260:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("message").version((0,a.messageCreateTable)(),[new _.default("id"),new s.default("internalId"),new d.default("internalId"),new s.default("rowId"),new d.default("rowId"),new s.default("type"),new s.default("subtype"),new s.default("t"),new s.default("notifyName"),new s.default("from"),new s.default("to"),new s.default("author"),new s.default("self"),new s.default("ack"),new s.default("invis"),new s.default("isStarred"),new c.default("isStarred"),new s.default("mentionedJidList"),new s.default("count"),new s.default("devicesAdded"),new s.default("devicesRemoved"),new s.default("isThisDeviceAdded"),new s.default("recipients"),new s.default("protocolMessageKey"),new s.default("protocolMessageRowId"),new s.default("templateParams"),new l.default(["internalId","isStarred"]),new s.default("vcardWAids"),new o.default("vcardWAids"),new s.default("hasLink"),new s.default("isMediaMsg"),new s.default("isDocMsg"),new l.default(["internalId","isMediaMsg"]),new l.default(["internalId","isDocMsg"]),new l.default(["internalId","hasLink"]),new s.default("ephemeralStartTimestamp"),new s.default("ephemeralDuration"),new s.default("ephemeralSettingTimestamp"),new s.default("ephemeralOutOfSync"),new s.default("expiredTimestamp"),new c.default("expiredTimestamp"),new s.default("directPath"),new s.default("mimetype"),new s.default("duration"),new s.default("filehash"),new s.default("uploadhash"),new s.default("size"),new s.default("filename"),new s.default("streamingSidecar"),new s.default("mediaKey"),new s.default("mediaKeyTimestamp"),new s.default("pageCount"),new s.default("isGif"),new s.default("gifAttribution"),new s.default("isViewOnce"),new s.default("width"),new s.default("height"),new s.default("scanLengths"),new s.default("scansSidecar"),new s.default("interactiveAnnotations"),new s.default("firstFrameLength"),new s.default("firstFrameSidecar"),new s.default("isAnimated"),new s.default("thumbnail"),new s.default("richPreviewType"),new s.default("doNotPlayInline"),new s.default("broadcast"),new s.default("broadcastParticipants"),new s.default("broadcastId"),new s.default("quotedMsg"),new s.default("quotedStanzaID"),new s.default("quotedRemoteJid"),new s.default("quotedParticipant"),new s.default("footer"),new s.default("hydratedButtons"),new s.default("selectedId"),new s.default("selectedIndex"),new s.default("vcardFormattedName"),new s.default("isVcardOverMmsDocument"),new s.default("isCaptionByUser"),new s.default("businessOwnerJid"),new s.default("productId"),new s.default("currencyCode"),new s.default("priceAmount1000"),new s.default("retailerId"),new s.default("url"),new s.default("productImageCount"),new s.default("paymentCurrency"),new s.default("paymentMessageReceiverJid"),new s.default("paymentTransactionTimestamp"),new s.default("paymentStatus"),new s.default("paymentNoteMsg"),new s.default("paymentRequestMessageKey"),new s.default("paymentExpiryTimestamp"),new s.default("message"),new s.default("orderTitle"),new s.default("itemCount"),new s.default("orderId"),new s.default("surface"),new s.default("status"),new s.default("token"),new s.default("textColor"),new s.default("backgroundColor"),new s.default("font"),new s.default("isForwarded"),new s.default("forwardingScore"),new s.default("ctwaContext"),new s.default("messageRangeIndex"),new c.default("messageRangeIndex"),new s.default("vcardList"),new s.default("totalAmount1000"),new s.default("totalCurrencyCode"),new s.default("list"),new s.default("listResponse"),new s.default("isDynamicReplyButtonsMsg"),new s.default("dynamicReplyButtons"),new s.default("selectedButtonId"),new s.default("sellerJid"),new s.default("deprecatedMms3Url"),new s.default("encFilehash"),new u.AddEncryptedColumn("msgRowOpaqueData",u.ENCRYPTED_VALUE_TYPE.ARRAY_BUFFER),new s.default("thumbnailDirectPath"),new s.default("thumbnailSha256"),new s.default("thumbnailEncSha256"),new s.default("thumbnailHeight"),new s.default("thumbnailWidth"),new s.default("revokeSender"),new s.default("pendingReadReceipt"),new l.default(["from","pendingReadReceipt"]),new s.default("inviteGrpType"),new s.default("quotedGroupSubject"),new s.default("quotedParentGroupJid"),new s.default("reactionParentKey"),new s.default("reactionTimestamp"),new s.default("reactionText"),new s.default("lastPlaybackProgress"),new s.default("hasReaction"),new s.default("kicKey"),new s.default("kicState"),new s.default("kicTimestampMs"),new s.default("kicNotified"),new s.default("keptMessageKey"),new s.default("keepType"),new s.default("keptCount"),new s.default("agentId"),new s.default("revokeTimestamp"),new s.default("futureproofParams"),new s.default("futureproofReparsed"),new s.default("futureproofType"),new s.default("futureproofSubtype"),new s.default("latestEditMsgKey"),new s.default("latestEditSenderTimestampMs")]).version((0,a.messageAddIsSendFailureProperties)(),[new s.default("isSendFailure")]).version((0,a.messageAddPaymentTxnStatus)(),[new s.default("paymentTxnStatus")]).version((0,a.messageAddProductListPreviewInfo)(),[new s.default("productListItemCount")]).version((0,a.messageAddPrivacyModeFields)(),[new s.default("privacyModeWhenSent"),new s.default("bizPrivacyStatus")]).version((0,a.messageAddProductListPreviewHeaderImage)(),[new s.default("productHeaderImageRejected")]).version((0,a.messageAddDisappearingModeInitiator)(),[new s.default("disappearingModeInitiator")]).version((0,a.messageAddGroupInviteV4)(),[new s.default("inviteGrp"),new s.default("inviteGrpName"),new s.default("comment"),new s.default("inviteCode"),new s.default("inviteCodeExp")]).version((0,a.addSupportForHSMButtons)(),[new s.default("isFromTemplate")]).version((0,a.messageAddPaymentRequestNFMFields)(),[new s.default("nativeFlowButtons"),new s.default("paymentRequestHeader")]).version((0,a.addWaveformToAudioMessages)(),[new s.default("waveform")]).version((0,a.messageRemovePaymentRequestHeaderField)(),[new p.default("paymentRequestHeader")]).version((0,a.messageAddNativeFlowNameField)(),[new s.default("nativeFlowName")]).version((0,a.addStaticURLToImageVideoMessages)(),[new s.default("staticUrl")]).version((0,a.addRequiresDirectConnection)(),[new s.default("requiresDirectConnection")]).version((0,a.messageAddPaymentInviteServiceType)(),[new s.default("paymentInviteServiceType")]).version((0,a.addStatusPSACampaignFields)(),[new s.default("campaignId"),new s.default("campaignDuration")]).version((0,a.messageAddPaymentBackground)(),[new s.default("paymentBackground")]).version((0,a.messageAddInteractiveMessageFields)(),[new s.default("interactiveHeader"),new s.default("interactiveType"),new s.default("interactivePayload")]).version((0,a.messageAddActionLink)(),[new s.default("actionLink")]).version((0,a.messageAddHeaderType)(),[new s.default("headerType")]).version((0,a.messageStatusPSAReadTimestamp)(),[new s.default("statusPSAReadTimestamp")]).version((0,a.messageAddPollInvalidated)(),[new s.default("pollInvalidated")]).view((e=>e)).enablePropFilter(!0).useDbMsgEncKeyForEncryptedCol(!0)},t.getTable=function(){return(0,i.getStorage)().table("message")};var i=n(605316),a=n(526456),o=r(n(227209)),s=r(n(372407)),l=r(n(974622)),u=n(345632),c=r(n(599395)),d=r(n(277309)),p=r(n(482078)),_=r(n(874712));n(522357)},572837:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("message-history").version((0,a.messageHistoryCreateTable)(),[new l.default("msgKey"),new o.default("parentMsgKey"),new s.default("parentMsgKey")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("message-history")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(599395)),l=r(n(874712))},719438:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("message-info").version((0,a.messageInfoCreateTable)(),[new l.default(["msgKey","receiverUserJid"]),new o.default("delivery"),new o.default("read"),new o.default("played"),new o.default("deviceDelivered"),new o.default("deviceNotDelivered"),new s.default("msgKey")]).version((0,a.messageInfoAddDeliveryPrivacyMode)(),[new o.default("deliveryPrivacyMode")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("message-info")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(599395)),l=r(n(277631))},467862:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("message-orphans").version((0,a.messageOrphansCreateTable)(),[new u.default("msgKey"),new o.default("parentMsgKey"),new s.default("parentMsgKey"),new o.default("sender"),new o.default("parsedMsgPayload"),new o.default("senderTimestampMs"),new s.default("senderTimestampMs")]).version((0,a.messageOrphansAddColumns)(),[new o.default("t"),new s.default("t"),new o.default("type"),new l.default("senderTimestampMs")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("message-orphans")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(599395)),l=r(n(614604)),u=r(n(874712))},536884:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,a.getStorage)().add("missing-keys").version((0,o.missingKeysCreateTable)(),[new l.default("keyHex"),new s.default("keyId"),new s.default("timestamp"),new s.default("deviceResponses")]).view((e=>e))},t.convertFromMissingKeyToRow=function(e){const{keyHex:t,keyId:n,timestamp:r,deviceResponses:a}=e;return{keyHex:t,keyId:(0,i.fromSyncKeyId)(n),timestamp:r,deviceResponses:a}},t.convertToMissingKeyFromRow=function(e){const{keyHex:t,keyId:n,timestamp:r,deviceResponses:a}=e;return{keyHex:t,keyId:(0,i.toSyncKeyId)(n),timestamp:r,deviceResponses:a}},t.getTable=function(){return(0,a.getStorage)().table("missing-keys")};var i=n(682661),a=n(605316),o=n(526456),s=r(n(372407)),l=r(n(874712))},320493:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DataRequestUploadOperationType=void 0,t.addTable=function(){(0,i.getStorage)().add("non-message-data-request").version((0,a.nonMessageDataRequestCreateTable)(),[new s.default("id"),new o.default("fileKey"),new o.default("requestType"),new o.default("operationType"),new o.default("lastRequestTimeStampSec"),new o.default("requestRetryCount"),new o.default("responseError"),new o.default("lastMediaUploadTimeStampSec"),new o.default("lastMediaUploadSuccess"),new o.default("mediaUploadFailureCount")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("non-message-data-request")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712));const l=n(76672).Mirrored(["SEND_REQUEST","MEIDA_UPLOAD"]);t.DataRequestUploadOperationType=l},609910:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("orphan-payment-notification").version((0,a.orphanPaymentNotificationCreateTable)(),[new s.default("msgKey"),new o.default("receiver"),new o.default("currency"),new o.default("amount1000"),new o.default("type"),new o.default("status"),new o.default("ts")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("orphan-payment-notification")};var i=n(605316),a=n(526456),o=(n(850788),r(n(372407))),s=r(n(874712))},302213:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("orphan-receipt").version((0,a.orphanReceiptCreateTable)(),[new s.default("msgKey"),new o.default("delivery"),new o.default("read"),new o.default("played")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("orphan-receipt")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712))},428557:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("orphan-revoke").version((0,a.orphanRevokeCreateTable)(),[new s.default("msgKey"),new o.default("sender"),new o.default("timestamp"),new o.default("subtype")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("orphan-revoke")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712))},414015:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("orphan-tc-token").version((0,a.orphanTcTokenCreateTable)(),[new l.default("chatId"),new s.AddEncryptedColumn("tcToken",s.ENCRYPTED_VALUE_TYPE.ARRAY_BUFFER),new o.default("tcTokenTimestamp"),new o.default("tcTokenSenderTimestamp")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("orphan-tc-token")};var i=n(605316),a=n(526456),o=r(n(372407)),s=n(345632),l=r(n(874712))},443421:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("participant").version((0,a.participantCreateTable)(),[new l.default("groupId"),new s.default("senderKey"),new s.default("participants"),new s.default("pastParticipants"),new s.default("admins"),new s.default("rotateKey"),new s.default("version"),new o.default("participants"),new s.default("deviceSyncComplete"),new s.default("staleType")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("participant")};var i=n(605316),a=n(526456),o=r(n(227209)),s=r(n(372407)),l=r(n(874712))},417917:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("payment-backgrounds").version((0,a.paymentBackgroundsCreateTable)(),[new s.default("id"),new o.default("imageBuffer")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("payment-backgrounds")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712))},131020:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("peer-message").version((0,a.peerMessageCreateTable)(),[new s.default("id"),new o.default("to"),new o.default("type"),new o.default("subtype"),new o.default("appStateSyncKeyShare"),new o.default("appStateSyncKeyRequest"),new o.default("appStateFatalExceptionNotification"),new o.default("peerDataOperationRequestMessage"),new o.default("peerDataOperationRequestResponseMessage")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("peer-message")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712))},257383:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("pending-mutations").version((0,a.pendingMutationsCreateTable)(),[new l.default("id"),new o.default("collection"),new o.default("index"),new s.default("index"),new o.default("timestamp"),new s.default("collection"),new o.default("version"),new o.default("operation"),new o.default("binarySyncAction")]).version((0,a.addActionToPendingMutations)(),[new o.default("action"),new s.default("action")]).view((e=>e))},t.convertToPendingMutationFromRow=function(e){const{id:t,collection:n,index:r,binarySyncAction:i,version:a,operation:o,timestamp:s,action:l}=e;return{id:t,collection:n,index:r,binarySyncAction:i,version:a,operation:o,timestamp:s,action:l}},t.getTable=function(){return(0,i.getStorage)().table("pending-mutations")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(599395)),l=r(n(172581))},572768:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.PrivacyDisallowedListType=void 0,t.addTable=function(){(0,i.getStorage)().add("privacy-disallowed-list").version((0,a.privacyDisallowedListCreateTable)(),[new s.default("id"),new o.default("disallowedList")]).version((0,a.privacyDisallowedListAddDhashField)(),[new o.default("dhash")]).view((e=>({id:e.id,disallowedList:e.disallowedList,dhash:e.dhash})))},t.getTable=function(){return(0,i.getStorage)().table("privacy-disallowed-list")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712));const l=n(76672)({About:"status",GroupAdd:"groupadd",LastSeen:"last",ProfilePicture:"profile"});t.PrivacyDisallowedListType=l},391967:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("profile-pic-thumb").version((0,a.profilePicThumbCreateTable)(),[new s.default("id"),new o.default("tag"),new o.default("raw"),new o.default("eurl"),new o.default("previewEurl"),new o.default("timestamp")]).view((e=>({id:e.id,tag:e.tag,eurl:e.eurl,previewEurl:e.previewEurl,timestamp:e.timestamp})))},t.getTable=function(){return(0,i.getStorage)().table("profile-pic-thumb")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712))},949135:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("quick-reply").version((0,a.quickReplyCreateTable)(),[new s.default("id"),new o.default("shortcut"),new o.default("message"),new o.default("count"),new o.default("keywords")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("quick-reply")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712))},237:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("reactions").version((0,a.reactionsCreateTable)(),[new u.default(["parentMsgKey","senderUserJid"]),new o.default("msgKey"),new o.default("reactionText"),new o.default("timestamp"),new o.default("orphan"),new o.default("orphanReason"),new o.default("read"),new o.default("ack"),new l.default("parentMsgKey"),new l.default("orphan")]).version((0,a.addReactionTableOrphanIndex)(),[new s.default(["parentMsgKey","orphan"])]).version((0,a.addReactionTableMsgKeyIndex)(),[new l.default("msgKey")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("reactions")};var i=n(605316),a=n(526456),o=(n(23030),r(n(372407))),s=r(n(974622)),l=r(n(599395)),u=r(n(277631))},235513:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("recent-stickers").version((0,a.recentStickersCreateTable)(),[new s.default("id"),new o.default("timestamp"),new o.default("sticker"),new o.default("msgId"),new o.default("weight"),new o.default("isNewSticker")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("recent-stickers")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712))},651308:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("subscription").version((0,a.subscriptionCreateTable)(),[new s.default("id"),new o.default("isDeactivated"),new o.default("isAutoRenewing"),new o.default("expirationDate")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("subscription")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712))},516934:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,s.getStorage)().add("sync-actions").version((0,l.syncActionsCreateTable)(),[new p.default("index"),new u.default("keyId"),new u.default("version"),new u.default("actionState"),new d.default("actionState"),new u.default("modelId"),new u.default("modelType"),new c.default(["modelId","modelType","actionState"]),new u.default("valueMac"),new u.default("indexMac"),new d.default("indexMac"),new u.default("collection"),new d.default("collection"),new u.default("timestamp"),new u.default("action"),new d.default("action"),new u.default("binarySyncAction"),new u.default("binarySyncData")]).view(_)},t.convertFromSyncActionToRow=function(e){const{keyId:t}=e;return(0,i.default)((0,i.default)({},e),{},{keyId:(0,o.fromSyncKeyId)(t)})},t.convertToSyncActionFromRow=function(e){const{keyId:t}=e;return(0,i.default)((0,i.default)({},e),{},{keyId:(0,o.toSyncKeyId)(t)})},t.getTable=function(){return(0,s.getStorage)().table("sync-actions")};var i=r(n(81109)),a=n(813757),o=n(682661),s=n(605316),l=n(526456),u=r(n(372407)),c=r(n(974622)),d=r(n(599395)),p=r(n(874712));function _(e){const{index:t,binarySyncAction:n,actionState:r,version:i,keyId:o,modelId:s,modelType:l,indexMac:u,valueMac:c,collection:d,timestamp:p,action:_}=e;let{binarySyncData:f}=e;if(null==f){if(null==n)throw __LOG__(4,void 0,new Error,!0,["syncd"])`syncd: binarySyncAction should not be null when binarySyncData is null`,SEND_LOGS("syncd: syncd binarySyncAction should not be null when binarySyncData is null"),new Error("syncd: binarySyncAction should not be null when binarySyncData is null");f=(0,a.syncActionToSyncData)(n)}return{index:t,binarySyncData:f,actionState:r,version:i,keyId:o,modelId:s,modelType:l,indexMac:u,valueMac:c,collection:d,timestamp:p,action:_}}},732367:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,o.getStorage)().add("sync-keys").version((0,s.syncKeysCreateTable)(),[new d.default("keyId"),new l.default("timestamp"),new l.default("fingerprint"),new u.AddEncryptedColumn("keyData",u.ENCRYPTED_VALUE_TYPE.ARRAY_BUFFER),new l.default("keyEpoch"),new c.default("keyEpoch")]).view((e=>e))},t.convertFromSyncKeyToRow=function(e){const{keyId:t,keyData:n}=e;return(0,i.default)((0,i.default)({},e),{},{keyId:new Uint8Array((0,a.fromSyncKeyId)(t)),keyData:(0,a.fromSyncKeyData)(n)})},t.convertToSyncKeyFromRow=function(e){const{keyId:t,keyData:n}=e;return(0,i.default)((0,i.default)({},e),{},{keyId:(0,a.toSyncKeyId)(t.buffer),keyData:(0,a.toSyncKeyData)(n)})},t.getTable=function(){return(0,o.getStorage)().table("sync-keys")};var i=r(n(81109)),a=n(682661),o=n(605316),s=n(526456),l=r(n(372407)),u=n(345632),c=r(n(599395)),d=r(n(874712))},448855:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("tasks-scheduled-time").version((0,a.tasksScheduledTimeCreateTable)(),[new s.default("taskName"),new o.default("time")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("tasks-scheduled-time")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712))},23030:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OrphanReactionsReasonType=void 0;const r=n(76672).Mirrored(["ParentMsgPlaceholder","ParentMsgMissing","ParentMsgFutureproof"]);t.OrphanReactionsReasonType=r},484187:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("unjoined-subgroup-metadata").version((0,a.unjoinedSubgroupMetadataCreateTable)(),[new l.default("id"),new o.default("subject"),new o.default("subjectTime"),new o.default("defaultSubgroup"),new o.default("parentGroup")]).version((0,a.unjoinedSubgroupParentGroupIndex)(),[new s.default("parentGroup")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("unjoined-subgroup-metadata")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(599395)),l=r(n(874712))},766488:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("user-prefs").version((0,a.userPrefsCreateTable)(),[new s.default("key"),new o.default("value")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("user-prefs")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(874712))},646240:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("verified-business-name").version((0,a.verifiedBusinessNameCreateTable)(),[new l.default("id"),new o.default("serial"),new o.default("name"),new o.default("isApi"),new o.default("level"),new o.default("actualActors"),new o.default("hostStorage"),new o.default("privacyModeTs")]).version((0,a.verifiedBusinessNameAddPrivacyMode)(),[new o.default("privacyMode"),new s.default("actualActors"),new s.default("hostStorage"),new s.default("privacyModeTs")]).version((0,a.verifiedBusinessNameAddSmbColumn)(),[new o.default("isSmb")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("verified-business-name")};var i=n(605316),a=n(526456),o=r(n(372407)),s=r(n(482078)),l=r(n(874712))},476462:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createDeviceListPK=function(e){switch(e.server){case"lid":return`${e.user}@lid`;case"c.us":return e.user}throw new Error(`Jid ${e.toString({legacy:!0})} is not fully qualified to create a device list pk, jid.server should be "c.us" or "lid"`)}},565804:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.restoreAgents=function(){return W.apply(this,arguments)},t.restoreArchiveV2Settings=function(){return H.apply(this,arguments)},t.restoreBlocklist=function(){return(0,P.getTable)().all().then((e=>{c.BlocklistCollection.initializeFromCache(e.map(l.hydrateWids))}))},t.restoreCarts=function(){return(0,O.getTable)().all().then((e=>{d.CartCollection.initializeFromCache(e.map(l.hydrateWids))}))},t.restoreChatAssignments=function(){return $.apply(this,arguments)},t.restoreCommunityActivity=function(){const e=g.default.filter((e=>e.isParentGroup)).map((e=>_.default.syncActivityFor(e.id)));return Promise.all(e)},t.restoreFavoriteStickers=function(){if((0,o.getABPropConfigValue)("sticker_md_favorite_stickers_enabled"))return(0,M.getTable)().all().then((e=>h.default.initializeFromCache(e)));return Promise.resolve()},t.restoreImportantMetaData=function(){return K.apply(this,arguments)},t.restoreLabelAssociations=function(){if((0,u.canDisplayLabel)())return(0,R.getTable)().all().then((e=>{m.LabelCollection.initializeAssociationsFromCache(e)}));return Promise.resolve()},t.restoreLabels=function(){if((0,u.canDisplayLabel)())return(0,b.getTable)().all().then((e=>{m.LabelCollection.initializeFromCache(e)}));return Promise.resolve()},t.restoreMediaUploadResult=function(){return(0,N.getTable)().all().then((e=>{(0,T.initializeMediaUploadResultFromStroage)(e)}))},t.restoreQuickReplies=function(){if((0,u.canSendQuickReply)())return(0,w.getTable)().all().then((e=>{v.QuickReplyCollection.initializeFromCache(e)}));return Promise.resolve()},t.restoreRecentStickers=function(){return(0,L.getTable)().all().then((e=>A.RecentStickerCollectionMd.initializeFromCache(e)))},t.restoreSubscriptions=function(){return V.apply(this,arguments)},t.restoreUnjoinedSubgroups=function(){return z.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(287461),s=n(268392),l=n(642232),u=n(72696),c=n(157211),d=n(308084),p=n(387202),_=r(n(837104)),f=n(266888),h=r(n(788788)),g=r(n(318797)),m=n(478353),y=n(332108),E=n(97858),S=n(828770),T=n(734173),v=n(319022),A=n(951220),C=n(402593),P=n(287844),O=n(950242),I=n(936771),M=n(699070),b=n(187411),R=n(294715),N=n(320493),w=n(949135),L=n(235513),D=n(651308),k=n(484187),U=n(6961),G=n(808469),x=r(n(56992)),B=n(757453),F=n(673168),j=n(669050),Y=r(n(897215));function K(){return(K=(0,a.default)((function*(){__LOG__(2)`[InitFromStorage] will attempt to initialize metadata from storage`,f.Conn.trigger("me_ready");const e=(0,B.getPushname)(),t=yield(0,B.getLastMobilePlatform)();if(null==t)return __LOG__(4,void 0,new Error)`platform not found in UserPrefs.`,U.Socket.logout(!1,y.LogoutReason.UnknownCompanion);yield(0,S.setMobilePlatform)(t,!1),f.Conn.pushname=e,f.Conn.platform=t,__LOG__(2)`[InitFromStorage] important metadata loaded`}))).apply(this,arguments)}function H(){return(H=(0,a.default)((function*(){if((0,E.archiveV2Supported)()){const e=yield(0,F.getArchiveV2EnabledSetting)(),t=yield(0,F.getUnarchiveChatsSetting)();null!=e&&(Y.default.archive=(0,i.default)((0,i.default)({},Y.default.archive),{},{enabled:e})),null!=t&&(Y.default.archive=(0,i.default)((0,i.default)({},Y.default.archive),{},{classic:t}))}}))).apply(this,arguments)}function W(){return(W=(0,a.default)((function*(){if((0,u.isMultiDeviceMessageAttributionEnabled)()){const e=yield(0,C.getTable)().all();s.AgentCollection.initializeFromCache(e)}}))).apply(this,arguments)}function V(){return(V=(0,a.default)((function*(){const e=yield(0,D.getTable)().all();G.SubscriptionCollection.initializeFromCache(e)}))).apply(this,arguments)}function $(){return($=(0,a.default)((function*(){if((0,u.chatAssignmentEnabled)()){const e=yield(0,I.getTable)().all();p.ChatAssignmentCollection.initializeFromCache(e)}}))).apply(this,arguments)}function z(){return(z=(0,a.default)((function*(e){const t=new Map;e.forEach((e=>{const n=g.default.get(e);n&&null!=n.isParentGroup&&!1!==n.isParentGroup&&!n.unjoinedSubgroupsQueryPromise&&(n.unjoinedSubgroupsQueryPromise=new Promise((n=>{t.set(e,n)})))}));const n=Array.from(t.keys());if(0!==n.length)try{(yield(0,k.getTable)().anyOf(["parentGroup"],n)).forEach((e=>{x.default.add({id:(0,j.createWid)(e.id),subject:e.subject,subjectTime:e.subjectTime,defaultSubgroup:e.defaultSubgroup,parentGroupId:(0,j.createWid)(e.parentGroup)},{merge:!0})}))}finally{n.forEach((e=>{const n=t.get(e);null==n||n()}))}}))).apply(this,arguments)}n(186749)},323791:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.destroy=function(){return(0,a.destroyStorage)().catch((()=>(0,i.dexieCastToPromise)(new c.default(a.DATABASE_NAME).delete()))).finally((()=>{d=null}))},t.initialize=function(){null==d&&((0,a.createStorage)(),(0,u.addTable)(),(0,o.addTable)(),(0,s.addTable)(),(0,l.addTable)(),d=(0,a.getStorage)().initialize().catch((e=>{throw __LOG__(4,!0,new Error,!0)`Assertion failed!`,SEND_LOGS("Failed to initialize offd storage"),e})));return d};var i=n(273624),a=n(587225),o=n(665894),s=n(336619),l=n(11454),u=n(822393),c=r(n(986128));let d},92268:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.updatePeerReceipts=function(){return m.apply(this,arguments)};var i=r(n(81109)),a=r(n(348926)),o=n(616310),s=n(493928),l=n(402994),u=n(359987),c=n(147980),d=n(108595),p=n(605316),_=r(n(565754)),f=n(121260),h=n(336619),g=n(237);function m(){return(m=(0,a.default)((function*(){const e=yield(0,h.getTable)().all(),t=[],n=[];e.forEach((e=>{e.ack===l.ACK.READ?t.push(e):e.ack===l.ACK.PLAYED?n.push(e):__LOG__(3)`updatePeerReceipts: unknown ack type: ${e.ack}`}));const{chatUpdates:r,ackUpdates:a,reactionUpdates:o}=yield y(t),s=new Map(a.map((e=>[e.id,e])));S(n).forEach((e=>{const t=s.get(e.id);null==t?s.set(e.id,e):s.set(e.id,(0,i.default)((0,i.default)({},t),{},{ack:e.ack}))}));const c=Array.from(s.values());if((0,u.frontendFireAndForget)("updateOfflinePeerReceipt",{chatUpdates:r.map((e=>{var t;return{chatId:e.id,unreadCount:e.unreadCount,unreadMentionsOfMe:null!==(t=e.unreadMentionsOfMe)&&void 0!==t?t:[]}})),ackUpdates:c.map((e=>({msgKey:e.id,ack:e.ack})))}),yield(0,p.getStorage)().lock(["message","chat"],(e=>{let[t,n]=e;return Promise.all([t.bulkCreateOrMerge(c),n.bulkCreateOrMerge(r)])})),o.length>0){const e=o.map((e=>_.default.fromString(e)));yield(0,d.markReactionsAsReadByMessageKeys)(e)}return(0,h.getTable)().clear()}))).apply(this,arguments)}function y(){return E.apply(this,arguments)}function E(){return(E=(0,a.default)((function*(e){const t=new Set(e.flatMap((e=>e.msgKeys)));const n=function(e){return new Map(e.flatMap((e=>e.msgKeys)).map(p).filter((e=>e!==o.STATUS_JID)).map((e=>[e,{unreadCount:0,lastUnreadMsgRowId:void 0,unreadMentionsOfMe:[],unreadMentionCount:0}])))}(e),r=Array.from(n.keys()),i=yield(0,f.getTable)().anyOf(["from","pendingReadReceipt"],r.map((e=>[e,1])),{shouldDecrypt:!1});i.forEach((e=>function(e,n){const{rowId:r,id:i}=n;if(null==e||null==r)return;t.has(i)&&(null==e.lastUnreadMsgRowId||r>e.lastUnreadMsgRowId)&&(e.lastUnreadMsgRowId=r)}(n.get(e.from),e))),i.forEach((e=>function(e,t){const{rowId:n}=t;if(null==e||null==n||null==e.lastUnreadMsgRowId)return;if(n>e.lastUnreadMsgRowId&&(e.unreadCount+=1,(0,s.isGroupCatchUpEnabled)()&&(0,c.isImportantMessage)(t))){const n={id:t.id,timestamp:t.t};e.unreadMentionsOfMe.push(n)}}(n.get(e.from),e)));const u=i.flatMap((e=>{const{rowId:t}=e,r=n.get(e.from);return null==r||null==t||null==r.lastUnreadMsgRowId?[]:t<=r.lastUnreadMsgRowId?[{id:e.id,ack:l.ACK.READ,pendingReadReceipt:null}]:[]})).concat((d=t,Array.from(d).filter((e=>p(e)===o.STATUS_JID)).map((e=>({id:e,ack:l.ACK.READ})))));var d;return{chatUpdates:r.map((e=>{const t=n.get(e);return null!=t&&null!=t.lastUnreadMsgRowId?{id:e,unreadCount:t.unreadCount,unreadMentionsOfMe:t.unreadMentionsOfMe}:null})).filter(Boolean),ackUpdates:u,reactionUpdates:yield function(){return h.apply(this,arguments)}(t)};function p(e){return _.default.fromString(e).remote.toString()}function h(){return(h=(0,a.default)((function*(e){return(yield(0,g.getTable)().anyOf(["msgKey"],Array.from(e))).map((e=>e.msgKey))}))).apply(this,arguments)}}))).apply(this,arguments)}function S(e){const t=new Set;return e.forEach((e=>{e.ack===l.ACK.PLAYED&&e.msgKeys.forEach((e=>t.add(e)))})),Array.from(t).map((e=>({id:e,ack:l.ACK.PLAYED,pendingReadReceipt:null})))}},587225:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DATABASE_NAME=void 0,t.createStorage=function(){const e=new i.default(u);c=new a.Storage(e),c.addErrorHandler(s.default.AbortError,(e=>{e.message.includes("QuotaExceededError")&&o.StorageCmd.trigger("storage_not_enough_space")}))},t.destroyStorage=function(){if(null==c)return Promise.reject(new Error("[offd-storage] Storage should be created first before being destroyed"));return c.purge().then((()=>{c=null})).catch((e=>{throw c=null,e}))},t.getStorage=function(){return(0,l.default)(null!=c,"[offd-storage] Storage should be created first before being accessed"),c};var i=r(n(844800)),a=n(408286),o=n(355701),s=r(n(986128)),l=r(n(441143));const u="offd-storage";t.DATABASE_NAME=u;let c=null},277330:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addUserToPendingDeviceSync=function(e){return(0,a.getTable)().bulkCreateOrMerge(e.map((e=>({id:e}))))},t.doPendingDeviceSync=function(){return s.apply(this,arguments)};var i=r(n(348926)),a=n(11454),o=n(669050);function s(){return(s=(0,i.default)((function*(){try{const e=yield(0,a.getTable)().all(),t=n(510607).syncDeviceListJob;yield t(e.map((e=>(0,o.createWid)(e.id))),null,null),yield(0,a.getTable)().bulkRemove(e.map((e=>e.id)))}catch(e){__LOG__(4,!0,new Error)`doPendingDeviceSync failed during RESUME_WITH_OPEN_TAB`}}))).apply(this,arguments)}},665894:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("dangling-receipt").version((0,i.getStorage)().versions.version(1),[new o.default("id"),new a.default("receipts")]).view((e=>({id:e.id,receipts:e.receipts})))},t.getTable=function(){return(0,i.getStorage)().table("dangling-receipt")};var i=n(587225),a=r(n(372407)),o=r(n(172581))},336619:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("peer-read-receipt").version((0,i.getStorage)().versions.version(2),[new o.default("id"),new a.default("msgKeys"),new a.default("ts"),new a.default("ack")]).view((e=>({id:e.id,ts:e.ts,msgKeys:e.msgKeys,ack:e.ack})))},t.getTable=function(){return(0,i.getStorage)().table("peer-read-receipt")};var i=n(587225),a=r(n(372407)),o=r(n(172581))},11454:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("pending-device-sync").version((0,i.getStorage)().versions.version(4),[new a.default("id")]).view((e=>({id:e.id})))},t.getTable=function(){return(0,i.getStorage)().table("pending-device-sync")};var i=n(587225),a=r(n(874712))},822393:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("read-receipt").version((0,i.getStorage)().versions.version(0),[new o.default("id"),new a.default("externalIds")]).delete((0,i.getStorage)().versions.version(3)).view((e=>({id:e.id,externalIds:e.externalIds})))},t.getTable=function(){return(0,i.getStorage)().table("read-receipt")};var i=n(587225),a=r(n(372407)),o=r(n(874712))},7901:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.add=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,o.getABKey)()||"abkey";d=d.concat(e.map(_(t))),p()},t.clear=function(){return S.apply(this,arguments)},t.deleteRange=T,t.getFromBottom=g,t.rowCount=y;var i=r(n(348926)),a=r(n(823493)),o=n(183660),s=n(786950),l=n(241296);const u=1e5,c=parseInt("426861583",10)||0;let d=[];const p=(0,a.default)((()=>C()),200);function _(e){return function(t){return function(e,t){return{marker_id:e.marker_id,method:e.method,action_id:e.action_id,duration_ns:e.duration_ns,marker_type:e.marker_type,sample_rate:e.sample_rate,points:e.points,instance_id:e.instance_id,metadata:e.metadata||{application_analytics:{time_since_qpl_module_init:0}},flags:e.flags,annotations_bool_array:e.annotations_bool_array,annotations_bool:e.annotations_bool,annotations_double_array:e.annotations_double_array,annotations_double:e.annotations_double,annotations_int_array:e.annotations_int_array,annotations_int:e.annotations_int,annotations_string_array:e.annotations_string_array,annotations:e.annotations,app_version:"2.2246.10",app_build_number:c,wa_ab_key2:t}}(t,e)}}function f(){return h.apply(this,arguments)}function h(){return(h=(0,i.default)((function*(){try{yield(0,l.initialize)()}catch(e){throw __LOG__(4,!0,new Error,!0)`QPL Storage, error calling initializeQplStorage, error ${e}`,SEND_LOGS("QPL Storage init error"),e}}))).apply(this,arguments)}function g(){return m.apply(this,arguments)}function m(){return(m=(0,i.default)((function*(e){return yield f(),(0,l.getQplEventsTable)().all({limit:e,offset:0})}))).apply(this,arguments)}function y(){return E.apply(this,arguments)}function E(){return(E=(0,i.default)((function*(){return yield f(),(0,l.getQplEventsTable)().count()}))).apply(this,arguments)}function S(){return(S=(0,i.default)((function*(){return yield f(),(0,l.getQplEventsTable)().clear(!0)}))).apply(this,arguments)}function T(){return v.apply(this,arguments)}function v(){return(v=(0,i.default)((function*(e,t){return yield f(),(0,l.getQplEventsTable)().bulkDeleteRange(["id"],e-1,t+1).then((()=>{}))}))).apply(this,arguments)}let A=null;function C(){return P.apply(this,arguments)}function P(){return(P=(0,i.default)((function*(){if(yield f(),A)A.then(C);else if(d.length>0){const e=d;d=[];try{const t=yield y();if(t+e.length>u){(0,s.maxStorageEventCountReached)();const n=t+e.length-u;yield O(n)}}catch(e){return __LOG__(4,!0,new Error,!0)`QPL Storage, error during checking for excessive events ${e}`,void SEND_LOGS("QPL Storage, error saving events")}A=(0,l.getQplEventsTable)().bulkCreate(e).then((()=>{A=null})).catch((e=>{__LOG__(4,!0,new Error,!0)`QPL Storage, error saving events ${e}`,SEND_LOGS("QPL Storage, error saving events"),A=null}))}}))).apply(this,arguments)}function O(){return I.apply(this,arguments)}function I(){return(I=(0,i.default)((function*(e){const t=yield g(e),n=t[0].id||0,r=t[t.length-1].id||0;yield T(n,r)}))).apply(this,arguments)}},241296:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.destroy=function(){return(0,a.destroyStorage)().catch((()=>(0,i.dexieCastToPromise)(new s.default(a.DATABASE_NAME).delete()))).finally((()=>{l=null}))},Object.defineProperty(t,"getQplEventsTable",{enumerable:!0,get:function(){return o.getTable}}),t.initialize=function(){null==l&&((0,a.createStorage)(),(0,o.addTable)(),l=(0,a.getStorage)().initialize().catch((e=>{throw __LOG__(4,!0,new Error,!0)`Assertion failed!`,SEND_LOGS("Failed to initialize qpl storage"),e})));return l};var i=n(273624),a=n(273944),o=n(181507),s=r(n(986128));let l},273944:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DATABASE_NAME=void 0,t.createStorage=function(){const e=new i.default(u);c=new a.Storage(e),c.addErrorHandler(s.default.AbortError,(e=>{e.message.includes("QuotaExceededError")&&o.StorageCmd.trigger("storage_not_enough_space")}))},t.destroyStorage=function(){if(null==c)return Promise.reject(new Error("[qpl-storage] Storage should be created first before being destroyed"));return c.purge().then((()=>{c=null})).catch((e=>{throw c=null,e}))},t.getStorage=function(){return(0,l.default)(null!=c,"[qpl-storage] Storage should be created first before being accessed"),c};var i=r(n(844800)),a=n(408286),o=n(355701),s=r(n(986128)),l=r(n(441143));const u="qpl-storage";t.DATABASE_NAME=u;let c=null},158352:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.qplEventsCreateTable=function(){return(0,r.getStorage)().versions.version(0)};var r=n(273944)},181507:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("qpl-events").version((0,a.qplEventsCreateTable)(),[new s.default("id"),new o.default("marker_id"),new o.default("instance_id"),new o.default("action_id"),new o.default("sample_rate"),new o.default("method"),new o.default("duration_ns"),new o.default("points"),new o.default("metadata"),new o.default("marker_type"),new o.default("flags"),new o.default("annotations"),new o.default("annotations_double"),new o.default("annotations_int"),new o.default("annotations_bool"),new o.default("annotations_string_array"),new o.default("annotations_double_array"),new o.default("annotations_int_array"),new o.default("annotations_bool_array"),new o.default("app_version"),new o.default("app_build_number"),new o.default("wa_ab_key2")]).view((e=>e))},t.getTable=function(){return(0,i.getStorage)().table("qpl-events")};var i=n(273944),a=n(158352),o=r(n(372407)),s=r(n(172581))},704548:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.destroy=function(){return(0,p.destroyStorage)().catch((()=>(0,i.dexieCastToPromise)(new _.default(p.DATABASE_NAME).delete()))).finally((()=>{f=null}))},Object.defineProperty(t,"getBaseKeyTable",{enumerable:!0,get:function(){return a.getTable}}),Object.defineProperty(t,"getIdentityTable",{enumerable:!0,get:function(){return o.getTable}}),Object.defineProperty(t,"getMetaTable",{enumerable:!0,get:function(){return s.getTable}}),Object.defineProperty(t,"getPreKeyTable",{enumerable:!0,get:function(){return l.getTable}}),Object.defineProperty(t,"getSenderKeyTable",{enumerable:!0,get:function(){return u.getTable}}),Object.defineProperty(t,"getSessionTable",{enumerable:!0,get:function(){return c.getTable}}),Object.defineProperty(t,"getSignedPreKeyTable",{enumerable:!0,get:function(){return d.getTable}}),t.initialize=function(){null==f&&((0,p.createStorage)(),(0,a.addTable)(),(0,o.addTable)(),(0,s.addTable)(),(0,l.addTable)(),(0,u.addTable)(),(0,c.addTable)(),(0,d.addTable)(),f=(0,p.getStorage)().initialize().catch((e=>{throw __LOG__(4,!0,new Error,!0)`Assertion failed!`,SEND_LOGS("Failed to initialize signal storage"),e})));return f};var i=n(273624),a=n(472269),o=n(212448),s=n(509020),l=n(487282),u=n(899802),c=n(98035),d=n(883175),p=n(397981),_=r(n(986128));let f},397981:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.DATABASE_NAME=void 0,t.createStorage=function(){const e=new i.default(u);c=new a.Storage(e),c.addErrorHandler(s.default.AbortError,(e=>{e.message.includes("QuotaExceededError")&&o.StorageCmd.trigger("storage_not_enough_space")}))},t.destroyStorage=function(){if(null==c)return Promise.reject(new Error("[signal-storage] Storage should be created first before being destroyed"));return c.purge().then((()=>{c=null})).catch((e=>{throw c=null,e}))},t.getStorage=function(){return(0,l.default)(null!=c,"[signal-storage] Storage should be created first before being accessed"),c};var i=r(n(844800)),a=n(408286),o=n(355701),s=r(n(986128)),l=r(n(441143));const u="signal-storage";t.DATABASE_NAME=u;let c=null},145958:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.baseKeyCreateTable=function(){return(0,r.getStorage)().versions.version(5)},t.identityCreateTable=function(){return(0,r.getStorage)().versions.version(0)},t.metaCreateTable=function(){return(0,r.getStorage)().versions.version(1)},t.preKeyCreateTable=function(){return(0,r.getStorage)().versions.version(2)},t.senderKeyCreateTable=function(){return(0,r.getStorage)().versions.version(6)},t.sessionCreateTable=function(){return(0,r.getStorage)().versions.version(3)},t.signedPreKeyCreateTable=function(){return(0,r.getStorage)().versions.version(4)};var r=n(397981)},472269:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("baseKey-store").version((0,a.baseKeyCreateTable)(),[new l.default("id"),new o.default("address"),new o.default("originalMsgId"),new o.default("baseKey"),new s.default(["address","originalMsgId"])]).view((e=>({id:e.id,address:e.address,originalMsgId:e.originalMsgId,baseKey:e.baseKey})))},t.getTable=function(){return(0,i.getStorage)().table("baseKey-store")};var i=n(397981),a=n(145958),o=r(n(372407)),s=r(n(974622)),l=r(n(172581))},212448:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("identity-store").version((0,a.identityCreateTable)(),[new s.default("identifier"),new o.default("identityKey"),new o.default("rowId")]).view((e=>({identifier:e.identifier,identityKey:e.identityKey,rowId:e.rowId})))},t.getTable=function(){return(0,i.getStorage)().table("identity-store")};var i=n(397981),a=n(145958),o=r(n(372407)),s=r(n(874712))},509020:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("signal-meta-store").version((0,a.metaCreateTable)(),[new s.default("key"),new o.default("value")]).view((e=>({key:e.key,value:e.value})))},t.getTable=function(){return(0,i.getStorage)().table("signal-meta-store")};var i=n(397981),a=n(145958),o=r(n(372407)),s=r(n(874712))},487282:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("prekey-store").version((0,a.preKeyCreateTable)(),[new s.default("keyId"),new o.default("keyPair"),new o.default("isDirectDistribution")]).view((e=>({keyId:e.keyId,keyPair:e.keyPair,isDirectDistribution:e.isDirectDistribution})))},t.getTable=function(){return(0,i.getStorage)().table("prekey-store")};var i=n(397981),a=n(145958),o=r(n(372407)),s=r(n(172581))},899802:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("senderkey-store").version((0,a.senderKeyCreateTable)(),[new l.default("senderKeyName"),new o.default("senderKey"),new o.default("senderId"),new s.default("senderId")]).view((e=>({senderKeyName:e.senderKeyName,senderKey:e.senderKey,senderId:e.senderId})))},t.getTable=function(){return(0,i.getStorage)().table("senderkey-store")};var i=n(397981),a=n(145958),o=r(n(372407)),s=r(n(599395)),l=r(n(874712))},98035:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("session-store").version((0,a.sessionCreateTable)(),[new s.default("address"),new o.default("session")]).view((e=>({address:e.address,session:e.session})))},t.getTable=function(){return(0,i.getStorage)().table("session-store")};var i=n(397981),a=n(145958),o=r(n(372407)),s=r(n(874712))},883175:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.addTable=function(){(0,i.getStorage)().add("signed-prekey-store").version((0,a.signedPreKeyCreateTable)(),[new s.default("keyId"),new o.default("keyPair"),new o.default("signature")]).view((e=>({keyId:e.keyId,keyPair:e.keyPair,signature:e.signature})))},t.getTable=function(){return(0,i.getStorage)().table("signed-prekey-store")};var i=n(397981),a=n(145958),o=r(n(372407)),s=r(n(172581))},436005:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.ENC_KEY_TTL=t.ENC_KEY_TABLE_NAME=t.ENC_KEY_DB_NAME=t.DbEncKeyStore=t.DB_ENCRYPTION_CIPHER=void 0;var i=r(n(81109)),a=r(n(348926)),o=n(417405),s=n(827653),l=n(990445),u=n(273624),c=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=_(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(r,a,o):r[a]=e[a]}r.default=e,n&&n.set(e,r);return r}(n(288057)),d=r(n(986128)),p=r(n(441143));function _(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(_=function(e){return e?n:t})(e)}const f="wawc_db_enc";t.ENC_KEY_DB_NAME=f;const h="keys";t.ENC_KEY_TABLE_NAME=h;const g={name:"HKDF"},m={hash:"SHA-256"},y=4*l.WEEK_MILLISECONDS*24;t.ENC_KEY_TTL=y;const E="fts_hmac_keys",S="AES-CBC";t.DB_ENCRYPTION_CIPHER=S;function T(){const e=new Uint8Array(128);return self.crypto.getRandomValues(e),self.crypto.subtle.importKey("raw",e,g,!1,["deriveKey"])}const v=new class{constructor(){var e=this;this._waitUntilFinalDbEncKeyReady=new s.Resolvable,this._waitUntilEncKeyReady=new s.Resolvable,this._waitUntilFinalFtsHmacKeyReady=new s.Resolvable,this._getOrUpdateEncKeys=e=>this._getDbOrThrow().keys.orderBy("id").toArray().then((t=>{if(!t||0===t.length)return this._addNewEncKey(e);const n=t[t.length-1]._expiration;if(null!=n&&n<=(new Date).getTime())return this._addNewEncKey(e);this._ephemeralLocalEncSalt=e;const r=t.map(function(){var t=(0,a.default)((function*(t){const n=yield self.crypto.subtle.deriveKey((0,i.default)((0,i.default)((0,i.default)({},g),m),{},{salt:e,info:new Uint8Array(1)}),t.key,{name:S,length:128},!1,["encrypt","decrypt"]);return(0,i.default)((0,i.default)({},t),{},{key:n})}));return function(){return t.apply(this,arguments)}}());return Promise.all(r).then((e=>{this._keys=e,this._waitUntilEncKeyReady.resolve()}))})),this._getOrUpdateFtsKey=()=>this._getDbOrThrow().fts_hmac_keys.orderBy("id").toArray().then((e=>{if(!e||0===e.length)return this._addNewFtsHMACKey();if(e.length>1)throw new c.DBInvalidFtsHMACKey;this._ftsHMACKey=e[e.length-1]})),this._addNewEncKey=e=>T().then((t=>this._getDbOrThrow().keys.add({key:t,_expiration:(new Date).getTime()+y}).then((()=>this._getOrUpdateEncKeys(e))))),this._addNewFtsHMACKey=()=>T().then((e=>this._getDbOrThrow().fts_hmac_keys.add({key:e}).then((()=>this._getOrUpdateFtsKey())))),this.generateFinalDbEncryptionAndFtsKey=e=>{if(null!=this._finalDbMsgEncKeys||null==this._ephemeralLocalEncSalt)return Promise.resolve();const t=(0,o.decodeB64)(e);return this._generateFinalFtsHmacKey(t),this._generateFinalDbMsgEncryptionKey(t),Promise.resolve()},this._generateFinalDbMsgEncryptionKey=t=>this._getDbOrThrow().keys.orderBy("id").toArray().then((n=>{const r=n.map(function(){var n=(0,a.default)((function*(n){let r;(0,p.default)(null!=e._ephemeralLocalEncSalt,"local salt is undefined");try{r=yield self.crypto.subtle.deriveKey((0,i.default)((0,i.default)((0,i.default)({},g),m),{},{salt:t,info:new Uint8Array(e._ephemeralLocalEncSalt||0)}),n.key,{name:S,length:128},!1,["encrypt","decrypt"])}catch(t){throw e._ephemeralLocalEncSalt=null,t}return(0,i.default)((0,i.default)({},n),{},{key:r})}));return function(){return n.apply(this,arguments)}}());return Promise.all(r).then((e=>{this._ephemeralLocalEncSalt=null,this._finalDbMsgEncKeys=e,this._waitUntilFinalDbEncKeyReady.resolve()}))})).finally((()=>{this._ephemeralLocalEncSalt=null})),this._generateFinalFtsHmacKey=function(){var t=(0,a.default)((function*(t){if(!e._ftsHMACKey||null==e._ftsHMACKey.key||null==e._ftsHMACKey.id)throw __LOG__(2)`Base ftsHMACKey is null in _generateFinalFtsHmacKey`,new c.DBInvalidFtsHMACKey;const[n,r]=[e._ftsHMACKey.id,e._ftsHMACKey.key],a=yield self.crypto.subtle.deriveKey((0,i.default)((0,i.default)((0,i.default)({},g),m),{},{salt:t,info:new Uint8Array(0)}),r,{name:"HMAC",hash:"SHA-256"},!1,["sign"]);e._finalFtsHmacKey={id:n,key:a},e._waitUntilFinalFtsHmacKeyReady.resolve()}));return function(){return t.apply(this,arguments)}}()}init(e){if(this._db)return Promise.resolve();this._db=new d.default(f),this._getDbOrThrow().version(1).stores({[h]:"++id, _expirtation",[E]:"++id"}),this._getDbOrThrow().version(2).stores({[h]:"++id",[E]:"++id"});const t=e.buffer.slice(e.byteOffset,e.byteLength+e.byteOffset);return(0,u.dexieCastToPromise)(this._getDbOrThrow().open()).then((()=>Promise.all([this._getOrUpdateEncKeys(t),this._getOrUpdateFtsKey()])))}_getDbOrThrow(){if(null==this._db)throw new Error("[db_encryption_key] db is not initialized");return this._db}deleteKeys(){return Promise.all([this._getDbOrThrow().table(h).clear(),this._getDbOrThrow().table(E).clear()]).then((()=>{})).finally((()=>(this._db=null,(0,u.dexieCastToPromise)(d.default.delete(f)).catch((()=>d.default.delete(f))))))}deleteKeyCache(){this._keys=null,this._ftsHMACKey=null,this._finalDbMsgEncKeys=null,this._waitUntilFinalDbEncKeyReady=new s.Resolvable,this._waitUntilFinalFtsHmacKeyReady=new s.Resolvable,this._waitUntilEncKeyReady=new s.Resolvable,this._finalFtsHmacKey=null,this._ephemeralLocalEncSalt=null}waitForEncKey(){return this._waitUntilEncKeyReady.promise}waitForFinalDbMsgEncKey(){return this._waitUntilFinalDbEncKeyReady.promise}waitForFinalFtsHmacKey(){return this._waitUntilFinalFtsHmacKeyReady.promise}getEncKeys(){if(!this._keys)throw new c.DbEncKeyNotLoaded(h);return this._keys}getDbMsgEncKeys(){if(!this._finalDbMsgEncKeys)throw new c.DbMsgEncKeyNotLoaded(h);return this._finalDbMsgEncKeys}getFtsHMACKey(){if(!this._finalFtsHmacKey)throw new c.DbEncKeyNotLoaded(E);return this._finalFtsHmacKey}};t.DbEncKeyStore=v},144778:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return a.apply(this,arguments)};var i=r(n(348926));function a(){return(a=(0,i.default)((function*(){const e=window.caches;if(null==e)return;const t=yield e.keys();yield Promise.all(t.map((t=>e.delete(t))))}))).apply(this,arguments)}},273624:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dexieCastToPromise=function(e){return Promise.resolve(e)}},355701:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.StorageCmdImpl=t.StorageCmd=void 0;var i=r(n(395654));class a extends i.default{}t.StorageCmdImpl=a;const o=new a;t.StorageCmd=o},482904:(e,t,n)=>{"use strict";var r=n(595318);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=n(643930),a=n(924583),o=n(975175),s=n(344611),l=n(368170),u=r(n(571834)),c=r(n(986128)),d=r(n(730381));const p={ERROR:"error",OPENING:"opening",BLOCKED:"blocked",OPEN:"open",CLOSED:"closed",FAILED:"failed"};let _=!1,f=null;function h(){this._dbName=s.WEB_IDB_DB_NAMES.wawc,this._db=new c.default(this._dbName),this._db.on("versionchange",(e=>{this._db.close(),__LOG__(2)`db: close db due to versionchange`,e&&null!=e.newVersion&&e.newVersion!==e.oldVersion&&(_=!0,f&&f())})),this._db.version(1).stores({logs:"line,log"}),this._db.version(2).stores({logs:"line,log",assets:"key,hash,data"}),this._db.version(3).stores({logs:"line,log",assets:"key,hash,data",wam:",buffer,prevValues,lastSend"}),this._db.version(4).stores({logs:"line,log",assets:"key,hash,data",wam:",key,buffer",l10n:"key,hash,t"}).upgrade((function(e){e.wam.toCollection().modify((function(e){e.key=e.lastSend,delete e.prevValues,delete e.lastSend}))})),this._db.version(5).stores({logs:"line,log",assets:null,wam:",key,buffer",l10n:"key,hash,t"}),this._db.version(6).stores({logs:"line,log,timestamp",wam:",key,buffer",l10n:"key,hash,t"}).upgrade((e=>{e.logs.toCollection().count().then((()=>{e.logs.toCollection().modify((e=>{const{log:t}=e;e.timestamp=1e3*(0,d.default)(t.slice(5,28),"YYYY-MM-DD HH:mm:ss.SSS").unix()}))}))})),this._db.version(7).stores({logs:"line,log,timestamp",wam:",key,buffer",l10n:"key,hash,t",user:"key"}),this._db.version(8).stores({logs:"line,log,timestamp",wam:",key,buffer,channel",l10n:"key,hash,t",user:"key"}).upgrade((e=>{e.wam.toCollection().modify((e=>{e.channel="regular"}))})),this._db.version(9).stores({logs:"line,log,timestamp",wam:",key,buffer,channel",wam_meta:"streamId,seqNum",l10n:"key,hash,t",user:"key"}),this._db.version(10).stores({logs:"line,log,timestamp",wam:",key,buffer,channel",wam_meta:"streamId,seqNum",ps_meta:"key, value, rotateInDays, lastRotationTimeUtc",ps_tokens:"key",l10n:"key,hash,t",user:"key"}),this._db.version(11).stores({logs:"line,log,timestamp",wam:",key,buffer,channel",wam_meta:"streamId,seqNum",ps_meta:"key, value, rotateInDays, lastRotationTimeUtc",ps_tokens:"key",l10n:"key,hash,t",user:"key",core_wam:"key, streamId",core_wam_meta:"streamId"}),this.openAttempt=0,this.openDB().catch((e=>{__LOG__(3)`openDB failed: ${e}`})),this._dbState=p.OPENING}h.prototype.loadUserIdb=function(){return this.idb().then((e=>e.transaction("rw",e.user,(()=>e.user.toArray().then((e=>e.forEach((e=>{this.permanentStorage.dataStore[e.key]=e.value})))))))).catch((e=>{__LOG__(3)`db:loadUserIdb:Error ${e}`}))},h.prototype.openDB=function(){this._db.isOpen()&&(this._db.close(),__LOG__(2)`db: close db due to duplicate openDB`);const e=(0,o.promiseTimeout)(Promise.resolve(this._db.open()),1e4).then((()=>{__LOG__(2)`db: Successfully opened db`;return new u.default.WebcDbOpen({webcDbName:this._dbName,webcDbOpenWasSuccess:!0,webcDbOpenNumAttempts:this.openAttempt}).commit(),this._dbState=p.OPEN,p.OPEN})).catch((0,a.filteredCatch)(i.TimeoutError,(()=>{__LOG__(2)`db:openDB blocked`;return new u.default.WebcDbOpen({webcDbName:this._dbName,webcDbOpenWasSuccess:!1,webcDbOpenNumAttempts:this.openAttempt}).commit(),this._dbState=p.BLOCKED,p.BLOCKED}))).catch((e=>{if(__LOG__(3)`db:openDB:Error ${e}`,this.openAttempt>1||l.UA.isSafari){this.opening=void 0,this._dbState=p.ERROR;throw new u.default.WebcDbOpen({webcDbName:this._dbName,webcDbOpenWasSuccess:!1,webcDbOpenNumAttempts:this.openAttempt}).commit(),p.ERROR}return this.openAttempt+=1,this._db.delete().catch((e=>{throw __LOG__(3)`db:deleteDB:Error ${e}`,this.opening=void 0,this._dbState=p.ERROR,p.ERROR})).then((()=>this.openDB()))})).then((e=>{if(this.opening=void 0,e===p.BLOCKED)throw p.BLOCKED;return this._db}));return this.opening||(this.opening=e),e},h.prototype.idb=function(){return this._db.isOpen()?Promise.resolve(this._db):this._db.hasFailed()?(__LOG__(3)`Dexie: database failed to open, hasClosed ${this._db.hasBeenClosed()}`,Promise.reject(new Error(p.FAILED))):this._dbState===p.BLOCKED?(__LOG__(3)`Dexie: database is blocked`,Promise.reject(new Error(p.BLOCKED))):this.opening?this.opening:(__LOG__(3)`Dexie: database is closed`,Promise.reject(new Error(p.CLOSED)))},h.prototype.onVersionChange=function(e){f=e,_&&f()},h.prototype.State=p;var g=new h;t.default=g},780625:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let{error:t}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(0,i.default)({},null);if(null!=t)return t;return new Error(e)};var i=r(n(73982))},953268:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=Object.freeze({BACKSPACE:8,TAB:9,RETURN:13,SHIFT:16,CTRL:17,ALT:18,PAUSE_BREAK:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,LEFT_WINDOW_KEY:91,RIGHT_WINDOW_KEY:92,SELECT_KEY:93,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,MULTIPLY:106,ADD:107,SUBTRACT:109,DECIMAL_POINT:110,DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUM_LOCK:144,SCROLL_LOCK:145,SEMI_COLON:186,EQUAL_SIGN:187,COMMA:188,DASH:189,PERIOD:190,FORWARD_SLASH:191,GRAVE_ACCENT:192,OPEN_BRACKET:219,BACK_SLASH:220,CLOSE_BRAKET:221,SINGLE_QUOTE:222});t.default=n},731058:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t={};for(const[n,r]of(0,i.default)(e))null!=r&&(t[n]=r);return t};var i=r(n(257008))},257008:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return Object.entries(e)}},599001:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t={};if(!(e instanceof Object)||Array.isArray(e))throw(0,i.default)("keyMirror(...): Argument must be an object.","comet_infra");for(const n in e)e.hasOwnProperty(n)&&(t[n]=n);return t};var i=r(n(780625))},170872:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=[];for(const n of e)null!=n&&t.push(n);return t}},871690:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(r(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(let a=0;a<i.length;a++)if(!n.call(t,i[a])||!r(e[i[a]],t[i[a]]))return!1;return!0};const n=Object.prototype.hasOwnProperty;function r(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}},765305:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const n=e.map(((e,n)=>({index:n,sortValue:t(e),value:e})));return n.sort(((e,t)=>{const n=e.sortValue,r=t.sortValue;return n>r?1:n<r?-1:e.index-t.index})),n.map((e=>e.value))}},900628:(e,t,n)=>{"use strict";var r=n(307914);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(e.size!==t.size)return!1;return(0,i.default)(e,(e=>t.has(e)))};var i=r(n(896608))},896608:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){const r=e.entries();let i=r.next();for(;!i.done;){const a=i.value;if(!t.call(n,a[1],a[0],e))return!1;i=r.next()}return!0}},754057:(e,t,n)=>{e.exports=n.p+"img/bg-chat-tile-dark_a4be512e7195b6b733d9110b408f075d.png"},217498:(e,t,n)=>{e.exports=n.p+"img/bg-chat-tile-light_04fcacde539c58cca6745483d4858c52.png"},192256:(e,t,n)=>{e.exports=n.p+"img/f00_50f7c47f611e65a746f1d8328172af4c.png"},107151:(e,t,n)=>{e.exports=n.p+"img/f01_3d1e81d38917ed4427168024350d8df6.png"},329449:(e,t,n)=>{e.exports=n.p+"img/f02_c83a3786caa656cdcea06396bbc6c1fc.png"},594719:(e,t,n)=>{e.exports=n.p+"img/f03_dc76f32180586199d7e1872dd004832c.png"},783004:(e,t,n)=>{e.exports=n.p+"img/f04_f13406e16c2b6a8dda89763cf005b02b.png"},99381:(e,t,n)=>{e.exports=n.p+"img/f05_566b33dfb23660bf5fa83125a9dd8218.png"},604893:(e,t,n)=>{e.exports=n.p+"img/f06_f564cba48589a560af4b6e8408ae1718.png"},761353:(e,t,n)=>{e.exports=n.p+"img/f07_ae76e3caeb9dde2ad18eab0ce141d223.png"},945598:(e,t,n)=>{e.exports=n.p+"img/f08_59c98baa006f5eac6629be0957fd73f2.png"},379575:(e,t,n)=>{e.exports=n.p+"img/f09_1a7f295d0fa98fa1d2a63f8dc4600341.png"},105211:(e,t,n)=>{e.exports=n.p+"img/f10_53c9084de35f9f003ed395e1d120d9b6.png"},419751:(e,t,n)=>{e.exports=n.p+"img/f11_c129c05bc58cad686e0934357d6194fb.png"},61294:(e,t,n)=>{e.exports=n.p+"img/f12_bf90fa5257d34005ad5b75ffebb9b74c.png"},970938:(e,t,n)=>{e.exports=n.p+"img/f13_156bc51d4150b9b257fa4e2e774ce985.png"},381790:(e,t,n)=>{e.exports=n.p+"img/f14_95fa7d926a8cf1638985d3cd551fac31.png"},8669:(e,t,n)=>{e.exports=n.p+"img/f15_454f1add82fcb11fbb4086c8be3b1bd9.png"},130047:(e,t,n)=>{e.exports=n.p+"img/f16_9ca6324f98317f9d73084696719d2b9b.png"},361022:(e,t,n)=>{e.exports=n.p+"img/f17_9376c16fcd9b554de8a081973bebe9aa.png"},633295:(e,t,n)=>{e.exports=n.p+"img/f18_cc883fb28c32b1652826de5dc16feee0.png"},299635:(e,t,n)=>{e.exports=n.p+"img/f19_c448ba8ef94abcf763e25003aa15d27d.png"},882645:(e,t,n)=>{e.exports=n.p+"img/f20_4ebcff229b29e651b73640d0cd8eccb2.png"},367083:(e,t,n)=>{e.exports=n.p+"img/f21_54d02a1f6ad665760923ecfae9c9ff25.png"},755359:(e,t,n)=>{e.exports=n.p+"img/f22_ca38cbb571fbddb6900518455b8a20b9.png"},30003:(e,t,n)=>{e.exports=n.p+"img/f23_851a6d2ec552319ddaac7ff8ff37263e.png"},677659:(e,t,n)=>{e.exports=n.p+"img/f24_7806bc8ea69d9441ff27032fbaf52907.png"},81024:(e,t,n)=>{e.exports=n.p+"img/f25_68d927d9d12aef33387b683be6341340.png"},564195:(e,t,n)=>{e.exports=n.p+"img/f26_eb28a47950f61dc80827a74063d8786a.png"},837704:(e,t,n)=>{e.exports=n.p+"img/f27_d53f3b6cf583d7a41f3434d18fe4456e.png"},393374:(e,t,n)=>{e.exports=n.p+"img/f28_245f3d8d8dae33bdc04373918922c5a8.png"},712282:(e,t,n)=>{e.exports=n.p+"img/f29_31c6170329c4cf5808fe773488b5d143.png"},657894:(e,t,n)=>{e.exports=n.p+"img/f30_105e340803065abb74841ce2fff42b4b.png"},353320:(e,t,n)=>{e.exports=n.p+"img/f31_db46b1350eb553583212866aa44e2ac0.png"},918234:(e,t,n)=>{e.exports=n.p+"img/f32_4c358e4136bab81e06b7fd7171a7908c.png"},537426:(e,t,n)=>{e.exports=n.p+"img/f33_5a8f246313db052d67853a40f77a6427.png"},37382:(e,t,n)=>{e.exports=n.p+"img/f34_8588016a836bc826824d0656c8b7b0bc.png"},380904:(e,t,n)=>{e.exports=n.p+"img/f35_8aefe3b46c378109f0f780b6954e18db.png"},605193:(e,t,n)=>{e.exports=n.p+"img/f36_793fc72fadaf963507fc6802a9470970.png"},838324:(e,t,n)=>{e.exports=n.p+"img/f37_8d8f6653cbe1f6dd3783174a8af618da.png"},683149:(e,t,n)=>{e.exports=n.p+"img/f38_54b8f37e9f1251bfe9a2a2ef88a31912.png"},968480:(e,t,n)=>{e.exports=n.p+"img/f39_23a6e90aa9166a2fb981cc171abe8513.png"},235741:(e,t,n)=>{e.exports=n.p+"img/f40_923f39f07df4b8ad006e1115dcb206ec.png"},424081:(e,t,n)=>{e.exports=n.p+"img/f41_87448793e4bcea7fae3cfa7532e45033.png"},709062:(e,t,n)=>{e.exports=n.p+"img/f42_cd0e42183cff2e75bdde0c139bbb641a.png"},951839:(e,t,n)=>{e.exports=n.p+"img/f43_9f44150edcf010967cf272c80bd4ff14.png"},477271:(e,t,n)=>{e.exports=n.p+"img/f44_7f5d4a3e29f21bd5d5572a1543448949.png"},39622:(e,t,n)=>{e.exports=n.p+"img/f45_04c55805346c4afbc7f8084570a2cd48.png"},148373:(e,t,n)=>{e.exports=n.p+"img/f46_1e9f9b05193093b5d0d80d9c936bcb36.png"},51400:(e,t,n)=>{e.exports=n.p+"img/f47_152a85c5e9ff12d5f85050ecad1d4313.png"},542720:(e,t,n)=>{e.exports=n.p+"img/f48_bd6d89500662b8605997f54027b2e650.png"},243805:(e,t,n)=>{e.exports=n.p+"img/f49_42185158c0bfff92c70f417c74297ce7.png"},56995:(e,t,n)=>{e.exports=n.p+"img/f50_d825d156222c0d93428f4ecd78564c75.png"},575688:(e,t,n)=>{e.exports=n.p+"img/f51_51e116016636d309962001419e70d5f1.png"},131796:(e,t,n)=>{e.exports=n.p+"img/f52_5296e30be9bec98ccf173a9be6e711a9.png"},173785:(e,t,n)=>{e.exports=n.p+"img/f53_f81b7a3702779e190aeefb7e2183e636.png"},162521:(e,t,n)=>{e.exports=n.p+"img/f54_37b3eb612da7ad6c0b20b65e4fdae582.png"},471449:(e,t,n)=>{e.exports=n.p+"img/f55_0c3d912e971e18d6fe8946550262d0e6.png"},298224:(e,t,n)=>{e.exports=n.p+"img/f56_97a65c1c44dced234e0fbb5f78cb277f.png"},710601:(e,t,n)=>{e.exports=n.p+"img/f57_88b41898da1ce86274ee318e1713f437.png"},972870:(e,t,n)=>{e.exports=n.p+"img/f58_56649fe103006ec4fc5bdea5c69f7828.png"},493224:(e,t,n)=>{e.exports=n.p+"img/f59_1dd065a271b58e1ecb9bb3b6c261107f.png"},921564:(e,t,n)=>{e.exports=n.p+"img/f60_4b277b056575663ee9dbf81fecce989e.png"},93169:(e,t,n)=>{e.exports=n.p+"img/f61_ef3fba8c7e6d895afacfb334e7a746ff.png"},154423:(e,t,n)=>{e.exports=n.p+"img/f62_edecb61bfd5cd13895dd8134898d4402.png"},303491:(e,t,n)=>{e.exports=n.p+"img/f63_245e85a3728d5fed6ff9acf1182f4797.png"},886262:(e,t,n)=>{e.exports=n.p+"img/f64_48df8c352924ef1153bb8fd56f5af198.png"},37806:(e,t,n)=>{e.exports=n.p+"img/f65_162b82a8adaf7d2815129f38f265bfb6.png"},135049:(e,t,n)=>{e.exports=n.p+"img/f66_c626c592461087351ad719fa3118959d.png"},704971:(e,t,n)=>{e.exports=n.p+"img/f67_daa263ddff773a14e3ababc4b485a7c9.png"},332845:(e,t,n)=>{e.exports=n.p+"img/f68_ec21f5c8c90ec3bbf634290d6e6025c0.png"},529664:(e,t,n)=>{e.exports=n.p+"img/f69_549a880f1517135abf8914b4cb31fa92.png"},29469:(e,t,n)=>{e.exports=n.p+"img/f70_a69c6599124e3c33d7fac368b07c0249.png"},860540:(e,t,n)=>{e.exports=n.p+"img/f71_4aceb1dc5eaeb5f9cdddf4975e45a841.png"},114364:(e,t,n)=>{e.exports=n.p+"img/f72_f4ed6835609bf3831a20437e8e47d2dc.png"},34476:(e,t,n)=>{e.exports=n.p+"img/f73_94b8b5d2760e6afd967fd74a008cfae0.png"},280952:(e,t,n)=>{e.exports=n.p+"img/f74_2cd31cfe47f05fabb12f9b9f76fc2b6b.png"},547236:(e,t,n)=>{e.exports=n.p+"img/f75_25366bc618fe77d5dfd9db90133f2766.png"},991385:(e,t,n)=>{e.exports=n.p+"img/f76_1347ad29de86f3d0ceb3bf329b06a0a7.png"},886342:(e,t,n)=>{e.exports=n.p+"img/f77_6749eab5d350640476c8ec39ebc3e4db.png"},593828:(e,t,n)=>{e.exports=n.p+"img/f78_9effc679939e4458adafae48294a5db5.png"},407026:(e,t,n)=>{e.exports=n.p+"img/f79_36df3d2cd225fa6b3a6c84c69b72bed1.png"},659076:(e,t,n)=>{e.exports=n.p+"img/f80_f94a52bb981c25a9f8643a55d023be59.png"},686555:(e,t,n)=>{e.exports=n.p+"img/f81_fb74d3d4cc5a27e62e93586c7d09e47e.png"},215330:(e,t,n)=>{e.exports=n.p+"img/f82_2741f2d09772f3e9e836f2c50fb0bf99.png"},751331:(e,t,n)=>{e.exports=n.p+"img/f83_f8586167f3fde3b1e0c7dbb479e5c0ab.png"},844780:(e,t,n)=>{e.exports=n.p+"img/f84_f5b79393aa7e2979b376c76f46d39b52.png"},902506:(e,t,n)=>{e.exports=n.p+"img/f85_7ea40f8452fb838a747fb0881ffd5980.png"},527300:(e,t,n)=>{e.exports=n.p+"img/f86_486fdf332fda50c1cd7c4b9bd8a3f993.png"},235074:(e,t,n)=>{e.exports=n.p+"img/f87_91e88bfc16e4baddaf2fc4f881c3efc5.png"},583020:(e,t,n)=>{e.exports=n.p+"img/f88_286401f05def8a122db7f4686e383691.png"},558516:(e,t,n)=>{e.exports=n.p+"img/f89_658f39d559719b5b6208346f6a7753b9.png"},615707:(e,t,n)=>{e.exports=n.p+"img/f90_d5612bad79e603d92135c3bbfbcd14d1.png"},871247:(e,t,n)=>{e.exports=n.p+"img/f91_58bb429f953c740a98bcab0c032e8e25.png"},654647:(e,t,n)=>{e.exports=n.p+"img/f92_970e0969177b051897bdd55bf12ee3ae.png"},167517:(e,t,n)=>{e.exports=n.p+"img/f93_4776ec98a5d48ae85b24621ad1eac6eb.png"},383439:(e,t,n)=>{e.exports=n.p+"img/f94_296c4ae16a836cf0903cc5ef0476333c.png"},938404:(e,t,n)=>{e.exports=n.p+"img/f95_888ec2f78b312aed756a8d7008dc979b.png"},550273:(e,t,n)=>{e.exports=n.p+"img/f96_5b97286be655dbd4f5aa79f5f008c5ce.png"},312123:(e,t,n)=>{e.exports=n.p+"img/f97_b4ff99d92592c44b5d8a5b501fc24da6.png"},879144:(e,t,n)=>{e.exports=n.p+"img/f98_0922d228059acde80cc489a2879fe864.png"},440594:(e,t,n)=>{e.exports=n.p+"img/f99_c608e2edac2f741a5a39b814ba36c287.png"},172654:(e,t,n)=>{e.exports=n.p+"img/favicon-error_ac2b4ac0b3a8a9d2256d517e69a3e272.png"},819528:(e,t,n)=>{e.exports=n.p+"img/favicon-error2_fb2afa4bfd23495c7bd2555bb080bb35.png"},429242:(e,t,n)=>{e.exports=n.p+"img/favicon_c5088e888c97ad440a61d247596f88e5.png"},211372:(e,t,n)=>{e.exports=n.p+"img/f00_81a748c30861e19178cb90ab8b31c9e4.png"},648039:(e,t,n)=>{e.exports=n.p+"img/f01_78cd893586564a736b94f919cd2851f7.png"},149519:(e,t,n)=>{e.exports=n.p+"img/f02_4bfcfe058a11109e81b7e9cbdfdeb02a.png"},298446:(e,t,n)=>{e.exports=n.p+"img/f03_577fd59324f5db48af17efcba0a23ea5.png"},868917:(e,t,n)=>{e.exports=n.p+"img/f04_841c20c722f90620ba13762ae73f6143.png"},146454:(e,t,n)=>{e.exports=n.p+"img/f05_c1bde74d642126370c5da5fb0de680c6.png"},580841:(e,t,n)=>{e.exports=n.p+"img/f06_eb85be6945aa4a51c3e05d97ecb1c290.png"},941038:(e,t,n)=>{e.exports=n.p+"img/f07_4d1031e781a9619d0579571eb2049ee6.png"},457522:(e,t,n)=>{e.exports=n.p+"img/f08_4d61c3d691066fa829ad43af1d6063ca.png"},604754:(e,t,n)=>{e.exports=n.p+"img/f09_f9d4e1b3266f81e8952251520de80711.png"},644183:(e,t,n)=>{e.exports=n.p+"img/f10_1f2eeb1340d4c4b4d423117d47d5f56e.png"},899233:(e,t,n)=>{e.exports=n.p+"img/f11_699424412fed1628d27e04957a284d2e.png"},800347:(e,t,n)=>{e.exports=n.p+"img/f12_ef4dd9b4bc88503d33fde312a57af7f9.png"},452761:(e,t,n)=>{e.exports=n.p+"img/f13_0bf1895a611a2187f9758ac305e87d2e.png"},219754:(e,t,n)=>{e.exports=n.p+"img/f14_df2ad83835b022116ce26f030de1a13d.png"},318613:(e,t,n)=>{e.exports=n.p+"img/f15_cffc8769d0c2ef7f8f8d5fc16e339cab.png"},117613:(e,t,n)=>{e.exports=n.p+"img/f16_8b958a65cb9dbf5c7716f1c865391473.png"},670322:(e,t,n)=>{e.exports=n.p+"img/f17_83147bc30e9d1cfe9ae417bf4afc2f77.png"},55928:(e,t,n)=>{e.exports=n.p+"img/f18_9595be739a769411763ad68c24cb245f.png"},98442:(e,t,n)=>{e.exports=n.p+"img/f19_2b465cf764fb53292292e003e070268a.png"},732677:(e,t,n)=>{e.exports=n.p+"img/f20_a781e4e7a5b4d97c226843b0f2d1472d.png"},664770:(e,t,n)=>{e.exports=n.p+"img/f21_b03a1e45532edd017ebbda6b8e2566bb.png"},643426:(e,t,n)=>{e.exports=n.p+"img/f22_809ee1be83cf9aba76ecde6bf3e65e58.png"},31644:(e,t,n)=>{e.exports=n.p+"img/f23_e2c0fa78795ee79b68fdbdca50a960ae.png"},106597:(e,t,n)=>{e.exports=n.p+"img/f24_3832927a08d4eec1867a7d7c4ba2fcd7.png"},407210:(e,t,n)=>{e.exports=n.p+"img/f25_0ade03b46b6e8819de9523bc8ff6a7cd.png"},561890:(e,t,n)=>{e.exports=n.p+"img/f26_e38c0e2c62dae55d9cdf26d8c22b6b9d.png"},258229:(e,t,n)=>{e.exports=n.p+"img/f27_b4871a7570313a9f599b1911f339413d.png"},181250:(e,t,n)=>{e.exports=n.p+"img/f28_1b3971aa7b75218570c3d9940aa4a73d.png"},341431:(e,t,n)=>{e.exports=n.p+"img/f29_f2c7a605126e29e8885601cdc65e6aa0.png"},60853:(e,t,n)=>{e.exports=n.p+"img/f30_712d71bfb048818a771a9d144b40d9aa.png"},875920:(e,t,n)=>{e.exports=n.p+"img/f31_1d19e90516ce464192bd7016d05a2dba.png"},621202:(e,t,n)=>{e.exports=n.p+"img/f32_9a70dc1de944f622b350752076a6310d.png"},523022:(e,t,n)=>{e.exports=n.p+"img/f33_1f3382e82a8abe7cdce46f789f7c4ede.png"},746622:(e,t,n)=>{e.exports=n.p+"img/f34_29dc69ea8e91117dae46fcf7e7f58417.png"},13683:(e,t,n)=>{e.exports=n.p+"img/f35_fa478612d2487e2fead293b7005566ea.png"},945274:(e,t,n)=>{e.exports=n.p+"img/f36_bb827e69f0979553e18c0fd1cb192b02.png"},374507:(e,t,n)=>{e.exports=n.p+"img/f37_b06f5850d2c8eda0c51ad5491779af6c.png"},536466:(e,t,n)=>{e.exports=n.p+"img/f38_0b370e976457b876910c4a638ac302e2.png"},855254:(e,t,n)=>{e.exports=n.p+"img/f39_a09d7dfecc70b04ec35edc2967c60a30.png"},695725:(e,t,n)=>{e.exports=n.p+"img/f40_ed134cdcd59bb430218f2be2cdd20aa1.png"},297585:(e,t,n)=>{e.exports=n.p+"img/f41_a785dbfd120b89c2e8616357b9722163.png"},175218:(e,t,n)=>{e.exports=n.p+"img/f42_4149402ff16c6de0b1b06eff01619455.png"},81303:(e,t,n)=>{e.exports=n.p+"img/f43_d543d1bc6a09014ac24d7189b0ced761.png"},249465:(e,t,n)=>{e.exports=n.p+"img/f44_9ffa8beb4bd1c21f328fdd822cba19a7.png"},55625:(e,t,n)=>{e.exports=n.p+"img/f45_0c3cea68945b437380dacd15cbe90ded.png"},448475:(e,t,n)=>{e.exports=n.p+"img/f46_58320ab4676a6287d9dec0790f0d88fc.png"},767848:(e,t,n)=>{e.exports=n.p+"img/f47_5f2ac6f7a9fe79dc3d9a701872c0d0f8.png"},658139:(e,t,n)=>{e.exports=n.p+"img/f48_5fdbdf26d5c581f2a84ebfa50355bd2d.png"},697019:(e,t,n)=>{e.exports=n.p+"img/f49_7bd9cdf5a225ef778b0abd7c9b5310ba.png"},263744:(e,t,n)=>{e.exports=n.p+"img/f50_f4b49b8b3eb729c1fd7c991958aa67b7.png"},814517:(e,t,n)=>{e.exports=n.p+"img/f51_cccd95bad4c9b8e03d05f634e91d2cc8.png"},302181:(e,t,n)=>{e.exports=n.p+"img/f52_8cc8a9757166f53c59a5a1c5e2ebeb00.png"},665405:(e,t,n)=>{e.exports=n.p+"img/f53_623900497390a42269ea6c7ffd812ecc.png"},661605:(e,t,n)=>{e.exports=n.p+"img/f54_c114021c7945464df273df92403987cb.png"},990866:(e,t,n)=>{e.exports=n.p+"img/f55_bcfef9ad8bf26d250613af9b04c918cf.png"},671888:(e,t,n)=>{e.exports=n.p+"img/f56_76dd317a660aa4927e72484ef9d903fb.png"},435515:(e,t,n)=>{e.exports=n.p+"img/f57_72ed0f17ab92bb06761245cb5a7fd73b.png"},18457:(e,t,n)=>{e.exports=n.p+"img/f58_8b9aa917870bcfabc296989c8a810446.png"},820009:(e,t,n)=>{e.exports=n.p+"img/f59_1a64de23c9ec094314b18a18108319ce.png"},63163:(e,t,n)=>{e.exports=n.p+"img/f60_4926d3e8b53f38a3c792cb7b3e07d48d.png"},820930:(e,t,n)=>{e.exports=n.p+"img/f61_08509dff37749613925fe8b16a84ba56.png"},969341:(e,t,n)=>{e.exports=n.p+"img/f62_0869c06452d4ebecdc99f7192ebc702f.png"},108373:(e,t,n)=>{e.exports=n.p+"img/f63_6083f333c2239cba7bbde44e7607a67c.png"},399910:(e,t,n)=>{e.exports=n.p+"img/f64_5d2e1af055fb2cb08326de8e4a844eab.png"},510127:(e,t,n)=>{e.exports=n.p+"img/f65_c863d05c20e4ff179c46170a5311afaf.png"},134843:(e,t,n)=>{e.exports=n.p+"img/f66_1971ad2c6440b2fc909759d8614ef901.png"},168683:(e,t,n)=>{e.exports=n.p+"img/f67_8817a536067dadbc7dc0b1ce0c7cca51.png"},279587:(e,t,n)=>{e.exports=n.p+"img/f68_11393ba2b52ac23a884f923672858aa3.png"},481265:(e,t,n)=>{e.exports=n.p+"img/f69_6a31bf9a0987d546a53d7e8e148d9fa3.png"},929761:(e,t,n)=>{e.exports=n.p+"img/f70_6a12b8c8cf306de335b3174c92c7d63d.png"},67156:(e,t,n)=>{e.exports=n.p+"img/f71_363e1241dbcac22f3bebce9bb5e03e85.png"},14427:(e,t,n)=>{e.exports=n.p+"img/f72_ae6ac1146134ea79656c595a1a2d0e8b.png"},118241:(e,t,n)=>{e.exports=n.p+"img/f73_c9b6d05e598e5adf69ceab85f5db96ac.png"},555948:(e,t,n)=>{e.exports=n.p+"img/f74_67c9ceb4623d37c005ae86e28e4e9fbe.png"},305193:(e,t,n)=>{e.exports=n.p+"img/f75_62cbd93e646a20f624123b595584f2a2.png"},585044:(e,t,n)=>{e.exports=n.p+"img/f76_6862123772ba72af8d1f307c0d2b4895.png"},56746:(e,t,n)=>{e.exports=n.p+"img/f77_78710dcf8b6d89f3951e7887f95408bf.png"},973675:(e,t,n)=>{e.exports=n.p+"img/f78_59e408dc54ae0bd33f3617f7ee9bb2e0.png"},263159:(e,t,n)=>{e.exports=n.p+"img/f79_6682dcc8dd4b1c197e7ec7b9b3deb601.png"},437160:(e,t,n)=>{e.exports=n.p+"img/f80_0d13bdc19570b4c3577062fd0a3a1428.png"},331456:(e,t,n)=>{e.exports=n.p+"img/f81_bfb32e248b9a30d62e32a1f7ea4e7e98.png"},958193:(e,t,n)=>{e.exports=n.p+"img/f82_286f2cdea929dc7b1565aad502aaf165.png"},68436:(e,t,n)=>{e.exports=n.p+"img/f83_4984ad9c5348e8717965f575ac7ea534.png"},15188:(e,t,n)=>{e.exports=n.p+"img/f84_4d4303666006c977553c896dd850fc1b.png"},335444:(e,t,n)=>{e.exports=n.p+"img/f85_10cbc8d1444126f654a032456a74a72c.png"},961218:(e,t,n)=>{e.exports=n.p+"img/f86_03d43f57ad876d0367274524fd27b4ec.png"},712535:(e,t,n)=>{e.exports=n.p+"img/f87_610b9a8f68249032da365af5a664fc41.png"},756277:(e,t,n)=>{e.exports=n.p+"img/f88_5ad6ef9e65165c4bb4c670ce875a5fb5.png"},111847:(e,t,n)=>{e.exports=n.p+"img/f89_e049c6b076ab9212a901406939d7274e.png"},83242:(e,t,n)=>{e.exports=n.p+"img/f90_88c16bdd2fd8228ad1ec89ce3f0cb118.png"},697168:(e,t,n)=>{e.exports=n.p+"img/f91_78d445d5baae7479cac968c11f6724dc.png"},906763:(e,t,n)=>{e.exports=n.p+"img/f92_34f845f9fa2a3667d8d747453f63ad68.png"},169685:(e,t,n)=>{e.exports=n.p+"img/f93_2f324509fe48d002f5a944b003cd180d.png"},234887:(e,t,n)=>{e.exports=n.p+"img/f94_c406ffa6170c14bcbe3158ab7879ce16.png"},424111:(e,t,n)=>{e.exports=n.p+"img/f95_7ce72143c371f981d394ab9b3391f5ea.png"},271972:(e,t,n)=>{e.exports=n.p+"img/f96_bc32095dc9dab040674f58592e10451b.png"},739920:(e,t,n)=>{e.exports=n.p+"img/f97_eedf5849b413d903c4cc72cca6ce0576.png"},694784:(e,t,n)=>{e.exports=n.p+"img/f98_8d47ec83349711222b6d9346049676f1.png"},760795:(e,t,n)=>{e.exports=n.p+"img/f99_d27a48329dde7e88d3d7cd348d745f91.png"},306769:(e,t,n)=>{e.exports=n.p+"img/favicon-error_ef91873fcda4eda22679f675ebf6ed24.png"},477238:(e,t,n)=>{e.exports=n.p+"img/favicon-error2_7ce1b67dbef23e87862b3c12b9b32676.png"},56216:(e,t,n)=>{e.exports=n.p+"img/favicon_94e99ab189284094867d2e1220e42e9f.png"},977152:(e,t,n)=>{e.exports=n.p+"img/qr-video-hq_c001ebd6ddb0ba5fc7de491dfb556024.png"},215767:(e,t,n)=>{e.exports=n.p+"img/qr-video_0c6ec69b054fdeb31cf3e5e10290fd8e.png"},326252:(e,t,n)=>{e.exports=n.p+"whatsapp-webclient-login-hq_0e0caf2391158ebc09fe32edd1022d03.mp4"},815109:(e,t,n)=>{e.exports=n.p+"whatsapp-webclient-login_c09223f0813e7c3adc16476cba2a5d0d.mp4"},465381:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={"landing-wrapper":"_1-4Rd",landingWrapper:"_1-4Rd","landing-wrapper-before":"vg9nq",landingWrapperBefore:"vg9nq","deprecated-electron":"_14yiH",deprecatedElectron:"_14yiH","landing-window":"_153VF",landingWindow:"_153VF","landing-main":"v_mws",landingMain:"v_mws","landing-header":"_3J26o",landingHeader:"_3J26o","landing-headerTitle":"e0z5v",landingHeaderTitle:"e0z5v","landing-header-upgradeCompleteText":"_1PEnt",landingHeaderUpgradeCompleteText:"_1PEnt","edge-fix":"sTQ-C",edgeFix:"sTQ-C","landing-icon":"_1qVm2",landingIcon:"_1qVm2","landing-logo":"_2edWd",landingLogo:"_2edWd","landing-title":"_1jAkd",landingTitle:"_1jAkd",headline:"_3BJgQ",listItem:"_1x0Qz",text:"_28IPF",hint:"_3tKX1",qr:"_2ytz1",toggle:"_1xFmQ"}},800158:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={container:"Zu0md",containerFull:"_2wJ6P",icon:"_2FjqD",containerCircleIconFull:"_1jy-1",name:"_3gkyZ",labelFilter:"E_3Ky",iconContainer:"yHoVW",drawerTitle:"_1xeSZ",circleIcon:"l_tuI"}},248651:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={action:"_1-SiY",wrapper:"_2XcXo",butterbar:"_22XJC",icon:"_384go",body:"_1Yy79",controls:"_3UDm1",controlsIcon:"_1K1wg",title:"_2z7gr",text:"_2BxMU",notification:"_2C_7j",update:"xx0PQ",computer:"f2_qc",phone:"_3C1U5",battery:"_1sNMG",notice:"_3izPF",noticeSmb:"_1d_P-",noticeSvgWrapper:"_2JUqz",fatalSvgWrapper:"afTH_",fatal:"cwVT9",nuxGreenSvgWrapper:"_3aqmZ",nuxGreen:"_3Olve",resumeProgress:"_2wsOz",nuxBlueSvgWrapper:"_2Abc7",nuxBlue:"_3tjOE",invalidPoll:"_3GW1A",webDesktopUpsell:"_3iFBn"}},703010:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={button:"_20C5O",plainWhite:"GObVX",primary:"_2Zdgs",secondary:"_1zOyO",solidWarning:"_3opZY",strongPrimary:"pNwLD",warning:"_1XvHd",warningSecondary:"_1__8F",itemFocused:"_2yKMT",disabled:"_3fyVm",nowrap:"_1gUOr",simplified:"_1RguK",strong:"SEZ8N"}},12783:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={noop:"tm2tP"}},352204:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={noop:"i0jNr"}},631680:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={avatar:"_3GlyB",avatarDefault:"_1lPgH",groupProfilePicturePlaceholderContainer:"_1z2oj",groupProfilePicture:"sordb",avatarImage:"_8hzr9",avatarImageNoTransition:"_2v41M",isLoaded:"M0JmA",avatarSquare:"_3eYBS",avatarSquircle:"_18q5X",avatarBorder:"_32GIw",avatarProfileRingBorder:"_-1LqN",avatarDefaultAnnouncementGroup:"_2zzR9",inviteModal:"_11T5Z",status_v3:"_1DSb6",statusV3:"_1DSb6",wrapper:"_36VU6",badge:"JUffF",chatList:"Vu6GJ",conversationHeader:"_1FnbI",badgeIcon:"_1D5Hn",polls:"_1dQ4a",pollsSender:"_--Og0",pollsReceiver:"mSMPU",detailButton:"dwbWf"}},270284:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={"-emoji-picker-width":"388px",emojiPickerWidth:"388px","-reaction-details-width":"375px",reactionDetailsWidth:"375px",container:"o--vV",reactionDetails:"_3HjyJ",reactionSendTray:"B_YVs",right:"wGJyi",picker:"_3nQGi",tooltip:"_3t1CR",items:"_1HnQz",nib:"_2hkxa",tooltipHighlight:"_156-d",inverse:"QLmve",colorPicker:"fe-ue",emoji:"_3IU7z",sticker:"_1166F",reactionPicker:"_2BB8j",inverseVertical:"_24No0",text:"_3h2j_",attachMenu:"_14ik1"}},750687:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={item:"_2qR8G",text:"_18oo2",hover:"_19zgN",action:"dJxPU",compact:"_3gcnK",icon:"_26nDl",emoji:"_17jhh",emojiGrid:"_34jUG",emojiPreview:"_3-ePY",ellipsify:"_2oldI",disabled:"_3BFHH",shortcut:"_1wMaz",checkmark:"_59Vky"}},641523:(e,t,n)=>{"use strict";n.r(t)},523437:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={wrapper:"_3Xwf5",icon:"_3I5Fs",textWrapper:"_162_t",error:"U_F60",warn:"_2jaWt"}},437151:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={verified:"_3vLho",psa:"_2A4wP",icon:"_1M6Ay",hasLabels:"_3q9s6",labels:"_3dulN",chatAssignmentIcon:"_1d2fW",chatAssignmentIconAssignedToOthers:"_3mlBJ",chatAssignmentIconAssignedToYou:"xJNQi"}},722074:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={progress:"_35Zb2"}},173176:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={video:"_3-soo",container:"_1hsvr",player:"_1WD62",poster:"kqpxs",hidden:"_2XlyB",overlay:"_1E40b",button:"_2wAIt",play:"_11Jja"}},803306:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={qrWrapper:"_1N3oL",text:"_2WuPw",qr:"_25pwu",headline:"_3-XoE",list:"_2A31C",listItem:"QtrYx",hint:"_3aF8K",tip:"_2jR6Q",codeCopy:"_3YgA3",qrcode:"_2UwZ_",codeLogo:"b77wc",idle:"n4LVt",qrButton:"_2znac",qrButtonIcon:"_1pFa_",groupInviteTip:"_3Egqg",icon:"_30yMe",desktopUpsellBanner:"_1ihxg"}},808561:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={"weight-light":"_7qtH8",weightLight:"_7qtH8","weight-normal":"_1lF7t",weightNormal:"_1lF7t","weight-medium":"_3EVTz",weightMedium:"_3EVTz","weight-semibold":"_3VDu5",weightSemibold:"_3VDu5","weight-bold":"_2I4o9",weightBold:"_2I4o9","size-8":"_2Le-W",size8:"_2Le-W","size-9":"_2lMoY",size9:"_2lMoY","size-10":"_3QN-O",size10:"_3QN-O","size-11":"_1uSon",size11:"_1uSon","size-12":"_1MfDb",size12:"_1MfDb","size-13":"_2xTZM",size13:"_2xTZM","size-14":"VWPRY",size14:"VWPRY","size-15":"_3SFxP",size15:"_3SFxP","size-16":"_1FXE6",size16:"_1FXE6","size-17":"_2LoZ-",size17:"_2LoZ-","size-18":"ioBp1",size18:"ioBp1","size-19":"oUgLo",size19:"oUgLo","size-20":"_1ioN3",size20:"_1ioN3","size-22":"Urfuj",size22:"Urfuj","size-24":"_3rp2W",size24:"_3rp2W","size-26":"_1651n",size26:"_1651n","size-28":"_1o3ni",size28:"_1o3ni","size-30":"_3jq2u",size30:"_3jq2u","size-32":"_1Zkh5",size32:"_1Zkh5","size-36":"_2gaDs",size36:"_2gaDs","size-48":"i_P7s",size48:"i_P7s","size-60":"_116zp",size60:"_116zp",title:"_3NUK1",large:"_3WYXy","section-title":"_2MNpf",sectionTitle:"_2MNpf","chat-info-section-title":"x2dsD",chatInfoSectionTitle:"x2dsD","section-title-larger":"_24CNZ",sectionTitleLarger:"_24CNZ",small:"TWzFz",muted:"_3Bg5b","muted-small":"_2gdKz",mutedSmall:"_2gdKz",plain:"_26jM1","popup-title":"wMe6l",popupTitle:"wMe6l","color-accent":"_35orJ",colorAccent:"_35orJ","color-danger":"_2Hpjf",colorDanger:"_2Hpjf","color-dark":"PoW1D",colorDark:"PoW1D","color-primary":"_2cf_G",colorPrimary:"_2cf_G","color-secondary":"AjtLy",colorSecondary:"AjtLy","color-muted":"_2P9Q7",colorMuted:"_2P9Q7","color-success":"_3Vwf8",colorSuccess:"_3Vwf8"}},430157:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={highRes:"_2UdhN",wrapper:"_3R6rC",large:"_3zyju",lowRes:"_2LodA",medium:"_3Ci02",xlarge:"_1xeoG",animation:"KPHJD",invisible:"_1gSQr",heartbeat:"_1jJBG"}},88137:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={image:"_3mSTX",default:"LacDz",icon:"_3TcVw",container:"_1JhMF",hasBorder:"_374fh",dimmed:"Qrclb",hasInnerBorder:"_1HLgI",hasLargeInnerBorder:"_2OuQU",square:"_1avFe",col:"_3UWjv",row:"_3nYfM"}},57681:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={spinner:"_3_EXz"}},906524:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={ul:"_1NDS0",inline:"_3JZr1"}},364071:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={inline:"_3toqL"}},720132:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={container:"_2uGbr"}},249959:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={container:"_1INL_",web:"_1UG2S",containerFixed:"_1iyey",graphic:"_26aja",logo:"_35GDA",dots:"_2pp-n",laptop:"_1JPfm",shimmering:"_1dEQH",shimmer:"_3vobx",initialLoad:"_2FX6G",didYouKnow:"WD35o",logout:"_3iu7m",organizing:"A_WMk",progress:"_30oB1",main:"_2dfCc",secondary:"_2e4Ei",warning:"QgIWN",showWarning:"_3dIM5",dot:"behLh",connecting:"_2VJL-",downloading:"ygjbp"}},431230:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={background:"_2c_rw",mainWrapper:"_5XBCY",logoutTitle:"_329-Z"}},274196:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={backdrop:"_2B4d4",popupContainer:"_3ev9-",popup:"_3J6wB",popupBody:"nne8e",popupTitle:"_1bpDE",backdropCover:"_1QH2G",showOverStatusV3:"_3LIC8",popupContents:"_2Nr6U",popupBox:"_2DOJ8",popupBoxLarge:"_220P7",popupFlex:"_2EOHJ",popupAuto:"_1PdSy",popupControls:"_2i3w0",popupFlexInvite:"_3cUTm",popupFlexInviteNew:"_36f5g",popupFlexUpgrade:"_1jalA",popupTower:"_2ctZG",popupTowerLarge:"_18pvs",popupGuide:"_1hMip",popupColumnButtons:"_1Nf9C",popupMultiline:"_37AQP",popupStatusV3ViewerList:"_3jLOW",popupPromote:"_3Kwj9",popupCommandPalette:"_2CV_t",popupQuickReplies:"_1uhDt",popupChatAssignment:"w6WfS",popupHistorySyncProgress:"iANXb",popupMessageEdit:"_20p96"}},430173:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={textTip:"_2Z6v5",divider:"_2Xgjp"}},346297:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={wrapper:"_1Fm4m",isQR:"tsBgS",isQr:"tsBgS",draggableHeader:"_3uq5k",isMain:"_1h2dM"}},54099:(e,t,n)=>{"use strict";n.r(t)},9686:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});const r={focusAnimation:"_2BW67",focusAnimationKeyframes:"k4bcw"}},680519:(e,t,n)=>{"use strict";function r(){return new Worker(n.p+"opus.2a8a0e3101d2b51e4632.worker.js")}n.r(t),n.d(t,{default:()=>r})},988703:(e,t,n)=>{"use strict";function r(){return new Worker(n.p+"WAWebWorker.a2eec9d34a48e171b258.worker.js")}n.r(t),n.d(t,{default:()=>r})},648791:(e,t,n)=>{"use strict";function r(){return new Worker(n.p+"milan.a2224bbdf13c22685263.worker.js")}n.r(t),n.d(t,{default:()=>r})},913959:(e,t,n)=>{"use strict";function r(){return new Worker(n.p+"WAWebRgbaToWebp.worker.247b6e7ed738757ebedc.worker.js")}n.r(t),n.d(t,{default:()=>r})},565708:(e,t,n)=>{"use strict";function r(){return new Worker(n.p+"WAWebWebpToRgba.worker.0d915335547c9b91ea19.worker.js")}n.r(t),n.d(t,{default:()=>r})},442329:()=>{}},e=>{"use strict";e.O(0,[6177],(()=>{return t=856562,e(e.s=t);var t}));e.O()}]);
//# sourceMappingURL=https://web.whatsapp.com/app.cbe2fde94befbde07514.js.map